Week - 4
- Implement control logic of a “washing machine” using Stateflow as per given sequence:
- If the power supply is available, the system gets activated
- If the Water supply is not available, stop the process & indicate through LED
- Soaking time should be 200s followed by Washing time of 100s.
- Then rinsing happens for next 20s & dryer runs for 50s
After all the processes have completed turn on the finished LED
From the task given we have opened the simulink and later we used the commond chart to get state flow. The model is attached to below.

The condition for the washing machine is given as per the task which shown below.
From the symbol pane we have given input and output.

Inputs - Water and Power
Outputs - Soaking, Rinsing, Washing and drying.

For the paraameter in Water supply.

For the parameter in Finish.

We have give Stop time is 500.

From the 3condition we have shown below the LED will indicates.
Condition
Power_switch=0 and water=1
0 indicated off and 1 indicated on.

Condition
Power_switch=1 and water=0
0 indicated off and 1 indicated on.

Condition
Power_switch=1 and water=1
0 indicated off and 1 indicated on.

Conclusion:
The Simulation of the washing machine using State flow is done and the results is satisfactory.
---------------------------------------------------------------------------------------------------------------------------------------------
Task 2
Make a Simulink chart for the “Gear shift” logic as per below conditions:
Speed Range(kmph) Gear
0 to 15 1
16 to 25 2
26 to 40 3
41 to 60 4
Above 61 5
Give speed input while the simulation is running & display the gear number.
From the condition task we have changing gears as per the speed and in this we using slider gain we providing the input.
the model is attached as below.

and the conditions in the chart is given is

and the parameters output and input is

by the lamp will indicated the gear according to the speed.

from the slider we giving input as speed
The input is
0 to 15 1

16 to 25 2

26 to 40 3

41 to 60 4

Above 61 5

Conclusion: The gear shifts is satisfactory as per the given inputs.