The equations of motion for a standard robot can be derived using the
method of Lagrange. Using $T$ as the total kinetic energy of the system,
@@ -70,15 +70,33 @@
Without going into the full details, the key idea for handling
+ constraints is the "principle of virtual work" (and the associated
+ D'Almbert's principle). To describe even a pendulum at equilibrium in the
+ Newtonian approach, we would have to compute both external forces (like
+ gravity) and internal forces (like the forces keeping the pendulum arm
+ attached to the table), and have their sum equal zero. Computing internal
+ forces is slightly annoying for a pendulum; it becomes untenable for more
+ complex mechanisms. If the sum of the forces equals zero, then the work done
+ by those forces in some (infinitesmal) virtual displacement is certainly
+ also equal to zero. Now here is the trick: if we consider only virtual
+ displacements that are consistent with the kinematic constraints (e.g.
+ rotations around the pin joint of the pendulum), then we can compute that
+ virtual work and set it equal to zero without ever computing the internal
+ forces! Extending this idea to the dynamics case (via D'Almbert's and
+ Hamilton's principles) results eventually in the Lagrangian equations
+ above.
If you are not comfortable with these equations, then any good book
- chapter on rigid body mechanics can bring you up to speed -- try Craig89
- for an excellent practical guide to robot kinematics/dynamics. Lanczos70
- is my favorite exposition, by far, of variational mechanics; I highly
- recommend it if you want something more. But it's also ok to continue on
- for now thinking of Lagrangian mechanics simply as a recipe than you can
- apply in a great many situations to generate the equations of motion.
+ chapter on rigid body mechanics can bring you up to speed.
+ Craig89 is an excellent practical guide to robot
+ kinematics/dynamics. But Lanczos70 is my favorite mechanics
+ book, by far; I highly recommend it if you want something more. It's also ok
+ to continue on for now thinking of Lagrangian mechanics simply as a recipe
+ than you can apply in a great many situations to generate the equations of
+ motion.
For completeness, I've included a derivation of the Lagrangian from the
diff --git a/sysid.html b/sysid.html
index b3350aa8..b72e860a 100644
--- a/sysid.html
+++ b/sysid.html
@@ -88,7 +88,7 @@
We often separate the identification procedure into two parts, were we
first estimate the state $\hat{\bx}_n$ given the input-output data $\bu_n,
\by_n$, and then focus on estimating the state-evolution dynamics in a
@@ -128,14 +128,14 @@
Many of the techniques below can benefit from some basic data
preprocessing techniques. The MATLAB
System Identification Toolbox documentation has some useful advice
(with emphasis on the fitting of linear models).
Small kinematic calibration errors can lead to large steady-state
errors when attempting to stabilize a system like the Acrobot. I've put together a simple notebook to show the effect here:
The now familiar equations of motion for the simple pendulum are
$$ml^2 \ddot\theta + b \dot\theta + mgl\sin\theta = \tau.$$ For
parameter estimation, we will factor this into $$\begin{bmatrix}
\ddot\theta & \dot\theta & \sin\theta \end{bmatrix} \begin{bmatrix}
ml^2 \\ b \\ mgl \end{bmatrix} - \tau = 0.$$ The terms $ml^2$, $b$,
and $mgl$ together form the "lumped parameters".
-
+
It is worth taking a moment to reflect on this factorization. First
@@ -274,7 +274,7 @@
This is super interesting! It is tempting to thing about parameter
estimation for general dynamical systems in our standard state-space
form: $\bx[n+1] = f_\balpha(\bx[n], \bu[n]).$ But for multibody systems,
@@ -282,14 +282,14 @@
Very few robotics simulators have any way for you to access the
parameters of the dynamics. In Drake, we explicitly declare all of the
parameters of a multibody system in a separate data structure to make
them available, and we can leverage Drake's symbolic engine to extract
and manipulate the equations with respect to those variables.
-
+
As a simple example, I've loaded the cart-pole system model from
URDF, created a symbolic version of the MultibodyPlant,
and populated the Context with symbolic variables for the
@@ -303,7 +303,7 @@
Underactuated Robotics
Note that we could have easily made the fit more accurate with more
- data (or more carefully selected data).
+ data (or more carefully selected data).
Identification using energy instead of inverse
dynamics.
-
+
In addition to leveraging tools from linear algebra, there are a
number of other refinements to the basic recipe that leverage our
understanding of mechanics. One important example is the "energy
@@ -415,7 +415,7 @@
Why might we prefer to work in energy coordinates rather than torque?
The differences are apparent in the detailed numerics. In the torque
formulation, we find ourselves using $\ddot\bq$ directly. Conventional
@@ -469,13 +469,13 @@
Underactuated RoboticsLASSO
for least-squares regression with an $\ell_1$-regularization, or
- Brunton16a use an alternative based on
+ Brunton16a uses an alternative based on
sequential thresholded least-squares.
Experiment design as a trajectory optimization
-
+
One key assumption for any claims about our parameter estimation
algorithms recovering the true identifiable lumped parameters is that the
data set was sufficiently rich; that the trajectories were
@@ -500,11 +500,11 @@
The field of adaptive control is a huge and rich literature; many
books have been written on the topic (e.g Åström13). Allow
me to make a few quick references to that literature here.
@@ -522,7 +522,7 @@
Underactuated RoboticsMoore14 gives a nice example
of analyzing an adaptive controller for underactuated systems using many
of the tools that we have been developing in these notes.
-
+
As I said, adaptive control is a rich subject. One of the biggest
lessons from that field, however, is that one may not need to achieve
convergence to the true (lumped) parameters in order to achieve a task.
@@ -541,15 +541,15 @@
One can also study cases where the contact forces are not measured
directly. For instance, Fazeli17a studies the extreme case
of identifiability of the inertial parameters of a passive object with
and without explicit contact force measurements.
Flesh this out a bit more... (maybe move it to the hybrid sysid subsection?)
-
+
I've provide a notebook demonstrating what a practical application
of linear identification might look like for the cart-pole system, in a
series of steps. First, I've designed an LQR balancing controller, but
@@ -636,17 +636,17 @@
-
+
Local time-varying linear model along a trajectory + iLQR. Bregmann ADMM
The Hydrodynamic Cart-Pole
-
+
One of my favorite examples of model-based ILC was a series of
experiments in which we explored the dynamics of a "hydrodynamic
cart-pole" system. Think of it as a cross between the classic
cart-pole system and a fighter jet (perhaps a little closer to the
- cartpole)!
-
+ cartpole)!
+
Here we've replaced the pole with an airfoil (hydrofoil), turned
the entire system on its side, and dropped it into a water tunnel.
Rather than swing-up and balance the pole against gravity, the task
@@ -658,7 +658,7 @@
Underactuated Robotics
+ width="25%" src="data/hydro_cartpole_upright.png">
A cartoon of the hydronamic cart-pole system. The cart
is actuated horizontally, the foil pivots around a passive joint,
and the fluid is flowing in the direction of the arrows. (The
@@ -669,7 +669,7 @@
From input-output data (the state-realization problem)
-
+
In the more general form, we would like to estimate a model of the
form \begin{gather*} \bx[n+1] = \bA \bx[n] + \bB \bu[n] + \bw[n]\\ \by[n]
= \bC \bx[n] + {\bf D} \bu[n] + \bv[n]. \end{gather*} Once again, we
@@ -805,7 +805,7 @@
If you've studied linear systems, ${\bf G}$ will look familiar; it is
precisely this (multi-input, multi-output) matrix impulse response, also
known as the "Markov parameters". In fact, estimating $\hat{\bf
@@ -833,7 +833,7 @@
Underactuated RoboticsBrunton19 and which orders the states in terms of diminishing
effect on the input/output behavior. This ordering is relevant for
determining the system order and for model reduction.
-
+
Note that $\hat{\bf D}$ is the last block in $\hat{\bf G}$ so is
extracted trivially. The Ho-Kalman algorithm tells us how to extract
$\hat\bA, \hat\bB, \hat\bC$, with another application of the SVD on
@@ -844,7 +844,7 @@
Underactuated RoboticsDoes using the Kalman filter states allow me to use colored input excitation?
Ho-Kalman identification of the cart-pole from keypoints
-
+
Let's repeat the cart-pole example. But this time, instead of
getting observations of the joint position and velocities directly, we
will consider the problem of identifying the dynamics from a camera
@@ -914,7 +914,7 @@
-
+
identify observer/Kalman filter markov parameters (aka OKID) from
Juang93, also in Juang95 section 10.7, Brunton19, VanOverschee96, etc.
Inspiration is similar to Simchowitz and Boczar; we'd expect the Kalman
@@ -924,10 +924,10 @@
There is one more case that we can understand well: when states,
actions, and observations (and time) are all discrete. Recall that in the
very beginnings of our discussion about optimal control and Underactuated RoboticsIntroduce the transition matrix better in the DP chapter, and make
the notation consistent (in the DP section, I have T transposed).
-
+
From state observations
Following analogously to our discussion on linear dynamical systems,
@@ -1007,7 +1007,7 @@
If multibody parameter estimation, linear system identification, and
finite state systems are the first pillars of system identification, then
(at least these days) deep learning is perhaps the last major pillar. It's
@@ -1039,14 +1039,14 @@
One extremely interesting question that arises when fitting rich
nonlinear models like neural networks is the question of how to generate
the training data. You might have the general sense that we would like
data that provides some amount of "coverage" of the state space; this is
particularly challenging for underactuated systems since we have dynamic
- constraints restricting our trajectories in state space.
-
+ constraints restricting our trajectories in state space.
+
For multibody parameter estimation we
discussed using the condition number of the data matrix as an
explicit objective for experiment design. This was a luxury of using
@@ -1058,8 +1058,8 @@
This topic has received considerable attention lately in the context
of model-based reinforcement learning (e.g.
Agarwal20b). Broadly speaking, in the ideal case we would
@@ -1071,7 +1071,7 @@
In this exercise we will use physically-inspired basis functions to fit the nonlinear dynamics of a perching glider. In this python notebook, you will need to implement least-squares fitting and find the best set of basis functions that describe the dynamics of the glider. Take the time to go through the notebook and understand the code in it, and then answer the following questions. The written question will also be listed in the notebook for your convenience.
@@ -1163,7 +1163,7 @@
Underactuated RoboticsAll of the basis configurations we tested used at most 3 basis functions to compute a single acceleration. If we increase the number of basis functions used to compute a single acceleration to 4, the least-squares residual goes down. Why would we limit ourselves to 3 basis functions if by using more we can generate a better fit?
-
+