Abstract

The stabilization of a Rotary Inverted Pendulum based on Lyapunov stability theorem is investigated in this paper. The key of designing control laws by Lyapunov control method is the construction of Lyapunov function. A logarithmic function is constructed as the Lyapunov function and is compared with the usual quadratic function theoretically. The comparative results show that the constructed logarithmic function has higher numerical accuracy and faster convergence speed than the usual quadratic function. On this basis, the control law of stabilizing Rotary Inverted Pendulum is designed based on the constructed logarithmic function by Lyapunov control method. The effectiveness of the designed control law is verified by experiments and is compared with LQR controller and the control law designed based on the quadratic function. Moreover, the system robustness is analyzed when the system parameters contain uncertainties under the designed control law.

1. Introduction

The Rotary Inverted Pendulum, which was proposed by Furuta et al. [1], is a well-known test platform to verify the control theories due to its static instability. Rotary Inverted Pendulum has also significant real-life applications, for example, aerospace vehicles control [2, 3] and robotics [46]. Considering the mentioned facts, Rotary Inverted Pendulum is selected as the controlled system and lots of control problems are concerned by researchers, such as stabilizing the pendulum around the unstable vertical position [79], swinging the pendulum from its hanging position to its upright vertical position [1013], and creating oscillations around its unstable vertical position [14, 15].

For the swing-up and stabilizing control of Rotary Inverted Pendulum, a variety of control methods had been applied. Jose et al. [16] and Akhtaruzzaman and Shafie [17] all used proportional-integral-derivative (PID) and linear quadratic regulator (LQR) to balance the pendulum in its upright position, while PD cascade scheme was applied to the switching-up control of the pendulum and fuzzy-PD regulator to the stabilizing control of the pendulum by Oltean [18]. Besides, Hassanzadeh and Mobayen used particle swarm optimization (PSO) method to search and tune the controller parameters of PID in the control of balancing the pendulum in an inverted position [19].

Except these classical control techniques, several advanced control methods are also used to design controllers to stabilize the pendulum in upright vertical position. For example, Chen and Huang proposed an adaptive controller to bring the pendulum close to the upright position regardless of the various uncertainties and disturbances [20]. Hassanzadeh and Mobayen applied evolutionary approaches which include genetic algorithms (GA), PSO, and ant colony optimization (ACO) methods to balance the pendulum in inverted position [21]. Hassanzadeh et al. also proposed an optimum Input-Output Feedback Linearization (IOFL) cascade controller utilized GA to balance the pendulum in an inverted position, in which GA method was used to search and tune the controller parameters [22]. Furthermore, the fuzzy logic control [23], - control [24], and sliding mode control [25] are all used to achieve the same control objective.

On the other hand, the inverted system can be underactuated and nonholonomic systems. Yue et al. used indirect adaptive fuzzy and sliding mode control approaches to achieve simultaneous velocity tracking and tilt angle stabilization for a nonholonomic and underactuated wheeled inverted pendulum vehicle [26]. Different from [26], some researchers focus on the study of the general classes of underactuated and nonholonomic systems. For example, Mobayen proposed a new recursive terminal sliding mode strategy for tracking control of disturbed chained-form nonholonomic systems whose reference targets are allowed to converge to zero in finite time with an exponential rate [27]. Mobayen also proposed a recursive singularity-free, fast terminal sliding mode control method, which is able to avoid the possible singularity during the control phase, which is applied for a finite-time tracking control of a class of nonholonomic systems [28].

Among various control methods, Lyapunov control method is a simple method of designing control laws and can be applied to linear systems and nonlinear systems. Particularly, the analytic expression of designed control laws can be obtained, which help to analyze the control performances and system characteristics. Thus we use Lyapunov control method to achieve stabilizing control of Rotary Invert Pendulum in this paper. The key point of Lyapunov control method is the construction of the Lyapunov function. Aguilar-Ibanez et al. [8] and Türker et al. [9] all selected energy function as Lyapunov function from the quadratic function and used Lyapunov’s direct method to stabilize Rotary Inverted Pendulum. Energy function considered the physical system and was constructed from physical standpoint, which leads to the application of constructed energy function confined to the considered physical system. For different physical systems, the energy functions are different and need to be constructed respectively. Instead of energy function, we construct the Lyapunov function from mathematical standpoint. Based on the quadratic function and Taylor series, a logarithmic function is constructed and as Lyapunov function, which is applicable to not only Rotary Inverted Pendulum but also the physical systems with the linear or nonlinear models. Based on the logarithmic Lyapunov function, the control laws of stabilizing Rotary Inverted Pendulum are designed by Lyapunov method in this paper, that is, balancing the pendulum in its upright position. In order to describe the properties of the constructed logarithmic function, the relationships between the usual quadratic function and the constructed logarithmic function are compared in numerical value and convergence speed. The comparative results show that the logarithmic function has higher numerical accuracy and faster convergence speed, which will be also verified in experiments. Furthermore, the experiment results also show that the designed control law by Lyapunov method in this paper can also achieve swing-up control of Rotary Inverted Pendulum. Based on these results, the system robustness is analyzed when the system parameters contain uncertainties under the designed control law. Thus, the main construction of this paper is to construct a logarithmic function as Lyapunov function and prove that the logarithmic function has higher numerical accuracy and faster convergence speed.

The remaining of this paper is organized as follows. Section 2 introduces the mathematical model of Rotary Inverted Pendulum and describes the control objective. The construction and analysis of logarithmic Lyapunov function as well as the design of control laws and robustness analyses are shown in Section 3. The experiments in Section 4 are used to verify the effectiveness of the designed control laws and the analyzed conclusions of logarithmic Lyapunov function as well as the system robustness. Lastly, Section 5 concludes the paper.

2. Mathematical Model of Rotary Inverted Pendulum

Rotary Inverted Pendulum is composed of a rotating arm which is driven by a motor and a pendulum mounted on arm’s rim, whose structure is shown in Figure 1. The pendulum moves as an inverted pendulum in a plane perpendicular to the rotating arm. and are employed as the generalized coordinates to describe the inverted pendulum system. The pendulum moves a given while the arm rotates with an angle of .

By applying Newton method or Lagrange method [29], one can get the nonlinear mathematical model of Rotary Inverted Pendulum [24, 30]:where is voltage and is torque and given asThe parameters in (1) and (2) are described in Table 1, which is the same as [24].

This paper considers the problem of stabilizing Rotary Inverted Pendulum; thus and are all relatively small in most of the control time. For small and , and . Placing the approximate expressions into (1) and solving (1), the state space model of Rotary Inverted Pendulum can be written aswhere and is input voltage , while with

Obviously, vertically upward position () and vertically downward position () of pendulum are all equilibrium position for an arbitrary fixed ; that is, system (3) has more than one equilibrium state. In order to solve this problem, the states feedback technique, whose block diagram is shown in Figure 2, is used to make system (3) only have one equilibrium state (). If the feedback control is noted as , then (3) becomeswhere is the gain vector of state feedback and .

In the rest of this paper, we focus on the system model (6) instead of (3). The aim of this paper is to design feedback control by Lyapunov control method so that Rotary Inverted Pendulum can be stabilized at the equilibrium position and   from arbitrary position. The control law or input voltage can be calculated from easily based on and .

3. Design of Control Laws

For linear control systems, lots of methods can be used to design control laws. In this paper, the control laws of stabilizing Rotary Inverted Pendulum are designed by Lyapunov control method, whose motivations are as follows: (i) the procedure of designing control laws is simple; (ii) the analytic expression of control laws can be obtained; (iii) the control laws designed by Lyapunov method can guarantee the system stability. Based on Lyapunov stability theorem, the control laws can be designed as follows:(1)Construct a function which satisfies the conditions of Lyapunov function; that is, is once continuously differentiable for , and “” holds if and only if which is the equilibrium state.(2)Calculate the first time derivative of , that is, .(3)Design control laws to make and “” holds if and only if .

3.1. Construction of Logarithmic Lyapunov Function

In classical literatures [3133], the quadratic function is usually selected as Lyapunov function; that is,where is a nonnegative matrix.

In order to obtain higher numerical accuracy and faster convergence speed, a logarithmic function from quadratic function and Taylor series is constructed as Lyapunov function; that is,To illustrate is better than , the relationships of numerical value and convergence speed between and are shown as follows:(i) Numerical value: the Taylor series of is from which one can see that is the first item of the Taylor series of , while contains the quadratic term, cubic term, and higher order terms of relative to . Thus, has a higher numerical accuracy than .(ii) Convergence speed: let ; then Construct a function aswhere .If with , then which means is a monotone decreasing function, and thereby, is the constructed logarithmic Lyapunov function, so for through designing control laws. Taking into account (11), one can get that which means for ; namely has faster convergence speed than .

According to the above analysis, has higher numerical accuracy and faster convergence speed than , so the control laws of stabilizing Rotary Inverted Pendulum are designed based on by Lyapunov control method in this paper.

Moreover, the constructed can be used in nonlinear system due to the applicability of Lyapunov control method and can be as performance function in optimal control to obtain better control effect due to the higher numerical accuracy and faster convergence speed. Therefore has a greater range of applications, not limited to Rotary Inverted Pendulum and linear systems.

3.2. Design of Control Laws via Lyapunov Method

In order to design the control laws under the condition of at any time, we need to calculate the first-order time derivative of where and , .

To ensure , the feedback control is designed asPlacing (17) into (16), it is easily got that

Similarly, the first-order time derivative of isand the control law is designed asso that for .

Comparing (17) and (20), the first items of and are the same while the second item of contains parameter and does not contain . In Section 4, whether the control law can stabilize Rotary Inverted Pendulum will be verified by experiments, based on which the control performances of , , and a LQR controller will be compared.

3.3. Robustness Analyses

The actual system is usually affected by the perturbations from environment or other sources, so that the system parameters contain uncertainties. It is reasonable to request that the designed control laws can resist the variation of parameters and the effect of perturbations to the greatest extent, so the controlled systems need stronger robustness under the control laws. In this subsection, we will investigate the system robustness under the designed control law . We focus on the effects of and caused by the perturbations.

If the perturbations make become , that is, , which lead to that becomes , according to (17), the designed control law becomeswhich means the difference between the real control law and the theoretic control law is when the perturbations affect .

If the perturbations make become , which lead to that becomes , according to (17), the designed control law becomeswhich means the difference between the real control law and the theoretic control law is when the perturbations affect .

From (21) and (22), the two items of are all affected when the perturbations affect , while only one item of is affected when the perturbations affect , which means the system robustness is better in the most cases when contains uncertainties. However, it should be noted that the real control law is the same as the theoretic control law when , and the system robustness is best in this case.

4. Experiments

In this section, the values of parameters will be given and the characteristics of Rotary Inverted Pendulum will be analyzed. Then, three experiments are used to investigate the control law :(i)The initial position of Rotary Inverted Pendulum is set to , which verifies that can make the pendulum from vertically downward position to vertically upward position.(ii)The initial position of Rotary Inverted Pendulum is set to ,  , , and LQR controller are used to stabilize Rotary Inverted Pendulum, respectively, and then the control performances of , , and are compared.(iii)In order to investigate the system robustness under the designed control law, let the system parameters contain uncertainties; that is, the elements in or in become and where represents the uncertainties. Then, the control performances with uncertainties are compared with the case without uncertainties.

4.1. System Parameter Settings

The values of the parameters in Table 1 are given in Table 2, which is the same as in [24]. Substituting the values into and in (3), then the eigenvalues of are , which means is singular and system (3) is unstable with more than one equilibrium state due to zero eigenvalue and positive eigenvalues. The rank of the controllability matrix is 4, that is, full rank, which means the system is controllable. By applying state feedback technique, system (3) becomes system (6), which is controllable and stable and has only one equilibrium state.

The key of state feedback is to calculate the gain vector . In this section, the desired closed-loop poles are set to ; then the closed-loop characteristic equation is so Then, the gain vector can be calculated as [34]

4.2. Stability Control for Vertically Downward Initial Position

The initial state of Rotary Inverted Pendulum is set to , and the final state is ; that is, the initial position of pendulum is vertically downward and the final position is vertically upward position. The control law in (17) is used to make the pendulum from vertically downward position to vertically upward position and holds steady in vertically upward position. The parameters of arewhere is calculated by solving the Lyapunov equation . The experiment results are shown in Figure 3, in which Figures 3(a)3(d) are the curves of control law , feedback control , function , and system state , respectively.

The results in Figures 3(a) and 3(b) show that and all tend to zero, while the Lyapunov function in Figure 3(c) is less than which is close to zero. One can see from Figure 3(d) that the system state converges to zero under the designed control, that is, achieving the control task. Integrating all results, the position of pendulum is from vertically downward position to vertically upward position under the control law, which realizes not only stability control but also swing-up control.

4.3. Comparison of , , and in Stability Control

The initial state of Rotary Inverted Pendulum is set to , while the final state is vertically upward position; that is, . In this subsection, the parameters in control laws and are and , respectively, and the parameters in and are all identical with in (26). The LQR controller is designed based on the cost functional [24, 35]where .

The control laws , , and are all used to stabilize Rotary Inverted Pendulum, and the results are shown in Figure 4, in which Figure 4(a) is the curves of system states under ; Figure 4(b) is the curves of system states under and ; Figures 4(c) and 4(d) are the curves of control laws and energies , respectively, while the curves of under the three control laws are given in Figure 4(e).

From Figures 4(a) and 4(b), one can see that , , and can all stabilize Rotary Inverted Pendulum, but the convergence time of system states under is less than that under and . The comparison result of and is consistent with the theoretical analysis in Section 3.1. The results in Figures 4(c) and 4(d) show that the control amplitude and energy consumption of are the maximum in the three control laws. The control amplitudes of and are close while the energy consumption of is even less, which mean can stabilize Rotary Inverted Pendulum faster with less energy. It should be noted that if and in (27) are set as other values, the energy consumption of may be less than that of , but the control amplitude of is more than that of . Considering the control amplitude and energy consumption comprehensively, is the more recommended control law to stabilize Rotary Inverted Pendulum. In other words, the control law has the same and even better control effect than LQR controller. According to the results in [24], the control performance of LQR controller is similar to PID controller and better than infinity controller in the stability control of Rotary Inverted Pendulum. The designed control law has the same comparative result as LQR controller based on the above analyses. In addition, Rojas-Moreno et al. used a FO (Fractional Order) based-LQR controller to stabilize Rotary Inverted Pendulum in [35], from which the FO LQR-based controller has the similar control time and control accuracy to LQR controller but more ability to reject disturbances, which is the advantage of the FO LQR-based controller. Instead of better robustness, the designed control law in this paper can ensure the system stability, which is the property of Lyapunov control method.

In Figure 4(e), the function under converges faster and has higher accuracy than that under , which are also consistent with the results in Figures 4(a) and 4(b) and the analysis in Section 3.1. When the time is less than 5, the convergence speed of under is faster than that under , while the convergence speed of under is faster when the time is more than 5. The accuracy comparison results have the same conclusion. Comparing Figure 4(c) with Figure 3(a), the control amplitude in Figure 3(a) is more than that in Figure 4(c) and the control time in Figure 3(a) is more than that in Figure 4(c), which means swing-up control requests more control amplitude. Simultaneously, comparing Figure 4(a) with Figure 3(d), the curves of system state in Figure 4(a) converge to zero before time 10 while that in Figure 3(d) converges to zero after time 25, which mean the control process containing swing-up control takes more time. In particular, the curve of parameter which is the difference between and is shown in Figure 5, from which one can see that is time-dependent and from to in control process. If , , which means control law has more flexibility than control law .

4.4. Robustness Experiments

If represents the uncertainties, let and with and , where and represent the elements and in matrices and without uncertainties, respectively, while and represent the corresponding elements in and with uncertainties, respectively. Under the setting, the control law is applied to Rotary Inverted Pendulum, and the curves of in different cases are shown in Figure 6, in which Figures 6(a)6(e) show the curves of in the cases of , , , , and with , respectively. The curves of in the case of are similar to that in the case of and do not show in Figure 6.

From Figure 6, the analyses are drawn as follows:(1)Control performances are better in the cases of , , , and with uncertainties than those and with uncertainties, which is consistent with the robustness analyses in Section 3.3.(2)For the case of , when , the control performances are worse than that when , while the convergence speed is faster at first and slower than that when ; when , the control performances are better than that when , while is not monotone convergence.(3)For the case of , the control performances of and the convergence performances of when and are the opposite of that in the case of .(4)For the case of , when , the control performances are better than that when , while the convergence speed is lower at first and then faster than that when ; when , the control performances of are worse than that when , while is not monotone convergence.(5)For the case of , the control performances of and the convergence performances of when and are the opposite of that in the case of

Therefore, when the different system parameters contain uncertainties, the system robustness is also different under the control laws designed by Lyapunov control method. The better system robustness is in the following two cases:(1)The actual is more than the theoretical ; that is, the cases of and contain uncertainties with .(2)The actual is less than the theoretical ; that is, the cases of and contain uncertainties with .These are consistent with intuition and experience. If the analytical results can be considered in designing control laws, the designed control laws are expected to have better control performance.

5. Conclusions

The control law of stabilizing Rotary Inverted Pendulum is designed based on Lyapunov stability theorem. A logarithmic function is constructed as the Lyapunov function, based on which the control law is designed by Lyapunov control method. In particular, the relationships between the constructed logarithmic function and the usual quadratic function in numerical value and convergence speed are analyzed in theory. The results show that the logarithmic function has higher numerical accuracy and faster convergence speed than the quadratic function, which is also verified in experiments. Moreover, the control law designed can also achieve the swing-up control of Rotary Inverted Pendulum. On this basis, the system robustness when different system parameters contain uncertainties is investigated. The further works can be considered as follows: (1) Lyapunov control method is applicable to nonlinear system, so the nonlinear mathematical model of Rotary Inverted Pendulum, which is more accurate to describe system characteristics than linear model, can be considered as the controlled system, and the stabilizing control laws can be designed by Lyapunov method; (2) the constructed logarithmic function in this paper can be used in other control methods, such as the logarithmic function which was selected as the performance function in optimal control; (3) the research results for the general classes of the underactuated and nonholonomic systems, such as [27, 28], are applied to Rotary Inverted Pendulum systems.

Competing Interests

The authors declare that there is no conflict of interests regarding the publication of this paper.

Acknowledgments

This work was supported by 333 Talent Project of North University of China and Natural Science Foundation of North University of China (no. XJJ2016032).