






















Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Material Type: Notes; Class: Control Systems; Subject: Electrical and Computer Engr; University: University of Illinois - Urbana-Champaign; Term: Fall 2008;
Typology: Study notes
1 / 30
This page cannot be seen from the preview
Don't miss anything!























1
(painted on base of RWP)
1
1 Introduction
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.
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 W HEEL
ECE 486 - Introduction 3
We also introduce the quantity
J = Jp + mp ℓ^2 p+ mr ℓ (^2) r (3)
to represent the moment of inertia with respect to θp, and note the relationships
m = mp + mr (4) m ℓ = mp ℓ (^) p+ mr ℓ (^) r (5)
Lagrange’s Equations The Lagrangian method begins by defining a set of generalized coordinates q 1 ,...,q n, to represent an n-degree-of-freedom system. These generalized coordinates are typically position coordinates (distances or angles).
Next, compute the kinetic energy K, and the potential energy V in terms of these generalized coordinates. Typically, potential energy is only a function of the generalized coordinates, but kinetic energy is a function of the generalized coordinates and their derivatives.
In a multi-body system, the kinetic and potential energies can be computed for each body independently and then added together to form the energies of the complete system. This is an important advantage of the Lagrangian method and works because energy is a scalar-valued function, as opposed to a vector-valued function.
Once the kinetic and potential energies are determined, the Lagrangian, L( q 1 ,...,qn ,qɺ^1 ,...,qɺn ), is then defined as the difference between the kinetic and potential energies. The Lagrangian is therefore a function of the generalized coordinates and their derivatives.
Finally, it can be shown that the equations of motion all have the form
k n q
q
dt
d k k k
The variable тk represents the generalized force (or torque) in the qk direction. These equations are called Lagrange’s Equations and have the remarkable property of remaining invariant with respect to arbitrary changes of coordinates.
ECE 486 - Introduction 4
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 (2)) for this system. Express the equations using three parameters: J
mg p
k , and
J r
k
system around the hanging position.)
Your final representation should be:
i J
k
i J
k
r
r
p p p
ɺɺ (^2) sin (6)
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
ki = ku u u ≤ 10 (7)
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 (7),
(^2) sin ( ( ))
r r
u r
r u p p p
u F J
k
u F J
k
6
2 Friction Identification Using the Reaction
Wheel
In this section we will identify friction, using only the reaction wheel. Recall that we made the assumption that the pendulum link has negligible friction. Isolate the motor by attaching the pendulum arm to the mounting bracket using the provided hex spacers. We will design velocity controllers to identify friction. Since velocity information is not directly available to us, we will explore alternate methods. Keep in mind that in this part we are trying to model the real world, not perform actual control systems analysis. Therefore the emphasis will be on contrasting calculated or simulated behavior with actual behavior, rather than on designing controllers to meet certain performance specifications.
Safety note: When doing experiments in this part, remember a couple of things. Even though the motor controller has a safety mechanism to prevent the motor from spinning extremely fast, the combination of spinning fast and running for a long time will heat up or even burn out the motor. Be prepared to shut off the controller either when the system runs long enough for you to collect data or when it becomes unstable, either through Wincon or the switch on the amplifier board. Consider 200 rad/s as fast.
In past labs we have analyzed the dynamics of a DC motor, using the armature voltage as the input. Here however, we select the armature current i as input. Then the motor becomes merely a current-torque transducer (see Figure 3).
The torque τ is applied to the reaction wheel (rotor) having moment of inertia Jr and speed (relative to the motor housing) of ωr. There is also friction, due mainly to the motor brushes and represented as a torque τF. So the motion of the wheel is given by
with, we get the following:
First, we will consider velocity estimation. Consider Equation (11) but ignore friction for now.
Figure 3: DC Motor Model
i MOTOR τ = k i
ECE 486 - Friction Identification Using the Reaction Wheel 7
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π/4000.
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 (12)
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 (12) to our system,
t
t t t t r r ∆
Figure 4: General Block Diagram of Velocity Controller
ωREF CONTROLLER MODEL velocity (ω)
u (^) CL
K br /s
ECE 486 - Friction Identification Using the Reaction Wheel 9
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 with a stable system and use straightforward procedures (c.f. open-loop friction identification in Lab 4). Let’s see how this works. Consider Equation (11) at steady-state, with friction included.
We see that for non-zero friction, the control effort will be non-zero as well. In fact, the value of friction for any velocity is merely the steady-state control effort for a setpoint of that velocity. In other words,
where ucl is the closed-loop controller.
2-d Run the motor at various speeds (i.e. vary the setpoint) and record the steady-state control effort for each speed. Do this for both positive (counter-clockwise) and negative (clockwise) velocities. Fit this to two lines (hint: see MATLAB command “polyfit”), and note the static and dynamic frictions in both directions (they will probably differ). Write the expression for F(ω).
Now that we have characterized friction, we can explore a way of negating its effects on our system.
Friction compensation is a popular topic. Friction affects all systems, and can add to or modify system dynamics, bring in noise, decrease resolution, and introduce offsets. We have implemented one method of dealing with offsets introduced by Coulomb friction – integral control. However, the dynamics of the system are still affected by friction. By considering friction as a linear function (a velocity gain and offset for each direction), we see another way of dealing with it. Since we now know the value of friction (in control units; see Equation (7) and the associated discussion on page 4) for any speed, we can let Simulink “adjust” for friction by counteracting its value as a function of speed (see Figure 5). (Tip: Keep in mind that a “Switch” block can be used to implement a conditional function.)
ECE 486 - Friction Identification Using the Reaction Wheel 10
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
ECE 486 - System Identification 12
force (for the pendulum, consider conservation of energy and for the rotor, apply Newton’s first law of motion). This helps to validate our assumption that the friction in the pendulum link is negligible, but friction in the motor is not.
We must consider one implementation detail: the signs on the inputs and outputs.
3-c Verify the signs:
With NO input to the motor, check that the sign conventions on rotor and pendulum angle are consistent with Figure 2. If not, add – signs where necessary.
Apply a POSITIVE input to the motor to check that the rotor velocity and INITIAL pendulum velocity are consistent with Equation (9), ignoring friction. If not, add –1 gains where necessary.
If any –1 signs are necessary, these are purely an implementation detail, and should not be considered as part of your controller. They will be absolutely critical however, and if you forget them, they can result in total instability of a controller that should be stabilizing. With that taken care of, there is one parameter that we still don’t know. This is ku, which gives us bp and br. By examining Equation (18), we see a way to find bp and br.
sin ( ( )) r r r
p p p r b u F
a b u F
ɺ (^) in section 2.1. If we estimate
ɺɺ (^) and
ɺɺ (^) by differentiating again and use our friction
are bp and br. Solving for them is trivial. This assumes we can reliably find the second derivative. As Error! Reference source not found. shows, the first derivative is noisy, and the second derivative is worthless. A better approach would find a polynomial fit for
values can then be put into Equation (18) to solve for the torque constants. In practice, a cubic fit of the RWP response to a step input gives good results.
ECE 486 - System Identification 13
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
k i J
k b
k i J
k b
max
max (19)
The imax 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 imax and k, giving
bp = 1. br = 198 Your results should approximately agree (within 30%).
ECE 486 - Stabilizing the Inverted Reaction Wheel Pendulum 15
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
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
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?
Table 1: Robustness Comparisons Two-State Feedback (4.2)
Three-State Feedback (4.3)
Observer (5.1) Max IC deviations
Max pulse Max disturbance
Note: Remember that the controller uses delta states, whereas the nonlinear model outputs absolute states. You will need to remove the offset(s) accordingly. As you can see, the rotor velocity stays constant at steady-state without any disturbances. However, with a constant disturbance, however small, the motor undergoes a constant acceleration to counteract it, which causes the velocity to increase without bound. Since we have a bound on velocity (there is always a bound on velocity!), this is not practical for implementation. Therefore we must feed back the rotor velocity information. This may raise a question: In simulation, if a constant u can cause velocity to become arbitrarily large, why can’t that happen in our system? Because as velocity increases, friction increases, and (u-F) decreases until friction effectively “cancels out” u!
Consider the eigenvalues of the 4-state state-space model you found in Question 4-a. The zero eigenvalues represent the rotor position and velocity. Our goal is to pull the velocity eigenvalue into the LHP, but leave the position eigenvalue alone. This will stabilize the rotor velocity, while still ignoring its position.
ECE 486 - Stabilizing the Inverted Reaction Wheel Pendulum 16
4-c Using the same constraints as 4-b, design a state feedback controller
other two LHP poles. (Hint: MATLAB “place” or “acker” may work – just keep the fourth pole at zero. This makes the fact that we’re
again. Record in Table 1 the maximum IC deviation that the system can correct, as well as the maximum tap. Use Wincon to implement this controller on the actual RWP.
If the RWP is too sensitive to be positioned and doesn’t stay up very long, check
feedback gain may be too small. Adjust the gains until you get a satisfactory response, then show it to your TA. When the RWP is successfully stabilized, you should see limit cycle behavior^3.
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.
(^3) Persistent (but not necessarily precisely) repeating behavior that does not die out is called Limit
Cycle Behavior.