1 Introduction

With high mobility, high passability, and low environmental footprint, intelligent vehicles have wide application prospects in resource exploration, post-disaster search and rescue, and firefighting in a sustainable economy. Vehicles with traditional passive suspension have difficulty maintaining a stable body attitude, which seriously affects the comfort, safety, handling capability, and stability of passengers, payloads, and goods.

Existing research of attitude control has shown great potential for improving body stability (Chen et al., 2023a, 2023b). In the field of off-road vehicles, active vehicle suspension systems have been studied for improving ride comfort and handling capability of the vehicle by controlling the car body's vertical, roll, and pitch motions (Pan et al., 2015). An attitude tracking controller can help the body to lean inward during cornering, forward during acceleration, and backward during deceleration to eliminate the forces acting on the passengers to enhance ride comfort. While improving ride comfort, the body's active attitude motion enhances the grip on the pavement and reduces the chance of rollover by balancing the grip of each wheel during cornering, braking, and acceleration (Youn et al., 2015). To eliminate the lateral and longitudinal accelerations acting on the passenger, the attitude controller usually requires large ideal roll and pitch angles that are wider than those that can be achieved in actual body motion. Due to suspension space limitations, an active seating system is added to the body to accommodate angles larger than the available body angles to further enhance ride comfort (Wu et al., 2018). The influence of steering and braking is considered in attitude control to maximize the use of suspension deflection to improve ride comfort and road holding performance (Youn et al., 2006). Considering the coupling effect of body attitude motion and transverse sway motion, the attitude controller is combined with a steering controller to produce synergistic effects in terms of smoothness, handling, and safety (Wu et al., 2021). Considering the differences between simulated and real vehicles and the performance limitations of the actuators, the attitude controller is designed to reduce the vertical, pitch and roll motions of the vehicle (Jia et al., 2023).

Existing research on active suspension systems has shown significant potential for ground vehicle attitude motion control. Active systems control the body attitude based on terrain information to eliminate large body sway and vibration in harsh terrain conditions (Gu et al., 2018). The performance of tandem active suspension and parallel active suspension is studied, and the active suspension control algorithm is analyzed based on a quarter-vehicle model (Konieczny et al., 2013). The parallel active suspensions and joint actuators suffer from high energy consumption and low reliability, which limit their applications. Tandem active–passive suspension, as a type of finite bandwidth active suspension, has a simpler structure, lower design cost, and greater attitude adjustment range than parallel and hybrid active suspensions. Therefore, the design of vehicles with tandem active–passive suspensions has substantial research value. Tandem active–passive suspensions are used to eliminate body roll to reduce the possibility of rollover, which can achieve a significant reduction in body roll at a relatively low energy demand (van der Westhuizen & Els, 2013). A wheel-legged all-terrain vehicle is designed based on a tandem active–passive suspension, and verified the attitude closed-loop control strategy through simulation models and real-world experiments, and further validated the attitude control algorithm to reduce the effects of rugged terrain on stability and ride comfort (Jia et al., 2023; Ma et al., 2020a, 2020b; Ni et al., 2020, 2021, 2022).

Therefore, a tandem active–passive suspension (TAPS) system is proposed to provide a solution for active suspension technology. The schematic diagram of a quarter car with TAPS composed of the actuator, cross arm, and shock absorber is shown in Fig. 1. In the quarter model, the upper and lower cross arms are installed in the sprung and unsprung mass, respectively. The spring shock absorber is connected in series to the actuator, which is driven by an electric servo actuator. The speed of the electric servo drive can be controlled to achieve the attitude tracking control objective. In addition, TAPS offers advantages such as a simple and symmetrical structure, low actuator driving force requirements, easy suspension control, a wide control range, and easy troubleshooting.

Fig. 1
figure 1

A quarter real car model with TAPS

Many scholars have studied suspension and body attitude control, such as optimal control, adaptive control, fuzzy control, and sliding mode control (Du et al., 2018; Li et al., 2019; Patra et al., 2021; Taghavifar, 2019; Zhu et al., 2021). Both LQR and MPC are optimal controls and solve the control problem by minimizing the cost function. A system control method based on LQR optimal control performance index is proposed, and appropriate state variables are designed to solve the control force of active suspension, providing a reference for the realization of LQR for systems with large state space variables (Tchamna et al., 2016). To enhance LQR performance, a composite controller composed of LQR and PID is designed to isolate the relationship between body vibration and road roughness, keep the static height of the body constant, and control the pitch motion of the body (Nguyen, 2020). Compared to LQR, MPC can handle state prediction information and constraints (ElMadany et al., 2011). This makes the control value of MPC is the optimal under the restriction of prediction information and constraints, which is closer to the real situation. MPC shows great control performance in tracking control and stability control (Gao et al., 2022a, 2022b; Wu et al., 2024). Similarly, in order to improve the MPC control performance, many scholars have conducted related research. Based on exogenous inputs, a novel autoregressive model predictive control strategy is proposed and applied to semi-active suspension with a magnetorheological damper (Pinon et al., 2021). A model predictive controller is proposed to eliminate the influence of feedback controller performance (Enders et al., 2020). It is proposed that the off-line RMPC method can overcome the problem of large computation amounts by off-line optimization before implementation, and it is extended to the problem of uncertain parameters (Moradi et al., 2019). In addition, to improve the accuracy of position and pose prediction of fully automatic tracked vehicles during running, the Kalman filter algorithm is used to compensate for errors caused by the vehicle dynamic model and IMU (Ni et al., 2019).

About vehicle modeling, most of the current simulations of attitude and suspension control systems are done through mathematical models. In order to better respond to the vibration response of the suspension system, a physical model of the quarter-vehicle suspension is developed using Simscape and the performance of Skyhook, Groundhook and Hybrid control strategies are compared (Yerrawar & Arakerimath, 2016). Multi-physics field dynamics simulation software provides a more complete representation of vehicle structural nonlinearities, damping nonlinearities and tire nonlinearities.

Based on the above analysis and the previous research background, an 11-degree of freedom (DOF) mathematical model and a nonlinear Simscape model of an ATV are constructed. LQR and MPC attitude tracking control algorithms is designed and theoretically compared and analyzed. Considering actuator limitations, the designed LQR and MPC control algorithms are verified and comparatively analyzed in terms of attitude tracking performance through simulations and tests. The proposed attitude tracking control algorithms can provide theoretical support and an experimental basis for subsequent research on attitude tracking control under various working conditions such as vehicle steering and braking.

2 Modeling and Characterization of ATV Full Car System

In this section, an all-terrain vehicle (ATV) model based on TAPS configurations is first described. On this basis, a linear equivalent mathematical model of the full car is summarized by linearizing the approximation based on the uncertainty and nonlinear characteristics of the actual system (Jia et al., 2023). Finally, according to the attitude tracking control simulation and experimental requirements, a variety of pavement performance models are developed.

2.1 Multi-body Full Car Model and Parameters

An 11-DOF full car is designed, which includes wheels, car body, TAPS, and electric control system. The compositions of the TAPS system including the actuator, cross arm, and shock absorber are illustrated. Based on the vehicle’s structure, the characteristics of ATV as symmetry, differential steering, and independent TAPS are described. In addition, due to the excellent obstacle crossing ability of ATV, the attitude tracking control algorithms are designed based on the ATV full vehicle structure. Attitude tracking control is achieved by controlling the speed of the actuator. The principal parameters of the ATV with TAPS are given in Table 1.

Table 1 Principal parameters of ATV

2.2 Linear Equivalent Mathematical Model of Full Car with TAPS

It is first necessary to extend the quarter car model (Arana et al., 2017) to the full car model to enable attitude tracking control. And a linear equivalent mathematical model of the TAPS full car based on the Newton–Euler equation is employed and summarized here, as shown in Fig. 2.

Fig. 2
figure 2

Linear equivalent model of TAPS full car. \({m}_{wi}\) and \({m}_{si}\) are the masses of four wheels and the four support blocks, respectively; \({F}_{i}\) are control forces generated by actuators; \({c}_{s}\) is the damping coefficient; \({k}_{s}\) and \({k}_{t}\) are the stiffness of spring and tire, respectively; \({z}_{ri}\), \({z}_{wi}\), \({z}_{si}\), and \({z}_{bi}\) \({{\text{z}}}_{{\text{bi}}}\) \({{\text{z}}}_{{\text{bi}}}\) are the vertical displacements of road and wheel contacted points, wheel center points, shock absorber and actuator contacted points, and suspension mounting points, respectively; \(\theta\) and \(\varphi\) are the pitch and roll angles, respectively, and the \(z\) variables denote linear vertical displacements of the mass center indicated

The mass center, pitching, and rolling dynamic equation of the body is indicated as:

$$\begin{array}{*{20}l} {m_{b} \ddot{z} = F_{1} + F_{2} + F_{3} + F_{4} } \hfill \\ {I_{{\text{p}}} \ddot{\theta } = \left( {F_{3} + F_{4} } \right) \times b - \left( {F_{1} + F_{2} } \right) \times a} \hfill \\ {I_{{\text{r}}} \ddot{\varphi } = \frac{1}{2}\left( {F_{1} - F_{2} } \right) \times B_{{\text{f}}} + \frac{1}{2}\left( {F_{3} - F_{4} } \right) \times B_{{\text{r}}} ,} \hfill \\ \end{array}$$
(1)

where \({I}_{{\text{p}}}\) and \({I}_{{\text{r}}}\) are the pitching and rolling rotational inertia of the car body, respectively; \({m}_{b}\) is the body mass; \({B}_{{\text{f}}}\) and \({B}_{{\text{r}}}\) are front and rear wheel bases, respectively; \(a\) and \(b\) are the distance from the front and rear axles to the mass center, respectively.

The vertical displacement at each suspension mounting point is linearised and expressed as:

$$\begin{array}{*{20}c} {z_{b1} = z - a\theta + \frac{1}{2}B_{{\text{f}}} \varphi ,z_{b2} = z - a\theta - \frac{1}{2}B_{{\text{f}}} \varphi } \\ {z_{b3} = z + b\theta + \frac{1}{2}B_{{\text{r}}} \varphi ,z_{b4} = z + b\theta - \frac{1}{2}B_{{\text{r}}} \varphi .} \\ \end{array}$$
(2)

The vertical dynamic equations of each actuator support block and each actuator are described as:

$$\begin{array}{*{20}l} {m_{wi} \ddot{z}_{wi} = c_{s} \left( {\dot{z}_{si} - \dot{z}_{wi} } \right) + k_{s} \left( {z_{si} - z_{wi} } \right)} \hfill \\ {\quad \quad + k_{t} \left( {z_{ri} - z_{wi} } \right)} \hfill \\ \begin{gathered} m_{si} \ddot{z}_{si} = c_{s} \left( {\dot{z}_{wi} - \dot{z}_{si} } \right) + k_{s} \left( {z_{wi} - z_{si} } \right) - F_{i} \hfill \\ i = 1,2,3,4. \hfill \\ \end{gathered} \hfill \\ {} \hfill \\ \end{array}$$
(3)

An 11-DOF full car is represented by the above formulas. Notably, the actuator support blocks in the middle of the suspension only play the guiding role, and the masses (\({m}_{si}\)) of the support blocks are quite small. The actuators of TAPS lack parallel dampers to provide the relationship between the upper car body and lower passive shock absorbers and additional sensors to provide the corresponding status data. Therefore, it is difficult to realize the utilization of actuator forces for the proposed attitude control in real car test situation (Theunissen et al., 2020). Based on the above analysis, a second-order low-pass filter (LPF) (Jia et al., 2023) to convert from the force control to a speed control of the actuator is introduced. The mathematical model must be revised according to the actual performance and set of actuators and sensors. In this way, the dynamic efficiency of the support block should be ignored, so that (\({m}_{si}{\ddot{z}}_{si}\)) will not be considered in the dynamic model for the controller calculation. Therefore, Eq. (3) can be approximated as:

$$\begin{array}{*{20}l} {m_{wi} \ddot{z}_{wi} = c_{s} \left( {\dot{z}_{si} - \dot{z}_{wi} } \right) + k_{s} \left( {z_{si} - z_{wi} } \right)} \hfill \\ {\quad \quad + k_{t} \left( {z_{ri} - z_{wi} } \right)} \hfill \\ {F_{i} = c_{s} \left( {\dot{z}_{wi} - \dot{z}_{si} } \right) + k_{s} \left( {z_{wi} - z_{si} } \right)} \hfill \\ {i = 1,2,3,4} \hfill \\ \end{array}$$
(4)

The vertical displacement and velocity equations of the actuator can be expressed as:

$$\begin{array}{*{20}l} {z_{si} = z_{bi} - u_{i}^{\prime} ,\dot{z}_{si} = \dot{z}_{bi} - \dot{u}_{i}^{\prime} } \hfill \\ {i = 1,2,3,4} \hfill \\ \end{array}$$
(5)

The equation of LPF is expressed as:

$$u_{i} = \ddot{u}_{i}^{\prime} + 2\zeta \omega_{c} \dot{u}_{i}^{\prime} + \omega_{c}^{2} u_{i}^{\prime} , i = 1,2,3,4,$$
(6)

where \({\omega }_{c}\) is the cutoff frequency of the TAPS, \(\zeta\) is the damping ratio of the TAPS.

According to the above formulas, the state vector \(\mathbf{x}\), control input vector \(\mathbf{u}\), pavement input vector \(\mathbf{w}\), and output vector \(\mathbf{y}\) of the linear system can be expressed as:

$$\begin{array}{*{20}l} {{\mathbf{x}} = \left[ {z,\dot{z},\theta ,\dot{\theta },\varphi ,\dot{\varphi },z_{w1\sim w4} ,\dot{z}_{w1\sim w4} ,u_{1\sim 4}^{\prime} ,\dot{u}_{1\sim 4}^{\prime} } \right]^{T} } \hfill \\ {{\mathbf{u}} = \left[ {u_{1} ,u_{2} ,u_{3} ,u_{4} } \right]^{T} } \hfill \\ {{\mathbf{w}} = \left[ {z_{r1} ,z_{r2} ,z_{r3} ,z_{r4} } \right]^{T} } \hfill \\ {{\mathbf{y}} = \left[ {z,\ddot{z},\theta ,\ddot{\theta },\varphi ,\ddot{\varphi }} \right]^{T} .} \hfill \\ \end{array}$$
(7)

The state space representation of the model can be constructed as follows:

$$\left\{ {\begin{array}{*{20}c} {{\dot{\mathbf{x}}} = {\mathbf{Ax}} + {\mathbf{Bu}} + {\mathbf{Dw}}} \\ {{\mathbf{y}} = {\mathbf{Cx}}} \\ \end{array} } \right..$$
(8)

Based on the discrete system equation of state, the LQR and MPC attitude tracking control algorithms are designed for ATV with TAPS. Therefore, the continuous system needs to be discretized by zero-order holding input, fixed sampling time (Chan, 2002), and inverse Laplace transform. The state space expression after discretization can be expressed as:

$$\begin{array}{*{20}l} {{\mathbf{x}}\left( {k + 1} \right) = {\mathbf{A}}_{d} {\mathbf{x}}\left( k \right) + {\mathbf{B}}_{d} {\mathbf{u}}\left( k \right) + {\mathbf{D}}_{d} {\mathbf{w}}\left( k \right)} \hfill \\ {{\mathbf{y}}\left( k \right) = {\mathbf{C}}_{d} {\mathbf{x}}\left( k \right)} \hfill \\ \end{array}$$
(9)

where

$$\begin{array}{*{20}l} {{\mathbf{A}}_{{\mathbf{d}}} = {\text{e}}^{{{\mathbf{A}}T}} = {\mathcal{L}}^{ - 1} \left( {s{\mathbf{I}} - {\mathbf{A}}} \right)^{ - 1} } \hfill \\ {{\mathbf{B}}_{{\mathbf{d}}} = \mathop \int \limits_{0}^{T} {\text{e}}^{{{\mathbf{A}}t}} {\mathbf{B}}{\text{d}}t} \hfill \\ {{\mathbf{D}}_{{\mathbf{d}}} = \mathop \int \limits_{0}^{T} {\text{e}}^{{{\mathbf{A}}t}} {\mathbf{D}}{\text{d}}t} \hfill \\ {{\mathbf{C}}_{d} = {\mathbf{C}},} \hfill \\ \end{array}$$
(10)

where \(T\) is the discrete period.

Vehicle lateral acceleration is more difficult to obtain in the above mathematical model and the real vehicle. Therefore, to investigate the effect of attitude control on lateral acceleration, a Simscape nonlinear vehicle physical model is established as shown in Fig. 3.

Fig. 3
figure 3

Simscape nonlinear vehicle physical model

Since the vehicle lateral acceleration cannot be measured directly in Simscape, the lateral acceleration needs to be calculated from the measured quantities and the 3D model rotation transformation (Haslwanter, 2018). The measured quantities include yaw angle, pitch angle, roll angle, and velocity of the vehicle in the x-axis, y-axis, and z-axis directions of the world coordinate system. The vehicle yaw angle, pitch angle, and roll angle can be regarded as the rotation of the vehicle coordinate system around the z-axis, y-axis, and x-axis in the world coordinate system, respectively, as shown in Fig. 4.

Fig. 4
figure 4

Vehicle model rotation transformation. O-XYZ and O-\({{\text{X}}}_{{\text{V}}}{{\text{Y}}}_{{\text{V}}}{{\text{Z}}}_{{\text{V}}}\) are the world and vehicle coordinate systems, respectively, \({\theta }_{y}\) is the vehicle yaw angle

At the beginning of the simulation, the vehicle coordinate system is coincident with the world coordinate system. The vehicle lateral acceleration can be obtained by calculating the derivative of the lateral velocity. The vehicle lateral velocity can be expressed as:

$${v}_{y}{\prime}=\left[{v}_{x},{v}_{y},{v}_{z}\right]\bullet \left\{{\overline{v} }_{yb}\times \left[\begin{array}{ccc}1& 0& 0\\ 0& {\text{cos}}\varphi & {\text{sin}}\varphi \\ 0& -{\text{sin}}\varphi & \mathit{cos}\varphi \end{array}\right]\times \left[\begin{array}{ccc}{\text{cos}}\theta & 0& -{\text{sin}}\theta \\ 0& 1& 0\\ {\text{sin}}\theta & 0& {\text{cos}}\theta \end{array}\right]\times \left[\begin{array}{ccc}{\text{cos}}{\theta }_{y}& {\text{sin}}{\theta }_{y}& 0\\ -{\text{sin}}{\theta }_{y}& {\text{cos}}{\theta }_{y}& 0\\ 0& 0& 1\end{array}\right]\right\},$$
(11)

where, \({v}_{x}\), \({v}_{y}\), \({v}_{z}\) velocity of the vehicle in the x-axis, y-axis, and z-axis directions of the world coordinate system, \({\overline{v} }_{yb}\) is the unit vector in the lateral initial direction of the vehicle in the world coordinate system.

2.3 Pavement Performance Models

To verify the correctness of the vehicle mathematical model with TAPS and the effectiveness of the designed attitude tracking control algorithm through experiments and simulations, sinusoidal, single-side sinusoidal, and C-class random pavement performance models are established in this section.

2.3.1 Sinusoidal Pavement Performance Model

To verify the effectiveness of the designed control algorithm for the tracking control of pitch angle and vertical displacement, a sinusoidal pavement performance model with an amplitude of 0.05 m, a cycle of 0.75 s, and a vehicle speed of 1 m/s is established based on the actuator travel and actual working conditions. The impact on the front and rear wheels is shown in Fig. 5.

Fig. 5
figure 5

Sinusoidal pavement performance model

2.3.2 Single-Side Sinusoidal Pavement Performance Model

To verify the validity of the control algorithm designed to track control of the pitch angle, roll angle, and vertical displacement of the single-side wheel through the continuous impact on the pavement, based on the actuator travel and actual working conditions, a single-side sinusoidal pavement performance model with the amplitude of 0.05 m, the cycle of 0.75 s, and the vehicle speed of 1 m/s is established. The impact on the wheels is shown in Fig. 6.

Fig. 6
figure 6

Single-side sinusoidal pavement performance model

2.3.3 C-Class Random Pavement Performance Model

In order to verify the performance of the attitude tracking control algorithm designed by the ATV with TAPS under the impact of random pavement, a C-class random pavement performance model with the geometric mean value of the road roughness coefficient is 256 × 10−6m3, the geometric mean value of the root mean square of the road roughness coefficient is 15.23 × 10−2m, and the vehicle speed is 1 m/s is built. To better reflect the track of wheels on the C-level random pavement, the Butterworth low-pass filter is used to filter the C-class pavement. Filter out the high-frequency parts of the pavement that have little contact with the tire (Shi et al., 2018; Tian et al., 2021), as shown in Fig. 7.

Fig. 7
figure 7

C-class random pavement performance model

3 Design of Attitude Tracking Control Algorithm

In this section, linear quadratic regulator (LQR) and model predictive control (MPC) attitude tracking control algorithms are designed to track control the body attitude on the above three pavement performance models. Finally, the design and theory of the two attitude tracking control algorithms are compared and analyzed.

In the ATV with TAPS attitude tracking control, performance indexes such as the body vertical displacement, pitch angle, roll angle, vertical acceleration, roll angle acceleration, pitch angle acceleration, and actuator input are considered. Therefore, the cost function of attitude tracking control can be expressed as:

$$\begin{array}{*{20}l} {J = \rho_{1} z^{2} + \rho_{2} \theta^{2} + \rho_{3} \varphi^{2} + \rho_{4} \ddot{z}^{2} + \rho_{5} \ddot{\theta }^{2} + \rho_{6} \ddot{\varphi }^{2} } \hfill \\ { + \rho_{7} u^{2} ,} \hfill \\ \end{array}$$
(12)

where \({\rho }_{1}\), \({\rho }_{2}\), \({\rho }_{3}\), \({\rho }_{4}\), \({\rho }_{5}\), \({\rho }_{6}\), and \({\rho }_{7}\) are body vertical displacement, pitch angle, roll angle, vertical acceleration, roll angle acceleration, pitch angle acceleration, and actuator input weight coefficients, respectively. In addition, the choice of weight coefficients is based on the absolute tracking error of the control target and the corresponding constraints (Shadmand et al., 2019).

3.1 Design of LQR Attitude Tracking Control Algorithm for the Time-Invariant Infinite System

The LQR tracking control algorithm is designed to track and control body attitude on different pavement models based on discrete system. According to the system mathematical model and the performance index, the cost function of the time-invariant tracking system is established, and the minimum value of the cost function is calculated to obtain the optimal control quantity satisfying the system control requirements. In addition, different target quantities can be controlled by adjusting the weight coefficients of different quantities. The logical block diagram of the LQR attitude tracking control algorithm is shown in Fig. 8.

Fig. 8
figure 8

The logical block diagram of the LQR attitude tracking control algorithm

For the problem of the time-invariant tracking system, the approximate solution of the optimal control system can be obtained by solving the stable solution of the Riccati equation (Zhu, 2005). For a linear time-invariant observable controllable system (10), the error vector of the system can be expressed as:

$${\mathbf{e}}\left( k \right) = {\mathbf{y}}_{d} \left( k \right) - {\mathbf{y}}\left( k \right)$$
(13)

where \({\mathbf{y}}_{d}\left(k\right)\) is the target output of the linear time-invariant system.

According to the error, the actuator input, and the weight can represent the cost function of the system as:

$$\begin{array}{*{20}l} {J = \mathop \sum \limits_{k = 0}^{N - 1} \frac{1}{2}\left[ {{\mathbf{e}}^{T} \left( k \right){\mathbf{Qe}}\left( k \right) + {\mathbf{u}}^{T} \left( k \right){\mathbf{Ru}}\left( k \right)} \right]} \hfill \\ { + \frac{1}{2}{\mathbf{e}}^{T} \left( N \right){\mathbf{Se}}\left( N \right).} \hfill \\ \end{array}$$
(14)

where, the symmetric positive definite constant matrices \(\mathbf{Q}\) and \(\mathbf{R}\) are the weights of the error and input, respectively. \(\mathbf{S}\) is the weighting factor of the terminal error.

The optimal control law is found using dynamic programming and the Belmann equation (Kappen, 2011), which can be expressed as:

$$J^{0} \left[ {{\mathbf{x}}\left( k \right)} \right] = \mathop {{\text{min}}}\limits_{{{\mathbf{u}}\left( k \right)}} \left\{ {L\left[ {{\mathbf{x}}\left( k \right),{\mathbf{u}}\left( k \right)} \right] + J^{0} \left[ {{\mathbf{x}}\left( {k + 1} \right)} \right]} \right\}$$
(15)

where

$$\begin{array}{*{20}l} {L\left[ {{\mathbf{x}}\left( k \right),{\mathbf{u}}\left( k \right)} \right] = \frac{1}{2}{\mathbf{e}}^{T} \left( k \right){\mathbf{Qe}}\left( k \right) + \frac{1}{2}{\mathbf{u}}^{T} \left( k \right){\mathbf{Ru}}\left( k \right)} \hfill \\ {J^{0} \left[ {{\mathbf{x}}\left( N \right)} \right] = \frac{1}{2}{\mathbf{e}}^{T} \left( N \right){\mathbf{Se}}\left( N \right).} \hfill \\ \end{array}$$
(16)

The optimal cost function from state \({\mathbf{x}}\left( k \right)\) to the final state can be expressed as:

$$J^{0} \left[ {{\mathbf{x}}\left( k \right)} \right] = \frac{1}{2}{\mathbf{x}}^{T} \left( k \right){\mathbf{P}}\left( k \right){\mathbf{x}}\left( k \right) + {\mathbf{b}}\left( k \right){\mathbf{x}}\left( k \right) + {\mathbf{c}}\left( k \right),$$
(17)

where, in the final state \(\mathbf{x}\left(N\right)\), define \(\mathbf{P}\left(N\right)={\mathbf{C}}^{T}\mathbf{S}\mathbf{C}\), \({\varvec{b}}\left(N\right)={\mathbf{x}}_{d}^{T}\left(N\right){\mathbf{C}}^{T}\mathbf{S}\), and \(\mathbf{c}\left(N\right)={\mathbf{x}}_{d}^{T}\left(N\right){\mathbf{C}}^{T}\mathbf{S}\mathbf{C}{\mathbf{x}}_{d}\left(N\right)\).

The cost function (14) is minimal at \(\partial J/\partial \mathbf{u}=0\), therefore, by substituting (9), (10), and (15) into (14) and taking partial derivatives of \(\mathbf{u}\left(k\right)\), the optimal control input can be expressed as:

$$\begin{array}{*{20}l} {{\mathbf{u}}\left( k \right) = - \left[ {{\mathbf{R}} + {\mathbf{B}}^{T} {\mathbf{P}}\left( {k + 1} \right){\mathbf{B}}} \right]^{ - 1} \left[ {{\mathbf{B}}^{T} {\mathbf{P}}\left( {k + 1} \right){\mathbf{Ax}}\left( k \right)} \right.} \hfill \\ {\user2{ } + \left. {{\mathbf{B}}^{T} {\mathbf{P}}\left( {k + 1} \right){\mathbf{Dw}}\left( k \right) + {\mathbf{B}}^{T} {\mathbf{b}}\left( {k + 1} \right)} \right]} \hfill \\ \end{array}$$
(18)

The equation calculated by substituting \({\mathbf{u}}\left( k \right)\) into (14) is combined with (16), the following equations are obtained as:

$$\begin{array}{*{20}l} {{\mathbf{P}}\left( k \right) = {\mathbf{C}}^{T} {\mathbf{QC}} + {\mathbf{A}}^{T} {\mathbf{P}}\left( {k + 1} \right){\mathbf{A}} - {\mathbf{A}}^{T} {\mathbf{P}}\left( {k + 1} \right){\mathbf{B}}} \hfill \\ { \left[ {{\mathbf{R}} + {\mathbf{B}}^{T} {\mathbf{P}}\left( {k + 1} \right){\mathbf{B}}} \right]^{ - 1} {\mathbf{B}}^{T} {\mathbf{P}}\left( {k + 1} \right){\mathbf{A}}} \hfill \\ \end{array}$$
(19)
$$\begin{array}{*{20}l} {{\mathbf{b}}\left( k \right) = - {\mathbf{x}}_{d}^{T} \left( k \right){\mathbf{C}}^{T} {\mathbf{QC}} + {\mathbf{w}}^{T} \left( k \right){\mathbf{D}}^{T} {\mathbf{PA}} + {\mathbf{b}}\left( {k + 1} \right){\mathbf{A}}} \hfill \\ { - {\mathbf{w}}^{T} \left( k \right){\mathbf{D}}^{T} {\mathbf{PB}}\left[ {{\mathbf{R}} + {\mathbf{B}}^{T} {\mathbf{PB}}} \right]^{ - 1} {\mathbf{B}}^{T} {\mathbf{PA}}} \hfill \\ { - {\mathbf{b}}\left( {k + 1} \right){\mathbf{B}}\left[ {{\mathbf{R}} + {\mathbf{B}}^{T} {\mathbf{PB}}} \right]^{ - 1} {\mathbf{B}}^{T} {\mathbf{PA}}.} \hfill \\ \end{array}$$
(20)

When the system is stable, \({\mathbf{P}}\left( k \right) = {\mathbf{P}}\left( {k + 1} \right)\), therefore, the Riccati equation can be obtained as follows:

$${\mathbf{P}} = {\mathbf{C}}^{T} {\mathbf{QC}} + {\mathbf{A}}^{T} {\mathbf{PA}} - {\mathbf{A}}^{T} {\mathbf{PB}}\left[ {{\mathbf{R}} + {\mathbf{B}}^{T} {\mathbf{PB}}} \right]^{ - 1} {\mathbf{B}}^{T} {\mathbf{PA}}.$$
(21)

By solving Riccati Eq. (20), \({\mathbf{P}}\) can be obtained, and the value of \({\mathbf{u}}\left( k \right)\) can be solved as follows:

$$\begin{array}{*{20}l} {{\mathbf{u}}\left( k \right) = - \left[ {{\mathbf{R}} + {\mathbf{B}}^{T} {\mathbf{PB}}} \right]^{ - 1} \left[ {{\mathbf{B}}^{T} {\mathbf{PAx}}\left( k \right) + {\mathbf{B}}^{T} {\mathbf{PDw}}\left( k \right)} \right.} \hfill \\ {{ } + { }\left. {{\mathbf{B}}^{{\text{T}}} {\mathbf{b}}\left( {k + 1} \right)} \right].} \hfill \\ \end{array}$$
(22)

The LQR attitude tracking control algorithm based on ATV with TAPS is designed in this section. The relevant simulation and test contents are described in Sect. 4.

3.2 Design of MPC Attitude Tracking Control Algorithm for the Discrete System

Model predictive control (MPC) is used to optimize control by predicting the performance of the system in a certain period of the future based on the model. It is effective at dealing with control problems with constraints and low model accuracy. A discrete state space expression is generally used in MPC analysis. In addition, the design and implementation process of MPC includes three steps: prediction model, rolling optimization, and feedback correction.

The purpose of the prediction model is to measure and estimate the current system state based on the known system state, as well as forecast the input and output of the future system. As shown in Fig. 9, input \({u}_{k}\) is applied to the system at time \(k\). The controller predicts the output and input of the system at the future time \(\left[k, k+N\right]\) according to the mathematical model and system state. The intervals \(\left[k, k+N\right]\) and \(\left[k, k+N-1\right]\) are, respectively, called the prediction and control intervals. Rolling optimization is a feature of model predictive control. For example, at time \(k\), through calculating the system at the time \(\left[k, k+N\right]\) optimization problem to obtain the solution to the system input \({u}_{k}\), \({u}_{k+1}\), \({u}_{k+2}\),…, \({u}_{k+N}\), and only the first solution \({u}_{k}\) acts on the system. The process is repeated at time \(k+1\). Therefore, in the MPC-solving process, each step needs to solve an optimization problem, which also shows that MPC has high requirements for the controller. The purpose of feedback correction is to prevent model failure or deviation of the controller from the ideal state due to interference. For example, at time \(k+1\), the feedback correction process will check the output of time \(k+1\) and correct the results predicted by the model through the deviation.

Fig. 9
figure 9

The design and implementation process of MPC includes three steps

In this section, the MPC attitude tracking control algorithm of ATV with TAPS is solved by converting the cost function of the control algorithm into the form of quadratic programming. The general form of quadratic programming (Bartlett et al., 2002) is as follows:

$$\min \left( {{\mathbf{Z}}^{T} {\mathbf{QZ}} + {\mathbf{C}}^{T} {\mathbf{Z}}} \right)$$
(23)

\(\mathbf{x}\left(k+i|k\right)\) and \(\mathbf{u}\left(k+i|k\right)\) are used to represent the values of \(\mathbf{x}\) and \(\mathbf{u}\) at time \(k+i\) \({\text{k}}+{\text{i}}\) \({\text{k}}+{\text{i}}\) predicted at time \(k\), respectively. The predicted value of \(\mathbf{x}\left(k\right)\) at time \(\left[k, k+N\right]\), the predicted value of \(\mathbf{u}\left(k\right)\) at time \(\left[k, k+N-1\right]\), and the value of \(\mathbf{w}\left(k\right)\) at time \(\left[k, k+N-1\right]\) are expressed by \(\mathbf{X}\left(k\right)\), \(\mathbf{U}\left(k\right)\), and \(\mathbf{W}\left(k\right),\) respectively, as:

$$\begin{array}{*{20}c} {{\mathbf{X}}\left( k \right) = \left[ {\begin{array}{*{20}c} {{\mathbf{x}}\left( {k|k} \right)} \\ {{\mathbf{x}}\left( {k + 1|k} \right)} \\ \vdots \\ {{\mathbf{x}}\left( {k + N|k} \right)} \\ \end{array} } \right],{\mathbf{U}}\left( k \right) = \left[ {\begin{array}{*{20}c} {{\varvec{u}}\left( {k|k} \right)} \\ {{\mathbf{u}}\left( {k + 1|k} \right)} \\ \vdots \\ {{\mathbf{u}}\left( {k + N - 1|k} \right)} \\ \end{array} } \right]} \\ {{\mathbf{W}}\left( k \right) = \left[ {\begin{array}{*{20}c} {{\mathbf{w}}\left( {k|k} \right)} \\ {{\mathbf{w}}\left( {k + 1|k} \right)} \\ \vdots \\ {{\mathbf{w}}\left( {k + N - 1|k} \right)} \\ \end{array} } \right]} \\ \end{array} .$$
(24)

For the discrete time system of ATV with the TAPS, the reference value of the output is \({\mathbf{y}}_{d}\left(k\right)\), so the output error of the system can be expressed as:

$${\mathbf{E}}\left( k \right) = {\mathbf{y}}_{d} \left( k \right) - {\mathbf{y}}\left( k \right).$$
(25)

According to the error, the actuator input, and the weight can represent the cost function of the system as:

$$\begin{array}{*{20}l} {J = \mathop \sum \limits_{i = 0}^{N - 1} \left[ {{\mathbf{E}}^{T} \left( k \right){\mathbf{QE}}\left( k \right) + {\mathbf{u}}^{T} \left( {k + i|k} \right){\mathbf{Ru}}\left( {k + i|k} \right)} \right]} \hfill \\ { + {\mathbf{E}}^{T} \left( {k + N} \right){\mathbf{SE}}\left( {k + N} \right)} \hfill \\ \end{array}$$
(26)

The symmetric positive definite constant matrix \({\mathbf{Q}}\), \({\mathbf{R}}\), and \({\mathbf{S}}\) are the weights of the error, input, and terminal error, respectively.

According to the ATV with TAPS system mathematical model, the predicted values of system state x at time k can be expressed as:

$$\begin{array}{*{20}l} {{\mathbf{x}}\left( {k|k} \right) = {\mathbf{x}}\left( k \right)} \hfill \\ {{\mathbf{x}}\left( {k + 1|k} \right) = {\mathbf{A}}_{d} {\mathbf{x}}\left( k \right) + {\mathbf{B}}_{d} {\mathbf{u}}\left( {k|k} \right) + {\mathbf{D}}_{d} {\mathbf{w}}\left( k \right)} \hfill \\ \vdots \hfill \\ {{\mathbf{x}}\left( {k + N|k} \right) = {\mathbf{A}}_{d}^{N} {\mathbf{x}}\left( k \right) + {\mathbf{A}}_{d}^{N - 1} {\mathbf{B}}_{d} {\mathbf{u}}\left( {k|k} \right) + , \cdots \cdots ,} \hfill \\ { + {\mathbf{B}}_{d} {\mathbf{u}}\left( {k + N - 1|k} \right) + {\mathbf{A}}_{d}^{N - 1} {\mathbf{D}}_{d} {\mathbf{w}}\left( k \right) + , \cdots \cdots ,} \hfill \\ { + {\mathbf{D}}_{d} {\mathbf{w}}\left( {k + N - 1} \right).} \hfill \\ \end{array}$$
(27)

According to (23), (26) can be expressed in matrix form as follows:

$$\mathbf{X} \left( k \right) = {\mathbf{Mx}}\left( k \right) + {\mathbf{OU}}\left( k \right) + {\mathbf{NW}}\left( k \right)$$
(28)

where

$${\mathbf{M}} = \left[ {\begin{array}{*{20}c} {\mathbf{I}} \\ {{\mathbf{A}}_{d} } \\ \vdots \\ {{\mathbf{A}}_{d}^{N} } \\ \end{array} } \right],{\mathbf{O}} = \left[ {\begin{array}{*{20}c} 0 & 0 & \cdots & 0 \\ {{\mathbf{B}}_{d} } & 0 & \cdots & 0 \\ {{\mathbf{A}}_{d} {\mathbf{B}}_{d} } & {{\mathbf{B}}_{d} } & \ddots & \vdots \\ \vdots & \vdots & \ddots & 0 \\ {{\mathbf{A}}_{d}^{N - 1} {\mathbf{B}}_{d} } & {{\mathbf{A}}_{d}^{N - 2} {\mathbf{B}}_{d} } & \cdots & {{\mathbf{B}}_{d} } \\ \end{array} } \right]$$
$${\mathbf{N}} = \left[ {\begin{array}{*{20}c} 0 & 0 & \cdots & 0 \\ {{\mathbf{D}}_{d} } & 0 & \cdots & 0 \\ {{\mathbf{A}}_{d} {\mathbf{D}}_{d} } & {{\mathbf{D}}_{d} } & \ddots & \vdots \\ \vdots & \vdots & \ddots & 0 \\ {{\mathbf{A}}_{d}^{N - 1} {\mathbf{D}}_{d} } & {{\mathbf{A}}_{d}^{N - 2} {\mathbf{D}}_{d} } & \cdots & {{\mathbf{D}}_{d} } \\ \end{array} } \right].$$

According to (9) and (23), the cost function J of MPC attitude tracking control can be simplified to:

$$\begin{array}{*{20}l} {J = \frac{1}{2}{\mathbf{X}}^{T} \left( k \right){\overline{\mathbf{C}}}_{d}^{T} {\mathbf{\overline{Q}\overline{C}}}_{d} {\mathbf{X}}\left( k \right) - {\mathbf{E}}_{d}^{T} {\mathbf{\overline{Q}\overline{C}}}_{d} {\mathbf{X}}\left( k \right) + \frac{1}{2}{\mathbf{E}}_{d}^{T} {\overline{\mathbf{Q}}\mathbf{E}}_{d} } \hfill \\ { + \frac{1}{2}{\mathbf{U}}^{T} \left( k \right){\overline{\mathbf{R}}\mathbf{U}}\left( k \right).} \hfill \\ \end{array}$$
(29)

where

$${\overline{\mathbf{C}}}_{d} = \left[ {\begin{array}{*{20}c} {{\mathbf{C}}_{d} } & {} & {} & {} \\ {} & \ddots & {} & {} \\ {} & {} & {{\mathbf{C}}_{d} } & {} \\ {} & {} & {} & {{\mathbf{C}}_{d} } \\ \end{array} } \right],{\overline{\mathbf{Q}}} = \left[ {\begin{array}{*{20}c} {\mathbf{Q}} & {} & {} & {} \\ {} & \ddots & {} & {} \\ {} & {} & {\mathbf{Q}} & {} \\ {} & {} & {} & {\mathbf{S}} \\ \end{array} } \right]$$
$${\mathbf{E}}_{d} = \left[ {\begin{array}{*{20}c} {{\mathbf{y}}_{d} \left( k \right)} \\ {{\mathbf{y}}_{d} \left( {k + 1} \right)} \\ \vdots \\ {{\mathbf{y}}_{d} \left( {k + N} \right)} \\ \end{array} } \right],{\overline{\mathbf{R}}} = \left[ {\begin{array}{*{20}c} {\mathbf{R}} & {} & {} & {} \\ {} & \ddots & {} & {} \\ {} & {} & {\mathbf{R}} & {} \\ {} & {} & {} & {\mathbf{R}} \\ \end{array} } \right].$$

By substituting (27) into (28), the quadratic programming form of the cost function can be obtained through simplification as follows:

$$J = \frac{1}{2}{\mathbf{U}}^{T} \left( k \right){\mathbf{C}}_{q} {\mathbf{U}}\left( k \right) + {\mathbf{C}}_{e} {\mathbf{U}}\left( k \right) + {\mathbf{C}}_{c} .$$
(30)

where \(\mathbf{U}\left(k\right)\) is solved based on the minimum of the quadratic programming form of the cost function. According to the above analysis and the system state, \({\mathbf{C}}_{q}\), \({\mathbf{C}}_{e}\), and \({\mathbf{C}}_{c}\) can be calculated as follows:

$$\begin{array}{*{20}l} {{\mathbf{C}}_{q} = {\mathbf{O}}^{T} {\overline{\mathbf{C}}}_{d}^{T} {\mathbf{\overline{Q}\overline{C}}}_{d} {\mathbf{O}} + {\overline{\mathbf{R}}}} \hfill \\ {{\mathbf{C}}_{e} = 2{\mathbf{x}}^{T} \left( k \right){\mathbf{M}}^{T} {\overline{\mathbf{C}}}_{d}^{T} {\mathbf{\overline{Q}\overline{C}}}_{d} {\mathbf{O}} + 2{\mathbf{W}}^{T} \left( k \right){\mathbf{N}}^{T} {\overline{\mathbf{C}}}_{d}^{T} {\mathbf{\overline{Q}\overline{C}}}_{d} {\mathbf{O}}} \hfill \\ { - 2{\mathbf{E}}_{d}^{T} {\mathbf{\overline{Q}\overline{C}}}_{d} {\mathbf{O}}} \hfill \\ {{\mathbf{C}}_{c} = {\mathbf{x}}^{T} \left( k \right){\mathbf{M}}^{T} {\overline{\mathbf{C}}}_{d}^{T} {\overline{\mathbf{Q}}}\left[ {{\overline{\mathbf{C}}}_{d} {\mathbf{Mx}}\left( k \right) + 2{\overline{\mathbf{C}}}_{d} {\mathbf{NW}}\left( k \right) - 2{\mathbf{E}}_{d} } \right]} \hfill \\ {\user2{ } + {\mathbf{W}}^{T} \left( k \right){\mathbf{N}}^{T} {\overline{\mathbf{C}}}_{d}^{T} {\overline{\mathbf{Q}}}\left[ {{\overline{\mathbf{C}}}_{d} {\mathbf{NW}}\left( k \right) - 2{\mathbf{E}}_{d} } \right] + {\mathbf{E}}_{d}^{T} {\overline{\mathbf{Q}}\mathbf{E}}_{d} .} \hfill \\ \end{array}$$

The MPC attitude tracking control algorithm is designed in this section. The relevant simulation and test contents are described in Sect. 4.

3.3 Comparison of the LQR and MPC Attitude Tracking Control Algorithm in Theory

In the design of the ATV control algorithm, LQR can be analyzed according to a discrete or continuous system, while MPC is generally analyzed based on a discrete system. MPC is solved by converting the cost function into a quadratic programming problem, while LQR is solved by solving the Riccati equation.

The MPC controller has rolling optimization. Each step forward needs to solve an optimization problem within a predicted period. The controller applies the first value of the solution to the system. The LQR controller solves an optimization problem in the entire control time domain and inputs all the values of the solution into the system. Therefore, compared with LQR, MPC has a large amount of computation, poor real-time performance, and high hardware costs. The differences in control effects between these two controllers are analyzed in the following section.

Both MPC and LQR controllers can achieve attitude tracking control with TAPS for linear systems. In addition, both control algorithms can control multiple targets at the same time. Both controllers need to solve the optimization problem based on the minimum cost function, and the cost function of both is similar.

4 Simulation and Test

Based on the above derivation and analysis, the LQR and MPC attitude tracking control model is established in MATLAB/Simulink, as shown in Fig. 10. In this section, through simulation and real car test, the proposed attitude tracking control algorithms are verified. In addition, the attitude tracking control performance of the controller is also analyzed in the aspects of improving vehicle maneuverability, passability, and ride comfort. In the simulation,

Fig. 10
figure 10

LQR and MPC attitude tracking control model in MATLAB/Simulink

In the simulation, 11-DOF ATV simulation model, ATV Simscape physical model and control algorithms are built in the MATLAB/Simulink environment. The attitude control algorithms are simulated and analyzed when the vehicle is in the stationary state and movement state. When the vehicle is in the movement state, three kinds of pavements are simulated and analyzed, such as sinusoidal unilateral pavement, sinusoidal pavement, and random pavement. The objectives of attitude control include tracking control of vertical displacement, roll angle, and pitch angle. In the test, the host computer is connected to the ATV Controller Area Network (CAN) bus via Kveser to control the ATV's TAPS and travel system and read the attitude data via CAN signals. Due to the restrictions of driving conditions, actuator travel, etc., the control algorithms are tested and analyzed according to the vehicle on stationary state and driving on single-side sinusoidal pavement. The control algorithms can multi-target tracking control the pitch and roll angle. In addition, the speed of the ATV is 1m/s in motion during simulation and test.

4.1 Simulation and Comparative Analysis of the LQR and MPC Algorithms

In this section, LQR and MPC attitude tracking control algorithms are simulated and compared according to five cases as follows:

(1) The LQR and MPC are simulated and compared when the vehicle is in the stationary state.

(2) The LQR and MPC are simulated and compared on the sinusoidal pavement.

(3) The LQR and MPC are simulated and compared on the single-side sinusoidal pavement.

(4) The LQR and MPC are simulated and compared on the C-class random pavement.

(5) The LQR and MPC are simulated and compared in the Simcape.

The reference values for attitude tracking control are 0, stable value, and dynamic sinusoidal value. Specifically, the reference value of 0 is to make the changes of body attitude as stable and small as possible to improve the stability and passability of the vehicle. The reference value of stable value is the vehicle attitude change tracking to a definite non-zero value. The reference value of dynamic sinusoidal value is the vehicle attitude change tracking to a sinusoidal value. Due to the limitation of actuator travel and the wheelbase of the ATV being longer than the wheel track, the expected stable values of the vertical displacement, pitch angle, and roll angle are 0.05 m, 0.1 rad, and 0.2 rad, respectively. The expected sinusoidal amplitudes of vertical displacement, pitch angle, and roll angle are 0.05 m, 0.1 rad, and 0.2 rad, respectively, and the period is 2 s.

When the vehicle is in stationary state, the reference values for attitude tracking control simulation analysis mainly include stable value and dynamic sinusoidal value. When the vehicle is in movement state, the reference values for attitude tracking control simulation analysis mainly include 0, stable value, and dynamic sinusoidal value.

The simulation in Simcape focuses on the effect of attitude control on lateral acceleration and roll angle. The reference value of vehicle attitude tracking is 0. The amplitude and period of the used sinusoidal road surface are 0.05 m and 1 m, respectively. The rear wheels speed is 5 rad/s. The front wheels are driven wheels.

4.1.1 Simulation and Comparative Analysis of the LQR and MPC Algorithms in the Stationary State

When the vehicle is in the stationary state and the reference value of attitude tracking control is stable value, the simulation results of the LQR and MPC are shown in Fig. 11. For further evaluating the performance of the control algorithms, the stability, overshoot, and stability time values are investigated, as shown in Table 2. As can be seen, both the LQR and MPC can effectively track the vertical displacement, roll angle, and pitch angle to a quantitative value. Specifically, the LQR controller is less computationally intensive and prone to overshooting due to the lack of aspects such as rolling optimisation and prediction. The LQR has a better effect than the MPC in terms of reaction speed, but in terms of overshoot of vertical displacement tracking control, the value under MPC control is smaller than that of LQR. Due to the small amount of calculation of the LQR, when the ATV is in the stationary state, the LQR is slightly better than the MPC in quantitative value attitude tracking control simulation.

Fig. 11
figure 11

Simulation results of the LQR and MPC for tracking stable value in the stationary state

Table 2 Simulation results of stability value, overshoot, and stability time under LQR and MPC control for tracking stable value in the stationary state

When the vehicle is in the stationary state and the reference value of attitude tracking control is dynamic sinusoidal value, the simulation results of the LQR and MPC are shown in Fig. 12. For further evaluating the performances of the control algorithms, sinusoidal curves are fitted out on the body attitude curve. The performances of the LQR and MPC attitude tracking control algorithms are analyzed and compared according to the amplitude, phase, and period of the fitted curve. In addition, the sum of squares due to error (SSE) is closer to 0, indicating better curve fitting. Where the sinusoidal fitting (Renczes, 2017) formula as: \(y=A{\text{sin}}\left(\omega x+\varphi \right)\), where \(A\) and \(\omega\) are the amplitude and angular frequency, which represent the amplitude and frequency of the vibration of the sinusoidal curve. \(\varphi\) is the initial phase, which represents the lead or lag of the sinusoidal curve.

Fig. 12
figure 12

Simulation results of the LQR and MPC for tracking dynamic sinusoidal value in the stationary state

When LQR and MPC attitude tracking control algorithms based on ATV with TAPS are analyzed and compared, the reference curves of the body vertical displacement, roll angle, and pitch angle are as follows:\({y}_{v}=0.05{\text{sin}}\left(\pi t\right)\), \({y}_{r}=0.2{\text{sin}}\left(\pi t\right)\), \({y}_{p}=0.1{\text{sin}}\left(\pi t\right)\).

Therefore, the parameters of the sinusoidal fitting curve under the control of the control algorithms are shown in Table 3. According to Fig. 12 and Table 3, the designed control algorithms can effectively track the sinusoidal curves of the ATV in the stationary state. The vibration amplitude and SSE under MPC are slightly better than LQR, but MPC has slightly more lag than LQR. When the system has no pavement disturbance, the performance of the two control algorithms is similar.

Table 3 Fitting results of attitude curves under the LQR and MPC control for tracking dynamic sinusoidal value in the stationary state

4.1.2 Simulation and Comparative Analysis of the LQR and MPC Algorithms on the Sinusoidal Pavement

When the vehicle is driving on the sinusoidal pavement and the reference value is 0, the simulation results of LQR and MPC are shown in Fig. 13. Due to the frequency response characteristics (Gao & Han, 2022), when vehicle drives at a constant speed on the sinusoidal pavement, the vibration response of the body attitude also changes sinusoidally. Therefore, the sinusoidal curve fitting is also used for analysis and comparison of the LQR and MPC on the sinusoidal pavement. The attitude curves under LQR and MPC control on the sinusoidal pavement are fitted, as shown in Table 4. According to the above analysis and calculation, the SSE of the fitted curve is very close to 0, therefore, the fitted sine curve is very close to the response curve. The reduction ratios of vibration amplitudes of vertical displacement and pitch angle are 89.4% and 41.5%, respectively, under LQR control. The reduction ratios of vibration amplitudes of vertical displacement and pitch angle are 93.2% and 92.5%, respectively, under MPC control. Therefore, the results show that the designed control algorithms can effectively improve ride comfort and attitude stability of the vehicle subjected to continuous sinusoidal pavement disturbances. In addition, the reduction effect of vertical displacement is better than that of pitch angle. The reduction effects of the MPC attitude algorithm are generally better than those of the LQR control algorithm, and MPC has large lead control. It also shows that vertical control is more stable, and MPC has stronger anti-jamming ability. On the other hand, the designed attitude algorithms do not change the vibration frequency of ATV under sinusoidal pavement excitation, compared with the passive state.

Fig. 13
figure 13

Simulation results of the LQR and MPC for tracking to 0 on the sinusoidal pavement

Table 4 Fitting results of attitude curves under the LQR and MPC control for tracking to 0 on the sinusoidal pavement

When the vehicle is driving on the sinusoidal pavement and the reference value is stable value, the simulation results of LQR and MPC attitude tracking control algorithms are shown in Fig. 14. The tracking control performance of vertical displacement and pitch angle under MPC control is better than that under LQR control. The tracking control performance of roll angle under LQR control is slightly better than that under MPC control. It also shows that the MPC attitude tracking control algorithm has strong anti-interference performance. In addition, the tracking control effect of roll angle is better than that of other parameters, because the left and right wheels are under the same excitation.

Fig. 14
figure 14

Simulation results of the LQR and MPC for tracking stable value on the sinusoidal pavement

When the vehicle is driving on the sinusoidal pavement and the reference value is dynamic sinusoidal value, the simulation results of the LQR and MPC attitude tracking control algorithms are shown in Fig. 15. The attitude curves under LQR and MPC control on the sinusoidal pavement are fitted, as shown in Table 5. The designed LQR and MPC control algorithms can effectively track the sine curves of the ATV on sinusoidal pavement. The vibration amplitude and SSE under MPC tracking control are slightly better than LQR. It also shows that the tracking control effect of pitch angle under LQR control is slightly poor, and its SSE is larger.

Fig. 15
figure 15

Simulation results of LQR and MPC for tracking dynamic sinusoidal value on the sinusoidal pavement

Table 5 Fitting results of attitude curves under the LQR and MPC control for tracking dynamic sinusoidal value on the sinusoidal pavement

4.1.3 Simulation and Comparative Analysis of the LQR and MPC Algorithms on the Single-Side Sinusoidal pavement

When the vehicle is driving on the single-side sinusoidal pavement and the reference value is 0, the simulation results of the control algorithms are shown in Fig. 16. The mean value of the attitude change of the body might not be 0, but it still vibrates with the vibration of the single-side sinusoidal pavement. Therefore, the fitting equation of the simulation curve under the active and passive state can be expressed as: \(y=A{\text{sin}}\left(\omega x+\varphi \right)+d\), where \(d\) is the mean value of the fitted curve.

Fig. 16
figure 16

Simulation results of the LQR and MPC for tracking to 0 on the single-side sinusoidal pavement

The body attitude curves in Fig. 16 are fitted based on the above formula. The attitude curves under LQR and MPC control on the single-side sinusoidal pavement are fitted, as shown in Table 6, and the reduction ratios of vibration amplitudes under MPC and LQR control are shown in Table 7. According to the above analysis and calculation, the SSE of the fitted curve is very close to 0, therefore, the fitted curves are very close to the response curve. The mean values of vertical displacement and roll angle are optimized by 87.6% and 27.4%, respectively, under LQR control. But the mean values of vertical displacement and roll angle are controlled to be close to 0 under MPC control, and MPC has large lead control. As shown in Table 7, the reduction ratios of vibration amplitudes of vertical displacement roll angle, and pitch angle are 89.2%, 30.1%, and 39.8%, respectively, under LQR control. The reduction ratios of vibration amplitudes of vertical displacement roll angle, and pitch angle are 93.2%, 80.3%, and 81.2%, respectively, under MPC control. Therefore, the results show that the designed control algorithms can effectively improve ride comfort and attitude stability of the vehicle dealing with single-side sinusoidal pavement disturbance, and the MPC control effect is more obvious.

Table 6 Fitting results of attitude curves under the LQR and MPC control for tracking to 0 on the single-side sinusoidal pavement
Table 7 Reduction ratios of vibration amplitudes under the LQR and MPC control for tracking to 0 on the single-side sinusoidal pavement

When the vehicle is driving on the single-side sinusoidal pavement and the reference value is stable value, the simulation results of LQR and MPC attitude tracking control algorithms are shown in Fig. 17. The body attitude under LQR control has a slight deviation from the reference value. The attitude vibration amplitude under MPC control is smaller than that under LQR control. The tracking control effects of vertical displacement, roll angle, and pitch angle under MPC control are better than those under LQR control.

Fig. 17
figure 17

Simulation results of the LQR and MPC for tracking stable value on the single-side sinusoidal pavement

When the vehicle is driving on the single-side sinusoidal pavement and the reference value is dynamic sinusoidal value, the simulation results of LQR and MPC attitude tracking control algorithms are shown in Fig. 18. The attitude curves under LQR and MPC control are fitted, as shown in Table 8. The designed LQR and MPC attitude tracking control algorithms can effectively track the sine curves of the ATV on the single-side sinusoidal pavement. The vibration amplitude and SSE under MPC tracking control are better than LQR.

Fig. 18
figure 18

Simulation results of the LQR and MPC for tracking dynamic sinusoidal value on the single-side sinusoidal pavement

Table 8 Fitting results of attitude curves under the LQR and MPC control for tracking dynamic sinusoidal value on the single-side sinusoidal pavement

4.1.4 Simulation and Comparative Analysis of the LQR and MPC Algorithms on the C-Class Random Pavement

When the vehicle is driving on the C-class random pavement and the reference value is 0, the simulation results of the control algorithms are shown in Fig. 19. Since the body attitude vibration is relatively random when the ATV driving on the C-class random pavement, the root means square (RMS) value of the body attitude is used in the analysis and comparison of the control effect. The RMS values are investigated, as shown in Table 9. The reduction ratios of RMS values of vertical displacement and pitch angle are 87.3% and 32%, respectively, under LQR control. The reduction ratios of vibration amplitudes of vertical displacement roll angle and pitch angle are 98% and 87.7%, respectively, under MPC control. Therefore, the results show that the designed control algorithms can effectively improve ride comfort and attitude stability of the vehicle dealing with single-side sinusoidal pavement disturbance, and the MPC control effect is more obvious. It also shows that the MPC attitude control algorithm has strong anti-interference performance.

Fig. 19
figure 19

Simulation results of the LQR and MPC for tracking to 0 on the C-class random pavement

Table 9 Simulation results of RMS values of the LQR and MPC for tracking to 0 on the C-Class Random Pavement

When the vehicle is driving on the C-class random pavement and the reference value is stable value, the simulation results of LQR and MPC attitude tracking control algorithms are shown in Fig. 20. The tracking control performances of vertical displacement and pitch angle under MPC control are better than those under LQR control. The tracking control effect of roll angle under LQR control is slightly better than that under MPC control. It also shows that the MPC attitude tracking control algorithm has strong anti-interference performance. In addition, the tracking control effect of roll angle is better than that of other parameters, because the left and right wheels are under the same excitation.

Fig. 20
figure 20

Simulation results of the LQR and MPC for tracking stable value on the C-class random pavement

When the vehicle is driving on the C-class random pavement and the reference value is dynamic sinusoidal value, the simulation results of LQR and MPC attitude tracking control algorithms are shown in Fig. 21. The attitude curves under LQR and MPC control on the C-class random pavement are fitted, as shown in Table 10. The designed LQR and MPC attitude tracking control algorithms can effectively track the sine curves of the ATV on the C-class random pavement. The vibration amplitude and SSE under MPC tracking control are better than LQR.

Fig. 21
figure 21

Simulation results of the LQR and MPC for tracking dynamic sinusoidal value on the C-class random pavement

Table 10 Fitting results of attitude curves under the LQR and MPC for tracking dynamic sinusoidal value on the C-class random pavement

4.1.5 Simulation and Comparative Analysis of the LQR and MPC Algorithms in Simscape

When the vehicle is driving on the sinusoidal pavement in Simscape and the reference value is 0, the simulation results of the LQR and MPC are shown in Fig. 22. The peak values and RMS values are investigated, as shown in Table 11. The tracking control effect of roll angle under MPC control is better than that under LQR control. The body attitude control can effectively improve lateral stability. The effect of body attitude under MPC control on peak lateral acceleration is better than that under LQR control. But the RMS value of lateral acceleration under LQR control is slightly better.

Fig. 22
figure 22

Simulation results of the LQR and MPC algorithms in Simscape

Table 11 Simulation results of peak values and RMS values under the LQR and MPC control

According to the above analysis and calculation, the designed attitude tracking control algorithms can all effectively suppress the amplitude of vertical displacement, roll angle and pitch angle. Attitude control also has a positive effect on lateral acceleration performance. The stability and ride comfort of the vehicle under attitude control is improved. In addition, the designed attitude tracking control algorithm can effectively track to a certain value or sinusoidal curve. Overall, the MPC attitude tracking control algorithm is slightly better compared to the LQR.

4.2 Test and Comparative Analysis of the LQR and MPC Algorithms

Due to the limited test conditions, the proposed LQR and MPC attitude tracking control algorithms are verified and analyzed according to the ATV in the stationary state and driving on single-side sinusoidal pavement, as shown in Fig. 23. When the vehicle is in stationary state, the reference values for attitude tracking control test analysis mainly include stable value and dynamic sinusoidal value. When the real car is driving on the single-side sinusoidal pavement, the reference values mainly include 0, stable value, and dynamic sinusoidal value. In addition, the speed of the actuator is controlled within a certain range to make the attitude tracking control more stable and effective.

Fig. 23
figure 23

The test of ATV with TAPS driving on the single-side sinusoidal pavement

4.2.1 Test and Comparative Analysis of the LQR and MPC Algorithms in the Stationary State

Due to the limitation of experimental conditions and actuator travel, in attitude tracking control reference value as stable value, the tracking angle of the pitch angles are 0.05 and 0.1 rad, and the tracking angles of the roll angle are 0.05 and 0.1 rad. A certain value is tracked at 1 s for body attitude. When the vehicle is in the stationary state and the reference value of attitude tracking control is stable value, the tracking control test results of LQR and MPC attitude tracking control algorithms are shown in Fig. 24. The stability, overshoot, and stability time values are investigated, as shown in Table 12. The fluctuation of parameters is due to measurement and equipment errors. Due to the delay and limitations of the actuator, the stabilization time is much higher than that of the simulation. The experiment mainly reflects the results under a variety of constraints. According to the above calculation and analysis, the proposed MPC attitude tracking control algorithm has a smaller overshoot and shorter stability time than LQR in attitude tracking control reference value as stable value. On the contrary, the LQR has better performance at stable values.

Fig. 24
figure 24

Test results of the LQR and MPC for tracking stable value in the stationary state

Table 12 Test results of stability value, overshoot, and stability time under the LQR and MPC control for tracking stable value in the stationary state

When the vehicle is in the stationary state and the reference value of attitude tracking control is dynamic sinusoidal value, the tracking control period T of roll angle and pitch angle in the test is 2 s, and the amplitude is 0.1 rad. The tracking control test results of LQR and MPC attitude tracking control algorithms are shown in Fig. 25. The attitude curves under LQR and MPC control are fitted, as shown in Table 13. According to the above analysis and calculation, the vibration amplitude of the sinusoidal fitting curve under the LQR attitude tracking control of body attitude is slightly better than that under the MPC attitude tracking control of body attitude. In addition, the control curves have a lag of about 0.5 s, and the lag of LQR tracking results is larger than that of MPC. The tracking control of roll angle is slightly better than that of pitch angle, due to the wheelbase of the vehicle being longer than the wheel track.

Fig. 25
figure 25

Test results of the LQR and MPC for tracking dynamic sinusoidal value in the stationary state

Table 13 Fitting test results of attitude curves under the LQR and MPC control for tracking dynamic sinusoidal value in the stationary state

When the tracking period T is 2 s, and the tracking angle is 0.1 rad, the designed control algorithms cannot make the body attitude reach the tracking angle, indicating that the tracking speed has exceeded the ultimate speed of the actuator. Therefore, the tracking angle of the car body attitude is reduced for tracking, and the tracking angle after reduction is 0.05 rad. The test results are shown in Fig. 26. The attitude curves are fitted, as shown in Table 14. According to the above analysis and calculation, both the LQR and MPC control algorithms can effectively track the sinusoidal curve, and the attitude under the LQR tracking control has better performance. The lag in tracking performance is less than before. The vibration amplitude of the sinusoidal fitting curve under the LQR control is better than that under the MPC control.

Fig. 26
figure 26

Reduced tracking angle test results of the LQR and MPC for tracking dynamic sinusoidal value in the stationary state

Table 14 Fitting test results of tracking curves under the LQR and MPC control for tracking dynamic sinusoidal value in the stationary state

4.2.2 Test and Comparative Analysis of the LQR and MPC Algorithms on the Single-Side Sinusoidal Pavement

When the vehicle is driving on the single-side sinusoidal pavement and the reference value of attitude tracking control is 0, the body attitude tracking control test result of the control algorithms are shown in Fig. 27. The vibration of the body's attitude is relatively random. The RMS values are investigated, as shown in Table 15. According to the above analysis and calculation, the reduction ratios of RMS value of roll angle and pitch angle are 58.2% and 39.8%, respectively, under LQR control. The reduction ratios of RMS value of roll angle and pitch angle are 59.7% and 41.1%, respectively, under MPC control. The results show that the designed control algorithms can effectively improve ride comfort and attitude stability of the vehicle dealing with single-side sinusoidal pavement disturbance, and the MPC control effect is slightly better.

Fig. 27
figure 27

The test results of the LQR and MPC for tracking to 0 on the single-side sinusoidal pavement

Table 15 Test results of RMS values under the LQR and MPC for tracking to 0 on the single-side sinusoidal pavement

When the vehicle is driving on the single-side sinusoidal pavement, due to structural and actuator speed limitations, the roll and pitch angles are tracked at 0.05 rad. The reference value as stable value test results of LQR and MPC attitude tracking control are shown in Fig. 28. The RMS values are investigated, as shown in Table 16. The test performance is lower than the simulation performance. The MPC attitude tracking control algorithm has slightly better performance than LQR.

Fig. 28
figure 28

Test results of the LQR and MPC for tracking stable value on the single-side sinusoidal pavement

Table 16 Test results of RMS values under the LQR and MPC for tracking stable value on the single-side sinusoidal pavement

When the vehicle is driving on the single-side sinusoidal pavement and the reference value of attitude tracking control is dynamic sinusoidal value, the tracking control test results of LQR and MPC attitude tracking control algorithms are shown in Fig. 29. The attitude curves under LQR and MPC control are fitted, as shown in Table 17. The SSE value and tracking lag of the body attitude fitting curve under MPC control are smaller than that under LQR control. However, the vibration amplitude has an error of about 20%. The root mean squared error (RMSE) and cosine similarity (Ye et al., 2020) are further introduced to analyze the effect of attitude tracking control. The RMSE and cosine similarity values are investigated, as shown in Table 18. The RMSE value of body attitude curve under MPC control are smaller than that under LQR control, and the cosine similarity are better than that under LQR control. Therefore, the tracking control of body attitude under MPC control is more effective.

Fig. 29
figure 29

Test results of the LQR and MPC for tracking dynamic sinusoidal value on the single-side sinusoidal pavement

Table 17 Fitting test results of attitude curves on the single-side sinusoidal pavement
Table 18 RMSE and cosine similarity values of attitude curves on the single-side sinusoidal pavement

According to the above analysis and calculation, the performance in the experiment is lower than that in the simulation environment. Considering the difference between the linear model and the real vehicle, actuator response time delay, and factors such as wear and tear, it makes sense for there to be a difference between the simulation and the real vehicle tests, but the improved trend is consistent. It fully explains the positive performance of the proposed attitude control system in improving vehicle attitude stability and ride comfort. In addition, the effect of attitude tracking control is also positive, which has a certain basis for further research of attitude control in more complex conditions such as steering and braking.

5 Conclusion

To improve the attitude stability and ride comfort of the ATV, the dynamics model of the full car with 11-DOF is established based on the Newton–Euler equation. The Simscape kinematic model is developed considering the ATV structural nonlinearity. According to the full car mathematical model, the LQR and MPC attitude tracking control algorithms are designed, and the two tracking control algorithms are theoretically compared.

In simulation and test, the methods of the fitting curve and cosine similarity are introduced to analyze the attitude tracking effect in this paper. In the simulation environment, the LQR and MPC attitude tracking control algorithms reduce the body attitude change by at least 30% and 80%, respectively, when the body attitude is suppressed. The lateral acceleration is reduced by 43.33% and 41.87% under LQR and MPC control, respectively. During the test, the body attitude change is reduced by at least 39% and 41%, respectively. In terms of tracking control effect, the two attitude tracking control algorithms are compared. In addition, simulation and experiment results show that the designed tracking control algorithms can make the body attitude track a certain attitude or various sinusoidal curves, which reflects the transient and steady-state response characteristics of the tracking control algorithms and illustrates the effectiveness of the designed attitude tracking control algorithm. Finally, the proposed tracking controllers can effectively follow the desired attitude input and have great potential on the improvement of attitude stability and ride comfort in harsh pavement.