Week - 4
QUESTION 1: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
Blocks used and its work:
1.State flow chart-First off all i am using the chart block for making control logic of washing machine.
2.Display-Then after i am using the display block to display the value of process of washing machine like which process is going on(if 1 is on and 0 is off).
3.constant-constant block is used for giving the input as on and off.
4.Lamp-Lamp block will indicate the which process is going on if it will blow as green light then process will be on and red then process will be off or process done.There are 8 lamp blocks 6 blocks connected with display and 2 blocks coneected with water supply and power supply.
5.Rocker switch-Rocker switch connected with constants it is used as on or off the simulation.

MODEL:
MAIN MODEL-

STATEFLOW CHART-

SYMBOL PANE PARAMETERS-

Here power supply and water supply is as input.
water,soak,rinsing,washing,dryer and washing completed is as output.
TIME PARAMETERS-

OUTPUTS:
1.If the power supply is available, the system gets activated

2.If the Water supply is not available, stop the process & indicate through LED

3.After all the processes completed the washing complted as a finishing process blowing as a green light.

CONCLUSION: Here is the diagram of washing machine has complted all the process and indicating through the lamp. And if the process will not be complted it is also indicating.
QUESTION 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.
Blocks used and its work:
1.State flow chart-First off all i am using the chart block for making control logic of Gear shifting logic.
2.Display-Then after i am using the display block to display the Gear shift like which Gear is working(if 1 is on and 0 is off).
3.constant-constant block is used for giving the input as on and off.
4.Lamp-Lamp block will indicate the which Gear is working if it will blow as green light then Gear will be on and red then Gear will increase or decrease.There is 6 lamp block is working here which indicate which Gear is working.
5.Rocker switch-Rocker switch connected with constant it is used as on or off the simulation.It is working here as ignition switch for turn on or turn off the engine.

6.Slider-slider is connected with constant.It is used here as to increase or decrease the speed.

MODEL:
MAIN MODEL-

STATEFLOW CHART DIAGRAM-

SYMBOL PANE PARAMETERS-

Here engine and speed as input.
Gear 1,2,3,4,5 and ignition as a output.
OUTPUTS:
1.If the speed will be 0-15km/h then Gear 1 will work and lamp will blow as a green light.

2.If the speed will be 16-25km/h then Gear 2 will work and lamp will blow as a green light.

3.If the speed will be 26-40km/h then Gear 2 will work and lamp will blow as a green light.

4.If the speed will be 41-60km/h then Gear 4 will work and lamp will blow as a yellow light.

5.If the speed will be above 60km/h then Gear 5 will work and lamp will blow as a red light.

NOTE:- ignition will be on everytime till the engine in on condition.
CONCLUSION: simulated all the condition of this Gear shifting model using stateflow chart.It will shows if the speed will increase then we have to increase the gear.
THANK YOU