8 PROGRAM STRUCTURE AND
REAL-TIME CAPABILITY
When determining the structure of the source code,
great emphasis was put on both computing speed and
usability. The strucure of the vehicle model imple-
mented in Matlab is shown in figure 10. In the main
file, only the temporal change of the state vector is
determined, which is described by the kinematic and
dynamic equations of motion. Furthermore, the kine-
matics and dynamics in vector-matrix form are used
to reduce the number of equations. The occurring pa-
rameters are determined in subroutines. The compo-
nents described in the previous chapters, such as the
powertrain or the tire model, are stored in separate
files, so that they can easily be replaced if the vehicle
configuration changes. Values such as the wheel load,
which are required both for the calculation of the tire
forces in the longitudinal and lateral direction and for
the vertical motion of the wheel, are located in one of
the upper program levels. Thereby, all program parts
that need this information can access it and a recal-
culation is avoided. At the beginning the start values
Steering
Brake
Suspension
Wheel
Driving
Resistance
Kinematics
Powertrain
Figure 10: Structure of the Matlab model.
of the state vector z
z
z have to be defined. In addition,
the temporal courses of the accelerator pedal position,
the brake pedal position and the steering wheel angle
are to be specified as input data for the vehicle model.
At each time step, the change of the state vector d
d
dz
z
z
is determined. This first order differential equation is
then solved by means of the Matlab solver ode45 with
a time increment of one millisecond. The state vector
obtained thereby is the input for the next simulation
step.
One of the fundamental conditions to the nonlinear
twin track model presented in this paper is the real-
time capability. For this purpose, the computing time
required for the maneuvers for validating the vehicle
model is analyzed. To create the results listed in ta-
ble 2, the mean of five simulations is calculated us-
ing a laptop with the characteristics(Intel (R) Core
(TM) i5-7200U CPU)@ 2.50GHz 2.71GHz on a 64-
bit Windows operating system. The results show that
the vehicle dynamics model developed here enables
a real-time simulation for all driving maneuvers pre-
sented here. In order to achieve a further reduction in
Table 2: Real-time capability.
Maneuver Real Matlab mex
Acceleration [s] 10 2.72 0.46
Sinusoidal steering [s] 16 5.59 0.93
Circular test [s] 70 15.33 2.69
Evasive maneuver [s] 20 6.63 1.02
the computing time, the vehicle model is transferred
to the C programming language. The resulting file is
then integrated into Matlab as a mex file. The com-
puting speed is increased by a factor of 5.7.
9 CONCLUSION
In this paper, a nonlinear twin track model has been
introduced, containing all the components that are im-
portant for the vehicle handling. All components and
the entire vehicle has been compared to the CarMaker
system. The tire forces are validated by a sinusoidal
steering. The powertrain has used an acceleration pro-
cess for validation. All considered parameters show
no significant difference between the both systems.
The quality of the modeling of the behavior of the ve-
hicle body, which also takes into account the vertical
dynamics in addition to the horizontal dynamics, has
been evaluated by a driving maneuver, which consists
of a straight-ahead and a circular driving, and by an
evasive maneuver. In the first one, there are small de-
viations in the roll angle and in the lateral accelera-
tion, which are not constant during the circular driv-
ing and still increase slightly. In second maneuver one
there is no difference. The computation time fulfills
the requirement of a real-time simulation as a function
of the illustrated maneuvers. The remaining computa-
tion time may be used in future projects to implement
a controller that generates the required input variables
of the vehicle model based on a predetermined trajec-
tory and a speed profile. Furthermore, a method need
to be developed to determine the required parameters
of the nonlinear two-track model with reasonable ef-
fort on a proving ground.
SIMULTECH 2018 - 8th International Conference on Simulation and Modeling Methodologies, Technologies and Applications
412