Week - 4
- 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
Ans:
The below diagram shows the model of a "washing machine using stateflaow"

We can clearly see that once the operation of a washing machine is over, a green LED glowed.
The above figure also contains the chart which is inside the model;

In this above figure, we can clearly see the chart which is impemented for the operation of a washing machine.
In this stateflow, selection of input and output parameters are also very important, which was achieved by using "symbols pane"

here in this figure, the symbols pane chart shows us the input and output parameters of the stateflow.
2. 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.
Ans:
The below figure shows us the simulink model of "gear shift system"

In the above picture we can clearly see the simulink model of a gear shift system,
Blocks used:
1-constant
2-slider gain
3-chart
4-diaplay
The model also includes the stateflow which is as shown in the below fgure.

Here in this above figure, we could clearly see that how he stateflow logic is implemented.
and finally the symbols pane, input and output parameters are selected.

here in this figure, the symbols pane chart shows us the input and output parameters of the stateflow.