EE 476 - Homework 3 Due Date: 03 / 30 / 2015 Spring 2015 Exercise 1 (10 points). Consider the problem of two pulleys and a mass discussed in class. We solved a version of the problem where the mass was attached to the first pulley through a spring with stiffness constant k. Derive the differential equations using the Lagrangian method for the above system assuming the string connecting the two pulleys is elastic with spring constant k 2. In class we required 2 generalized coordinates to specify the system. You should now require 3 generalized coordinates as the pulley angles are no longer related to each other through a scaling ratio as shown in class. Solution. Let the displacement of the mass be x, rotation of first pulley connected to the mass be θ 1 and rotation of second pulley where we apply the torque be θ 2. Let the mass be m, and J 1 and J 2 be moments of inertia of the pulleys. Let the radii of the two pulleys be r 1 and r 2 respectively. Let the spring constant of the spring between mass and pulley 1 be k 1 and spring constant between pulley 1 and pulley 2 be k 2. The kinetic energy of the system is given by The potential energy of the system is given by The Lagrangian is then given by K.E. = 1 2 mẋ2 + 1 2 J 1 θ 2 1 + 1 2 J 2 θ 2 2 P.E. = mgx + 1 2 k 1 (x r 1 θ 1 ) 2 + 1 2 k 2 (r 1 θ 1 r 2 θ 2 ) 2 L = K.E. P.E. = 1 2 mẋ2 + 1 2 J 1 θ 2 1 + 1 2 J 2 θ 2 2 mgx 1 2 k 1 (x r 1 θ 1 ) 2 1 2 k 2 (r 1 θ 1 r 2 θ 2 ) 2 The generalized coordinates for this system are x, θ 1 and θ 2. The only external generalized force is applied to pulley 2 and given by τ. Hence the Lagrangian equations of motion are given as follows L dt ẋ x = 0 mẍ + mg + k 1 x k 1 r 1 θ 1 = 0 (1) L = 0 dt θ 1 θ 1 J 1 θ 1 + k 1 r 1 θ 1 k 1 x + k 2 r 1 θ 1 k 2 r 2 θ 2 = 0 (2) L = τ dt θ 2 θ 2 J 2 θ 2 + k 2 r 2 θ 2 k 2 r 1 θ 1 = τ (3) 1
This gives the differential equations as mẍ = k 1 x + k 1 r 1 θ 1 mg (4) J 1 θ 1 = (k 1 + k 2 )r 1 θ 1 + k 1 x + k 2 r 2 θ 2 (5) J 2 θ 2 = k 2 r 2 θ 2 + k 2 r 1 θ 1 + τ (6) Exercise 2 (20 points). An inextensible string of length l is fixed at one end and a bob of mass m is attached at another. The bob springs freely in R 3 but the string remains taut. Find the Lagrangian for the system and write down the equations of motion using spherical coordinates (r,θ,φ). Solution. Let the polar coordinates by given by r = l, θ be the angle with respect to the vertical z-axis and φ be the angle with respect to the horizontal x-axis. Let the cartesian coordinates of the sphere be (x,y,z) with origin at the point where string is attached. These are expressed in polar coordinates (l,θ,φ) as x = l sinθ cosφ, y = l sinθ sinφ, z = l cosθ. This gives us ẋ = l cosθ cosφ θ l sinθ sinφ φ, ẏ = l cosθ sinφ θ + l sinθ cosφ φ, ż = l sinθ θ Thus the kinetic energy of the system is given by K.E. = 1 2 mẋ2 + 1 2 mẏ2 + 1 2 mż2 = 1 2 ml2 θ 2 + 1 2 ml2 sin 2 θ φ 2 A direct way to obtain this kinetic energy is to consider the rotational kinetic energy about the point where the string is attached and rotate in the x-z-plane (energy due to θ rotation) and the rotational kinetic energy about the z-axis to rotate in the x-y-plane (energy due to φ rotation). The rotational kinetic energy in the x-z-plane is 1 2 ml2 θ 2. Distance of mass from the z-axis is l sinθ. Hence rotational kinetic energy about the z-axis is 1 2 m(l sinθ)2 φ 2. This gives the total kinetic energy as K.E. = 1 2 ml2 θ 2 + 1 2 ml2 sin 2 θ φ 2 Assuming the zero potential level to be the point where the string is attached, the potential energy is given by P.E. = mgl cosθ This gives the Lagrangian as L = 1 2 ml2 θ 2 + 1 2 ml2 sin 2 θ φ 2 + mgl cosθ 2
The generalized coordinates for this Lagrangian are θ and φ. There are no external forces applied on the system. Hence we get the equations of motion as L dt θ θ = 0 This gives us ml 2 θ ml 2 sinθ cosθ φ 2 + mgl sinθ = 0 L dt φ φ = 0 ml 2 sin 2 θ φ + 2ml 2 sinθ cosθ θ φ = 0 θ = 1 2 sin(2θ) φ 2 g l sinθ φ = 2cotθ φ θ (a) Motor Circuit (b) Motor & propeller (c) Motor & Propeller & Load Figure 1: Motor Circuit and Physical Setup Exercise 3 (30 points). Assume that we attach a propeller to a DC motor. See Figure 1(a) and 1(b). The motor is fixed to a small platform, and this platform is then attached to a larger load mass via a semi-flexible link. See Figure 1c. Assume that the load mass only moves in the up/down (z) direction for simplicity (i.e. only the motor+propeller rotate). Also assume the following: The motor inductance is negligable, i.e. L = 0. The motor torque is Q m = k v (i i 0 sgn(ω)) where i 0 is what is often times called zero-load current. The motor back-emf voltage is given by V em f = k v ω. The motor and propeller have combined moment of inertia J. The motor and propeller and small platform have mass m, while the load mass is M. 3
The semi-flexible link can be represented as a typical spring and damping using k and c respectively. The thrust produced by the propeller is given by T = k t ω 2. The torque generated by the propeller drag is Q p = k d ω 2. The acceleration of gravity is g and pointing down in Figure 1c 1. Using the Lagrangian methodology, derive the nonlinear differential equations governing the system dynamics. 2. Find the input voltage V to reach equilibrium with zero load velocity, essentially hovering. Is it possible to reach an equilibrium with all states zero? Explain. 3. Linearize the system around equilibrium. Assume full state measurement and provide the A, B,C, D matrices. Solution. Applying Kirchoff s Law to the circuit and neglecting L we obtain This gives V = ir +V em f = ir + k v ω i = 1 R V k v R ω The equation for the motor dynamics based on Newton s laws is given by J ω = Q m }{{} Motor circuit torque Substituting Q m = k v (i i 0 sgnω) and Q p = k d ω 2 we get Q p }{{} Propeller drag ω = k v J (i i 0 sgnω) k d J ω2 = k v JR V k2 v JR ω k vi 0 J sgn(ω) k d J ω2 We now model the equations of motion for the mass and the platform using Lagrangian method. Let the displacement of the mass be x m and of the platform be x p. Then the kinetic energy of the system is K.E. = 1 2 Mẋ2 m + 1 2 mẋ2 p Let the unextended length of the spring be l. The potential energy is given by P.E. = Mgx m + mgx p + 1 2 k (x p x m l) 2 The Lagrangian is given by L = 1 2 Mẋ2 m + 1 2 mẋ2 p Mgx m mgx p 1 2 k (x m x p ) 2 4
The external force on the mass M comes from the damping force f damp = c(ẋ p ẋ m ) in the upward direction and the normal force from the ground N (Normal force is zero if system is not in contact with ground). The external force on the platform comes from the propeller thrust T = k t ω 2 in the upward direction and the damping force f damp = c(ẋ p ẋ m ) in the downward direction. All displacements are positive in the upward direction. We can now write the equations of motion for the generalizedc coordinates x m and x p as L = f damp + N dt ẋ m x m Mẍ m + Mg + k(x m x p + l) = c(ẋ p ẋ m ) + N L = T f damp dt ẋ p x m mẍ p + mg + k(x p x m l) = T c(ẋ p ẋ m ) = k t ω 2 c(ẋ p ẋ m ) Thus the nonlinear differetial equations for the system dynamics are given by ω = k v JR V k2 v JR ω k vi 0 J sgn(ω) k d J ω2 ẍ p = c mẋp + c mẋm k m x p + k m x m + k t m ω2 + k m l g ẍ m = c M ẋp c M ẋm + k M x p k M x m k M l g + N M It is not possible to reach an equilibrium with all states zero as the spring may prevent x p from becoming zero. With V = ω = x m = ẋ m = ẋ p = 0 we get x p = l mg k, N = kl kx p + Mg = (M + m)g If the spring is very stiff (k is very large) we get x p l. Also if k mg l (loose spring) we have x p = 0 and N = kl + Mg as the ground level is zero and the mass cannot be lower than that. We now find other equilibrium points. Let the equilibrium voltage be V. Suppose this makes the propeller rotate with positive ω (This means sgn(ω) = 1). Furthermore, at equilibrium, ω = 0. This gives us 0 = k v JR V k2 v JR ω k vi 0 J k d J ω2 = k d Rω 2 + kvω 2 + (k v i 0 R k v V ) = 0 This gives equilibrium ω as a function of the voltage V as ω = k2 v 2k d R ± 1 ( k 4 2k d R v 4k d R(k v i 0 R k v V ) ) 1 2 For ω to be positive, we must at least provide V i 0 R. For zero load velocities, at equilibrium we have ẋ p = 0 and ẋm = 0. Let the equilirbium positions be x p and x m. Also we have equilibrium normal force is N = 0 as the system is in hover mode with no contact with ground. At equilibrium ẍ p = 0 and ẍm = 0. Hence we get x p xm = k t k (ω ) 2 + l mg k 5
Exercise 4 (40 points). We model and control a two wheeled robot in this example. This system is a special case of the pendulum on a cart example, where the idea is to balance a pendulum in an upright position using the motion of the cart. A real world example of this machine would be a Segway personal transporter revealed by Dean Kamen in 2001. For the purpose of this project, we make the following simplifying assumptions on the system - Both the wheels on the robot are considered as a single unit rigid body and the machine travels in a straight line. The body of the robot is approximated as a rigid point mass attached at a distance L from the wheels. The wheels never loose contact with the ground. The electrical and mechanical losses in the system are to be neglected. The dynamics of the electric motor are neglected as they take place at a faster time scale than the mechanical system dynamics. The angular displacement and angular velocity of the body are small to allow for linearization and neglecting centrifugal force, respectively. The system with these assumptions is shown in Fig. 2. System parameters: m 1 = 2, m 2 = 3.5, I 1 = 0.32, I 2 = 0.0065, L = 0.4, r = 0.061, b = 0.001 Figure 2: Schematic for 2-Wheeled Robot 7
1. Use the Lagrangian method to show the equations of motion for the two wheeled robot, with external torque τ and friction torque τ loss, are given by In the above equations, we have H 1 θ 1 + H 3 θ 2 m 2 rlsin(θ 2 ) θ 2 2 = τ τloss, (7) H 3 θ 1 + H 2 θ 2 m 2 glsin(θ 2 ) = τ + τ loss. (8) H 1 = (m 1 + m 2 )r 2 + I 1, H 3 = m 2 rlcos(θ 2 ), H 2 = m 2 L 2 + I 2. (9) 2. Assuming τ loss proportional to relative angular velocity with proportionality constant b, write down a state space model for the system with input τ and find the equilibrium points. 3. Linearize the system at the equilibrium point θ 1 = 0,θ 2 = 0, θ 1 = 0, θ 2 = 0,τ = 0 and write the linearized equations in the state space form. 4. What can you say about the stability of the linear system. Solution. The horizontal position of the wheel is given by x = rθ 1. The location of the mass m 2 is given by (x 2,y 2 ). These are given by This gives The kinetic energy of the system is given by x 2 = x + Lsinθ 2 = rθ 1 + Lsinθ 2, y 2 = r + Lcosθ 2 ẋ = r θ 1, ẋ 2 = r θ 1 + Lcosθ 2 θ 2, ẏ 2 = Lsinθ 2 θ 2 K.E. = 1 2 I 1 θ 2 1 + 1 2 m 1ẋ 2 + 1 2 I 2 θ 2 2 + 1 2 m 2ẋ 2 2 + 1 2 m 2ẏ 2 2 = 1 2 The potential energy is given by ( I1 + (m 1 + m 2 )r 2) θ 2 1 + 1 2 P.E. = m 1 gr + m 2 g(r + Lcosθ 2 ) We now construct the Lagrangian as L = K.E. P.E. given by L = 1 2 ( I1 + (m 1 + m 2 )r 2) θ 2 1 + 1 2 ( I2 + m 2 L 2) θ 2 2 + m 2 rlcosθ 2 θ 1 θ 2 ( I2 + m 2 L 2) θ 2 2 + m 2 rlcosθ 2 θ 1 θ 2 m 1 gr m 2 g(r + Lcosθ 2 ) We now apply the Lagrangian method to solve this with external torque on the wheel being τ τ loss and on the mass m 2 is τ + τ loss. Applying the Lagrangian method we get H 1 θ 1 + H 3 θ 2 m 2 rlsin(θ 2 ) θ 2 2 = τ τloss, (10) H 3 θ 1 + H 2 θ 2 m 2 glsin(θ 2 ) = τ + τ loss. (11) 8