Lecture note · Fig. 11 · control systems
A double pendulum on a leash: holding a chain still by pushing only a cart
Numa Koudsie
01The machine, part by part
Hold a heavy lamp that hangs from the ceiling on two links, not by the lamp but by a stretched cord tied to its bottom, and you can only steer it by moving the far end of the cord. This machine is that situation, built so that every part can be named and seen.
A crane driver knows the problem from the cab. The hook hangs from the trolley, the load hangs from the hook, and the only thing the driver commands is the motor that moves the trolley; every swing of the load has to be taken out through that one motor. Here a double pendulum plays the load, a cart on a rail plays the trolley, and a stretched spring strut is the only thing that joins them.
The aim of this page
The cart, and only the cart, brings the pendulum back to rest at the place you choose. The controller measures where both balls and the cart are and how fast they move, sets the current in the coil, and so pushes the cart; through the strut the cart pulls the chain until all three bodies rest. This section shows the machine in pictures; §2–§11 derive what the cart can do to the chain; §12 designs the push; §14 shows the chain coming home in phase space.

At the top is a pivot O, bolted to a frame that never moves. From it hangs a rod of length \(l_1\) on a frictionless hinge, ending in a ball of mass \(m_1\). From that ball hangs a second rod of length \(l_2\) on a second hinge, ending in ball 2, of mass \(m_2\). The rods are carbon-fibre tubes, stiff and so light next to the balls that we neglect their mass; the balls are small enough to treat as points. Below runs a straight, level rail with a cart of mass \(M\) on nylon wheels. Beside the rail lies a magnet track, and a coil fixed under the cart hangs into its gap. The cart carries a pin that travels along the rail at a fixed depth \(H\) below the pivot. Nothing rubs anywhere: the hinges, the wheels and the sliding tubes are taken as frictionless, so with the controller off the machine swings for ever.
The chain and the cart touch in one place only: the strut. The next three figures take its two ends, its inside, and the motor that pushes the cart apart.
1.1How ball 2 is tied to the cart

At ball 2 (panel A). A steel axle passes straight through a bore in the centre of ball 2, at right angles to the plane of the swing. The strut's upper end is a fork: two steel cheeks, one on each side of the ball, with bronze bushings that ride on the two ends of the axle, joined below the ball by a bridge whose boss is screwed onto the strut's inner tube. Rod 2 is fixed into the top of the ball and passes between the cheeks, so the fork can swing through nearly a full turn about the ball; only when the strut points straight back up along rod 2 would its bridge meet the rod.
The axle goes through the centre of the ball on purpose. The model in §2 puts the strut's upper end at the ball's centre, the point \((x_2, y_2)\). Had we screwed a bracket under the ball instead, the strut would pull on a point a few centimetres below the centre, fixed to rod 2: its length would have to be measured to that point, and its pull would twist rod 2 about the ball. With the axle through the centre, the drawing and the equations describe the same machine.
At the cart (panel B). A U-shaped steel bracket, a clevis, is screwed to the cart's top plate with two cap screws. A hardened steel pin passes through its two cheeks. The strut's lower end is a rod end: a steel eye on a threaded shank, with a bronze ball inside it, and the pin passes through that ball. The pin's centre is the point \((X, -H)\) of §2: it is the cart's hinge, and the depth \(H\) is measured to it.
Both joints let the strut turn freely in the plane of the swing; the ball in the rod end also lets it tilt a little out of that plane, so that a slightly bent machine does not bind. Neither joint can hold a twist. That fixes the direction of the strut's force. Hold a light stick between two pins: if the pins pushed on it along two different lines, the two forces would form a couple and spin the stick, and a stick with no mass and no moment of inertia would have to spin infinitely fast. So the two end forces of a massless strut are equal, opposite, and along the line through the two joint centres. Engineers call such a part a two-force member. Call \(N\) the pull it carries, positive when it pulls, and \(\ell\) its length, the distance from the cart's pin to the ball's centre.
Two-force member: Mechanics Map (Penn State), §5.2, argued there for a body at rest; with zero mass and zero moment of inertia, \(\sum F = ma\) and \(\sum\tau = I\alpha\) vanish at every instant, so it holds in motion too.
1.2The strut, cut open

The strut is two tubes, one sliding inside the other. The outer tube, on the cart's side, is aluminium; the inner tube, on the ball's side, is stainless steel and slides in a bronze bushing pressed into the mouth of the outer tube. A long spring of steel wire runs inside both: one end is hooked to the plug that closes the bottom of the outer tube, the other to a plug deep inside the inner tube. Pull the strut longer and the inner tube slides out, carrying the spring's upper anchor with it: the spring stretches and pulls back. Push the strut shorter and the spring is squeezed and pushes back. Its coils are wound open, with gaps between them, so it can do both. Either way the force is
\[ N = k_s(\ell - L_0) , \]where \(k_s\) is its stiffness and \(L_0\) the strut length at which the spring is slack. The spring is fitted already stretched, so that it pulls even when the chain hangs at rest, like a guitar string tightened before it is played. A pull set this way is a pre-tension; the page sets it by the pull \(N_0\) the strut carries when the chain hangs straight down over the cart.
The tubes cannot slide for ever. Pulled out, the collar on the inner tube (4) meets the bronze bushing (7): the strut is then at its longest, \(\ell_\text{max} = 0.95\ \mathrm m\). Pushed in, the end of the inner tube meets the bottom plug (2): the strut is at its shortest, \(\ell_\text{min} = 0.50\ \mathrm m\). The page draws each stop as a very stiff spring, \(k_\text{stop} = 2\times10^4\ \mathrm{N/m}\), with a damper, \(c_\text{stop} = 40\ \mathrm{kg/s}\), that acts only while the stop is touched. The damper turns the knock into heat, \(Q_\text{stop} = \int c_\text{stop}\dot\ell^2\, dt\), the only loss in the machine apart from the coil.
1.3The magnet track and the coil

The cart is pushed by a linear motor, which works like a loudspeaker laid along a rail. The track is a U-shaped steel channel. On the inside of both walls sit neodymium magnets, alternating every few centimetres, and opposite every north face on one wall is a south face on the other. So across the narrow gap the field points straight from one wall to the other: towards you over one pair, away from you over the next (3). The steel channel carries the field round behind the magnets, so almost all of it crosses the gap.
Into the gap hangs the coil (2). Its two upright legs are one magnet pair apart, so they always sit in fields that point opposite ways. When the controller asks for a current \(I\), the current source drives it up one leg and down the other (7, 8). A wire of length \(\boldsymbol\ell_w\) carrying current across a magnetic field feels the Lorentz force \(I\,\boldsymbol\ell_w\times\mathbf B\). In the left leg the current runs up and the field points towards you; in the right leg the current runs down and the field points away. Both reversals together leave both forces pointing the same way, to the right along the rail (9). Reverse the current and the cart is pushed to the left. The push grows in step with the current,
\[ F = \kappa I , \]with the force constant \(\kappa = B\ell_w\): the field \(B\) in the gap times the total length \(\ell_w\) of wire sitting in it, both legs together. The current comes from a current source, an electronic driver that delivers exactly the current it is told, whatever the coil is doing, up to \(I_\text{max}\).
With the coil off, \(I = 0\) and the coil pushes nothing; it rides along in the gap as a passenger. The only thing that moves the cart along the rail is the strut. Its pull \(N\) acts along its own line; the rail takes the vertical part, and the horizontal part is \(N\) times the strut's lean. If ball 2 sits a horizontal distance \(x_2 - X\) to the right of the cart's pin, the strut leans by that much over its length \(\ell\), so
\[ M\ddot X = N\,\frac{x_2 - X}{\ell} . \tag{1} \]The cart is dragged towards the point under ball 2, like a sled tied to someone walking along a balcony above it. When ball 2 swings right the strut leans right and tugs the cart right; when the ball swings back, so does the cart. The cart moves although nobody pushes it.
With the coil on, the controller sets the current and the coil adds its push:
\[ M\ddot X = N\,\frac{x_2 - X}{\ell} + F . \tag{2} \]The cart can now be driven ahead of the swing or held back against it, and through the strut that is the only way to reach the chain.
One simplification, said openly. A single coil over alternating magnets pushes hardest when its legs sit over the middle of the magnets and not at all when they sit over the joins between them. Real long-stroke motors use three coils side by side, and the driver shares the current between them so that the push is the same everywhere. The page models that ideal motor, with one constant \(\kappa\).
Force and back-emf with one constant: MIT 2.003 (2005), Prelab 4, eqs. (1)–(2). A cart that moves with no force applied: Green (2020), cart and pole.
1.4How the cart brings the chain home
Picture a child on a swing, and suppose the only way you may touch the seat is through a long, soft rubber cord tied to it. Hold the end of the cord still and the swing goes on for ever: the cord stretches and relaxes, takes a little energy and gives it back, and a hand that does not move does no work. To stop the swing you must move your hand. Follow the seat, give way to the cord a little more slowly than it pulls, and the cord ends up pulling against the seat’s motion; your arm takes in the work, as a damper would. Every swing loses a little, and the seat comes to rest.
The machine works the same way, part for part. The cord is the strut. To first order its sideways pull is that of a stretched string (§9); at the starting values, the pull \(N_0\) along the strut, tilted by the offset between ball 2 and the cart, gives a sideways force \((N_0/\ell_0)\,(X - x_2)\) on ball 2, about 4.6 N for every metre that the cart stands beside the ball, and the opposite force on the cart. The hand is the cart. The arm is the coil: it pushes the cart with \(F\), and its power \(F\dot X\) is positive when it speeds the cart along and negative when it brakes it; braking sends the energy back into the current source. Nothing else touches the chain. So the energy of a swing has exactly one way out: from the chain through the string into the cart, and from the cart through the coil into the source.
Figure 6 follows one release, computed with the linear model of §9–§12 at the straight-hanging rest (target \(r = 0\)) and the coil’s limit of 30 N. Ball 2 is moved 10 cm to the right, everything else held still, and let go. The swing then holds 0.102 J: 0.079 J in the chain (0.049 J of it is gravity, because ball 2 has been lifted by 1.0 cm, and 0.030 J is the spring, stretched by as much as the ball rose), and 0.023 J in the string’s sideways stretch. In the first tenth of a second the coil shoves the cart after the ball, at its full 30 N for the first 3.5 ms, and pours 0.50 J into the cart, five times what the swing holds. By 0.2 s the cart has run 12 cm, past the ball, which is now swinging back; the string pulls ball 2 to the right, against its motion, while the coil brakes the cart and takes the 0.50 J back, and a little more. So it goes, swing after swing, each smaller than the last. After 8 s the coil has put 2.30 J into the cart and taken 2.40 J out; the difference, 0.102 J, is the energy the swing held. Over the same 8 s the string did −0.079 J of work on the chain, all of the chain’s swing, and +0.102 J on the cart.
Two things follow, and both can be seen on the page. The cart must move, and it moves first, towards the ball: a string whose end stands still can only give back what it takes. And the coil is not a brake that is simply on; it is a pump that runs both ways, a little more out than in on every swing. The bars at the top left of the picture keep this account: \(E - E^*\) is the energy above the rest, \(W_\text{coil}\) the coil’s work since the run began. Set the target to 0, pull ball 2 aside and let go: \(W_\text{coil}\) falls by just what \(E - E^*\) loses. Switch the controller off and do the same: \(W_\text{coil}\) stays at zero, and the energy stays in the chain for ever. How hard the coil may pump is the controller’s design (§12). Gentle charges the coil’s effort five times more than Firm (\(\rho = 0.1\) against \(0.02\)), so it pushes less and the chain takes longer to come home.
1.5The parameters
Every quantity that defines the machine is a slider on the page. The derivations below keep them all as symbols; numbers in the text are for the starting values in this table.
| Symbol | Meaning | Start | Slider range |
|---|---|---|---|
| \(m_1,\ m_2\) | masses of the two balls | 0.5 kg | 0.1–2 kg |
| \(l_1,\ l_2\) | lengths of the two rods | 0.5 m | 0.3–0.7 m |
| \(M\) | mass of the cart with its coil | 1 kg | 0.2–5 kg |
| \(H\) | depth of the cart's pin below the pivot | 1.65 m | keeps \(\ell_0\) within 0.55–0.85 m |
| \(\kappa\) | force constant of the coil | 10 N/A | 2–30 N/A |
| \(I_\text{max}\) | largest current the source gives | 3 A | 0.5–8 A |
| \(k_s\) | stiffness of the spring | 100 N/m | 20–400 N/m |
| \(N_0\) | strut's pull with the chain hanging straight down | 3 N | −6 to 10 N |
| \(g\) | gravitational acceleration | 9.81 m/s² | fixed |
| \(\ell_\text{min},\ \ell_\text{max}\) | stops of the strut | 0.50, 0.95 m | fixed by the tubes |
02Coordinates
Three bodies move in a vertical plane: two balls and the cart. A free point in a plane needs two numbers, so three free bodies need six. Each rigid rod fixes one distance and the rail fixes the cart's height: three conditions on positions alone. Six minus three leaves three degrees of freedom. The strut adds none, because its length follows from where ball 2 and the cart are.
We choose the angle of each rod from straight down, positive to the right, and the cart's position along the rail, measured from the point under the pivot:
\[ \mathbf q = (\theta_1,\ \theta_2,\ X) . \]Put the pivot at the origin, \(x\) to the right and \(y\) upwards. Reading the positions off Figure 5,
\[ \begin{aligned} x_1 &= l_1\sin\theta_1, \\ y_1 &= -l_1\cos\theta_1, \\ x_2 &= l_1\sin\theta_1 + l_2\sin\theta_2, \\ y_2 &= -l_1\cos\theta_1 - l_2\cos\theta_2 , \end{aligned} \tag{3} \]and the cart's pin is at \((X, -H)\). Two lengths describe the strut: its horizontal offset and its vertical span,
\[ a = x_2 - X, \qquad b = y_2 + H . \]By Pythagoras the strut, from the cart's pin to the ball's centre, is
\[ \ell = \sqrt{a^2 + b^2} . \tag{4} \]When the chain hangs straight down over the cart, \(a = 0\) and \(b = H - l_1 - l_2\), so the strut is \(\ell_0 = H - l_1 - l_2\) long. The page keeps \(\ell_0\) between the stops: moving \(l_1\), \(l_2\) or \(H\) moves the others' limits with it.
Positions: Widnall, MIT 16.07, Lecture L20, eqs. (26)–(29), with the cart added.
03Velocities and kinetic energy
Differentiate the positions (3) in time. The angles change in time, so by the chain rule \(\tfrac{d}{dt}\sin\theta = \dot\theta\cos\theta\) and \(\tfrac{d}{dt}\cos\theta = -\dot\theta\sin\theta\). For ball 1,
\[ \dot x_1 = l_1\dot\theta_1\cos\theta_1, \qquad \dot y_1 = l_1\dot\theta_1\sin\theta_1 . \]Square and add, and use \(\cos^2 + \sin^2 = 1\):
\[ \dot x_1^2 + \dot y_1^2 = l_1^2\dot\theta_1^2 . \]Ball 1 runs on a circle, so its speed is the radius times the rate of turning. For ball 2 each component is a sum of two terms:
\[ \begin{aligned} \dot x_2 &= l_1\dot\theta_1\cos\theta_1 + l_2\dot\theta_2\cos\theta_2, \\ \dot y_2 &= l_1\dot\theta_1\sin\theta_1 + l_2\dot\theta_2\sin\theta_2 . \end{aligned} \]Squaring a sum gives two squares and a cross term. Adding the two squared components, the squares combine as for ball 1, and the cross terms combine into
\[ 2l_1l_2\dot\theta_1\dot\theta_2\,(\cos\theta_1\cos\theta_2 + \sin\theta_1\sin\theta_2) . \]The bracket is \(\cos(\theta_1 - \theta_2)\), by the addition formula. So
\[ \begin{aligned} \dot x_2^2 + \dot y_2^2 ={}& l_1^2\dot\theta_1^2 + l_2^2\dot\theta_2^2 \\ &+ 2l_1l_2\dot\theta_1\dot\theta_2\cos(\theta_1 - \theta_2) . \end{aligned} \]Picture ball 2's velocity as two arrows laid end to end: ball 1's velocity, at right angles to rod 1, and ball 2's own turning about ball 1, at right angles to rod 2. When the rods are parallel the arrows point the same way and add fully, and the cosine is 1. When the rods are at right angles the arrows are too, the cross term vanishes, and only Pythagoras remains. The cart moves along the rail with speed \(\dot X\). Adding \(\tfrac12 mv^2\) for the three bodies,
\[ \begin{aligned} T ={}& \tfrac12(m_1 + m_2)\,l_1^2\dot\theta_1^2 + \tfrac12 m_2l_2^2\dot\theta_2^2 \\ &+ m_2l_1l_2\cos(\theta_1 - \theta_2)\,\dot\theta_1\dot\theta_2 \\ &+ \tfrac12 M\dot X^2 . \end{aligned} \tag{5} \]Widnall, L20, eq. (30): the same result without the cart.
04Potential energy
Gravity's energy is \(mgy\) for each ball, with the heights \(y_1, y_2\) from (3). The cart's height never changes, so its gravity energy is a constant we drop. The spring stores \(\tfrac12 k_s(\ell - L_0)^2\). So
\[ \begin{aligned} V ={}& -(m_1 + m_2)\,gl_1\cos\theta_1 \\ &- m_2gl_2\cos\theta_2 \\ &+ \tfrac12 k_s(\ell - L_0)^2 , \end{aligned} \tag{6} \]with \(\ell\) from (4). The pre-tension fixes the slack length: at the hanging rest the pull is \(N_0 = k_s(\ell_0 - L_0)\), so \(L_0 = \ell_0 - N_0/k_s\). At the starting values the spring is then stretched by 3 cm at rest.
Gravity: Widnall, L20, eq. (31). Spring between two moving points: Witkin, "Particle System Dynamics", SIGGRAPH 2001 notes, §6, energy \(\tfrac{k_s}{2}C^2\) with \(C = \ell - L_0\).
05The coil in the Lagrangian
Run the motor of §1.3 backwards. When the cart moves at \(\dot X\), the coil's legs sweep through the field, and a voltage \(\kappa\dot X\) appears in the coil, the back-emf, with the same constant as the force. It has to be the same constant for energy to balance: the power the source spends driving \(I\) against \(\kappa\dot X\) is \(\kappa I\dot X\), exactly the power \(F\dot X\) the coil delivers to the cart.
To bring the coil into Lagrange's method we need one more coordinate, the charge \(\eta\) that has flowed through the coil, so that \(\dot\eta = I\). The coupling energy is built from the force law: its derivative with respect to the cart's position must be the force \(\kappa\dot\eta\), at every position, and integrating along the rail gives \(\kappa X\dot\eta\). Adding the coil's own magnetic energy \(\tfrac12\Lambda\dot\eta^2\), with \(\Lambda\) its inductance, the Lagrangian of the whole machine is
\[ \mathcal L = T - V + \tfrac12\Lambda\dot\eta^2 + \kappa X\dot\eta . \tag{7} \]Check that it gives back both effects. The coupling term contains \(X\), so \(\partial\mathcal L/\partial X\) contains \(\kappa\dot\eta = \kappa I\): the force on the cart. It also contains \(\dot\eta\), so
\[ \frac{d}{dt}\frac{\partial\mathcal L}{\partial\dot\eta} = \Lambda\ddot\eta + \kappa\dot X . \tag{8} \]With a resistance \(R\) in the coil and a voltage \(U\) across it, Lagrange's equation for \(\eta\) reads \(\Lambda\dot I + RI + \kappa\dot X = U\), and \(\kappa\dot X\) is the back-emf. The current source sets \(I\) and supplies whatever voltage that takes. Then \(\eta\) is no longer free: this equation only says what voltage the source must give, and on the mechanical side \(F = \kappa I\) acts as a given push on the cart.
Manhães, Sampaio, Lima, Hagedorn and Deü, Mecánica Computacional XXXVI (2018): coupling term from the force law, eqs. (69)–(73); Lagrangian, eq. (84); electrical equation, eq. (96), for a rotary motor, where the cart's \(X\) is an angle.
06How the spring pushes on each coordinate
Lagrange's equations need \(\partial V/\partial q\) for each coordinate. The gravity part is direct; the spring needs the chain rule:
\[ \frac{\partial}{\partial q}\,\tfrac12 k_s(\ell - L_0)^2 = N\,\frac{\partial\ell}{\partial q} . \tag{9} \]The pull times the rate at which the strut stretches when that coordinate changes. To find the rate, differentiate \(\ell^2 = a^2 + b^2\) from (4):
\[ 2\ell\,\frac{\partial\ell}{\partial q} = 2a\,\frac{\partial a}{\partial q} + 2b\,\frac{\partial b}{\partial q}, \] \[ \frac{\partial\ell}{\partial q} = \frac{a}{\ell}\frac{\partial a}{\partial q} + \frac{b}{\ell}\frac{\partial b}{\partial q} . \tag{10} \]Here \((a/\ell,\ b/\ell)\) is the unit vector along the strut, and \((\partial a/\partial q,\ \partial b/\partial q)\) is how its end moves when \(q\) changes. So the strut grows only by the part of its end's motion that points along it; motion across it only turns it on its pins. Move ball 2 sideways a centimetre when the strut is vertical and its length hardly changes; move ball 2 up a centimetre and it grows by a centimetre.
From (3), \(\partial a/\partial\theta_1 = l_1\cos\theta_1\) and \(\partial b/\partial\theta_1 = l_1\sin\theta_1\); the same with index 2 for \(\theta_2\); and \(\partial a/\partial X = -1\), \(\partial b/\partial X = 0\). So
\[ \begin{aligned} \frac{\partial\ell}{\partial\theta_1} &= \frac{l_1}{\ell}\,(a\cos\theta_1 + b\sin\theta_1), \\ \frac{\partial\ell}{\partial\theta_2} &= \frac{l_2}{\ell}\,(a\cos\theta_2 + b\sin\theta_2), \\ \frac{\partial\ell}{\partial X} &= -\frac{a}{\ell} . \end{aligned} \tag{11} \]Witkin, §6: an energy \(\tfrac{k_s}{2}C^2\) gives the force \(-k_sC\,\partial C/\partial x_i\); §4.2, eq. (1): a spring pulls its two ends equally and oppositely along the line joining them.
07Lagrange's equations, every term★
For each coordinate, \(\tfrac{d}{dt}\,\partial\mathcal L/\partial\dot q - \partial\mathcal L/\partial q = 0\). To keep lines short, write
\[ \mu = m_2l_1l_2, \quad c = \cos(\theta_1 - \theta_2), \quad s = \sin(\theta_1 - \theta_2) . \]By the chain rule, \(\dot c = -s\,(\dot\theta_1 - \dot\theta_2)\).
7.1The upper rod, \(\theta_1\)
\[ \begin{aligned} p_1 &= \frac{\partial T}{\partial\dot\theta_1} \\ &= (m_1 + m_2)l_1^2\dot\theta_1 + \mu c\,\dot\theta_2 . \end{aligned} \]Its time derivative needs the product rule on the second term, \(\tfrac{d}{dt}(c\,\dot\theta_2) = \dot c\,\dot\theta_2 + c\,\ddot\theta_2\):
\[ \begin{aligned} \dot p_1 ={}& (m_1 + m_2)l_1^2\ddot\theta_1 + \mu c\,\ddot\theta_2 \\ &- \mu s\,\dot\theta_1\dot\theta_2 + \mu s\,\dot\theta_2^2 . \end{aligned} \]In \(T\) only \(c\) depends on \(\theta_1\) itself, and \(\partial c/\partial\theta_1 = -s\), so \(\partial T/\partial\theta_1 = -\mu s\,\dot\theta_1\dot\theta_2\). Subtract: the term \(-\mu s\,\dot\theta_1\dot\theta_2\) in \(\dot p_1\) meets \(+\mu s\,\dot\theta_1\dot\theta_2\), and the two cancel:
\[ \begin{aligned} &\dot p_1 - \frac{\partial T}{\partial\theta_1} \\ &= (m_1 + m_2)l_1^2\ddot\theta_1 + \mu c\,\ddot\theta_2 + \mu s\,\dot\theta_2^2 . \end{aligned} \]The potential gives \(\partial V/\partial\theta_1 = (m_1 + m_2)gl_1\sin\theta_1 + N\,\partial\ell/\partial\theta_1\), from (6) and (9). So
\[ \begin{aligned} &(m_1 + m_2)l_1^2\ddot\theta_1 + \mu c\,\ddot\theta_2 + \mu s\,\dot\theta_2^2 \\ &+ (m_1 + m_2)gl_1\sin\theta_1 \\ &+ N\frac{\partial\ell}{\partial\theta_1} = 0 . \end{aligned} \tag{12} \]7.2The lower rod, \(\theta_2\)
\[ \begin{aligned} p_2 &= \frac{\partial T}{\partial\dot\theta_2} \\ &= m_2l_2^2\dot\theta_2 + \mu c\,\dot\theta_1 , \end{aligned} \] \[ \begin{aligned} \dot p_2 ={}& m_2l_2^2\ddot\theta_2 + \mu c\,\ddot\theta_1 \\ &- \mu s\,\dot\theta_1^2 + \mu s\,\dot\theta_1\dot\theta_2 . \end{aligned} \]Now \(\partial c/\partial\theta_2 = +s\), so \(\partial T/\partial\theta_2 = +\mu s\,\dot\theta_1\dot\theta_2\). Subtracting, the mixed terms cancel again:
\[ \begin{aligned} &\dot p_2 - \frac{\partial T}{\partial\theta_2} \\ &= m_2l_2^2\ddot\theta_2 + \mu c\,\ddot\theta_1 - \mu s\,\dot\theta_1^2 . \end{aligned} \]With \(\partial V/\partial\theta_2 = m_2gl_2\sin\theta_2 + N\,\partial\ell/\partial\theta_2\),
\[ \begin{aligned} &\mu c\,\ddot\theta_1 + m_2l_2^2\ddot\theta_2 - \mu s\,\dot\theta_1^2 \\ &+ m_2gl_2\sin\theta_2 \\ &+ N\frac{\partial\ell}{\partial\theta_2} = 0 . \end{aligned} \tag{13} \]7.3The cart, \(X\)
\(T\) contains \(\dot X\) only in \(\tfrac12 M\dot X^2\), and the coupling term \(\kappa X\dot\eta\) contains \(X\) but not \(\dot X\). So \(\partial\mathcal L/\partial\dot X = M\dot X\) and \(\partial\mathcal L/\partial X = -N\,\partial\ell/\partial X + \kappa I\):
\[ M\ddot X + N\frac{\partial\ell}{\partial X} = F . \tag{14} \]Put in \(\partial\ell/\partial X = -a/\ell\) from (11): \(M\ddot X = F + N(x_2 - X)/\ell\). That is (2), found in §1.3 from the picture of the motor and the strut alone. Lagrange and Newton agree on the cart, as they must.
7.4What the speed-squared terms mean
Spin the upper rod fast. Ball 1 runs round a circle, and ball 2, hanging from it, is flung outwards along rod 1 with the force \(m_2l_1\dot\theta_1^2\). Unless rod 2 lies along rod 1, that fling has a lever arm \(l_2\sin(\theta_1 - \theta_2)\) about ball 1 and twists rod 2: that is \(-\mu s\,\dot\theta_1^2\) in (13). The term \(\mu s\,\dot\theta_2^2\) in (12) is the mirror image: ball 2 whirling about ball 1 pulls ball 1 outwards along rod 2. Both are centrifugal. The mixed terms \(\dot\theta_1\dot\theta_2\), which would have been Coriolis forces, cancelled exactly.
7.5All three together
Collect the accelerations into a mass matrix:
\[ \mathbf M = \begin{pmatrix} (m_1 + m_2)l_1^2 & \mu c & 0 \\ \mu c & m_2l_2^2 & 0 \\ 0 & 0 & M \end{pmatrix} . \]Then (12)–(14) read
\[ \mathbf M\ddot{\mathbf q} + \mu s\begin{pmatrix} \dot\theta_2^2 \\ -\dot\theta_1^2 \\ 0 \end{pmatrix} + \nabla V = \begin{pmatrix} 0 \\ 0 \\ F \end{pmatrix} . \tag{15} \]The mass matrix has a zero block: the cart's inertia does not mix with the chain's. Everything that ties the cart to the chain sits in \(\nabla V\), through the strut's pull \(N\); the coil pushes only the cart. The page solves (15) for the accelerations in accel().
Without the strut, (12) and (13) are Widnall, L20, eqs. (36)–(41); her (40)–(41) are (12) and (13) divided by \(l_1\) and \(l_2\).
08Where the chain can rest
At a rest every speed and acceleration is zero, so the speed-squared terms vanish and (15) leaves \(\nabla V = (0, 0, F)\).
8.1Coil off
With \(F = 0\), the cart's equation (14) with (11) says \(N\,(x_2 - X)/\ell = 0\). A product is zero when either factor is, so there are two cases.
The strut stands vertical, \(x_2 = X\). Then \(a = 0\) and \(\ell = b\), so (11) gives \(\partial\ell/\partial\theta_1 = l_1\sin\theta_1\) and \(\partial\ell/\partial\theta_2 = l_2\sin\theta_2\), and (12), (13) at rest become
\[ \begin{aligned} \big[(m_1 + m_2)g + N\big]\,l_1\sin\theta_1 &= 0, \\ (m_2g + N)\,l_2\sin\theta_2 &= 0 . \end{aligned} \]So each rod points straight down or straight up. Only straight down fits the tubes; the three other arrangements need a strut of length \(H - l_1 + l_2\), \(H + l_1 - l_2\) or \(H + l_1 + l_2\), longer than \(\ell_\text{max}\) for every setting the sliders allow.
The strut carries no pull, \(N = 0\): the spring sits at its slack length, \(\ell = L_0\). Only gravity acts on the chain, so both rods hang straight down, \(b = \ell_0\), and the cart stands where \(\sqrt{(x_2 - X)^2 + \ell_0^2} = L_0\). That needs \(L_0 \ge \ell_0\), that is \(N_0 \le 0\): a strut that pushes. With a pulling strut this case cannot happen, and hanging straight down is the only rest. With a pushing strut it can: the cart rests at \(X = \pm\sqrt{L_0^2 - \ell_0^2}\) under a chain hanging straight down (\(\pm0.16\) m at \(N_0 = -2\) N with the other sliders at their starting values). The middle rest is then like a pencil on its tip: a strut that pushes shoves the cart away from under the ball as soon as it leans. At a side rest the spring is slack, and any small motion of the cart either stretches or squeezes it, so the rest is stable. With a pushing strut and no control the machine swings about one of the side rests.
8.2Coil on
A steady push \(F^*\) can hold the cart at any point \(X = r\) along the rail, the target you set with the slider r. The chain then leans until gravity and the tilted strut balance:
\[ \frac{\partial V}{\partial\theta_1} = 0, \quad \frac{\partial V}{\partial\theta_2} = 0 \quad\text{at } X = r , \tag{16} \] \[ F^* = \frac{\partial V}{\partial X} = -N^*\,\frac{x_2^* - r}{\ell^*} . \tag{17} \]The page solves (16) by Newton's method in equilibrium(). At the starting values and \(r = 0.30\) m the rods lean \(5.78^\circ\) and \(8.36^\circ\), the strut pulls with 6.12 N, and the coil holds the cart with 1.59 N. This rest depends on \(k_s\), because the strut leans: with \(k_s = 1000\) N/m the rods lean \(8.80^\circ\) and \(10.02^\circ\).
09Small swings: the guitar string★
Near the hanging rest the motion is small, so we expand \(V\) in powers of \(\theta_1, \theta_2, X\) and keep terms up to second order: enough for the forces to first order. Four steps.
Step 1, gravity. With \(\cos\theta = 1 - \tfrac12\theta^2 + \dots\), the gravity part of (6) becomes
\[ \begin{aligned} V_g \approx{}& \text{const} \\ &+ \tfrac12(m_1 + m_2)gl_1\theta_1^2 \\ &+ \tfrac12 m_2gl_2\theta_2^2 . \end{aligned} \]Each ball rises by \(l(1 - \cos\theta) \approx \tfrac12 l\theta^2\) as its rod swings, and gravity charges for the rise.
Step 2, the strut's length. With \(\sin\theta \approx \theta\), the offset and span of the strut are
\[ \begin{aligned} a &\approx l_1\theta_1 + l_2\theta_2 - X, \\ b &\approx \ell_0 + \beta, \\ \beta &= \tfrac12(l_1\theta_1^2 + l_2\theta_2^2) . \end{aligned} \]The offset \(a\) is first order; the rise \(\beta\) of ball 2 is second order. Now Pythagoras, dropping \(\beta^2\), which is fourth order:
\[ \begin{aligned} \ell &= \sqrt{a^2 + (\ell_0 + \beta)^2} \\ &\approx \ell_0\sqrt{1 + \frac{2\ell_0\beta + a^2}{\ell_0^2}} . \end{aligned} \]The fraction under the root is second order, and \(\sqrt{1 + u} \approx 1 + \tfrac12 u\) for small \(u\):
\[ \ell \approx \ell_0 + \delta, \qquad \delta = \beta + \frac{a^2}{2\ell_0} . \tag{18} \]The stretch \(\delta\) has no first-order part. Tilt a vertical string sideways by \(a\) and it gets longer only by \(a^2/2\ell_0\), the way a ladder leaned a little off the wall barely changes its height; lift its top by \(\beta\) and it gets longer by \(\beta\).
Step 3, the spring. At the hanging rest the spring is already stretched by \(\ell_0 - L_0 = N_0/k_s\), so \(\ell - L_0 = N_0/k_s + \delta\), and
\[ \tfrac12 k_s(\ell - L_0)^2 = \frac{N_0^2}{2k_s} + N_0\,\delta + \tfrac12 k_s\,\delta^2 . \]The first term is a constant, the second is second order, and the third, the square of a second-order quantity, is fourth order and dropped. This is where \(k_s\) leaves. The spring already pulls with \(N_0\), so a small extra stretch \(\delta\) costs the work \(N_0\delta\) at nearly constant pull; the pull itself changes only by \(k_s\delta\), and the work of that change is far smaller.
Step 4, add up step 1 and \(N_0\delta\), with \(\delta\) from (18):
\[ \begin{aligned} V \approx{}& \tfrac12(m_1 + m_2)gl_1\theta_1^2 + \tfrac12 m_2gl_2\theta_2^2 \\ &+ \tfrac12 N_0\,(l_1\theta_1^2 + l_2\theta_2^2) \\ &+ \frac{N_0}{2\ell_0}\,(l_1\theta_1 + l_2\theta_2 - X)^2 . \end{aligned} \tag{19} \]Each line has a picture. The first is gravity. The second has the form of ball 2's gravity term, \(\tfrac12 m_2g(l_1\theta_1^2 + l_2\theta_2^2)\), with \(m_2g\) replaced by \(N_0\): the strut's pull acts like an extra weight \(N_0\) hung on ball 2. The third is a stretched guitar string. Differentiate it with respect to \(X\), and the cart feels \(N_0(x_2 - X)/\ell_0\): the sideways force of a string under tension \(N_0\) and length \(\ell_0\) whose end is pulled aside by \(x_2 - X\). It is the only term that contains \(X\): with no pull, \(N_0 = 0\), the cart and the chain no longer feel each other.
Only at the hanging rest
All of this holds where the strut stands vertical. At a rest with the cart off to one side, \(r \neq 0\), the strut leans, \(\partial\ell/\partial X = -a^*/\ell^* \neq 0\), and moving the cart changes the strut's length already at first order. Then \(\tfrac12 k_s\delta^2\) is second order and \(k_s\) stays, as §8.2 showed.
Call \(\mathbf S\) the matrix of second derivatives of \(V\) at the rest, the stiffness matrix, and \(\mathbf M_0\) the mass matrix there. Small free motions obey \(\mathbf M_0\ddot{\mathbf q} + \mathbf S\mathbf q = 0\); trying \(\mathbf q = \mathbf u\,e^{i\omega t}\) gives
\[ \det(\mathbf S - \omega^2\mathbf M_0) = 0 . \tag{20} \]At the starting values, \(\omega = 1.71,\ 5.05,\ 10.00\) rad/s at the hanging rest, whatever \(k_s\) is.
Step 3: Hasted, "Guitar string deflection, tension and force": each half of a plucked string of tension \(T\) pulls back with \(T\,d/(L/2)\), and for small \(d\) the tension is not altered significantly.
10The linear model★
Write the state as \(\mathbf y = (\mathbf q, \dot{\mathbf q})\), six numbers. Solving (15) for the accelerations, \(\ddot{\mathbf q} = \mathbf M^{-1}\mathbf b\), with the net generalised force
\[ \mathbf b = \begin{pmatrix} 0 \\ 0 \\ F \end{pmatrix} - \mu s\begin{pmatrix} \dot\theta_2^2 \\ -\dot\theta_1^2 \\ 0 \end{pmatrix} - \nabla V . \]At a rest \(\mathbf b = 0\), and so are the speeds. Let \(\tilde{\mathbf y} = \mathbf y - \mathbf y^*\) and \(\tilde F = F - F^*\) be small, and keep first order. By the product rule,
\[ \frac{\partial(\mathbf M^{-1}\mathbf b)}{\partial q} = \frac{\partial\mathbf M^{-1}}{\partial q}\,\mathbf b + \mathbf M^{-1}\frac{\partial\mathbf b}{\partial q} . \]The first term multiplies \(\mathbf b = 0\) and vanishes at the rest: the mass matrix tilts as the angles change, but it multiplies a net force that is zero, so its change matters only at second order. In the second term the speed-squared part still carries \(\dot\theta^2\) and vanishes, leaving \(-\mathbf M^{-1}\mathbf S\). With respect to the speeds, the speed-squared part gives terms with one factor \(\dot\theta\), which vanish too. With respect to \(F\), the derivative is \(\mathbf M^{-1}\mathbf e_3\), with \(\mathbf e_3 = (0, 0, 1)^{\mathsf T}\). So
\[ \dot{\tilde{\mathbf y}} = \mathbf A\tilde{\mathbf y} + \mathbf B\tilde F , \tag{21} \] \[ \mathbf A = \begin{pmatrix} 0 & \mathbf 1 \\ -\mathbf M^{-1}\mathbf S & 0 \end{pmatrix}, \] \[ \mathbf B = \begin{pmatrix} 0 \\ \mathbf M^{-1}\mathbf e_3 \end{pmatrix} , \]with \(\mathbf M\) and \(\mathbf S\) taken at the rest. At the hanging rest \(\mathbf S\) comes from (19); at any other rest, from the full (6). The page builds \(\mathbf A\) and \(\mathbf B\) numerically in linearise().
Tedrake, Underactuated Robotics, Ch. 3: the term with the derivative of \(\mathbf M^{-1}\) disappears because the bracket it multiplies is zero at a fixed point, and the velocity terms drop because the speeds are zero there.
11Can one push reach everything?
Kick the cart with one sharp blow. The state jumps at once in the direction \(\mathbf B\): only the cart's speed changes. Now give a blow and its exact reverse a moment later. The state jumps along \(\mathbf A\mathbf B\): the cart has moved, and the strut has begun to tug ball 2. Each further step of this kind reaches one link further into the chain, \(\mathbf A^2\mathbf B\), \(\mathbf A^3\mathbf B\), and so on; by the Cayley–Hamilton theorem nothing new appears after \(\mathbf A^5\mathbf B\). Any push is built from such pieces, so the states a push can reach are the combinations of six columns,
\[ \boldsymbol\Gamma = \big[\,\mathbf B,\ \mathbf A\mathbf B,\ \dots,\ \mathbf A^5\mathbf B\,\big] . \tag{22} \]One push can steer all six numbers if and only if \(\boldsymbol\Gamma\) has rank 6. The page computes the rank in rankOf(). With any pull or push in the strut, \(N_0 \neq 0\), it is 6; with \(N_0 = 0\) it is 2, because \(\mathbf A\) splits into a chain block and a cart block and \(\mathbf B\) reaches only the cart's.
Åström and Murray, Feedback Systems (2008), §6.1, Theorem 6.1, eq. (6.3), p. 170, with the same impulse argument.
12The controller★
The controller pushes with the holding force plus a weighted sum of the six errors,
\[ F = F^* - \mathbf K\tilde{\mathbf y}, \tag{23} \]clipped to \(|F| \le \kappa I_\text{max}\). It chooses the six gains \(\mathbf K\) to make a bill as small as possible:
\[ J = \int_0^\infty \big(\tilde{\mathbf y}^{\mathsf T}\mathbf Q\,\tilde{\mathbf y} + \rho\,\tilde F^2\big)\,dt . \tag{24} \]The first term charges for being away from the rest, \(\mathbf Q\) being a diagonal of weights set by the sliders; the second charges for pushing, at the rate \(\rho\). Suppose a symmetric matrix \(\mathbf P\) satisfies the Riccati equation
\[ \mathbf A^{\mathsf T}\mathbf P + \mathbf P\mathbf A - \rho^{-1}\mathbf P\mathbf B\mathbf B^{\mathsf T}\mathbf P + \mathbf Q = 0 . \tag{25} \]Step 1. Along any motion of (21), by the product rule,
\[ \begin{aligned} \frac{d}{dt}\big(\tilde{\mathbf y}^{\mathsf T}\mathbf P\tilde{\mathbf y}\big) ={}& \tilde{\mathbf y}^{\mathsf T}(\mathbf A^{\mathsf T}\mathbf P + \mathbf P\mathbf A)\,\tilde{\mathbf y} \\ &+ 2\tilde F\,\mathbf B^{\mathsf T}\mathbf P\tilde{\mathbf y} . \end{aligned} \]The two mixed terms are equal because \(\mathbf P\) is symmetric and \(\tilde F\) is a number.
Step 2. Write \(z = \mathbf B^{\mathsf T}\mathbf P\tilde{\mathbf y}\). Take \(\mathbf Q\) from (25), put it into the integrand of (24), and use step 1:
\[ \begin{aligned} \tilde{\mathbf y}^{\mathsf T}\mathbf Q\tilde{\mathbf y} + \rho\tilde F^2 ={}& -\frac{d}{dt}\big(\tilde{\mathbf y}^{\mathsf T}\mathbf P\tilde{\mathbf y}\big) \\ &+ \rho\tilde F^2 + 2\tilde Fz + \rho^{-1}z^2 . \end{aligned} \]Step 3, complete the square. The last three terms are \(\rho\,(\tilde F + z/\rho)^2\); multiply it out to check. So
\[ \begin{aligned} \tilde{\mathbf y}^{\mathsf T}\mathbf Q\tilde{\mathbf y} + \rho\tilde F^2 ={}& -\frac{d}{dt}\big(\tilde{\mathbf y}^{\mathsf T}\mathbf P\tilde{\mathbf y}\big) \\ &+ \rho\,\big(\tilde F + \rho^{-1}\mathbf B^{\mathsf T}\mathbf P\tilde{\mathbf y}\big)^2 . \end{aligned} \tag{26} \]Step 4, integrate from 0 to \(\infty\), for any push that brings the machine to rest:
\[ \begin{aligned} J ={}& \tilde{\mathbf y}_0^{\mathsf T}\mathbf P\tilde{\mathbf y}_0 \\ &+ \rho\int_0^\infty \big(\tilde F + \rho^{-1}\mathbf B^{\mathsf T}\mathbf P\tilde{\mathbf y}\big)^2 dt . \end{aligned} \]The first term depends only on where the machine starts; no push can change it. The second is never negative, and it is zero exactly when \(\tilde F = -\rho^{-1}\mathbf B^{\mathsf T}\mathbf P\tilde{\mathbf y}\) at every instant. So the cheapest push is (23) with
\[ \mathbf K = \rho^{-1}\mathbf B^{\mathsf T}\mathbf P, \qquad J_\text{min} = \tilde{\mathbf y}_0^{\mathsf T}\mathbf P\tilde{\mathbf y}_0 . \tag{27} \]The bill is an entry fee plus fines: the fee is set by where you start, every moment you push differently from the rule costs a fine, and obeying the rule costs only the fee.
One thing was assumed: that a symmetric \(\mathbf P\) solving (25) exists at all. It does, and it is the only positive-definite solution, whenever one push can reach every motion (rank 6 in §11) and every weight in \(\mathbf Q\) is positive; the Toronto notes state this as their Theorem 6.1 and point to Wonham for the proof. The page solves (25) in lqr() each time you press Solve; at the starting values and \(r = 0.30\) m the gains are \(\mathbf K = (19.22,\ -201.70,\ 120.09,\ 0.04,\ 0.52,\ 22.14)\). The large gain on \(\theta_2\) is the hand that follows the swing: when ball 2 swings right, the coil shoves the cart after it, the cart runs past the ball, and the strut then pulls the ball back against its motion.
University of Toronto ECE410 notes (2008), Ch. 6, pp. 89–90, eqs. (6.8)–(6.13): the same derivation by completing the square, with the same signs; Åström and Murray, eq. (6.27), p. 191.
13The bowl that always falls
Put the best push, \(\tilde F = -\mathbf K\tilde{\mathbf y}\), into (26). The square vanishes, and \(\rho\tilde F^2 = \rho\,\tilde{\mathbf y}^{\mathsf T}\mathbf K^{\mathsf T}\mathbf K\tilde{\mathbf y}\), so
\[ \frac{d}{dt}\big(\tilde{\mathbf y}^{\mathsf T}\mathbf P\tilde{\mathbf y}\big) = -\tilde{\mathbf y}^{\mathsf T}\big(\mathbf Q + \rho\mathbf K^{\mathsf T}\mathbf K\big)\tilde{\mathbf y} . \tag{28} \]The right side is negative whenever the machine is away from the rest, because the weights in \(\mathbf Q\) are positive. So \(\tilde{\mathbf y}^{\mathsf T}\mathbf P\tilde{\mathbf y}\), the bill still to pay from the present state, is a bowl whose height falls along every path of the controlled linear model: a Lyapunov function. For the real machine the proof holds only near the rest, where (21) is good and the coil is below its limit. The phase-space panels on the page show the paths spiralling into the rest.
14Phase space and the region of rescue
The state of the machine is a point in a six-dimensional phase space, and a run is a path through it. We cannot draw six dimensions, so the page draws three shadows: the angle against the angular speed for each rod, and the position against the speed for the cart. In each the rest is a cross, and a run that settles is a path that spirals into it.
Without control the hanging rest is a centre: all six eigenvalues of \(\mathbf A\) in (21) are imaginary, at the starting values \(\pm1.71i\), \(\pm5.05i\) and \(\pm10.00i\) per second, the normal modes of (20), and the energy \(T + V\) of (5) and (6) is conserved, so a disturbed chain circles for ever on a surface of constant energy. At the target \(r = 0.30\ \mathrm m\) the coil must hold the cart, and the open-loop eigenvalues there are \(\pm2.73i\), \(\pm6.71i\) and \(\pm11.57i\). With the controller the eigenvalues of \(\mathbf A - \mathbf B\mathbf K\) move into the left half-plane. For the starting values and \(r = 0.30\ \mathrm m\) they are \(-14.98\), \(-1.83 \pm 6.58i\), \(-1.19 \pm 11.65i\) and \(-1.13\) per second: two decaying swings and two plain decays. The rest has become a stable focus, and the slowest decay, 1.13 per second, sets the time on which the chain comes to rest, about a second for each factor of three.
The bowl of §13 proves stability only near the rest. Far from it two things break the guarantee: the coil's current limit, which cuts the push off at \(\kappa I_\text{max}\), and the nonlinearity of (15), which grows with the angles. The set of starts from which the controller still brings the chain home is the region of attraction, and it has to be measured: drag a ball far out and let go. After a hard yank, ball 1 can circle its pivot faster than the leash can follow, and the status line says so.
15Solve first, then play
Nothing is computed while you watch. When you press Solve, release the flag or let go of the chain, the page reads every slider, designs the controller, and integrates (15) with the feedback (23) by the classical fourth-order Runge–Kutta method, step \(h = 0.5\ \mathrm{ms}\), for 30 s: 60 000 steps. The force is evaluated at all four stages of each step, as a continuous controller would act. Every twentieth state, one every 10 ms, is stored with the force, the current, the strut's pull and length, and the energy; the animation then plays the stored samples back. Moving a slider of the machine marks the stored run as stale; the picture keeps the old machine until you solve again.
The step is small because of the stops: a touched stop is a spring of \(2\times10^4\ \mathrm{N/m}\) on a ball of a few hundred grams, a vibration of a few hundred radians per second, and RK4 needs \(\omega h\) well below 2.8 to stay stable. To grade the run, the page solves it a second time with \(h/2\) and shows the largest difference under "RK4, h vs h/2". The energy books are a second check: the coil's work \(W_\text{coil} = \int F\dot X\,dt\) and the stops' heat are integrated with the same RK4 weights as the state, and \(E(0) + W_\text{coil} - Q_\text{stop} - E(T)\) is shown under "Energy balance".
16On screen
The machine is drawn to scale, in pixels per metre, as seen from the front, with the strut as a line from the cart's pin to the centre of ball 2. The pale dashed pendulum is the rest \(\mathbf y^*\) the controller aims at, joined to the target \(r\) on the rail. The burgundy arrow on the cart is the coil's force \(F\), drawn 0.02 m long per newton on the machine's scale; the grey arrows beside the strut are its pull \(N\) on ball 2 and on the cart, equal and opposite. The stop marker on the outer tube turns burgundy while a stop is touched. The small circles on the coil appear while current flows. The bars at the top left are the energy books: the energy above the rest, the coil's work and the stops' heat.
Below the machine, a window of 10 s follows the playback: \(\theta_1\) dark, \(\theta_2\) burgundy and \(X\) brown dashed, dark up to now and pale after, with the rest values as rose lines. The strip under it is the whole run, the window shaded, with marks where the coil sits at its limit and where the strut touches a stop. The force profile shows \(F\), its steady value \(F^*\) (rose) and its limits \(\pm\kappa I_\text{max}\) (dotted), and the strut's pull \(N\). The phase-space panels are scaled to each run; the caption gives the eigenvalues, the kind of rest and the rank of (22).
17What the model leaves out
- The balls are points and the rods, tubes and spring are massless. Real rods have moments of inertia, and a strut with mass carries sideways forces and swings on its own.
- Nothing rubs. Real pins, bushings, the sliding tubes and the wheels have friction, which would damp the uncontrolled swing and add a dead zone the controller must push through.
- The controller measures all six numbers exactly and at once. A real one needs sensors on both rods and the cart; speeds are usually estimated by an observer such as a Kalman filter, and every sample of delay costs stability.
- The motor is ideal: one constant \(\kappa\) all along the rail, as if three coils were shared by a driver (§1.3), and a current source with no voltage limit. A real amplifier runs out of voltage when the back-emf \(\kappa\dot X\) grows.
- The gains come from the linear model at the target. Far from the rest the nonlinear machine can escape, as the whirl shows. Swinging a chain up from far away needs other ideas, such as pumping energy in or out deliberately before handing over to the regulator.
Problems
- From (19), show that with \(N_0 = 0\) the cart's equation is \(M\ddot X = \tilde F\) and that the chain's equations do not contain \(X\). Which two columns of (22) survive?
- A string of tension \(N_0\) and length \(\ell_0\) is pulled sideways at one end by \(\delta\). Show that the restoring force is \(N_0\delta/\ell_0\) to first order, and explain why the spring stiffness \(k_s\) does not appear.
- Set \(\rho\) ten times larger on the page and solve again. How do the gains, the slowest decay and the time at the current limit change? Explain with (24).
- Double \(M\) on the page and solve again. Which entry of \(\mathbf B\) in (21) changes, and how does the controller answer?
17.1Further reading
- S. Widnall, MIT 16.07 Dynamics, Lecture L20: Energy Methods, Lagrange's Equations, 2009: the double pendulum by Lagrange's equations, every term (eqs. 26–41).
- R. Tedrake, Underactuated Robotics, chapter 3: Acrobots, Cart-Poles, and Quadrotors, MIT course notes: the manipulator equations, linearisation at a fixed point, the controllability test and LQR for a pendulum pushed through one actuator.
- K. J. Åström and R. M. Murray, Feedback Systems: An Introduction for Scientists and Engineers, Princeton University Press, 2008: reachability (Section 6.1) and the linear–quadratic regulator (Section 6.3). The authors' free electronic edition.
- W. Manhães, R. Sampaio, R. Lima, P. Hagedorn and J.-F. Deü, Lagrangians for Electromechanical Systems, Mecánica Computacional XXXVI, 2018: how a motor's coupling term enters the Lagrangian.
- J. R. Taylor, Classical Mechanics, University Science Books, 2005: chapter 7, Lagrange's equations, and chapter 11, coupled oscillators and normal modes.