A New Application of the Extended Kalman Filter to the Estimation of Roll Angles of a Motorcycle with Inertial Measurement Unit

The capability of providing a real–time reliable measure of the actual roll angle is of great importance for the racing motorcycle dynamics. This study presents a method based on an Extended Kalman Filter (EKF) for the estimation of the actual roll angle of a motorcycle equipped with an Inertial Measurement Unit (IMU), with the advantage of not needing the development and implementation of a complete motorcycle model. Measured data which, depending on the additional instrumentation available on the motorcycle, do not form a complete set of input data for the estimation algorithm, induce the introduction of approximations affecting the accuracy of the results. A thorough error analysis is carried out by means of numerical simulations along with experimental validations. As a result, a novel approximate form for the kinematical model of the IMU is developed, yielding an overall good accuracy in the roll angle estimates.


INTRODUCTION
The roll angle plays a fundamental role in the dynamics of motorcycles, since it greatly affects the behaviour of the tyre-road contact forces [1]. Hence, the capability of providing a real-time reliable measure of the actual roll angle is of paramount importance for any advanced braking, traction and stability control systems. More over, this would provide essential data for active or semi-active suspension systems [2,3], for improving the development of innovative suspension systems [4], and for a deeper understanding of motorcycle unstable behaviours due to interactions between longitudinal and lateral dynamics (like chattering [5,6,7] in the presence of a lean angle).
Direct measurement with non-contact distance optical sensors, when applicable, is perhaps the most precise estimation technique of roll angles: capabilities and limits of optical sensors, due to interaction between the light diffused by the asphalt and the motorcycle speed, are investigated and discussed in [8].
Several methods of motorcycle model-based estimation have been developed, for application when direct measurement of the roll angle (for example, with non-contact distance optical sensors) cannot be available. One of the most effective tools in this field is the Extended Kalman Filter (EKF), which yields optimal estimates for the state of non-linear models with additive independent white noise in both the transition and the measurement systems [9,10].
Common purpose of several proposed methods, also patented [11][12][13], is to devise robust estimation methods with low cost (and small size) equipment [14]. An EKF is adopted in [15] to determine the roll angle by means of low cost sensors, using as state estimator a multibody motorcycle model with four rigid bodies. Another roll angle estimation method based on a minimum set of sensors is presented in [16], using a couple of gyrometers feeding a non-linear EKF. A very simple motorcycle mathematical model is adopted (single rigid body in cornering steady state leaning motion, taking into account tyre geometry and gyroscopic effects), yielding errors with maximum of about 4° and r.m.s. of 1.5° with respect to multibody simulation, maximum of about 10° and r.m.s. of 4° with respect to experimental roll estimation from laser sensors. A simultaneous estimation method of leaning and steering dynamics is proposed in [17], adopting a motorcycle multibody model consisting of two rigid bodies and 4 degrees of freedom, as described in [18], with a nonlinear unknown input observer syntesis based on a Takagi-Sugeno fuzzy structure. In [19] the same multibody model is applied to a nonlinear unknown input observer synthesis, in this case based on a high order sliding mode observer. The latter identification technique is adopted also in [20], applied to a multibody motorcycle model with 11 degrees of freedom.
Other methods are based on image (camera data) processing only, without using any motorcycle model. In [21] the roll angle/rate is estimated from gradient information of grey-value images, yielding mean errors of about 2°; an improved version of this identification algorithm is presented in [22], with comparison of the results with those obtained using an IMU-based rollangle estimation (implementing a simplified roll angle model neglecting gyroscopic effects, together with Combined filter method and Kalman filter methods). A different technique is proposed in [23], using four gyroscopes installed in special positions plus encoder, and applying a frequency separation filtering of measured data, yielding peak estimation errors of about 5°. The same authors developed a different version of their method [24], without using the speed signal and assuming steady state cornering, negligible gyroscopic effects on roll angle, horizontal track, null tyre thickness and rider centre of gravity on symmetry plane.
In this study a new EKF-based method is presented for the roll angle estimate of a racing motorcycle equipped with an Inertial Measurement Unit (IMU). Further instrumentation includes either a phonic wheel (providing the velocity of the front wheel centre, by means of rolling-radius maps) or a Global Positioning System sensor (GPS).
An EKF is implemented on-board, in this case aimed at estimating the actual state of the IMU (yielding realtime roll angle estimates), and not the state of the whole motorcycle, with the advantage of not needing the development and implementation of a complete motorcycle model, especially when used in conjunction with a GPS.
Measured data which, depending on the additional instrumentation available on the motorcycle, do not form a complete set of input data for the estimation algorithm, induce the introduction of approximations in the kinematical equations modelling the IMU. Hence, the main concern becomes the analysis of the consequent errors affecting the accuracy of the roll angle estimates, which has been carried out by means of numerical simulations and experimental validations. As a result, a novel approximate form for the kinematical model of the IMU is developed, yielding an overall good accuracy in the roll angle estimates.

MATERIALS AND METHODS
A Ducati racing motorcycle (maximum power: 250 hp, capacity: 1000 cm 3 , weight without rider and fuel: 157 kg, maximum speed: 350 km/h) was tested, as displayed in Figure 1 (instrumented with optical sensors), and an algorithm was developed for real-time estimates of roll angles.

Sensors
The racing motorcycle under test was equipped with an IMU fixed on its main frame (constituted by 3 accelerometers and 3 gyroscopes Micro Electrical Mechanical System MEMS, measuring 3 acceleration components and 3 angular velocity components) and a phonic wheel sensor (for estimating the longitudinal velocity component); further onboard sensors provided the relative instantaneous position of the centres of the IMU and of the front and rear wheels. Rolling radius maps (both front and rear), racetrack altimetry (height and slope) and yaw velocity were available as well.
For additional testing, the motorcycle was also equipped with a Global Positioning System (GPS, yielding the instantaneous position of a fixed point on the motorcycle), and of non-contact distance optical sensors measuring the instantaneous roll angle ϕ with respect to the surface of the track, set as represented in Figure 2: which provided the data used for testing the proposed estimation algorithm [8].

Reference systems
The measured and estimated kinematical parameters are defined with respect to three different coordinate systems, which referring to Figure 3 are: an inertial coordinate system (O; X,Y,Z); an intermediate system (C; x,y,z), with origin C placed at the ground contact point of the rear wheel, and axes orientation due to a simple rotation ψ with respect to Z (yaw angle); a third system (C; ξ,η,ζ ), with origin C and same orientation as the motorcycle's main frame (assumed as a rigid body). The orientation of system (C; ξ,η,ζ ) is given by two consecutive rotations φ and ϑ around x and y (roll and pitch angles respectively). Therefore, the sequence of rotations from (O; X,Y,Z) to (C; ξ,η,ζ ) follows the yawroll-pitch convention. If R is the rotation matrix from (C; where the roll angle φ can be obtained from ϕ as in (1) knowing the actual lateral slope of the track. In Figure 3 point P represents the centre of the IMU, fixed to the motorcycle's main frame. The coordinate system origin C has been positioned at the ground contact point of the rear wheel since this is convenient for estimating the longitudinal velocity component (say U) using the phonic wheel. Otherwise it would be more convenient positioning C on the GPS sensor.

Exact kinematical relations
Given a vector b whose components are the co-ordinates of C in the inertial reference system, plus the coordinates of P in the intermediate reference system (in the following referred to as x = x P , y = y P , z = z P ), plus the yaw, roll and pitch angles: The components of the absolute acceleration of P in the same reference system (C; ξ,η,ζ ), derived in the appendix, are given by: where u, v, w are the velocity components of C with respect to the (C; ξ,η,ζ ) coordinate system. Equations 5 can be rewritten in the form: ζ ω ηω ξ ξω ζω η ζ ηω ξω (6) where I + II represents the drag acceleration, III the Coriolis acceleration and IV the relative acceleration. Adding the gravitational acceleration to (6) yields the components measured by the IMU: which in the following will be referred to as 'equations A' (exact form).

Approximated kinematical relations
Approximated forms for equations A are sought, for testing the possibility of using the estimation algorithm with a reduced set of input data. If the quantities: can be neglected, then in (6) the terms given by II + III + IV are negligible with respect to the terms in I, leading to a first level of approximation (in the following referred to as 'equations B'): then their time derivatives take the form: If in (11) the terms depending on U,V,W (i.e. on the time derivatives of ϑ and φ), can be neglected, then: which, introduced in (9) along with (10), give a further level of approximation (in the following referred to as 'equations C'): Introducing (10) and (11) in (12), if V, W, their time derivatives and the time derivative of ϑ can be neglected, yields: which represents the highest level of approximation here considered (in the following referred to as 'equations D').

RESULTS AND DISCUSSION
The instrumented racing motorcycle as in Figure 1 was tested on racetracks; in particular, data were recorded at the Mugello and Misano Adriatico racetracks (Italy), shown in Figure 4. The possibility of using the estimation algorithm with a reduced set of input data was first assessed, followed by a thorough analysis of the induced errors.

Roll angle estimation via EKF
An EKF [9,10] is an optimal estimator for the state of a non-linear model with additive independent white noise. It operates on a non-linear dynamic system discretized in the time domain, described by two sets of equations, representing the state-transition and the observation models: where x is the state vector, u is the control vector, z is the observation or measurement vector, f is the statetransition function, h is the observation function, v and w are the process and measurement noises (assumed to be zero-mean Gaussian with covariance matrices Q and R, respectively). In the present study the state vector (to be estimated) contains the roll angle φ and the pitch angle ϑ of the motorcycle, while the observation vector is represented by the acceleration components measured by the IMU fixed on the main frame of the motorcycle: The input vector u contains the angular velocity components measured by the IMU, the gravitational acceleration g, the yaw velocity, the yaw angle (computed integrating the yaw velocity), the velocity components U, V, W and their first derivatives with respect to time.

Using a reduced set of input data
After checking the settings of the IMU and optical sensors (the latter used for reference), equations D (14) were implemented in the EKF for a first assessment of the possibility of using the estimation algorithm with a reduced set of input data: in this case the components of u simply consist of , , , , , , , Since U can be computed starting from the velocity of the front wheel center (using the phonic wheel), the GPS signals are unnecessary for this application. Figure 5, referring to data recorded at the Mugello racetrack, shows a comparison between measured roll angles (red line) and EKF estimates using equations D (blue line). The reported values of both roll angles and relative errors are normalized (for protecting reserved data) with respect to their maximum absolute values on the whole manoeuvre (not completely displayed); the errors of the estimates reported in Figure 5 reach maximum absolute values of about 7°, and average values between 3° and 4°. Which results are not sufficiently accurate, in general over-estimating the reference values, especially at high lean angles (φ > 45°).
An improvement was then sought by tuning the EKF following a trial-and-error procedure, acting on both filtering the input signals and setting the covariance matrices Q and R of the process and measurement errors. This led to a global improvement, as shown in Figure 3, green line, but at high lean angles (φ > 45°) the accuracy was not satisfactory yet.
Which means that the approximations that led to equations D (neglecting the lateral and vertical velocity components V and W, their time derivatives, and the time derivative of the pitch angle ϑ) are too strong.

Experimental results and error analysis
A different kind of analysis was then performed, based on tests carried out at the Misano Adriatico racetrack, and aimed at evaluating how much each level of approximation (equations B, C or D) can affect the accuracy of the estimates. First the accelerations a P , simulated feeding equations A with filtered experimental signals, were compared with those simulated using equations B (9), C (13) and D (14). Figures 6 and 7 show the comparison among acceleration components, while Figure 8 represents the absolute values of the relative errors in each component. Equations B provide an excellent approximation in any case, Equations C give very good results in the longitudinal and lateral components, while equations D yield the largest errors.
The roll angles were then estimated via EKF, using the accelerations a P simulated with equations A (7) as observation vector z in (15) and (16). The results were compared with the estimates obtained by a P simulated using equations B, C and D as observation vectors z. As shown in Figures 9 and 10, equations B (9) yield an optimal approximation, equations C (13) still a good approximation (average error less than 1°, maximum error less than 2°), while equations D are not accurate enough. The same conclusions could be drawn after noise addition to the measures z in (15) and (16), as shown in Figures 11 and 12. This confirms that the approximations leading to equations D (neglecting the lateral and vertical velocity components V and W, their time derivatives, and the time derivative of the pitch angle) are too strong for applications in racing motorcycles, while equations C (which require GPS measures) allow a relevant error reduction (average error less than 1°, and maximum error less than 2°). Equations C (13) can therefore be conveniently adopted as an approximate form for the kinematical model of the IMU.

CONCLUSION
In this study an EKF-based method has been presented and discussed for real-time roll angle estimates of a racing motorcycle, having the advantage of not needing the development and implementation of a complete motorcycle model. Instrumentation includes an IMU and either a phonic wheel or a GPS sensor.
A first assessment regarded the possibility of using the estimation algorithm with a reduced set of input data (IMU and phonic wheel signals). The results were not really accurate, showing the tendency to over-estimate the actual reference values, especially at high lean angles. Not even with an optimal tuning of the EKF the desired accuracy could be achieved.
A thorough analysis of the errors induced by incomplete sets of input data has then been performed with numerical simulations and experimental validations. An approximate form for the kinematical model of the IMU has been identified, which requires GPS measures, yielding an overall good accuracy in the roll angle estimates.
The proposed method can be successfully applied on racing motorcycles for real-time roll angle estimates, improving the quality of vehicle dynamics controls.

APPENDIX
Recalling Figure 2, the position of point P (centre of the IMU) can be expressed in the inertial reference system (O; X,Y,Z) as: where R is the rotation matrix from the moving reference system (C; ξ,η,ζ) to (O; X,Y,Z). Then: , , If ω is the absolute angular velocity of the motorcycle main frame expressed in the moving reference system, then the following matrix notation can be adopted: where v is a generic vector. The skew symmetric matrix Ω IMU can also be expressed in the inertial reference system which, recalling (A3), yields immediately (5).

The Motorcycle Dynamics Division Team of Ducati
Corse is kindly acknowledged for the valuable support offered in the development of this study.