Chapter 25 Eample: Inverted pendulum on cart The figure to the right shows a rigid body attached by an frictionless pin (revolute joint to a cart (modeled as a particle. Thecart slides on a horizontal frictionless track. The track is fied in a ewtonian frame. Right-handed orthogonal unit vectors n, n y, n z and b, b y, b z are fied in and respectively, with: n horizontally-right and n y vertically-upward n z b z parallel to s ais of rotation in b y directed from to the distal end of Quantity Symbol Value Mass of m 0.0 kg Mass of m.0 kg Distance between and cm ( s center of mass 0.5 m s moment of inertia about cm for b z I zz 0.08333 kg m 2 Earth s gravitational constant g 9.8 m/s 2 bn measure of feedback-control force applied to F c Specified bn measure of s position vector from o (a point fied in Variable ngle from bn y to b y with bn z sense Variable 25. Kinematics (space and time Kinematics is the study of the relationship between space and time, independent of the influence of mass or forces. The kinematic quantities normally needed for motion analysis are listed below. In many circumstances, it is efficient to form rotation matrices, angular velocities, and angular accelerations before position vectors, velocities, and accelerations. Kinematic Quantity Rotation matri ngular velocity ngular acceleration Quantities needed for analyzing the inverted pendulum on a cart b R n, the rotation matri relating b, b y, b z and n, n y, n z ω, s angular velocity in α, s angular acceleration in F m a Position vectors r /o and r cm/, the position vector of from o and of cm from Velocity v and v cm, s velocity in and cm s velocity in cceleration a and a cm, s acceleration in and cm s acceleration in R r ω v α a Copyright c 992-208 Paul Mitiguy. ll rights reserved. 5 Chapter 25: Eample: Inverted pendulum on cart
25.2 Rotation matri, angular velocity, angular acceleration To relate b, b y, b z and n, n y, n z, redraw these unit vectors in the geometrically-suggestive way shown below. To determine the st row of the b R n rotation matri, b is epressed in terms of n, n y, n z as shown below. Similarly, the 2 nd and 3 rd rows of b R n are found by epressing b y and b z in terms of n, n y, n z. b y b cos( n sin( ny b y n n y b R n n n y n z b cos( sin( 0 b y b z n z b z b ngular velocity (special 2D case When a unit vector λ λ λ λ λ λ λ λ λ λ λ λ λ is fied in both reference frames and, has a simple angular velocity in that can be calculated via equation (. ω (simple ± λ λ λ λ λ λ λ λ λ λ λ λ λ ( Due to the pin joint, b z is fied a in both and, so has a simple angular velocity in. b z is a unit vector fied in both and (parallel to the pin joint n y is fied in and perpendicular to b z b y is fied in and perpendicular to b z is the angle between n y and b y,and is its time-derivative fter pointing the four fingers of your right hand in the direction of n y and curling them in the direction of b y, your thumb points in the bz direction. Since the right-hand rule produces a sign of b z that is negative: ω a vectorissaiobefied in reference frame if its magnitude is constant and its direction does not change in. ngular acceleration Equation (2 defines the angular acceleration of a reference frame in a reference frame. α also happens to be equal to the time-derivative in of ω. ote: Calculate with d ω if it is easier to compute than d ω. s angular acceleration in is most easily calculated with its alternate definition, i.e., α α d ω d ω d ( bz d ω (2 25.3 Position vectors, velocity, acceleration Position vectors are usually formed by inspection and vector addition. Inspection of the figure: ( s position vector from. Inspection of the figure: ( cm s position vector from. Vector addition: r cm/o r cm/ r /o ( cm s position vector from o Copyright c 992-208 Paul Mitiguy. ll rights reserved. 52 Chapter 25: Eample: Inverted pendulum on cart
Velocity and acceleration v cm (the velocity of a point cm in a reference frame is defined as the time-derivative in of r cm/o ( cm s position vector from o. v cm d r cm/ o d ( n ẋ n d ( n b y d ( by d ( by ω b y ẋ n 0 bz b y v cm d r cm/o (3 Point o is any point fied in a cm (the acceleration of point cm in reference frame is defined as the time-derivative in of v cm ( cm s velocity in. a cm d v cm (4 a cm d v cm d (ẋ n b d (ẋ n d ( b ẍ n d ( b ω ( b 25.4 Forces, moments, and free-body diagrams (2D To draw a free-body diagram (FD, isolate a single body (or system S of and and draw all the eternal contact and distance forces that act on it. Shown right are FDs with all the eternal forces on the cart and pendulum. a Quantity Description Type F c n measure of control force applied to Contact n y measure of the resultant normal force on from Contact R n measure of the force on from across the revolute joint Contact R y n y measure of the force on from across the revolute joint Contact m g ny measure of Earth s gravitational force on Distance m g ny measure of Earth s gravitational force on Distance F m a m g R Resultant force on : F ( R n ( m g R y n y Ry FD of Resultant force on : F R n (R y m g n y Resultant force on S: F S n [ (m m g] n y a lternately, to use the efficient MG road-map/d lembert method (Section 25.7 to eliminate constraint forces R and R y, draw a FD of the system S consisting of and (no need to draw alone. Since the revolute joint between and is ideal, action/reaction is used to minimize the number of unknowns. The b z component of the moment of all forces on about cm is a Ry m g R FD of / M z r /cm (R n R y n y 0 r cm/cm ( m g n y b y (R n R y n y [ cos(r sin(r y ] b z a ote: The rotation table to useful for calculating the cross-products (by bn and (b y bn y. Copyright c 992-208 Paul Mitiguy. ll rights reserved. 53 Chapter 25: Eample: Inverted pendulum on cart
25.5 Mass, center of mass, inertia (required by dynamics Mass of each particle and body, e.g., m (mass of particle and m (mass of body. ocation of each particle and body center of mass, e.g., r /o and r cm/. Inertia dyadic of each rigid body about a point fied on the body. Since s angular velocity in is simple, I zz ( s moment of inertia about cm for b z suffices for this analyses. F m a 25.6 ewton/euler laws of motion for and separately (inefficient n inefficient way to form this system s equations of motion is with separate analyses of and. Using F m a for particle and body [in conjunction with the previous free-body diagrams (FDs] yields, F m a (F c R n ( m g R y n y m ẍ n Dot-multiply with bn : Dot-multiply with bn y: F m a cm R n (R y m g n y m (ẍ n b 2 b y Dot-multiplication with n and n y (use the rotation table to calculate dot-products gives R m [ ẍ ( b n 2 ( b y n ] (R y m g m [ ( b n y 2 ( b y n y ] R m [ ẍ cos( 2 sin( ] ote: Separate analyses of and is less efficient than the MG road-map/d lembert method of Section 2..3 and omework 5.7. 25.6. Dynamics for a rigid body with a simple angular velocity (special 2D case Euler s equation for a rigid body with a simple angular velocity in a ewtonian reference frame is: M /cm z (20.5 I zz α R Ry m g M /cm z is the b z n z component of the moment of all forces on about cm. I zz is s moment of inertia about the line passing through cm and parallel to b z. α is s angular acceleration in. ssembling these terms and subsequent dot-multiplication with b z produces cos( R sin( R y I zz 25.6.2 Optional: ngular momentum principle (2D alternative to Section 25.6. The angular momentum principle for any system S in a ewtonian reference frame relates the moment of all forces on S about S cm to the time-derivative of S s angular momentum about S cm in. M S/Scm d S/S (20.4 When S is a rigid body, / z (the b z component of / z can be writtenintermsof I /cm zz ( s moment of inertia about cm for b z and ω. / z I /cm zz (5.3 ssembling terms in the angular momentum principle and dot-multiplication with b z produces [ ] M /cm d / bz cos( R sin( R y I zz ω Copyright c 992-208 Paul Mitiguy. ll rights reserved. 54 Chapter 25: Eample: Inverted pendulum on cart
25.6.3 Optional: ngular momentum principle (3D alternative to Section 25.6. For general 3D motion of rigid body, / canbewrittenin terms of / / / cm cm I ω I ( s inertia dyadic about cm and ω as: (5. / cm I b b I y b by I z b bz Using the general form of I with / I ω bz, yields y by b I yy by by I yz by bz ( bz / (shown right I z bz b I yz bz by I zz bz bz whose time-derivative in is given below. I z b I yz by I zz bz d / (I yz 2 I z b (I z 2 I yz by I zz bz ssembling terms in the angular momentum principle and dot-multiplication with b z produces [ M /cm d / ] bz cos( R sin( R y (5. I zz ote: d / has non-zero b and b y terms. Dot-multiplication of / M d / Λ with b (5. or b y requires a three-dimensional (3D free-body diagram (FD. This problem s FDs in Section 25.4 were two-dimensional (2D and ignored the b and b y measures of the torque on from that constrain s rotational motion to solely about b z.the FDs also ignored the bn z measure of the force on from across the revolute joint. on-zero b and b y constraint torque measures arise due to terms associated with 2,, and products of inertia I z and I yz. Summary of ewton/euler equations of motion (inefficient F c R m ẍ m g R y 0 R m [ẍ cos( 2 sin(] (R y m g m [ sin( 2 cos(] cos( R sin( R y I zz There are 5 unknown variables in the previous set of equations, namely R, R y,,,. ote: Once (t isknown, (t and (t are known. Similarly, once (t isknown,ẋ(t andẍ(t areknown. 25.7 Equations of motion via MG road-maps/d lembert (efficient For various purposes (e.g., control system design, it is useful to eliminate the unknown constraint forces R, R y,. lthough tedious linear-algebra can reduce the previous set of 5 equations in 5 unknowns to 2 equations in 2 unknowns (ẍ,, itismore efficient to use MG road-maps (Section 2..3 or the methods of agrange (Section 25.9 or Kane (Section 25.0 as they automatically eliminate R, R y,. Translate/ Direction System FD bout Variable Rotate (unit vector S of S point MG road-map equation Draw ot applicable ( (20. Draw ( (20.4 ote: m S a Scm m a m a cm (.3 and d /... (20.5 w 5.7 and Chapter 25 complete these calculations. I / zz α m r cm/ a. MG road-map for F c (m m ẍ m cos( m sin( 2 MG road-map for m g sin( m cos(ẍ (I zz m 2 Copyright c 992-208 Paul Mitiguy. ll rights reserved. 55 Chapter 25: Eample: Inverted pendulum on cart
25.8 Generalized forces for agrange/kane s equations of motion s described in Section 26.4, generalized forces depend on forces and partial velocities. Partial velocities are calculated for each generalized coordinate/speed. For agrange s method, anatural choice of generalized coordinates is q r,. Kane s method uses analogous generalized speeds u r ẋ,. The relevant partial velocities are determined by inspection of velocity epressions. Velocity Partial velocities for u r q r Symbol q r ẋ q r v ẋ n s partial velocity in for q r v q r n 0 v cm ẋ n b v cm cm s partial velocity in for q r n q b r Generalized forces are calculated for a system (not with free-body diagrams. It can be seen that certain forces do not contribute to generalized forces. For this system, the ground s normal force (, gravity force on (m g, and pin force on from (R n R y n y do not contribute to generalized forces. Generalized force for ẋ Fẋ F c n v (26.8 ẋ Generalized force for F F c n v (26.8 m g n y v cm ẋ m g n y v cm ote: Section 25.6 analyzed this system using separate free-body diagrams of and and generated 5 equations and 5 unknowns (ẍ,, R, R y,. The agrange/kane generalized forces automatically eliminate the constraint forces R, R y,, reducing the unknowns to only (t and(t. 25.9 agrange s equations of motion (described in Chapter 27 agrange s equations of motion for the generalized coordinates and are calculated using the generalized forces F r in Section 25.8 and the kinetic energy below. F r (27. d K qr K q r F c (m m ẍ m [ cos( sin( 2 ] m g sin( m cos(ẍ (I zz m 2 Kinetic energy of inverted pendulum on cart Since is a particle, its kinetic energy is defined in equation (0.6 as K (0.6 2 m v v 2 m ( ẋ n (ẋ n 2 m ẋ 2 Since is a rigid body with a simple angular velocity, its kinetic energy can be calculated with equation (5.6 as K (5.6 2 m v2 2 I ω2 ( 2 m ẋ n b (ẋ n b 2 I zz 2 2 m [ ẋ 2 2 ẋ cos( ( 2 ] 2 I zz 2 S s kinetic energy in is the sum of and s kinetic energy, i.e., K S K K 2 m ẋ 2 2 m [ ẋ 2 2 ẋ cos( ( 2 ] 2 I zz 2 Copyright c 992-208 Paul Mitiguy. ll rights reserved. 56 Chapter 25: Eample: Inverted pendulum on cart
25.0 Kane s equations of motion (described in Chapter 26 Kane s equation of motion for the generalized speeds ẋ and are calculated using the generalized forces F r in Section 25.8 and the generalized effective forces F S r (r ẋ, below. F r (26. F S r F c (m m ẍ m [ cos( sin( 2 ] m g sin( m cos(ẍ (I zz m 2 Generalized effective forces for inverted pendulum on cart Generalized effective forces depend on effective force and partial velocities/angular velocities, and are calculated by summing the contribution of each particle or body in the system. Particle s generalized effective forces for the generalized speeds u r ẋ, are F r v Q F (26.7 (0.?? v (m a (ẋ n (m ẍ n { F Ȧ m ẍ F Ȧ 0 Rigid body s generalized effective forces for the generalized speeds u r ẋ, are Fr v cm ω F (26.9 M / cm v cm m ( ẍ n b 2 by F Ḃ m [ẍ cos( sin( 2 ] (5.??, 5.?? v cm (m a cm ω ω ( Izz bz F Ḃ m cos(ẍ (I zz m 2 (I zz α The system S s generalized effective forces for the generalized speeds u r ẋ, are Fr S Fr Fr (26.8 F Ṡ (m m ẍ m [ cos( sin( 2 ] F Ṡ m cos(ẍ (I zz m 2 25. Matri form of equations of motion (for solution, controls,... For numerical solution and various control-systems techniques, it can be useful to write this system s nonlinear equations of motion in matri form as [ ] [ [ ] m m m ][ẍ ] [ cos( m 0 m cos( I zz m 2 sin( 2 ] m g sin( Copyright c 992-208 Paul Mitiguy. ll rights reserved. 57 Chapter 25: Eample: Inverted pendulum on cart