Integrating Disturbance Handling into Control Strategies for Swing-up And Stabilization of Rotary Inverted Pendulum
Online veröffentlicht: 31. März 2025
Seitenbereich: 7 - 16
Eingereicht: 13. Jan. 2024
Akzeptiert: 08. Feb. 2024
DOI: https://doi.org/10.14313/jamris-2025-002
Schlüsselwörter
© 2025 Thi-Van-Anh Nguyen et al., published by Sciendo
This work is licensed under the Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License.
The rotary inverted pendulum (RIP) is a fascinating mechanical system that presents significant control challenges due to its underactuated and nonlinear nature [3,12–14,17,20]. This system has been widely used in various fields for investigating nonlinear dynamics and control strategies [4,8,10,16]. The primary control issues in the RIP involve achieving the desired balance position of the pendulum and ensuring system stability during dynamic motion. Researchers have explored different control methods to address these challenges, each with its strengths and limitations.
One promising control approach is the energy-based swing-up controller, which efficiently brings the pendulum into an upright position [1,7,14].
However, a more robust control strategy is necessary to maintain stable control in the vicinity of its unstable equilibrium, as well as deal with disturbances. The Linear Quadratic Regulator (LQR) [15,18,19] is a widely-recognized control technique renowned for its ability to achieve stability in linear systems. However, it does not inherently possess robustness against disturbances. On the other hand, the sliding mode controller (SMC) [2,5,11,21] is renowned for its disturbance rejection capabilities, but its chattering behavior can raise practical implementation concerns. To overcome the limitations of these individual control techniques and leverage their complementary advantages, this paper proposes a novel control strategy for the rotary inverted pendulum: the LQR-based Sliding Mode Control (LQR-based SMC) approach. The objective is to harness the stability advantages of LQR while benefiting from the disturbance rejection capabilities of SMC. The main contribution of this work lies in the design and evaluation of an LQR-based SMC controller for the rotary inverted pendulum. By integrating these two control techniques, the proposed approach aims to achieve enhanced stability and robustness, allowing the system to withstand external disturbances and parameter changes.
This study focuses on addressing the control challenges of the RIP system. The proposed LQR-based SMC controller is designed to stabilize the pendulum and effectively resist the impact of disturbances. Through comprehensive simulations, the controller’s performance is evaluated, and it is found to outper form the traditional LQR controller in the presence of disturbances. The LQR-based SMC controller show-cases resilience against changes in model parameters, making it suitable for real applications with varying system dynamics. However, the presence of chattering in the output signals warrants further research and optimization efforts to ensure smooth control action without compromising disturbance rejection capabilities. Overall, the investigation highlights the potential of the LQR-based SMC controller as a robust and effective solution for regulating the rotary inverted pendulum system in the presence of disturbances and parameter uncertainties, paving the way for advancements in control strategies for complex and nonlinear systems.
In summary, this study makes the following notable contributions:
Integration of the Sliding Mode Control approach into the LQR controller, enabling effective handling of external disturbances and variations in model parameters in a rotary inverted pendulum system. Implementation of an extended state observer to enhance control performance and reduce the dependency on a large number of sensors. Conducting extensive multi-scenario simulations to validate and demonstrate the effectiveness of the proposed control approach.
These contributions collectively contribute to the advancement of control strategies for the rotary inverted pendulum system, offering insights into robust and efficient control techniques for various practical applications.
In this article, the RIP model is constructed using Simscape to demonstrate its correspondence with physical reality. Figure 1 displays a schematic depiction of the RIP, comprising a pendulum arm and a pendulum rod of length

The 3D model of the RIP.
The parameters of the pendulum.
Symbol | Description | Values | Units |
---|---|---|---|
Pendulum’s mass | 0.125 | ||
Pendulum’s length | 0.15 | ||
Rotary arm’s length | 0.15 | ||
Pendulum’s inertia moment | 2.3 × 10−4 | ||
Inertia moment of arm | 9.4 × 10−4 | ||
Viscous friction coefficient of the pendulum rod | 9.5 × 10−3 | - | |
Viscous friction coefficient of the pendulum arm | 0.04 | - | |
Motor torque constant | 0.042 | ||
Motor back EMF constant | 0.042 | ||
Terminal resistance | 2.6 | Ω | |
Rotor Inductance | 0.85 | mH | |
Gravitational acceleration | 9.81 |
Due to the uniformity of the pendulum rod, the center of mass is located at the midpoint of its length. The position
Taking the derivative with respect to time on both sides of the equation (1), the absolute velocity of
Squaring both sides of equation (2), obtain:
The kinetic energy of the RIP includes contributions from both the velocity of the pendulum’s center of mass, as well as the rotational motion of both the pendulum rod and pendulum arm.
The following expression determines the potential energy of the RIP:
The Lagrangian equation is represented as:
The pendulum arm is characterized by the viscous friction coefficient
By using the Euler-Lagrange equation:
Thus, the model for nonlinear dynamics for the RIP can be expressed as follows:
Selecting the state vector as
In this section, the discussion revolves around bringing the pendulum to an upright position, along with the controllers used to stabilize the pendulum of the RIP system. An estimated observer is also proposed.
In a natural state, the pendulum maintains a downward vertical position, so to bring it to an unstable equilibrium position, which is an upward upright position, a swing-up control system must be designed. To address this issue, the energy control law proposed by N.J. Mathew
The second-order linear control system (LQR control) plays a role in finding the optimal control signal to bring the system from the initial state to the final state with the lowest cost. The LQR controller’s cost function is expressed as follows:
The objective of the LQR controller is to minimize the cost function as specified in equation (14) in which
Modifying the elements, the state weighting matrix
The state feedback matrix
The output signal of the
LQR is a linear control system that is suitable for RIP due to its fast settling times. However, the limitation of the LQR is its inability to handle input disturbances. To overcome this drawback, the paper proposes the use of LQR-based SMC.
The SMC is a nonlinear control. The control input taken from the SMC is not a continuous function of time. It switches from one function to another depending on the pendulum’s position. The additional term
Consider a nonlinear inverted pendulum system described by:
The system’s control input is specified as follows:
Typically,
Considering the following sliding surface:
In equation (21), gain matrix
During sliding,
Replacing (18) and (19) into (23) yields:
When combined with LQR,
By combining SMC with LQR, the SMC is expected to attenuate input disturbance, meaning that
To ensure the existence of sliding mode from the beginning (
The Lyapunov stability theorem is employed to compute the discontinuous control input for the SMC. Consider the Lyapunov function as follows:
For a nonlinear system, the sufficient condition for stability is given by:
Formulas (28) in (31), we have:
Choose
Replace
To ensure system stability, the value of
To apply this to the practical model, estimating the velocity of the pendulum and the arm are necessary. The observer estimation also minimizes the use of sensors to avoid waste.
When using an LQR-based SMC, the observer system is designed according to the Extended State Observer design method. An Extended State Observer is as follows:
where
Considering,
The following equation is obtained
Here, the matrix
Simulation in multiple scenarios is carried out to evaluate the proposed controller (LQR-based SMC) to stabilize the pendulum in the vertically upright position. The traditional LQR controller is chosen as its encounter in every scenario simulation, where the pendulum is initially set at the downright position. Both controllers are first evaluated in two scenarios: external disturbance absent and external disturbance present. After that, the variation in the physical parameter of the model is also deemed to verify the effectiveness of the extended state observer, and this affects the proposed controller’s performance. The parameters of the LQR-based SMC controller are fine-tuned as follows:
Using the matrix value
In this simulation, the input disturbance is selected with an intensity of
Therefore, the signal obtained from SMC is given as:
Combined with the LQR signal, the output signal of the LQR-based SMC controller is:
To design the observer in section 3.4, the parameters are selected as follows:
The next subsections present the simulation results.
In this particular scenario, a comparative evaluation is conducted involving both the proposed controller and the traditional LQR controller. These evaluations are carried out with identical initial conditions and system setups, deliberately excluding any external disturbances that could affect the rotary inverted pendulum system. Our primary objective is to assess how each controller performs in regulating the system dynamics and, more importantly, achieves stability by maintaining the pendulum in an upright position. This stability is a critical factor for the safe and precise operation of the rotary inverted pendulum system.
As illustrated in Subfigures 2a and 2b, it becomes evident that the signal controlled by the LQR exhibits a notably faster settling time when compared to the signal under the control of the LQR-based Sliding Mode Control (SMC) configuration when no input disturbances are introduced into the system. Furthermore, Subfigure 2c visually demonstrates that the signal controlled by the LQR is devoid of the chattering phenomenon that is distinctly observable in the signal governed by the LQR-based SMC.

The comparison results without external disturbance: (a) the pendulum angle, (b) the arm angle, and (c) the control signal of two controllers.
It is crucial to highlight the fact that the introduction of the SMC component within the SMC-LQR controller, which is primarily designed to enhance robustness against external disturbances, appears to have an adverse effect on its performance in scenarios where disturbances are absent. This observation underscores the importance of carefully selecting and configuring control strategies depending on the specific operational context.
For a more comprehensive examination, Figure 3 offers a detailed comparative analysis of the estimated values and actual values derived from the Extended State Observer for both the traditional LQR (depicted in the two upper subfigures, labeled as aandb) and the SMC-LQR controllers (portrayed in the two lower subfigures, designated as c and d). This analysis provides valuable insights into the behavior and performance of these controllers under various operational conditions.

The Extended State Observer in the first scenario: (a) the pendulum angle velocity, (b) the arm angle velocity of the LQR controller, (c) the pendulum angle velocity, and (d) the arm angle velocity of the LQR-based SMC controller.
To evaluate the performance of the proposed controller in the presence of external disturbances, a randomized input with an amplitude of 10−2 (Figure 4a) is introduced as a disturbance to the system after 5 seconds. This allows us to validate the controller’s ability to handle disturbances and assess their impact on system stability.

The comparison results when there is external disturbance (a): the pendulum angle (b), the arm angle (c), and the control signal of two controllers (d).
As illustrated in Subfigures 4b and 4c, the LQR-based SMC controller demonstrates a notable advantage when dealing with input disturbances. The signals controlled by the LQR-based SMC exhibit fast settling times and minimal oscillations, whereas the LQR controller alone fails to stabilize the system, leading to pronounced oscillations. Subfigure 4d emphasizes the impact of input disturbances on the rotary inverted pendulum, with the control signal
Similar to the previous scenario, the estimated values of the Extended State Observer closely approximate their actual signals, as depicted in Figure 5. This reaffirms the effectiveness of the ESO in estimating system states and supporting the controller’s performance under the influence of external disturbances.

The Extended State Observer in the first scenario: (a) the pendulum angle velocity, (b) the arm angle velocity of the LQR controller, (c) the pendulum angle velocity, and (d) the arm angle velocity of the LQR-based SMC controller.
It is very difficult to obtain the physical parameters of any system with high accuracy. Thus in this scenario, the proposed controller is tested with the assumption that it deviates from the model’s parameter. In detail, the pendulum arm is obtained with a 15% deviation in mass and 8% deviation in length from actual values. This deliberate manipulation of the system’s parameters allows us to explore the controller’s robustness and adaptability in the face of uncertainties. It’s worth noting that this simulation takes place within the context of an environment that includes external disturbances, as previously studied in the second scenario. By incorporating both parameter deviations and external disturbances, our evaluation aims to provide a more realistic and demanding testbed for assessing the controller’s performance.
Subsequently, our observations, as illustrated in Subfigures 6a and 6b, reveal the behavior of the pendulum angle and its arm angle. Notably, the system under the control of the LQR exhibits a pronounced susceptibility to these parameter deviations. While both controllers demonstrate the ability to effectively swing the pendulum arm upward, only the LQR-based SMC controller exhibits the capability to stabilize the pendulum, effectively counteracting the adverse effects of parameter uncertainties. Because of these similar conclusions, figures depicting control signals and ESO’s states for both controllers are not included.

The comparison results during changes in model parameters: (a) the pendulum angle and (b) the arm angle of two controllers.
In conclusion, our investigation has demonstrated the robustness and adaptability of the LQR-based Sliding Mode Control (LQR-based SMC) controller in dealing with external disturbances and variations in model parameters in the rotary inverted pendulum (RIP) system. Through comprehensive simulations, it was observed that the LQR-based SMC controller outperformed the traditional LQR controller in the presence of external disturbances. The LQR-based SMC controller exhibited fast settling times and minimal oscillations, effectively attenuating the impact of disturbances on the system. This remarkable disturbance rejection capability makes it a valuable choice for applications where uncertainties and external disturbances are prevalent.
Furthermore, the LQR-based SMC controller displayed resilience against changes in model parameters. It successfully maintained stable control, even when faced with uncertainties in the system dynamics. This adaptability is essential for real systems, where model parameters may vary due to environmental conditions or other factors.
However, it is important to acknowledge that the introduction of the Sliding Mode component in the control signal resulted in a chattering phenomenon in the output signals. While this behavior did not compromise the overall stability of the system, it may raise practical implementation concerns. Further research and engineering efforts are necessary to address this issue and optimize the LQR-based SMC controller for smoother control without sacrificing its disturbance-rejection capabilities.
In summary, our study highlights the LQR-based SMC controller as a viable and effective solution for regulating the rotary inverted pendulum system in the presence of external disturbances and uncertain parameters. By combining the advantages of LQR and Sliding Mode Control, this controller demonstrates promising performance and opens avenues for advancements in control strategies for similar complex systems. Looking towards future research, refining the LQR-based SMC controller and exploring hybrid control approaches may pave the way for even more robust and reliable control solutions in various practical applications.