Simulink chart for the Gear shift
Aim:
To Make a Simulink chart for the “Gear shift” logic as per the below conditions.
Objective:
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
Model of the Gear shift in Simulink:
Stateflow:
Explanation:
1. To create a Simulink model of gear shift create a Stateflow chart and start with the power block which is connected to the breakpoint and a junction with power==0 condition and connected to speed block(state) power==1 so that when the speed is above 1 the process will start flowing to gears.
2. Here I have mentioned speed to Conway our conditions as above speed greater than zero the gear shift should start the cycle of changing to next gear.
3. In gear one, the breaking point is mentioned up to 16 then it is respectively changing till speed 61.
4. From gear five till gear one there up arrow(breaking point) the speed is decreased toll zero so that we can shift our gear not only increasing it can be decreased too.
5. Additional state mentioned as 'TopSpeed' So that if the speed is been increased above 80 there is a lamp which indicates over speed in our Simulink block.
6. After completion of our chart, we can see the inputs power and speed, outputs gear and top speed(Z).
7. I have connected the two constants to power and speed so that when the switch is on the power will be indicated from the lamp which is green in color. Speed is connected to a slider which requires manually increasing the speed.
8. From the output of gear, I have connected terminator so that it stops the data flow and to view the gear shifts I have connected to the gear shift indicator. and top speed(z) is connected to display and the display is connected to a lamp which shows over speed so that the lamp will indicate when the speed increased above 80.
9. I have connected it to the slider to the speedometer to view the speed in the speedometer.
Result:
Power off:
Power on:
Power on speed 20 kmph :
Power on speed 40 kmph :
Power on speed 60 kmph :
Power on Above 80 kmph :