Week - 4
https://drive.google.com/drive/folders/1YT_DjcMD1AUgA9pdvo_jFSVmO987f59y?usp=sharing
Week-4
Question 1:
- 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
Aim:
- To implement control logic of a Washing Machine using stateflow as per given sequence
- Create the model and opertate the model system logic in Simulink and display the output by Lamp indicator
Procedure:
Stateflow provides a graphical language that includes state transition diagrams, flow charts and truth tables. With the use of stateflow to enumerate Matlab algorithms and Simulink model react to input signals, events and time-based conditions.
Here the model system logic of washing machine stateflow has been done.
Step 1: Create a chart with and enter the given input conditions.
- 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
Fig.4.1.1
Step 2: Go to the Symbols pane and assign the input and output variables.
Step 3: Give the input values for turning on or off for the power and water supply.
Step 4: Use display and Lamp Indicator to display output results.

Fig.4.1.2

Fig.4.1.3

Fig.4.1.4
Conclusion:
Hence the control logic model system of Washing Machine is implemented using stateflow.
Question 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.
Aim:
- To make a Simulink chart for the Gear Shift logic as per the given condition.
- Give the speed input while the simulation is running and accordingly display the gear number.
Procedure:
Step 1: Gear shifting logic has been created

Fig.4.2.1
Step 2: Go to the Symbols pane and assign the input and output variables.
Step 3: Vary the slider gain block and observe the gear position in the display.
When key=0 and gear position=0

Fig.4.2.2
When speedometer is set at 40 kmph.

Fig4.2.3
When Key=1, speedometer= 40kmph and gear position=3

Fig.4.2.4
Conclusion:
Hence the gear shift logic for given speed input while the simulation is running & display the gear number.