We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 10
Modeling an Automatic Transmission Controller
This example shows how to model an automotive drivetrain with Simulink®, Stateflow® enhances
the Simulink model with its representation of the transmission control logic. Simulink provides a
powerful environment for the modeling and simulation of dynamic systems and processes. In many
systems, though, supervisory functions like changing modes or invoking new gain schedules must respond to events that
may occur and conditions that develop over ime, As a result, the environment requires a language capable of managing
these multiple modes and developing conditions. In the following example, Stateflow shows its strength in this capacity by
Performing the function of gear selection in an automatic transmission. This function is combined with the drivetrain
dynamics in a natural and intuitive manner by incorporating a Stateflow block in the Simulink block diagram.
(Open This Example
+ Analysis and Physics
+ Modeling
+ Modeling
+ Results
+ Closing the Model
+ Conclusions
Analysis and Physics
Figure 1 shows the power flow in a typical automotive drivetrain. Nonlinear ordinary differential equations model the
engine, four-speed automatic transmission, and vehicle. The model discussed in this example directly implements the
blocks from Figure 1 as modular Simulink subsystems. On the other hand, the logic and decisions made in the
Transmission Control Unit (TCU) do notlend themselves to well-formulated equations. TCU is better suited for a Stateflow
representation. Stateflow monitors the events which correspond to important relationships within the system and takes the
appropriate action as they occur.
r
.
Throttle 1
7
.
1
Transmission,
Control Unit
Figure 1: Generic block dia
ram for a drivetrain system
The throttle opening Is one of the inputs to the engine. The engine Is connected to the Impeller of the torque converter
which couples itto the transmission (see Equation 1)
Equation 1
[gNe = T. -T;
Ne = engine speed (RPM)
J.;= moment of inertia of the engine and the impeller
T,,T; = engine and impeller torqueThe input-output charactristis ofthe torque converter can be expressed as functions ofthe engine speed and the turbine
speed. n this example, the cirection of power fow is always assumed to be from the impeller to the turbine (see Equation
2.
Equation 2
The transmission model is implemented via static gear ratios, assuming small shift times (see Equation 3),
Equation 3
Rrn = fa(gear) = tras
Tou = RreTin
Nin = RrpNout
Tiny Tont = transmission input and output torques.
Nin, Now = transmission input and output speed (RPM)
The final drive, inertia, and a dynamically varying load constitute the vehicle dynamics (see
Equation 4
iw = RyjalTou = Thoad)
Ty vehicle inertia.
Nw = wheel speed (RPM)
I,
Rya = final drive ratio
Trout = fa(Nw) = load torque
The load torque includes both the road load and brake torque, The road load is the sum of frictional and aerodynamic
losses (see Equation 5),
Equation 5
Tiooa = 8gn(mph)(Rioato + Rioasmph? + Tirake)
Ricai; Riutn = friction and aerodynamic drag coefficients
Tioad, Tirake = load and brake torques
mph = vehicle linear velocity
The model programs the shift points for the transmission according to the schedule shown in Figure 2. For a given throttle
ina given gear, there is @ unique vehicle speed al which an upshif takes place. The simulation operates similarly fora
downshift.transmission shift points
109)
so |4—4 _upshift
7 downshift
sor
vehicle speed (mph)
0 1020 30D 50 70 80 9 100
throttle (%)
Figure 2: Shift schedule
Modeling
To open this model type s1deno_autotrans in MATLAB® terminal, Initial conditions are setiin the Model Workspace.
The top-level diagram of the model is shown in Figure 3, To run the simulation, press the Play button on the toolbar in the
model window. Note that the model logs relevant data to MATLAB Workspace in a data structure called
sldeno_autotrans_output. Logged signals have a blue indicator (see Figure 3). After you run the simulation, you can
View the components of the data structure by typing sldeno_autotrans_output in MATLAB Command Window.a Modeling an Automatic Transmission Controller
|
Exenatr |
ese a
f
Tout >| t
aofee ep +
ft = | f
Cepyigh 1000-2012 The Maes ne
Figure 3: Model diagram and sample simulation results (passing maneuver)
Modeling
The Simulink model shown in Figure 3 is composed of modules which represent the engine, transmission, and the vehicle,
with an additional shif logic block to control the transmission ratio. User inputs to the model are in the form of throttle (given
in percent) and brake torque (given in fb). The user inputs throttle and brake torques using the ManeuversGUI interface.
The Engine subsystem consists of a two-dimensional table that interpolates engine torque versus throttle and engine
speed. Figure 4 shows the composite Engine subsystem, Double click on this subsystem in the model to view its structure,
7
ale
Qa 8 aim fi
@ rr f
le
EroeePcipeterneta
ae
Engine
Figure 4: Engine subsystem
The TorqueConverter and the TransmissionRato blocks make up the Transmission subsystem, as shown in Figure 5.
Double click on the Transmission subsystem in the model window to view its components,}________,e
7
Tasectowe |" teat >)
Tea
Qo
ee
|
EG {Nout
Wea
‘TraremasonRato
Transmission
Figure 5: Transmission subsystem
The TorqueConverteris a masked subsystem, which implements Equation 2. To open this subsystem, right click on itand
select Mask > Look Under Mask from the drop-down menu. The mask requires a vector of speed ratios ( Nin/Ne ) and
vectors of K-factor (£2) and torque ratio (F3). Figure 6 shows the implementation of the TorqueConverler subsystem,
Te
| J
Ne aa Fecork
Torque Converter
Figure 6: Torque converter subsystem
The transmission ratio block determines the ratio shown in Table 1 and computes the transmission output torque and input
speed, as indicated in Equation 3, Figure 7 shows the block diagram for the subsystem that realizes this ratio in torque and
speed.
Table 1: Transmission gear ratios
gear Rtr = Nin/Ne
a 2.393
2 1.458
3 1.000
4 0.677ToT
a 4]«} 2
Transmission Gear Ratio
Figure 7: Transmission gear ratio subsystem
The Siatefow block labeled ShiftLogic implements gear selection for the transmission. Double click on ShifiLogic in the
made! window to open the Stateflow diagram. The Model Explorer is utilized to define the inputs as throttle and vehicle
speed and the output as the desired gear number. Two dashed AND states keep track of the gear state and the state of the
gear selection process. The overall chart is execuled as a discrete-time system, sampled every 40 milliseconds. The
Stateflow diagram shown in Figure 8 illustrates the functionality of the block.
[down th, up th] = Compute Thresholi(Gear, Tht:
INehicleSpeed> up thy
[VericeSpead <= up th
[ge=_ state 00WN) {over stata UP}
Simulink Funclion
[down_th,up_th] = ComputeThreshold(Gear,Throttle)
Figure 8: Stateflow diagram of the transmission shift logic
The shift logic behavior can be observed during simulation by enabling animation in the Stateflow debugger. The
selection_state (always active) begins by performing the computations indicated in ts during function. The model
computes the upshift and downshift speed thresholds as a function of the instantaneous values of gear and throttle. Whilein stoady_stato, tho modol compares these values to the present vehicle spead to determine ita shiftis required. iso, it
centers one of the confirm states (upshi ting or downshift ing), which records the time of enty.
Ifthe vehicle speed no longer satisfes the shift condition, while in the confirm state, the model ignores the shiftand it
transitions back to steady_state, This prevents extraneous shifts due to noise conditions, ifthe shift condition remains
valid for a duration of TWATT ticks, the model transitions through the lower junction and, depending on the current gear, it
broadcasts one of the shift events. Subsequently, the model again activates steady_state after a transition through one of
the central junctions. The shift event, which is broadcast o the gear_selection slate, activates a transition to the
appropriate new gear,
For example, ifthe 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. The during function of the latte, finds that an upshift should take
place when the vehicle exceeds 30 mph. Atthe moment this becomes true, the model enters the upshiftting state. While
in this state, ifthe vehicle speed remains above 30 mph for TWATT ticks, the model satisfies the transition condition leading
down to the lower right junction. This also satisfies the condition [Igear == 2[] on the transition leading from here to
steady_state, so the model now takes the overall transition from upshifting to steady_state and broadcasts the event
UP as a transition action, Consequently, the transition from second to third is taken in gear_state which completes the shit
logic.
The Vehicle subsystem (Figure 9) uses the net torque to compute the acceleration and integrate itto compute the vehicle
speed, per Equation 4 and Equation 5. The Vehicle subsystem is masked. To see the structure of the Vehicle block, right
click on itand select Mask > Look Under Mask from the drop-down menu. The parameters entered in the mask menu are
the final drive ratio, the polynomial coefficients for drag friction and aerodynamic drag, the wheel radius, vehicle inertia,
and initial transmission output speed.
a Modeling an Automatic Transmission Controller
Cepyigh 1000-2012 The Maes ne+s»
=> a oo
onsite So rose
VeFiclnanis, WhedlSpeed ‘