Simulink Model of Washing Machine & Gear Shifting
Week 4 Challenge in Simulink
AIM:
- Create a SIMULINK circuits layout to control logic of a “washing machine” using Stateflow command.
- Create a SIMULINK circuit layout to display 'Gear shift number' with respect to the speed range.
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
2. Make a Simulink chart for the “Gear shift” logic as per below conditions and display speed input while the simulation is run time & display the gear shift numbers.
| Speed Range(kmph) | Gear |
| 0-15 | 1 |
| 16-25 | 2 |
| 26-40 | 3 |
| 41-60 | 4 |
| Above 61 | 5 |
PROCEDURE:
(1) Washing machine:
Steps:
(i) To run the given sequence operation of the washing machine, we need to create a Stateflow chart to perform the operation with respect to time.
(ii) As per the given condition, 'If the power supply is available, the system gets activated'. To start the machine, we need to provide an input signal using a constant block with value as '1' defines the ON state and '0' defines the OFF state.
(iii) And for the water supply also, we need to provide a constant block to tell the circuit about its state.
(iv) To perform all the operations, we need to assign the delay after each stage using 'after' logic.
(v) A lamp block is added to display all the operation and each colour is assigned to each individual state. By varying the simulation time, we can check the LED colour.
(vi) A display block is attached at the output to show the time step.
(vii) Also, by changing the value of constant for power and water supply we check the logic by the change of the LED signal lamp.
(viii) The simulation run time for this logic is 500.
Block used:
(i) Constant:

(ii) Chart:

(iii) Scope:

(iv) Lamp:

Simulink chart layout:
(i) The flow chart for the washing machine sequence:

fig(i). Flow chart logic for washing machine operations in sequence
(ii) The main Simulink circuit layout:

fig.(ii) Simulink circuit layout
Operation Stages:

fig.(iii) Water Supply ON indicator

fig.(iv) Soaking operation indicator

fig.(v) Washing operation indicator

fig.(vi) Rinsing operation indicator

fig.(vii) Drying operation indicator

fig.(viii) End operation indicator
Results:

fig(xi). The time step of washing machine operations
(2) Gear shifting:
Steps:
(i) A chart block is created to perform the gear shifting by using the logic of 'greater than equal to' and 'less than equal to', so that we display the gear shift number as per the speed on the speedometer.
(ii) A logic is created for each stage as per the given speed range. A constant block is provided to ON the engine and a display block to show the present gear number.
(iii) A slider block is used as a speedometer linked to a constant block to assign the values of speed.
(iv) By changing the speed, we can check the gear shift number on the display block. Also, lamp blocks are linked at each stage of the gear shift to show the gear position w.r.t the speed given.
(v) The simulation run time for this logic is 80.
Block used:
(i) Constant:

(ii) Chart:

(iii) Display:

(iv) Slider:

(v) Lamp:

Simulink chart layout:
(i) The flow chart for the gear shift logic:

fig.(x) Flow chart logic for gear shifting
(ii) The main Simulink circuit layout:

fig.(xi) Simulink circuit layout for gear shifting
Gear Shifting Stages:
The below figures represents the gear shifting with the display of the gear number w.r.t. to speed with each individual lamp turning ON.

fig.(xii) Gear shift 1 indicator

fig.(xiii) Gear shift 2 indicator

fig.(xiv) Gear shift 3 indicator

fig.(xv) Gear shift 4 indicator

fig.(xvi) Gear shift 5 indicator
CONCLUSION: Successfully create the Simulink block diagram to run the simulation of the washing machine using the given sequence and gear shift with the display of the gear number with varying speed limits using LED lamps.