CarSim Math Models
CarSim Math Models
CarSim solves equations that represent the dynamic 3D Road Geometry and Friction
behavior of four-wheeled vehicles, possibly towing a · Up to 100 road surfaces are supported, each with its own
trailer. The VehicleSim® (VS) architecture includes the reference path.
built-in VS Command scripting language to add new
· Vertical elevation is added with several components,
capabilities at runtime to automate tests or add features to
each specified as a function of path S (station) and L
the math models. Further, the models can work with other
(lateral offset) coordinates.
software (Simulink, LabVIEW, ETAS ASCET, Custom
C/C++ programs, Visual Basic, etc.) for automation or · Roads can have variable width, allowing highly efficient
extensions to the math models. descriptions of complex geometries.
· Road profiles are included that “wander” to follow the
Vehicle Math Models vehicle wherever it goes. This provides efficient use of
high-frequency measured road roughness data.
Configurable Table Functions · Friction is specified relative to the reference path with a
· Potentially nonlinear relationships between independent variable-width function of station and lateral distance.
and dependent variables are defined with VS · Road geometry can be imported from other software or
Configurable Functions that are set at runtime to use: defined by equations that are added at runtime.
o Constants · The VS API includes functions to provide access to the
o Linear coefficients 3D road geometry for user-supplied equations for model
o Nonlinear tables with several interpolation methods extensions or additional outputs.
involving one or two independent variables
Vehicle Configurations
o Algebraic formulas involving other variables
· CarSim trailer includes a trailer with one or two
· When linear coefficients or linear interpolation methods suspensions in a tandem with load-sharing effects. An
are selected, the simulations can run even faster. optional license is needed to include a trailer.
· No built-in limit to the length of tables. · The sprung masses may be simple rigid bodies, or
· Independent and dependent variables can be transformed include frame rails account for torsional compliance. An
in support of normalized functions. optional license is needed for torsional compliance.
· CarSim includes an option to include extra multibody
VS Reference Paths degrees of freedom (DOF) for engine movement due to
· Up to 200 VS Reference Paths, each with a sequence of mount compliances. An optional license is needed.
segments (straight, arc, clothoid, X-Y table).
· Reference paths are used for driver controls, traffic Wind and Aerodynamic Effects
vehicles, and road definitions. · Six aerodynamic forces and moments are applied to the
sprung mass (both sprung masses if there is a trailer).
Driver Controls · These forces and moments are Configurable Functions
· All driver controls can be specified using built-in model of aerodynamic slip, pitch, and ride height.
options, defined by equations added at runtime with VS
Commands, or imported from other software. · Ambient wind speed and heading can be set with tables,
runtime equations, or imported from other software.
· The built-in driver model can steer to follow a target
path, which can be changed during the run. Suspensions
· Closed-Loop Speed Controller based on target speed and · Suspensions can be generic or a solid axle. Generic
acceleration limits, curvature of the target path, and 3D suspensions specify wheel movements with jounce on
road geometry (banking, grade, curvature). both sides, possibly with coupling. They can represent
· Gear shifting and clutch controls can be handled with independent and twist-beam suspensions.
shift schedules and automatic throttle-clutch interactions. · Suspensions are either un-steered, or they include full
· Closed-loop and open-loop controls can be combined to 3D kinematics for inclined steering axes of the wheels.
simulate intervention systems. · The suspension models have full nonlinear kinematical
· Open-loop steering can be angle or torque. behavior and are asymmetric.
· Open-loop braking can be pedal force or fluid pressure.
Mechanical Simulation
755 Phoenix Drive, Ann Arbor MI, 48108, USA • 734 668-2930 • Fax: 734 668-2877 • Email: [email protected] carsim.com
· Suspension springs and dampers are nonlinear and · The built-in models use nonlinear tables for lateral force,
include hysteresis due to friction. longitudinal force, aligning moment, and overturning
· Every suspension has compliance in the lateral and moment as functions of slip, load, and camber.
longitudinal directions, and every wheel has toe and · Variable friction conditions are handled using similarity,
camber compliance effects. to maintain both linear and limit properties of the tire.
· All compliances can be represented with linear Separate coefficients are used for X and Y components.
coefficients or nonlinear configurable functions. · Transient effects of rolling are included using relaxation
· Separate forces are included for bump stops. length. Relaxation lengths can be constant or defined as
nonlinear functions of vertical force and slip.
· Suspension roll moments include a nonlinear auxiliary
roll moment and linear coefficient roll damper. · Special equations are used to keep realistic tire transient
behavior at very low speeds and very high speeds.
Steering System · External tire models can apply forces at either the
· The interactions between the suspension, steering, tire, ground contact point or the wheel center.
and ground are handled with a detailed multibody model · Tire contact can be handled with one to four points to
that uses an inclined kingpin axis. account for the contact patch dimensions, which can be
· The steering model includes specific details for rack- defined as nonlinear functions of tire compression.
and-pinion and recirculating ball-type systems. · Dual tires are available for all wheels.
· Steer angle of each road wheel is available as rotation as
measured in a K&C rig (in the sprung mass coordinate Powertrain
system), or as rotation about the kingpin axis. · CarSim has detailed powertrain models for front-wheel
· The steering system includes detailed options for manual drive, rear-wheel drive, and four-wheel drive (all-wheel
or dynamic power boost, including column assist. drive). There is also a minimal model used for speed
control in which torque is applied directly to the wheels.
· The steering system includes hysteresis, compliance,
inertia, and damping. · Engine torque is defined with a Configurable Function of
throttle input and crankshaft angular velocity.
· Special equations are used for low-speed conditions to
simulate ground friction steer torque. · Fuel consumption is defined with a 2D table.
· The engine feeds torque to the transmission either
Brake System through a hydraulic torque converter or through a
· Brake control can be set with pedal force (with or mechanical clutch.
without boost) or master cylinder pressure. · The transmission converts torque and speed based on the
· The control input pressure from the master cylinder is current gear selection, with spin inertias and efficiencies
proportioned for each wheel-end brake actuator. that depend on the gear selection.
· Brake torque is modeled as a nonlinear function of · Continuously variable transmissions (CVT) are
actuator pressure and thermal effects. supported.
· The brake system has several options for providing ABS · The torque from the transmission goes to a differential
control from external programs such as Simulink, or for front or rear-wheel drive systems. With four-wheel
using a simple built-in controller. drive systems, the transmission applies torque to a center
· Special equations handle wheel lockup to obtain the unit (e.g. transfer case) with a torque bias.
correct reaction torque and avoid numerical instability. · The center unit and differential models are similar. All
have four model options:
Tires 1. Always locked.
· CarSim includes several tire models. It is ready to run
2. Viscous coupling.
with a fully asymmetric table-based model, an extended
model (more tables for camber effects), the Pacejka 5.2 3. Coupling applied using a clutch. The clutch can be
version of the magic formula, and MF-Tyre from controlled externally or with built-in logic.
TASS/TNO. 4. Yaw control differential system, which involves two
clutches with reduction gears in parallel over a
· CarSim runs with MF-Swift from TASS/TNO and FTire
differential. The system allows control of the torque
from COSIN (extra licenses are required from TASS and
distribution between left and right, or front and rear.
COSIN, respectively, to use their models).
· The center unit has a torque bias for non-locked options.
· Different models can be applied to different wheels of
the same vehicle.
2/4
· Twin-clutch is an alternative to an axle differential. The · CarSim processes VS Commands at runtime that define
system involves a gear box in the middle of the axle and new variables, add equations to the model, change units
two clutches between each wheel and the gearbox. for variables, and otherwise extend the original CarSim
· Torsional compliance of the driveline can be model to meet custom requirements.
characterized by a natural frequency and damping ratio. · Parsfiles support the INCLUDE capability, allowing
· CarSim provides tight, low-level integration with the advanced applications such as design of experiments
commercial tool AVL Cruise. The GUI in CarSim and (DOE), sensitivity, and customized automation methods.
AVL-Cruise support automatic connections. An optional
license is needed to use the Cruise interface.
Output Variables
· CarSim generates from 600 to several thousand built-in
Sensors and Traffic output variables, depending on whether there is a trailer,
· The models include several kinds of virtual sensors that sensors, traffic vehicles, etc.
detect various types of vehicle motion, including · Commands used at runtime add sets of motion outputs,
acceleration, speed, and previews of the road ahead. driver preview points, and other outputs as needed.
· Up to 200 moving objects can be added that are updated · A subset of the available outputs can be specified at run-
automatically to convert simple road-based commands time, to control the size and organization of output files.
into full 3D geometry. The objects can be recycled for · Writing to file can be enabled and disabled during the
extensive runs, to reappear after they go out of view. run, to save only interesting results from long
· Motion of an object can be constant, set by specifying simulations.
speed, set with algebraic equations, or imported from · New output variables can be defined at runtime.
third-party software.
· CarSim provides a GUI for browsing the lists of
· Objects that move based on speed support offtracking, to available variables, sorting by several categories.
produce realistic low-speed traffic turns at intersections.
· All variables are described in documentation files in both
· Up to 99 range and detection sensors can be included text and spreadsheet format.
that detect the moving objects. An optional license is
· Output files may be written in several binary forms (32-
needed to use the sensor feature.
bit and 64-bit) or CSV (text) spreadsheet format.
· Each detection includes 22 variables that can be exported
· Output variables are used for several purposes:
to external controllers (e.g., ADAS).
o Make plots that show vehicle behavior.
· Objects can block each other (occlusion). The sensor
detection variables respond only to the portion of the o Input to post-processing software.
object that is within the field of view. o Motion information for video visualization.
o Define conditions for VS Events when new vehicle
Solver Program Input and Outputs or control properties take effect.
CarSim uses standard VS library routines for processing o Used in formulas added at runtime.
input files, performing standard calculations, and o Export to other software during the simulation.
generating output files.
Working with Simulink® and External Models
Input Data Files
· On Windows machines, the CarSim math model is a
· CarSim reads all input from text files that are normally DLL file that runs in many environments:
generated automatically. These files can also be made
externally for advanced applications. o CarSim runs the models with no additional software.
o Models run as blocks in MATLAB/Simulink,
· Input files for CarSim follow a simple keyword-based
LabVIEW, and other simulation environments.
format called the Parsfile. CarSim can recognize
thousands of keywords when processing input files. o Models can run as functional mockup units (FMU)
using the functional mockup interface (FMI). FMUs
· Parsfiles are efficient for software to read and write, may access database files or be defined as
while also being easy for people to read and edit.
completely self-contained files.
· Each input line can optionally specify alternate units for o Models work with Visual Basic, MATLAB, and
a parameter. other programming languages that can load DLL
· Values can be assigned directly to model parameters files and access their functions with the VS API.
with numbers, numerical expressions (e.g., 1/16), or o CarSim includes both 32-bit and 64-bit DLLs.
symbolic algebraic expressions involving other model
variables.
3/4
· C/C++ can be used to extend the math models, accessing · The math model for a four-wheeled vehicle has over 110
thousands of parameters and variables using the VS API. ordinary differential equations (ODEs). Each multibody
· MATLAB, Visual Basic (VB), and other languages can DOF has two equations; other equations represent the
run the models with Windows COM for automation. dynamics of components:
· Math model solver programs are compiled to native code o Each tire has two DOF for lagged response.
for real-time systems to interface with the RT test o MF-Tyre / MF-Swift and FTire add more DOF.
control software. o The brake fluid in each actuator has one DOF.
· CarSim has a LINEARIZE command to generate o The temperature for each brake has one DOF.
linearized A, B, C, and D matrices for use in MATLAB. o The engine crankshaft has one DOF.
· CarSim has built-in commands for adding forces and o Throttle has a lag with one DOF.
moments to extend the model. o Fuel consumption has one DOF.
o Power steering and power brake each add one DOF.
Input Variables
· The engine mount models add six DOF.
· Calculations from external models and measurements
from hardware-in-the-loop (HIL) can be imported into · The math model has over 250 state variables, needed
CarSim. These include most forces and moments, fluid (along with parameters and configurable function
pressures, controls, ground geometry under each tire, etc. definitions) to fully define the state of the system. These
include the ODE variables plus others:
· The vehicle models can import values for hundreds of
built-in variables. o Each friction element has a state variable for
hysteresis (suspension springs, steering system, low-
· Most of the import variables can be combined with
speed tire steer).
native internal variables with one of three modes:
o Clutches and built-in controllers (e.g., ABS) have
1. replace the native variable,
locked states.
2. add to the native variable, or o Other dynamic mode conditions have state variables.
3. multiply with the native variable.
· CarSim provides a browser for activating import Equation Form
variables from the lists of all those that are available. · The equations of motion are derived from first principles
· New import variables can be defined at runtime to pass for 3D motions of multiple connected rigid bodies.
through data from other software. E.g., variables from · The equations of motion are ordinary differential
Simulink can be passed through to the animator. equations (ODE’s) that are well behaved (not stiff).
· The built-in VS library provides six methods for solving
Export Variables the ODE’s (Adams-Bashforth, Adams-Moulton, Runge-
· All variables available for writing to output files are also Kutta, and Euler methods).
available for export to Simulink or external code.
· All methods run at a fixed time step and work well for
· Variables are exported only if activated at runtime, as real-time applications.
needed to be compatible with the external model.
· The algorithms work well with measured and sampled
· New export variables can be defined at runtime. data sources, even when there are discontinuities.
· The equations are compiled with extensive optimizations
Multibody Model Specifications for efficient use either alone or with other software (e.g.,
Simulink, LabVIEW).
State Variables and Degrees of Freedom
CarSim has ordinary differential equations (ODEs) for the Initialization and Restarts
dynamics of multibody systems, including rigid bodies, · CarSim supports many initialization options, from
fluids, tires, controllers, and other dynamic parts. automatic to detailed specification of any state variable.
· The multibody mechanical system for a four-wheeled · The complete state of the vehicle model is saved at the
vehicle has 15 mechanical degrees of freedom (DOF): end of each run, to support continuation of advanced
o The sprung mass is a rigid body with six DOF. automation and optimization methods.
o Each suspension has two DOF. (The 3D motions · The state of the model can be saved during a run and
follow constraint data from K&C tests.) fully restored during the run, in support of advanced
o Each wheel has one spin DOF. optimization methods and repetitive test sequences.
o The steering system has one DOF.