Week - 4
AIM - To understand the working of the stateflow and complete the given objectives below.
OBJECTIVES-
- 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
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.
OBJECTIVE 1 -
Control logic of a “washing machine” using Stateflow.
STEPS -
1.Create a chart in simulink as per all the above mentioned conditions.
2.Then Open the symbols panel and assign the data (i.e input and output values)
3.Connect the switch and the LED lamps indiacator to each process accordingly.
4.Provide output as the display.
5.Values 0 and 1 are given as input which SWITCH ON and OFF the power and the water supply respectively.
STATEFLOW FOR CONTROL OF WASHING MACHINE-

WHEN POWER SUPPLY=0,WATER SUPPY=0

WHEN POWER SUPPLY=1,WATER SUPPY=0

WHEN POWER SUPPLY=1,WATER SUPPY=1

WHEN POWER SUPPLY=1,WATER SUPPY=1 AND T=200 sec

WHEN POWER SUPPLY=1,WATER SUPPY=1 AND T=300 sec

WHEN POWER SUPPLY=1,WATER SUPPY=1 AND T=320 sec

WHEN POWER SUPPLY=1,WATER SUPPY=1 AND T=400 sec

OBJECTIVE 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.
PROCEDURE -
According to the given conditions the neutral state is created with the default transition.
If the speed is 0>x<15,then the 1st gear is selected.
If the speed is 16>x<25,then the 2nd gear is selected.
If the speed is 26>x<40,then the 3rd gear is selected.
If the speed is 41>x<60,then the 4th gear is selected.
If the speed is above 61 ,then the 5th gear is selected.
Slider gain block is used to change the speed for the movement of the the respective gear.
STATEFLOW CHART FOR GEAR SHIFT-

FOR SPEED<15(1ST GEAR)-

FOR SPEED<25(2ND GEAR)-

FOR SPEED<40(3RD GEAR)-

FOR SPEED<60(4TH GEAR)-

FOR SPEED>60(5TH GEAR)-

VARIATION IN GEAR SHIFT-

CONCLUSION-
Thus the control logic of 'Washing Machine' and the 'Simulink chart for gear shift' is completed.