Week - 4
Aim:
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
Model:
The file which contains the model is attached with the report.
Implement control logic of a “washing machine” using Stateflow

parameter: Condititon:
value1 = mean there is input when lamp shown Green, the task In progress
value0 = mean there is no input when lamp shown Red, the task ends.
Chart diagram:

parameters:

When have given water,soak,washing,rinsing,dryer,cycle as output as chart
when have given power_supply, water_supply as input as chart
Simulation time set as 430sec
Output:
there is two condition
Condition 1:
when water supply is off

From above diagram, we can see that indicator of water is showing Red, 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

From above diagram, when there is water supply the process is terminated and the cycle process comoplete indicator shown in green
Question 2:
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
Model with block diagram:


Symbol parameter

In this speed is input, and gear is output
Time change as inf

Above diagram appears that slider gain parameter to set in 0, while running the program we should change the speed that result will acquires in lamp as a different color
Output: when gear at 1 and the increase a speed using slider gain ,the colcor shown in green

Output: when gear at 2 and the increase a speed using slider gain ,the colcor shown in light blue

Output: when gear at 3 and the increase a speed using slider gain ,the colcor shown in pink

Output: when gear at 1 and the increase a speed using slider gain ,the colcor shown in yellow

Output: when gear at 1 and the increase the speed using slider gain ,the colcor shown in orange

Conclusion :
Created the state flow of gear shift using simulink and the result satisfactory.