Download as pdf or txt
Download as pdf or txt
You are on page 1of 12

See discussions, stats, and author profiles for this publication at: https://www.researchgate.

net/publication/236341727

Simulation of vehicle kinematics in rollover tests with quaternions

Article  in  Proceedings of the Institution of Mechanical Engineers Part D Journal of Automobile Engineering · November 2006
DOI: 10.1243/09544070JAUTO360

CITATIONS READS

8 2,603

3 authors, including:

Clive Neal-Sturgess
University of Birmingham
131 PUBLICATIONS   1,619 CITATIONS   

SEE PROFILE

Some of the authors of this publication are also working on these related projects:

Pedestrian Protection View project

APROSYS View project

All content following this page was uploaded by Clive Neal-Sturgess on 30 May 2014.

The user has requested enhancement of the downloaded file.


1503

Simulation of vehicle kinematics in rollover tests with


quaternions
Y Hu*, C E Neal-Sturgess, and A M Hassan
Birmingham Automotive Safety Centre, School of Engineering, Department of Mechanical Engineering, University of
Birmingham, Birmingham, UK

The manuscript was received on 12 May 2006 and was accepted after revision for publication on 21 July 2006.

DOI: 10.1243/09544070JAUTO360

Abstract: The paper provides a method to simulate the vehicle kinematics in rollover tests.
There are several rollover tests in use: SAE J2114 dolly rollover, ditch rollover, corkscrew,
curb trip, and soil trip. Sensors located on board the vehicle record the various accelerations
and make it possible to reconstruct the whole event with high accuracy, which is difficult in
real-world accidents.
Euler parameters, as a useful method to describe the orientation of a rigid body, have been
widely used in three-dimensional multi-body and rollover crash simulations. A method based
on the Euler parameters derived from the test data is used to simulate the vehicle rollover
kinematics in a SAE J2114 dolly rollover test. The detailed procedure from the raw data to the
Euler parameters is described and the influence of gravity included in the test data is removed
by projecting to a local vehicle reference system.
The method is validated by simulating the dolly rollover test in MADYMO, using a simple
rigid body model to represent the vehicle. Good agreement is obtained from the comparison
between the simulated vehicle orientation and the test video, and the comparison between
simulated displacements and calculated displacements using the recorded test accelerations
at the same points. This demonstrated that the method proposed is a useful and effective
method for simulating vehicle kinematics in rollover tests.

Keywords: simulation, rollover test, quaternions

1 INTRODUCTION It is well known that rollover is a complex event.


There are many possible mechanisms which can lead
Rollover crashes can be amongst the most violent to several rollover types in real-world accidents. For
of crashes in terms of occupant injury outcome, the integration of rollover protection into a vehicle
especially for occupants in sports utility vehicles safety system, full-scale tests are necessary to validate
(SUVs). From the data in the US National Accident mathematical models and to give basic information
Sampling System – Crashworthiness Data System for about how sensors and algorithms trigger the relevant
the years 1995–2004, SUV rollover accidents cover protection devices. In this field, several test pro-
approximately 12.2 per cent of all accidents of SUVs, cedures are established and in use. From these
and 41 per cent of all seriously injured occupants methods, researchers expect to understand the
were involved in an accident where the SUV rolled. kinematics of the vehicle and occupants, and to
Even in passenger cars which experienced a single assess the injury potential during rollover.
vehicle rollover only with ground impact, about 10.6 Rollover is a semichaotic event. Small changes
per cent of front-seat passengers received serious to in the initial conditions, owing to the extended
fatal injuries. duration of the event, may eventually have major
consequences on the total vehicle behaviour as
* Corresponding author: Birmingham Automotive Safety Centre, the rollover progresses. For this reason, computer
School of Engineering, Department of Mechanical Engineering, simulation is an important tool for rollover research.
University of Birmingham, Birmingham, B15 2TT, UK. email: It allows parametric changes to be made that are
hyz_uk@hotmail.com prohibitively expensive to test, it allows the same

JAUTO360 © IMechE 2006 Proc. IMechE Vol. 220 Part D: J. Automobile Engineering
1504 Y Hu, C E Neal-Sturgess, and A M Hassan

model to be run many times with different initial


conditions, and it also can use human body models,
as opposed to dummies in the tests. It also permits
accurate modelling and reproduction of initial
conditions, which is difficult in real-world rollover
tests.
Compared with other forms of vehicle accident
simulation, rollover simulation requires more accuracy
for the whole process including orientation, position,
and occupant motion. In a simulation, vehicle
kinematics are the basis for occupant simulation and
this paper provides a method to simulate the vehicle
kinematics in a rollover test efficiently and effectively.
Fig. 2 Ditch rollover test

2 TESTS AND SIMULATIONS 3. Corkscrew tollover test. The corkscrew rollover test
shown in Fig. 3 uses a ramp to lift one side of the
To date, there have been several real-world rollover vehicle with a certain speed to generate a rollover.
tests. The purpose of this test is to assess the strength
and integrity of the occupant compartment. Such
1. The SAE J2114 dolly rollover test. A dolly rollover
a test is useful for scenarios with slow-roll motion
test was described in the Society of Automotive
around the longitudinal axes of the car [2].
Engineers (SAE) Recommended Practice J2114
4. Curb trip rollover test. The vehicle is towed side-
shown in Fig. 1 as a method of evaluating the per-
ways on a moving fixture towards a stationary
formance of a vehicles’ crashworthiness during
curb. The moving fixture is decelerated at a known
rollover. The test consists of positioning a vehicle
rate, releasing the vehicle. As the vehicle moves
on a dolly fixture, which is inclined at 23° to
laterally, the tyres contact the curb shown in Fig. 4,
the horizontal. The fixture is towed at 48 km/h
(30 miles/h) and stopped suddenly to generate
the vehicle rollover. The number of rolls can vary
from one to three or more under the same initial
conditions depending on the vehicle tested.
2. Ditch rollover test. This slow-speed ditch test
emulates a real-world fall-over accident. When a
vehicle is tipped by a slope and its centre of mass
is outboard of its wheels, a fall-over happens. This
is an important test since, based on the field data
analysis, fall-over accounts for about 13 per cent
of all passenger vehicle rollover accidents [1].
Figure 2 shows a diagram of the ditch test. Fig. 3 Corkscrew rollover test

Fig. 1 SAE J2114 dolly rollover test Fig. 4 Curb trip rollover test

Proc. IMechE Vol. 220 Part D: J. Automobile Engineering JAUTO360 © IMechE 2006
Simulation of vehicle kinematics in rollover tests with quaternions 1505

inducing a rollover depending on the speed and 3 SIMULATION METHOD


curb type.
5. Soil trip rollover test. The soil trip rollover test This paper intends to provide an effective and
shown in Fig. 5 is designed to gain insight into the accurate method for simulating vehicle kinematics
condition that the friction between the tyre and in a rollover test. During a rollover event, when
the road surface is one of the major factors leading the vehicle is airborne and not subject to the road
to rollover. The vehicle is placed like the curb trip surface constraint, the vehicle can be considered as
test set-up. However, when the vehicle comes off a free body with six degrees of freedom. Roll, pitch,
the dolly, and one of the side wheels make initial and yaw motions can occur in any combination. To
contact with the soil surface, rollover is induced reconstruct the event with high resolution, the most
by the interaction of the tyres with soil [1]. important consideration is the vehicle attitude with
respect to an inertial coordinate system [7].
There are many rollover simulation models. Cheng
et al. [3] described the ATB model, which is an
3.1 Quaternions
analytical program using the Euler equations of
motion with Lagrange-type constraints, to simulate According to the Euler theorem, any finite rotation of
the vehicle behaviours and to predict occupant a rigid body can be expressed as a single rotation
dynamics during a real rollover accident. Steffan about an appropriate base vector. In the case
et al. [4] simulated a rollover test by using PC-CRASH under consideration here, the Euler parameters or
software, which calculates vehicle movement based quaternions are applied to create a representation of
on a three-dimensional kinetic vehicle model, taking this transformation from the vehicle local coordinate
into account gravity, tyre, wind, and trailer forces. system to an inertial coordinate system, which is
Renfroe et al. [5] employed the mathematical dynamic commonly used in spacecraft orientation control [8],
model (MADYMO) software (TNO automotive) to for it has no inherent geometric singularity as do the
simulate a SAE J2114 dolly rollover test, and Day and Euler angles. The quaternions are defined by
Garvey [6] in their study used a three-dimensional

AB
a
vehicle model including inertial properties, tyre q =cos
0 2
model, and crush strength, to simulate a rollover test

AB
and real-world accidents. The simulations were all a
matched successfully with real test data. q =−cos b sin
1 1 2
The rollover simulations quoted above are all

AB
based on kinetic models, which are concerned with a
q =−cos b sin
the effects of forces on the motion of a body or 2 2 2
system of bodies, and so the accuracy depends on
AB
a
the initial conditions, the vehicle model properties, q =−cos b sin
3 3 2
the suspension model, the tyre model, and the con-
tact between the vehicle and ground. Usually, such (1)
models are useful to reconstruct accidents with a
where the parameters are defined in Appendix 1.
reasonable accuracy; however, to obtain an accurate
The parameters are not independent, but must
simulation of the vehicle kinematics in rollover tests,
satisfy the constraint
it is preferable to use the test data (accelerations or
displacements). q2 +q2 +q2 +q2 =1 (2)
0 1 2 3
The four Euler parameters represent the orientation
of the vehicle. In fact, the Euler angles q, c, and Q
can also be expressed by the Euler parameters
according to
sin q=2(q q −q q )
1 2 0 3
cos q sin c=−2(q q +q q )
2 3 0 1
cos q cos c=q2 −q2 +q2 −q2
0 1 2 3
2(q q +q q )
tan Q=− 1 3 0 2
q2 +q2 −q2 −q2
0 1 2 3
Fig. 5 Soil trip rollover test (3)

JAUTO360 © IMechE 2006 Proc. IMechE Vol. 220 Part D: J. Automobile Engineering
1506 Y Hu, C E Neal-Sturgess, and A M Hassan

Also, there is a relationship between the angular Software such as MADYMO provides the interface for
rates and the Euler parameters of the body in a fixed the Euler parameters but, starting from the raw
reference frame relative to an inertial reference accelerometer data to obtain the Euler parameters,
frame, which is given by there are some practical factors to consider. The
following section provides the detailed procedure.

CD C DC D
q̇ +q
+q +q
0 1 2 3 v
q̇ −q −q +q x
1 =1 0 3 2 v (4) 3.2.1 Gravity effect removal
q̇ 2 +q −q −q y
2 3 0 1 v Usually an accelerometer placed in a stationary
q̇ −q +q −q z manner on the Earth with its sensitive axis pointing
3 2 1 0
To solve equation (4), there are a number of numerical vertically will give an output signal equivalent to 1G,
methods available including Taylor series expansion, assuming that it responds to static acceleration
the rotation vector concept, Runge–Kutta algorithms, inputs. However, when the body is moving, accelero-
and the state transition matrix [9]. In this paper, the meters measure accelerations, which represent the
fourth-order Runge–Kutta method is chosen as it is actual dynamics of a moving body but may also
reasonably simple and robust, and this method is be contaminated by components of the Earth’s
given by gravitational field, which may also be sensed. For
example, if such an accelerometer is left stationary
1 with its sensitive axis pointing parallel to the surface
q(t+h)=q(t)+ (k +2k +2k +k )
6 1 2 3 4 of the Earth, it will produce an output signal
k =hq(t)v(t) equivalent to 0G.
1 In a rollover event, accelerometers record inertial
k =h[q(t)+0.5k ]v(t+0.5h) and gravitational accelerations at the same time,
2 1
k =h[q(t)+0.5k ]v(t+0.5h) owing to the change in orientation of the vehicle.
3 2 The recorded acceleration is equal to the sum of the
k =h[q(t)+k ]v(t+h) inertial and gravitational acceleration according to
4 3
(5) A =A +A (7)
r i g
where
As a rollover is a long-duration event, because of
q(t)=[q (t) q (t) q (t) q (t)]T accumulated errors, the influence of gravity on the
0 1 2 3
accelerometer data may be large. In the method
and v(t)=[v (t) v (t) v (t)]T.
x y z employed in this paper, if the gravity is not removed,
When the four Euler parameters are available, the
after the coordinate transformation using the Euler
orientation of the vehicle is completely determined,
parameters, the a and a values are the same, but
and the coordinate transformation can be expressed x y
the a value would shift 1G between the cases with
as z
and without gravity. The difference in acceleration

CD
x and velocity for the Z direction only is shown in the
b
y Figs 6 and 7.
b It can be seen from the above that, to obtain
z accurate estimates of the position, it is necessary to
b
remove the gravity effect before the double integration

C D
q2+q2−q2−q2 2(q q −q q ) 2(q q +q q )
0 1 2 3 1 2 0 3 1 3 0 2 of the acceleration. In general, the gravity and inertial
= 2(q q +q q ) q2−q2+q2−q2 2(q q −q q ) accelerations cannot be completely separated with-
1 2 0 3 0 1 2 3 2 3 0 1
2(q q −q q ) 2(q q +q q ) q2−q2−q2+q2 out information about the vehicle orientation [7].
1 3 0 2 2 3 0 1 0 1 2 3 Praxl [10] mentioned that there were some extra

CD
x calculations to consider the gravity in the coordinate
a
× y (6) data transformation, but he did not provide a
a detailed process. Takagi et al. [11] applied angular
z acceleration and linear accelerations to remove the
a
gravity effect. The angular acceleration was deter-
3.2 Practical factors
mined by taking the derivative of the angular rate
The Euler parameters, as a useful method to describe data. This method is sensitive to the angular rate data;
the orientation of a rigid body, have been widely it is easy to induce a derivative error and requires a
used in three-dimensional multi-body simulations. high-precision angular velocity sensor. In fact, by

Proc. IMechE Vol. 220 Part D: J. Automobile Engineering JAUTO360 © IMechE 2006
Simulation of vehicle kinematics in rollover tests with quaternions 1507

Fig. 6 Gravity effect on the acceleration (Z direction)

Fig. 7 Gravity effect on the velocity (Z direction)

using equation (6) to remove the effect of gravity, the the vehicle is equal to G cos 23°. For this reason, it is
process is simplified. The gravitational acceleration important to analyse the vehicle orientation and
can be projected on to the local vehicle coordinate gravity effect during the offset correction. The offset
system and removed from the accelerometer output, correction can use an averaging algorithm, which
to obtain the inertial accelerations along the local assumes that the signal is corrected by subtracting a
vehicle coordinate system. Alternatively, after the bias from each point on the signal.
raw accelerations are transformed to the inertial Based on the current National Highway Traffic
reference, the effect of gravity can be removed by Safety Administration (NHTSA) filtering standard SAE
subtracting the gravitational acceleration from the J211-1, the CFC60 cut-off frequencies are applied
vertical direction. to acceleration data, whereas the CFC1000 cut-off
frequencies are applied to the angular rate data.
3.2.2 Offset correction and filters
3.3 Method
Owing to offset, drift, noise, and sensitivity errors,
there will always be errors arising in the output from The total procedure used can be divided into three
any sensor. For this reason, offset correction or bias steps.
removal, and some filters, need to be applied to the Step 1. The raw test data, including the acceleration
raw sensor signals. and angular rate of the centre of gravity (CG) of the
As mentioned above, because of the gravity effect, vehicle, were adjusted for any offset and filtered,
the recorded acceleration is not zero even when the by using signal analysis software for Microsoft
vehicle is stationary. For example, when the vehicle Windows, which can be found at http://www-
is on the dolly in a SAE J2114 dolly rollover test, the nrd.nhtsa.dot.gov/software/signal-analysis/
output of the accelerometer along the vertical axis of downloads.html.

JAUTO360 © IMechE 2006 Proc. IMechE Vol. 220 Part D: J. Automobile Engineering
1508 Y Hu, C E Neal-Sturgess, and A M Hassan

Step 2. To find the orientation of the vehicle, The kinematics during the first 3 s represent the
quaternions can be obtained by solving equation most severe portion of the rollover in terms of injury
(4) using offset-corrected and filtered angle rates causation, as the highest head, neck, and chest
from Step 1. The numerical integration used a accelerations of dummies happen in this period.
fourth-order Runge–Kutta method. Then, the Also, as there was little roof crush in the first 3 s of
gravity components are available by projecting the the test, and the vehicle rollover can be simulated as
gravity on to the vehicle-fixed coordinate system a rigid body.
using equation (6). These are then subtracted from The rigid body shown in Fig. 9 is used to represent
the acceleration data, determined in Step 1, to the test vehicle with a similar geometry, and the
obtain the inertial accelerations in the vehicle- same dimensions, moments of inertia, mass, initial
fixed coordinate system. After projecting on to the velocity, and position. For the test vehicle, two
inertial or Earth coordinate system, the inertial ellipsoids are shaped to give the vehicle figuration,
accelerations are available. The main program and four cylinders represented the tyres, which are
code in Visual Basic is provided in Appendix 2. for visual aid only, as they are not included in the
computations and do not have any functional con-
Step 3. The displacements of the CG of the vehicle
tact interaction. In this model, the vehicle kinematics
are calculated by double integration of the inertial
are prescribed by specifying the motion for all
accelerations obtained in Step 2. The displacement
degrees of freedom of a free joint and determined
and Euler parameters were then used as the input
by the data collected at the vehicle’s CG. This can,
for the MADYMO model in the global coordinate
within limits, accurately model the kinematics of the
system. The detailed flow chart of data process is
vehicle without the complications of modelling
shown in Fig. 8.
the vehicle suspension and tyre characteristics,
which are difficult to model accurately.
Figure 10 shows the displacements of the CG of the
4 RESULTS
vehicle in the inertial reference system calculated by
the method outlined above, and Fig. 11 shows the
To verify the method, a SAE J2114 dolly rollover
four Euler parameters representing the orientation
test was chosen. The test was performed by the
of the vehicle. The vehicle motion is shown in Fig. 12.
NHTSA in 1997. The accelerations a , a , and a
cgx cgy cgz
of the CG of the vehicle and the angular velocities
4.1 Validation
v , v , and v , along the longitudinal, lateral, and
x y z
vertical axes respectively of the vehicle were recorded. To validate the simulation, two comparisons were
The test duration was approximately 6 s. In this conducted. One was a visual comparison between
paper, because of the accumulated errors and com- the orientation of the vehicle in the simulation and
putational constraints, only the first 3 s are simulated that shown by the film of the test. Figure 13 shows
with the MADYMO software (TNO automotive). the comparison at some key orientations. From this
comparison, it can be seen that the simulation pro-
vided good agreement with the vehicle orientation
from the test, except for a slight error at 1.05 s, which
may be due to suspenion effects.

Fig. 8 Data process flow chart Fig. 9 Vehicle model

Proc. IMechE Vol. 220 Part D: J. Automobile Engineering JAUTO360 © IMechE 2006
Simulation of vehicle kinematics in rollover tests with quaternions 1509

Fig. 10 Vehicle position

Fig. 11 Vehicle orientation expressed as the Euler parameters

Fig. 12 Vehicle motion comparison

The other comparison is between the simulated v around the roll axis is not sufficiently accurate,
y
displacements of a point on the test vehicle where because some data are lost in the test, and the vehicle
an accelerometer was attached, and the calculated is not a rigid body in the real test, which can also
displacements from the accelerations recorded by have a small effect on the displacements along the
that accelerometer. Figures 14 to 16 show the roll and pitch directions.
results. About after 1.5 s, the displacements in the In particular the suspension and tyres are modelled
longitudinal direction shown in Fig. 14 began to as rigid bodies for convenience, which will affect the
show discrepancies. This is because the angular rate kinematics in this mode. Figures 15 and 16 show

JAUTO360 © IMechE 2006 Proc. IMechE Vol. 220 Part D: J. Automobile Engineering
1510 Y Hu, C E Neal-Sturgess, and A M Hassan

Fig. 13 Vehicle attitude comparison

Fig. 14 X displacement comparison

Fig. 15 Y displacement comparison

Proc. IMechE Vol. 220 Part D: J. Automobile Engineering JAUTO360 © IMechE 2006
Simulation of vehicle kinematics in rollover tests with quaternions 1511

Fig. 16 Z displacement comparison

much better accuracy; overall it is reasonable to accelerations, which can also be used for other
conclude that the simulation is successful and applications that need gravity effect removal.
demonstrates the usefulness of the model. This method avoids the complication of vehicle
suspension and tyres and ignores the contact between
the vehicle and ground, which greatly simplify the
5 DISCUSSION AND CONCLUSIONS simulation. However, it also means that there are
some limitations. For the parts of the vehicle close
The simulation showed good agreement between the to the CG, the simulation is of good accuracy but,
test and simulation, it showed that using the Euler for other parts remote from the CG, the accuracy
parameters to reconstruct the vehicle kinematics in decreases slightly; this is because of the simplification
rollover tests is an effective and useful method. The of modelling the suspension and tyres. Thus this
reasons are as follows. method can give good accuracy for simulating
occupant protection research where the occupants
1. Only products exist in the Euler parameters
are near to the CG of the vehicle [12].
defining the kinematic differential equations.
2. Using only the angular rate sensor rather than
linear accelerations to solve the orientation ACKNOWLEDGEMENTS
decreases the errors in the numerical solution.
3. As the measurements are related to the CG, then This work is financially supported by the Overseas
there is only one point at which the accelerations Research Students Award Scheme (2003–2006), UK,
of the CG and the angular velocities along the and the University of Birmingham.
longitudinal, lateral, and vertical axes are recorded.
This means that the method developed is suitable
for all rollover tests where the accelerations and REFERENCES
angular rates are available.
1 Gopal, M., Baron, K., and Shah, M. Simulation and
This method allows the study of vehicle move- testing of a suite of field relevant rollovers. SAE paper
ments in rollover events and thus can be used to 2004-01-0335, 2004.
determine the occupant contact, kinematics, loads, 2 Berg, F. A., Behling, R., and Helbig, M. Rollover
and injury mechanisms. Once the vehicle mechanics crash tests. Int. J. Crashworthiness, 2002, l7(4),
have been established, a compartment model can be 487–498.
constructed in which the occupant model can be 3 Cheng, H., Rizer, A. L., and Obergefell, L. A. Pickup
truck rollover accident reconstruction using the ATB
described. Different interior designs with respect to
model. SAE paper 950133, 1995.
the occupant and restraint system can be evaluated 4 Steffan, H., Geigl, B. C., and Moser, A. A new
without having to repeat the real-world test, as it is approach to occupant simulation through the
simple to add or change constraints or objects. It also coupling of PC-Crash and MADYMO. SAE paper
provides a means to separate gravity from inertial 1999-01-0444, 1999.

JAUTO360 © IMechE 2006 Proc. IMechE Vol. 220 Part D: J. Automobile Engineering
1512 Y Hu, C E Neal-Sturgess, and A M Hassan

5 Renfroe, D. A., Partain, J., and Lafferty, J. Modeling Q yaw angle


of vehicle rollover and evaluation of occupant injury v ,v ,v instantaneous angular rates of the
potential using MADYMO. SAE paper 980021, 1998. x y z
body in the fixed reference
6 Day, T. D. and Garvey, J. T. Applications and
coordinate system
limitations of 3-dimensional vehicle rollover simu-
lation. SAE paper 2000-01-0852, 2000. v(t) angular rate function
7 Schubert, P. J., Nichols, D., Wallner, E. J., Kong, H.,
and Schiffmann, J. K. Electronics and algorithms for
rollover sensing, SAE paper 2004-01-0343, 2004. APPENDIX 2
8 Wetz, J. R. (Ed.) Spacecraft attitude determination
and control, 1978 (Reidel, Dordrecht).
9 Wie, B. Space vehicle dynamics and control, 1998 Visual Basic main program code for solving
(American Institute of Aeronautics and Astronautics, inertial acceleration data
Reston, Virginia).
The code is as follows.
10 Praxl, N. Simulation of occupant kinematics in
vehicle rollover – dummy model versus human Private Sub Caculation_Click()
model. In Proceedings of the 18th International
Technical Conference on the Enhanced Safety of
‘Initial value of Euler parameters
Vehicles, Nagoya, Japan, 2003, Paper 202. q0=0.9799247
11 Takagi, H., Maruyama, A., Dix, J., and Kawaguchi, K. q1=0.1993679
MAYDMO modeling method of rollover event and q2=0
occupant behavior in each rollover initiation type. q3=0
In Proceedings of the 18th International Technical
Conference on The Enhanced Safety of Vehicles, ‘Initial value of C.G. velocity
Nagoya, Japan, 2003, Paper 236. f_finalVx=0
12 Hu, Y., Neal-Sturgess, C. E., Hassan, A. M., and f_finalVy=13.408
Guo, R. The effect of an inflatable tubular structure f_finalVz=0
on occupant kinematics in rollover of an SUV. In
Proceeding of the International Crashworthiness ‘Time step
Conference 2006, Athens, Greece, 2006, Paper f_Step=0.000125 1 2
2006-23 (on CD-ROM).
‘Input the acceleration data and angular rate of
C.G.
APPENDIX 1 Input #1, f_time1, f_Ax1, f_Ay1, f_Az1, f_Wx1,
f_Wy1, f_Wz1
Notation
‘Call function 1st order Runge-Kutta to K1
A gravitational acceleration parameter
g
A inertial acceleration Call K1(q0, q1, q2, q3, f_Wx1, f_Wy1, f_Wz1)
i
A recorded acceleration of the
r ‘Loop to 3seconds
accelerometer
G acceleration due to gravity= For i=0 To 12000
9.8 m/s2 ‘Input the next time acceleration data and
h time step angular rate of C.G.
k ,k ,k ,k Runge–Kutta parameters Input #1, f_time2, f_Ax2, f_Ay2, f_Az2, f_Wx2,
1 2 3 4
q ,q ,q ,q quaternions f_Wy2, f_Wz2
0 1 2 3
q(t) quaternion function Input #1, f_time3, f_Ax3, f_Ay3, f_Az3, f_Wx3,
t time f_Wy3, f_Wz3
x ,y ,z coordinates in the reference system
a a a
X Y Z ‘Call Runge-Kutta function get K2,K3,K4.
a a a
x ,y ,z coordinates in the reference system Call K2(q0+0.5 1 fK1_Q0, q1+0.5 1 fK1_Q1,
b b b
X Y Z q2+0.5 1 fK1_Q2, q3+0.5 1 fK1_Q3,
b b b
f_Wx2, f_Wy2, f_Wz2)
a rotation angle Call K3(q0+0.5 1 fK2_Q0, q1+0.5 1 fK2_Q1,
b ,b ,b angles between a given vector and q2+0.5 1 fK2_Q2, q3+0.5 1 fK2_Q3,
1 2 3
the reference coordinate system f_Wx2, f_Wy2, f_Wz2)
c roll angle Call K4(q0+fK3_Q0, q1+fK3_Q1, q2+fK3_Q2,
q pitch angle q3+fK3_Q3, f_Wx3, f_Wy3, f_Wz3)

Proc. IMechE Vol. 220 Part D: J. Automobile Engineering JAUTO360 © IMechE 2006
Simulation of vehicle kinematics in rollover tests with quaternions 1513

‘Get the next time Euler Parameters fReturn0=f_Step 1 0.5 1


q0=q0+1/6 1 (fK1_Q0+2 1 fK2_Q0+2 1 (fQ1 1 fWx+fQ2 1 fWy+fQ3 1 fWz)
fK3_Q0+fK4_Q0) fReturn1=f_Step 1 0.5 1
q1=q1+1/6 1 (fK1_Q1+2 1 fK2_Q1+2 1 (−fQ0 1 fWx−fQ3 1 fWy+fQ2 1 fWz)
fK3_Q1+fK4_Q1) fReturn2=f_Step 1 0.5 1
q2=q2+1/6 1 (fK1_Q2+2 1 fK2_Q2+2 1 (fQ3 1 fWx−fQ0 1 fWy−fQ1 1 fWz)
fK3_Q2+fK4_Q2) fReturn3=f_Step 1 0.5 1
q3=q3+1/6 1 (fK1_Q3+2 1 fK2_Q3+2 1 (−fQ2 1 fWx+fQ1 1 fWy−fQ0 1 fWz)
fK3_Q3+fK4_Q3)
If n=1 Then
‘Call Runge-Kutta function to get K1. fK1_Q0=fReturn0
Call K1(q0, q1, q2, q3, f_Wx3, f_Wy3, f_Wz3) fK1_Q1=fReturn1
fK1_Q2=fReturn2
‘Get the Gravity effect on the vehicle-fixed fK1_Q3=fReturn3
coordinates ElseIf n=2 Then
fAGx=Gx 1 (q0 1 q0+q1 1 q1−q2 1 q2−q3 1 fK2_Q0=fReturn0
q3)+Gy 1 (2 1 (q1 1 q2−q0 1 q3))+ Gz 1 fK2_Q1=fReturn1
(2 1 (q1 1 q3+q0 1 q2)) fK2_Q2=fReturn2
fAGy=Gx 1 (2 1 (q1 1 q2+q0 1 q3))+Gy 1 fK2_Q3=fReturn3
(q0 1 q0−q1 1 q1+q2 1 q2−q3 1 q3)+Gz ElseIf n=3 Then
1 (2 1 (q2 1 q3−q0 1 q1)) fK3_Q0=fReturn0
fAGz=Gx 1 (2 1 (q1 1 q3−q0 1 q2)) fK3_Q1=fReturn1
+Gy 1 (2 1 (q2 1 q3+q0 1 q1))+Gz 1 fK3_Q2=fReturn2
(q0 1 q0−q1 1 q1−q2 1 q2+q3 1 q3) fK3_Q3=fReturn3
‘remove gravity effect. ElseIf n=4 Then
fAcgx=f_Ax3−fAGx fK4_Q0=fReturn0
fAcgy=f_Ay3−fAGy fK4_Q1=fReturn1
fAcgz=f_Az3−fAGz fK4_Q2=fReturn2
fK4_Q3=fReturn3
‘Project the acceleration data on the inertial End If
coordinates. End Function
fAcx=fAcgx 1 (q0 1 q0+q1 1 q1−q2 1
Public Function K1(fQ0, fQ1, fQ2, fQ3, fW1, fW2,
q2−q3 1 q3)+fAcgy 1 (2 1 (q1 1 q2+q0 1
fW3)
q3)) +fAcgz 1 (2 1 (q1 1 q3−q0 1 q2))
Call F(1, fQ0, fQ1, fQ2, fQ3, fW1, fW2, fW3)
fAcy=fAcgx 1 (2 1 (q1 1 q2−q0 1 q3))+fAcgy
End Function
1 (q0 1 q0−q1 1 q1+q2 1 q2−q3 1 q3)+
fAcgz 1 (2 1 (q2 1 q3+q0 1 q1)) Public Function K2(fQ0, fQ1, fQ2, fQ3, fW1, fW2,
fAcz=fAcgx 1 (2 1 (q1 1 q3+q0 1 q2)) fW3)
+fAcgy 1 (2 1 (q2 1 q3−q0 1 q1))+fAcgz Call F(2, fQ0, fQ1, fQ2, fQ3, fW1, fW2, fW3)
1 (q0 1 q0−q1 1 q1−q2 1 q2+q3 1 q3) End Function

Next Public Function K3(fQ0, fQ1, fQ2, fQ3, fW1, fW2,


End Sub fW3)
Call F(3, fQ0, fQ1, fQ2, fQ3, fW1, fW2, fW3)
‘Function of 4th order Runge-Kutta End Function
Public Function F(n, fQ0, fQ1, fQ2, fQ3, fWx, fWy,
fWz) Public Function K4(fQ0, fQ1, fQ2, fQ3, fW1, fW2,
fW3)
Dim fReturn0, fReturn1, fReturn2, fReturn3 As Call F(4, fQ0, fQ1, fQ2, fQ3, fW1, fW2, fW3)
Double End Function

JAUTO360 © IMechE 2006 Proc. IMechE Vol. 220 Part D: J. Automobile Engineering

View publication stats

You might also like