Week - 4
Aim:
1. To implement a control logic of a “washing machine” using Stateflow as per the 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.
Solution:
Model 1- The Control logic of a "Washing machine" using State flow.
Model :-

The blocks used in the model :-
- Slider Switch - To switch on and off the machine.
- Constant Block - For the Power and Water supply.
- Chart - The stateflow for the control logic
- Display - To display the output signals.
- Lamp - LED's used to show the output signals.
Given Data:-
The different states of washing machine:
- Soaking - 200 seconds (0-200)
- Washing - 100 seconds (200-300)
- Rinsing - 20 seconds (300-320)
- Drying - 50 seconds (320-370)
- Finished
The State flow of the Model:-

The model when the water supply switch is turned off:-

The different states of the washing machine :-
Soaking:

Washing:

Rinsing:

Drying:

Model 2- Simulink chart for the "Gear Shift" logic as per given conditions.
Model :-

Blocks used in this model :-
- Gauge - It acts as a speedometer of vehicle.
- Constant block - It is to multiply with the slider gain.
- Slider Gain - It acts as throttle to increase or decrease the speed.
- Chart - The control logic for the gear shifting.
- Display - To display the gear output.
Given Data :-
- 1st Gear : 0-15kmph
- 2nd Gear : 15-25kmph
- 3nd Gear : 25-40kmph
- 4th Gear : 40-60kmph
- 5th Gear : >60kmph
The Stateflow of the model :-

The gears shifts at different speeds :-
Gear 1:

Gear 2:

Gear 3:

Gear 4:

Gear 5:
