Week - 4
Implement control logic of a “washing machine” using Stateflow as per given sequence:
| sl no | various state | time in second | State of washing Machine |
| 1 | power on | -- | not on |
| 2 | water on | -- | ON |
| 3 | Soaking time | 200 | ON |
| 4 | Washing time | 100 | ON |
| 5 | rinsing | 20 | ON |
| 6 | drying | 50 | ON |
Aim:-To simulate the working of the washing machine
process :-To simulate these things below blocks are requires
- logic state for building logic
- constant for input
- scope to see output
- lamp to see various output
now in this case the input is given by constant for both of power supply and water supply
as per the given question that the logic has been written and is shown below
For output, the scope is given and is given that there are a lot of states were there and each state was seen in a different state.

Fig 1:model of washing machine

Fig2:logic of model

Fig3:output of washing machine
in output, it can be seen that various states are in the y-axis and each will show an state.
Output:-
- model is simulated in Simulink
- and various operating states of washing machine is known and analised.Make a Simulink chart for the “Gear shift” logic as per the below conditions:
Speed Range(kmph) Gear
0to 15 1
16 to 25 2
26 to 40 3
41 to 60 4
Above 61 5
here condition given here is speed depends so the entire system can be speed dependent system.
so to simulate systems we want these blocks
- the chart to simulate the logic
- constant for input
- display to seen
- lamp to visualize the result
- to see the input as a gauge is placed.
The below process to be followed
- open Simulink
- add chart
- as per the given condition gave the condition
- gave the arrow marks as per the given condition
- simulate the various conditions for the output and comment on the result.
below are the figure

Fig4: entire model

Fig 5:chart view

Fig6:1 gear

Fig7:2 gear

Fig8:gear 3

Fig 9:4 gear

Fig 10:5 gear
Conclusion
- The above example is simulated using Simulink
- Change of gear with respect to the speed can be seen in the above case
- gear shifting mechanism is understood