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
model:

stateflow:

blocks used in model:
constant = for power and water supplay
lamp=indicate the signal
slider switch = to turn the machine on and off
stateflow= for control logic
display= to show the output signals
procedure:
the power and water supplay to the machin are dependent upon the switch condition which is on or off condition and it is defined by the constant value 0 or 1
when desplay shows 1 the power and water supplay is present
if the value is 0 and 1 then the machine will not start the process as one of the switch is off
when both power and water are at 1 then the socking process starts and run for 200 sec after this washing started
after 200 sec the rinsing process starts and after this process is started for which the water supplay is cut off
after compliting all the task the machin turn off
and finally the lamp indicating red for working and it indicating blu for not working
power switches off condition:
water supplay is off condition :

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:

stateflow:

blocks used in the model :
constant-to multiply with the slider gain
slider gain- it acts as a throttle to increase or decrease the speed
state flow - control logic of gear shifting
scpo- to plot the graph of the speed vs gear shift
procedure:
at the initial position the slider is at 0
when we increased the speed the input is given to the state flow chart whare it check the input speed and display the gear number
range of 1 gear(0-15)kmph
range of second gear(15-25)kmph
range of 3 gear (25-40)kmph
range of 4 gear (40-60)kmph
range of 5 gear(>60 kmph)
at 1st gear:

at 2 gear:

at 3 gear:

at 4 gear:

at 5 gear:

out put:
