Week - 4
Aim:- To implement Control logic of a washing machine using stateflow in simulink.
Objectives :-
1.To implement the control logic of a washing machine using stateflow as per given sequnce:
a) If the power supply is available ,the system gets activated.
b)If the water supply is not available stop the process & indicates through LED.
c)soaking time should be 200s followed by washing time of 100s.
d)Then rinsing happens for next 20s & dryer runs for 50s.
After all the processes have completed turn on the finished LED.
Model:-
The file which contains the model is attached with this report.
Parameters:-
1) value '1'= there is input
2) value '0'= there is no input
Conditions :-
1.when lamp is green = task in progress
2.when lamp is red = the task is end.
Chart Diagram:

Similation time parameters:-
We used 430s so that it can cover the whole cycle and sufficient time to store and solve the parameters .

Output:-
There are two conditions asked to solve in the question.
A) When water supply is off.
We should Not provide water supply and check for output.
From the above diagram, we can see that indicator of water is showing red i.e. when there is no water supply the process is terminated and LED. indicator is used to indicate that state.
B) When Water Supply is ON.
Now we are Providing the water supply and check the output.
As we can observed from the above fig all the states have been executed and indicating the process completion indicator (named as cycle ) showing Green.
Conclusion:
The simulation of the washing machine using state flow is done and the result is satisfactory.
Q2
Aim:- To Make a simulink chart for the Gear Shift logic.
Objective:- making the simulink chart for the below parameters.
Speed range(kmph) Gear
0 To 15 1
16 To 25 2
26 To 40 3
41 To 60 4
<60 5
Model:- The File which contatins the model of Gear Shift is attached with this report.

Above fig shows the block Diagram of automatic Gear shift logics.
Chart Diagram:-

Simulation parameter:-
Here we gave time as 'inf' for our simulation should run until we stop it.

Input:-
We use gain to provide input to the chart.

here i am changing my speed values from 0 to 100 using slider gain during the simulation.
OUTPUT:-
The output produced is recorded when its displaying the each gear.
Gear_1
Speed range is 0 to 15 kmph
input speed is 10kmph
color Green

Gear_2
Speed range is 16 To 25 kmph.
Input Speed 20kmph.
Color Blue.

Gear_3
Speed Range 26 To 40 kmph.
Input speed 30kmph
color is yellow

Gear_4
Speed range 41 To 60 kmph.
input speed is 50kmph.
color is orange.

Gear _5
Speed range above 60 kmph.
input speed 80 kmph.
color is Red.

Conclusion :
Created a state Flow for Gear Shift using the simulink and the results are satisfactory.