complete vehicle model
the full car drivetrain simulation of the example encompasses all the basic methods of driveline modeling and many key simscape™ driveline™ features. it includes engine and transmission models and a model of the drivetrain-wheel-road coupling. the engine and transmission are coupled with a torque converter. programmed clutch control steps the transmission through four gears during the simulation. the clutch pressure signals are smooth and more realistic than the sharp clutch pressure signals in the simpler drivetrain examples. this section describes these features, subsystems, and their relationship and purposes, leading you to actual simulation.
understanding the global structure of the model
open the example. the model contains model workspace variables for parameterizing some of the blocks. for information on creating, accessing, and changing model workspace variables, see and .
vehicle with four-speed transmission model
the main driveline subsystems and components are:
driver inputs — throttle/brake profile
engine — system-level model of spark-ignition and diesel engine
torque converter — three-part torque converter consisting of an impeller, a turbine, and a stator.
transmission subsystem — cr-cr 4-speed transmission
shift logic — stateflow® implemented transmission controller
vehicle body — vehicle, tire, and brake dynamics
while the engine is idling initially at a nonzero speed, the transmission output and the vehicle as a whole are initially not moving.
model the throttle/brake profile
the driver inputs block is a subcomponent implementation that provides throttle and brake signals to the engine and transmission control system. open the driver inputs block to view the throttle/brake profile for the simulation.
the throttle signal is programmed to produce a realistic acceleration profile and to agree with the gear shifting sequence described in control the clutches. the throttle signal feeds to the engine and to the transmission controller.
the brake signal supplies the input force that actuates braking in a double-shoe brake block in the vehicle body subsystem.
model the engine
for the purposes of system modeling, an engine or motor specifies an output torque as a function of driveline speed. the engine has a connection port coupling it rotationally to the rest of the system.
using an engine block from vehicle components
the engines library contains blocks that you control using an input physical signal for the throttle. you can parameterize the generic engine block using vectors to specify speed and torque. the block calculates the maximum possible torque as a function of the engine speed at any instant. the throttle signal controls how much of the maximum torque the engine can deliver. the piston engine block accounts for the instantaneous torque transmitted to the engine drive shaft. the instantaneous torque enables you to model vibrations in the drivetrain due to piston revolution. to model just the piston mechanism of a combustion engine, use the piston block.
the vehiclewithfourspeedtransmissionexample
example uses a generic
engine block, configured as spark-ignition
type. the block properties specified in the
property inspector include the maximum power,
speed at maximum power, and maximum possible speed
of the engine. to view engine settings, click the
engine block. the engine torque and motion are
modeled relative to the rotational ground, which
is taken as the base reference of the engine and
the starting point of the driveline, or mechanical
rotational, connections in this model.
alternative and advanced methods for modeling engines
simscape driveline allows you to create complex, custom engine models. several important engine features to consider in a complex model are:
distinguishing steady-state behavior from engine start-up, when the engine speed-engine torque function has not yet reached its maximum possible envelope
details of mechanical power production, such as air-fuel compression and combustion
additional controls beyond what can be represented by a single throttle signal
model the transmission
the cr-cr 4-speed transmission subsystem in the
vehiclewithfourspeedtransmissionexample
model is similar to other examples with the same
transmission. the clutch and planetary gear
properties are set in the blocks with model
workspace variables.
workspace variable | description |
---|---|
eff_tor_rad | clutch: effective torque radius (m) |
num_fric_surf | clutch: number of friction surfaces in contact |
engagement_area | clutch: friction surface area in contact (m2) |
fric_coeff | clutch: kinetic friction coefficient of surfaces in contact |
peak_normal | clutch: static (locking) friction coefficient of surfaces in contact |
veltol | clutch: clutch velocity locking tolerance (rad/s) |
pressthresh | clutch: normalized pressure threshold |
p0 | clutch: physical pressure normalization (pa) |
for more about gears, clutches, and transmissions, see the block reference page.
couple the engine to the transmission
the vehiclewithfourspeedtransmissionexample
model couples the engine and
the transmission through a torque converter
block.
torque converter stage
like a clutch, a torque converter couples two independent driveline axes to transfer angular motion and torque from an input to an output shaft. however, unlike a clutch, a torque converter never locks. the torque converter transfers motion by hydrodynamic viscosity, not by surface friction. thus a torque converter does not step through discrete stages and avoids the motion discontinuities inherent in friction clutches.
to mimic engine idling at the start of the simulation, the initial condition of the impeller inertia is a nonzero angular velocity. the initial condition of the turbine & input shaft inertia is zero speed.
for more details about these blocks, see the and block reference pages.
model the tires, brakes, wheels, and road
the transmission feeds its output torque to the final drive subsystem, vehicle body. this subsystem represents the vehicle inertia (the load on the transmission), the wheels, the brakes, the driving conditions, and the wheel contact with the road. the subsystem models only the rear wheels as driven by the transmission.
final drive subsystem: vehicle body
the subsystem has two major areas.
modeling the tires and brakes
the right and left tire blocks accept the driveline torque and rotation from the transmission at their wheel axle rotational ports (a). given a normal or vertical load (n), this torque and rotation are converted to a thrust force and translation at the wheel hub translational ports (h).
the tires rotate nonideally, slipping before they fully generate traction and react against the road surface. the tire slip of the left tire is reported as a physical signal and converted to simulink® for use with the tire slip scope.
the double-shoe brake block represents a brake arranged as two pivoted rigid shoes that are symmetrically installed inside or outside of a drum and operated by one actuator. the brake block converts the braking signal from the driver inputs block to an actuator force that exerts a friction torque on the shaft that connects the brake drum to the tire blocks.
modeling the vehicle body and load
the driveline connection line sequence of the model ends with the block, which specifies the vehicle geometry, mass, aerodynamic drag, and initial velocity (zero). this block generates the normal forces that the tire blocks accept as vertical loads. vehicle body accepts the developed thrust force and motion at its horizontal motion translational port (h). the vehicle body model also accepts a wind velocity (w) and a road incline (beta), both provided by physical constants.
the rear wheel vertical load force (nr) is reported back to the tire blocks. the forward wheel vertical load (nf) is not used.
the forward velocity (v) of the vehicle is converted and reported, through the subsystem outport, to the vehicle velocity scope.
alternative differential, wheel, road, and braking models
the vehiclewithfourspeedtransmissionexample
example models only the rear
wheels, the rear tires, and the vehicle body,
without the more realistic drivetrain components
of differential gears and brakes. the
vehiclewithfourwheeldriveexample
example illustrates how to model a vehicle that
has four wheels and front and rear differential
gears.
for information on modelling brake systems using clutches, see and .
control the clutches
to select and engage the appropriate gear set, the model uses a stateflow block and clutch schedule. to see
how these components work, return to the main
model of
vehiclewithfourspeedtransmissionexample
.
state-controlled gear selection
the stateflow block, which is labeled shift logic, implements gear selection for the transmission. the block determines whether to shift up or down based on input from two other components in the model. driver inputs block supplies throttle and braking information. the vehicle body subsystem supplies the velocity of the vehicle body via a feedback loop.
to open the stateflow diagram, double-click the shift logic block. 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 executed as a discrete-time system. the stateflow diagram shown in the figure illustrates the functionality of the block.
the model computes the
upshifting and downshifting speed thresholds as a function of the
instantaneous values of gear and throttle. while in steady_state
,
the model compares these values to the present vehicle speed to determine
if a shift is required. if so, it enters one of the confirm states
(upshifting or downshifting), which records the time of entry.
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
. the steady-state condition
prevents extraneous shifts due to noise conditions. 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. the model again
activates steady_state
after a transition through
one of the central junctions. the shift event, which is broadcast
to the gear_selection
state, activates a transition
to the appropriate new gear. the stateflow block outputs the
gear information to a clutch schedule subsystem that is in the transmission
subsystem.
clutch schedule subsystem
the signal from the stateflow block to the clutch schedule controls the five clutches of the cr-cr 4-speed transmission. to see the clutch schedule, open the transmission subsystem, and then the clutch schedule subsystem.
run the model
the model is configured to simulate for 50 seconds. the table shows the gear profile for the simulation.
time ranges (s) | cr-cr gear settings |
---|---|
0–3.96 | 1 |
3.96–10.48 | 2 |
10.48–40.68 | 3 |
40.68–50 | 4 |
simulate the car.
to see the results using the simscape results explorer, in the description in the model window, click explore simulation results.
to plot the rotational velocity in rpms and power in watts for the engine:
in the left pane of the results explorer window, expand the node for the engine
click the f node, and then the w node.
to change the units for the y-axis to revolutions per minute, click the arrow button below the y-axis label (
rad/s
) and selectrpm
.to add a plot of the power that the engine delivers to the torque converter, ctrl click the p node.
add a plot of the tire slip.
ctrl click to expand the vehicle_body node.
ctrl click to expand the tire_left node.
ctrl click the s node.
add a plot of the vehicle velocity.
ctrl click to expand the second vehicle_body node.
ctrl click the v node.
to change the units to kilometers per hour, click the arrow button below the y-axis label (
m/s
), selectspecify
, and for specify your unit, enterkm/hr
.
the plots show that for:
engine speed and power — when the transmission shifts to second gear at 3.96 seconds, the engine reaches its maximum speed and power.
tire slip — as the transmission steps into higher gears, the speed ratio rises. the drive ratio falls, and the tire slip decreases. the tire motion more closely approaches ideal (nonslipping) motion at higher speeds.
vehicle velocity — the speed increases less with each upshift for gears one, two, and three. the velocity decreases slightly before it starts to stabilize when the car is in fourth gear.