Week - 4
- 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.
Answer:
To create control logic for washing machine,
use Chart block and create different states for washing machine.
States used:
- Power Supply
- Water Supply
- Soaking
- Washing Clothes
- Rinsing
- Dryer
- Exit

Simulink Environment :

When water supply is off:

2) 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 :
Answer:
States:
car moving/ stop condition
gear 1 upto gear 5 condition

Simulink blocks:

In above model, input speed is 46, which satisfy the 4th gear condition.
speed >41 then shift 5th gear.
here, in fig.
gear display shows 4 no., which means input condition is satisfyed.
Conclusion :
In this 4th week challenge, i have learnt how to use control logic and state flow in practical examples.
Simulate the models by changing input variables and check the obtained results for better understanding.