Week - 4
Q 1) Implement control logic of a “washing machine” using Stateflow as per given sequence:
ANS :
stateflow dia:

washing machine block dia:

Q 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
ANS :
stateflow dia:

gear shift block dia :

report:
what is stateflow :
Stateflow provides a graphical language that includes state transition diagrams, flow charts, state transition tables, and truth tables. You can use Stateflow to describe how MATLAB algorithms and Simulink models react to input signals, events, and time-based conditions.
what is control logic :
Control logic is the part of a controller that defines how a reactive system responds to events or conditional changes. Applications for control logic include: Supervising how to switch between different modes of operation. Scheduling a sequence of tasks or steps for a system.
1) for washing machine :
-If the power supply is available, the system gets activated , If the Water supply is not available, stop the process & indicate through LED :

- if both water and power supply is not available :

- Soaking time should be 200s followed by Washing time of 100s Then rinsing happens for next 20s & dryer runs for 50s:

2) for gear shigting :
- Give speed input while the simulation is running & display the gear number.
(i) at speed of 10:

(ii) at speed of 22:

(iii) at speed of 32:

(iv) at speed of 45:

(v) at speed above 61:
