Week - 4
1. To implement the control logic of a washing machine using stateflow in simulink.
a. If the power supply is available, the system gets activated.
b. If the water supply is not available,stop the process & indicate through LED.
c. Soaking time should be 200s followed by washing time of 100s.
d. Then rinsing happen for next 20s & dryer runs for 30 sec.
Simulink model :

Blocks used in the model are :
switch, constant, chart, display, and lamp.
Parameters :
1. Value 1 means there is input of 1.
2. Value o means ther is no input.
Conditions :
1. When lamp shows green then the task is in progress.
2. When the lamp shows red the task ends.
Chart blocks :

Stage 1 : when the water supply is off.

Parameters :
1. Value 1 means there is input of 1.
2. Value o means ther is no input.
Conditions :
1. When lamp shows green then the task is in progress.
2. When the lamp shows red the task ends.
From the above model, the indicator of the water is shown red. When there is no water supply the process is terminated and LED indicator is used ti indicate the state.
Stage 2 : When water supply is on.

Parameters :
1. Value 1 means there is input of 1.
2. Value o means ther is no input.
Conditions :
1. When lamp shows green then the task is in progress.
2. When the lamp shows red the task ends.
In the above model the water supply is on, then all states of model has executed and the process completes indicator cycle. First two stages are shown as green signal.
Link 1 :
https://drive.google.com/file/d/1tDRFUI9ITncVRzLxaXdVI3-IQBZi5KqN/view?usp=sharing
2. To make the simukink chart for the gear shift for the below mentioned parameters :
[Speed range(kmph)] [gear]
0 to 15 1
16 to 25 2
26 to 40 3
41 to 60 4
above 61 5
Block diagram :

The above simulink model represents the gera shifts.
Blocks used in the model are :
Constant, slider gain, chart, display and lamp.
Lamp colours according to speed range :

Chart diagram :

Simulation time parameters :

Slider gain as input :

Output of the model gear shift :
The output produced is recorded in the display for each gear shift.
Gear 1 :
Speed range : 0 to 15 kmph.
Input speed : 10 kmph.
Colour : Green.

Gear 2 :
Speed range : 16 to 25 kmph.
Input speed : 20 kmph.
Colour : Blue.

Gear 3 :
Speed range : 26 to 40.
Input speed : 30 kmph.
Colour : Red.

Gear 4 :
Speed range : 41 to 60 kmph.
Input speed : 50 kmph.
Colour : Yellow.

Gear 5 :
Speed range : Above 60 kmph.
Input speed : 80 kmph.
Colour : Voilet.

These are the above gear shifts described with speed range and input speed and colour.
Link 2 :
https://drive.google.com/file/d/1r5vQ3eze5ME2DFB--zGA2Ro8AoQsMvRE/view?usp=sharing