Journal of Fuzzy Systems and Control, Vol. 3, No 2, 2025 |
A Study of Adaptive Model Predictive Control for Rotary Inverted Pendulum
Phuc-Hoang Huynh 1, Khac-Chan-Nguyen Le 2, Truong-Phuc Nguyen 3, Hoang-Dang-Khoa Tran 4, Su-Truong Dang 5, Thanh-Quyen Nguyen 6, Thang-Phong Le 7, Huu-Hanh Nguyen 8, Pham-Hong-Linh Tran 9, Hau-Phuong Nguyen 10,
Hoang-Son Nguyen 11, Tai-Truong Nguyen 12, Hai-Thanh Nguyen 13,*
1, 3, 4, 5, 7, 8, 11 Faculty of Electrical and Electronics Engineering (FEEE), Ho Chi Minh City University of Technology and Education (HCMUTE), Ho Chi Minh City (HCMC), Vietnam
2, 8, 9, 12 Faculty of Mechanical Engineering, Ho Chi Minh City University of Technology and Education (HCMUTE),
Ho Chi Minh City (HCMC), Vietnam
6, 10 Faculty of Vehicle and Energy Engineering, Ho Chi Minh City University of Technology and Education (HCMUTE),
Ho Chi Minh City (HCMC), Vietnam
13 Nguyen Huu Canh Technical and Economics Intermediate School,500-502, Huynh Tan Phat St., Binh Thuan ward,
District 7, Ho Chi Minh City, Vietnam
Email: 1 21151503@student.hcmute.edu.vn, 2 21146129@student.hcmute.edu.vn, 3 21142576@student.hcmute.edu.vn,
4 21142548@student.hcmute.edu.vn, 5 18142232@student.hcmute.edu.vn, 6 20145594@student.hcmute.edu.vn,
7 21142147@student.hcmute.edu.vn, 8 21142093@student.hcmute.edu.vn, 9 21146121@student.hcmute.edu.vn,
10 21142154@student.hcmute.edu.vn, 11 20142402@student.hcmute.edu.vn, 12 20142438@student.hcmute.edu.vn,
*Corresponding Author
Abstract—This paper proposes an Adaptive Model Predictive Control (MPC) approach for the rotary inverted pendulum (RIP). The method combines Linear Time-Varying (LTV) models at each sampling instant with a Linear Time-Varying Kalman Filter (LTVKF) for state estimation. By predicting and adapting to dynamic system changes, the controller achieves trajectory tracking performance comparable to non-adaptive MPC. However, the Adaptive MPC extends the arm’s operating range by up to 1.5 times, making it a promising solution for strongly nonlinear or time-varying systems like the RIP.
Keywords—Rotary Inverted Pendulum; Adaptive Control; Model Predictive Control; Kalman Filter; Linear Time-varying
RIP is a representative model in control theory, widely studied due to its strong nonlinearity [1], inherent instability, and practical applications in robotics [2][3]. Controlling this system requires advanced control methods capable of handling rapid dynamic changes and maintaining stability under various operating conditions.
Optimal control methods have always been a focus of researchers and have high applicability, such as Linear Quadratic Regulator (LQR) control [4], Linear Quadratic Gaussian (LQG) control [5] and the classical Euler-Lagrange variable method [6]. Among them, MPC is regarded as one of the optimal control methods due to its ability to control nonlinear systems in real-time and handle control constraints configured by the designer [7]. As a result, MPC has been widely applied in practice, such as in aircraft control [8], control of longitudinal flight dynamics of a fixed-wing UAV[9], oxygen stoichiometry control [10]. However, traditional MPC methods often rely on a linearized model at a fixed operating point, which limits the system's adaptability, especially when the pendulum arm follows reference signals with large amplitudes and rapid variations [11]. This is because, for strongly nonlinear systems, the system dynamics may no longer match the linearized dynamics at the original operating point when the working conditions deviate significantly. This limitation can lead to degraded performance when the system operates outside the valid range of the linearized model.
In practice, several studies have been conducted to address this issue, such as using Nonlinear MPC for swing-up and control of RIP [12], The advantage of this control method is that it can handle the system from any initial position. However, it requires high-performance hardware and involves complex algorithms to solve the non-convex optimization problem. Another approach is Gain-Scheduled MPC [13], which allows the design of multiple MPC controllers with different configurations, such as sampling time, prediction horizon, control horizon, and control weighting factors. While this method provides flexibility, its main drawback is that the number of controllers is finite, and careful selection is required for each operating condition.
Therefore, to effectively overcome nonlinear systems' control challenges, this paper proposes an adaptive MPC for RIP. Continuously updating the predictive model at each sampling instant enhances control performance and extends the operating range of the RIP system. The advantage of this controller is that it requires designing only a single controller offline, involves less run-time computational effort, has a smaller memory footprint, and is more robust to real-life changes in system conditions [14].
In [11], the authors provided a detailed explanation of the system variables, modeled the RIP system, and designed the non-adaptive MPC controller. In [15], they further discussed the parameter selection method for the Kalman filter used in the non-adaptive MPC controller and applied the same filter to the LQG controller to compare the control performance of non-adaptive MPC, LQG, and LQR. However, in both studies, the controllers were designed to perform well only around the operating point, as they were based on a linearized model at that point.
In this paper, the proposed approach builds upon the previously designed MPC controller by incorporating the LTV plants method and designing the LTVKF state estimator. The implementation results are simulated using MATLAB/Simulink.
RIP consists of an arm and a pendulum, with a DC motor mounted at the end of the arm. The pendulum is always stable in the downward position but unstable in the upright position. Therefore, the objective is to design a controller to keep the pendulum upright and move the arm along a predefined trajectory. The model structure is shown in Fig. 1, For details, a reader can be referred to [11].
The structure of the adaptive MPC controller applied to RIP is illustrated in Fig. 2.
To design an Adaptive MPC controller, the steps are listed from part A to part C
By applying the Euler-Lagrange dynamic equations to describe the dynamics of the RIP and considering that a DC motor is used to generate the control force for the arm, it is necessary to combine two mathematical models: the DC motor and the RIP system. In [11], the authors modeled RIP under consideration.
To obtain the state-space equations at each operating point, state matrices A and B must be determined at each operating point and each sampling instant. The linearized system results are presented in (1).
| (1) |
where:
: Arm angle (rad);
: Pendulum angle (rad);
: Control voltage (v);
; Matrices A and B are listed in (2)
| (2) |
|
State-space equation (1) It is in the continuous domain. To convert it into the discrete domain, the matrix exponential discretization method will be applied from equation (3) to equation (8) [16]:
The general solution of the differential equation (1) can be expressed as:
| (3) |
Based on the general solution (3) of the continuous-time system, we obtain (4) and (5).
| (4) |
| (5) |
In (6), we rewrite the exponential function of the extended matrix
| (6) |
From (6), discrete-time matrices are obtained:
| (7) |
| (8) |
Where:
: It is the number of state variables of the system.
: It is the number of control variables of the system.
: It is the sampling time of the controller.From this, the authors can summarize that to obtain Linear Time-Varying (LTV) models at each sampling instant, the system must be linearized at each sampling time using the equation (2), and then converted from the continuous domain to the discrete domain using equation (6) to equation (8).
To design an Adaptive MPC controller, an MPC controller must first be designed at the initial operating point [17], at
. This design was previously conducted in [11],[15]. Here, the author revisits the controller parameters as






Adaptive MPC utilizes a Kalman state estimator and adjusts the gain matrices
and
at each sampling instant to maintain consistency with the updated system model. The computed results are presented in equation (9) to equation (11) [17]:
| (9) |
| (10) |
| (11) |
Where:
: is computed as in the state estimation for MPC by adjusting the measurement noise and process noise values, which were previously derived by the author in [15].
: These are the state-space matrices, determined as previously in [15] but influenced by the model plant updated over time at step k.
: is the covariance matrix of the state estimation error at time k, based on time
.
and
are the updated Kalman filter gain matrices. To evaluate the control performance of the Adaptive MPC controller, the author will simulate two controllers: a non-adaptive MPC designed in the previous study [15] and Adaptive MPC. A simulation diagram of two controllers is illustrated in Fig. 3.
Simulation results of MPC (orange line) and Adaptive MPC controllers (blue line) with measurement noise in the arm angle and pendulum angle, where the noise power is [0.00000001] and the arm angle follows a reference signal with f = 6 (rad), are presented in Fig. 4.
The control performance is evaluated using the Root Mean Square Error (RMSE) index, as presented in Table 1:
Adaptive MPC | MPC | |
| 1.62 | 1.559 |
| 0.038 | 0.054 |
| 3.289 | 2.604 |
From the simulation results in Fig. 4 and the control performance in Table 1, we obtain
To further demonstrate that adaptive MPC can adapt to highly nonlinear systems when operating conditions change, the author will set the arm angle to track a reference signal with f=8 (rad). The results are shown in Fig. 5 and Fig. 6.
From Fig. 5, adaptive MPC controller is still able to track the reference signal, whereas the standard MPC fails to do so. Furthermore, the arm angle response remains smooth, and the overshoot in the pendulum angle is limited to 0.2 rad. This demonstrates that Adaptive MPC has excellent adaptability to sudden changes in operating conditions.
To verify the trajectory tracking performance of both controllers when the reference signal is continuously varying, the author will set the arm to follow a sinusoidal signal with
(rad). Results are shown in Fig. 6.
Control performance is evaluated using the RMSE index, as presented in Table 2.
Adaptive MPC | MPC | |
| 1.232 | 1.293 |
| 0.019 | 0.018 |
| 2.399 | 0.891 |
From the results in Fig. 6 and the control performance in Table 2, the response performance of both controllers at alpha and beta is nearly equivalent. However, the average control voltage in Adaptive MPC is 2.5 times higher than in MPC. From this, adaptive MPC should only be used when the system dynamics change significantly due to varying operating conditions. This can be determined either through the system’s dynamic equations or through experimental testing.
By linearizing the system at every operating point and applying the matrix exponential discretization method to update the predictive model for the MPC controller, we obtain the Adaptive MPC controller. Since the model is updated at each sampling time, the conventional Kalman filter is no longer suitable. Therefore, the author has designed the LTVKF state estimator, which can estimate states based on the updated model.
Through simulations under various conditions, it is observed that Adaptive MPC delivers good control performance and is well-suited for highly nonlinear systems whose dynamics change significantly with operating conditions. However, it is also evident that standard MPC provides comparable control performance to Adaptive MPC when operating around the pre-linearized working point while significantly optimizing control energy compared to Adaptive MPC.
The comparison between the Adaptive MPC and non-adaptive MPC controllers also demonstrates that practical implementation is entirely feasible, as the simulation conditions leading to real-world experiments for the non-adaptive MPC controller were successfully conducted by the author in [15]. This controller presents a promising control method for systems with changing dynamics under varying operating conditions, such as autonomous vehicles, where the dynamics vary with steering angle and speed.
This paper belongs to project SV2025-56 of Ho Chi Minh City University of Technology and Education (HCMUTE). It is funded by HCMUTE. We also want to give thanks to the PhD. Van-Dong-Hai Nguyen (FEEE-HCMUTE) for his ideas in this contribution.
Phuc-Hoang Huynh, A Study of Adaptive Model Predictive Control for Rotary Inverted Pendulum