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

The above the simulation diagram has constant inputs using the manual switch and these inputs are connected to chart inputs, the ouput of chart are connected to lamps repectively as in question.

I have given some conditions in chart to fullfill the requirements. In symbol plane we are assigning the inputs and outputs.

Now both the inputs are 0 so the machine state is off


In the above images the conditions are 1,0 or 0,1 so the machine dosent continue the process.

Now both the conditions are 1,1 so machine gets ON

Water flowing so soaking gets on and it continues for 200 seconds.

After soaking 200 sec it goes to washing process for 100 sec.

After washing 100 sec it goes to risening process

After 20 sec of resening it continues to dry for 50 sec
After 50 sec of drying, The washing machine stopts and shows finish.
Result-
Thus from the above images we have seen that washing machine works according to the conditions given.
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 the above simulation block a slider gain is connected to constant to vary the input. The chart input is connected to the slider constant and the outputs are connected to lamps to through the display to show the gear at corresponding speed.

In the chart the condition are given with the help of state flow method.

when the speed is between 0 to 15 the gear state is 1

When the speed is between 16 to 25 the gear state is 2

When the speed is between 26 to 40 rhe gear state is 3

when the speed is between 41 to 60 the gear state is 4

When the speed is above 61 the gear state is in 5
Result-
Thus the above images show the status of gear and the gear shifts as the condition given.