Adaptive control of rotary inverted pendulum system with time-varying uncertainties

In this paper, an adaptive controller is proposed to balance a rotary inverted pendulum with time-varying uncertainties. The goal of the control is to bring the pendulum close to the upright position regardless of the various uncertainties and disturbances. Its underactuated dynamics is ﬁrst decoupled by Olfati’s transformation into a cascade form, and then an adaptive controller is designed to deal with the uncertainties in the new space. Based on the Lyapunov-like theory, the closed loop stability and boundedness of all internal signals can be proved. The simulation results show that the proposed scheme is capable of giving good performance, as desired.

fall into one of several categories [6]. For example, some considered the problem of stabilizing the pendulum around the unstable vertical position [1,6,25,26,32]. Some swung the pendulum from its hanging position to its upright vertical position [3,9,14,15,31]. Some others tried to create oscillations around its unstable vertical position [2,12,30]. In this paper, we would like to consider the control problem of stabilizing the pendulum around the unstable vertical position when subjected to time-varying uncertainties.
Several robust controllers were proposed for dealing with uncertainties and disturbances in the Furuta system. Yu et al. [34] proposed a robust controller to stabilize the Furuta pendulum under bounded perturbation. Khanesar et al. [22] used a fuzzy sliding controller to drive a rotary inverted pendulum to the vertical position subject to bounded uncertainties and disturbances. Park et al. [29] presented a swing-up and stabilization control with coupled sliding mode control. Some other robust designs can be found in the recent papers by Iraj et al. [21], Muske et al. [24], Ashrafiuon and Whitman [4], and Uchiyama et al. [33]. A common assumption to these robust designs is that the variation bounds of the uncertainties and disturbances have to be available; otherwise, the design is not feasible.
The other approach to deal with system uncertainties is the adaptive control. However, few reports can be found. Matsuda et al. [23] proposed a variable structure system type adaptive controller to stabilize the pendulum at the upright position. Hirata et al. [16]  presented a robust adaptive control for the stabilization problem of the Furuta pendulum. Similar to the traditional adaptive design, the uncertainties in these approaches are assumed to be linearly parameterized as a multiplication of a known regressor matrix and an unknown constant vector. If this regressor form cannot be achieved, the adaptive design fails. In this paper, we consider the case when the system dynamics contains time-varying uncertainties that cannot be represented in the regressor form. Therefore, we may not apply the traditional adaptive design. In addition, let us assume that the variation bounds of these time-varying uncertainties are not available; the conventional robust designs are not feasible either. Here, we would like to design a function approximation technique (FAT) based adaptive controller to cover the time-varying uncertainties [7,8,[17][18][19][20].
The rotary inverted pendulum is well-known to be an underactuated system [7,11] where fewer actuators are used to drive the system than its degree of freedom. To decouple the underactuated dynamics, Olfati's transformation [27,28] is used to transform the system into a special cascade form [7]. Together with the FAT-based adaptive controller, the closed loop stability can be justified with the Lyapunov-like method. Simulation cases are designed to justify the effectiveness of the proposed method. This paper is organized as follows. Section 2 derives the system dynamics and introduces Olfati's transformation. The FAT-based adaptive controller is proposed in Sect. 3. Section 4 presents the simulation results. The last section concludes the paper.

System dynamics and Olfati's transformation
Consider the rotary inverted pendulum shown in Fig. 1 where I 1 is the moment of inertia of the arm, L 1 is the arm length, m 3 is the mass of the pendulum, 3 is the distance to the center of gravity of the pendulum, J 3 is the inertia of the pendulum around its center of gravity, θ 1 is the angular displacement of the arm, θ 3 is the angular displacement of the pendulum, F d is the external force disturbance, and τ is the torque applied to the arm. The system dynamics can be represented by the set of differential equationṡ where θ = [θ 1 θ 2 θ 3 θ 4 ] T is a vector of states, and functions f 1 , f 2 , b 1 , and b 2 are defined as , Suppose f 1 and f 2 are unknown functions without knowing their variation bounds, while b 1 is known. The uncertain function b 2 is assumed to be bounded Since the system is well-known to be underactuated, we would like to apply Olfati's transformation [27,28] to represent the system in a special cascade form so that the underactuated dynamics can be eliminated. By using the coordinate transformation we have the system dynamics in the new space given bẏ where z = [z 1 z 2 z 3 z 4 ] T is the new state vector and It is seen that system (3) is in a special cascade form and d is a mismatched time-varying uncertainty without knowing its variation bound. To deal with the mismatched uncertainty, a backstepping-like design called multiple-surface sliding control is employed with the function approximation technique to give appropriate compensation. To unify the derivation, we would like to represent (3) aṡ where d 1 = 0 and d 2 = d(z).

Controller design
Define y = z 1 as the output signal of system (4) and y d (t) is its desired trajectory. Let us consider the error signals where z id is the desired value forz i . These error signals can be regarded as a set of surfaces in some error space. Let z 1d = y d (t). Then the time derivative of s 1 can be found aṡ To stabilize (6), we may regard z 2d as a virtual control, and it is selected to be z 2d =ẏ d − c 1 s 1 φ 1 where c 1 is a positive constant and φ 1 > 0 is the thickness of the boundary layer for the surface s 1 = 0. With this selection of z 2d , (6) becomeṡ It can be seen that if s 2 is small, then s 1 will also be small. Taking the time derivative of s 2 , we havė To stabilize (8), we may regard z 3d as a virtual control which can be designed as where c 2 and φ 2 are positive constants, andd 2 is an estimate of the mismatched uncertainty d. Hence, (8) can be derived aṡ If s 3 is small and some update law can be designed so that d 2 −d 2 is small, then (10) implies that the magnitude of s 2 is small. To evaluate the dynamics of s 3 , let us take its time derivate aṡ whereż 3d is a function of the uncertainty d 2 , so it is also unknown. To simplify the derivation, let us define d 3 = −ż 3d and we may select z 4d = −d 3 − c 3 s 3 φ 3 to havė Finally, the dynamics of s 4 is found aṡ Define f = f 2 −ż 4d , and we havė We may thus design the control law as wheref is an estimate of f and c 4 > 0 and φ 4 > 0 are constants and u r is a robust term to be designed. Substituting the control law u into (13), we havė At this stage, we have already obtained the dynamics of error surfaces in (7), (10), (12), and (15). Let us collect them to form the error dynamics for the whole system aṡ If a robust term u r can be designed so that the term can be properly covered, and an update law forf can be found such that f → f , then we may have the convergence of s 4 . Likewise, if an update law ford 3 can be derived to satisfyd 3 → d 3 , then (16c) implies the convergence of s 3 . Again, if we may design an update law ford 2 such thatd 2 → d 2 , then (16b) gives s 2 → 0. Finally, with the convergence of s 2 , we may conclude the convergence of s 1 from (16a). To design these update laws, we would like to apply the function approximation technique [8,[17][18][19][20]. Define d 4 = f andd 4 =f , then we have the representations where z i is a known vector of basis functions, w i and w i are respectively the coefficient vector and its estimate, and ε i is the approximation error. Note that d 1 = 0, and the representation in (17) for d 1 andd 1 is only for convenience in the following derivation. Hence, we may rewrite (16a)-(16d) aṡ wherew i = w i −ŵ i are approximation errors for the coefficient vectors, and η i = c i φ i , i = 1, . . . , 4 are positive constants. Define a Lyapunov-like function where Γ 4 is a positive definite matrix. Taking the time derivative of (19) along the trajectory of (18), we havė Select the update law forŵ 4 aṡ where σ 4 is a positive number. Hence, (20) can be written aṡ By using the inequalities − η 4 s 2 4 + |s 4 ||ε 4 | ≤ − Eq. (22) can be derived aṡ where α 4 is selected as Hence,V 4 < 0 whenever Note that ϕ 4 is a positive constant, and hence we may conclude that (s 4 ,w 4 ) is uniformly ultimately bounded. In addition, given any μ 4 > 0, there exist Along the same line, we can choose the Lyapunov-like functions By taking the time derivatives of these functions along the trajectory of (18), we may have the update laws to be selected aṡ After some rearrangements, the time derivative of V i becomeṡ where α i ≤ min{η i , σ i λ max (Γ i ) }, i = 1, 2, 3. For t 0 ≤ t < T i+1 , we may haveV i < 0 whenever 2 , then after the convergence of V i+1 (i.e., when t ≥ T i+1 ) to ϕ i+1 + μ i+1 , V i is bounded. We have thus proved that (s i ,w i ) is uniformly ultimately bounded. Therefore, we have established the order of convergence from s 4 to s 1 . During the convergence of s i , the boundedness of s j , j = i − 1, . . . , 1 is ensured. Specifically, when t ≥ T 1 , we have Hence the proposed controller ensures that the output error of the rotary inverse pendulum system will be bounded by some constants adjustable by controller parameters. In this work, the performance is achieved subject to mismatched time-varying uncertainties.

Computer simulations
To verify the effectiveness of the proposed design, let us consider the system in Fig. 1 again. The initial condition is assumed to be θ (0) = [1 0 −1 0] T , and we would like to bring the desired state to the origin. The actual values of system parameters [10] are   Figure 3 shows that both the arm and pendulum positions converge to their desired values in 3 seconds regardless of the system uncertainties. With the presence of the external disturbances during 4 to 6 seconds, the pendulum exhibits some deviations in the trajectories. However, the proposed controller is robust enough to keep the  Figure 4 shows that the control law is realizable.

CASE 2. Time-varying parameters
In this case, we consider the case when both values of the pendulum mass and center of gravity are timevarying as m 3 = 0.0538 + 0.04 cos 50t kg,  Figure 5 shows that both the arm and pendulum converge to their desired values in 3 seconds even with the time-varying parameters. The robustness of the controller is still sufficient to regulate the system in a bounded region near the equilibrium point when the external force appears during 4 to 6 seconds. Figure 6 depicts the control effort.

Conclusions
We have proposed an adaptive controller for a rotary inverted pendulum system subject to time-varying uncertainties and external disturbances. We first apply Olfati's transformation to the system dynamics, and then the function approximation technique is utilized to estimate the uncertainties. Based on the Lyapunovlike stability theory, the closed-loop stability is proved to be ultimately uniformly bounded. Experimental results show that the proposed design is able to give proper performance regardless of various uncertainties and disturbances.
Open Access This article is distributed under the terms of the Creative Commons Attribution License which permits any use, distribution, and reproduction in any medium, provided the original author(s) and the source are credited.