A Novel Roll and Pitch Estimation Approach for a Ground Vehicle Stability Improvement Using a Low Cost IMU

Onboard attitude estimation for a ground vehicle is persuaded by its application in active anti-roll bar design. Conventionally, the attitude estimation problem for a ground vehicle is a complex one, and computationally, its solution is very intensive. Lateral load transfer is an important parameter which should be taken in account for all roll stability control systems. This parameter is directly related to vehicle roll angle, which can be measured using devices such as dual antenna global positioning system (GPS) which is a costly technique, and this led to the current work in which we developed a simple and robust attitude estimation technique that is tested on a ground vehicle for roll mitigation. In the first phase Luenberger and Sliding mode observer is implemented using simplest roll dynamics model to measure the roll angle of a vehicle and the validation of results is carried using commercial software, CarSim® (CarSim, Ann Arbor, MI, USA). In the second phase of research, complementary and Kalman filters have been designed for attitude estimation. In the third phase, a low-cost inertial measurement unit (IMU) is mounted on a vehicle, and both the complementary filter (CF) and Kalman filter (KF) are applied independently to measure the data for both smooth and uneven terrains at four different frequencies. We compared the simulated and real-time results of roll and pitch angles obtained using the complementary and Kalman filters. Using the proposed method, the achieved root mean square error (RMSE) is less than 0.73 degree for pitch and 0.68 degree for roll, with a sample time of 2 ms. Thus, a warning signal can be generated to mitigate roll over. Hence, we claim that our proposed method can provide a low-cost solution to the roll-over problem for a road vehicle.


Introduction
Nowadays, one major objective in road transport systems is to reduce the number of accident victims. For the same reason, vehicles on the market are equipped with control system variants, such as ESC (Electronic Stability Control) and RSC (Roll Stability Control) [1,2] for the improvement of vehicle safety standards. The discussed systems must have knowledge of expected vehicle behavior in advance during different conditions and maneuvers for the proper actuation of the control system [3][4][5]. Specifically, knowledge about the roll angle of the vehicle is useful in RSC systems. Rollover accidents are responsible for nearly 33% of all deaths from passenger vehicle crashes [6].
In this paper, we addressed the main issues about state estimation of vehicle roll angle. Vehicle attitude estimation is challenging due to rough terrain, road disturbances and noise. Model based observers are often too complicated to implement and the computation cost of such systems requires a powerful onboard processor. We simulated the vehicle dynamics and narrowed down the complex model to simple one using which the use of observers is computationally less intensive.
The methods proposed are fast and easy to implement, since they are free from iteration. In order to decrease significant effects of gyro bias, we suggested a bias compensation which is merged with filtering architecture. We validated the experiments carried out on real hardware in real time environment to show the performance comparison. Results show that the proposed Filters can estimate with as much accuracy as Kalman filter and higher order observers. We successfully tested the proposed algorithms in ordinary road conditions where we find a balance between estimation accuracy and time consumption. Compared with previously used iterative methods, the proposed filter has much less convergence time.
The introduction of MEMS (micro-electro-mechanical systems) technology has helped in shrinking the size and cost of inertial sensors [20]. Now miniature accelerometers and gyroscopes are available at a very low cost, but their performance is too much degraded for the use in automotive applications. While the drift performance of an automotive grade gyroscope is typically 1 • /h, a MEMS gyroscope provides a typical performance of 70 • /h [21]. Moreover, this bias is subject to temperature variations as well [22]. Although much work is being done in order to improve the MEMS gyroscope quality, and to make them robust to different vibrations and noise sources for automotive applications [23], the drift issue remains a major concern. A comparison of the performance characteristics for automotive grade MEMS gyroscopes is presented in Table 1 [24]. The trend of performance deterioration resulting from the decrease in cost is easily noticeable considering the TG6000 as most expensive and MPU-6050 as least. Even a nominal automotive grade gyroscope costs approximately 10,000 USD. Several sensors such as camera [25], LIDAR [26], and GPS [27] have been extensively used for attitude estimation for both static and accelerated vehicles. However, these are costly and involve intensive computational algorithms.
The goal of this paper is to enable the low cost gyroscope (price in the range of 10 USD) to function precisely in ground vehicle related applications. Results obtained using this research are compared to previously documented studies shown in the discussion section, based on which we concluded that our proposed method has a more significant outcome.

Materials and Methods
The InvenSense MPU-6050 (TDK InvenSense, San Jose, CA, USA) is a low-cost sensor which contains a MEMS gyroscope and a MEMS accelerometer mounted on a single chip. It uses the standard I2C-bus Interface. Processing hardware is attached to MPU-6050 and interfaced with the MATLAB®(The MathWorks, Inc., Torrance, CA, USA) using the instrument and control toolbox. The sensor is placed at approximate center of gravity location of the vehicle and the results are acquired under different urban road conditions. Figure 1 shows the overall system architecture and the breakup of research carried out. A mathematical model is developed using dynamics equations to show model consistency. The observer-based approach focuses on estimation carried using plant model (i.e., vehicle model) while real time estimation used sensor with on board motion processor to validate the results obtained by applying filters.

Mathematical Modelling and Validation
Mathematical Modeling For implementation of our algorithm, we used a simple bicycle model with roll dynamics (see Figure 2). Considering roll dynamics, equation for lateral motion is: where m is the mass of vehicle. a is the lateral acceleration, Fy is front tire force and Fy is rear tire force. yaw rate becomes: where I is the yaw inertia, ψ is the yaw rate, l is distance of front from center of gravity and l is the distance of rear from center of gravity of vehicle. roll rate can be written as, where, I is roll moment of inertia, ϕ is the roll rate, and ϕ is the roll angles, m is the mass of vehicle, and h is the height from center of gravity. C is the compliance and K is the stiffness coefficient.
Substituting the value of a , Fy , and Fy , the above equations for lateral acceleration becomes:

Mathematical Modeling
For implementation of our algorithm, we used a simple bicycle model with roll dynamics (see Figure 2). Considering roll dynamics, equation for lateral motion is: where m is the mass of vehicle. a y is the lateral acceleration, Fy f is front tire force and Fy r is rear tire force. yaw rate becomes: I z . .
where I z is the yaw inertia, ..
ψ is the yaw rate, l f is distance of front from center of gravity and l r is the distance of rear from center of gravity of vehicle. roll rate can be written as, where, I xx is roll moment of inertia, . φ is the roll rate, and φ is the roll angles, m is the mass of vehicle, and h is the height from center of gravity. C q is the compliance and K q is the stiffness coefficient.
Substituting the value of a y , Fy f , and Fy r , the above equations for lateral acceleration becomes: where . v y is the lateral acceleration δ is the steer angle . ψ is the yaw rate, v x is the longitudinal velocity, and v y is the lateral velocity.
Similarly, yaw acceleration can be expressed as: . .
ψ is the acceleration I zz is the yaw moment of inertia, v x is the longitudinal velocity and v y is the lateral velocity.
Roll Acceleration for a single-track model can be expressed as, where ..
φ is the roll acceleration, I xx is the roll moment of inertia.
where v is the lateral acceleration δ is the steer angle ψ is the yaw rate, v is the longitudinal velocity, and v is the lateral velocity. Similarly, yaw acceleration can be expressed as: where ψ is the acceleration I is the yaw moment of inertia, v is the longitudinal velocity and v is the lateral velocity. Roll Acceleration for a single-track model can be expressed as, where ϕ is the roll acceleration, I is the roll moment of inertia.

Observer Based Estimation
State observer provides estimate of internal state of the system. Sensors normally measures the state of the system which may contain noise. An observer is used to obtain a filtered version of state by using actual measurements as well as estimated measurements from output.

Luenberger Observers
Luenberger structure [28] is used for parameter estimation using following equations.

Continuous Time System:
The state space form for observer design for a vehicle is given as: where the matrices A, B, and C are state space model parameters. The Luenberger observer for such system can be given as, Estimation error can be expressed as,

Observer Based Estimation
State observer provides estimate of internal state of the system. Sensors normally measures the state of the system which may contain noise. An observer is used to obtain a filtered version of state by using actual measurements as well as estimated measurements from output.

Luenberger Observers
Luenberger structure [28] is used for parameter estimation using following equations. Continuous Time System: The state space form for observer design for a vehicle is given as: where the matrices A, B, and C are state space model parameters. The Luenberger observer for such system can be given as, Estimation error can be expressed as, The Luenberger observer implementation can be seen as a block diagram in Figure 3.
Sensors 2020, 20, x FOR PEER REVIEW 6 of 30 The Luenberger observer implementation can be seen as a block diagram in Figure 3. Roll rate error dynamics can be expressed as, The estimation error will only converge to zero if = (A − LC) has the eigen values which fall in the left plane. L is observer gain matrix and can be obtained using pole placement method. The full order observer block implementation can be seen in Figure 4.  Roll rate error dynamics can be expressed as, The estimation error will only converge to zero ifÂ = (A − LC) has the eigen values which fall in the left plane. L is observer gain matrix and can be obtained using pole placement method. The full order observer block implementation can be seen in Figure 4.
The Luenberger observer implementation can be seen as a block diagram in Figure 3.
The estimation error will only converge to zero if = (A − LC) has the eigen values which fall in the left plane. L is observer gain matrix and can be obtained using pole placement method. The full order observer block implementation can be seen in Figure 4.  Single-track model roll acceleration can be written as, Assuming a y = v y . + v x ψ . , The state space equation form can be written as follows. Let, After differentiation the above equation becomes, Differentiating again the equation can be written as, x .
where a y is the system input, I xx is the Roll Inertia. Parameter K q is the spring constant and C q is the damping constant. The output equation can be written as, Observer Design Step 1: After expressing the system in state space form, system observability is investigated. Observability is the property by which the state variables can be estimated from the knowledge of input u(t) and output y(t).
For any n × n matrix A, and for any p × n matrix C observability matrix for any state space system can be expressed as, If matrix rank of O is equal to that of n than we can say that system under consideration is observable.
Step 2: For the convergence of estimation error to zero,Â = A − LC must have all its eigen values in the left-half plane. Based on this, the poles or eigen values of the system matrix A are computed.
Step 3: To start with observer design first, we must select the gain matrix L. We will use the pole placement method for this purpose. Matlab ® (The MathWorks, Inc., Torrance, CA, USA) command L = place (A', C', [p])' places the desired closed loop poles p by computation of a state feedback gain matrix L.
Step 4: A = (A − LC) obtained is our new system matrix, where L in our case is a 2 × 1 matrix.
u y e , where u is referred as the system input and y e = y − Cx.

Sliding Mode Observer
Luenberger observer is precise for the linear systems with low noise. As soon as noise increased the system starts losing track of desired output. In order to resolve this issue, we need observer with noise rejection property that can deal with complex systems as well. Hence, we opted for the sliding mode observer, which is more robust in terms of performance. Experiments performed concluded that sliding mode observer (SMO) kept better system track in all scenarios.
Sliding mode observer [29] was used to estimate the roll angle for ground vehicle. Consider a continuous time system, The state space can be written as, where the columns of N c ∈ R n×(n−p) span the null space of C. The non-singular transformation, CT −1 c = 0 I p becomes the new distribution matrix.
The other system matrices can be expressed as, T c AT −1 c = Then, the nominal system can be written as under. .
Considering the state matrix represented in Equation (16), The proposed Utkin observer has the form, .
Vector L is computed in such a way that A 11 + LA 21 lies in spectrum C. The discontinuous vector v is defined by, v = M sgn(ŷ − y) (26) The value of variable M used in experiments remained 0.1. The overall block diagram for sliding mode observer can be seen in Figure 5.

The Complementary Filter
In order to get rid of complex vehicle models and observers as well as state estimators, we opted for a simple, yet precise estimation technique known as complementary filters. Complementary filter is a fusion algorithm which provides best among the measurements [30]. The gyroscope data will be used during short term maneuvers because of its precision and such data obtained is not liable to be influenced by external forces. Whereas during the long-term maneuvers, we will rely on the data obtained from the accelerometer as it does not drift. Equation (27) provides the simplest form for complementary filters angle = α * (angle + gyroData * dt) + (1 − α) * accData) The overall block diagram for complementary filter can be seen in Figure 6 for better understanding. Based on the value of current angle, the gyro data will be integrated over every time step after this process it will be fused with the low pass filter data relying on accelerometer. The constants α and 1 − α are tuning parameters of filter and are chosen such a way that their sum would add up to 1.
The implementation of complementary filter is carried out using a MPU6050 Inertial measurement unit (IMU) in real time environment. After every iteration the roll and pitch angle values are updated based on the gyroscope values that are obtained by integration with time. Filter update is performed for roll and pitch angles of the gyro data by assigning a percentage weight for the current value with the addition to percentage weight of the angle obtained by the accelerometer to ensure that the measured angle will not drift, keeping it very precise for short-and long-term maneuvers.

The Complementary Filter
In order to get rid of complex vehicle models and observers as well as state estimators, we opted for a simple, yet precise estimation technique known as complementary filters. Complementary filter is a fusion algorithm which provides best among the measurements [30]. The gyroscope data will be used during short term maneuvers because of its precision and such data obtained is not liable to be influenced by external forces. Whereas during the long-term maneuvers, we will rely on the data obtained from the accelerometer as it does not drift. Equation (27) provides the simplest form for complementary filters The overall block diagram for complementary filter can be seen in Figure 6 for better understanding. Based on the value of current angle, the gyro data will be integrated over every time step after this process it will be fused with the low pass filter data relying on accelerometer. The constants α and 1 − α are tuning parameters of filter and are chosen such a way that their sum would add up to 1.
The implementation of complementary filter is carried out using a MPU6050 Inertial measurement unit (IMU) in real time environment. After every iteration the roll and pitch angle values are updated based on the gyroscope values that are obtained by integration with time. Filter update is performed for roll and pitch angles of the gyro data by assigning a percentage weight for the current value with the addition to percentage weight of the angle obtained by the accelerometer to ensure that the measured angle will not drift, keeping it very precise for short-and long-term maneuvers.

Second-Order Complementary Filter:
The roll angle estimate is obtained by blending two preliminary estimates which are each valid in different operation range. In this blending process the weights are selected in such a manner that it always favors the estimate which is closely precise. Roll angle estimate can be obtained by the integration of the measured and compensated roll rate Equation (33). From Equation (37), we get a simplified equation for roll angle estimate by making the assumption that is small. The following kinematic relation can be obtained.
The second-order complementary filter block diagram can be seen in Figure 7 for real time implementation. Since both the filters should add up to have a unity gain, the low pass filter for such system can be written as, where the high pass filter is expressed as The complementary filtering technique discussed in the manuscript uses manually fed gain parameter alpha (α), that is generally user fixed or can be obtained on trial and error basis. Although several techniques are proposed in the literature but they suffer from certain issues, such as optimizing membership function in the fuzzy logic-based adaptation technique or being dependent on an external sensor [31].
Let us start by defining the orientation of the vehicle with respect to Inertial frame of reference. The angle along the longitudinal axis with horizontal plane is roll angle ∅ and the angle around the lateral axis with horizontal plane is called pitch θ. Considering the roll angles and road bank angles the following relations hold.

Second-Order Complementary Filter:
The roll angle estimate is obtained by blending two preliminary estimates which are each valid in different operation range. In this blending process the weights are selected in such a manner that it always favors the estimate which is closely precise. Roll angle estimate can be obtained by the integration of the measured and compensated roll rate Equation (33). From Equation (37), we get a simplified equation for roll angle estimate by making the assumption that v y is small. The following kinematic relation can be obtained.
The second-order complementary filter block diagram can be seen in Figure 7 for real time implementation. Since both the filters should add up to have a unity gain, the low pass filter for such system can be written as, where the high pass filter is expressed as The complementary filtering technique discussed in the manuscript uses manually fed gain parameter alpha (α), that is generally user fixed or can be obtained on trial and error basis. Although several techniques are proposed in the literature but they suffer from certain issues, such as optimizing membership function in the fuzzy logic-based adaptation technique or being dependent on an external sensor [31].
Let us start by defining the orientation of the vehicle with respect to Inertial frame of reference. The angle along the longitudinal axis with horizontal plane is roll angle ∅ and the angle around the lateral axis with horizontal plane is called pitch θ. Considering the roll angles and road bank angles the following relations hold.
where ω x , ω y , ω z are rotation rates along x, y, and z-axis correspondingly. The velocity components around center of mass are v x , v y , and v z . Further, a x and a y denotes acceleration components for center of mass inclusive of all the gravity effects.
Sensors 2020, 20, x FOR PEER REVIEW  11 of 30 where ω , ω , ω are rotation rates along x, y, and z-axis correspondingly. The velocity components around center of mass are v , v , and v . Further, a and a denotes acceleration components for center of mass inclusive of all the gravity effects. Roll rate integration can be expressed using Equation (35).
Simplifying the equations further, we assume that the pitch angle is very small so we can write tanθ ≅ θ . Let's assume that the roll angle will have a moderate value cosθ = 1 and vertical component v is also small. Then, Equations (32)-(34) can be expressed as: The term sin∅tanθω is neglected in Equation (31) since it is a small value of higher order. Now the following observations would hold: • The product of pitch angle and yaw rate is small. The roll angle can be obtained by integration of the roll rate obtained by the gyroscope.

•
If the vehicle is in steady state condition, the time derivative of would be small and roll angle can be calculated through Equation (37).
• Pitch angle can be determined from the Equation (38) when roll angle gets known.

Kalman Filter Implementation
The Kalman filter utilizes the state estimate of a discrete time system that can be written as a linear stochastic difference equation along with measurement equation as following: = + + (38) = + (39) where x ∈ R represents the system state, A is called system Matrix, B is said to be input matrix, H is the output matrix, U is the input to the system, v is known as measurement noise, w is called process noise, z is the output of the system. Roll rate integration can be expressed using Equation (35).
Simplifying the equations further, we assume that the pitch angle is very small so we can write tan θ θ. Let's assume that the roll angle will have a moderate value cos θ = 1 and vertical component v z is also small. Then, Equations (32)-(34) can be expressed as: The term sin ∅tan θω y is neglected in Equation (31) since it is a small value of higher order. Now the following observations would hold: • The product of pitch angle and yaw rate is small. The roll angle can be obtained by integration of the roll rate obtained by the gyroscope.

•
If the vehicle is in steady state condition, the time derivative of v y would be small and roll angle can be calculated through Equation (37). • Pitch angle can be determined from the Equation (38) when roll angle gets known.

Kalman Filter Implementation
The Kalman filter utilizes the state estimate of a discrete time system that can be written as a linear stochastic difference equation along with measurement equation as following: where x ∈ R represents the system state, A is called system Matrix, B is said to be input matrix, H is the output matrix, U is the input to the system, v k is known as measurement noise, w k is called process noise, z k is the output of the system. Further, w k and v k are the two random variables and are assumed to have Gaussian distribution with zero mean, they can be written as p(w) − N(0, Q); p(v) − N(0, R).

Real Time Implementation:
Real time implementation involves the following steps.
Step 1:θ k|k−1 is priori angle estimate which will be equal to previous state estimateθ k−1|k−1 with addition of unbiased rate times ∆t. Since bias cannot be measured directly, the estimate of priori bias will be equal to the previous bias.

Prediction Current Statex
Measurement Update Calculating Kalman Gain

Model Validation
CarSim ® (CarSim, Ann Arbor, MI, USA) is a system-level vehicle dynamics simulation software that is widely used in automotive industry. CarSim ® is the "company standard" vehicle dynamics software in several automotive companies, and is in use for various purposes at many more of the world's OEM companies and their suppliers. The same has been used in [32,33] to simulate the results. We have developed the vehicle's analytical model that was simulated in MATLAB ® (The MathWorks, Inc., Torrance, CA, USA). Validation is performed by conducting several standard tests and comparing them with CarSim ® including step steer, Fishhook, and Double lane change.

ISO (International Organization for Standardization)
Step Input is International Standard that specifies open-loop test methods for determining the transient response behavior of road vehicles. It is applicable to passenger cars, as defined in ISO 3833, and to light trucks. A step steer input of 100-degree step is fed to both observers and Carsim ® against which a roll angle of around 3 degree is observed as seen in Figure 8. It is observed that the sliding mode observer performed better by keeping better track of roll angle as compared to Luenberger during step steer input. The root mean square error obtained for sliding mode observer is 0.0906 degree where as Luenberger came up with a root mean square error of 0.2127 degrees.
Sensors 2020, 20, x FOR PEER REVIEW 13 of 30 MathWorks, Inc., Torrance, CA, USA). Validation is performed by conducting several standard tests and comparing them with CarSim ® including step steer, Fishhook, and Double lane change.

ISO (International Organization for Standardization)
Step Input is International Standard that specifies open-loop test methods for determining the transient response behavior of road vehicles. It is applicable to passenger cars, as defined in ISO 3833, and to light trucks. A step steer input of 100degree step is fed to both observers and Carsim ® against which a roll angle of around 3 degree is observed as seen in Figure 8. It is observed that the sliding mode observer performed better by keeping better track of roll angle as compared to Luenberger during step steer input. The root mean square error obtained for sliding mode observer is 0.0906 degree where as Luenberger came up with a root mean square error of 0.2127 degrees. NHTSA (National Highway Traffic Safety Administration) released details of a dynamic maneuver designed to determine a vehicles susceptibility to rollover. The maneuver is known as the Fishhook (nhtsa.gov). Considering the NHTSA Fishhook maneuver (Figure 9) both sliding mode and Luenberger are fed with roll rate and lateral acceleration as input. It is again witnessed that the sliding mode observer is keeping better track of roll angle and root mean square error between sliding mode observer and Luenberger observer as compared to CarSim ® is found to be 0.0872 degrees and 0.1458 degrees respectively. NHTSA (National Highway Traffic Safety Administration) released details of a dynamic maneuver designed to determine a vehicles susceptibility to rollover. The maneuver is known as the Fishhook (nhtsa.gov). Considering the NHTSA Fishhook maneuver (Figure 9) both sliding mode and Luenberger are fed with roll rate and lateral acceleration as input. It is again witnessed that the sliding mode observer is keeping better track of roll angle and root mean square error between sliding mode observer and Luenberger observer as compared to CarSim ® is found to be 0.0872 degrees and 0.1458 degrees respectively. ISO Double lane change specifies the dimensions of the test track for a closed-loop test method to subjectively determine a double lane-change which is one part of the vehicle dynamics and roadholding ability of passenger cars. It is applicable to passenger cars. ISO Double Lane change input ( Figure 10) for roll rate and acceleration is fed to sliding mode and Luenberger observer. Root mean square error for Sliding mode observer is 0.0898 degree while the root mean square error for Luenberger observer is 0.1823 degree. This clearly indicates that the sliding mode observer tracks the roll angle better in comparison to Luenberger.   ISO Double lane change specifies the dimensions of the test track for a closed-loop test method to subjectively determine a double lane-change which is one part of the vehicle dynamics and roadholding ability of passenger cars. It is applicable to passenger cars. ISO Double Lane change input ( Figure 10) for roll rate and acceleration is fed to sliding mode and Luenberger observer. Root mean square error for Sliding mode observer is 0.0898 degree while the root mean square error for Luenberger observer is 0.1823 degree. This clearly indicates that the sliding mode observer tracks the roll angle better in comparison to Luenberger.  The error comparison plot for ISO double lane change maneuver is shown below in Figure 11. Finally, altered Sine with dwell stability control testing (ISO 19365:16) for roll rate and acceleration is fed to observers, as seen in Figure 12. Sliding mode observer tracked the roll angle with Root mean square error of 0.1537 and Luenberger produced root mean square error of 0.4471.  The error comparison plot for ISO double lane change maneuver is shown below in Figure 11. Finally, altered Sine with dwell stability control testing (ISO 19365:16) for roll rate and acceleration is fed to observers, as seen in Figure 12. Sliding mode observer tracked the roll angle with Root mean square error of 0.1537 and Luenberger produced root mean square error of 0.4471.   Table 2 shows the root mean square error (RMSE) comparison of Luenberger and sliding mode observer. We can see that the RMSE is less in SMO as compared to Luenberger Observer. Max error in case of step input remained 0.2223 for sliding mode observer whereas, maximum error in case of step input for Luenberger is 0.3126. We investigated the response of observers in presence of white Gaussian noise. Noise of magnitude 0.01 is introduced along the sine wave input in Figure 13 and step input in Figure 14. It can be clearly observed that sliding mode observer keeps better track of the system as compared to Luenberger observer.
Sensors 2020, 20, x FOR PEER REVIEW 16 of 30 Table 2 shows the root mean square error (RMSE) comparison of Luenberger and sliding mode observer. We can see that the RMSE is less in SMO as compared to Luenberger Observer. Max error in case of step input remained 0.2223 for sliding mode observer whereas, maximum error in case of step input for Luenberger is 0.3126. We investigated the response of observers in presence of white Gaussian noise. Noise of magnitude 0.01 is introduced along the sine wave input in Figure 13 and step input in Figure 14. It can be clearly observed that sliding mode observer keeps better track of the system as compared to Luenberger observer. Simulation results prove that Luenberger observer (LO) and sliding mode observer (SMO) exhibit strong robustness to variations. SMO may have better performance compared to LO because of the inherent properties of sliding mode theory. Simulation results prove that Luenberger observer (LO) and sliding mode observer (SMO) exhibit strong robustness to variations. SMO may have better performance compared to LO because of the inherent properties of sliding mode theory.

Simulated Results Comparison of Complementary Filter with CARSIM ®
A swept sine having 0.5 Hz frequency and amplitude of 100 deg is fed as a steer input ( Figure 15). It can be seen from figure that the roll angle obtained from pure integration behaves in similar manner to the roll angle obtained from blend of two equations using high pass and low pass filters. This is because, during fast maneuvers, there is less drift produced in gyroscope measurements. A 100-degree step steer input is fed to system and it is clearly seen that during the step maneuver the angle obtained from the pure integration of roll rate through the gyroscope suffers from drift, whereas the blend recovers within a short time to keep track of the roll angle ( Figure 16).

Simulated Results Comparison of Complementary Filter with CARSIM ®
A swept sine having 0.5 Hz frequency and amplitude of 100 deg is fed as a steer input ( Figure 15). It can be seen from figure that the roll angle obtained from pure integration behaves in similar manner to the roll angle obtained from blend of two equations using high pass and low pass filters. This is because, during fast maneuvers, there is less drift produced in gyroscope measurements.

Simulated Results Comparison of Complementary Filter with CARSIM ®
A swept sine having 0.5 Hz frequency and amplitude of 100 deg is fed as a steer input ( Figure 15). It can be seen from figure that the roll angle obtained from pure integration behaves in similar manner to the roll angle obtained from blend of two equations using high pass and low pass filters. This is because, during fast maneuvers, there is less drift produced in gyroscope measurements. A 100-degree step steer input is fed to system and it is clearly seen that during the step maneuver the angle obtained from the pure integration of roll rate through the gyroscope suffers from drift, whereas the blend recovers within a short time to keep track of the roll angle ( Figure 16). A 100-degree step steer input is fed to system and it is clearly seen that during the step maneuver the angle obtained from the pure integration of roll rate through the gyroscope suffers from drift, whereas the blend recovers within a short time to keep track of the roll angle ( Figure 16).

Experimental Setup
The experimental setup containing arduino duemilanove and MPU6050 can be seen in Figure 17. The sensor is mounted at approximate Center of gravity location of vehicle. Arduino Duemilanove is a single-board computer manufactured by Arduino in Italy. It can be powered by either a USB connection or with an external power supply. The detailed description and specifications can be seen in appendix. The MPU-6050 sensor contains a Digital Motion Processor™ (DMP™), which processes complex six-axis Motion Fusion algorithms. The inner DMP uses a high-performance algorithm to fuse accelerometers measure data and gyroscope measure data and output attitude quaternion which has a good real-time performance.  Figure 18 shows the test track details obtained by google maps. Let's now consider the starting frequency of 5 Hz and observe the roll angle behavior using different tuning parameters of filter. A

Experimental Setup
The experimental setup containing arduino duemilanove and MPU6050 can be seen in Figure 17. The sensor is mounted at approximate Center of gravity location of vehicle. Arduino Duemilanove is a single-board computer manufactured by Arduino in Italy. It can be powered by either a USB connection or with an external power supply. The detailed description and specifications can be seen in appendix. The MPU-6050 sensor contains a Digital Motion Processor™ (DMP™), which processes complex six-axis Motion Fusion algorithms. The inner DMP uses a high-performance algorithm to fuse accelerometers measure data and gyroscope measure data and output attitude quaternion which has a good real-time performance.

Experimental Setup
The experimental setup containing arduino duemilanove and MPU6050 can be seen in Figure 17. The sensor is mounted at approximate Center of gravity location of vehicle. Arduino Duemilanove is a single-board computer manufactured by Arduino in Italy. It can be powered by either a USB connection or with an external power supply. The detailed description and specifications can be seen in appendix. The MPU-6050 sensor contains a Digital Motion Processor™ (DMP™), which processes complex six-axis Motion Fusion algorithms. The inner DMP uses a high-performance algorithm to fuse accelerometers measure data and gyroscope measure data and output attitude quaternion which has a good real-time performance.  Figure 18 shows the test track details obtained by google maps. Let's now consider the starting frequency of 5 Hz and observe the roll angle behavior using different tuning parameters of filter. A  Figure 18 shows the test track details obtained by google maps. Let's now consider the starting frequency of 5 Hz and observe the roll angle behavior using different tuning parameters of filter. A slight deviation can be seen in Figure 19 for (DMP™) data as it takes 10-15 s to settle down [34]. We observed the root mean square error for roll angle estimate to be 1.1693 degrees.
Sensors 2020, 20, x FOR PEER REVIEW 19 of 30 slight deviation can be seen in Figure 19 for (DMP™) data as it takes 10-15 s to settle down [34]. We observed the root mean square error for roll angle estimate to be 1.1693 degrees.  Similarly, in Figure 20. We obtain the pitch angle response by setting frequency at 5 Hz. The Digital Motion Processor (DMP) takes 10-15 s to stabilize. This time is utilized by the algorithm to calculate gyro and accelerometer offsets to remove zero error.
The pitch angle estimation appears precise at most of the points with an RMS error value of 0.8951.  slight deviation can be seen in Figure 19 for (DMP™) data as it takes 10-15 s to settle down [34]. We observed the root mean square error for roll angle estimate to be 1.1693 degrees.  Similarly, in Figure 20. We obtain the pitch angle response by setting frequency at 5 Hz. The Digital Motion Processor (DMP) takes 10-15 s to stabilize. This time is utilized by the algorithm to calculate gyro and accelerometer offsets to remove zero error.
The pitch angle estimation appears precise at most of the points with an RMS error value of 0.8951. Repeating the procedure again, this time frequency is set to 10 Hz. We found that the roll angle error has decreased and now root mean square error is 1.0944 degrees (Figure 21). Similarly, the pitch angle estimate (Figure 22) obtained at f = 10 Hz has the root mean square error of 0.9969 degree. This means, at this frequency, the roll angle result has improved from the roll angle result at 5 Hz frequency. The pitch angle estimation appears precise at most of the points with an RMS error value of 0.8951. Repeating the procedure again, this time frequency is set to 10 Hz. We found that the roll angle error has decreased and now root mean square error is 1.0944 degrees ( Figure 21). Repeating the procedure again, this time frequency is set to 10 Hz. We found that the roll angle error has decreased and now root mean square error is 1.0944 degrees (Figure 21). Similarly, the pitch angle estimate (Figure 22) obtained at f = 10 Hz has the root mean square error of 0.9969 degree. This means, at this frequency, the roll angle result has improved from the roll angle result at 5 Hz frequency. Similarly, the pitch angle estimate (Figure 22) obtained at f = 10 Hz has the root mean square error of 0.9969 degree. This means, at this frequency, the roll angle result has improved from the roll angle result at 5 Hz frequency. Increasing the set frequency to 20 Hz (Figure 23), we concluded that the root mean square error between digital motion processor and the best value of alpha 0.96 increased to 1.8868 degrees, which is already greater than the roll angle errors obtained under previous frequencies. Setting up the frequency at 20 Hz (Figure 24), we estimated the pitch angle using different filter tuning parameters and found that the root mean square is now 1.1371 degrees, which is greater than the previous two readings, i.e., frequency of 5 Hz and 10 Hz. Increasing the set frequency to 20 Hz (Figure 23), we concluded that the root mean square error between digital motion processor and the best value of alpha 0.96 increased to 1.8868 degrees, which is already greater than the roll angle errors obtained under previous frequencies. Increasing the set frequency to 20 Hz (Figure 23), we concluded that the root mean square error between digital motion processor and the best value of alpha 0.96 increased to 1.8868 degrees, which is already greater than the roll angle errors obtained under previous frequencies. Setting up the frequency at 20 Hz (Figure 24), we estimated the pitch angle using different filter tuning parameters and found that the root mean square is now 1.1371 degrees, which is greater than the previous two readings, i.e., frequency of 5 Hz and 10 Hz. Setting up the frequency at 20 Hz (Figure 24), we estimated the pitch angle using different filter tuning parameters and found that the root mean square is now 1.1371 degrees, which is greater than the previous two readings, i.e., frequency of 5 Hz and 10 Hz. Repeating the experiment again, we now set the sampling frequency to 25 Hz and estimated roll angle at different values of alpha with new sample frequency. It has been observed that the roll angle results ( Figure 25) are much better than previous frequency results in terms of root mean square error. Looking at the graph, we can interpret that system kept track of angle in almost all the situations. We found that the root mean square has decreased to 0.6738 degrees for roll angle estimates.  Repeating the experiment again, we now set the sampling frequency to 25 Hz and estimated roll angle at different values of alpha with new sample frequency. It has been observed that the roll angle results ( Figure 25) are much better than previous frequency results in terms of root mean square error. Looking at the graph, we can interpret that system kept track of angle in almost all the situations. We found that the root mean square has decreased to 0.6738 degrees for roll angle estimates. Repeating the experiment again, we now set the sampling frequency to 25 Hz and estimated roll angle at different values of alpha with new sample frequency. It has been observed that the roll angle results ( Figure 25) are much better than previous frequency results in terms of root mean square error. Looking at the graph, we can interpret that system kept track of angle in almost all the situations. We found that the root mean square has decreased to 0.6738 degrees for roll angle estimates.  Similarly, we analyzed the estimation results for pitch angle at frequency 25 Hz, we can clearly see in Figure 26 that complementary filter tracked roll angle at almost all data points. Observed root mean square error is now 0.7280 degrees for roll angle, which is also smaller less than all the frequency data collected before. We can see a slight deviation of digital motion processor data in the start since it takes 10-15 s to settle down the values to true values. Similarly, we analyzed the estimation results for pitch angle at frequency 25 Hz, we can clearly see in Figure 26 that complementary filter tracked roll angle at almost all data points. Observed root mean square error is now 0.7280 degrees for roll angle, which is also smaller less than all the frequency data collected before. We can see a slight deviation of digital motion processor data in the start since it takes 10-15 s to settle down the values to true values. Frequency is now set to 40 Hz for roll angle estimate using different filter tuning parameters ( Figure 27). Roll angle root mean square error is now 1.0140, which is greater than the results obtained at frequency 25 Hz.  Frequency is now set to 40 Hz for roll angle estimate using different filter tuning parameters ( Figure 27). Roll angle root mean square error is now 1.0140, which is greater than the results obtained at frequency 25 Hz. Similarly, we analyzed the estimation results for pitch angle at frequency 25 Hz, we can clearly see in Figure 26 that complementary filter tracked roll angle at almost all data points. Observed root mean square error is now 0.7280 degrees for roll angle, which is also smaller less than all the frequency data collected before. We can see a slight deviation of digital motion processor data in the start since it takes 10-15 s to settle down the values to true values. Frequency is now set to 40 Hz for roll angle estimate using different filter tuning parameters ( Figure 27). Roll angle root mean square error is now 1.0140, which is greater than the results obtained at frequency 25 Hz.  We set the sampling frequency to 40 Hz now. The RMSE now is smaller for pitch angle estimate ( Figure 28) but still results are not better than 25 Hz frequency. The RMSE now obtained is 0.7657 degrees for pitch angle estimation. We set the sampling frequency to 40 Hz now. The RMSE now is smaller for pitch angle estimate ( Figure 28) but still results are not better than 25 Hz frequency. The RMSE now obtained is 0.7657 degrees for pitch angle estimation.

Real Time Complemenary Filter Implementation
A Kalman filter with the following parameters is applied on a digital controller and InvenSense MPU-6050 (TDK InvenSense) is mounted on the vehicle. The sampling frequency is 25 Hz. The tuning parameters used are as follows: Q_angle = 0.0005; Q_bias = 0.0015; R_measure = 0.015. The Allan variance (AV) is a well-known technique that is commonly used to identify and to quantify inertial sensors' stochastic noises, as quantization noise, random walks errors, and bias instability, among others. It is mandatory to process data from static measurements in order to apply Allan variance [35]. Theoretical details about the AV technique can be found in the literature [36,37] and are beyond the scope of this paper.
While observing the roll angle a root mean square of 0.9026 degrees is obtained. As seen in Figure  29. In contrast, the pitch angle root mean square error is 0.9213 degrees as seen in Figure 30. Kalman filter can be further tuned to get more precise results, however, algorithm complexity and computation burden is involved for real time implementation.
To investigate the efficacy of the complementary filter, we applied Kalman and complementary filter simultaneously to evaluate the vehicle roll angle. Figure 31 shows the results obtained for vehicle roll angle. The RMSE obtained for the complementary filter is 0.61 degrees and for Kalman filter is 0.70 degree. Figure 32 shows the response of both Kalman and Complementary filter with respect to DMP data when pitch angle is estimated. RMSE obtained for Kalman filter is 0.69 degree, whereas RMSE for complementary is 0.596 degrees.

Real Time Complemenary Filter Implementation
A Kalman filter with the following parameters is applied on a digital controller and InvenSense MPU-6050 (TDK InvenSense) is mounted on the vehicle. The sampling frequency is 25 Hz. The tuning parameters used are as follows: Q_angle = 0.0005; Q_bias = 0.0015; R_measure = 0.015. The Allan variance (AV) is a well-known technique that is commonly used to identify and to quantify inertial sensors' stochastic noises, as quantization noise, random walks errors, and bias instability, among others. It is mandatory to process data from static measurements in order to apply Allan variance [35]. Theoretical details about the AV technique can be found in the literature [36,37] and are beyond the scope of this paper.
While observing the roll angle a root mean square of 0.9026 degrees is obtained. As seen in Figure 29. In contrast, the pitch angle root mean square error is 0.9213 degrees as seen in Figure 30. Kalman filter can be further tuned to get more precise results, however, algorithm complexity and computation burden is involved for real time implementation.
To investigate the efficacy of the complementary filter, we applied Kalman and complementary filter simultaneously to evaluate the vehicle roll angle. Figure 31 shows the results obtained for vehicle roll angle. The RMSE obtained for the complementary filter is 0.61 degrees and for Kalman filter is 0.70 degree. Figure 32 shows the response of both Kalman and Complementary filter with respect to DMP data when pitch angle is estimated. RMSE obtained for Kalman filter is 0.69 degree, whereas RMSE for complementary is 0.596 degrees.

Discussion
Attitude estimation in ground vehicle is challenging due to rough terrain and noise. Table 3 below shows RMSE comparison of our research with current literature. Algorithms used in these are mainly genetic algorithm (GA), Bayesian propagation (BP), neural networks (NN), unscented Kalman filter (UKF), extended kalman filter (EKF), non-linear complementary filter (NCF), and differential nonlinear complementary filter.

Discussion
Attitude estimation in ground vehicle is challenging due to rough terrain and noise. Table 3

Discussion
Attitude estimation in ground vehicle is challenging due to rough terrain and noise. Table 3 below shows RMSE comparison of our research with current literature. Algorithms used in these are mainly genetic algorithm (GA), Bayesian propagation (BP), neural networks (NN), unscented Kalman filter (UKF), extended kalman filter (EKF), non-linear complementary filter (NCF), and differential nonlinear complementary filter. The results demonstrated by [38] proposed that attitude prediction can be completed 2 s ahead of the vehicle motion. The mean relative error (MRE) of the predicted roll angle is 0.0383 and predicted pitch angle is 0.0476 with. RMSEs of 1.8 • for roll and 2.1 • for pitch angle. The computational cost with higher RMSE is the disadvantage of the discussed approach. Research proposed by [24] used Kalman filtering with GPS as an additional sensor adding increased computation cost. The efficacy of algorithm was tested on straight track. In the research carried out by [39], GPS was used as an additional sensor along with IMU. Kalman filtering was applied to fuse data together. GNSS along with IMU was used by [40], but initially, the system takes 200 s to stabilize the values. A pseudo algorithm was developed by [41] which is an extension of Whaba's problem. The system utilized quaternion and the algorithm was tested using a 3.2 Ghz core I7, decreasing the computation time. The RMSE using pseudo approach was 1.3 degree for roll angle and 1.1 degree for pitch angle. A nonlinear complementary filter and differential nonlinear complementary filter were used by [42] to estimate roll and pitch for UAV. The fusion algorithm took 41 ms of computational time which is still large as compared to the techniques mentioned in literature. EKinox D IMU along with MPU 6000 was used by [43] for comparison purpose. The Roll angle RMSE obtained using MPU6000 and U-Blox GNSS was 1.6 degree whereas for pitch angle RMSE was found 1.8 degree. Low RMSE mentioned in table against this research is the result from EKinox, such high-end equipment cannot be used in commercial vehicles as the sensor costs 47,000 USD.
Our proposed filter is fast since it is free of iteration. To decrease the significant effects of bias imposing on gyroscope, bias compensation is merged with filtering architecture. Several experiments are carried out on real hardware in a real time environment to show the performance comparison. Results show that the proposed Filters can reach the accuracy of Kalman filter and higher order observers. Successfully tested in ordinary road conditions we find a balance between estimation accuracy and time consumption. Compared with iterative methods, the proposed filter has much less convergence time.
The results clearly indicate that, during real time implementation of second order complementary filter, the root mean square error of 0.62 degrees is observed for roll angle estimate. The implementation of a first order complementary filter is easier, simpler, and works well during static maneuvers, however, in the presence of road disturbances, the performance is deteriorated. If we decrease the value of the filter tuning parameter, it adds more weight to the static equation, and the filter will become non-responsive during very fast maneuvers. So, we set the parameters according to system requirements so that balance between static and dynamic motion results is maintained and estimation accuracy is not affected. The optimal sampling frequency obtained for Complementary filter through the experimentation in real time environment with sensor mounted near center of gravity of vehicle is 25 Hz as it brings small root mean square error while on all other frequency errors are larger. The results obtained demonstrate that the complementary filter is equally good as the Kalman filter with less computation burden and better accuracy, with the least tuning involved. Finally, the implementation of the proposed algorithms can be easily carried out on low cost hardware that can be easily mounted on standard commercial vehicle with the addition of marginal cost. Further, based on attitude information, anti roll systems can be designed and implemented.

Conclusions
In the research carried out, estimation of vehicle roll angle is investigated with the help of various schemes available in the literature. Real time implementation is also carried out using multi-axis gyroscope and accelerometers. The estimation of roll angle done using this approach is used to remove the gravity component from lateral acceleration prior to estimation of vehicle's lateral velocity. The given estimation method is simple and cost effective as it does not require any tire models or complex vehicle models. The major advantage of the proposed technique is fast and precise estimation up to error of 0.7 degrees by adding marginal cost and equipment with the least computational complexity involved. The algorithm is tested in ordinary driving conditions with speeds varying from 0 to 90 Km/hr. The estimate of roll and pitch angles, along with lateral acceleration, in a real time environment can aid the estimation of other vehicle and tire road interaction phenomena. This simple technique can be coupled with a sliding mode observer to support the highly precise estimation of vehicle dynamics. Finally, it can be safely claimed that in the presence of ordinary road conditions, this technique can easily provide a precise estimate of the roll angle by adding marginal cost to the user.