Week - 4
Aim 1:
Implementation of control logic chart for washing machine using stateflow process.
Condition:
- If the power supply is available, the system gets deactivated
- If the water supply is not available, stop the process and indicate through LED
- Soaking time should be 200s followed by washing time of 100s
- Then rinsing happens for next 20s and dryer runs for 50s
After all the processes are completed turn on the finished LED.
Procedure:
- Start the Simulink and create a blank model.
- Search for chart block in the stateflow category of library browser.
- Open the chart block and select the junction feature from the stateflow window.
- Control logic for washing machine is such that is should soak the water for the first 200s followed by drying time in 50s.
Lamp -

Rocker Switch -

Logic explanation:
The rocker switch from the dashboard library is used with a constant to supply the power and as water supply. A lamp is used to indicate the power status and water status. The power status is checked at the entry for every state and the water supply is checked for the soaking and the rinsing process. The timing for each state is as per the given inputs.

In the above control logic first state is created with 2 conditions for power supply. One is with power supply available and second with water supply available. If the power supply at the entry is 1 and water supply is on, then machine will get activated and start the next process of the operation. Next 4 operation states have been created in flow order soaking, washing, rinsing, drying with their time of operation as 200s for a soak, 100s for wash 20s for rinse and 50sec for dry. Entry and exit condition of the state are kept as 0 and i.e., at entry of operation states it is 0 and as operation completes it is 1 for every state.
Simulink Model-


Here all LED glows as green means all process has been completed and all display output as 1.
Aim 2:
Make a Simulink chart for the “Gear shift” logic
Condition:
Speed range (kmph) gear
- Gear 1 (0 to 15)
- Gear 2 (16 to 25)
- Gear 3 (26 to 40)
- Gear 4 (41 to 60)
- Gear 5 (Above 61)
Process:
Start Simulink and create a blank model. Search for chart block in the stateflow category of library browser. Open the chart block and select the various features from the stateflow window. Control logic for gear shift is such that it should change the gear when the speed increases of decreases automatically. After finishing the control logic run the stateflow and check the gear shift operation for an infinite time.
Logic explanation:
The speed ranges from 0 to 100 and the slider is used to send the input. The first gear has speed input values from 0 to 15 so the entry condition for the first gear is 0< speed and speed<15 and the exit condition is when the speed greater than 15.
Similarly for 2nd gear the entry condition is 16<speed and speed<25 and exit the condition is when speed<16 and speed>25. In the same way for each gear, the entry and the exit condition are specified and the out is mapped to the lamp and the display block.

Simulink model -

Slider -

At speed10 kmph:

At speed 60 kmph:

At speed 75 kmph:
