To make a gear shift logic using Simulink chart and implement a control logic for washing machine using Stateflow.
AIM:
1. To make a gear shift logic using Simulink Chart.
2. Implement a control logic for washing machine using Stateflow.
GEAR SHIFT LOGIC USING SIMULINK CHART
The input to the chart is given by a slider gain. The speed can be varied from 0 to 100 kmph.
Simulink Model
The block named 'Gear' is a Chart which has the control logic for the gear shift. The following data is used for the logic.
Speed Range(kmph) Gear
0 to 15 1
16 to 25 2
26 to 40 3
41 to 60 4
Above 61 5
Control Logic in Chart
The speed of the vehicle is used to decide the gear of the vehicle. Here speed is compared and the gear value is assigned. Eg. If speed is 18 kmph. First it will enter the FirstGear block and then check that, speed is greater than 15 so it will change the state to SecondGear block. Again it checks the condition for moving to next block but, it won't shift as the speed is less than 25. So the gear assigned is 2. Now if driver changes the speed to 9 kmph, the comparision takes place and the gear shifts to first gear as the speed is less than 15 kmph. The process is similar for other speeds too.
Speed Input from Slider Gain
Gear Number Output
WASHING MACHINE CONTROL LOGIC USING STATEFLOW
The setup will work only if the power supply and water supply is available. This is ensured using a switch block. If power or water supply is not available the switch block will be open so the system won't work and red light glows in lamp. One more water supply check is provided within the chart.
Simulink Model
Control Logic in Chart
If the water supply is not there the value of 'water' is not equal to 1 and it will stop the system. Also, red light will glow in the lamp.
If the water supply is provided it will procees to the next step soaking (200 sec delay is given after soaking step for the soaking operation). Then the next step is washing (100 sec process). The next step is rinsing (20 sec process) and then the last step is drying (50 sec process). Then the process is completed which is indicated by green glowing lamp.
The lamp is connected to the chart in such a way that, state 1 (process going on) is indicated by blue color lamp, state 0 (stopped process) is indicated by red color lamp and state 2 (Washing completed) is indicated by green color lamp.
Lamp Parameters