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:
To implement the control logic of the washing machine using state flow
Logics are to be applied to implemt the control logic are shown in the below figures which discribes the each condition of water supply, soaking, washing time, soakming and etc are implemted.
- 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

Each block represents the transtion of the next state for the given condition.
From the above figure, Inputs are power supply and the water supply and the outputs are Soak, washing, rising, dryer are the outputs.
STEP 1
When the power supply is above zero then the process continuous or else stop the process.
STEP 2
If power supply is on, check for water supply. If water is sufficient, then proceed to next state or else teriminate the process to OFF.
STEP 3
If water supply is sufficient, the next state will be saok that with run for 200 secs and proceed to next state washing and followed by rising and dryer.
The following outputs are shown in scope results.


The following model is uploaded in this page
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:
To model gear shift using state flow, the following are required,
1. input (speed)
2. output(display)
3. gain slider
4. stateflow block
5. junction block.
The following model gives the exact gear shift logic as per following conditions




