State flow Modelling For Gear Switch Indicator and Washing Machine
Aim -
- To model a control logic for Washing Machine Using Simulink.
- To model a Gear Shift Indicator for the following Speed -
- Speed Range(kmph) Gear
0 to 15 1
16 to 25 2
26 to 40 3
41 to 60 4
Above 61 5
Software - Matlab Simulink 2019R
Model -
#1.
Block's used -
- Constant
- Chart
- Lamp
- Terminator
- Toggle Switch
Conditions -
If the power is on the machine activates.
If the water supply is on the Machine starts working otherwise the loop restarts.
The Soaking time is 200 sec followed by Washing Time of 100 sec.
Rinsing time of 20 sec followed by Drying time of 50 sec.
Logic Explanation -
Water and power blocks are represented by constant blocks. They are connected with a Toggle switch to change the values. The Water and power block work as input for chart. The chart block contains the logic for Washing machine. If both the Input Satisfies the conditions then the logic gets activated.
If all the conditions are satisfied the cycle gets completed. Each Stage in the washing cycle is provided with entry and exit values which can be used to control the Lamp on display.
Model of Washing Machine Using Simulink -

Power and Water OFF -

Power - ON, Water - OFF
Power And Water - ON, Soaking

Washing -

Rinsing -

Drying -

#2.
Gear Shift Indicator -
In this model, I have tried to Simulate a gear shift indicator using the following blocks and Stateflow process -
- Constant
- Slider Gain
- Stateflow Chart
- Custom Gauge
- terminator block
Model Logic Conditions -
Speed Range(kmph) Gear
0 to 15 1
16 to 25 2
26 to 40 3
41 to 60 4
Above 61 5
Model Logic -

1st Gear - speed is 10 km/hr

2nd Gear - speed is 25 km/hr and increasing.

3rd Gear - speed is 35 km/hr and increasing

4th Gear - speed is 50 km/hr and increasing

5th Gear - speed is more than 60km/hr

Explanation -
The speed of the gauge is increased using slider gain block. which is used as an input in the state flow logic chart.
The display of gear change is dependent on the speed of the engine. As the speed crosses a certain threshold the gear shifts automatically.