Vehicle Body

Two-axle vehicle with longitudinal dynamics and motion and adjustable mass, geometry, and drag properties

  • Library:
  • Simscape / Driveline / Tires & Vehicles

Description

The Vehicle Body block represents a two-axle vehicle body in longitudinal motion. The vehicle can have the same or a different number of wheels on each axle. For example, two wheels on the front axle and one wheel on the rear axle. The vehicle wheels are assumed identical in size. The vehicle can also have a center of gravity (CG) that is at or below the plane of travel.

The block accounts for body mass, aerodynamic drag, road incline, and weight distribution between axles due to acceleration and road profile. Optionally include pitch and suspension dynamics. The vehicle does not move vertically relative to the ground.

The block has an option to include an externally-defined mass and an externally-defined inertia. The mass, inertia, and center of gravity of the vehicle body can vary over the course of simulation in response to system changes.

Model

The vehicle axles are parallel and form a plane. The longitudinal, x, direction lies in this plane and perpendicular to the axles. If the vehicle is traveling on an incline slope, β, the normal, z, direction is not parallel to gravity but is always perpendicular to the axle-longitudinal plane.

This figure and table define the vehicle motion model variables.

Vehicle Dynamics and Motion

Vehicle Model Variables

SymbolDescription
gGravitational acceleration
βIncline angle
mMass of the vehicle
hHeight of vehicle center of gravity (CG) above the ground
a, bDistance of front and rear axles, respectively, from the normal projection point of vehicle CG onto the common axle plane
VxVelocity of the vehicle. When Vx > 0, the vehicle moves forward. When Vx < 0, the vehicle moves backward.
VwWind speed. When Vw > 0, the wind is headwind. When Vw < 0, the wind is tailwind.
nNumber of wheels on each axle
Fxf, FxrLongitudinal forces on each wheel at the front and rear ground contact points, respectively
Fzf, FzrNormal load forces on each wheel at the front and rear ground contact points, respectively
AEffective frontal vehicle cross-sectional area
CdAerodynamic drag coefficient
ρMass density of air
FdAerodynamic drag force

Equations

Vehicle Dynamics

The vehicle motion is a result of the net effect of all the forces and torques acting on it. The longitudinal tire forces push the vehicle forward or backward. The weight mg of the vehicle acts through its center of gravity (CG). Depending on the incline angle, the weight pulls the vehicle to the ground and pulls it either backward or forward. Whether the vehicle travels forward or backward, aerodynamic drag slows it down. For simplicity, the drag is assumed to act through the CG.

mV˙x=Fx Fdmgsinβ

Fx=n(Fxf+Fxr)

Fd=12CdρA(Vx+Vw)2sgn(Vx+Vw)

Zero normal acceleration and zero pitch torque determine the normal force on each front and rear wheel.

Fzf=h(Fd+mgsinβ+mV˙x)+bmgcosβn(a+b)

Fzr=+h(Fd+mgsinβ+mV˙x)+amgcosβn(a+b)

The wheel normal forces satisfy Fzf+Fzr=mgcosβn.

If you include an externally-defined mass or inertia, the equations are shifted by the weighted value of the input.

Pitch dynamics

The rate of the pitch that occurs during vehicle acceleration depends on three torque components and the inertia of the vehicle:

α=(fh)+(Fzfa)(Fzrb)J

Where:

  • ɑ is the pitch rate.

  • f is the longitudinal force.

  • J is the inertia.

If you choose a linear model for suspension stiffness and damping, the block uses small angle approximation for pitch calculations. If you choose a table lookup model, the block uses the vectors that you specify calculate pitch dynamics. For hard stop equations, see Translational Hard Stop.

Variables

Use the Variables tab to set the priority and initial target values for the block variables before simulating. For more information, see Set Priority and Initial Target for Block Variables (Simscape).

Unlike block parameters, variables do not have conditional visibility. The Variables tab lists all the existing block variables. If a variable is not used in the set of equations corresponding to the selected block configuration, the values specified for this variable are ignored.

Limitations and Assumptions

The Vehicle Body block lets you model only longitudinal dynamics, parallel to the ground and oriented along the direction of motion. The vehicle is assumed to be in pitch and normal equilibrium. The block does not model pitch or vertical movement. As such, the equations assume that the wheels never lose contact. This constraint can result in negative normal forces.

Ports

Input

expand all

Physical signal input port for headwind speed.

Physical signal input port for road incline angle.

Physical signal input port for the center of gravity, in m, of the externally-defined mass relative to the CG of the vehicle body.

Dependencies

This port is visible only when the Externally-defined additional mass parameter in the Main settings is set to On.

Physical signal input port for the mass, in kg, of the externally-defined mass.

Dependencies

This port is visible only when the Externally-defined additional mass parameter in the Main settings is set to On.

Physical signal input port for the moment of inertia, in kg*m^2, of the externally-defined mass.

Dependencies

This port is visible only when the Externally-defined additional mass parameter in the Main settings and the Pitch dynamics parameter in the Pitch settings are both set to On.

Output

expand all

Physical signal output port for vehicle longitudinal velocity.

Physical signal output port for normal force on the front axle. Wheel forces are considered positive if acting downwards.

Physical signal output port for normal force on the rear axle. Wheel forces are considered positive if acting downwards.

Conserving

expand all

Conserving port associated with the horizontal motion of the vehicle body. Connect tire traction motion to this port.

Parameters

expand all

Main

Mass of the vehicle.

Wheel counts on the front and rear axles. If the input is a scalar number, the wheel counts of the front and rear axles are assumed the same. For example, if the input is 2, then the front and rear axles are each assumed to have two wheels.

If the input is a two-element array, the first number is the front-axle wheel count and the second number the rear-axle wheel count. For example, if the input is the array [2,1], then the front axle is assumed to have two wheels and the rear axle one wheel.

Horizontal distance, a, from the center of gravity to the front wheel axle of the vehicle.

Horizontal distance, b, from the center of gravity to the rear wheel axle of the vehicle.

Distance, h, between the center of gravity of the vehicle and the ground.

Acceleration due to gravitational force acting at the center of gravity of the vehicle.

Option to include as time- or event-variant mass that affects the mass and CG of the vehicle body.

Dependencies

The CG, M, and J ports are visible only when this parameter is set to On. Exposure of the J port also requires that you select On for the Pitch dynamics parameter in the Pitch settings.

To see a warning when the block calculates negative values for normal force during simulation, select On. The block can generate negative forces because the equations assume that the wheels never lose contact.

Drag

Effective cross-sectional area, A, presented by the vehicle in longitudinal motion. The block uses this value to calculate the aerodynamic drag force on the vehicle.

Aerodynamic drag coefficient, Cd. The block uses this value to calculate the aerodynamic drag force on the vehicle.

Density of the air that surrounds the vehicle.

Pitch

The table shows how the visibility of some parameters depends on the option that you choose for other parameters. To learn how to read the table, see Parameter Dependencies.

Pitch Parameter Dependencies

Pitch
Pitch dynamics — Choose Off or On
OffOn
 Pitch moment of inertia
Suspension model — Choose Linear or By table lookup
LinearBy table lookup
Front suspension stiffnessFront suspension stiffness force vector
Front suspension dampingFront suspension deformation vector
Rear suspension stiffnessFront suspension damping force vector
Rear suspension dampingFront suspension velocity vector
Rear suspension stiffness force vector
Rear suspension deformation vector
Rear suspension damping force vector
Rear suspension velocity vector
Interpolation method
Extrapolation method
Hard stop — Choose Off or On
OffOn
 Front upper bound
Front lower bound
Front contact stiffness
Front contact damping
Rear upper bound
Rear lower bound
Rear contact stiffness
Rear contact damping
Initial pitch
Initial pitch rate

Option to model pitch dynamics.

Dependencies

Selecting On for this parameter enables parameters for:

  • Suspension model

  • Hard-stop model

  • Initial pitch conditions

The J port is visible only when this parameter is set to On. Exposure of the J port also requires that you select On for the Externally-defined additional mass parameter in the Main settings.

For more information, see the Pitch Parameter Dependencies table.

Moment of inertia for pitch calculations.

Dependencies

This parameter is enabled when you set Pitch dynamics to On.

For more information, see the Pitch Parameter Dependencies table.

Parameterization method for suspension modeling.

You parameterize the suspension using stiffness and damping data. To specify the data using scalar values, select Linear. To specify the data using vector values, select By table lookup.

Dependencies

This parameter is enabled when you set Pitch dynamics to On.

For more information, see the Pitch Parameter Dependencies table.

Front suspension stiffness per axle.

Dependencies

This parameter is enabled when you set both of these options:

  • Pitch dynamics to On

  • Suspension model to Linear

For more information, see the Pitch Parameter Dependencies table.

Front suspension damping per axle.

Dependencies

This parameter is enabled when you set both of these options:

  • Pitch dynamics to On

  • Suspension model to Linear

For more information, see the Pitch Parameter Dependencies table.

Rear suspension stiffness per axle.

Dependencies

This parameter is enabled when you set both of these options:

  • Pitch dynamics to On

  • Suspension model to Linear

For more information, see the Pitch Parameter Dependencies table.

Rear suspension damping per axle.

Dependencies

This parameter is enabled when you set both of these options:

  • Pitch dynamics to On

  • Suspension model to Linear

For more information, see the Pitch Parameter Dependencies table.

Stiffness force of the front suspension. Specify the output values for the lookup table as a vector. The number of elements in the output vector must be the same as the number of elements in the input vector. The input vector parameter is the Front suspension deformation vector parameter.

Dependencies

This parameter is enabled when you set both of these options:

  • Pitch dynamics to On

  • Suspension model to By table lookup

For more information, see the Pitch Parameter Dependencies table.

Deformation of the front suspension specified in terms of displacement. Specify the input values for the lookup table as a vector. The values of the elements in the vector must increase from left to right. The minimum number of elements in the vector depends on the interpolation method that you select. For linear interpolation, provide at least two elements. For smooth interpolation, provide at least three elements. The output vector parameter is the Front suspension stiffness force vector parameter.

Dependencies

This parameter is enabled when you set both of these options:

  • Pitch dynamics to On

  • Suspension model to By table lookup

For more information, see the Pitch Parameter Dependencies table.

Damping force of the front suspension. Specify the output values for the lookup table as a vector. The number of elements in the output vector must be the same as the number of elements in the input vector. The input vector parameter is the Front suspension velocity vector parameter.

Dependencies

This parameter is enabled when you set both of these options:

  • Pitch dynamics to On

  • Suspension model to By table lookup

For more information, see the Pitch Parameter Dependencies table.

Velocity of the front suspension. Specify the input values for the lookup table as a vector. The values of the elements in the vector must increase from left to right. The minimum number of elements in the vector depends on the interpolation method that you select. For linear interpolation, provide at least two elements. For smooth interpolation, provide at least three elements. The output vector parameter is the Front suspension damping force vector parameter.

Dependencies

This parameter is enabled when you set both of these options:

  • Pitch dynamics to On

  • Suspension model to By table lookup

For more information, see the Pitch Parameter Dependencies table.

Stiffness force of the rear suspension. Specify the output values for the lookup table as a vector. The number of elements in the output vector must be the same as the number of elements in the input vector. The input vector parameter is the Rear suspension deformation vector parameter.

Dependencies

This parameter is enabled when you set both of these options:

  • Pitch dynamics to On

  • Suspension model to By table lookup

For more information, see the Pitch Parameter Dependencies table.

Deformation of the rear suspension specified in terms of displacement. Specify the input values for the lookup table as a vector. The values of the elements in the vector must increase from left to right. The minimum number of elements in the vector depends on the interpolation method that you select. For linear interpolation, provide at least two elements. For smooth interpolation, provide at least three elements. The output vector parameter is the Rear suspension stiffness force vector parameter.

Dependencies

This parameter is enabled when you set both of these options:

  • Pitch dynamics to On

  • Suspension model to By table lookup

For more information, see the Pitch Parameter Dependencies table.

Damping force of the rear suspension. Specify the output values for the lookup table as a vector. The number of elements in the output vector must be the same as the number of elements in the input vector. The input vector parameter is the Rear suspension velocity vector parameter.

Dependencies

This parameter is enabled when you set both of these options:

  • Pitch dynamics to On

  • Suspension model to By table lookup

For more information, see the Pitch Parameter Dependencies table.

Velocity of the rear suspension. Specify the input values for the lookup table as a vector. The values of the elements in the vector must increase from left to right. The minimum number of elements in the vector depends on the interpolation method that you select. For linear interpolation, provide at least two elements. For smooth interpolation, provide at least three elements. The output vector parameter is the Rear suspension damping force vector parameter.

Dependencies

This parameter is enabled when you set both of these options:

  • Pitch dynamics to On

  • Suspension model to By table lookup

For more information, see the Pitch Parameter Dependencies table.

Interpolation methods for approximating the output value when the input value is between two consecutive grid points are:

  • Linear — Select this default option to get the best performance. Provide at least two values per dimension.

  • Smooth — Select this option to produce a continuous curve with continuous first-order derivatives. Provide at least three values per dimension.

For more information on interpolation algorithms, see the PS Lookup Table (1D) block reference page.

Dependencies

This parameter is enabled when you set both of these options:

  • Pitch dynamics to On

  • Suspension model to By table lookup

For more information, see the Pitch Parameter Dependencies table.

Extrapolation method for determining the output value when the input value is outside the range specified in the argument list are:

  • Linear — Produces a curve with continuous first-order derivatives in the extrapolation region and at the boundary with the interpolation region.

  • Nearest — Produces an extrapolation that does not go above the highest point in the data or below the lowest point in the data.

For more information on extrapolation algorithms, see the PS Lookup Table (1D) block reference page.

Dependencies

This parameter is enabled when you set both of these options:

  • Pitch dynamics to On

  • Suspension model to By table lookup

For more information, see the Pitch Parameter Dependencies table.

Option to model hardstops for the front and rear suspension.

Dependencies

This parameter is enabled when you set the Pitch dynamics to On:

Selecting On for this parameter enables parameters for the front and rear hard stops:

  • Upper bound

  • Lower bound

  • Contact stiffness

  • Contact damping

For more information, see the Pitch Parameter Dependencies table.

Upper bound of the hard stop for the front suspension.

Dependencies

This parameter is enabled when you set both of these options:

  • Pitch dynamics to On

  • Hard stop to On

For more information, see the Pitch Parameter Dependencies table.

Lower bound of the hard stop for the front suspension.

Dependencies

This parameter is enabled when you set both of these options:

  • Pitch dynamics to On

  • Hard stop to On

For more information, see the Pitch Parameter Dependencies table.

Contact stiffness of the hard stop for the front suspension.

Dependencies

This parameter is enabled when you set both of these options:

  • Pitch dynamics to On

  • Hard stop to On

For more information, see the Pitch Parameter Dependencies table.

Contact damping of the hard stop for the front suspension.

Dependencies

This parameter is enabled when you set both of these options:

  • Pitch dynamics to On

  • Hard stop to On

For more information, see the Pitch Parameter Dependencies table.

Upper bound of the hard stop for the rear suspension.

Dependencies

This parameter is enabled when you set both of these options:

  • Pitch dynamics to On

  • Hard stop to On

For more information, see the Pitch Parameter Dependencies table.

Lower bound of the hard stop for the rear suspension.

Dependencies

This parameter is enabled when you set both of these options:

  • Pitch dynamics to On

  • Hard stop to On

For more information, see the Pitch Parameter Dependencies table.

Contact stiffness of the hard stop for the rear suspension.

Dependencies

This parameter is enabled when you set both of these options:

  • Pitch dynamics to On

  • Hard stop to On

For more information, see the Pitch Parameter Dependencies table.

Contact damping of the hard stop for the rear suspension.

Dependencies

This parameter is enabled when you set both of these options:

  • Pitch dynamics to On

  • Hard stop to On

For more information, see the Pitch Parameter Dependencies table.

Pitch at the beginning of the simulation.

Dependencies

This parameter is enabled when you set Pitch dynamics to On.

For more information, see the Pitch Parameter Dependencies table.

Pitch rate at the beginning of the simulation.

Dependencies

This parameter is enabled when you set Pitch dynamics to On.

For more information, see the Pitch Parameter Dependencies table.

Model Examples

Extended Capabilities

C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.

Introduced in R2011b