Control logic and Stateflow application in MATLAB Simulink
Objective-
- 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
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.
Simulink Models-

Electricity source

Water Source
In above sources thresholds are set as per requirements.
Washing machine is set as per above control logic.
The loop will only go in one direction after it verified the previous conditions.
When the conditions are not met it will indicate through lamp in red light and also if the processes are not completed lamp will show red color.
We have created one variable in each process that are a,b,c,d , they will return value 1 if the processes are completed. otherwise it will return 0 value.
If the all processes are completed then it will indicate it with green color lamp.



2. Gear Transmission Simulink Model
In below model stateflows are generated as per the given conditions also the output value shows the result of how the blocks are changing according the speed input.
All the blocks are connected with each other in forward and return direction as per given conditions.
each stateflow block is guided with two conditions one is greater than and less than condition.

Results shown by below graohs are ther results where the speed was increased and deacreased during simulation.

Result and Conclusion-
All the objectives are completed successfully.