Week - 4
Challenge 1
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 50
Working of washing machine as per the required condition
flow chat of the washing machine working-

- In this chart we can see that as power supply gets on there is current in the system.
- If water supply gets on then there is check on water supply, then if the condition is done.
- Then we get to the next system which is soaking where clothes soak water for sometime and then to the next condition.
- After 200sec of water soaking the washing machine gets started, where clothes are washed for 100sec.
- Then water is rinsed out of the machine which takes 20sec
- Then clothes are dried for 50sec.
- And then the end of the washing machine working.
Here green signal indicates the working of the system, And the red signal indicates the not working of the system.
0 indicates OFF
1 indicates ON
Here both the power supply and water supply is off.

condition 1 - to show the power supply through indicating led.

just by power supply getting on the washing machine is not going to run, because there is no water supply.
To run the system power supply and water supply both should be on.

Challenge 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.
In this model inputs are generated by giving speed and the gear shift is done on the basis of the speed.
state flow for the gear shift.

And the input condition are given according to the slider gain, this helps to change the input while even simulation is running.

Gear 1-
In the given belowfigure we can see that the when the speed is 0-15 the gear shift is 1, and it's indicated through the display and the lamp color green.

Gear 2-
In the given belowfigure we can see that the when the speed is 16-25 the gear shift is 2, and it's indicated through the display and the lamp color blue.

Gear 3-
In the given belowfigure we can see that the when the speed is 26-40 the gear shift is 3, and it's indicated through the display and the lamp color orange.

Gear 4-
In the given belowfigure we can see that the when the speed is 40-60 the gear shift is 4, and it's indicated through the display and the lamp color yellow.

Gear 5-
In the given belowfigure we can see that the when the speed is above 60 the gear shift is 5, and it's indicated through the display and the lamp color purple.
