lab3_v2

# lab3_v2 - University of California Santa Barbara Department...

This preview shows pages 1–4. Sign up to view the full content.

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 state-feedback/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

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
2 ECE147b: Lab #3 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 state-vector as x 1 x 2 x 3 x 4 = p ˙ p θ ˙ θ . We can linearize the system about the equilibrium [0 0 0 0] T . Note that θ = 0 corresponds to the pendulum being upright. You should check that this is indeed an equilibrium for the cart/pendulum system. The linearization is δ ˙ x 1 δ ˙ x 2 δ ˙ x 3 δ ˙ x 4 = 0 1 0 0 0 - 1 M - mpl L K 2 m K 2 g Rr 2 - gm p l L M - mpl L 0 0 0 0 1 0 1 M L - mpl M K 2 m K 2 g Rr 2 g L - mpl

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern