You are on page 1of 6

# Self-Tuning Control for Rotation Type Inverted Pendulum Using Two Kinds of Adaptive Controllers

Koji HAGA ** , Phornsuk RATIROCH-ANANT * , Hiroshi HIRATA ** Masatoshi ANABUKI ** and Shigeto OUCHI **
* Faculty of Engineering, King Mongkut's Institute of Technology, Ladkrabang, THAILAND E-mail: ktphorns@kmitl.ac.th ** School of Information Technology and Electronics, Tokai University, JAPAN E-mail: hirata@keyaki.cc.u-tokai.ac.jp Abstract: This paper presents the self-tuning control method for the rotation type inverted pendulum that the momentum of inertia of the pendulum part changes widely. The control system prepares two kinds of adaptive controllers, and the stabilization of inverted pendulum is achieved by separating the control mode to two stages. The rotational angle of the pendulum is stabilized by VSS (Variable Structure System) adaptive control method to unknown parameter system at the first stage, and whole basic parameters are simultaneously estimated in the parameter estimation system. After the eigenvalue of the inverted pendulum system converge sufficiently, the controller is changed to LQ (Linear Quadratic) control at the second stage. It is verified by the practical experiment that the proposed self-tuning strategy is very useful as one of the on-line tuning method. Key words: inverted pendulum self-tuning control VSS adaptive control recursive estimation eigenvalue

Figure 1 Rotation type inverted pendulum system. difficult problem and important theme in the auto-tuning. This paper presents the self-tuning control method [5][6] for the rotation type inverted pendulum that the momentum of inertia of the pendulum part changes widely [4]. The control system prepares two kinds of adaptive controllers, and the stabilization of inverted pendulum is achieved by separating the control mode to two stages, which are unknown transient stage and known stable stage. The rotational angle of the pendulum is stabilized by VSS adaptive control method to unknown parameter system at the first stage, and whole basic parameters are simultaneously estimated in the parameter estimation system. When the designed controller stabilizes the pendulum’s angle, the controlled system has little information for the estimation of the system parameter. Whole basic parameters of the stabilized system are estimated by RLS (Recursive Least Square) method under the condition that the available disturbance torque [4] is appended to the control signal on limited short interval. Furthermore, the validity of the convergence decision concerning the estimated parameter is verified by calculating the eigenvalue [7][8] of the inverted pendulum system. After the eigenvalue of the inverted pendulum system converge sufficiently, the controller is changed to LQ control at the second stage.

1. Introduction So many papers with respect to the stabilization of the inverted pendulum are reported, because it is typically unstable system and is well used as example to verify many control theories. However, few approaches consider the inverted pendulum as unknown parameter system. Slotine and Li [1] proposed adaptive sliding controller that satisfies the desirable properties to nonlinear system having unknown parameters, and proved the validity of the innovative method to the robot manipulator control. Furthermore, T.-P. Leung , et al. [2] proposed AVSMFC ( Adaptive Variable Structure Model Following Control) to nonlinear robot system with unknown parameter. Yamakita and Furuta [3] proposed a VSS adaptive control method for the inverted pendulum of rotation type, and verified the effectiveness of the nonlinear control scheme through simulation and experiment. They assume that the pendulum is simple rod for the stabilization of the rotating arm. However, there is difficult problem in applying the adaptive sliding control to the inverted pendulum, since the input number is less than the output number. This study considers the controlled object [4] of such parameter change that the pendulum expands and contracts under the stabilization. Furthermore, the on-line estimation for a few information systems of the input and output is the

-1-

the input torque τ1 is given by τ 1 = kτ i .C. l = l1 / 2 . J 2 = I 2 + m2 a2 2 . (8) (9) ⎡J + J 2S22 M (θ ) = ⎢ 1 ⎢ − rlC 2 ⎣ − rlC 2 ⎤ ⎥ . velocities and accelerations. τ = [τ1 0] . a2 [m] 2 Gravity acceleration： g[ m / s ] pendulum system converges sufficiently. m2 [kg ] Momentum of inertia: I1 . The control system then guarantees the global stability. 0 ⎢ ⎥ ⎣ ⎦ (3) 3. the conditions of the sliding mode are satisfied and the rotational angle θ2 of the pendulum converges to zero. it leads to & V (t ) = −(k | s | − sw) ≤ − | s | ( k − | w | ) ≤ 0 .θ&)θ& + G (θ ) + Bθ& + D(θ&) .C. respectively. If the gain k is larger than the absolute value of disturbance w . using the boundary layer thickness δ .θ&)θ& represents the torques arising from centrifugal and Coriolis forces. and two following vector pairs of both Y and a are considered: & & & & & ⎧ T ⎪ Y = θ& − s θ2 θ2 θ1 sgn(θ1 ) 2 ⎨ T ⎪ a = [ H J1b2 / rl kτ − J1 g / l kτ b1 / kτ ⎩ & & & ⎧ Y T = θ& − s θ2 θ2 ⎪ 2 ⎨ T ⎪ a = [H J1b2 / rl kτ − J1 g / l kτ ] . J2 ⎥ ⎦ (2) where J1 = I1 + m1a12 + m2 l 2 . D(θ&) and G (θ ) represent the friction torques acting at rotational joints. ~ ~ & = s ( − k sgn( s ) + w) + a T Γ ( a − Γ −1 Y s) . the controller is changed to LQ control at the second stage. -2- . M (θ ) is the inertia matrix. the following result yields V (t ) = (12) ~ ~ ~ ~ & & & & ~ ˆ V (t ) = sH s + a T Γ a = s ( i − Y T a − Y T a + w) + a T Γ a & ⎡bθ ⎤ & Bθ& = ⎢ 1 1 ⎥ . motor (24V-6. (4) ⎨ && + J θ& − rgθ + b θ = 0 & & ⎪ − rlθ1 2 2 2 2 2 ⎩ Using the motor torque constant kτ and the motor current i . C 2 = cos(θ 2 ) . Let the switching function s as & s = θ 2 + cθ 2 . & − J 2 S 2C2θ1 ⎢ ⎥ ⎣− rgS2 ⎦ ⎣ ⎦ ˆ Using the estimation a . l2 [m] Mass： m1 . In the case of neglecting the Coulomb friction of the pendulum part. I 2 [kgm 2 ] Center of balance： a1. (5) where det M is defined by det M = J1 J 2 − ( rl )2 . (1) & where τ is the motor torques. G(θ ) = ⎢ ⎥ . 2. Equation (4) can be rewritten by & & & & (det M )θ&2 + J1b2θ 2 − J1 rgθ 2 + rlb1θ1 + rld1 sgn(θ1 ) = rlkτ i . S 2 = sin(θ 2 ) . Bθ&. r = m2 a2 . ⎩ l2 θ1 l1 θ2 X Y Figure 2 Schematic drawing of inverted pendulum. C (θ . After the eigenvalue of the inverted (13) Above second term is removed by the adaptation law. Furthermore. respectively. θ& and θ& are the joint angles. (7) where H is H = (det M ) / rlkτ . and θ . (6) then the system (5) is described as follows: & YTa + H s = i + w . motor (100V-250W) and also the link of pendulum is driven to straight by rack and pinion gear connected to small D. undesirable chattering of the switching control law (10) is appropriately prevented. w represents the equivalent disturbance term. Design of control system The control system prepares adaptive controllers of two types. The following candidate of Liapunov function is considered to prove this: 1 ~ ~ [ sH s + a T Γ a ] . The rotational arm is directly driven by D. the terms in (1) can be obtained as follows: [ [ ] ] d1 / kτ ] .Z Link Length： l1 . and the gravitational torques respectively. Dynamic equation of such rotation type inverted pendulum can be written in the following general form & τ = M (θ )θ& + C (θ . (14) Therefore. The rotational angle of the pendulum is stabilized by VSS adaptive control method to unknown parameter system at the first stage. 3.1 Stabilization of pendulum part VSS adaptive stabilization system for only rotational angle of the pendulum is designed to the linear approximation system nearby the origin of equation (1) given by & & & & ⎧ J1θ& − rlθ&2 + b1θ1 + d1 sgn(θ1 ) = τ 1 ⎪ 1 . θ = [θ1 θ 2 ]T and & & &2 ⎡ 0 ⎤ & & ⎡2 J S C θ θ + rlS θ ⎤ C (θ . 2 Differentiating V (t ) . Dynamics of rotation type inverted pendulum The inverted pendulum system used in the experiment and its schematic drawings are shown in Figure 1 and Figure 2.θ )θ = ⎢ 2 2 2 1 2 2 2 2 ⎥ .4W). the control input i and the adaptation law are given by ˆ i = Y T a − k sgn( s ) (10) & ˆ a = −Γ −1Ys (11) where k is positive scalar value and Γ is constant positive definite matrix. D (θ ) = & ⎢b2θ 2 ⎥ ⎣ ⎦ & ⎡ d1 sgn(θ1 )⎤ T ⎢ ⎥ .

ia (k )} for the estimation is obtained by the following various filters [9]. When the identification system has different sensor dynamics. θ&a ( k ). (27) (28) & sgn(θ ) G0 Adaptive gain: G0 G1 G2 θ&a & θ&a G0 v P (k ) = ia e & sgn(θ a ) θa P(k − 1)Φ (k )Φ T (k ) P (k − 1) ⎫ 1 ⎧ ⎪ ⎪ ⎨ P (k − 1) − ⎬ λ (k ) ⎪ λ (k ) + tr[Φ T ( k ) P(k − 1)Φ (k )] ⎪ ⎩ ⎭ − & & ˆ v = Φ T (θ a . G2 = s 2 G0 (20) The operation of these filters is also calculated in discrete form using the bilinear transformation: s= 2 ⎛ z −1 ⎞ ⎜ ⎟ .θ&. we use linear parameterized form described by & & τ = M (θ )θ& + C (θ .θ&)δ . then. where 0 < P −1 (0) . The adaptation algorithm is also equivalent to RLS estimation. Eq.θ a . (25) Output error: e( k ) = 1 λ (k ) + tr[Φ T (k ) P(k − 1)Φ (k )] ε (k ) . θ&a (k ). θ ≅ {θ (k ) − θ (k − 1)} T ⎪ & && ⎩ θ a = G1θ . the convergence of the output error e(k ) is ensured as e(k ) → 0 .(18) because it is useful for the estimation of the basic parameter included the torque constant. (22) (16) & & φ13 = l ( S 2θ 2 2 − C2θ&2 ) . θ a = G0θ ⎪ & & & ⎨ sgn(θ a ) = G0 sgn(θ ) .θ&. -3- . (26) θ Prediction error: ˆ ε (k ) = i (k ) − Φ T (k )σ (k − 1) .2 Stabilization of whole parts The LQ controller of including the estimation system is considered for unknown parameter system. the estimation accuracy generally deteriorates. 1 & & φ 22 = θ&2 − S 2 C 2θ12 .θ . G1 = s G0 . the filter structure shown in Figure 3 is introduced to compensate the difference of the sensor characteristics. (17) In the case with uncertainty in the torque constant.θ&) and the basic parameter δ are given by & & & ⎡θ& φ12 φ13 θ1 0 sgn(θ1 )⎤ 1 & Φ T (θ . σ = δ / kτ = [σ 1 σ 2 σ 3 σ 4 σ 5 σ 6 ]T . The & necessary motion data {θ a (k ). Hence. Linear parameterization Such linear parameterization as equations (8) and (9) is not sufficient for LQ controller design. (18) where the input current i is i = [i 0]T . 0 < λ (k ) ≤ 1 . (21) Recursive estimation system The estimate model is defined as ˆ v(k ) = Φ T (k )σ (k ) . & & i = Φ T (θ .θ&)σ . The recursive estimation is completed in every sampling interval by filling the following motion data & & ∆ a:= {θ a (k ). ia (k )} . T ⎝ z +1 ⎠ T : sampling period . other required motion data like the angular velocities and the angular accelerations are obtained by using the low pass filter including the derivative filter. θ&a (k ). θ a ( k ). ( k → ∞ ). θ a = G2θ (19) G0 = 1 (1 + τ f s ) 3 . (15) where the input torque τ is τ = [τ 1 0] and the regressor & Φ (θ . the estimated basic parameter and the output of the estimate model. [Adaptation theorem] Let η (k ) be the parameter error defined by ˆ η (k ) = σ − σ (k ) . i & & & & & kτ i = M (θ )θ& + C (θ .θ )θ + G (θ ) + Bθ + D (θ ) ˆ where σ ( k ) and v(k ) are. (24) ˆ If the estimated parameter σ ( k ) is adjusted with Parameter adjusting: η (k ) = η (k − 1) − P(k − 1)Φ (k ) e(k ) . The adaptive law of the previous subsection does not give whole basic parameters for LQ controller design. T Hence. Φ (k ) is the regressor of (16).θ&.3. (23) The parameter adaptation theorem that ensured the asymptotic stability of the parameter convergence is given below by the simplified form.θ&)θ& + G (θ ) + Bθ& + D(θ&) = Φ T (θ .θ&a )σ Figure 3 Acquisition of regressor for estimation system. Therefore. ⎧ ia = G0 i . respectively. & 0 ⎥ ⎢ 0 φ22 φ23 0 θ 2 ⎦ ⎣ & & φ12 = S 2 2θ& + 2 S 2 C 2θ&1θ 2 . and δ := [ J 1 J2 & φ23 = −lC2θ& − gS 2 1 r b1 b2 d1 ]T .(15) is changed to Eq. the following recursive estimation system is employed for the control purpose.θ&) := ⎢ ⎥ . Acquisition of regressor Only the motor current and the rotational angles are used as the measurement data of the inverted pendulum.

Table1 and Table2 are the basic parameter of nonlinear model and the condition used in the control simulation. The proposed self-tuning controller effectively stabilizes the inverted pendulum having unknown parameters. Simulation of VSS controller and estimation system The validity of the proposed system is verified through the numerical simulation. ⎣0 0 1 0⎦ det = σ 1σ 2 − l 2 σ 3 .1351 State equation using the basic parameter The basic parameter is obtained by the estimation of the nonlinear system mentioned above. the linear approximation of equation (4) can be rewritten to the state equation form without the disturbance. The eigenvector method based on Hamilton matrix quickly solves Riccati equation of LQ problem. coefficient c in switching function scalar gain k in control input matrix gain Γ = ρ I in adaptive law boundary layer δ in saturation function sampling period T c = 10 k = 3.590e-2 0. (29) Table1: Basic parameters of inverted pendulum model. We use the following sequence λ ( k ) = (1 − µ )λ (k ) + µ .779e-2 5.410e-4 0. -4- .2692 2.The weighting sequence λ (k ) is usually chosen within 0. In order to apply the optimal regulator design. respectively. B. θ a θ&a [A] current sampling time T=1[ms] + τ 1 − k sgn( s) / l Inverted Pendulum i −F LQ regulator Recursive Solution θ& θa Signal Filter θ a T = [θ a1 θ a 2 ] θ T = [θ1 θ 2 ] & ia θ&a ˆ v = Φ Tσ Estimation sample Figure 4 Self-tuning control system for inverted pendulum.504e-3 7. and the estimation system simultaneously ˆ estimates basic parameters σ ( k ) in order to prepare to the second stage.001 4. Only VSS adaptive control is executed to the inverted pendulum having unknown parameters under the condition that the available disturbance torque (the amplitude of 1 volt is bipolar and the period is also 1 second) is appended to the control signal for five seconds from starting. the output and the state variable as u = i . y = [θ1 θ 2 ]T and x = [θ1 θ&1 θ 2 θ&2 ]T . (31) Self-tuning control system Figure 4 shows the self-tuning control system of the inverted pendulum. σ1 σ2 σ3 σ4 σ5 σ6 9. 5 T = 0. sampling time T=1[ms] [rad] angle θ 2 θ&a 2 θ θ&a sample Figure 6 Rotational angle of rotating arm. 1 ⎥ σσ − 1 5 ⎥ det ⎥ ⎦ 0 ⎡ 0 ⎤ ⎢ σ2 ⎥ ⎢ ⎥ B = ⎢ det ⎥ 0 ⎢ lσ ⎥ ⎢ 3⎥ ⎢ det ⎥ ⎣ ⎦ 2 (30) ⎡1 0 0 0⎤ C=⎢ ⎥. the state space expression ∑ S : ( A.0 ρ = 100 δ = 0. ⎤ lσ 3σ 5 ⎥ − ⎥ det ⎥ . Then.98 < λ ( k ) ≤ 1 and µ is the constant for adjusting λ ( k ) . B. Define the input. The feedback gain F is designed by the optimal regulator using the system ∑ S : ( A. C ) obtained in the estimation part. Figure 7 Control input appended the disturbance. respectively. & s = θ 2 + cθ 2 & ˆ a = −Γ −1Y s ˆ YT a / l [rad] angle sampling time T=1[ms] sample Figure 5 Rotational Angle of inverted pendulum. C ) ˆ is described by using the estimated basic parameter σ ( k ) as follows: 1 ⎡0 ⎢ σ 2σ 4 ⎢0 − det A=⎢ 0 ⎢0 ⎢0 − lσ 3σ 4 ⎢ det ⎣ l gσ 3 det 0 gσ 1σ 3 det 0 2 Table2: Condition of simulation for VSS controller. VSS adaptive controller of previous subsection stabilizes the rotational angle of the pendulum at the first stage.

These calculations are repeated in every sampling interval within 1 [msec]. The pendulum never falls down due to the effect of VSS adaptive control. Experiment of self-tuning control The experiment of the proposed strategy is executed by means of same VSS controller condition as previous section. λ1 λ 3 . respectively. Table3 is also the estimation result that shows a good accuracy based on Figure 8.532 29. λ4 λ2 sampling time T=1[ms] sample Figure 9 Transition of eigenvalues of inverted pendulum.584e-2 ˆ σ3 ˆ σ4 ˆ σ5 ˆ σ6 0. They are quickly calculated by means of both algorithms of Householder's method using the elementary Hermitian transformation and QR method using the unitary matrix of Givens. The available disturbance torque for the improvement of the estimation accuracy is appended to the control signal for five seconds from starting same as case of the simulation. f2 sampling time T=1[ms] sample Figure 10 Feedback gain calculated by LQR design. the feedback gain similarly converges.03 in the acquisition of the regressor matrix Φ (k ) . r =1 . the controller is changed to the adaptive LQ controller.792e-3 1.σ 5 sampling time T=1[ms] sample Figure 8 Transition of estimated basic parameter. At first. σ3 It is obvious that the preparation of shifting the controller is sufficient. ˆ σ1 9. Figure 5 and Figure 6 show the rotational angles of the inverted pendulum and the rotating arm. respectively. Figure 13 is the control input that is appending the disturbance. However. Slow fluctuation of the parameter appears to the estimation of the Figure 14 due to the influence of both noise and uncertainty.781e-2 ˆ σ2 5. the appending of the disturbance is continued until passage of 5 seconds for the confirmation of the adaptive system. both eigenvalue and feedback gain rarely fluctuate compared with the parameter transition after passage of 3 seconds.120e-3 0. Figure 15 and Figure 16 show the eigenvalue and the feedback gain.2689 1. Using their basic parameters. Figure 9 and Figure 10 show. Figure 14 shows the estimated basic parameter that is estimated by using nonlinear model (22).000 − 1.1354 sample Figure 11 Rotational Angle of inverted pendulum. f3 f4 f 1. Both angles of pendulum and rotating arm are appropriately stabilized by means of the proposed self-tuning strategy. Hence. though it slightly sways like the limit cycle by the disturbance torque. after passage of 2 seconds from starting. though the simulation does not change the controller to LQ controller. the rotational angle of pendulum is stabilized by VSS adaptive control to unknown parameter system with setting all zeros of adjustable parameter (11). When the eigenvalue of the system converges sufficiently. Finally.Furthermore. The time constant τ f of the various filter uses τ f = 0. respectively. Figure 7 is the control input that appends the disturbance mentioned above for the improvement of the estimation accuracy. Figure 8 shows the estimated basic parameter that is estimated by using nonlinear model (22). Table3: Result of recursive estimation.414 3. Figure 11 and Figure 12 show the rotational angles of the inverted pendulum and the rotating arm.566 ] is designed by the following weight in LQ regulator: Q = diag [1 1 100 1] . Though the controller is changed. respectively. 5. sampling time T=1[ms] [rad] angle σ6 σ2 σ1 σ 4 . it uses vector pair (9) in the control input (10). Table4 is one example of the estimation result that shows slow fluctuation based on Figure 14. Furthermore. one optimal feedback gain F = [ − 1. -5- . the eigenvalue calculated by the estimated basic parameter and the feedback gain designed by LQ regulator.