1 Introduction

For decades, the control problem of the rotary inverted pendulum system has been regarded as one of the most important practical examples in various control applications, including robotics systems, aerospace systems, and industrial crane systems [1, 2]. Furthermore, the analysis of controlling the rotary inverted pendulum plays a crucial role in Segways systems, marine systems, and vibration removing apparatus [1, 2].

The rotary inverted pendulum control procedure consists of two stages: (i) swinging up the pendulum to the neighborhood of the upright position; and (ii) stabilizing both the pendulum in its upright position and the rotary arm at its zero position. These two stages can be combined together by a certain switching criterion to achieve the overall control objective [1, 2]. The main control challenge is the under-actuated structure, since only the rotary arm is linked to the control input torque of the system. The contribution of this paper is to propose a new class nonlinear hybrid controller (NHC) for the rotary inverted pendulum system, which guarantees the faster swing-up and better stabilization performances, compared with the existing approaches.

Below, we mention several swing-up and stabilization control schemes of the (under-actuated) rotary inverted pendulum that are relevant to our paper.

1.1 Swing-up control

There are three main approaches for swinging-up the pendulum to the upright position: (i) the intelligent controller [3,4,5]; (ii) the nonlinear trajectory following technique [6, 7]; (iii) the energy-based controller [8,9,10,11].

The intelligent control approach focuses on using the fuzzy logic controller (FLC) for swinging-up the inverted pendulum to the small region around the upright position [3,4,5]. Regarding the second category in (ii), the nonlinear trajectory following control method is used for swinging-up the pendulum to the upright unstable position [6, 7]. The idea behind the first and second techniques is that the rotary arm is driven back and forth along the proper trajectory, making the pendulum to get an appropriate speed to approach the upright position region. Although the approaches of (i) and (ii) in [3,4,5,6,7] were demonstrated to work well by simulations and experiments, there is no theoretical guarantee for the stability of the closed-loop system. Besides, to perform a successful swing-up procedure with [3,4,5,6,7], designer’s experience and trial and error method are essential [2, 7].

As for the energy-based control method in (iii), the main idea is to design the control law such that the energy of the pendulum is generated until reaching the upright position. This approach was originally proposed by Åström and Furuta [8]. Based on [8], various applications of energy-based controllers for swinging-up pendulum were obtained in [9,10,11]. By means of the Lyapunov method, the stability of the system during the swing-up stage with the controllers in [8,9,10,11] were shown. However, in [8,9,10,11], the swing-up controller was proposed based on the simplified dynamic model of the rotary inverted pendulum system, in which the arm acceleration is considered as the control input and its relationship with the control torque was ignored. For practical systems, it might not be possible to design the arm acceleration input directly.

1.2 Stabilization control

The stabilization control problem of the rotary inverted pendulum system, although it seems simple, is challenging, since we need to stabilize the fully-actuated and unstable under-actuated state variables simultaneously.

Various kinds of stabilization controllers have been proposed, including linear control approaches [12,13,14,15,16], generic nonlinear control methods [17,18,19], intelligent control frameworks [20,21,22,23,24], adaptive control methods [25,26,27], and sliding mode control (SMC) approaches [4, 28,29,30]. The interested readers are referred to [1, 2] for a comprehensive review of the linear and nonlinear controllers for the rotary inverted pendulum system.

Among the existing stabilization approaches mentioned above, the SMC features an ease of implementation in practice and offers a rapid transient response [31, 32]. We should mention that two main challenging issues, preventing the application of the SMC method to the rotary inverted pendulum system, are how to construct an appropriate sliding surface and prove the stability of the closed-loop system during the sliding phase. In particular, since the system is under-actuated, one has to incorporate multiple state variables, i.e., fully-actuated and under-actuated state variables, into one sliding surface. Hence, unlike fully-actuated systems, different sliding surface and stability proof technique are essentially required to show the stabilizing performance of the SMC approach for the (under-actuated) rotary inverted pendulum system. We note that different kinds of SMC stabilization controllers have been considered for the (under-actuated) rotary inverted pendulum in [4, 28,29,30]. In these SMC approaches, various forms of sliding surfaces were designed in order to achieve the closed-loop system stability during the sliding phase. However, there are two main drawbacks in [4, 28,29,30]:

  1. (a)

    The SMC stabilization approaches in [4, 28,29,30] were related to the traditional SMC. Hence, they suffer from the chattering phenomenon owing to the discontinuous control inputs, which may cause actuator damage and stabilization control performance degradation; and

  2. (b)

    The stability of the closed-loop system in the sliding phase had not been addressed in [4, 28,29,30]. Specifically, there is no theoretical guarantee for the stability of the closed-loop system in the sliding surface. It is worthwhile to point out that proving the stability of under-actuated systems during the sliding phase is challenging, since both the full-actuated and under-actuated state variables have to be stabilized simultaneously.

1.3 Main contributions and comparison

In this paper, we propose a new class nonlinear hybrid controller (NHC) for swinging-up and stabilizing the rotary inverted pendulum. In the proposed NHC, around the upright position, the stabilization controller is applied, and in different circumstances aside from the upright position, the swing-up controller is used. We now state the main contributions of this paper. Then, we provide a detailed comparison of the proposed NHC with the existing control approaches.

1.3.1 Main contributions

  1. (i)

    For the swing-up stage, the proposed swing-up controller is designed by incorporating the feedback linearization and energy control approaches. The swing-up control law is developed based on the non-simplified dynamic model of the rotary inverted pendulum system, in which the relationship between the rotary arm acceleration and control input torque is incorporated. With the swing-up controller in the proposed NHC, we show that the pendulum is able to reach the desired upright position;

  2. (ii)

    For the stabilization stage, our main goal is to address the above-mentioned drawbacks in the existing SMCs stabilization controllers [see (a) and (b) in Sect. 1.2]. We first introduce the new sliding surface, which is designed to resolve the under-actuated problem. The proposed sliding surface is constructed by incorporating the rotary arm and pendulum dynamics into one equation. Subsequently, the stabilization controller is developed by means of the designed sliding surface and the modified super-twisting sliding mode algorithm. We emphasize that the stabilization control signal in the proposed NHC is continuous, which provides the better control performance for the convergence of the angular positions of the rotary arm and pendulum and alleviates the chattering phenomenon. We also provide the detailed analysis to show the finite-time and asymptotic stabilities of the sliding variable and the closed-loop system in reaching and sliding phases, respectively; and

  3. (iii)

    Various experimental results are provided to illustrate the effectiveness of the proposed NHC.

To the best of the authors’ knowledge, (i) and (ii) in our main contributions have not been considered in the existing literature mentioned above. Moreover, the stability proof of (ii) relies on constructing new sliding surface and Lyapunov function, which has not been studied in the existing literature.

Table 1 Characteristics of SMCs, STA, and the proposed stabilization controller

1.3.2 Comparison

  1. (i)

    For the swing-up control problem, our paper can be viewed as an extension of [3,4,5,6,7,8,9,10,11]. Note that our paper is different from [8,9,10,11], since we propose the swing-up controller based on the feedback linearization and energy control methods, in which the relationship between the arm acceleration and the control torque is considered. Besides, compared with [3,4,5,6,7], we can prove theoretically that the pendulum is able to reach the desired upright position with the swing-up controller in the proposed NHC;

  2. (ii)

    For the stabilization control problem, our paper can be viewed as a generalization of [4, 28,29,30]. Specifically, compared with [4, 28,29,30], our paper proves the stability of the closed-loop system in the reaching phase as well as the sliding phase. Besides, we consider the continuous modified super-twisting control law, whereas [4, 28,29,30] used the traditional SMC method, which is discontinuous. We also generalize the results of Moreno and Osorio [33] to the case of under-actuated systems. These generalizations turn out to be not straightforward due to the complicatedness of the modified super-twisting control approach and the under-actuated structure of the rotary inverted pendulum. The features of the proposed stabilization controller and SMCs in [4, 28,29,30, 33] are given in Table 1;

  3. (iii)

    For the experimental results,

    1. (a)

      in case of swing-up control, the faster swing-up times with the same control effort is obtained, compared with the FLC swing-up controller [5];

    2. (b)

      in case of stabilization control,

      • the better control performance for the convergence of the angular positions of the rotary arm and pendulum is attained and the chattering is alleviated, compared with the existing SMC stabilization controllers in [28, 29];

      • the better stabilization control accuracy with the faster convergence time and lower peak overshoot is accomplished, compared with the existing Fuzzy-LQR controller [23]; and

    3. (c)

      with the stabilization controller in the proposed NHC, the robustness of the closed-loop system is guaranteed under the effect of sudden external disturbances.

The rest of paper is organized as follows. In Sect. 2, the nonlinear hybrid controller (NHC) is proposed, and the system stability is analyzed. The experimental results are provided in Sect. 3. Concluding remarks are given in Sect. 4.

2 Design of the proposed NHC

In this section, we propose a new class nonlinear hybrid controller (NHC) for the rotary inverted pendulum. The dynamic model of the rotary inverted pendulum is first described. Then, the swing-up and stabilization controllers are developed. Finally, the NHC is designed by integrating the proposed swing-up and stabilization controllers with the switching criterion. The pendulum angle is used to determine the switching condition.

2.1 Dynamic model of the rotary inverted pendulum

In this paper, we use the Quanser rotary inverted pendulum module. As shown in Fig. 1, the pendulum section is attached at the end of the rotary arm section. The schematic of the rotary inverted pendulum system is displayed in Fig. 2. In the figure, the masses of the rotary arm and pendulum are \(m_r\) and \(m_p\), respectively. The arm and pendulum have total lengths of \(L_r\) and \(L_p\). Let \(J_r\) be the moment of inertia of the rotary arm and \(J_p\) be the moment of inertia of the pendulum about its center of mass. The control torque \(\tau \) is applied to the rotary arm. Besides, the rotary arm and pendulum angles, \(\theta \) and \(\alpha \), increase positively when they rotate counter-clockwise (CCW).

Fig. 1
figure 1

The single inverted pendulum mounted on the SRV02 base unit. Image courtesy of Quanser Inc. [16]

Fig. 2
figure 2

The rotary inverted pendulum conventions [16]

The system has two controlled outputs: the angular position of the arm of \(\theta \) and the angular position of the pendulum of \(\alpha \). The system is under-actuated, since only the rotary arm is subjected to the control input torque of \(\tau \). By means of the Lagrangian formulation, the equations of motion of the rotary inverted pendulum can be derived as follows [16]:

$$\begin{aligned}&\big ( {\overline{J}}_r + \frac{1}{4}m_p L_p^2 \mathrm {sin}^2 (\alpha ) \big ) \ddot{\theta } - \frac{1}{2} m_p L_p L_r \mathrm {cos}(\alpha ) \ddot{\alpha } \nonumber \\&\quad + \frac{1}{2} m_p L_p^2 \mathrm {sin}(\alpha ) \mathrm {cos} (\alpha ) {\dot{\theta }} {\dot{\alpha }} + \frac{1}{2} m_p L_p L_r \mathrm {sin}(\alpha ) {\dot{\alpha }}^2 = \tau \nonumber \\&\big ( J_p + \frac{1}{4} m_p L_p^2 \big ) \ddot{\alpha } - \frac{1}{2} m_p L_p L_r \mathrm {cos}(\alpha ) \ddot{\theta } \nonumber \\&\quad -\, \frac{1}{4} m_p L_p^2 \mathrm {sin}(\alpha ) \mathrm {cos}(\alpha ) {\dot{\theta }}^2 - \frac{1}{2} m_p L_p g \mathrm {sin}(\alpha ) = 0, \end{aligned}$$
(1)

where \({\overline{J}}_r := m_p L_r^2 + J_r\) and the system variables are introduced in Table 2.

2.2 Swing-up controller

In this subsection, we design the swing-up controller in the proposed NHC by means of the feedback linearization and energy control schemes.

First, the dynamics in (1) can be rewritten as

$$\begin{aligned} \ddot{\alpha }&= \frac{1}{J_{\alpha }} \Big [ \frac{1}{2} m_p L_p L_r \mathrm {cos}(\alpha ) \ddot{\theta } \nonumber \\&\quad +\, \frac{1}{4} m_p L_p^2 \mathrm {sin}(\alpha ) \mathrm {cos}(\alpha ) {\dot{\theta }}^2 + \frac{1}{2} m_p L_p g \mathrm {sin}(\alpha ) \Big ] , \end{aligned}$$
(2)

where \(J_{\alpha } := J_p + \frac{1}{4} m_p L_p^2\). Then, let us define

$$\begin{aligned} f_{\theta } ( \alpha ,{\dot{\alpha }},{\dot{\theta }} )&:= \frac{4J_\alpha }{J_{\theta }(\alpha )} \Big [ {\dot{\theta }} \big ( - \frac{1}{2} m_p L_p^2 \mathrm {sin}(\alpha ) \mathrm {cos}(\alpha ) {\dot{\alpha }} \\&\quad +\, \frac{1}{8 J_\alpha } m_p^2 L_p^3 L_r \mathrm {sin}(\alpha )\mathrm {cos}^2(\alpha ) {\dot{\theta }} \big ) \\&\quad - \, \frac{1}{2} m_p L_p L_r \mathrm {sin} (\alpha ) {\dot{\alpha }}^2 \\&\quad +\, \frac{1}{4J_{\alpha }} m_p^2 L_p^2 L_r g \mathrm {sin}(\alpha )\mathrm {cos}(\alpha ) \Big ] \\ g_{\theta }(\alpha )&:= \frac{4J_\alpha }{J_{\theta }(\alpha )} \\ J_{\theta }(\alpha )&:= 4J_\alpha {\overline{J}}_r + J_\alpha m_p L_p^2 \mathrm {sin}^2 (\alpha ) \\&\quad -\, m_p^2 L_p^2 L_r^2 \mathrm {cos}^2\alpha . \end{aligned}$$

Next, by substituting (2) into (1), we have

$$\begin{aligned} \ddot{\theta } = f_{\theta } \big ( \alpha ,{\dot{\alpha }},{\dot{\theta }} \big ) + g_{\theta }(\alpha )\tau . \end{aligned}$$
(3)

Now, by applying the feedback linearization method, we propose the following control lawFootnote 1:

$$\begin{aligned} \tau := \tau _{sw} = \frac{1}{g_{\theta }} \big ( \tau _1 - f_{\theta } \big ), \end{aligned}$$
(4)

where \(g_{\theta }\) and \(f_{\theta }\) are given in (3) and \(\tau _1\) is a new control input. Note that \(g_{\theta }(\alpha ) > 0,\forall \alpha \in [-\pi ,\pi ]~(\mathrm {rad})\) (see Remark 2). From (3) and (4), we have

$$\begin{aligned} \ddot{\theta } = \tau _1. \end{aligned}$$
(5)

For the swing-up control objective, the pendulum is assumed to be the planar pendulum and the friction is neglected (see Remark 3). Under these assumptions, the equation of motion for the pendulum can be obtained as follows [8]:

$$\begin{aligned} J_\alpha \ddot{\alpha }&= \frac{1}{2} m_p L_p L_r \mathrm {cos}(\alpha ) \ddot{\theta } + \frac{1}{2} m_p L_p g \mathrm {sin}(\alpha ), \end{aligned}$$
(6)

where the acceleration of the rotary arm \(\ddot{\theta }=\tau _1\) is considered as the control input.

Table 2 The Quanser rotary inverted pendulum system definitions

The energy of the uncontrolled pendulum is given as follows:

$$\begin{aligned} E = \frac{1}{2}J_{\alpha }{\dot{\alpha }}^2 + \frac{1}{2} m_p g L_p \mathrm {cos}(\alpha ). \end{aligned}$$
(7)

From (5) to (7), the derivative of E can be obtained as

$$\begin{aligned} {\dot{E}} = \frac{1}{2} m_p L_p L_r \mathrm {cos}(\alpha ) {\dot{\alpha }} \tau _1. \end{aligned}$$
(8)

On the other hand, when the pendulum is at the upright position, i.e., \({\dot{\alpha }} = 0\), it has only the potential energy \(E_d\):

$$\begin{aligned} E_d := \frac{1}{2} m_p g L_p. \end{aligned}$$

Then if the criterion is chosen as

$$\begin{aligned} V_p = \frac{1}{2} \big ( E - E_d \big )^2, \end{aligned}$$
(9)

then, the pendulum is at the upright position with \({\dot{\alpha }} = 0\) as long as \(V_p\) keeps \(V_p = 0\).

To achieve \(V_p = 0\), from (8) and (9),

$$\begin{aligned} {\dot{V}}_p&= \frac{1}{2} \big ( E - E_d \big ) m_p L_p L_r \mathrm {cos}(\alpha ) {\dot{\alpha }} \tau _1. \end{aligned}$$
(10)

Now, by selecting

$$\begin{aligned} \tau _1 = - \frac{2}{m_p L_p L_r} K \mathrm {sign} \big ( \big ( E - E_d \big ) {\dot{\alpha }} \mathrm {cos}(\alpha ) \big ), \end{aligned}$$
(11)

(10) can be rewritten as

$$\begin{aligned} {\dot{V}}_p = -K \big | \big ( E - E_d \big ) {\dot{\alpha }} \mathrm {cos}(\alpha ) \big | \le 0, \end{aligned}$$
(12)

where K is a positive constant. Since the pendulum cannot maintain a stationary position with \(\alpha = \pm \pi /2~(\mathrm {rad})\), the control law \(\tau _1\) drives \(V_p\) towards zero. This shows that under (11), \(V_p \rightarrow 0\) as \(t \rightarrow \infty \), which implies that the pendulum is fully swung up to the upright position.

2.3 Stabilization controller

In this subsection, we design the modified super-twisting-based stabilization controller in the proposed NHC. We first introduce the new sliding surface, which is designed to resolve the under-actuated problem. It is worthwhile to emphasize that it is not straightforward to construct a proper sliding surface for the under-actuated system as the rotary inverted pendulum. Besides, to enhance control performance and reduce the chattering phenomenon, the stabilization controller is design by means of the modified continuous super-twisting sliding mode control. We show that with the proposed stabilization controller, both the finite-time convergence of the sliding surface and the asymptotic stability of the closed-loop system are obtained.

2.3.1 Control law design

First, by using (2) and (3),

$$\begin{aligned} \ddot{\alpha } = f_{\alpha } \big ( \alpha ,{\dot{\alpha }},{\dot{\theta }} \big ) + g_{\alpha }(\alpha )\tau , \end{aligned}$$
(13)

where

$$\begin{aligned} f_{\alpha } ( \alpha ,{\dot{\alpha }},{\dot{\theta }} )&:= \frac{1}{J_{\theta }(\alpha )} m_p L_p L_r\mathrm {cos}(\alpha ) \\&\quad \big (- m_p L_p L_r \mathrm {sin}(\alpha ){\dot{\alpha }}^2 \\&\quad -\,m_p L_p^2 \mathrm {sin}(\alpha ) \mathrm {cos}(\alpha ) {\dot{\theta }} {\dot{\alpha }} \big )\\&\quad +\big ( 4{\overline{J}}_r + m_p L_p^2 \mathrm {sin}^2(\alpha ) \big ) \\&\quad \times \, \left[ \frac{1}{4J_{\theta }(\alpha )} m_p L_p^2 \mathrm {sin}(\alpha ) \mathrm {cos}(\alpha ) {\dot{\theta }}^2 \right. \\&\left. \quad +\,\frac{1}{2J_{\theta }(\alpha )} m_p L_p g \mathrm {sin}(\alpha ) \right] \\ g_{\alpha }(\alpha )&:= \frac{2}{J_{\theta }(\alpha )}m_p L_p L_r \mathrm {cos}(\alpha ). \end{aligned}$$

To resolve the under-actuated problem of system (1), we propose a new sliding surface by incorporating the rotary arm and pendulum dynamics into one equation as follows:

$$\begin{aligned} s = k_{\theta } {\dot{\theta }} + k_{\alpha } {\dot{\alpha }} + \lambda _{\theta } \theta + \lambda _{\alpha } \alpha , \end{aligned}$$
(14)

where \(k_{\theta }, k_{\alpha }, \lambda _{\theta },\) and \(\lambda _{\alpha }\) are sliding surface gains. We mention that (14) is different from the existing SMC approaches due to the under-actuated structure (see Remarks 4 and 5).

Then, the modified super-twisting stabilization algorithm in this paper is proposed as follows:

$$\begin{aligned} \tau&:= \tau _{st} = -\frac{1}{k_{\theta } g_{\theta }(\alpha ) + k_{\alpha } g_{\alpha }(\alpha )} \Big [ k_{\theta } f_{\theta } \big ( \alpha ,{\dot{\alpha }},{\dot{\theta }} \big ) \nonumber \\&\quad +\, k_{\alpha } f_{\alpha } \big ( \alpha ,{\dot{\alpha }},{\dot{\theta }} \big ) +\lambda _{\theta } {\dot{\theta }} + \lambda _{\alpha } {\dot{\alpha }} \nonumber \\&\quad +\, k_1 | s |^{1/2}\mathrm {sign}(s) + k_2 s - z \Big ] \nonumber \\ {\dot{z}}&= -k_3 \mathrm {sign}(s) - k_4 s, \end{aligned}$$
(15)

where \(k_i > 0\), \(i=1,\ldots ,4\) is a design constant. We note that the sliding surface gains, \(k_{\theta }\) and \(k_{\alpha }\), are chosen appropriately to guarantee that \(k_{\theta } g_{\theta }(\alpha ) + k_{\alpha } g_{\alpha }(\alpha ) \ne 0\) during the stabilization stage (see Remark 2).

2.3.2 Stability analysis

This subsection provides a completed stability analysis of the stabilization controller in (15) for the rotary inverted pendulum system in (1). We first prove the finite-time convergence of the sliding function s to zero. Subsequently, the closed-loop system asymptotic stability during the sliding phase is achieved through the proper selection of sliding surface gains.

The time derivative of (14) can be obtained as

$$\begin{aligned} {\dot{s}} = k_{\theta }\ddot{\theta } + k_{\alpha }\ddot{\alpha } + \lambda _{\theta } {\dot{\theta }} + \lambda _{\alpha } {\dot{\alpha }}. \end{aligned}$$
(16)

Substituting of (3), (13), and (15) into (16) yields

$$\begin{aligned} {\dot{s}}&= - k_1 \big | s \big |^{1/2}\mathrm {sign}(s) - k_2 s + z \nonumber \\ {\dot{z}}&= -k_3 \mathrm {sign}(s) - k_4 s. \end{aligned}$$
(17)

Theorem 1

Consider the rotary inverted pendulum system (1) with the proposed stabilization controller (15). The convergence to zero of the sliding variable s is established in finite time, then the system states, \(\theta \), \({\dot{\theta }}\), \(\alpha \), and \({\dot{\alpha }}\), converge to zero asymptotically, if the control switching and sliding surface gains satisfy

$$\begin{aligned} k_i&> 0,\quad i=1,\ldots ,4 \\ 4k_3k_4&> (8k_3+9k_1^2)k_2^2, \end{aligned}$$

and

$$\begin{aligned}&\lambda _\theta ,k_\theta < 0,\quad \lambda _\alpha ,k_\alpha> 0 \\&\frac{\lambda _\alpha }{k_\alpha }>\frac{\lambda _\theta }{k_\theta },\quad 2k_\theta J_\alpha + k_\alpha m_p L_p L_r > 0 . \end{aligned}$$

The finite reaching time to the sliding surface can be estimated by

$$\begin{aligned} T = \frac{2}{\vartheta _2}\mathrm {ln} \left( \frac{\vartheta _2}{\vartheta _1}V^{1/2}(s(0),z(0)) + 1 \right) , \end{aligned}$$
(18)

where V(sz) is defined in (19) and \(\vartheta _1\) and \(\vartheta _2\) can be found in (24).

Proof

The proof consists of two parts: (i) we first prove that the convergence to zero of the sliding variable s can be established in finite time, where an explicit finite time is characterized; (ii) we show that the asymptotic stability of the system states, \(\theta \), \({\dot{\theta }}\), \(\alpha \), and \({\dot{\alpha }}\), can be achieved on the designed sliding surface.

In the first part, we prove that the sliding variable s converges to zero in finite time by constructing an appropriate Lyapunov function.

In view of Moreno and Osorio [33], we consider the following Lyapunov candidate function:

$$\begin{aligned} V(s,z)&= 2k_3|s| + k_4s^2 + \frac{1}{2}z^2\nonumber \\&\quad +\,\frac{1}{2}\Big (k_1 | s |^{1/2}\mathrm {sign}(s) + k_2s - z \Big )^2 . \end{aligned}$$
(19)

We define the subspace \( {\mathfrak {s}} := \{ (s,z) \in {\mathbb {R}}^2: s = 0 \} \). Note that V(sz) is continuous everywhere, and continuously differentiable everywhere except on the subspace \({\mathfrak {s}}\). Besides, it can be shown that V(sz) is positive definite and radially unbounded.

We note that any point in the subspace \({\mathfrak {s}}\), before reaching the origin, takes the form (0, z) with \(z \ne 0\). From the first equation of (17), it implies that \({\dot{s}} = z \ne 0\). In other words, the system trajectory (17) cannot stay on the subspace \({\mathfrak {s}}\) before reaching the origin. Hence, \({\dot{V}}(s,z)\) can be obtained in the usual way, except when the trajectory intersects the subspace \({\mathfrak {s}}\). The set of time instants when this happens, before the origin is reached, is of zero measure, as discussed in [34].

Now, differentiating the expression in (19) yields

$$\begin{aligned} {\dot{V}}(s,z)&= \bigg (2k_3 + \frac{k_1^2}{2} \bigg ) \frac{s}{|s|}{\dot{s}} + 2 \bigg ( \frac{k_2^2}{2} + k_4 \bigg ) s{\dot{s}} \nonumber \\&\quad +\, 2 z {\dot{z}} + \frac{3}{2}k_1k_2 \frac{s}{ | s |^{1/2}}{\dot{s}} - k_2({\dot{s}}z + s {\dot{z}}) \nonumber \\&\quad -\,k_1 \bigg ( \frac{z}{2 | s |^{1/2}}{\dot{s}} + \frac{s}{| s|^{1/2}}{\dot{z}} \bigg ). \end{aligned}$$
(20)

Then, by substituting for (17) into (20), we obtain

$$\begin{aligned} {\dot{V}}(s,z)&= -\bigg (k_1k_3 + \frac{k_1^3}{2} \bigg ) | s |^{1/2} - \big ( k_2k_4 + k_2^3 \big ) | s |^{2}\nonumber \\&\quad -\, \bigg (k_4k_1 + \frac{5}{2}k_1k_2^2 \bigg ) | s |^{3/2} + k_1^2 \frac{sz}{|s|} + 2k_2^2sz \nonumber \\&\quad +\, 3k_1k_2\frac{sz}{ | s |^{1/2}} - k_2z^2 - \frac{k_1}{2}\frac{z^2}{ | s |^{1/2}} \nonumber \\&\quad -\, \big ( k_3k_2 + 2k_1^2k_2 \big )|s| . \end{aligned}$$
(21)

Introducing a new vector

$$\begin{aligned} \varvec{\zeta } = \begin{bmatrix} | s |^{1/2} \mathrm {sign} (s)&s&z \end{bmatrix}^\top . \end{aligned}$$

Then from (21),

$$\begin{aligned} {\dot{V}}(s,z) = -\frac{1}{ | s |^{1/2}} \varvec{\zeta }^\top \varvec{\Omega _1} \varvec{\zeta } - \varvec{\zeta }^\top \varvec{\Omega _2} \varvec{\zeta }, \end{aligned}$$
(22)

where

$$\begin{aligned} \varvec{\Omega _1} = \begin{bmatrix} \frac{1}{2}k_1^3 + k_1 k_3 &{} 0 &{} -\frac{1}{2}k_1^2 \\ 0 &{} k_4 k_1 + \frac{5}{2}k_2^2 k_1 &{} -\frac{3}{2}k_1 k_2 \\ -\frac{1}{2}k_1^2 &{} -\frac{3}{2}k_1 k_2 &{} \frac{1}{2}k_1 \end{bmatrix} \end{aligned}$$

and

$$\begin{aligned} \varvec{\Omega _2} = \begin{bmatrix} k_2 k_3 + 2 k_1^2 k_2 &{} 0 &{} 0 \\ 0 &{} k_4 k_2 + k_2^3 &{} -k_2^2 \\ 0 &{} -k_2^2 &{} k_2 \end{bmatrix}. \end{aligned}$$

We can see that \({\dot{V}}(s,z)\) in (22) is negative definite if \(\varvec{\Omega _1} > 0\) and \(\varvec{\Omega _2}>0\) hold simultaneously. This condition can be satisfied if

$$\begin{aligned}&k_i> 0,\quad i=1,\ldots ,4 \\&4k_3k_4 > (8k_3+9k_1^2)k_2^2. \end{aligned}$$

We should note that it is always possible to select \(k_i > 0\), \(i=1,\ldots ,4\) such that the above conditions are satisfied. Hence, from (22), by using Rayleigh’s inequality, we can obtain

$$\begin{aligned} {\dot{V}}(s,z) \le -\frac{1}{ | s |^{1/2}} \lambda _\mathrm {min}\{ \varvec{\Omega _1} \} \big \Vert \zeta \big \Vert _2^2 - \lambda _\mathrm {min}\{ \varvec{\Omega _2} \} \big \Vert \zeta \big \Vert _2^2, \end{aligned}$$
(23)

where \(\big \Vert \varvec{\zeta } \big \Vert _2^2 := |s| + s^2 + z^2\).

Note that the Lyapunov function in (19) can be rewritten as a quadratic form \(V(s,z)=\varvec{\zeta }^\top \varvec{\Pi } \varvec{\zeta }\) with an appropriate symmetric positive definite matrix

$$\begin{aligned} \varvec{\Pi } = \frac{1}{2} \begin{bmatrix} 4k_3 + k_1^2 &{} k_1 k_2 &{} -k_1 \\ k_1 k_2 &{} 2k_4 + k_2^2 &{} -k_2 \\ -k_1 &{} -k_2 &{} 2 \end{bmatrix} \end{aligned}$$

and from Rayleigh’s inequality, we have

$$\begin{aligned} \lambda _\mathrm {min}\{ \varvec{\Pi } \} \big \Vert \varvec{\zeta } \big \Vert _2^2 \le V(s,z) \le \lambda _\mathrm {max}\{ \varvec{\Pi } \} \big \Vert \varvec{\zeta } \big \Vert _2^2. \end{aligned}$$

Therefore, from (23) and the fact

$$\begin{aligned} \big | s \big |^{1/2} \le \big \Vert \varvec{\zeta } \big \Vert _2 \le \frac{V^{1/2} (s,z)}{\lambda _\mathrm {min} ^{1/2}\big \{ \varvec{\Pi } \big \}}, \end{aligned}$$

we can conclude that

$$\begin{aligned} {\dot{V}}(s,z) \le - \vartheta _1 V^{1/2}(s,z) - \vartheta _2 V(s,z), \end{aligned}$$
(24)

where

$$\begin{aligned} \vartheta _1 = \frac{ \lambda _\mathrm {min} ^{1/2}\big \{ \varvec{\Pi } \big \}\lambda _\mathrm {min}\big \{ \varvec{\Omega _1} \big \} }{\lambda _\mathrm {max}\big \{ \varvec{\Pi } \big \}} \end{aligned}$$

and

$$\begin{aligned} \vartheta _2 = \frac{\lambda _\mathrm {min}\big \{ \varvec{\Omega _2} \big \} }{\lambda _\mathrm {max}\big \{ \varvec{\Pi }\big \}}. \end{aligned}$$

Since the solution of the comparison equation

$$\begin{aligned} {\dot{v}} = -\vartheta _1 v^{1/2} - \vartheta _2 v, v(0)=v_0\ge 0 \end{aligned}$$

can be obtained as

$$\begin{aligned} v(t) = \mathrm {exp}(-\vartheta _2t) \left[ v_{0}^{1/2} + \frac{\vartheta _1}{\vartheta _2} \left( 1 - \mathrm {exp}\left( \frac{\vartheta _2}{2}t \right) \right) \right] ^2, \end{aligned}$$

then invoking the comparison lemma [35], it can be verified that V(sz), and therefore, the sliding variable in (14) converge to zero at most after some finite time given in (18).

This completes the proof of finite-time convergence part of the theorem.

In the second part, we show that as the sliding function s converges to zero in finite time, the asymptotic stability of the system states, \(\theta \), \({\dot{\theta }}\), \(\alpha \), and \({\dot{\alpha }}\), can be achieved on the designed sliding surface.

From (14), we can obtain the following expression after some finite time:

$$\begin{aligned} {\dot{\theta }} = -\frac{\lambda _{\theta }}{k_{\theta }} \theta - \frac{\lambda _{\alpha }}{k_{\theta }} \alpha - \frac{k_{\alpha }}{k_{\theta }} {\dot{\alpha }}. \end{aligned}$$
(25)

We note that the dynamic in (25) is well established, since \(k_\theta \) can always be chosen properly, i.e., \(k_\theta \ne 0\) (see Remark 2).

In the sliding phase, the rotary inverted pendulum system dynamics is represented by

$$\begin{aligned}&\ddot{\alpha } = f_\alpha (\theta ,\alpha ,{\dot{\alpha }}) \nonumber \\&\quad -\, \frac{g_\alpha (\alpha )}{k_\theta g_\theta (\alpha ) + k_\alpha g_\alpha (\alpha )} \Big [ k_\theta f_\theta (\theta ,\alpha ,{\dot{\alpha }}) \nonumber \\&\quad +\, k_\alpha f_\alpha (\theta ,\alpha ,{\dot{\alpha }}) \nonumber \\&\quad +\, \lambda _\theta \Big ( -\frac{\lambda _{\theta }}{k_{\theta }} \theta - \frac{\lambda _{\alpha }}{k_{\theta }} \alpha - \frac{k_{\alpha }}{k_{\theta }} {\dot{\alpha }} \Big ) + \lambda _\alpha {\dot{\alpha }} \Big ] \nonumber \\&k_{\theta } {\dot{\theta }} + k_{\alpha } {\dot{\alpha }} + \lambda _{\theta } \theta + \lambda _{\alpha } \alpha = 0, \end{aligned}$$
(26)

where the first equation is obtained by substituting (25) and the control input from (15) into (13) and the second equation is given by letting \(s = 0\).

Now, by introducing,

$$\begin{aligned} x_1 = \theta ,~x_2 = \alpha ,~x_3 = {\dot{\alpha }}, \end{aligned}$$

and

$$\begin{aligned} {\mathbf {x}} = \begin{bmatrix} x_1&x_2&x_3 \end{bmatrix}^\top , \end{aligned}$$

the dynamical system in (26) can be rewritten as

$$\begin{aligned} {\dot{\mathbf {x}}} = {\mathbf {f}}({\mathbf {x}}) = \begin{bmatrix} f_1({\mathbf {x}} ) \\ f_2({\mathbf {x}} ) \\ f_3({\mathbf {x}} ) \end{bmatrix}, \end{aligned}$$
(27)

where

$$\begin{aligned} f_1({\mathbf {x}} )&:= -\frac{\lambda _{\theta }}{k_{\theta }} x_1 - \frac{\lambda _{\alpha }}{k_{\theta }} x_2 - \frac{k_{\alpha }}{k_{\theta }} x_3 \\ f_2({\mathbf {x}} )&:= x_3 \\ f_3({\mathbf {x}} )&:= f_\alpha (x_1,x_2,x_3) - \frac{g_\alpha (x_2)}{k_\theta g_\theta (x_2) + k_\alpha g_\alpha (x_2)} \\&\quad \times \, \Big [ k_\theta f_\theta (x_1,x_2,x_3) + k_\alpha f_\alpha (x_1,x_2,x_3) \\&\quad +\, \lambda _\theta \Big ( -\frac{\lambda _{\theta }}{k_{\theta }} x_1 - \frac{\lambda _{\alpha }}{k_{\theta }} x_2 - \frac{k_{\alpha }}{k_{\theta }} x_3 \Big ) + \lambda _\alpha x_3 \Big ], \end{aligned}$$

where the definition of \(f_\theta (x_1,x_2,x_3)\), \(f_\alpha (x_1,x_2,x_3),\) and \(g_\theta (x_2)\), \(g_\alpha (x_2)\) are given in (28).

$$\begin{aligned} f_\theta (x_1,x_2,x_3)&:= \frac{4J_\alpha }{J_{\theta }(x_2)} \Big [ \Big ( -\frac{\lambda _{\theta }}{k_{\theta }} x_1 - \frac{\lambda _{\alpha }}{k_{\theta }} x_2 \nonumber \\&\quad -\, \frac{k_{\alpha }}{k_{\theta }} x_3 \Big ) \Big ( - \frac{1}{2} m_p L_p^2 \mathrm {sin}(x_2) \mathrm {cos}(x_2) x_3 \Big )\nonumber \\&\quad +\, \Big ( -\frac{\lambda _{\theta }}{k_{\theta }} x_1 - \frac{\lambda _{\alpha }}{k_{\theta }} x_2 - \frac{k_{\alpha }}{k_{\theta }} x_3 \Big )^2 \nonumber \\&\quad \Big ( \frac{1}{8 J_\alpha } m_p^2 L_p^3 L_r \mathrm {sin}(x_2)\mathrm {cos}^2(x_2) \Big )\nonumber \\&\quad -\frac{1}{2} m_p L_p L_r \mathrm {sin} (x_2) x_3^2 \nonumber \\&\quad +\, \frac{1}{4J_{\alpha }} m_p^2 L_p^2 L_r g \mathrm {sin}(x_2)\mathrm {cos}(x_2) \Big ] \nonumber \\ f_\alpha (x_1,x_2,x_3)&:= \frac{1}{J_{\theta }(x_2)} m_p L_p L_r\mathrm {cos}(x_2) \Big [\nonumber \\&\quad -\,m_p L_p^2 \mathrm {sin}(x_2) \mathrm {cos}(x_2) x_3 \Big ( -\frac{\lambda _{\theta }}{k_{\theta }} x_1 - \frac{\lambda _{\alpha }}{k_{\theta }} x_2 \nonumber \\&\quad - \,\frac{k_{\alpha }}{k_{\theta }} x_3 \Big ) -m_p L_p L_r \mathrm {sin}(x_2)x_3^2 \Big ] \nonumber \\&\quad +\,\frac{1}{4J_{\theta }(x_2)} m_p L_p^2 \mathrm {sin}(x_2) \mathrm {cos}(x_2) \Big ( -\frac{\lambda _{\theta }}{k_{\theta }} x_1\nonumber \\&\quad - \frac{\lambda _{\alpha }}{k_{\theta }} x_2 -\, \frac{k_{\alpha }}{k_{\theta }} x_3 \Big )^2 \Big ( 4{\overline{J}}_r + m_p L_p^2 \mathrm {sin}^2(x_2) \Big ) \nonumber \\&\quad +\,\frac{1}{2J_{\theta }(x_2)} m_p L_p g \mathrm {sin}(x_2) \Big ( 4{\overline{J}}_r + m_p L_p^2 \mathrm {sin}^2(x_2) \Big ) \nonumber \\ g_\theta (x_2)&:= \frac{4J_\alpha }{J_{\theta }(x_2)},~g_\alpha (x_2) := \frac{2}{J_{\theta }(x_2)}m_p L_p L_r \mathrm {cos}(x_2),\nonumber \\ J_{\theta }(x_2)&:= 4J_\alpha {\overline{J}}_r + J_\alpha m_p L_p^2 \mathrm {sin}^2 (x_2) \nonumber \\&\quad -\, m_p^2 L_p^2 L_r^2 \mathrm {cos}^2(x_2). \end{aligned}$$
(28)

Now, we are interested in the stability of the dynamical system described in (27). First, as we can observe from (27), the origin is the equilibrium point, i.e., \({\mathbf {x}}_e = 0\). Subsequently, in a small neighborhood of the origin, we can approximate the nonlinear system (27) by its linearization about the origin

$$\begin{aligned} {\dot{\mathbf {x}}} = {\mathbf {A}} {\mathbf {x}}, \end{aligned}$$
(29)

where

$$\begin{aligned} {\mathbf {A}} = \left. \begin{array}{c} \frac{\partial {\mathbf {f}}({\mathbf {x}})}{\partial {\mathbf {x}}} \end{array}\right| _{{\mathbf {x}}={\mathbf {x}}_e} = \left[ \begin{array}{lll} A^{11} &{} A^{12} &{} A^{13} \\ A^{21} &{} A^{22} &{} A^{23} \\ A^{31} &{} A^{32} &{} A^{33} \end{array}\right] \end{aligned}$$

with elements defined by

$$\begin{aligned} A^{11}&:= -\frac{\lambda _\theta }{k_\theta },~A^{12} := -\frac{\lambda _\alpha }{k_\theta },~A^{13} := -\frac{k_\alpha }{k_\theta } \\ A^{21}&:= 0, ~A^{22} := 0,~A^{23} := 1 \\ A^{31}&:= \frac{\lambda ^2_{\theta }}{k_{\theta }} \frac{m_p L_p L_r}{2k_\theta J_\alpha + k_\alpha m_p L_p L_r} \\ A^{32}&:= \frac{1}{k_\theta } \frac{m_p L_p g k_\theta ^2 + m_p L_p L_r \lambda _\theta \lambda _\alpha }{2k_\theta J_\alpha + k_\alpha m_p L_p L_r}\\ A^{33}&:= -\frac{m_p L_p L_r}{2k_\theta J_\alpha + k_\alpha m_p L_p L_r} \Big ( -\frac{\lambda _\theta k_\alpha }{k_\theta } + \lambda _\alpha \Big ). \end{aligned}$$

It can be clearly observed that the origin of (29) is asymptotically stable if the real part for all eigenvalues of \({\mathbf {A}}\) is negative. By letting

$$\begin{aligned} \varvec{\Xi } := \rho {\mathbf {I}} - {\mathbf {A}}, \end{aligned}$$

where \(\rho \) is a complex variable, \({\mathbf {I}} \in \mathrm {R}^{3\times 3}\) is the unit matrix, we have the following:

$$\begin{aligned} \varvec{\Xi } = \begin{bmatrix} \varXi ^{11} &{} \varXi ^{12} &{} \varXi ^{13} \\ \varXi ^{21} &{} \varXi ^{22} &{} \varXi ^{23} \\ \varXi ^{31} &{} \varXi ^{32} &{} \varXi ^{33} \end{bmatrix} \end{aligned}$$

with elements defined by

$$\begin{aligned} \varXi ^{11}&:= \rho + \frac{\lambda _\theta }{k_\theta },~\varXi ^{12} := \frac{\lambda _\alpha }{k_\theta },~\varXi ^{13} := \frac{k_\alpha }{k_\theta } \\ \varXi ^{21}&:= 0,~\varXi ^{22} := \rho ,~\varXi ^{23} := -1 \\ \varXi ^{31}&:= -\frac{\lambda ^2_{\theta }}{k_{\theta }} \frac{m_p L_p L_r}{2k_\theta J_\alpha + k_\alpha m_p L_p L_r} \\ \varXi ^{32}&:= -\frac{1}{k_\theta } \frac{m_p L_p g k_\theta ^2 + m_p L_p L_r \lambda _\theta \lambda _\alpha }{2k_\theta J_\alpha + k_\alpha m_p L_p L_r} \\ \varXi ^{33}&:= \rho + \frac{m_p L_p L_r}{2k_\theta J_\alpha + k_\alpha m_p L_p L_r} \bigg ( -\frac{\lambda _\theta k_\alpha }{k_\theta } + \lambda _\alpha \bigg ). \end{aligned}$$

Subsequently, the characteristic polynomial of the linearized system (29) is given by

$$\begin{aligned}&\rho ^3 + \rho ^2 \bigg [ \frac{\lambda _\theta }{k_\theta } + \frac{m_p L_p L_r}{2k_\theta J_\alpha + k_\alpha m_p L_p L_r} \bigg ( -\frac{\lambda _\theta k_\alpha }{k_\theta } + \lambda _\alpha \bigg ) \bigg ] \nonumber \\&\quad +\, \rho \bigg [ -\frac{m_p L_p g k_\theta }{2k_\theta J_\alpha + k_\alpha m_p L_p L_r} \bigg ] \nonumber \\&\quad +\, \bigg [ -\frac{m_p L_p g \lambda _\theta }{2k_\theta J_\alpha + k_\alpha m_p L_p L_r} \bigg ] = 0. \end{aligned}$$
(30)

From (30), we can check that the real part for all eigenvalues of \({\mathbf {A}}\) is negative, if the sliding surface gains, \(k_\theta ,k_\alpha ,\lambda _\theta ,\) and \(\lambda _\alpha \), fulfil the following circumstances:

$$\begin{aligned}&\lambda _\theta ,k_\theta < 0,\quad \lambda _\alpha , k_\alpha> 0 \nonumber \\&\frac{\lambda _\alpha }{k_\alpha }> \frac{\lambda _\theta }{k_\theta },\quad 2k_\theta J_\alpha + k_\alpha m_p L_p L_r > 0. \end{aligned}$$
(31)

Hence, by choosing the sliding surface gains \(k_\theta ,k_\alpha ,\lambda _\theta ,\) and \(\lambda _\alpha \) satisfied the circumstances in (31) (see Remark 2), the real part for all eigenvalues of \({\mathbf {A}}\) is negative. In other words, the origin of (29) is asymptotically stable, which implies that the angular position of the rotary arm, \(\theta \), and the angular position of the pendulum, \(\alpha \), and its derivative, \({\dot{\alpha }}\), converge to zero asymptotically. From (25), we can observe that \({\dot{\theta }}\) is also driven to zero asymptotically. Hence, it can be concluded that the origin of the nonlinear system given by (27) is asymptotically stable [35, 36].

To conclude the proof, the proposed modified super-twisting stabilization controller in (15) guarantees:

  1. (i)

    the finite-time convergence of the sliding function s to zero;

  2. (ii)

    the asymptotic convergence of the system states \(\theta \), \({\dot{\theta }}\), \(\alpha \), and \({\dot{\alpha }}\) to the origin.

This completes the proof of the theorem. \(\square \)

2.4 Switching criteria of swing-up and stabilization controllers

The swing-up and stabilization control are realized by switching the above two controllers in Sects. 2.2 and 2.3 depending on the pendulum angle. The switching criteria is set as

$$\begin{aligned} \tau = {\left\{ \begin{array}{ll} \tau _{sw} &{} |\alpha | > \alpha _{sw} \\ \tau _{st} &{} \mathrm {otherwise}, \end{array}\right. } \end{aligned}$$
(32)

where \(\alpha _{sw}\) is the switching angle. For the experiment in Sect. 3, we set the switching angle as \(\alpha _{sw} := \pi /15 ~(\mathrm {rad})\) [16].

Then, the proposed nonlinear hybrid controller can be designed by combining the swing-up and stabilization controllers with the switching criterion in (32). The block diagram of the overall control system is shown in Fig. 3.

Fig. 3
figure 3

Block diagram of the proposed nonlinear hybrid controller (NHC)

Before moving to the next section, we present numerous remarks on the proposed control structure.

Remark 1

Regarding the hybrid (switching) mode control, we use the pendulum angle threshold method; see [1, 2, 16] and the references therein. The effectiveness and robustness of the proposed NHC will be verified through various experiments in Sect. 3.

Remark 2

  1. (i)

    From the values of the system parameters [16], it can be easily check that \(J_{\theta }(\alpha ) > 0\), \(\forall \alpha \in [-\pi , \pi ]~(\mathrm {rad})\). Hence, we have

    $$\begin{aligned} g_{\theta }(\alpha ) := \frac{4J_\alpha }{J_{\theta }(\alpha )} > 0,\quad \forall \alpha \in [-\pi , \pi ]~(\mathrm {rad}), \end{aligned}$$

    which results in the effectiveness of the proposed swing-up controller in (4).

  2. (ii)

    The parameters for the sliding function s in (14) may be selected as \(k_\theta = -0.1, \lambda _\theta = -0.1, k_\alpha = 0.2\), and \(\lambda _\alpha = 3.1\). With these surface parameters, the following holds:

    • The circumstances described in (31) are fulfilled;

    • The proposed stabilization controller in (15) is triggered when \(\alpha \in [ -\pi /15, \pi /15]~(\mathrm {rad})\). Hence, by selecting \(k_\theta = -0.1\) and \(k_\alpha = 0.2\), the proposed stabilization controller in (15) is always well defined, since we have

      $$\begin{aligned} k_{\theta } g_{\theta }(\alpha ) + k_{\alpha } g_{\alpha }(\alpha ) \ne 0,~\forall \alpha \in [ -\pi /15, \pi /15]. \end{aligned}$$
  3. (iii)

    With the proposed NHC, less computational effort and fewer sensing information are required. In fact, (a) in the swing-up stage, the proposed swing-up controller consumes a small computational resources owing to its simple structure [8, 37]; (b) in the stabilization stage, the proposed modified super-twisting algorithm does not require the higher-order derivatives of the sliding variable and the system state, which reduces the computational effort and simplifies the control design, as discussed in [32, 38]. Note also that in view of the switching criterion in (32), the swing-up or stabilization controllers is executed only when needed, thus the computation complexity is also reduced.

In the next remarks, we state the main contributions of our work and provide a comprehensive comparison with the existing swing-up and stabilization controllers (see also Sect. 1.3):

Remark 3

For the swing-up stage:

  1. (i)

    As mentioned in Sect. 1.3, the main difference between our proposed swing-up approach and [8] is that the relationship between the arm acceleration of \(\ddot{\theta }\) and the control input torque of \(\tau \) given in (1) is realized by the feedback linearization through (3) and (5). It should be noted that for practical systems, it might not be possible to design the arm acceleration input directly; and

  2. (ii)

    During the swing-up control design in Sect. 2.2, we imposed the planar pendulum and the frictionless motion. We state below that these assumptions are valid for practical pendulum systems.

    • Regarding the planar pendulum, the third term of the left-hand side of the second equation in (1) can be neglected, which is,

      $$\begin{aligned} \frac{1}{4} m_p L_p^2 \mathrm {sin}(\alpha ) \mathrm {cos}(\alpha ) {\dot{\theta }}^2 \simeq 0. \end{aligned}$$

      This assumption is valid, since the pendulum is light enough to be swung up with the small value of \({\dot{\theta }}\) [8, 11, 16, 39,40,41].

    • As for the frictionless motion during the swing-up stage, note that we can choose the appropriate control gain K in (11) such that the energy provided to the pendulum system is much larger than the energy loss of the system by the influence of the friction. This implies that the pendulum can be driven to the neighborhood of the vertical upright position [8, 11, 16, 39,40,41]. Hence, this assumption is also valid.

    Based on the above discussions, we note that the assumptions in Sect. 2.2 are not restrictive. In fact, these assumptions have been used widely for various swing-up control problems of rotary inverted pendulum systems; see [8, 11, 16, 39,40,41] and the references therein. Besides, in the next section, we show that the swing-up controller in the proposed NHC can fully swing the pendulum to the upright position under various experimental scenarios, which also show the validity of the assumptions.

Remark 4

For the stabilization stage:

  1. (i)

    Although extensive SMC methods have been proposed for nonlinear fully-actuated systems (see [33, 42,43,44,45,46,47,48,49] and the references therein), it is not straightforward to apply these approaches for under-actuated systems, in particular for stabilizing the rotary inverted pendulum system (1) in the vertical upright position. For fully-actuated systems, the sliding surface can be constructed by means of different stable linear or nonlinear equations, which includes all the system state variables. Then, as soon as the sliding phase is realized, the system state variables converge to zero asymptotically. Nevertheless, this method is not possible to be applied directly for the stabilization control purpose of the rotary inverted pendulum system in (1). In particular, although the system state variables are driven to the sliding surface in finite time, the system motion is also described by the inherent under-actuated dynamics. To tackle this issue, we construct the new sliding surface in (14) by incorporating the rotary arm and pendulum dynamics into one equation.

  2. (ii)

    We should note that the stability proof for Theorem 1 is different from that of [4, 28,29,30]. Specially,

    • In the reaching phase, the more complex analysis than that of the traditional SMC approaches in [4, 28,29,30] is applied to show the finite-time convergence of the sliding variable to zero. In particular, recall that the standard Lyapunov theorem requires a continuously differentiable Lyapunov function. Note that the Lyapunov function V(sz) in (19) is continuously differentiable everywhere except on the subspace \({\mathfrak {s}} := \{ (s,z) \in {\mathbb {R}}^2: s = 0 \}\), whereas the Lyapunov functions in [4, 28,29,30] are continuously differentiable. This seems that the standard Lyapunov analysis cannot be applied to Theorem 1. To overcome this technical limitation, in the proof of Theorem 1, we show that the system trajectory (17) cannot stay on the subspace \({\mathfrak {s}}\) before reaching the origin. Then, we are able to obtain \({\dot{V}}\), except when the trajectory of system (17) intersects with the subspace \({\mathfrak {s}}\). We should mention that the set of time when the system trajectory (17) intersects with the subspace \({\mathfrak {s}}\), before the origin is reached, is of measure zero, as discussed in [34]. Hence, the standard Lyapunov analysis can be applied to Theorem 1 to show the finite-time convergence of the sliding variable.

    • In the sliding phase, we provide several conditions on the selection of the sliding surface coefficients, which ensure the asymptotic stability of the closed-loop system. As mentioned in Sect. 1.3, there is no theoretical guarantee for the stability of the closed-loop system on the sliding surface with the works [4, 28,29,30].

  3. (iii)

    Besides, we mention that the proposed stabilization controller is continuous by means of the modified super-twisting algorithm while the SMC-based stabilization approaches in [4, 28,29,30] used the traditional SMC method, which is discontinuous.

Hence, Theorem 1 resolves two main drawbacks mentioned in Sect. 1.2 when applying the SMC to the rotary inverted pendulum system in (1).

The following remark first presents a comprehensive comparison between the continuous SMC-based stabilization controller in the proposed NHC with other nonlinear control approaches in [46,47,48,49]. Then, we provide a detailed explanation why we employ the modified continuous super-twisting algorithm for the stabilization stage in the proposed NHC.

Remark 5

For stabilizing the rotary inverted pendulum in the vertical upright position, we have employed the modified continuous super-twisting algorithm, which provides several remarkable features, compared with other nonlinear controllers in the works [46,47,48,49], as below:

  1. (i)

    The proposed modified super-twisting algorithm in the NHC is continuous, whereas the corresponding SMC control law in [46] is discontinuous. From a practical perspective, a discontinuous control signal results in a chattering phenomenon, which may cause potential damage to the actuators and degrade the overall control performance;

  2. (ii)

    The proposed modified continuous super-twisting algorithm in the NHC only requires the measurement of the sliding variable, whereas the continuous SMC approaches in [47, 48] also need the value of the time derivative of the sliding variable. In practice, it might not be possible to obtain the derivative of the sliding variable directly. In the same aspect, the nonlinear controller [49] relies on the complete information of the system state up to the second-order derivative, whereas the proposed controller only needs the knowledge of the system state up to the first-order derivative. Hence, the controllers in [47,48,49] lead to an increased complexity of the control algorithm and require more computational effort; and

  3. (iii)

    The controllers in [46,47,48,49] are designed for the fully-actuated systems while the proposed modified super-twisting algorithm is developed for the case of under-actuated systems. We note that the designed control laws in [46,47,48,49] cannot be applied directly to a class of under-actuated systems such as the rotary inverted pendulum system.

In summary, based the above discussion, we choose to employ the modified continuous super-twisting algorithm in the proposed NHC for stabilizing the rotary inverted pendulum due to the following aspects:

  1. (i)

    The proposed stabilization controller in the NHC generates a continuous control signal, which can reduce a chattering phenomenon and enhance the control performance of the closed-loop system;

  2. (ii)

    The proposed stabilization controller in the NHC reduces the design as well as the computational complexities. It relaxes the requirement on the knowledge about the values of higher-order derivatives of the sliding variable and system state; and

  3. (iii)

    The proposed stabilization controller in the NHC is suitable for a wide range of practical applications, including both the fully-actuated and under-actuated systems.

The following remark provides a procedure how to apply the theoretical results proposed in Sect. 2.3 to other classes of under-actuated systems.

Remark 6

The proposed stabilization controller in Sect. 2.3 can be implemented into several nonlinear under-actuated systems, including container or overhead crane systems, aerospace systems, and ball and beam systems. In particular, the sliding surface for these under-actuated systems can be defined as in (14) such that the fully-actuated and under-actuated variables are combined together into one equation. Then, the proposed control law in (15) can be modified properly based on the dynamics of these systems to ensure the finite-time convergence of the sliding variable to zero in the reaching phase. Next, several conditions for the stability of systems during the sliding phase can be found by following the same procedure as in Theorem 1. We finally note that the overall stability for these closed-loop systems can be analyzed as in Theorem 1.

The following remark introduces several potential research directions for our future work:

Remark 7

  1. (i)

    In this work, the influences of the additive matched and mismatched disturbances on the performance of the closed-loop system have not been explicitly considered. This problem will be studied and tackled in our future work. Interesting methods are introduced in [50,51,52] to address the stabilization control of fully-actuated systems under mismatched disturbances. It should be pointed out that we cannot applied these methods directly for the rotary inverted pendulum system owing the under-actuated nature of the considered system. In other words, a different control design procedure and stability proof technique are essentially required to show the stabilizing performance of the SMC approach for the disturbed rotary inverted pendulum system; and

  2. (ii)

    In this paper, we have not analyzed the effect on the region of attraction. In fact, the region of attraction in the stabilization stage is verified through extensive experimental scenarios. As illustrated in the next section, the stabilization controller is able to stabilize the rotary inverted pendulum in various control situations. It would be interesting to apply the sums-of-squares optimization methods in [53,54,55] to estimate the region of convergence of the origin. In particular, the methods in [53,54,55] provide the ability to search for a certain region of attraction by solving a series of convex optimization problems.

3 Experimental results

The experimental validation has been conducted for the rotary inverted pendulum built by Quanser Inc. [16]. The experiment configuration is shown in Fig. 4. The hardware includes the single inverted pendulum mounted on the Quanser SRV02 based unit, the VoltPAQ—X2 amplifier, and the Q8—USB DAQ control board. The apparatus is also equipped with two optical shaft encoders to measure the angular positions of the rotary arm and pendulum. The QUARC control environment in MATLAB/Simulink is provided by Quanser for real-time implementation. The output voltage range to the load is between \(\pm 5~ (\mathrm {V})\). A diagram of the experimental investigation is displayed in Fig. 5. The starting voltage for the swing-up controller in the proposed NHC was \(-1~(\mathrm {V})\) that was applied for 0.1 (s). Finally, we note that the values of the system parameters can be found in [16].

Fig. 4
figure 4

Experimental configuration

Fig. 5
figure 5

Scheme of experimental investigation

For verification, we conduct four different experiment groups:

  • Group 1: we demonstrate the superiority of the swing-up controller in the proposed NHC by comparing it with the fuzzy logic swing-up controller (FLC) [5];

  • Group 2: we show the superior performance of the stabilization controller in the proposed NHC by comparing it with the decoupled SMC (DSMC) [28] and SMC [29] stabilization methods;

  • Group 3: we illustrate the better stabilization control performance under the proposed NHC with regard to the convergence of the angular positions of the rotary arm and pendulum, compared with the Fuzzy-LQR controller [23]; and

  • Group 4: We evaluate the good robustness of the proposed controller against sudden external disturbances. The external disturbances are added to the pendulum twice, as illustrated from the marked places in Fig. 9. The sudden external disturbance could for instance represents sudden collisions during the operation of the system.

Fig. 6
figure 6

Experimental results—Group 1. The proposed NHC (blue, solid) and FLC (red, dashed)

It is worthwhile to point out that all the experiments appears as a movie at https://drive.google.com/file/d/1UhKIVLicHaclpRv3T7ZtWOj87ozG4s6c/view.

3.1 Group 1

In Group 1, we compare the swing-up control performance of the swing-up controller in the proposed NHC with the FLC in [5].

For the proposed swing-up controller, we note that the control parameter K has been tuned carefully such that the desired swing-up performance is obtained and the experiment system is maintained in the safe conditions. According to that, the value of the parameter K is set as \(K = 0.08\). Besides, the FLC swing-up controller is designed properly as in [5]. In the stabilization stage, we use the proposed stabilization controller in (15).

As illustrated in Fig. 6, both swing-up controllers successfully bring the pendulum within \(\pm ~\pi /15 ~(\mathrm {rad})\) region to trigger the stabilization controller. However, as shown in Table 3, the swing-up time of the proposed NHC takes around \(3~(\mathrm {s})\), which is around four times faster than the FLC. Note that for a fair comparison, the average control efforts for both controllers are the same. This is because, in the FLC control scheme, the arm is driven backward and forward several times until the pendulum approaches the upright position. In contrast, with the proposed NHC, the faster swing-up time can be obtained due to the efficient utilization of the feedback linearization and energy control methods.

Table 3 Performance comparison—Group 1

From the experimental results in Fig. 6 and Table 3, we can conclude that the faster swing-up with the reasonable control effort is obtained by the proposed NHC, compared with the FLC [5].

3.2 Group 2

For Group 2, we compare the stabilization control performance of the stabilization controller in the proposed NHC with the DSMC [28] and SMC [29]. For the proposed stabilization controller, the values of the control parameters are set as \(k_1 = 5.5, k_2 = 0.8, k_3 = 8.0,\) and \(k_4 = 8.0 \) and the sliding surface parameters are selected as in Remark 2. For the DSMC [28], the value of the control switching gain is selected as \(K = 18\), and the sliding surface parameters are chosen as \(c_1 = 10\) and \(c_2 = 0.9\). For the SMC [29], the values of the control parameters are selected as \(K = 3.2\) and \(\lambda _1 = -0.1, \lambda _2 = 0.2, \lambda _3 = -0.1,\lambda _4 = 3.1\). For a fair comparison, the control parameters of all three approaches are selected such that the magnitude of control inputs at the starting point of the stabilization stage is similar and the chattering phenomenon is reduced as small as possible, which enhances the control performance of the closed-loop system and protects the system actuators.

As shown in Fig. 7, all three stabilization controllers can simultaneously stabilize both the fully-actuated and under-actuated state variables. However, it should be pointed out that the proposed NHC displays the better stabilization control performance with regard to the control accuracy and convergence rate characteristics.

Fig. 7
figure 7

Experimental results—Group 2. The proposed NHC (blue, solid), DSMC (black, dashdot), and SMC (red, dashed)

Table 4 Performance comparison—Group 2
Fig. 8
figure 8

Experimental results–Group 3. The proposed NHC (blue, solid) and Fuzzy-LQR (red, dashed)

Table 5 Performance comparison—Group 3
Fig. 9
figure 9

Experimental results–Group 4

Besides, to provide a quantitative measure for the performance of the proposed controller and the comparative methods, the root-mean-square error (RMSE) value for the angular positions of the rotary arm and pendulum in the steady-state phase from \(7 ~(\mathrm {s})\) to \(14 ~(\mathrm {s})\) are considered. We also use the convergence time as the comparison index. In this paper, the convergence time (CT) is the time after which \(|\alpha | \le \pi /60~(\mathrm {rad})\) and \(|\theta | \le \pi /15~(\mathrm {rad}) \) fulfil. Table 4 demonstrates the RMSE of rotary arm and pendulum angles and the CT of all three approaches. It can be clearly observe that the proposed controller has the lowest RMSE with the fastest CT, compared with [28, 29].

The corresponding control inputs for the rotary inverted pendulum under the proposed NHC, DSMC, and SMC are also illustrated in Fig. 7. We can clearly see the existence of the chattering phenomenon with the DSMC and SMC due to the discontinuous control structures, which reduce the control accuracy of the closed-loop system and even may cause damages to the actuator. In contrast, the proposed NHC provides the continuous control input by means of the modified super-twisting algorithm, which enhances the stabilization control performance and reduces the chattering phenomenon.

The experimental results in this subsection show that the better control performance for the convergence of the angular positions of the rotary arm and pendulum is attained and the chattering is alleviated, compared with the existing sliding mode stabilization controllers [28, 29].

3.3 Group 3

In Group 3, we compare the stabilization control performance in terms of the convergence of the angular positions of the rotary arm and pendulum between the proposed NHC and the Fuzzy-LQR [23].

We note that the corresponding gain of the LQR control in [23] is designed based on the linearization model of the rotary inverted pendulum in the upright position. Hence, the control parameters of the Fuzzy-LQR approach are selected properly as in the work [23] to ensure that the stabilization control objective is attained within \(\alpha _{sw} := \pi /15~(\mathrm {rad})\). Besides, for a fair comparison, the control parameters of both methods are chosen such that the magnitude of control inputs at the starting point of the stabilization stage is similar. The control parameters of the proposed NHC are set as in experiment Group 2. We also use the RMSE and CT as the comparative performance indexes as in previous experiment scenario.

As displayed in Fig. 8 and Table 5, the proposed NHC and the Fuzzy-LQR approach can drive the rotary arm to its zero position and stabilize the pendulum in the upright position at the same time. However, we can clearly see that the proposed NHC provides the better control accuracy with the faster convergence time to the desired region. Furthermore, as illustrated in Fig. 8, the proposed NHC produces the smaller peak overshoot in both the rotary arm and pendulum responses. Hence, it can be concluded that the proposed NHC shows the superior stabilization performance, compared with the existing Fuzzy-LQR controller in [23].

3.4 Group 4

In this Group, we evaluate the good robustness of the proposed stabilization controller against sudden external disturbances. The external disturbances are added to the pendulum twice at about \(28~(\mathrm {s})\) and \(42~(\mathrm {s})\), as illustrated from the marked places in Fig. 9. It can be clearly observed that the proposed control scheme behaves swiftly to keep the pendulum in its vertical upright position and drive the arm to the desired position. This indicates that the proposed NHC ensures robustness of the system against external disturbances.

Finally, we note that all the experiment results are available as a movie clip on the website.Footnote 2 The experiment results in the movie clip also show the superiority performance of the proposed NHC, compared with the existing approaches.

4 Conclusions

In this paper, we have proposed a new class nonlinear hybrid controller (NHC) for swinging-up and stabilizing the rotary inverted pendulum. First, a control strategy for swinging-up the pendulum is designed based on the feedback linearization and energy control methods. Then, the stabilization controller is developed based on the new sliding surface and modified continuous super-twisting algorithm. Finally, the NHC is designed by integrating the proposed swing-up and stabilization controllers with the switching criterion. We show that with the NHC: (i) the pendulum is able to reach the desired upright position; and (ii) the closed-loop system achieves the asymptotic stability in the stabilization stage. Various experimental results have been provided to show the effectiveness of the proposed NHC, compared with the existing control approaches.