Week - 4
1.
Aim :
- 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
Working Principle of a Washing machine :
A washing machine by spinning at 800-1600rpm helps soap and dirt with it to leave the surface of the cloth cia centrfugal force and into outlet pipes hence utilizing centrifugation to both clean and partially dry the clothes loaded in it. Thus the processes are electrically controlled, such as the drum,valves,pump,motor and heating. the valve opens again and the dirty water drains out of the drums. The pump works to help get rid of the water. The valve lets clean water in again into the drums. The four process are :
Soaking :
It is used to dip clothes in detergent water to remove dirty from the clothes. In this function customer need to select soak from a panel. Soak - This function is available with wash timmer,in 42 mins of washing 27 mins is soak and 15 min machine will wash the clothes.
Rinsing :
The dirty, soapy water is drained, then the washing machine is refilled and your clothes are "rewashed' in clean water. Spin: All the water is drained completely, then your clothes are spun very fast and excess water is removed thanks to centrifugal force.
Washing :
During the wash cycle, a larfe plastic agitator(green) turns around, moving your clothes through the water. When the wash is finished, the pump drains the water from the outer drum.
Dryer :
They work by pushing warm dry air through youur wet washing to extract moisture, then cooling the now humid air in a heat exchanger to condense the moisture, which is collected a tank or pumped down the drain. The air is reheated and the cycle repeats.
Control Logic Of a Washing Machine :
It checks for the extent of dirt and grease, the amount of a soap and water to add,direction of spin, and so on. The machine rebalances washing load to ensure correct spinning. Else, it reduces spinning speed if an imbalance is detected. Even distribution of washing load reduces spinning noise.

The 2 inputs are given for power and water supply. Once the inputs are given outputs are displayed by the flow charts as per given sequence. The system are observed for sometime then it is checked and the process is completed by green light as displayed.

2.
Aim:
To Make a Simulink chart for the “Gear shift” logic as per below conditions:
Speed Range(kmph) Gear
0 to 15 1
16 to 25 2
26 to 40 3
41 to 60 4
Above 61 5
Give speed input while the simulation is running & display the gear number.
Blocks Used :
1. Constant :
Constant values are added where.
2. Display :
A display block is used to display the final output of the function.
3. Stateflow chart :
A stateflow chart can be used as the action language to implement control logic.
4. Circular Guage :
The circular guage block displays the value of the connected signal on a guage face that you can customized to look like a guage in a real system.
Simulink Model :

Stateflow Chart :

Explanation :
1. The stateflow chart is having two inputs which are speed and the engine. The speed inputs which connected with a constant named slider gain.
20. Giving condition as speed==0 this will execute when constant value is 0 that is when vehicle is turned off.
3.We have defined 5 states namely first gear, second gear, third gear, fourth gear and fifth gear.
4. Now to shift from one state to another we have defined the conditions of the speeds as mentioned above.
5. We have also defined the value inside the state which represents that when the particullar state is going On it will display value that is defined. This will helps us to see that which gear is operating at particular speed.
6. Transition condition for gear shifty is decided as
speed>15 shift to G=2
speed>25 shift to G=3
speed>40 shift to G=4
speed>60 shift to G=5 ( when speed increases from 0-60 kmph)
Similarly in reverse direction,
speed<60 shift to G=4
speed<40 shift to G=3
speed<25 shift to G=2
speed<15 shift to G=1 (when sspeed is decreasing from 60-0 kmph)
Conclusion :
Thus all objectives were acheived successfully.