Week - 4
1)
AIM: make 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 the 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 been completed turn on the finished LED.
BLOCKS USED FOR THIS MODEL:
constant
slider switch
lamp
chart
display
PROCEDURE:
the model is given below.
here in the chart if the power supply is available means constant is 1 then system gets activated means lamp1 on and display show 1. then water supply is given constant1 is 1 then system gets water and activated and lamp1 show green color and display1 show 1. then after 200sec soaking started and then after 100sec washing and then after 20sec rinsing and last drying after 50sec.

when the power supply is on:

when the water supply is on:

soaking:

washing:

rinsing:

drying:

finish:

CONCLUSION:
so the conclusion is when the power supply and water supply are available then the system gets activated otherwise the process will stop and indicate through the LED.
2)
AIM: make a Simulink chart for the GEAR SHIFT logic as per the below conditions:
Speed range(kmph) GEAR
0-15 1
16-25 2
26-40 3
41-60 4
ABOVE 61 5
BLOCKS USED FOR THIS MODEL:
Constant
Slider
Display
State flow chart
PROCEDURE:
the model is given below.

here in the chart, if speed is greater than 0 then gear changes to 1, if speed is greater than 15 then gear changes to 2, and so on for gears 3,4, and 5 is checked.

when speed is greater than 0:

when speed is greater than 15:

when speed is greater than 25:

when speed is greater than 40:

when speed is greater than 60:

CONCLUSION:
so the conclusion is when speed is greater than 0 gear will be 1 and when speed is greater than 15 gear will be changed to 2, and then it follows the chart it will run until speed=0.