Week - 4
AIM:
1. To Implement control logic of a washing machine using stateflow in simulink.
2. To make a simulink chart for the gear shift logic.
OBJECTIVE:
1.To implement the control logic of a washing machine using stateflow as per given sequence:
a.If the power supply is available, the system gets activated.
b.If the water supply is not available, stop the process and indicate through LED.
c.Soaking time should be 200s followed by washing time of 100s
d.Then rinsing happens for next 20s and dryer runs for 50s
After all the processes have completed turn on the finished LED
SIMULINK MODEL:

State flow model:

Parameters in it:

Simulation time parameters:

Here from the simulink model we use state flow model to implement control logic of a washing machine. And in the simulink we add 2 constant blocks and 6 display blocks. From the model value '1' means there is input and value '0' means there is no input. The parameters in the stateflow are water, soak, washing, rinsing, dryer, cycle as the outputs. And the water supply and power supply as the inputs of the chart. Simulation time parameters here used is 430 sec so that it can cover the whole cycle and sufficient time to store and solve the parameters.
Condition 1:
When water supply is off.

From the above diagram, we can see that indicator of water is showing '0'. When there is no water supply the process is terminated.
Condition 2:
When water supply is on.

From the above diagram, All the states have been executed and indicating the process completion display showing the value '1'.
OBJECTIVE:
2.Making a simulink 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
SIMULINK MODEL:

State flow chart:

Parameters in it:

Simulation time parameters:

Here from the above simulink model, it has a constant block, slider gain block and a display block. In the stateflow model the logic control of the gear shift is shown. And it has 2 variables they are, speed is the input value and gear is the output value. And in the simulation time parameter we gave as 'inf' for our simulation should run until we stop it.
OUTPUT:
Gear 1:
Speed range 0 to 12kmph
input speed:10kmph
Display:1

Gear 2:
Speed range:26 to 40kmph
Input speed:20kmph
Display:2

Gear 3:
Speed range:26 to 40kmph
Input speed:30kmph
Display:3

Gear 4:
Speed range:41 to 60kmph
Input speed:50kmph
Display:4

Gear 5:
Speed range:above 60kmph
Input speed:70
Display:5

CONCLUSION:
Completted successfully as per the aim.