Week - 4
Aim- Implement the control logic of a “washing machine” using Stateflow as per the given sequence:
- If the power supply is available, the system gets activated
- If the Water supply is not available, stop the process & indicate through the LED.
- Soaking time should be 200s followed by Washing time of 100s.
- Then rinsing happens for the next 20s & dryer runs for 50s
After all the processes have been completed turn on the finished LED.
Logic - If the power or water supply is not available the washing machine will stop and indicate through LED otherwise the process will be completed.
Stateflow diagram
there are two inputs, power and water, and 6 outputs.
Model
1. if both supplies are available

2. if one or more is not available

Output Explanation
if the supplies are available the process will complete and a green LED will indicate the process.
and if the supply is not available last LED will be turned red and the machine will stop.
2. Aim -
Make a Simulink chart for the “Gear shift” logic as per the 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.
Stateflow Diagram

Model

Explanation
for the given conditions a chart is prepared to control the speed b using gear
to provide the speed at the run time slider is used and as the shown in figure speed is set by using the slider at 50KMph the display block shows the gear number 4.