This preview shows pages 1–4. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: University of California, Santa Barbara Department of Electrical & Computer Engineering ECE 147b: Digital Control Lab 3: Balancing the Inverted Pendulum Overview In this lab you will attempt to balance the inverted pendulum. The pendulum is a classic example in differential equations in general, and control systems in specific. This is due to the fact that it has two equilibria, one stable and one unstable. The stable equilibrium—when the pendulum hangs down—is not as interesting as the unstable one, but it is a lot easier to use for debugging your implementation. The ultimate objective is to get a balanced upright pendulum and this will require a good statefeedback/estimator based design. Modeling A schematic of the inverted pendulum is shown in Figure 1. You are already familiar with the motor cart. The pendulum is attached to the pivot on top of the cart and the angle measurements are obtained via a quadrature encoder, similar to the one used to obtain cart position measurements. θ p Pendulum Cart Track Figure 1: Inverted Pendulum A free body diagram of the system is shown in Figure 2, and defines the forces and moments considered below. Applying Newton’s second law to the motor cart yields m c ¨ p = F N . (1) Applying Newton’s second law to the pendulum in both the horizontal and vertical directions 2 ECE147b: Lab #3 R N P F m c g N P m p g Figure 2: Free Body Diagram for Cart/Pendulum System we obtain N = m p d 2 dt 2 ( p + l sin( θ )) = m p (¨ p + l cos( θ ) ¨ θ l sin( θ )( ˙ θ ) 2 ) (2) P m p g = m p d 2 dt 2 ( l cos( θ )) = m p g + m p l ( sin( θ ) ¨ θ cos( θ )( ˙ θ ) 2 ) . (3) Balancing the moments about the pendulum’s center of mass gives I ¨ θ = Pl sin( θ ) Nl cos( θ ) . (4) By substituting Equation 2 into Equation 1 we obtain F = ( m c + m p )¨ p + m p l cos( θ ) ¨ θ m p l sin( θ )( ˙ θ ) 2 . (5) Substituting Equations 2 and 3 into Equation 4 yields ¨ θ ( I + m p l 2 ) = m p gl sin( θ ) m p l ¨ p cos( θ ) . (6) For simplicity, define the constants M = m c + m p L = I + m p l 2 m p l . Recall that the relationship between force and voltage for the motor cart is F = K m K g Rr V K 2 m K 2 g Rr 2 ˙ p . Digital Control Design 3 Eliminating ¨ θ from Equation 5, ¨ p from Equation 6, and substituting M , L , and the equation for force yields ¨ p parenleftbigg M m p l cos 2 ( θ ) L parenrightbigg = K m K g Rr V K 2 m K 2 g Rr 2 ˙ p m p lg L cos( θ )sin( θ ) + m p l sin( θ )( ˙ θ ) 2 (7) ¨ θ parenleftbigg L m p l cos 2 ( θ ) M parenrightbigg = g sin( θ ) m p l ( ˙ θ ) 2 M cos( θ )sin( θ ) cos ( θ ) M parenleftBigg K m K g Rr V K 2 m K 2 g Rr 2 ˙ p parenrightBigg . (8) Let us define the statevector as x 1 x 2 x 3 x 4 = p ˙ p θ ˙ θ ....
View
Full
Document
This note was uploaded on 04/06/2010 for the course ECE 145 taught by Professor Rodwell during the Spring '07 term at UCSB.
 Spring '07
 RODWELL

Click to edit the document details