<<

SICE Journal of Control, Measurement, and System Integration, Vol. 2, No. 1, pp. 050–055, January 2009

Motion Control of Inverted Pendulum Robots Using a Based Disturbance Observer

∗ ∗ Akira SHIMADA and Chaisamorn YONGYAI

Abstract : A high-speed technique for inverted pendulum robots, utilizing instability and a disturbance observer, based on the Kalman filtering technique, is introduced. Inverted pendulums are basically controlled as they do not topple. Shimada and Hatakeyama developed a contrary idea and presented a controller that deliberately off balanced the robot when it moved. To implement the idea, a controller was designed using zero dynamics, which was derived by partial feedback linearization. However, the was not robust or sufficiently reliable. Although they presented a revised method using H∞ control law, it was complex. Shimada et al. also presented a design method for a disturbance observer using Kalman filtering. This paper presents the latest control technique, combining both control laws to solve the problem, and introduces an application with respect to inverted pendulum robots. It further shows experimental results to confirm its validity.

Key Words : inverted pendulum, robot, disturbance observer, Kalman filter, motion control.

1. Introduction ing very fast, but such rapid moves cannot be realized with- This paper introduces a high-speed motion control technique out tilting. This paper discusses only straight motion control, for inverted pendulum robots, based on the concept of instabil- however it introduces a tilt angle control technique for imple- ity and a disturbance observer based on Kalman filtering tech- menting high speed motion. In the future, we expect to see in- niques. It is well known that an inverted pendulum is a self- novative mobile robots being developed using this new control regulated system with a to-and-fro motion similar to the motion technique based on the concept of instability. of a child swinging an umbrella or a stick [1]–[5]. However, The first and second control systems presented by Shimada designing a control system for various pendulums has been a and Hatakeyama, which were based on instability, were not ro- ffi challenge since the 1970s. Later, machines based on the same bust or su ciently reliable [8],[9]. The details are as follows. principles were developed for human riding [6],[7], and many Their first paper [8] presented the basic control scheme based biped walking robot designs are also based on this principle. on the instability which achieved the high-speed straight mo- Those inverted pendulums are automatically controlled, as they tion. However, it needed two control modes-stable and un- do not continuously toppled. stable. Although the unstable control mode implemented the Shimada and Hatakeyama presented a contrary theory [8]– tilt angle control function, it often caused positioning errors. [10], using a controller that deliberately unbalanced a robot in Therefore, the stable control mode, based on a conventional motion. To implement this concept, a controller was designed servo control technique, was used to fix the error problem. The using partial feedback linearization [11],[12], which controls second paper [9] introduced a control scheme based on a 3D only the tilt and orientation angles of the robot. The robot’s mathematical model. This scheme achieved straight motion and position is controlled indirectly, rather than directly, although swerve and pivoting motions as well. However, the positioning the orientation is directly controlled. In machines designed for error problem remained. To solve this problem, a revised con- humans to ride, which are based on the principle of instability, troller, using the H∞ control law, was presented, but its structure the unstable states are acquired from operators, not controllers. was too complex [10]. However, these robots generate unstable states automatically. The authors and their colleague [14] presented a design Applications using the same concept existed [13], but the idea method for a disturbance observer using a Kalman filtering of [8]–[10] was unique, since it was based on the concept of the technique. It is well known that disturbance observer based robots having zero dynamics. The proposed unstable motion is similar to the sprinting of speed skaters or the motion of a rocket when it starts. Fig- ure 1 illustrates the robot motion with a picture of imaginary robots moving independently. While in motion, the robot tilts, swerves, and makes K-turns. Moreover, it seems to be mov-

∗ Department of Electrical System Engineering, Polytechnic Uni- versity, 4–1–1 Hashimotodai, Sagamihara-shi, Kanagawa 229– 1196, Japan E-mail: [email protected] (Received October 21, 2008) (Revised November 25, 2008) Fig. 1 Motion image of inverted pendulum robot.

JCMSI 0001/09/0201–0050 c 2008 SICE SICE JCMSI, Vol. 2, No. 1, January 2009 51

Fig. 2 Exterior view of the robot. Fig. 3 Variables and coordinate frames. control technology can provide high control performance for at z from ΣB. Furthermore, the wheel angles are defined as θw. a variety of mechanical systems. However, we sometimes Normally, the wheel angles should be expressed as θrw and θlw encounter involuntary events, as conventional disturbance ob- respectively, since the robot has two wheels. However, since server based controllers often cause noisy or unstable motion. this paper treats only straight motion. The relation θrw = θlw is One reason is quantization error caused by the low resolution of assumed and the angles are expressed as θw. sensors mounted on the joints of mechanical systems that can The equations of motion of the inverted pendulum robot are inadvertently estimate real disturbance as observation noise. To derived as reconsider the disturbance observer based control technique, 2 J2θ¨w + J3θ¨b cos θb − J3θ˙b sin θb = τs (1) this paper introduces a design method based on a steady state θ¨ θ + θ¨ − / θ = −τ Kalman filter design and applies it to inverted pendulum robots. J3 w cos b J1 b J3g R sin b s (2) The presented control technique is useful for fixing the error = 4 2 + 2 = 2 + + , = where J1 mb( 3 z zb), and J2 R (mb mw) Iw J3 mbzR. problem simply and to make the robot robust against distur- Further, mb, mw refer to the mass of the body and the wheel. It bances. is assumed that z is half of the body height, the width is 2zb, and the radius of the wheels is R. θw is the wheel angle. θb is 2. Inverted Pendulum Robot the tilt angle of the body, and τs is the driving torque. Using the Figure 2 shows the exterior view of an inverted pendulum equation of motion, the nonlinear state equation is derived as ⎡ ⎤ ⎡ ⎤ ⎡ ⎤ robot. It is a wheeled inverted pendulum and consists of a body, θ˙ θ˙ ⎢ w ⎥ ⎢ w ⎥ ⎢ 0 ⎥ a pair of wheels, and a contact terminal to detect the body tilt ⎢ θ˙ ⎥ ⎢ θ˙ ⎥ ⎢ ⎥ ⎢ b ⎥ = ⎢ b ⎥ + ⎢ 0 ⎥ τ angle. The body includes a pair of DC servo motors with rotary ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ s (3) ⎢ θ¨w ⎥ ⎢ f3 ⎥ ⎢ g3 ⎥ encoders and gear boxes. The base block of the contact termi- ⎣ ⎦ ⎣ ⎦ ⎣ ⎦ θ¨ f g nal is set at the center of the body. The robot body has two b 4 4 θ = − 2 2 θ , small arms with free rollers connected at the terminals of the where Det( b) J1 J2 J3 cos b J1 2 J3 cos θb arms. During the initial stages of development, the robot con- f3 = (J3 sin θb · θ˙ ) − (J3g/R · sin θb), Det(θb) b Det(θb) −J3 cos θb 2 J2 troller and power amplifier are set outside the robot for conve- f4 = (J3 sin θb · θ˙ ) + (J3g/R · sin θb), Det(θb) b Det(θb) + θ − θ − nience and are connected to the motors and sensors via electri- J1 J3 cos b J3 cos b J2 g3 = θ , g4 = θ . cal wires. Generally, a two-wheeled pendulum cannot move in Det( b) Det( b) a direction inline with the drive shaft without slipping—a prop- 4. Kalman Filter Based Identity Disturbance Observer erty referred to as velocity constraint. A K-turn motion turns 4.1 Identity Disturbance Observer [15] the robot. This is a typical problem associated with nonlinear Now, using the conventional linearization of Eqs. (1) and (2), control techniques for non-holonomic systems. This robot is the continuous state and output equations are derived as a type of inverted pendulum and does not have an to x˙ = A x˙ + B u − B d (4) regulate the tilt angle of the body directly: therefore, it can be s c s c s s = considered an under-actuated system. the robot has two types of ys Cs xs (5) T T non-linear characteristics: however, this paper deals with only where xs = [θω,θb, θ˙ω, θ˙b] , us = τs, ys = [θω,θb] ,andd straight motion control of the inverted pendulum and does not means equivalent input disturbance. discuss curved motion and K-turn control. ⎡ ⎤ ⎡ ⎤ ⎢ ⎥ ⎢ 0010⎥ ⎢ 0 ⎥ ⎢ ⎥ ⎢ ⎥ 3. Coordinate Frames and Modeling of the Inverted ⎢ 0001⎥ ⎢ 0 ⎥ ⎢ 2 ⎥ ⎢ ⎥ A = ⎢ J g ⎥ , B = ⎢ J1+J3 ⎥ Pendulum Robot s ⎢ − 3 ⎥ s ⎢ ⎥ ⎢ 0 Det·R 00⎥ ⎢ Det ⎥ ⎣⎢ ⎦⎥ ⎣ + ⎦ The coordinate frames used in this paper are illustrated in J2 J3g − J2 J3 0 Det·R 00 Det Fig. 3. ΣF refer to the floor coordinate frame, ΣV is the vehicle Σ 1000 coordinate frame. B is the body coordinate frame, and xv is C = s 0100 the position of ΣV from ΣF . ΣB is located at the origin of ΣV .It θ = θ = − 2. rotates b about the YV axis. The center of mass of the body is Det max(Det( b)) J1 J2 J3 52 SICE JCMSI, Vol. 2, No. 1, January 2009

Fig. 4 A Block diagram of the digital identity disturbance observer.

θ θ θ˙2 θ Is means that sin b,cos b,and b are approximated by b.1, Fig. 5 Encoder output and angle error. and 0, respectively. Next, they are converted to a discrete state equation and out- where E[ω(k)] = 0, E[(k)] = 0, E[ω(k)( j)T ] = 0, T T put equation as E[ω(k)ω( j) ] = Qobδk, j, E[(k)( j) ] = Robδk, j, Qob ≥ 0, Rob > 0. xs(k + 1) = Ad xs(k) + Bdus(k) − Bdd(k)(6) T ys(k) = Cd xs(k)(7)J = E[(x ¯(k) − xˆ¯(k)) (¯x(k) − xˆ¯(k)) (14) H = −A¯ PC¯T (R + C¯ PC¯T )−1 (15) where the dimension of each coefficient matrix Ad, Bd, Cd is the d d ob d d = + ¯ ¯T same as the dimension of the above continuous system. Fur- P Qob Ad PAd − thermore, it is assumed that the disturbance satisfies d˙ = 0m×1 − ¯ ¯T + ¯ ¯T 1 ¯ ¯T Ad PCd (Rob Cd PCd ) Cd PAd (16) and the condition is replaced as d(k + 1) = d(k) ∈ Rm.The characters k, k + 1 in ( )s mean t = kT,(k + 1)T. A Kalman filter is a type of estimator that minimizes the vari- Next, the revised state variable vector xo(k) = ance of the estimation error J, which is expressed as Eq. (14). T T T [xs(k) , d(k) ] is defined, including the disturbance. Thus, In the case of a steady state Kalman filter, the forms of the equa- the extended discrete state equation and output equations are tions are the same as those of a conventional identity observer. derived as Thus, the steady state Kalman filter based disturbance observer is expressed as Eqs. (10) and (11). The Kalman gain matrix, + = + xo(k 1) Ao xo(k) Bous(k)(8)= T , T T H [H1 H2 ] is designed to minimize J using Eqs. (15) and yo(k) = Co xo(k)(9)(16). Figure 5 (a) shows the relation between the actual angle A −B B and the encoder output, and (b) shows the sensing error used to where A = d d , B = d , C = C 0 . o 0 I o 0 o d estimate the system covariance. From Eqs. (8) and (9), the identity disturbance can be de- 5. Movement Controller Design signed as To implement the proposed movement control system, the + = + + { − } xˆo(k 1) Ao xˆo(k) Bou(k) H yo(k) yˆo(k) (10) control input us(k) should consist of the nonlinear input u(k) ˆ yˆo(k) = Co xˆo(k) (11) and the disturbance estimate d(k). This means modifying the nonlinear control plant to the equivalent linear plant using dˆ(k) where H = [HT , HT ]T is the gain matrix of the observer. Fig- 1 2 to cancel the external disturbance and the effects of modeling ure 4 shows a block diagram of the control plant and the pre- error. sented disturbance observer, which is described using the com- ponents in Ao, Bo, Co. us(k) = u(k) + dˆ(k) (17)

4.2 Design of a Kalman Filter Based Identity Disturbance It is well known that an equivalent linear system related to in- Observer verted pendulums is not controllable except at the equilibrium Assuming that white system noise ω(k) ∈ Rn and white sen- points. Therefore, the controller cannot regulate all the state sor noise (k) ∈ Rl are added to the extended system, Eqs. (8), variables and make all the system poles stable in the global (9), the extended system equations are modified as range concurrently. Thus, this paper discusses the movement control of a few variables while the robot is in motion. How- + = ¯ + ¯ + ω x¯(k 1) Ad x¯(k) Bdus(k) (k) (12) ever, since it is difficult to design a nonlinear feedback con- y(k) = C¯d x¯(k) + (k) (13) troller with digital , the subsequent controller is SICE JCMSI, Vol. 2, No. 1, January 2009 53

Fig. 6 The block diagram of the control system.

designed using continuous theory. In practice, only θ¨b is par- ture of the experimental control system. The inverted pendu- tially linearized by Eq. (18), as θ¨b = v is realized [11],[12]. lum robot is driven by a pair of 140 W DC servo motors, which are installed in the body of the robot. The controller was de- J2 J3g Det u(k) = θb(k) − v(k) (18) signed using MATLAB/Simulink/RealtimeWorkshop program, R(J + J ) J + J 2 3 2 3 produced by MathWorks Inc. The tilt angle and the wheel Instead of the implementation of θ¨b = v, the remaining part, angles are detected by rotary encoders manufactured by Mi- which is the third row of the matrix Ad, is modified to θ¨ω = crotech Laboratory Inc. They are mounted in the robot’s body. J3g J1 J2+J2 J3−J3(J2+J3) J1+J3 f5θb + g5v where f5 = , g5 = − . The program is transferred to a controller S-box produced by Det·R J2+J3 J2+J3 When v is small, the second term can be neglected and the MTT Inc. in Japan. The control program runs every 1 ms. equation approximated as θ¨ω = f5θb. It is known that this equa- The physical and control parameter values used in the exper- tion expresses a kind of zero dynamics. When a PID control iment are shown in Tables 1 and 2, respectively. They were t v = k θ − θ + k θ − θ dt − k θ˙ θ law p( br b) i 0 ( br b) d b is used, b con- collected from the data of real robots under development. verges to θbr. Thus, Eq. (19) is obtained, which means that the Figure 8 shows the actual experimental results related to the tilt angle θb can be controlled if the acceleration of the robot θ¨w control system. Basically, the figures indicate that the pre- is to be controlled on track θ¨wr. sented control law is suitable as intended. The top line shown in Fig. 8 (a) illustrates the position reference xr with a dotted line, θ = 1 θ¨ br ωr (19) and the real position x (= R · θw) of the robot with a solid line. f5 The waveform of x tracks xr fairly well, departing from xr once To control the position of the robots, to set it in motion, the from 22.5 s to 23 s because of a disturbance given to the robot acceleration reference ar is calculated from the second order manually. Note that x returns to xr from 23 s to 25 s. The sec- derivative of the position reference xr, which is a function of ond line of the figure shows the tilt angle reference θbr and real θ¨ = / θ time. Next, w ar R and pr are derived from Eq. (19). The tilt angle θb,andθb tracks θbr very well, which means the tilt resultant control law indicates an indirect position control based on instability. Figure 6 shows the block diagram of the control system.

6. Experimental Result This section presents the experimental results for evaluating the control performance. Figure 7 describes the hardware struc-

Table 1 Physical parameters of the inverted pendulum.

Mass of the body mb 8.8 (kg) Half of height of the body z 0.20 (m) −2 Half of width of the body zb 7.5 × 10 (m) Radius of the wheel R 8.5 × 10−2 (m)

Mass of the wheel mw 0.6 (kg)

Table 2 Control parameters. 2 2 Proportional gain kp 7.20 × 10 (1/s ) 3 Integral gain ki 2.80 (1/s ) Derivative gain kd 8.50 (1/s) Sample rate: Tsamp 1.0 ms Covariance Qob diag(1.0e6, 1.0e5, 2.0e3, 1.0e3, 2.0e5) Covariance Rob diag(1.0e−2, 1.0e−2) Note: The character “e ∗∗” means “×10∗∗”. Fig. 7 The system hardware structure. 54 SICE JCMSI, Vol. 2, No. 1, January 2009

Fig. 8 Experimental results of straight motion. Fig. 9 Sequential photographs of movement control with Kalman filter angle control is executed successfully. It seems that the control based disturbance estimate feedback. law based on tilt angle control realizes the intended high-speed motion control. The third line of the figure shows the actual quickly. control input torque τ and the fourth line of the figure describes Acknowledgments the disturbance estimate. Figure 8 (b) shows another experimental result for the control The authors acknowledge the contribution by the members of system without disturbance estimate feedback. The top line of Microtech Laboratory Inc. = · θ Fig. 8 (b) illustrates the xr and x ( R w). The waveform of x References does not track xr well, although the tilt angle control performs [1] Rogerugist: Experiment to stand up dolls, Mall to Physics, . reasonably well. x does not track xr from about 10 5s to17s pp.77–84, Iwanami, 1963 (in Japanese). and from 17 s to about 18.5 s the operator provides a manual [2] K. Furuta, T. Okutani, and H. Sone: Computer control of a dou- disturbance to support the robot, and the robot almost tracks ble inverted pendulum, Computer and Electrical Engineering, the position reference. However, after 28 s, the robot departs Vol.5, pp.67–84 ,1978. due to the another manual disturbance. [3] P. Albertos, P.A. Perez, R. Strietzel, and N. Mort: Control En- Figures 9 and 10 show sequential photographs of the robot’s gineering Solutions: A Practical Approach, IET, 1997. [4] N.R. Prasad, S.T. Balfour, H.T. Nguyen, and E.A. Walker: A motion—the same motions as in Figs. 8 (a) and (b). They show First Course in Fuzzy and Neural Control, CRC Press, 2002. that the intended high-speed motions are realized. [5] S.K. Spurgeon and C. Edwards: Sliding Mode Control: Theory and Applications, Taylor & Francis, 1998. 7. Conclusion and Future Work [6] Segway Inc.: http://www.segway.com/ This paper discussed the latest control technique for two- [7] D.L. Kamen, R.R. Ambrogi, R.J. Duggan, R.K. Heinzmann, wheeled inverted pendulum robots using instability with a B.R. Key, A. Skoskiewicz, and P.K. Kristal: Transportation Ve- Kalman filter based disturbance observer. It utilized partial lin- hicles and Methods, U.S. Patent No.5971091,1999. earization feedback and the cancellation by the disturbance es- [8] A. Shimada and N. Hatakeyama: High-speed motion control of inverted pendulum robots, 9th IEEE International Workshop timate feedback. The experimental results demonstrated that on Advanced Motion Control—AMC ’06, pp.307–310, 2006. the proposed concept works well. This result is better than pre- [9] N. Hatakeyama and A. Shimada: Movement control using vious results [8]–[10] and the control technique is expected to zero dynamics of two-wheeled inverted pendulum robot, Trans. help development of innovative mobile robots that can move SICE, Vol.44, No.3, pp.252–259, 2008 (in Japanese). SICE JCMSI, Vol. 2, No. 1, January 2009 55

Akira SHIMADA (Member) He was born in Chiba, Japan, in 1958. He received the B.S. degree in electronics engineering from the Uni- versity of Electro Communications, Japan, in 1983 and received the Ph.D. in engineering from Keio University, Japan in 1996. He worked at Seiko Instruments as a engineer from 1983 to 2001. Concurrently, he was a guest professor at Chiba University. He has been an associate professor at the Polytechnic University, Japan since 2001. His current interests include motion control, robotics, and control engineering. He is a member of RSJ and IEEE, and a senior member of IEEJ.

Chaisamorn YONGYAI He was born in Kamphaengphet, Thailand, in 1976. He received the B.S. degree in mechanical engineering from the Polytechnic University, Kanagawa, Japan, in 2003. He is currently pursuing the M.S. degree in mechanical engineering at the Polytechnic University. His current re- search interests include Kalman filters, disturbance ob- servers and mobile robotics.

Fig. 10 Sequential photographs of movement control without Kalman fil- ter based disturbance estimate feedback.

[10] N. Hatakeyama and A. Shimada: Movement control of two- wheeled inverted pendulum robots considering robustness, Trans. SICE, Vol.44, No.9, pp.721–728, 2008 (in Japanese). [11] M.W. Spong: The swing up control problem for the Ac- robot, IEEE Control Systems Magazine, Vol.15, No.2, pp.49– 55, 1995. [12] T. Mita: Introduction to Nonlinear Control: Skill Control of Under-Actuated Robots, Syokodo, 2000 (in Japanese). [13] Toyota News Release, October 11, 2005. [14] C. Yongyai, A. Shimada, and N. Fujii: Kalman filter based disturbance observer and an observation to the use of distur- bance estimate, Proc. 51st Joint Automatic Control Conference, pp.1226–1231, 2008 (in Japanese). [15] A. Shimada, K. Ohishi, M. Shibata, and O. Ichikawa: EE Text Motion Control, Ohmusha, 2004 (in Japanese).