Next Article in Journal
Building an Educational Automated Mechatronics-Based Sorting System
Previous Article in Journal
World Modeling for Autonomous Wheel Loaders
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Optimized Hierarchical Sliding Mode Control for the Swing-Up and Stabilization of a Rotary Inverted Pendulum

by
Duc-Binh Pham
,
Quy-Thinh Dao
and
Thi-Van-Anh Nguyen
*,†
School of Electrical and Electronic Engineering, Hanoi University of Science and Technology, Hanoi 100000, Vietnam
*
Author to whom correspondence should be addressed.
These authors contributed equally to this work.
Automation 2024, 5(3), 282-296; https://doi.org/10.3390/automation5030017
Submission received: 18 June 2024 / Revised: 4 July 2024 / Accepted: 6 July 2024 / Published: 8 July 2024

Abstract

:
This paper presents a study on controlling a rotary inverted pendulum (RIP) system using a hierarchical sliding mode control (HSMC) approach. The objective is to swing up and stabilize the pendulum at a desired position. The proposed HSMC controller addresses the underactuation challenge through a hierarchical structure of sliding surfaces. The particle swarm optimization (PSO) algorithm is used to optimize the controller parameters. Simulations were performed to evaluate the performance of the HSMC controller at different initial pendulum angles, demonstrating its effectiveness in achieving swing-up and stabilization. The integration of the PSO algorithm enhances the controller’s adaptability and robustness, emphasizing the benefits of combining optimization algorithms with controller parameter tuning for underactuated systems like the RIP.

1. Introduction

Inverted pendulum systems have long captivated researchers and engineers in the field of control theory due to their inherent complexity and practical significance. These systems serve as valuable testbeds for developing and evaluating control strategies, offering insights into the fundamental challenges of stabilizing unstable systems. The dynamics of inverted pendulums make them particularly intriguing, as they require continuous adjustments to counteract the effects of gravity and external disturbances. The concept of an inverted pendulum can be visualized as a pendulum that is placed in an upside-down position, with its pivot point above the center of mass. This configuration inherently leads to an inherently unstable system, as even the slightest disturbance can cause the pendulum to fall and diverge from its upright position. Consequently, controlling the inverted pendulum becomes a challenging task that necessitates sophisticated control algorithms and strategies [1,2].
Control methods for rotary inverted pendulum (RIP) systems have been extensively studied to address their inherent instability. Conventional methods such as proportional–integral–derivative (PID) control [3,4,5] offer simplicity but struggle with nonlinear dynamics and uncertainties, leading to limited stability and robustness in controlling RIP systems. Sliding mode control (SMC) [6,7,8,9,10] ensures robustness by driving the system onto a predefined sliding surface, effectively minimizing disturbances and uncertainties. However, SMC can introduce chattering phenomena, which can degrade control performance and affect system dynamics. Fuzzy logic control (FLC) incorporates linguistic rules and fuzzy sets to handle nonlinearities and uncertainties, providing a flexible approach to RIP control [11,12]. However, FLC requires an extensive rule base and parameter tuning, which can be time-consuming and complex. While the above control approaches have been investigated in terms of the performance, robustness, and stability of RIP systems, their drawbacks should be considered when selecting an appropriate control strategy for practical applications. In addition to the mentioned drawbacks, the above studies either did not specifically present the method for adjusting controller parameters or did not select optimal parameters.
To address the limitations and disadvantages of the preceding controllers, the selection of the hierarchical sliding mode control (HSMC) approach emerges as a promising remedy. The effectiveness of HSMC in controlling underactuated systems has been extensively demonstrated in numerous studies [13,14,15,16]. Hierarchical sliding mode control is an advanced control method that combines the benefits of sliding mode control with a hierarchical control structure. Sliding mode control is a robust control technique that aims to drive the system’s states onto a predefined sliding surface, minimizing the effects of disturbances and uncertainties. This is achieved by designing a discontinuous control law that forces the system’s trajectory to track the sliding surface. However, in underactuated systems, where the number of control inputs is less than its degrees of freedom, sliding mode control alone may not be sufficient to achieve satisfactory control performance. HSMC addresses this limitation by introducing a hierarchical control structure. The control structure consists of two levels of the controller: the upper level and the lower level. The upper-level controller is responsible for generating the desired sliding surface and supervising the lower-level controller. It ensures that the lower-level controller tracks the desired sliding surface, effectively controlling the system’s states. The lower-level controller, also known as the sliding mode controller, implements the discontinuous control law to drive the system onto the sliding surface. This paper aims to leverage the advantages of the HSMC controller to address two critical tasks of the pendulum system: swing-up and stabilization. By employing the HSMC controller in this research, the objective is to showcase its effectiveness in both swing-up and stabilization tasks, ultimately providing insights into the applicability of the HSMC approach for controlling complex and underactuated systems like the pendulum.
Particle swarm optimization (PSO) is a powerful optimization algorithm inspired by the social behavior of birds and fish. It involves a population of particles that move through the search space to find the optimal solution based on the best-performing particles. This algorithm has found applications in various control methods, demonstrating its versatility. In the realm of control systems, PSO has been successfully integrated into methodologies such as fuzzy logic [17,18], PID [19,20], and more. In this study, we leverage the capabilities of PSO by incorporating it into the parameter-tuning process of hierarchical sliding mode control. This integration aims to optimize the HSMC controller’s parameters, enhancing its overall performance. The decision to employ PSO in this research underscores the importance of intelligent optimization techniques in improving control systems. It emphasizes PSO’s potential as a valuable tool in the parameter optimization process, offering efficiency and effectiveness in achieving optimal controller configurations.
This paper makes the following contributions:
  • Our research introduces a pioneering hierarchical sliding mode controller that streamlines control efforts and outperforms dual-controller methods in both the swing-up and stability control of the rotary inverted pendulum.
  • In addition, our paper leverages particle swarm optimization (PSO) to fine-tune the controller’s parameters, resulting in enhanced control performance for the rotary inverted pendulum.

2. HSMC and PSO: Theoretical Foundations and Integration Strategies

2.1. Hierarchical Sliding Mode Control

Having scrutinized the structure and merits of the HSMC controller in the Introduction, this section delves into the controller design. Consider a single-input multi-output system comprising n subsystems, each representing a specific component or aspect of the overall system. By dividing the system into these subsystems, we can derive the state-space equations that describe the dynamics of the entire system:
x ˙ 1 = x 2 x ˙ 2 = F 1 ( x ) + G 1 ( x ) u x ˙ 2 i 1 = x 2 i x ˙ 2 i = F i ( x ) + G i ( x ) u x ˙ 2 n 1 = x 2 n x ˙ 2 n = F n ( x ) + G n ( x ) u
where { x 1 , x 2 , , x 2 n } are state variables; F i ( x ) and G i ( x ) , with i = { 1 , 2 , , n } , are nonlinear functions; and the control input signal is represented by u. Considering the state space associated with the i t h subsystem, the sliding surface of this subsystem can be defined as follows:
s i = x 2 i + λ i x 2 i 1
where λ i is an arbitrary positive constant. The derivation of the equivalent control signal for the i t h subsystem, responsible for maintaining the subsystem on its designated sliding surface, can be achieved by setting s ˙ i = 0 :
s ˙ i = x ˙ 2 i + λ i x ˙ 2 i 1 = λ i x 2 i + F i + G i u = 0
and then
u e q i = λ i x 2 i + F i G i .
Figure 1 illustrates the hierarchical structure of the sliding surfaces, providing a visual representation of the stepwise construction process [21]. Consider the ith-layer sliding surface with a constant γ i 1 ( i = 1 , 2 , , n ) and γ 0 = S 0 = 0 :
S i = γ i 1 S i 1 + s i .
The determination of the control signal for the ith-layer sliding surface involves a combination of the control signal from the previous layer’s sliding surface and two components: the equivalent control signal ( u e q i ) and the switching control signal ( u s w i ):
u i = u e q i + u s w i + u i 1
where u 0 = 0 . The calculation of the control signal u i in the aforementioned equation can be performed utilizing Lyapunov stability theory as a foundation. Let us consider the Lyapunov function associated with the sliding surface of the ith layer, denoted by
V i ( t ) = 1 2 S i 2 .
The time derivative of the above function is
V ˙ i ( t ) = S i S ˙ i = S i ( γ i 1 S ˙ i 1 + s ˙ i ) = S i q = 1 i p = q i γ p s ˙ q
where γ p = 1 if p = i . The following equation is derived by substituting (3), (4), and (6) into (8):
V ˙ i = S i q = 1 i p = q i γ p λ q x 2 q + F q + G q u i = S i q = 1 i p = q i γ p G q m = 1 m q i u e q m + m = 1 i u s w m = S i m = 1 i q = 1 q m i p = q i γ p G q u e q m + S i m = 1 i q = 1 i p = q i γ p G q u s w m .
An exponential reaching law with the arbitrary positive constants k i and η i is chosen and defined as follows:
S ˙ i = k i S i η i sgn ( S i ) .
The ith layer has the following switching control law:
u s w i = m = 1 i q = 1 q m i p = q i γ p G q u e q m q = 1 i p = q i γ p G q m = 1 i 1 u s w m k i S i + η i sgn ( S i ) q = 1 i p = q i γ p G q .
The control signal for the entire system can be calculated when i = n [21]:
u n = m = 1 n 1 u s w m + u s w n + m = 1 n u e q m = q = 1 n p = q n γ p G q u e q q q = 1 n p = q n γ p G q k n S n + η n sgn ( S n ) q = 1 n p = q n γ p G q .
Theorem 1. 
For the underactuated system represented by Equation (1), the sliding surface S i of the ith layer, as defined in (5), is asymptotically stable, with the control law determined by the following expression:
u n = q = 1 n p = q n γ p G q u e q q q = 1 n p = q n γ p G q k n S n + η n sgn ( S n ) q = 1 n p = q n γ p G q .
Proof. 
By selecting the Lyapunov function stated in Equation (7), we can compute its time derivative and subsequently apply the control signal defined in Equation (13):
V ˙ i = S i S ˙ i = S i k i S i η i sgn ( S i ) = k i S i 2 η i S i .
Integrating both sides of the aforementioned equation, we obtain
0 t V ˙ i d τ = 0 t k i S i 2 η S i d τ .
Then,
V i ( t ) V i ( 0 ) = 0 t k i S i 2 η S i d τ .
With V i ( t ) 0 , 0 t k i S i 2 + η S i d τ V i ( 0 ) and lim t 0 t k i S i 2 + η S i d τ V i ( 0 ) < .
Based on Barbalat’s lemma, we have
lim t k i S i 2 + η S i = 0 lim t S i = 0 .
Then, the ith-layer sliding surface has been proven to be asymptotically stable. □
Theorem 2. 
For the underactuated system represented by Equation (1), the ith-subsystem sliding surface s i , as defined in (2), is asymptotically stable, with the control law determined by (13).
Proof. 
From Theorem 1, the ith-layer sliding surface S i 0 when t . Then,
lim t S i = lim t γ i 1 S i 1 + s i = γ i 1 lim t S i 1 + lim t s i = lim t s i = 0 .
The sliding surface s i of the ith subsystem is demonstrated to be asymptotically stable. □

2.2. Particle Swarm Optimization

Particle swarm optimization (PSO) is an optimization strategy derived from the foraging behavior of living organisms, i.e., fish schools and bird flocks, initially proposed by J.Kennedy and R.Eberhart [22]. This method simulates a swarm of particles, where the particle’s position stands for a potential solution within a multidimensional search space. By iteratively adjusting each member’s positions and velocities in response to both their individual experiences and the best solution encountered by the swarm of n particles, PSO efficiently explores the solution space to locate optimal or near-optimal solutions. The updating formula for the velocity and position of the ith particle ( i = 1 , 2 , , n ) after the k t h iteration is described as follows:
v i k + 1 = w v i k + c 1 r 1 ( p b e s t i k x i k ) + c 2 r 2 ( g b e s t i k x i k )
x i k + 1 = x i k + v i k
where w is the inertia weight, while the terms r 1 and r 2 refer to uniformly distributed random variables in the range of (0, 1). p b e s t and g b e s t are the best-known solution of each individual (personal) and the overall best solution achieved within the entire swarm (global), respectively. The relative influences of the personal and global optimal positions on the movement of individual particles are governed by c 1 and c 2 .
The velocity in the next iteration consists of three parts. The first component serves as the inertial part, driving the agent to continue following the previous direction. The second element is considered the cognitive component, directing the particles toward their individual optimal positions. The third component is considered the social factor, representing the collective effect of globally optimal solutions on individuals searching. This social component attracts individuals toward the swarm’s optimal solution. Afterward, the agent’s position in the next iteration is computed as in (20).
The personal best position p b e s t is determined by evaluating the fitness function for a particle’s position. The fitness function is problem-specific, based on whether the problem is a maximization or minimization problem. For a maximization problem, a higher fitness value indicates a better solution, so the personal best is updated if the new fitness is greater than the current value. In contrast, within the context of minimization problems, a lower fitness value signifies a superior solution. For each iteration, after evaluating the fitness function for all particles, if there exists a position that yields the best-known fitness value among the entire population, that position will be updated as the new global best position g b e s t .
The PSO algorithm’s effective management of exploration and exploitation is a crucial concern. Typically, in the initial search stages, utilizing a substantial inertia weight results in a comprehensive exploration of the search space. Subsequently, by gradually reducing the inertia weight, the algorithm is able to converge toward more ideal solutions in the final stages of the search process. The fundamental aim of this adjustment is to mitigate premature convergence during the initial search phases and facilitate the algorithm’s convergence toward the global optimal solution during the later stages. According to [23], the gradual reduction in inertia weight in each iteration is defined as
w = w m a x w m a x w m i n i t e r m a x i t e r
where w m a x and w m i n represent the initial and final values of the inertia weight, respectively; i t e r is the current iteration number; and i t e r m a x is the maximum number of iterations specified for the algorithm. In this paper, the parameters w m a x and w m i n are set to 0.9 and 0.4, respectively, resulting in a wide exploration of the search space during the initial stages and a quick approach to the swarm’s optimal solution in the later process.
Building upon the general theories of PSO discussed earlier, this optimization algorithm is applied to determine the parameters for the proposed hierarchical sliding mode controller. The control design process reveals that numerous controller parameters require careful selection. Without the assistance of intelligent algorithms like PSO, it would be challenging to choose these parameters optimally based solely on experience. The specific parameters to be optimized using PSO will be detailed later in the article.

3. Application to Rotary Inverted Pendulum

To illustrate the application of the presented theories to a specific system, we utilize a rotary inverted pendulum, as depicted in Figure 2. This system is a classic example of a nonlinear dynamic system characterized by a single input and multiple outputs.
Consider the mathematical model of the RIP [24] and its parameters shown in Table 1, where α is the deviation angle of the pendulum from verticality and θ is the position of the rotary arm:
c 1 θ ¨ + c 2 c o s ( α ) α ¨ + c 2 s i n ( α ) α ˙ 2 + c 5 θ ˙ = c 6 V i n c 2 c o s ( α ) θ ¨ + c 3 α ¨ c 4 s i n ( α ) = 0
in which c 1 = J e q + m r 2 + J m k g 2 η g ; c 2 = m L r ; c 3 = 4 m L 2 3 ; c 4 = m L g ; c 5 = B e q R m + η g k g 2 k m 2 R m ; and c 6 = k m k g η g R m . The state-space expression of the rotary inverted pendulum system is derived as follows:
x 1 . = x 2 x 2 . = F 1 ( x ) + G 1 ( x ) u x 3 . = x 4 x 4 . = F 2 ( x ) + G 2 ( x ) u
with [ x 1 x 2 x 3 x 4 ] = [ α α ˙ θ θ ˙ ] ; F 1 ( x ) = c 1 c 4 s i n ( x 1 ) c 2 c o s ( x 1 ) ( c 2 s i n ( x 1 ) x 2 2 + c 5 x 4 ) c 1 c 3 c 2 2 c o s ( x 1 ) 2 ; G 1 ( x ) = c 6 c 2 c o s ( x 1 ) c 1 c 3 c 2 2 c o s ( x 1 ) 2 ; F 2 ( x ) = c 3 F 1 ( x ) c 4 s i n ( x 1 ) c 2 c o s ( x 1 ) ; G 2 ( x ) = c 6 c 3 c 1 c 3 c 2 2 c o s ( x 1 ) 2 .
The sliding surfaces of these two subsystems can be defined as
s 1 = x 2 + λ 1 x 1 s 2 = x 4 + λ 2 x 3
From (4) and (24), the equivalent control signals can be calculated as follows:
u e q 1 = λ 1 x 2 + F 1 G 1 u e q 2 = λ 2 x 4 + F 2 G 2
With the presence of two subsystems in this RIP model, the hierarchical structure comprises two layers. The sliding surface of the last layer, as well as the sliding surface of the entire system, is given by
S 2 = γ 1 S 1 + s 2
where γ 1 is an arbitrary constant. The hierarchical sliding mode control law for the RIP can be inferred:
u = u e q 1 + u e q 2 + u s w .
By choosing the Lyapunov function
V ( t ) = 1 2 S 2 2
and the reaching law S ˙ 2 = k S 2 η sgn ( S 2 ) , the control signal of the entire system can be determined according to (13) and (27):
u = γ 1 G 1 γ 1 G 1 + G 2 u e q 1 + G 2 γ 1 G 1 + G 2 u e q 2 k S 2 + η sgn ( S 2 ) γ 1 G 1 + G 2 .
The stability of the sliding surfaces S 2 , S 1 , and s 2 has been guaranteed and proven through Theorems 1 and 2. From Equations (24) and (29), it can be observed that the performance of the system is determined by the selection of the parameters λ 1 , λ 2 , γ 1 , k, and η . In this context, the PSO algorithm will be employed to search for the optimal values of these parameters. To evaluate the potential solutions, the design fitness function employed is the integral absolute error (IAE) of the pendulum angle error, expressed as
J = 0 α ( t ) α d ( t ) d t
where α ( t ) is the actual signal of the pendulum angle at time t, α d ( t ) denotes the desired value of the signal, and J represents the final value of the fitness function. The IAE fitness function takes into account both the magnitude and duration of the error in the pendulum angle. It quantifies the cumulative absolute difference between the desired and actual angles over a specific time interval. Through the minimization of the fitness value, the control system’s accuracy and stability can be improved, demonstrating superior performance in control.

4. Simulations Results

4.1. Parameter-Tuning Process

In order to evaluate the performance of the proposed hierarchical sliding mode control approach applied to the rotary inverted pendulum system, extensive simulations were conducted via Matlab Simulink. The simulations aimed to analyze the behavior of the control system under various scenarios and assess its effectiveness in achieving the swing-up and stabilization of the pendulum.
The parameters of the RIP system were selected, as indicated in Table 1. Furthermore, to demonstrate the efficacy of utilizing PSO to choose the parameters of the HSMC controller, a series of iterations were performed, and the results are presented in Table 2. These iterations serve as evidence of the effectiveness of PSO in optimizing the cost function via tuning the controller’s parameters, contributing to improved control system performance and stability.
The angle and angular velocity of the pendulum for each parameter set specified in Table 2 are visualized in the subsequent figures. In Figure 3a,b, the results of the initial iteration of PSO are presented. During this iteration, the parameters for the controller were randomly selected from the search space. The corresponding performance of the controller can be observed, indicating that with these randomly chosen parameters, the control system failed to swing up the pendulum and stabilize it at the desired position.
In Figure 4a,b, the performance of the 10th iteration is displayed, revealing notable improvements in the angular response and angular velocity of the pendulum. The swing-up maneuver has been successfully accomplished, and the pendulum is observed to be stable. However, a small steady-state error of approximately 3 degrees is still present. Despite this minor deviation, the overall performance of the system has significantly improved compared to earlier iterations, demonstrating the efficiency of PSO in tuning parameters for the HSMC controller.
In the 15th iteration, the issue of steady-state error persisted without complete resolution. Nevertheless, an improvement in swing-up performance can be observed in Figure 5a compared to Figure 4a. The angular velocity depicted in Figure 5b exhibits a significant increase during the swing-up phase and gradually approaches zero as the pendulum stabilizes. This observation suggests that the controller is effectively driving the pendulum toward the desired position and achieving stability, although some steady-state error remains. Continued iterations and fine-tuning of the control parameters may be necessary to further mitigate the steady-state error and optimize the swing-up and stabilization process.
In the 30th iteration, as illustrated in Figure 6a,b, the issues encountered in previous iterations were successfully resolved. Notably, the steady-state error was completely eliminated, and the swing-up and stabilization processes were noticeably faster compared to earlier iterations. The improved angular response resulted in a slightly higher angular velocity, as depicted in Figure 6b. Overall, with the control parameters obtained in the 30th iteration, the HSMC controller exhibited excellent performance in both swing-up and stability control tasks. These results demonstrate the effectiveness of the proposed approach in achieving the precise control and robust stabilization of the RIP system.

4.2. Simulation Cases and Evaluations

To validate the efficacy of the controller using the parameters obtained in the final iteration, a series of simulations were conducted with three scenarios, including changing the initial angle of the pendulum and adding an external disturbance, and the proposed controller was compared with other controllers. In the first scenario, the initial deflection angle of the pendulum was gradually changed from 30 degrees to 180 degrees. The outcomes displayed in Figure 7 and Figure 8 not only confirm the effectiveness of the HSMC controller under varying initial angle conditions but also underscore the significance of the PSO algorithm in parameter selection. By employing PSO during the optimization process, the controller’s parameters were fine-tuned to achieve optimal performance. As a result, the HSMC controller, equipped with the parameter set obtained from the last iteration, demonstrated remarkable performance in swiftly and accurately stabilizing the pendulum, irrespective of the initial angle. The correlation between the initial angle and the corresponding angular velocity showcased the controller’s ability to adapt dynamically, leveraging the chosen parameters to expedite the pendulum’s convergence to the desired position. This robust performance solidifies the effectiveness of the PSO-driven parameter selection approach in enhancing the control system’s overall performance.
To assess the robustness of the controller in the presence of external disturbances, let us consider a scenario where a white noise disturbance is added to the control signal. The characteristics, including the shape and magnitude of the disturbance, are depicted in Figure 9.
The responses of the pendulum angle, under both disturbed and undisturbed conditions, are illustrated in Figure 10. Starting with an initial angle of α = 60 degrees, the proposed controller adeptly brings the pendulum to its equilibrium position even in the presence of a disturbance. A closer examination of the graph’s magnified section reveals minimal oscillations in the pendulum bar. While it is not feasible to entirely eliminate the influence of the disturbance, the pendulum’s oscillation toward the equilibrium position is minimal, measuring only approximately 0.5 degrees. Consequently, the proposed controller demonstrates notable resistance to interference, establishing its viability for practical experimental applications.
The congruence between the HSMC controller and the RIP system is further substantiated through a comparative analysis with other controllers operating under identical conditions. Specifically, two controllers chosen for this comparative study are the LQR controller and the conventional SMC controller, representing the linear and nonlinear controller categories, respectively. In the LQR approach [11], the control signal is computed using the following equation:
u ( t ) = K x ( t )
where K is the control matrix. With the value of the matrix Q = d i a g ( 10 , 1 , 1 , 1 ) and R = 1 , the matrix K is determined:
K = 40.3487 5.8822 1.0000 1.3263
The control signal of the SMC controller is given by [24]
u = β sat V Δ λ s 1 x 2 + F 1 ( x ) sign s 1 λ V λ s 2 x 4 + F 2 ( x ) sign s 2 G 1 ( x ) sign s 1 + λ V G 2 ( x ) sign s 2
in which the controller parameters are selected as follows: β = 3 , λ s 1 = 5 , λ s 2 = 8 , λ V = 0.1 , and Δ = 0.1 . The deflection angle responses of the pendulum bar using different controllers are shown in Figure 11.
Upon comparison with two alternative controllers at the same initial angle of −45 degrees, the proposed controller distinctly exhibits a superior convergence time for the deviation angle. The LQR controller requires approximately 1 s to guide the pendulum to a stable state and over 2 s to completely stabilize it at 0 degrees. In contrast, the SMC controller yields a slightly swifter response, stabilizing the pendulum in about 1 s. Remarkably, the HSMC controller outshines both, accomplishing equilibrium in a mere 0.2 s, signifying a significantly faster convergence. Similar to the SMC controller, negligible steady-state error is observed when the pendulum bar attains a stable position. To validate the supremacy of the proposed controller in the face of disturbances, all three controllers underwent testing while the pendulum bar oscillated due to an external disturbance.
In this case, a white noise disturbance, similar to the one depicted in Figure 9, is introduced into the control signals. The deflection angles of the pendulum bar, as depicted in Figure 12, exhibit noticeable variations compared to the scenario without a disturbance. Specifically, the pendulum angle under the sliding mode controller displays the least fluctuation in the steady region, albeit with a relatively small steady-state error. In contrast, both the LQR and HSMC controllers exhibit slightly larger fluctuations in their responses. Notably, only the proposed controller manages to maintain the pendulum at around the 0-degree position, whereas the other two controllers still exhibit steady-state errors. The remarkable characteristic of the HSMC controller, its swift settling time, persists in this context. However, for a more nuanced evaluation of the responsiveness in the presence of a disturbance, the integral absolute error (IAE) for the aforementioned three responses is considered.
The computed integral absolute error values in Table 3 corroborate the earlier analysis. The SMC controller exhibits the highest IAE value due to the extended rise time observed in its response. The LQR controller follows with the second-largest error, having an IAE of 5.739, while the proposed controller demonstrates the smallest error, with an IAE of 1.976. This reinforces the conclusion regarding the effectiveness and superiority of the proposed controller.

5. Conclusions and Discussion

In addressing the inherent challenges posed by the RIP system, characterized by underactuation, high nonlinearity, and instability, an optimized hierarchical sliding mode controller was developed. This approach integrates the HSMC controller with the particle swarm optimization algorithm. The HSMC controller is formulated to fulfill the dual objectives of swinging up and stabilizing the pendulum, while PSO is employed to meticulously adjust the parameters of the proposed controller, thereby elevating the overall efficacy of the control system. Through diverse simulation scenarios, the effectiveness and robustness of the proposed controller are substantiated. Comparative analyses with two alternative controllers, namely, LQR and SMC, highlight the superior performance of the proposed approach under varying conditions, encompassing scenarios with and without disturbances. While the results are promising in many instances, the theoretical foundation requires further refinement to better adapt to practical conditions. Utilizing observers, as demonstrated in reference [25], can aid in detecting disturbances and enhance the control design to mitigate these disturbances. Prospective research endeavors will be centered around implementing the proposed controller within an experimental model and augmenting its disturbance rejection capabilities.

Author Contributions

Conceptualization, D.-B.P. and T.-V.-A.N.; methodology, D.-B.P.; software, D.-B.P. and Q.-T.D.; validation, D.-B.P., Q.-T.D. and T.-V.-A.N.; data analysis, Q.-T.D.; writing—original draft preparation, D.-B.P. and Q.-T.D.; writing—review and editing, Q.-T.D. and T.-V.-A.N. All authors have read and agreed to the published version of the manuscript.

Funding

This research was funded by Hanoi University of Science and Technology (HUST) under project number T2023-PC-036.

Data Availability Statement

Data is contained within the article.

Conflicts of Interest

The authors declare no conflicts of interest.

Abbreviations

The following abbreviations are used in this manuscript:
HSMCHierarchical sliding mode control
RIPRotary inverted pendulum
PSOParticle swarm optimization
IAEIntegral absolute error

References

  1. de Jesús Rubio, J.; Hernandez, M.A.; Rosas, F.J.; Orozco, E.; Balcazar, R.; Pacheco, J. Genetic high-gain controller to improve the position perturbation attenuation and compact high-gain controller to improve the velocity perturbation attenuation in inverted pendulums. Neural Netw. 2024, 170, 32–45. [Google Scholar] [CrossRef] [PubMed]
  2. Nguyen, T.V.A.; Dong, B.T.; Bui, N.T. Enhancing stability control of inverted pendulum using Takagi-Sugeno fuzzy model with disturbance rejection and input-output constraints. Sci. Rep. 2023, 13, 14412. [Google Scholar] [CrossRef]
  3. Prasad, L.B.; Tyagi, B.; Gupta, H.O. Optimal Control of Nonlinear Inverted Pendulum System Using PID Controller and LQR: Performance Analysis Without and With Disturbance Input. Int. J. Autom. Comput. 2014, 11, 661–670. [Google Scholar] [CrossRef]
  4. Dwivedi, P.; Pandey, S.; Junghare, A.S. Stabilization of unstable equilibrium point of rotary inverted pendulum using fractional controller. J. Frankl. Inst. 2017, 354, 7732–7766. [Google Scholar] [CrossRef]
  5. Saleem, O.; ul Hasan, K.M. Robust stabilisation of rotary inverted pendulum using intelligently optimised nonlinear self-adaptive dual fractional-order PD controllers. Int. J. Syst. Sci. 2019, 50, 1399–1414. [Google Scholar] [CrossRef]
  6. Yiğit, İ. Model free sliding mode stabilizing control of a real rotary inverted pendulum. J. Vib. Control. 2015, 23, 1645–1662. [Google Scholar] [CrossRef]
  7. Nguyen, N.P.; Oh, H.; Kim, Y.; Moon, J.; Yang, J.; Chen, W.H. Fuzzy-Based Super-Twisting Sliding Mode Stabilization Control for Under-Actuated Rotary Inverted Pendulum Systems. IEEE Access 2020, 8, 185079–185092. [Google Scholar] [CrossRef]
  8. Mofid, O.; Alattas, K.A.; Mobayen, S.; Vu, M.T.; Bouteraa, Y. Adaptive finite-time command-filtered backstepping sliding mode control for stabilization of a disturbed rotary-inverted-pendulum with experimental validation. J. Vib. Control. 2022, 29, 1431–1446. [Google Scholar] [CrossRef]
  9. Duong, M.D.; Pham, Q.T.; Vu, T.C.; Bui, N.T.; Dao, Q.T. Adaptive fuzzy sliding mode control of an actuator powered by two opposing pneumatic artificial muscles. Sci. Rep. 2023, 13, 8242. [Google Scholar] [CrossRef]
  10. García-Chávez, R.E.; Silva-Ortigoza, R.; Hernández-guzmáN, V.M.; Marciano-Melchor, M.; Orta-Quintana, Á.A.; García-Sánchez, J.R.; Taud, H. A Robust Sliding Mode and PI-Based Tracking Control for the MIMO “DC/DC Buck Converter–Inverter–DC Motor” System. IEEE Access 2023, 11, 119396–119408. [Google Scholar] [CrossRef]
  11. Chawla, I.; Singla, A. Real-Time Control of a Rotary Inverted Pendulum using Robust LQR-based ANFIS Controller. Int. J. Nonlinear Sci. Numer. Simul. 2018, 19, 379–389. [Google Scholar] [CrossRef]
  12. Susanto, E.; Wibowo, A.S.; Rachman, E.G. Fuzzy Swing Up Control and Optimal State Feedback Stabilization for Self-Erecting Inverted Pendulum. IEEE Access 2020, 8, 6496–6504. [Google Scholar] [CrossRef]
  13. Qian, D.; Yi, J. Hierarchical Sliding Mode Control for Under-Actuated Cranes; Springer: Berlin/Heidelberg, Germany, 2015. [Google Scholar] [CrossRef]
  14. Pham, D.B.; Lee, S.G. Aggregated Hierarchical Sliding Mode Control for a Spatial Ridable Ballbot. Int. J. Precis. Eng. Manuf. 2018, 19, 1291–1302. [Google Scholar] [CrossRef]
  15. Ouyang, H.; Wang, J.; Zhang, G.; Mei, L.; Deng, X. Novel Adaptive Hierarchical Sliding Mode Control for Trajectory Tracking and Load Sway Rejection in Double-Pendulum Overhead Cranes. IEEE Access 2019, 7, 10353–10361. [Google Scholar] [CrossRef]
  16. Moghanni-Bavil-Olyaei, M.R.; Keighobadi, J.; Ghanbari, A.; Zekiy, A.O. Passivity-based hierarchical sliding mode control/observer of underactuated mechanical systems. J. Vib. Control. 2022, 29, 107754632210910. [Google Scholar] [CrossRef]
  17. Bevrani, H.; Habibi, F.; Babahajyani, P.; Watanabe, M.; Mitani, Y. Intelligent Frequency Control in an AC Microgrid: Online PSO-Based Fuzzy Tuning Approach. IEEE Trans. Smart Grid 2012, 3, 1935–1944. [Google Scholar] [CrossRef]
  18. Liu, Y.; Jiang, D.; Yun, J.; Sun, Y.; Li, C.; Jiang, G.; Kong, J.; Tao, B.; Fang, Z. Self-Tuning Control of Manipulator Positioning Based on Fuzzy PID and PSO Algorithm. Front. Bioeng. Biotechnol. 2022, 9, 817723. [Google Scholar] [CrossRef]
  19. Rahayu, E.S.; Ma’arif, A.; Çakan, A. Particle Swarm Optimization (PSO) Tuning of PID Control on DC Motor. Int. J. Robot. Control. Syst. 2022, 2, 435–447. [Google Scholar] [CrossRef]
  20. Chang, W.D. PID control for chaotic synchronization using particle swarm optimization. Chaos Solitons Fractals 2009, 39, 910–917. [Google Scholar] [CrossRef]
  21. Qian, D.; Yi, J.; Zhao, D. Hierarchical sliding mode control for a class of SIMO under-actuated systems. Control. Cybern. 2008, 37, 243–250. [Google Scholar] [CrossRef]
  22. Kennedy, J.; Eberhart, R. Particle swarm optimization. In Proceedings of the ICNN’95—International Conference on Neural Networks, Perth, WA, Australia, 27 November–1 December 1995; Volume 4, pp. 1942–1948. [Google Scholar] [CrossRef]
  23. Shi, Y.; Eberhart, R. A modified particle swarm optimizer. In Proceedings of the 1998 IEEE International Conference on Evolutionary Computation Proceedings. IEEE World Congress on Computational Intelligence (Cat. No.98TH8360), Anchorage, AK, USA, 4–9 May 1998; pp. 69–73. [Google Scholar] [CrossRef]
  24. Nguyen, V.A.; Pham, D.B.; Pham, D.T.; Bui, N.T.; Dao, Q.T. A Hybrid Energy Sliding Mode Controller for the Rotary Inverted Pendulum. In Advances in Engineering Research and Application; Springer International Publishing: Berlin/Heidelberg, Germany, 2022; pp. 34–41. [Google Scholar]
  25. Qiu, J.; Wang, T.; Sun, K.; Rudas, I.J.; Gao, H. Disturbance Observer-Based Adaptive Fuzzy Control for Strict-Feedback Nonlinear Systems With Finite-Time Prescribed Performance. IEEE Trans. Fuzzy Syst. 2022, 30, 1175–1184. [Google Scholar] [CrossRef]
Figure 1. Hierarchical structure of sliding surfaces.
Figure 1. Hierarchical structure of sliding surfaces.
Automation 05 00017 g001
Figure 2. The rotary inverted pendulum.
Figure 2. The rotary inverted pendulum.
Automation 05 00017 g002
Figure 3. The angle and angular velocity of the pendulum in iteration 1. (a) The angle of the pendulum. (b) The angular velocity of the pendulum.
Figure 3. The angle and angular velocity of the pendulum in iteration 1. (a) The angle of the pendulum. (b) The angular velocity of the pendulum.
Automation 05 00017 g003
Figure 4. The angle and angular velocity of the pendulum in iteration 10. (a) The angle of the pendulum. (b) The angular velocity of the pendulum.
Figure 4. The angle and angular velocity of the pendulum in iteration 10. (a) The angle of the pendulum. (b) The angular velocity of the pendulum.
Automation 05 00017 g004
Figure 5. The angle and angular velocity of the pendulum in iteration 15. (a) The angle of the pendulum. (b) The angular velocity of the pendulum.
Figure 5. The angle and angular velocity of the pendulum in iteration 15. (a) The angle of the pendulum. (b) The angular velocity of the pendulum.
Automation 05 00017 g005
Figure 6. The angle and angular velocity of the pendulum in iteration 30. (a) The angle of the pendulum. (b) The angular velocity of the pendulum.
Figure 6. The angle and angular velocity of the pendulum in iteration 30. (a) The angle of the pendulum. (b) The angular velocity of the pendulum.
Automation 05 00017 g006
Figure 7. The angle of the pendulum at different initial angles.
Figure 7. The angle of the pendulum at different initial angles.
Automation 05 00017 g007
Figure 8. The angular velocity of the pendulum at different initial angles.
Figure 8. The angular velocity of the pendulum at different initial angles.
Automation 05 00017 g008
Figure 9. Disturbance.
Figure 9. Disturbance.
Automation 05 00017 g009
Figure 10. The angle of the pendulum with and without a disturbance.
Figure 10. The angle of the pendulum with and without a disturbance.
Automation 05 00017 g010
Figure 11. The angle of the pendulum when comparing controllers.
Figure 11. The angle of the pendulum when comparing controllers.
Automation 05 00017 g011
Figure 12. The pendulum’s angle when comparing controllers in the presence of a disturbance.
Figure 12. The pendulum’s angle when comparing controllers in the presence of a disturbance.
Automation 05 00017 g012
Table 1. The parameters of the RIP.
Table 1. The parameters of the RIP.
ParameterSymbol and Value
Mass of pendulum (kg) m = 0.027
Mass of arm (kg) M = 0.05
Equivalent moment of inertia of pendulum arm and gears ( kgm 2 ) J e q = 2.33 × 10 4
Rotor inertia of DC motor ( kgm 2 ) J m = 1.23 × 10 4
Pendulum rod’s length to center of mass (m) L = 0.153
Length of arm (m) r = 0.08260
Vicious friction coefficient of motor (Nms/rad) B e q = 0.0005
Gravitational acceleration ( m/s 2 ) g = 9.81
Motor armature resistance ( Ω ) R m = 3.3
Gearbox efficiency η g = 0.9
Gearbox ratio k g = 70
Back EMF constant k m = 0.02797
Table 2. The parameters of the controller in different iterations.
Table 2. The parameters of the controller in different iterations.
Iteration λ 1 λ 2 k γ 1 η
1939.980357.669619.8582465.3105990.2627605
10598.800284.2718359.57943.1386940.4041733
15520.802475.5508159.419212.4269040.3585694
30847.964465.8123974.86892.4132610.288982
Table 3. The integral absolute error and settling time of the pendulum angle.
Table 3. The integral absolute error and settling time of the pendulum angle.
Proposed ControllerSMCLQR
IAE = 0 2 α ( t ) d t 1.97610.8405.739
Settling time (s)0.2160.7500.719
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Pham, D.-B.; Dao, Q.-T.; Nguyen, T.-V.-A. Optimized Hierarchical Sliding Mode Control for the Swing-Up and Stabilization of a Rotary Inverted Pendulum. Automation 2024, 5, 282-296. https://doi.org/10.3390/automation5030017

AMA Style

Pham D-B, Dao Q-T, Nguyen T-V-A. Optimized Hierarchical Sliding Mode Control for the Swing-Up and Stabilization of a Rotary Inverted Pendulum. Automation. 2024; 5(3):282-296. https://doi.org/10.3390/automation5030017

Chicago/Turabian Style

Pham, Duc-Binh, Quy-Thinh Dao, and Thi-Van-Anh Nguyen. 2024. "Optimized Hierarchical Sliding Mode Control for the Swing-Up and Stabilization of a Rotary Inverted Pendulum" Automation 5, no. 3: 282-296. https://doi.org/10.3390/automation5030017

Article Metrics

Back to TopTop