Week - 4
Q1: Implement the 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 the next 20s & dryer runs for 50s
- After all the processes have been completed turn on the finished LED
Answer:
Description:
A washing machine is an automated electro-mechanical device used for cleaning clothes. It can execute various functionalities such as soaking, washing, rinsing, drying etc. These tasks are mainly based on the centrifugation principle. All the cleaning processes are electrically controlled with the help of the motor, valves, drum, heater etc.

State flow:
With the help of State-flow, we can have a systematic solution for any sequential problem statement. An algorithm is the key component of such a software program. With this case study, we understood to implement the algorithm by using Simulink Stateflow. The complete model and chart of various washing machine steps with expected delays are built as below.
Final model after simulation:



Here, there are two inputs given:
1. Power supply
2. Water supply
In the simulation, we can observe the completion of each step after a given delay. It is represented with a display of bulbs which turns from Red to Green once that particular step completes.
Question2: Make a Simulink chart for the “Gear shift” logic as per the 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:
Description:
Manual transmission of vehicle gear system includes axial movement of the shaft. the shaft is ensured to be in one position after each gear change by two helical springs.


Conclusion:
With the help of Stateflow, one can build the logic and verify it with sequence flow. Similarly above two systems and their Stateflow are simulated to verify the functionality.