Week - 4
TASK-1
AIM:-
Implement control logic of a “washing machine” using Stateflow in simulink.
OBJECTIVE:-
- 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.
SIMULINK MODEL:-

CHART DIAGRAM:-

PARAMETERS:-

we have given soak, wash, rinse, dry and finish as output of the chart.
We have given Power and Watersupply as Input of the chart.
Simultanious time parameters:
we used 400 sec 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 qduestion.
Condition-1: when Water Supply is OFF.
We should not provide water supply and check for output.
Implementing control logic of a "washing machine" using Stateflow

Parameters: Conditions:
1) Value '1' means there is input 1) When Lamp shows Green, The task is In Progress
2) Value '0' means there is no output 2) When Lamp shows Red, The task Ends.
From the above diagram, We can see that indicator of water is showing Red is showing Red i.e., When there is no water supply the process is terminated and LED indicator is used to indicate that state.
Condition-2: when Water supply is ON.
Now we are providing the water supply and check the output.
Implementing control logic of a "washing machine" using Stateflow

Parameters: Conditions:
1) Value '1' means there is input 1) When Lamp shows Green, The task is In Progress
2) Value '0' means there is no output 2) When Lamp shows Red, The task Ends.
As we can observe from teh above figure, All the states have been executed and indicating the Process completion indicator (named as finish) showing Green.
CONCLUSION:
- The simulation of the washing machine using state flow is done and the result is satisfactory.
TASK-2
AIM:-
To make a simulink for the "Gear Shift" logic.
OBJECTIVE:-
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.
SIMULINK MODEL:-

CHART DIAGRAM:-

PARAMETERS:-

Speed and E is the input
powerswitch and gears are output
SLIDER GAIN INPUT:-

Slider gain use to change the speed as per the given conditions.
OUTPUT:-
Gear-1
Speed give by slider = 0
Speed range = 0 to 15
Colour Green for power switch
Colour Sky Blue for Gear 1

Gear-2
Speed give by slider = 22
Speed range = 16 to 25
Colour Blue for Gear 2

Gear-3
Speed give by slider = 32
Speed range = 26 to 40
Colour Orange for Gear 3

Gear-4
Speed give by slider = 58
Speed range = 41 to 60
Colour Pink for Gear 4

Gear-5
Speed give by slider = 66
Speed range = more than 60
Colour Red for Gear 5

CONCLUSION:
- The simulation of State Flow for Gear Shift using state flow is done and the result is satisfactory.