Week - 4
1. State flow model of washing machine is shown below

Here we can see there are seven state block for operating the washing machine they are
- OFF state
- ON state
- Soaking
- Washing
- Rinsing
- Drying
- Process copleted
the each state block is compiled after meeting up the required condition mentioned on the arrow mark shown
The simulink model for the washing machine looks like this.

Here we can see the Power supply and Water Supply is connected as input to the Washing Machine stateflow chart
A display block is connected for every output state to observe that each state is executed or not
A Lamp is inserted to indicate the process is completed or not the Green colour indicates that the process is completed and Red colour indicates not completed
At the input side i have connected two switches one for the power supply and the other for water inlet. Here both switch is turned On and we can see the washing machine as completed its process and the lamp is showing green
The output of this model is shown below

Here the power supply is given to the washing machine but the water inlet is turned OFF so the process as been stoped and the Lamp appears as red colour
Now in the next condition

here the power supply is turned OFF but there is water supply hence the lamp is showing green but since there is no power supply the washing machine is in off state and the lamp is showing RED in the display also we can see that it is showing 0 since there is no process going on.
2. Simulink model for Gear Shift
Here is the representation of the gear shift model

The blocks used in this model are
- Slider used as an accelerator pedal
- A chart block consisting of gear shift condisions
- Display
- Lamp to indicate a gear position
Here is the representation of the stateflow chart for the gear system

In this the first state is to check for Engine is ON or OFF and after this depending on the speed the gear must change i.e
- 0 to 15 is first gear
- 16 to 25 is second gear
- 26 to 40 is third gear
- 41 to 60 is fourth gear
- above 61 it is fifth gear
The variables are decleared using symbol pane block.
Here are the output result of the gear shift

here the speed is between 0 to 15 so the FIRST lamp is ON

here the speed is between 16 to 25 so the SECOND lamp is ON

here the speed is between 26 to 40 so the THIRD lamp is ON

here the speed is between 41 to 60 so the FOURTH lamp is ON

here the speed is above 61 so FIFTH lamp is ON