Week - 4
AIM:
To Implement control logic of a "Washing Machine" using StateFlow and to make a Simulink chart for the "Gear Shift" logic.
OBJECTIVE:
- To Implement control logic of a "Washing Machine' using Stateflow as per given sequence.
- If the power supply is available the system gets activated.
- If the water supply is not available, stop the process & indicate through LED.
- Soaking time should be 200s followed by Washing time of 100s.
- Then rinsing happens for next 20s & dryer runs for 50s.
After all the processes have completed turn on the finished LED
WORKING OF WASHING MACHINE:

A washing machine (laundry machine, clothes washer, or washer) is a home appliance used to wash laundry. The term is mostly applied to machines that use water as opposed to dry cleaning or ultrasonic cleaners. The user adds laundry detergent, which is sold in liquid or powder form, to wash.
All the important parts of the clothes washer are electrically controlled, including the inner drum, the valves, the pump, and the heating element.
The programmer is like the conductor of an orchestra, switching these things on and off in a sensible sequence that goes something like this:
- You put your clothes in the machine and detergent either in the machine itself or in a tray up above.
- You set the program you want and switch on the power.
- The programmer opens the water valves so hot and cold water enters the machine and fill up the outer and inner drums. The water usually enters at the top and trickles down through the detergent tray, washing any soap there into the machine.
- The programmer switches off the water valves.
- The thermostat measures the temperature of the incoming water. If it's too cold, the programmer switches on the heating element. This works just like an electric kettle or water boiler.
- When the water is hot enough, the programmer makes the inner dum rotate back and forth, sloshing the clothes through the soapy water.
- The detergent pulls the dirt from your clothes and traps it in the water.
- The programmer opens the valves so the water drains from both drums. Then it switches on the pump to help empty the water away.
- The programmer opens the water valves again so clean water enters into the drum.
- The programmer makes the inner drum rotateback and forth so the clean water rinses the clothes. It empties both drums and repeats this process several times to get rid of all the soap.
- When the clothes are rinsed, the programmer makes the inner drum rotate at really high speed. The clothes are flung against the outside edge of the inner drum, but the water they contain is small enough to pass through the drums tiny holes into the outer drum. Spinning gets your clothes dry using the same idea as a centrifuge.
- The pump removes any remaining water from the outer drum and the wash cycle comes to an end.
STEPS USED IN CONTROL LOGIC OF WASHING MACHINE:
- The input signals are inputted through the switches, then it is picked up by the connected LEDs. The LEDs are red when there is no signal and green when a signal passes through them.
- Initially the system is off.
- To create this control system in simulink insert the chart and create the logic system using stateflow. The Stateflow execute the flow of inputs if the condition is accept.
- In this control logic the input power is applied to ON the washing and the power supply is flow in other system. The conditions are applied to move other sequence of operation in stateflow.
- Water supply is execute when power is ON, So entry and exit are assigned as value pf 0 to 1. While the condition is not satisfied water supply stops and it will come back to its constant state.
- This process is applied for each flow and time of working in each operatios are initiate by sec that are given in question.
- StateFlow chart of "Washing Machine" are created and given below:

- Now assigned the input values of steadyflow and sequence of operation is initiate to identify the working division. Constant block is created to give an input power value of system.
- And other constant block is created for input of water supply and value as 1 to )N water and to run washing sequence.
- Display block is inserted with each sequence to display the results of operations.
- Lamp block is used to indicates wheather the operations are "ON" or "OFF" in different conditions.
RESULTS:
Simulink model are created and inputs are generated to power supply and water supply
- If the power supply and water supply switches are OFF the output value of all operations become 0 because their is no inputs are generated and conditions are not satisfied.
- Lamp is in red color due to OFF of operation system. That are shown below:

- In this state only power supply is ON and water supply remains OFF. The power are generated and that indicates as in display value 1 lamp is in green light. But the water supply is 0 so other operations are not proceed that value as 0 and lamp is in red light.

- Now both the switches are ON. Power are generated from input and the operation starts, water supply also done by initiate the value of 1.
- Sequence of operation in stateflow starts when the condition is getting satiefied. Water supply is generated and the other operations are followed by duration of time that we given in stateflow.
- Each operations are runned and results are obtained by display block. Lamp is "ON" and it indicates green color as results.

CONTROL LOGIC OF GEAR-SHIFT:
THEORY:
A manual transmission is a multi-speed transmission where gear changes require the driver to select the gears by manually operating a gear stick and clutch. Early automobiles used sliding mesh manual transmissions with up to three forward gear ratios. Since the 1950s, constant mesh manual transmissions have become increasingly commonplave and the number of forward ratios has increased to 5-sped and 6-speed manual transmissions for current vehicles. The alternative to a manual transmissions is the automatic transmissions; common types of automatic transmissions are the hydraulic automatic transmission, automated manual transmission, dual-clutch transmission, and the continuously variable transmission.
SIMULINK MODEL:
- In this model inputs are generated to slider gain which is connected to constant block the value is 1. The gear shift is acted by conditions in stateflow. chart is created and conditions are applied same as washing machine stateflow.
- The gear is shifted by variations in speed. An speed range are created in chart as several gear system and conditions are applied.
- Display block is used to obtain the results. That displays which gear is running in particular range of speed.
- Lamp is connected to indicate the 5 different colors which is assigned for each gear. The model is shown below:


Speed range and the gear variation are given below:
Speed Range(kmph) Gear
0 to 15 1
16 to 25 2
26 to 40 3
41 to 60 4
Above 61 5
The speed variation is given by the slider gain block. Block parameters shown below:

RESULTS:
- Neutral Gear:
When speed range is 0 the gear is in neutral and output displayes 0 thus it indicates red light lamp.

- Gear- 1:
When speed range is 0 to 15 the gear 1 is proceed and the output value of display gives 1.

- Gear- 2:
When speed range is 16 to 25 the gear 2 is proceed and output value display gives 1 in front of gear 2.

- Gear- 3:
When speed range is 26 to 40 the gear 3 is proceed and output value display gives 1 in front of gear 3.

- Gear- 4:
When speed range is 41 to 60 the gear 4 is proceed and output value display gives 1 in front of gear 4.

- Gear- 5:
When speed range is above 60 the gear 5 is proceed and output value display gives 1 in front of gear 5.

CONCLUSION:
All the process is completed based on the given conditions.