Week - 4
1. Implementing a control logic for 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
To make stateflow logic units we first added the chart and the sequence to run the washing machine is typed in it as shownn below:

The full model to run the washing machie sequennce is created as shown below:

The input is given by a toggle switch which is connnected to a constant value


The output is shown in lamps which was connected to the display

2. Creating 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
To give the logic the sequence condition is created in chart as shown below:

The total model is made as shown below:

The speed is given as the input through a slider to decide the speed which is connected to a constant to give it as an input

And the output is connect to a lamp to indicate the result which is conected to the display

A set of outputs are shown below to indicate the sequence running correctly and in different speeds:

Speed is at 10 which is the 1st gear

Speed is at 25 which is the 2nd gear

Speed is at nearly 50 which is a 4th gear