Dynamics (MIT 16.07) - Lecture 5: Mass Matrix and Manipulator Equation
Overview
Prof. Zac Manchester derives the cart-pole equations with generalized coordinates for cart position and pendulum angle, then reorganizes them into the manipulator equation, M(q)q̈ + C(q,q̇) + G(q) = Q. He explains how the mass matrix encodes kinetic energy and can be constructed from forward kinematics and a Jacobian, then begins deriving the rotating-frame velocity relation using a spinning record and an ant.
Key takeaways
- The cart-pole’s two coupled Euler–Lagrange equations are nonlinear in position and velocity but linear in acceleration, so simulation can solve a linear system for q̈ at each step.
- The manipulator equation separates dynamics into M(q)q̈, velocity-dependent Coriolis terms C(q,q̇), potential-derived terms G(q), and generalized input Q.
- Kinetic energy has the quadratic form T = ½q̇ᵀM(q)q̇, which makes the mass matrix symmetric and positive definite for a nondegenerate system.
- For point masses, the generalized-coordinate mass matrix follows from forward kinematics as M(q) = J(q)ᵀM̄J(q), where M̄ is constant in Cartesian coordinates.
- A generic dense solve for accelerations scales as O(n³), while Featherstone’s algorithm achieves linear-time dynamics computation for systems without closed loops.
- For a point fixed in a rotating body frame, inertial velocity comes from frame rotation and is described by v = ω × r; the rotation matrix mapping body components to inertial components varies with time.
Chapters
- Recaps generalized coordinates as problem-specific coordinates that need not be Cartesian.
- Explains that ideal constraint forces do no work because they are orthogonal to allowed motion.
- Connects D’Alembert’s principle to the coordinate-independent Euler–Lagrange equations.
- Models a cart carrying a pendulum, with cart position x_c and pendulum angle θ as the two generalized coordinates.
- The only control input is horizontal force F_c on the cart; the pendulum joint has no direct actuator.
- Identifies the system as underactuated, motivating its use for balancing and swing-up control.
- Writes the pendulum mass position as x_p = x_c + L sin θ and y_p = L cos θ.
- Differentiates those positions to obtain velocities, including the cart-pendulum coupling in ẋ_p.
- Forms gravitational potential energy from the pendulum height and kinetic energy from both cart and pendulum motion.
- Simplifies the kinetic energy using sin²θ + cos²θ = 1, exposing cart translation, pendulum rotation, and a cross-coupling term.
- Constructs the Lagrangian as kinetic energy minus gravitational potential energy.
- Applies the Euler–Lagrange equation separately to x_c and θ, using cart force as the generalized input and zero applied pendulum torque.
- The resulting equations are nonlinear, with trigonometric terms and coupling between cart and pendulum motion.
- For upright balancing, a common control approach is to linearize the equations around the equilibrium.
- For nonlinear simulation, the key observation is that the equations remain linear in the accelerations, so the coupled acceleration terms can be solved as a linear system.
- Repackages the equations as M(q)q̈ + C(q,q̇) + G(q) = Q.
- Defines M(q) as the mass matrix, dependent on configuration but not velocity; C collects Coriolis terms, and G collects potential-derived forces such as gravity.
- Solves for accelerations by moving C and G to the right-hand side and solving the mass-matrix system.
- A generic dense solve involving an n-dimensional mass matrix costs O(n³); doubling n can make the solve roughly eight times as expensive.
- The cost is negligible for the two-degree-of-freedom cart-pole but matters for large articulated or discretized systems.
- Featherstone’s algorithm can compute dynamics in linear time with the number of degrees of freedom for systems without closed loops.
- Some software packages combine gravity and velocity-dependent terms into a single dynamic-bias vector, often still labeled C.
- Expresses kinetic energy compactly as T = ½ q̇ᵀM(q)q̇.
- Because kinetic energy is nonnegative, the mass matrix is symmetric and positive definite for a nondegenerate system.
- The eigenvalues of a symmetric mass matrix are real; positive definiteness ensures positive kinetic energy for nonzero generalized velocity.
- Stacks the Cartesian positions of point masses into a vector R(q), mapped from generalized coordinates by forward kinematics.
- Differentiates the mapping to get Ṙ = J(q)q̇, where J(q) is the kinematic Jacobian.
- For the cart-pole, the stacked Cartesian positions include the cart and pendulum coordinates, while q contains only x_c and θ.
- In Cartesian coordinates, point-mass kinetic energy uses a constant mass matrix M̄, assembled from each mass times an identity matrix of the appropriate dimension.
- Substituting Ṙ = J(q)q̇ into the Cartesian kinetic-energy expression gives M(q) = J(q)ᵀM̄J(q).
- This Jacobian-based recipe converts constant Cartesian mass into a configuration-dependent generalized-coordinate mass matrix.
- For hand derivations, Zac Manchester recommends finding energies and applying Euler–Lagrange equations directly.
- For code, the Jacobian construction provides a reusable route from generalized coordinates to the mass matrix.
- Dynamics toolboxes commonly expose quantities such as M, J, C, and G, then solve the mass-matrix system to return accelerations.
- Rotating reference frames arise in aircraft dynamics, spacecraft attitude dynamics, and inertial navigation using IMUs.
- In orbit mechanics, the circular restricted three-body problem becomes more manageable in a frame rotating with the primary bodies.
- Introduces a record spinning at angular velocity ω about the z-axis as a planar example.
- Defines an inertial N frame fixed in the lab and a body B frame whose basis vectors rotate with the record.
- The ant’s position vector can be represented by components in either frame, with a rotation matrix mapping B-frame components into N-frame components.
- Because the record rotates, the B-to-N rotation matrix depends on time.
- When the ant stands still relative to the record, its B-frame position has zero time derivative.
- Differentiating the rotation-matrix expression for position gives the ant’s N-frame velocity from the changing frame orientation.
- Relates this velocity to the familiar inertial-frame expression v = ω × r, then rewrites ω and r using body-frame components.
- Equates the differentiated position relation with the ω × r expression to connect the rotation-matrix derivative to angular velocity.
- The derivation has not yet reached its final general form when the lecture pauses.
- The next step is to develop the rotating-frame derivative relation beyond the stationary-ant example.
Transcript excerpt
0:00 All right. So, what did we talk about last time? Last time we talked a little bit about generalized coordinates, which is really just anything that isn't cartisian that we want to make up and use in our lrangeian stuff. Then we talked about work, which is basically like the amount of change in kinetic energy that you get from an applied force. The idea being that uh forces only generate work if they're lined up with the velocity of the system and therefore constraint forces which are always by definition orthogonal to the velocity because you're not allowed to move in the direction of the constraint do no work. That sort of that setup got us to
0:50 Dumbbear's principle which basically is a little trick where we have this like weird virtual displacement thing that's basically getting at the fact that constraints do no work and is kind of the rigorous theoretical justification for then ignoring constraint forces. We we had this like f equals m a term and then this virtual displacement thing that's telling you you're only allowed to move in the unconstrained directions and we put that together did a little calculus magic and got out the famous oil lrange equation and I can't spell which is really just the coordinate invariant version of f= ma it's f= ma in arbitrary coordinates we got this by
1:36 plugging in some coordinate transformation stuff massaging doing some weird derivative tricks to get it into a form that was in terms of like derivatives of the kinetic energy. Then we argue that kinetic energy is a scaler. So you could write it any coordinates and then we got this coordinate free expression that's just in terms of these generalized coordinates that's valid in any coordinates you want to write down. Very
This is the start of the transcript. Save this video free for the whole transcript, searchable and time-coded.
In this course
Related notes
Summary, takeaways, and chapters were generated by AI from the video's transcript and may contain errors. The video belongs to its creator, MIT Robotic Exploration Lab.