The Reaction Wheel Pendulum - Control Systems – Final Project | ECE 486, Study Guides, Projects, Research of Control Systems

Material Type: Project; Class: Control Systems; Subject: Electrical and Computer Engr; University: University of Illinois - Urbana-Champaign; Term: Fall 2008;

Typology: Study Guides, Projects, Research

Pre 2010

Uploaded on 03/16/2009

koofers-user-jsb
koofers-user-jsb 🇺🇸

5

(1)

10 documents

1 / 29

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
1
ECE 486 Final
Project:
The Reaction Wheel
Pendulum
Name:
RWP #:
(painted on base of RWP)
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d

Partial preview of the text

Download The Reaction Wheel Pendulum - Control Systems – Final Project | ECE 486 and more Study Guides, Projects, Research Control Systems in PDF only on Docsity!

1

ECE 486 Final

Project:

The Reaction Wheel

Pendulum

Name:

RWP #:

(painted on base of RWP)

Fall 2008 2

1 1 Introduction

1.1 The Reaction Wheel Pendulum

Rotor Pendulum Figure 1 : The Reaction Wheel Pendulum The Reaction Wheel Pendulum (RWP), shown in Figure 1, is a simple pendulum with a rotating wheel at the end. The wheel is actuated by a 24-V, permanent magnet DC motor mounted on the pendulum. This motor can produce a torque on the wheel, causing the wheel to spin. According to Newton’s third law, there is an equal and opposite “reaction” torque on the motor, and hence on the pendulum. This reaction torque can be used to control the motion of the pendulum. We begin by obtaining the equations of motion for the RWP. Next, control of only the reaction wheel's speed is examined. As part of this phase, we investigate counteracting the effect of friction in the motor by “friction compensation.” Finally control of the complete RWP is considered.

1.2 Derivation of Mathematical Model

The first step in any control system design problem is to develop a mathematical model of the system to be controlled. Nonlinear models will first be derived using the Lagrangian approach. These models will later be linearized, and the linear models will be used to design control strategies. Figure 2 : Schematic Diagram  p  r PENDULUM REACTION WHEEL reaction wheel pendulum Figure 1: the Reaction Wheel

2 A schematic diagram of the RWP is shown in Figure 2. We have chosen the angles as in Figure 2 because it is natural to use gravity to line up the pendulum hanging down. The angle  p is the angle of the pendulum arm measured counterclockwise from the vertical when facing the system, and  r is the wheel angle measured likewise. The RWP is provided with two optical encoders. These encoders are relative as opposed to absolute encoders and thus measure only the relative angle between their (fixed) stator and (movable) rotor. Their values are initialized to zero at the start of every experiment. One encoder is attached to the fixed mounting bracket with its shaft attached to the pendulum link. It thus provides a measure of the relative angle between the pendulum and the fixed base. The other encoder is attached to the motor fixed at the end of the pendulum. Its shaft is attached to the rotating reaction wheel and thus provides the relative angle between the pendulum and wheel. If we denote the encoder angles for the pendulum and rotor as ^ p and ^ r , we see that r p r p p         ( Later we will discuss such issues as the noise and quantization associated with digital measurement of these angles and the problem of estimating angular velocities from the encoder values. A convenient way to derive equations of motion for electromechanical systems is the Lagrangian method. The Lagrangian method allows one to deal with scalar energy functions rather than vector forces and accelerations as in the Newtonian method and is, in many cases, simpler. The RWP has two degrees of freedom. We take as generalized coordinates the angles θp of the pendulum and θr of the rotor as shown in Figure 2. We also introduce the following variables: mp mass of the pendulum and motor housing/stator mr mass of the rotor m combined mass of rotor and pendulum Jp moment of inertia of the pendulum about its center of mass Jr moment of inertia of the rotor about its center of mass  (^) p distance from pivot to the center of mass of the pendulum  (^) r distance from pivot to the center of mass of the rotor  distance from pivot to the center of mass of pendulum and rotor k torque constant of the motor i input current to motor

ECE 486 - Introduction 1-a Write the equations for the kinetic energy K and potential energy V of the RWP. (Note that the kinetic energy of the system is the sum of the kinetic energies of each degree of freedom. How many degrees of freedom does the RWP have?) Also point out the generalized coordinates and their derivatives. How many equations of motion will we have? (Hint: See Appendix A for help with the physics if you’re stuck.) Notice: the RWP includes the motor. So the motor cannot produce a net torque on the RWP. Therefore, when it exerts a torque on the rotor it must exert an equal and opposite torque on the pendulum. Use the relation τ = ki for motor torque. 1-b Write Lagrange’s equations (see Equation ( ) for this system. Express the equations using three parameters: J mg p   2  , J k , and J r k

. (Notice that^ ^ p is the frequency of small oscillations of the system around the hanging position.) Your final representation should be:

i

J

k

i

J

k

r r p p p    

  2 sin

So far we have ignored friction. The mass on the pendulum is large enough that the friction on the pendulum link can be ignored. However, there is a significant amount of friction on the rotor link (mostly due to motor friction). Fortunately, the rotor is attached directly to the motor, making friction easy to model. The motor current i is generated by a pulse width modulation system, which is controlled from the computer. Due to current feedback, the current is proportional to the control command u from the computer. The control variable used in the computer is scaled so that 10 units correspond to maximum current. Therefore we can write kiku u u  (^10) ( We assume the friction is a function of the rotor speed F(ωωr). Initially, we will model friction in command units (units of ' u '). Applying Equation ( ,

sin ( ( ))

2 r r u r r u p p p

u F

J

k

u F

J

k

4

ECE 486 - Introduction Finally, to clear up the clutter, we can define variables J mg a (^) p    2  (^) , J k b (^) pu , and using ( , r u r J k b  (^) becomes: 

sin ( ( )) r r r p p p r b u F a b u F  

This is a satisfactory representation of the RWP. Before we begin its control, however, let us take a detour and consider speed control of a DC motor. This will allow us to model and play with friction. 5

ECE 486 - Friction Identification Using the Reaction Wheel 2-a Design a proportional controller to regulate this system to 100 rad/s, with a rise time of 0.2 s (see Figure 4). Assume br = 198 (rad/s). Simulate your controller using Simulink (see Appendix B: Implementation Notes). Of course, this is an ideal model, so a few real-world issues must be dealt with. Recall from Section 1.2, page 4 , that the control input is limited to 10. That is simple enough to simulate in Simulink. (ωHint: Check out the “Saturation” block.) Another issue is the determination of angle from the encoder output. Think of the encoder as the Wheel of Fortune wheel; counting ticks tells you that it’s turning. (There’s also a provision for determining direction of spin; this is analogous to the “ticker” sounding different in either direction.) The ticks add as the angle changes. There are two issues here: First, how does the software know where “zero” is? By convention, zero is the encoder angle when you “Start” the run. Second, how do you determine angle from ticks? Since the motor encoder has 4000 ticks/revolution, multiply by 2π/4000 to scale to radians. (The pendulum encoder has 5000 ticks/revolution.) One other detail: the reaction wheel encoder and motor use opposite sign conventions in this setup. In other words, when a positive current is applied to the motor, it spins in a direction that the encoder calls negative. Therefore, also include a negation by multiplying the encoder value instead by -2π/. The encoder measures position. How can the velocity ^  d^  dt be obtained? This is done either by using a transfer function that approximates a derivative or by using a discrete version of the same. We will implement both and compare them. A simple discrete version can be found by using Euler’s method (FPE pp.167, or FPE 3rd^ Ed pp. 138). It states that t f t f t t dt df t (^) 



lim 0

The discrete derivative approximation is implemented by using the “Unit Delay” block in Simulink. In order to keep life simple, when doing calculations we will still consider our velocity estimate to be ideal. Applying Equation ( to our system, t t t t t r r

Trick: To make sure you don’t have to change Δt each time you change thet each time you change the simulation step size (ωit must be fixed-step) in Simulink, use “str2num(ωget_param(ωbdroot, Figure 4 : General Block Diagram of Velocity Controller REF CONTROLLER MODEL velocity () u (^) CL K br /s 7

ECE 486 - Friction Identification Using the Reaction Wheel 'FixedStep'))” in place of Δt each time you change thet. This causes Simulink to look up the value you’ve entered in the Fixed Step Size field in Configuration Parameters. The continuous derivative approximation can be understood by looking at the frequency response of the derivative function s. We want to keep the response similar at low frequencies, but refrain from amplifying the high-frequency noise. This is accomplished by placing a pole at a sufficiently high^1 frequency, giving the transfer function s  1 s

where ω = 1/ τ is the pole location. For your continuous derivative, use Equation ( with  = 1/50. Now that we have a velocity estimate, we can solve the following problem: 2-b Implement your controller designed above in Wincon (see Wincon Notes in Appendix B).  Use a “Manual Switch” to choose between your continuous and discrete velocity estimates. Pick the better derivative.  Compare the simulated response with the Wincon response. What is the source of this discrepancy? The answer to question  leads us to the ultimate goal of this section: friction identification and modeling.

2.2 PI Control for Friction Identification

As you know, we can counteract a constant disturbance by adding an integrator. 2-c Choose a PI controller to regulate the system to 100 rad/s (similar to Question 2-a). Simulate it, and also implement it using Wincon. Compare results, especially steady-state velocities and steady-state control efforts. Explain why the steady-state control effort differs. This nonzero control effort can be used to our advantage. We can use it to characterize friction. It may seem odd to be doing system identification while applying a controller; this is called closed-loop system identification , and is a relatively new and exciting area of study. In this case, closed-loop system identification allows us to work (^1) Sufficiently high: application-specific, often selected iteratively by simulation or test runs. 8

ECE 486 - Friction Identification Using the Reaction Wheel 2-e Implement friction compensation in Wincon.^2 Proportional control should now regulate the system to (or very close to) the desired velocity. Is integral control still needed, or is proportional control sufficient? Observe the effects of PI control. Now, remove your controller and simply implement friction compensation. What do you expect will happen? Reason out what you expect to see, then manually start the motor spinning in either direction and see what happens. Try adjusting your dynamic friction gains and see how the behavior changes. Friction compensation can do wonders for velocity control. Now that friction is well understood and accurately modeled, we can return to the overall Reaction Wheel Pendulum. First, we will do some System Identification and Model Verification, then finally delve into control. (^2) Typing fricblocks at the MATLAB prompt opens a block that calculates asymmetrical friction. Figure 5 : Functionality of Friction Compensation FRICTION- LESS MOTOR FRICTION  velocity^ () F = - (b+c) FRICTION COMPENSATION F' = b+c OPEN-LOOP SYSTEM SHOWING FRICTION EXPLICITLY OPEN-LOOP SYSTEM WITH FRICTION COMPENSATION PLANT u (^) CL  FRICTION- LESS MOTOR FRICTION  velocity^ () F = - (b+c) PLANT u (^) CL 10

11 3 System Identification We can now determine the parameters of the Reaction Wheel Pendulum (RWP). Here we set up the RWP in the standard configuration. The parameters can be determined from physical construction data and by direct experiments on the system. It is useful to combine both methods to find all the parameters, and to make cross-checks. It also verifies that our mathematical model is reasonable. By measuring the dimensions of the components, weighing them, and computing moments of inertia using simplified formulas we find: mp = 0.2164 kg mr = 0.0850 kg Jp = 2.233ּ 10 -4^ kgּm^2 Jr = 2.495ּ 10 -5^ kgּm^2  (^) p = 0.1173 m  (^) r = 0.1270 m 3-a Use the relations and definitions given in Section 1.2 to get values for J , m , , and ω)p. Also find ω)p′ (defined by Equation ( below). In order to verify the natural frequency, we can do a free swing test (below).

3.1 Checking the Harmonic Frequency

3-b Initialize the pendulum at about 90 and let it swing freely. When the wheel stays stuck to the pendulum, i.e. the encoder reading φr is constant, determine the frequency of oscillation. This measured frequency is different from ωp because the rotor is contributing to the moment of inertia. The quantity you measured is actually r p J J mg     ' ( Compare the experimental value with the theoretical value, computed from the parameters (all known). Notice also that the decay in the swing amplitude is very slow (at small amplitudes), having a time constant on the order of a minute. On the other hand, if the rotor is excited with the maximum current, and then the current is removed, it takes only a few seconds to come to complete rest. In both cases, friction is the only deceleration For you to find: J = kgּm^2 m = kg  (^) = m ωp = rad/s ωp′ = rad/s measured frequency of oscillation: ωp′meas = rad/s

ECE 486 - System Identification Figure 6 : Derivative approximations add significant noise 3-d Use the method described above to find bp and br. A partial m-file is provided for you on the lab website. Use a step of magnitude 5 for u. To determine bp and br mathematically (and thus ku ), recall that

r r u r u p

J

k i

J

k

b

J

k i

J

k

b

max max ( The i max and 10 comes from the fact that we want the controller to send maximum current to the motor when we give an input of 10. Properties of the motor and controller tell us the value of i max and k , giving bp = 1. br = 198 Your results should approximately agree (within 30%). 13

14 4 Stabilizing the Inverted Reaction Wheel Pendulum

4.1 Linearization and Controllability

The Reaction Wheel Pendulum (RWP) has equations of motion, ignoring friction, given by 

b u a b u r r p p p

  (^) sin ( 4-a Linearize this system about the equilibrium position of θp = π. Write the state-space model for this system in the blanks provided in Equation ( and check for controllability from the single input u. Note: Your new state variables are delta-angles, where  θp = θpπ and  θr = θr. u u r^ r p^ p   ^    ^ ^ ^   ^  ^ ^ ^    ^ ^ ^    ^ ^ ^    ^ ^ ^   ^  ^ ^ ^    ^ ^ ^      ^  ^     xA xB ( The system should be controllable; otherwise we would need to add another actuator to be able to complete the project.

4.2 Stabilization Using Two-State Feedback

In the interest of keeping our controller as simple as possible, and because we don’t care about the position of the rotor, let us first design a PD controller to regulate the pendulum angle, completely ignoring the rotor angle and velocity. Here we are only considering the first equation of Equation ( – so we actually have a 2nd^ order system. 4-b Design a PD controller (in the feedback path) for the RWP. Constraints for θp: keep ω)n » ω)p ( ω)p as found in Section 3 ) – do you know why it must be greater?, make   1 2 , and keep kP and kD both less than 300. (Hint: meet the last constraint by trial and error.) Simulate your system using the nonlinear “Reaction Wheel Block Diagram Model” and “Reaction Wheel Animation” blocks (don’t bother estimating velocity; just use the exact states). Simulate  IC deviation ( ^ p or ^ ^ ^ p nonzero),  a pulse (simulating a tap) disturbance input to the pendulum arm ( τp ) with duty cycle of 5% and period of 4 seconds, and  a constant disturbance input to the pendulum arm. Is the response satisfactory (i.e. stable and fairly fast)? Now look at rotor velocity. Do you see any problems?

ECE 486 - Stabilizing the Inverted Reaction Wheel Pendulum 4-d Include friction compensation (which you designed in Question 2-e) and observe the change in behavior. Demonstrate it to your TA. We will next explore the observer’s approach. 16

17 5 Observer Design We will now design an observer for the Reaction Wheel Pendulum (RWP) to replace the full state feedback controller we designed previously. The observer will estimate both velocities of the system. And since we’re designing a full-order observer, it will also “estimate” both positions. Look back at your full-state feedback design; you pulled all of the open-loop poles except the ^ r pole into the left half plane. When we design an observer, however, we must place all of the poles in the left half plane; our criteria being, as before: “significantly farther” than the desired closed-loop poles. See Figure 7 for an illustration of this (not to scale, and relative pole locations may vary by design). Figure 7 : Illustration of Pole Locations

5.1 Observing Four States Together

5-a Using the MATLAB place command, place the observer poles significantly farther than your closed-loop poles (as designed in Section 4.3). Five to ten times faster is a good distance. Keep these poles near or on the real axis. Also note that the ‘place’ command connot solve for repeated roots. Check the full system’s eigenvalues using MATLAB eig to make sure they are stable. RWP coordinate change Observer  (^) p  (^) r observed states p r u (^) - K Figure 8 : Block Diagram of System with Observer OPEN-LOOP POLES CLOSED-LOOP POLES OBSERVER POLES