IEEE ICMA 2009 Conference Proceeding - CiteSeerX

5 downloads 2098 Views 243KB Size Report
[8], [10]. A typical inverted pendulum setup consists of either a one or two-stage ..... state upright position, the total energy, which we call the target energy, can be ...
Proceedings of the 2009 IEEE International Conference on Mechatronics and Automation August 9 - 12, Changchun, China

Development and Control of an Inverted Pendulum Driven by a Reaction Wheel∗ Frank Jepsen, Anders Søborg, Anders R. Pedersen, Zhenyu Yang Department of Electronic Systems Aalborg University, Esbjerg Campus Niels Bohrs Vej 8, 6700 Esbjerg, Denmark

control of the Hubble Space Telescope [2]. The principle of using a reaction wheel lies in the conservation of angular momentum [1], [7]. For example, to accelerate a spinning wheel via an attached motor in one direction, a spacecraft on which the wheel is attached will rotate the other way. Since the reaction wheel is normally a small fraction of the spacecraft’s total mass, thereby easily-measurable changes in the speed of the wheel can provide very precise changes in spacecraft attitude [2], [6]. Using the reaction wheel to drive an inverted pendulum has been extensively studied in [3]. Normally the control of this type of inverted pendulum consists of two tasks: swinging-up the pendulum and then stabilizing the pendulum at its upright position. Although a bunch of analysis and design results for this type of setup can be found in literatures, it is still far beyond simplicity and ease if people intends to develop a physical setup and realize most control strategies. This paper summarizes what we learned and observed from the development, control and implementation of a laboratory-sized inverted pendulum system using the reaction wheel mechanism. From the hardware development point of view, we noticed that the ”compatible” features of physical components are very critical in getting a reasonable complete system. At the first development stage, the control design focused on a simple but reliable solution, i.e., a simple hybrid switching controller which consists of three discrete states is developed. Two control states are defined on the status that the motor is fully driven either clockwise or counter-clockwise. By properly switching between these two control states, a bang-bang swing-up controller with some hysteresis characteristic is developed through the energybased analysis. In order to stabilize the pendulum when it approaches close to the upright position, an observer-based feedback controller is derived. The operating regions and switching conditions among different control status are also investigated. The simulation and real system tests showed consistent and satisfactory performance of this controlled system, which is self-developed and successfully controlled with a small financial budget. The rest of the paper is organized as the following: Section II describes the hardware development and the physical setup; Section III discusses the mathematical modeling and

Abstract—This paper discusses the development and control of an inverted pendulum system using the reaction wheel mechanism. A laboratory-sized system is developed and services as a physical platform for control test purpose. A hybrid switching controller is designed to swing-up and then stabilize the pendulum at its upright position. Based on the energy analysis, the swing-up controller is developed as a simple modest bang-bang controller which switches the control signal’s direction according to the measured pendulum’s angle and angular velocity as well. The local stabilizing controller is designed as an observer-based feedback controller. The operating regions and the switching condition between these two controllers are also investigated. The developed controller is implemented in a DSP of type eZdsp F2812 which is plugged in a developed PCB. The simulation and real tests showed consistent and satisfactory performance of this controlled system which is self-developed and successfully controlled with a small financial budget. Index Terms—Inverted Pendulum, reaction wheel, hybrid switching control

I. INTRODUCTION Due to its inherently open-loop un-stability and highly nonlinear characteristics, the inverted pendulum system has been extensively used for the purposes of automation education and test of new advanced control techniques [1], [3], [4], [8], [10]. A typical inverted pendulum setup consists of either a one or two-stage inverted pendulum pivoted on a movable cart, or a rotational pendulum, where either a (motor) driver is located at the fixed pivoted position or a driver (normally called a reaction wheel [3]) is located at the free end of the pendulum. One ultimate control objective for this kind of system is to (possibly first swing-up and then) stabilize the pendulum at its upright position when the system starts from some tilt angle or from the hanging position. The control can be developed using classical or contemporary control techniques [1], [5], [7]. Recently the control of mechanic systems using the reaction wheel mechanism has become more and more attractive due to its simple configuration and recent spacecraft applications [3], [6], [7]. For instance, a set of reaction wheels have been successfully used in the precise pointing ∗ The first three authors are registered students in the Intelligent Reliable Systems (IRS) Master degree programme at Aalborg University. More information about our study programmes can be found from http://www.esn.aau.dk/.

978-1-4244-2693-5/09/$25.00 ©2009 IEEE

2829

TABLE I PARAMETERS AND VARIABLES USED IN THE MOTOR MODEL

Symbol Bm Kt Jm La Ra Ke ωm Vin ia Fig. 1.

Description Viscous friction constant Torque constant Moment of inertia of the motor Motor inductance Motor resistance Back EMF constant Angular velocity armature voltage Armature current

Value/Variable Nm 0.018 rad/s Nm 1 V 2.38e-5 kgm2 3.2e-3 H 40.8 Ω V 1.66e − 2 rad/sec rad/sec V A

CAD drawing of the developed pendulum system

radius of 0.1175m and the calculated inertia of 6.57e3kgm2 ; and • The pendulum is made in aluminium with a length of 0.265m and the mass as 1.28kg. In order to measure the angular velocity of the reaction wheel, an optical tacho-meter is attached on the motor shaft. This tacho-meter outputs a dual channel Quadrature Encoder Pulse (QEP) so that it is possible to detect the turning direction as well. This tachometer has a resolution of up to 2000 pulses pr. round. It means that there will be almost 20000 ticks per second when the motor runs at full speed. This should of course be taken into consideration when a micro-processer is chosen. To measure the angular velocity of the pendulum a second dual channel QEP tacho-meter is placed on the pendulum axis. As opposed to the one used for the wheel this tacho-meter has 500 pulses pr. round. A dualaxis accelero-meter from Parallax is chosen for measuring the pendulum’s vertical tilt angle. It has a resolution better than 1 milli-g. The output from the accelerometer is a pulse, where the duty cycle indicates the acceleration of the axis.

parameter identification; Section IV briefs the development of a switching controller so as to swing-up and then stabilize the concerned system; Section V describes some implementation issues and summarizes the simulation and test results; and finally we conclude the paper in Section VI. II. SYSTEM DEVELOPMENT A laboratory-sized setup is developed from scratch with a small financial budget (less than 100US$) in mind. The CAD drawing of the developed system is illustrated in Fig.1. During the hardware development period, the following aspects are considered: • The moment of inertia of the reaction wheel; • The characteristics of the selected motor in terms of available torque vs. speed; • The mass of the pendulum; and • The length of the pendulum. Many of these aspects affect each other. For instance, the moment of inertia of the reaction wheel should ”match” with the output torque of the selected motor and the pendulum length as well. The reaction wheel should be designed to maximize the moment of inertia but at the same time minimize the total weight. Thereby, after several try-by-error experiments, our strategy for hardware development is to use the motor characteristic as a starting point. It is noticed that a motor with low speed but high torque is preferred. A 24V DC motor of type 440-329 from RS Components is chosen. This motor provides a top velocity of 140 RPM and a peak load of 600 Nm. Based on the selected motors characteristic, a prototype reaction wheel was designed. The configuration of the wheel is illustrated in Fig.1. By placing the prototype wheel and the selected motor on a physical framework where the length of the pendulum can be variable, the proper length of the pendulum and the other remaining aspects of the set-up can be determined experimentally. The final conclusion of our setup are • The reaction wheel is made partly from steel with a

III. MODELING AND IDENTIFICATION The modeling task consists of modeling the selected DC motor as well as modeling the mechanic setup. To simplify the modeling process, we assume • The pendulum and the steel framework are rigid body, respectively; • The effect of the swinging pendulum to the motor dynamic is negligible. A. Model of the Electric Motor The standard linear model for a DC motor is used to model the selected motor, which is described in (1). The system coefficients are identified by several arranged experiments, and the values are listed in Table I. Kt ia = Jm ω˙ m + Bm ωm Vin − Ke ωm = ia Ra + La i˙a .

2830

(1)

Inserting (4) into (3) leads to the model of the mechanic part as mp rcog 2 ω˙ p + Jw ω˙ w = mp rcog g sin θp − Bp ωp .

(5)

C. Entire System Model

Fig. 2.

By combining the motor model (1) and the pendulum model (5), the complete model of the entire system can be obtained. Due to the fact that the reaction wheel is directly attached on the motor shaft in our configuration, there is ωm = ωw . Furthermore, the moment of inertia in the motor model (1) will be substituted by the moment of inertia of the entire load to the motor, i.e., Jmw = Jm + Jw . After linearizing (5) at the upright position (corresponding θp = 180 degree), and defining ⎤ ⎡ θp ⎢ ωp ⎥  ⎥ X=⎢ ⎣ ωw ⎦ , u = Vin , Y = θp ωp ωw , ia

Concerned angular momentum and torques

TABLE II PARAMETERS AND VARIABLES USED IN THE PENDULUM MODEL

Symbol rcog mp Jw g Bp θp ωp ωw

Description Length from origin to COG of pendulum Mass of pendulum Moment of inertia of the reaction wheel Earth’s gravity Pendulum friction constant Angle of the pendulum Angular velocity of pendulum Angular velocity of wheel

Value/Variable 0.27 m 1.02 kg 6.6e-3 kgm2 9.82 sm2 Nm 0.038 rad/s rad

a state space model can be created as X˙ = AX + Bu Y = Cx

rad s rad s

with B. Model of the Mechanic Setup

0

0

Jmw Bm c −Bm Jmw −Ke La

−Bp mp rcog 2

0

0

−Jmw Kt c Kt Jmw −Ra La

⎤ ⎤ ⎡ 0 1 0 0 0 ⎢ 0 ⎥ ⎥ ⎣ ⎦ B=⎢ ⎣ 0 ⎦, C = 0 1 0 0 . 0 0 1 0 1

⎤ ⎥ ⎥ ⎥, ⎥ ⎦

(7)

(8)

La

where c = mp rcog 2 (Jm + Jw ). D. Identification and Validation The system parameters are identified through arranged experiments, the relevant values are also listed in Table I and II, respectively. By substituting obtained system parameters into model (6), the validation of the modeling can be carried out. For instance, for a step input to the motor (18V) the measured and simulated wheel velocity are shown in Fig.3. The measured and simulated pendulum angles and velocities are shown in Fig.4 and 5, respectively. Some nonlinear features of the motor, mechanic setup and frictions make some deviations between the simulated and real tests. However, in general, we can conclude that the obtained system model has a reasonable precision, and it will be used for the further control development.

(3)

These four elements in (3) can be estimated by L˙ p = mp rcog 2 ω˙ p , L˙ w = Jw ω˙ w , τg = mp rcog g sin(π − θp ) = −mp rcog g sin θp , τf p = Bp ωp ,

1



(2)

− → ˙ where Lp is the changing rate of the angular momentum −→ ˙ of the pendulum. Lw is the changing rate of the angular → momentum of the reaction wheel. − τg is the torque originating − → from gravity. τf p is the torque originating from the friction between the axle of the pendulum and the frame. It should be noticed that the angular momentums have the opposite direction in regards to the torques. therefore, (2) can be simplified into a scalar formulation L˙p + L˙w = −τg − τf p .

0

⎢ − g ⎢ rcog A=⎢ ⎢ 0 ⎣ 0

The conservation of angular momentum is employed to model the mechanic part of the considered system, i.e., the reaction wheel and the pendulum. By analyzing the concerned system as shown in Fig.2, there is − → −→ ˙ ˙ → Lp + Lw = − τg + − τ→ fp



(6)

(4)

where the relevant system parameters and variables are listed in Table II.

2831

model (6), the discrete-time control and estimator poles (Pdci and Pdei for i = 1, · · · , 4) are selected as

Fig. 3.

Pdc1 Pdc2 Pdc3 Pdc4 Pde1 Pde2 Pde3 Pde4

Comparison of measured and simulated motor speeds

= −0.9752 + 0.0454i = −0.9752 − 0.0454i = 0.5338 = 0.5927 = −0.005875 + 0.09053i = −0.005875 − 0.09053i = 5.497e − 28 = 1.921e − 23

The feedback control gain K and the estimator gain Lp derived from the pole placement method can handle the stabilization with an initial tilt angle up to 4.2 and zero initial pendulum speed without saturating the motor input. It is observed that this controller works very well. B. A Simple Swinging-up Controller Fig. 4.

Comparison of measured and simulated pendulum angles

One of the simplest way to swing-up the pendulum is to always fully accelerate the reaction wheel under proper direction (bang-bang controller) w.r.t. the pendulum position. For instance, the pendulum may stay at the initial position A, as illustrated in Fig.7. Then the reaction wheel is accelerated clockwise, the pendulum will swing up counter-clockwise due to the conservation of angular momentum. When the reaction wheel reaches its maximal speed or the pendulum speed becomes zero, the pendulum will fall back towards the hanging position as shown at position B in Fig7. When the angle of the pendulum goes from negative to positive value as shown at position C in Fig.7, the reaction wheel will be immediately accelerated in the counterclockwise direction. This switching sequence needs to be repeated and eventually the pendulum will reach the predefined catch angle for switching from the swing-up controller to the stabilizing controller. However, in this kind of case, the angular velocity of the pendulum is often too high when it enters the switching condition, this high velocity often cause saturation of the stabilizing controller and consequently the pendulum will run over the upright position and fall down in the other side. To overcome this problem, the energy-based method proposed in [3], [10] is employed to develop a simple bangbang controller with a hysteresis characteristic to swing-up the pendulum in a modest way.

IV. CONTROL DESIGN The control development comprises of the design of a swing-up controller, a stabilizing controller and a switching strategy between these two, to drive the pendulum to a upright position. A. Stabilizing Controller A full-order observed-based feedback controller as shown in Fig.6 is developed for stabilizing the inverted pendulum, when the measured signals satisfy the switching condition from the swing-up to stabilizing action. This switching condition will be discussed in the following. Based on the system

Fig. 5.

Comparison of measured and simulated pendulum speeds

C. Two-stage bang-bang swing-up controller To ensure that the pendulum has a relatively small angular velocity when it enters the catch angle, its total energy is calculated at each sample period. The total mechanic energy consists of potential energy and kinetic energy inside the system, and there is Etot = Ekin + Ept .

Fig. 6.

When the pendulum swings, the potential and kinetic energies will shift accordingly. These two kinds of energies can be

Observer-based feedback stabilizing controller

2832

Fig. 8.

Fig. 7.

A simple bang-bang switching controller w.r.t. pendulum angle

position! We suspect that the system might enter some limit cycle behavior where the energy injected into the system is equal to the energy lost due to friction. The theoretical investigation of this problem is undergoing. This motivate us to improve the control strategy by adding the following criterion: The third criterion: If the pendulum angle is within the region θp ∈ (−θc , − π2 ) ∪ (θc , π2 ), the control input will be determined according to the pendulum angle instead of the pendulum velocity, i.e., input to the motor will be 24V if the pendulum angle θp > o, otherwise the input will be −24V . Combining the second and third criteria, a hysteresis swing-up controller is proposed as illustrated in Fig.8, where θc is the catching angle defined as the switching boundary between the swing-up and stabilizing controllers.

estimated by 2 Ekin = 12 Jp ωp2 ≈ 12 mp rcog ωp2 , Epot = mp grcog (1 + cosθp ).

(9)

It is also known that when the pendulum reaches its steadystate upright position, the total energy, which we call the target energy, can be calculated as Etar = 2mp grcog .

Bang-bang swing-up controller with its hysteresis feature

(10)

Assume the motor can either fully accelerates or fully decelerates when it runs (i.e., ±24V ). Then a switching criterion for developing a bang-bang controller is proposed as: The first criterion: at each sampling step, the system energy Etot is estimated based on measurements and compared with the target energy Etar calculated by (10). If Etot < Etar , keep accelerate the reaction wheel if possible. Otherwise, fully decelerate the wheel. In order to find out the proper period to inject energy into the pendulum system, the system energy change rate is analyzed by take time derivative of Etot , there is

D. Switching between stabilizing and swing-up controllers The switching condition between the stabilizing and swing-up controllers can be determined according to pendulum’s angle and velocity [9]. However, in our concerned system, only the tilt angle of the pendulum is concerned for switching condition development. This benefit of this simplicity is due to the fact that the first criterion for swing-up control guarantees that the pendulum won’t hold too much kinetic energy when the pendulum crossover the catching angle. Thereby, through some experiments, a maximal titled angle of the pendulum (app. ±4.2 degree) is found that the stabilizing controller can stabilize the pendulum from this initial position without initial velocity This angle is referred to as the catching angle. The operating regions of the developed controllers are illustrated in Fig.9. In order to avoid potential bumping switches, a smooth switching strategy (using fuzzy membership functions) is also employed in the real implementation.

E˙ tot = mp rcog ωp (rcog ω˙ p + gsinθp ). By inserting (5) into above equation, there is E˙ tot = ωp (−Jw ω˙ w − Bp ωp ) = −Jw ωp ω˙ w − Bp ωp2 . (11) It is clear that in order to swing-up the pendulum, i.e., to inject energy into the system through accelerating the reaction wheel, the following switching criterion is required: The second criterion: The wheel acceleration ω˙ w should has a opposite direction to ωp . From (11), it can also be noticed that the acceleration B of the wheel should satisfy ω˙ w ≥ Jwp ωp in order to fully compensate the energy loss due to frictions. This leads to two observations: (1) The selected motor should have a capability for high torque generation; (2) the pendulum will be significantly accelerated when the pendulum has a slow angular velocity, which corresponds to the situation that the pendulum moves close to the upright position. In the experiment, we observed an interesting phenomenon that if only the second criterion is used to guide the bangbang switchings - the pendulum never reaches its upright

V. IMPLEMENTATION AND RESULTS A DSP of type eZdsp F2812 from SPECTRUM DIGITAL Inc. is chosen to realize the developed controller. This 32-bit DSP has six PWM outputs, A/D converters, QEP inputs, and digital I/O pins as well. The DSP is programmed to fulfill the following tasks: (1) Generate a PWM signal to control the motor; (2) Use general purpose I/O pins to control the

2833

Fig. 9.

Operating regions of the developed control strategy

Fig. 10.

Fig. 11.

Schematic diagram of the complete setup

Measurements during the swing-up and stabilization period

swing-up controller and the switching strategy between them. The real tests and simulations showed consistent and satisfactory performances of the controlled system. However, some problems are still open, such as the limit cycle we observed when only the first and second switching criteria for swing-up controller are used; whether the feedback swing-up control proposed in [3], [7] could be better than the current bangbang control or not. The investigation of these open problems will be next stage work.

motor direction; (3) Decode the QEP signals received from two tacho-meters; (4) Decode the PWM signal received from the accelero-meter; and (5) Carry out serial communication. From the laboratory perspective, a Printed Circuit Board (PCB) is also developed as a connector board between the DSP and the physical setup, as well as the link between the PC and the DSP. This is shown in Fig.10. The communication between DSP and PC is done over a serial port using the RS232 standard. Through experimental tests, we observed the developed controller can swing up the pendulum from a hanging position and then stabilize it at an upright position. As shown in Fig.11, it took a few swing cycles before the stabilizing controller took over the control. The controller stage 0 (1) represents the swing-up controller is following the second (velocity-dependent) switching criterion (third (angle-dependent) switching criterion). The control stage 2 represents the stabilizing controller is underrunning. A disturbance (ticking on the pendulum) happened after the system is stabilized, it can be noticed that the controller can recover the falling pendulum back to its upright position again. It can be noticed that the total energy is indeed not monotonically built up due to the two-stage swinging-up controller. The payoff of this modest energy accumulation is that the system takes a little bit more time to reach the catching angle.

R EFERENCES ˚ om and K. Furuta, Swingup a pendulum by energy control, [1] K. J. Astr¨ Automatica, Vol.36, 2000, pp 278-285. [2] D. J. Carr´e and P. A. Bertrand, Analysis of Hubble Space Telescope Reaction Wheel Lubricant, Journal of Spacecraft and Rockets, vol.36, No.1, 1999, pp 109-113. ˚ om and Mark W. Spong, The reaction wheel [3] Daniel J. Block, K. J. Astr¨ pendulum, Morgan & Claypool Publishers, 2007. [4] I. Fantoni, R. Lozano and M.W. Spong, Energy based control of the pendubot, IEEE Trans. on Auto. Contr., Vol.45, No.4, 2000, pp 725729. [5] G. F. Franklin, J. D. Powell and A. Emami-Naeini, Feedback control of dynamic systems (Third edition), Addison-Wesley Publishing Company, 1994. [6] Jaehyun Jina, Sangho Kob and Chang-Kyung Ryoo, Fault tolerant control for satellites with four reaction wheels, Control Engineering Practice, Vol.16, No.10, 2008, pp 1250-1258. [7] K. N. Srinivas and Laxmidhar, Swing-up control strategies for a reaction wheel pendulum, International Journal of Systems Science, Vol.39, No.12, 2008, pp 1165 - 1177. [8] M. W. Spong, The swing up control problem for the Acrobot, IEEE Control Systems Magazine, Vol.15, No.1, 1995, pp 49-55. [9] Z. Yang, J. Lu and Z. Chen, ”A State-Space-Based Approach to Acquisition of I/O Automaton - A Case Study for Design of Hybrid Control Systems”, in Proc. of WODES’96, Edinburgh, UK, Aug.19-21, 1996, pp202-207. [10] K. Yoshida, ”Swing-up control of an inverted pendulm by energy-based methods”, in Proc. of ACC99,1999, pp 4045-4047.

VI. CONCLUSION A laboratory-sized inverted pendulum using a reaction wheel is designed and constructed. A hybrid switching controller is proposed and implemented. It consists of an observer-based stabilizing controller, a two-stage bang-bang

2834