At the moment this becomes true, the model enters the upshifting state. The during function of the latter, finds that an upshift should take place when the vehicle exceeds 30 mph. The shift event, which is broadcast to the gear_selection state, activates a transition to the appropriate new gear.įor example, if the vehicle is moving along in second gear with 25% throttle, the state second is active within gear_state, and steady_state is active in the selection_state. Subsequently, the model again activates steady_state after a transition through one of the central junctions. If the shift condition remains valid for a duration of TWAIT ticks, the model transitions through the lower junction and, depending on the current gear, it broadcasts one of the shift events.
This prevents extraneous shifts due to noise conditions. If the vehicle speed no longer satisfies the shift condition, while in the confirm state, the model ignores the shift and it transitions back to steady_state. If so, it enters one of the confirm states ( upshifting or downshifting), which records the time of entry. While in steady_state, the model compares these values to the present vehicle speed to determine if a shift is required. The model computes the upshift and downshift speed thresholds as a function of the instantaneous values of gear and throttle. The selection_state (always active) begins by performing the computations indicated in its during function. The shift logic behavior can be observed during simulation by enabling animation in the Stateflow debugger.