Lecture note · Fig. 16 computed on Kaggle · mechanics · control · fluid dynamics
Carrying a pint over a kerb
Numa Koudsie · for readers meeting the subject for the first time, from school to the second year of university · 15 November 2026
01Carrying a pint over a kerb
Walk over a kerb with a full pint in your hand and you do two things without thinking: you slow down before you reach it, and you let your wrist give, so that the glass stays level while your body jolts.
Both actions have a precise meaning. Slowing down early spreads the change of speed over a longer time, so that the push on the beer is gentler. Letting the wrist give means that the glass no longer follows every movement of your arm: you lift it a little when your body drops and tip it a little when your body lurches. Your eyes make both possible, because they see the kerb coming.
The cart of Fig. 12 could do neither. Its glass stood on a body with one wheel and one motor, and its controller could only choose how hard the motor pushed. At 1.5 m/s the motor could push forward with at most 11.25 N, because the battery’s voltage is nearly used up by the motor’s own back-voltage at that speed; the kerb pushed the wheel back far harder. The cart lost speed in a fraction of a second, the stout carried on and climbed the front wall, and even with the best of Fig. 12’s five controllers 1.63 mL of the head of foam went over the rim. The largest tilt of the stout’s surface was 20.81 mm.
The cart of this figure is built around the two things the hand does. A scanner reads the road ahead, and actuators in the suspension can lift and tilt the deck that carries the glass. The glass itself is clamped to the deck, so the only way to move the glass is to move the deck. This chapter explains how such a machine works and how its control system is designed, from the physics of the stout up. Section 3 finds what the stout feels on a deck that both accelerates and turns. Section 4 writes the cart’s equations of motion and finds the rhythms at which the cart rocks by itself. Section 5 builds the control law. Sections 6 to 8 explain how the rides were computed, what they show and how the picture is drawn, and section 9 lists what the model leaves out.
02The machine
A tea trolley with a soft suspension and four small hands at the corners of its tray, each of which can push the tray up or pull it down.
The glass is clamped to a deck, a rigid plate that carries everything else: the battery, the controller and the road scanner. The deck rests on two axles, a front one and a rear one, a distance \(\ell\) apart; this distance is the wheelbase. Each axle has two wheels on swing arms hinged under the deck. Between each arm and the deck stands a strut: a coil spring over a damper (a piston in oil, which resists motion in proportion to its speed), and at its top a voice-coil actuator, a coil in the gap of a magnet that pushes up or down with a force set by the current through it, as the coil of a loudspeaker does. Two hub motors in the rear wheels drive the cart. The sensors are an inertial measurement unit (IMU) on the deck, which measures its acceleration and its rate of turning; encoders on the wheels; stroke sensors on the struts; Fig. 12’s two level probes on the glass’s wall; and the road scanner on a boom in front.
We make four simplifications, and keep them throughout. First, the cart is planar: both wheels of an axle meet the same road, so the cart cannot roll sideways or turn, and the two wheels of an axle can be lumped into one. Second, the deck is rigid. Third, the pint is a rigid load on the deck, plus the motion of the stout inside the glass, which pushes back on the deck through the force computed by the fluid solver. Fourth, the wheels roll without slipping, and the tyres can push on the road but cannot pull. Table 1 lists every number of the machine; each is a line of the cart’s code, tools/fig16/kaggle/cart4.py.
| symbol | meaning | value |
|---|---|---|
| \(M_d\) | deck with glass, battery, controller and scanner | 2.4 kg |
| \(m_l\) | the pint: stout and head | 454 g |
| \(J_0\) | deck’s moment of inertia about its centre, without the pint | 0.0215 kg m² |
| \(a_f, a_r\) | front and rear axle ahead of and behind the deck’s centre; \(\ell = a_f + a_r\) | 110 mm, 110 mm |
| \(h_g\) | height of the point S (section 3) above the deck’s centre | 122 mm |
| \(h_s\) | height of the pint’s centre of mass above the deck’s centre | 90 mm |
| \(d\) | height of the deck’s centre above the arms’ hinges | 35 mm |
| \(m_f, m_r\) | front and rear axle (wheels, arms; the rear one with the motors) | 0.60 kg, 1.00 kg |
| \(R_w, I_w\) | wheel radius; all four wheels’ moment of inertia | 45 mm, 0.0012 kg m² |
| \(k, c\) | spring stiffness and damper constant | 700 N/m, 19 N s/m |
| \(s_\text{max}\) | strut travel either side of its static length, then a bump stop | 30 mm |
| \(k_t, c_t\) | tyre stiffness and damping | 16,000 N/m, 8 N s/m |
| \(U_\text{max}, \tau_U\) | actuator force limit; its lag | 50 N, 3 ms |
| \(n_m, b\) | hub motors; force per ampere of each at the road | 2, 3 N/A |
| \(I_\text{max}, V_\text{max}, R_a, \tau_I\) | current limit, battery voltage, motor resistance, current lag | 8 A, 24 V, 0.6 Ω, 2 ms |
| \(\mu, c_x\) | tyre grip coefficient; drag along the road | 0.8, 2 N s/m |
| \(T_s, N_p\) | controller’s sampling time; samples of road it previews | 1 ms, 250 |
Three combinations of these numbers recur. The mass that moves up and down with the deck, the sprung mass, is \(M_s = M_d + m_l = 2.854\) kg. The mass that the drive must accelerate along the road is larger, because the axles come along and the wheels must also be spun up. A wheel that rolls at speed \(v\) turns at the rate \(v/R_w\) and carries the kinetic energy \(\tfrac12 I_w (v/R_w)^2\), which is the kinetic energy of an extra mass \(I_w/R_w^2\) moving at \(v\). So
\[ M_x = M_s + m_f + m_r + \frac{I_w}{R_w^2} = 5.047\ \mathrm{kg} . \tag{1} \]The pint also adds to the deck’s resistance to turning: its moment of inertia about the deck’s centre, treating it as a point mass at the height \(h_s\), is \(m_l h_s^2\), so \(J = J_0 + m_l h_s^2 = 0.0252\) kg m².
Standing still, each axle carries half of the deck’s weight, \(M_s g a_r/\ell = 14.00\) N, which compresses each axle’s springs by \(14.00/700 = 20.0\) mm. Push the deck down and let go: the four struts act as one spring of stiffness \(2k\) on the mass \(M_s\), so the deck bounces at \(f = \sqrt{2k/M_s}/2\pi = \sqrt{ 1400/2.854 }/2\pi = 3.52\) Hz, with the damping ratio \(\zeta = 2c/(2\sqrt{2kM_s}) = 0.30\) (the damping ratio is the damper’s constant divided by the value that would just stop the bounce from overshooting). The full model of section 4, which lets the tyres and the axles move too, gives 3.47 Hz and 0.28: the one-body estimate is within 1 %. In the same way the deck pitches on its struts with the stiffness \(k(a_f^2 + a_r^2) = 16.94\) N m per radian against the inertia \(J\), at \(\sqrt{ 16.94/0.0252 }/2\pi = 4.13\) Hz. Units: \(\mathrm{N/m}\) divided by \(\mathrm{kg}\) is \(\mathrm{s^{-2}}\), as the square of an angular frequency must be.
03What the stout feels on a tilting deck
A waiter carrying a tray of full glasses tilts the tray back a little when he stops. He is pointing the glasses along the direction in which the drinks feel pulled.
3.1Effective gravity
Fig. 12’s note (section 3.1) shows that in the frame of a glass that accelerates without turning, every parcel of stout obeys Newton’s law as if gravity were replaced by the effective gravity
\[ \mathbf g_\text{eff} = \mathbf g - \mathbf a_S , \tag{2} \]where \(\mathbf g = (0, -g)\) points down, with \(g = 9.81\ \mathrm{m/s^2}\), and \(\mathbf a_S\) is the acceleration of the glass. We write vectors in the road’s frame as (along the road, up). The reason is the same as on a braking bus: the parcel tends to keep its velocity, so seen from the glass it seems pushed by a force \(-\delta m\,\mathbf a_S\) in addition to its weight \(\delta m\,\mathbf g\), and the two act together. The new feature here is that the deck also turns, so different points of the glass accelerate differently. We pick one point, called S, where the stout’s first sloshing mode lives: on the glass’s axis, 92 mm above its inner floor, which puts it \(h_g = 122\) mm above the deck’s centre. Section 3.5 deals with the rest of the glass.
3.2The acceleration of a point on a pitching deck
Let the deck’s centre be at \((X, z_c)\), where \(X\) is the distance along the road and \(z_c\) the height, and let the deck be tilted by the pitch angle \(\theta\), positive when the nose is up. Fixed to the deck are two unit vectors: \(\mathbf e_x = (\cos\theta, \sin\theta)\), forward along the deck, and \(\mathbf e_z = (-\sin\theta, \cos\theta)\), along the glass’s axis. The point S sits at \(h_g\) along \(\mathbf e_z\):
\[ \mathbf r_S = (X - h_g\sin\theta,\ \ z_c + h_g\cos\theta) . \]We differentiate once in time, using the chain rule, \(\mathrm d(\sin\theta)/\mathrm dt = \dot\theta\cos\theta\) and \(\mathrm d(\cos\theta)/\mathrm dt = -\dot\theta\sin\theta\), where a dot means a time derivative:
\[ \dot{\mathbf r}_S = (\dot X - h_g\dot\theta\cos\theta,\ \ \dot z_c - h_g\dot\theta\sin\theta) . \]Differentiating again, each term \(\dot\theta\cos\theta\) gives \(\ddot\theta\cos\theta - \dot\theta^2\sin\theta\) by the product rule, and each \(\dot\theta\sin\theta\) gives \(\ddot\theta\sin\theta + \dot\theta^2\cos\theta\):
The terms in \(\ddot\theta\) are the tangential acceleration: a deck that starts to tip throws S backward or forward like the top of a falling pencil. The terms in \(\dot\theta^2\) make up the vector \(-h_g\dot\theta^2\,\mathbf e_z\), the centripetal acceleration, which points from S back to the centre about which it turns, as for a stone on a string.
★ An earlier version of the cart’s code (Cart4.forces in cart4.py) carried the centripetal term with the opposite sign, \(+h_g\dot\theta^2\,\mathbf e_z\). A finite-difference test confirms (3) to 1 × 10⁻7 m/s² and shows the old form off by up to 1.76 m/s² on a test motion. The difference, \(2h_g\dot\theta^2\,\mathbf e_z\), lies along the glass, so it has no part along \(\mathbf e_x\): the sideways push on the stout, which drives the slosh, was right even then. It made the stout slightly heavier along the glass, by at most \(2h_g\dot\theta^2 = 0.66\ \mathrm{m/s^2}\) on the controlled kerb (7 % of \(g\)) and 8.3 m/s² on the kerb with the control off, from the largest pitch rates stored. The code now follows (3). Every kerb ride and every ride with the control off on this page was computed with the corrected code; the two gentle roads with control (version 2, section 7) were computed before the correction, on roads where the deck barely pitches.
3.3Gravity seen from the glass
The stout is computed in the glass’s own axes, so we need the two components of \(\mathbf g_\text{eff}\) along \(\mathbf e_x\) and \(\mathbf e_z\). Write \(\mathbf a_S = (a_x, a_z)\). Then \(\mathbf g_\text{eff} = (-a_x,\ -(g + a_z))\), and the component along a unit vector is the dot product with it:
\[ g_x = \mathbf g_\text{eff}\cdot\mathbf e_x = -a_x\cos\theta - (g + a_z)\sin\theta, \qquad g_z = \mathbf g_\text{eff}\cdot\mathbf e_z = a_x\sin\theta - (g + a_z)\cos\theta . \tag{4} \]We call \(a_\text{eff} = -g_x\) the sideways acceleration felt by the stout. When it is zero, the effective gravity points straight along the glass, and the stout has no reason to slosh. Setting \(g_x = 0\) in (4) and dividing by \(\cos\theta\) gives
A glass tilted by \(\theta^*\) feels no sideways push. Braking (\(a_x \lt 0\)) asks for the nose up, the top of the glass leaning back; accelerating asks for the nose down. Checks: with \(a_x = 0\) the glass should stand upright, and (5) gives \(\theta^* = 0\); with \(a_x = 0\) and \(\theta = 0\), (4) gives \(g_z = -(g + a_z)\), the stout’s weight changed by the vertical acceleration, as in a lift.
With its control system off, the cart decelerates on the kerb at up to \(7.12\ \mathrm{m/s^2}\), measured by central differences of the stored speed at 60 pictures a second. By (5), with \(a_z = 0\), the glass would have to lean by \(\arctan(7.12/9.81) = 36°\). The struts can change their lengths by at most \(\pm s_\text{max}\), so the most they can tilt the deck is \(\arcsin(2s_\text{max}/\ell) = \arcsin(60/220) = 15.8°\). Leaning alone cannot cancel the kerb. The control system must also make the cart’s change of speed gentler and start before the wheel arrives, as the hand does; with control the largest stored deceleration is 3.08 m/s², which would still call for 17°.
For the controller we need (4) for small angles. With \(\sin\theta \approx \theta\), \(\cos\theta \approx 1\), and products of small quantities such as \(a_z\theta\) and \(\dot\theta^2\) dropped, (3) and (4) give
\[ a_\text{eff} \approx \ddot X + g\theta - h_g\ddot\theta . \tag{6} \]Each term is a way to push the stout sideways: the cart’s acceleration, the tilt (a tilt of \(1°\) lets gravity push sideways with \(g\sin 1° = 0.171\ \mathrm{m/s^2}\)), and the deck’s angular acceleration acting on the lever \(h_g\). A deck that tilts too quickly pushes the stout as hard as one that brakes. As a check of (6): at \(\theta = 0.01\) rad, \(\ddot X = 0.2\ \mathrm{m/s^2}\) and \(\ddot\theta = 1\ \mathrm{rad/s^2}\), the exact (4) gives \(0.17609\ \mathrm{m/s^2}\) and (6) gives \(0.17610\ \mathrm{m/s^2}\).
3.4How the stout answers
Fig. 12’s note (section 4) derives how the stout’s surface rocks in a glass that is pushed sideways. In its slowest mode the surface tips as a whole, up at the front wall and down at the back. Call \(q\) the height of the surface at the front wall above its rest level. For small swings,
The swing behaves as a mass on a spring with friction, driven by the sideways acceleration (6). For the stout with its head of foam, Fig. 12’s free-swing computation measured the natural frequency \(f_0 = \omega_0/2\pi = 2.915\) Hz, the damping ratio \(\zeta = 0.425\) and the drive coefficient \(\beta = 1.241\). The head’s friction on the glass stops a swing within about one period.
Equation (7) is the model the controller uses. The fluid solver does not use it: it computes the whole stout, a million parcels, with (4) as its gravity. Fig. 12’s note also gives a factor \(1 + a_z/g\) on the spring term, the stout’s weight changed by vertical acceleration; the controller’s linear model leaves it out, the solver keeps it through \(g_z\).
The stout fills the glass to 125 mm, its head of foam is 19 mm thick and the rim is at 147.5 mm, so the head’s top stands 3.5 mm below the rim. If the deck tilts by \(\theta\) and the stout settles level, the stout rises at the wall, relative to the glass, by \(R_g\tan\theta\), where \(R_g = 39.1\) mm is the glass’s inner radius at the surface. The head’s top reaches the rim at \(\theta = \arctan(3.5/39.1) = 5.1°\). In Fig. 12’s model the head breaks off once the part above the rim is heavy enough to overcome its yield stress \(\tau_y = 5.41\) Pa, at a height \(e = 2\tau_y/(\phi_f\rho g) = 4.06\) mm above the rim (\(\phi_f = 0.27\) is the liquid fraction of the foam, \(\rho = 1007\ \mathrm{kg/m^3}\) the stout’s density). That needs a steady tilt of \(\arctan\big((3.5 + 4.06)/39.1\big) = 10.9°\). A deck that rocks by a few degrees at the stout’s own rhythm will do it sooner.
3.5The turning glass ★
Equation (2) holds for one point. A glass that turns also pushes on the stout differently at different places. Let a parcel be at \(\mathbf r = r_x\mathbf e_x + r_z\mathbf e_z\) relative to S, with \((r_x, r_z)\) its coordinates in the glass’s axes. Its position in the road’s frame is \(\mathbf r_S + \mathbf r\). The axes turn with the deck: \(\dot{\mathbf e}_x = \dot\theta\,\mathbf e_z\) and \(\dot{\mathbf e}_z = -\dot\theta\,\mathbf e_x\), as differentiating their components shows. Then
\[ \frac{\mathrm d\mathbf r}{\mathrm dt} = \dot r_x\mathbf e_x + \dot r_z\mathbf e_z + \dot\theta\,(r_x\mathbf e_z - r_z\mathbf e_x) , \]and differentiating once more, using the same two rules for the axes,
\[ \frac{\mathrm d^2\mathbf r}{\mathrm dt^2} = \big(\ddot r_x - 2\dot\theta\dot r_z - \ddot\theta r_z - \dot\theta^2 r_x\big)\,\mathbf e_x + \big(\ddot r_z + 2\dot\theta\dot r_x + \ddot\theta r_x - \dot\theta^2 r_z\big)\,\mathbf e_z . \]Newton’s law in the road’s frame says that \(\mathbf a_S + \mathrm d^2\mathbf r/\mathrm dt^2\) equals the force per unit mass: pressure, friction and \(\mathbf g\). Moving every term except \(\ddot r_x\) and \(\ddot r_z\) to the right-hand side gives the acceleration of the parcel as seen in the glass:
where the dots stand for pressure and friction. Beside the uniform effective gravity (4) appear the Euler term (\(\ddot\theta\)), which makes the stout lag behind a glass that starts to turn, the centrifugal term (\(\dot\theta^2\)), which flings it outward from S, and the Coriolis term (\(2\dot\theta\) times the parcel’s own velocity), which deflects moving stout sideways and does no work. These are the forces of a rotating frame [1, section 2.2.1], here with a rotation rate that changes in time.
How large are they? The stout farthest from S is at the edge of the glass’s floor, \(r = 100\) mm away. On the controlled kerb the stored pitch rate reaches 1.64 rad/s, so the centrifugal term stays below \(\dot\theta^2 r = 0.27\ \mathrm{m/s^2}\); with the control off, 5.8 rad/s and 3.4 m/s². The stored angular acceleration reaches 263 rad/s² (control on) and 154 rad/s² (off) in single samples of the 1 ms clock, when a wheel strikes the kerb or a strut its stop; averaged over one stored picture, 1/60 s, it is at most 45 and 117 rad/s². Over a few milliseconds the Euler term can therefore exceed \(g\) at the floor’s edge, though the pitch rate it builds stays small. All three terms are in the fluid solver (Stout.frame_accel in tools/fig12/kaggle/stout_jax.py), and the formula there agrees with (8) to rounding (2 × 10⁻15 m/s² on random states). How much they matter was measured by computing the controlled kerb with them (version 9) and, a day earlier, without them (version 2): the tilt differs by 0.30 mm rms (at most 0.96 mm), while two computations with them that differ only in the random seeding of the particles differ by 0.24 mm rms, both read at the same 121 stored moments. With control, the turning glass changes the ride by about as much as the seeding does.
04How the cart moves
Push down on the front of a parked car and let go: it nods a few times and settles. The cart has such rhythms too, and a bumpy road can find them.
4.1The forces
Each strut pushes the deck up with the force
\[ F_i = -k\,(s_i - s_\text{free}) - c\,\dot s_i + u_i + F_\text{stop}(s_i), \qquad s_f = z_c + a_f\sin\theta - z_f, \quad s_r = z_c - a_r\sin\theta - z_r , \tag{9} \]where \(i = f, r\) labels the front and rear axle, \(z_f, z_r\) are the axles’ heights, \(s_i\) is the strut’s length (the height of the deck’s corner above its axle), \(s_\text{free}\) the spring’s unloaded length, \(u_i\) the actuator’s force and \(F_\text{stop}\) the bump stop, a stiff spring of 20,000 N/m that acts only beyond \(\pm s_\text{max}\) of the static length. Each tyre pushes its axle up with
\[ N_i = \max\big(0,\ k_t\,(z_a(X_i) - z_i) + c_t\,(z_a'(X_i)\dot X - \dot z_i)\big) , \tag{10} \]where \(X_i\) is the axle’s position along the road and \(z_a(X)\) the height the axle would have if the tyre did not squash: the path of the centre of a rigid wheel of radius \(R_w\) rolling over the road’s profile, which rounds a sharp bump. The prime is the slope \(\mathrm dz_a/\mathrm dX\). The \(\max\) says the tyre cannot pull: when the road drops away faster than the wheel can follow, \(N_i = 0\) and the wheel is in the air. On a slope the road pushes the tyre at right angles to the surface, so the load \(N_i\) also pushes the cart back by \(N_i z_a'\) when it climbs. The drive force of the hub motors is \(F_d = n_m b\,i\), with \(i\) the current of each motor, but no more than the rear tyres’ grip \(\mu N_r\) allows.
4.2Newton and Euler
Newton’s second law for the motion along the road, for the deck’s height and for each axle, and the law of rotation for the deck’s pitch, read
\[ \begin{aligned} M_x\ddot X &= F_d - c_x\dot X - N_f z_a'(X_f) - N_r z_a'(X_r) + F_x ,\\ M_s\ddot z_c &= F_f + F_r - M_s g + F_z ,\\ J\ddot\theta &= a_f\cos\theta\,F_f - a_r\cos\theta\,F_r + d\,(M_s\ddot X - F_x) - h_g F_x ,\\ m_i\ddot z_i &= -F_i + N_i - m_i g \quad (i = f, r) . \end{aligned} \tag{11} \]Here \(F_x\) and \(F_z\) are the push of the moving stout on the glass, along the road and upward, which the fluid solver computes from the rate of change of the stout’s momentum (section 6).
★ The pitch equation is the law of rotation about the deck’s centre: \(J\ddot\theta\) equals the sum of the torques, and a force \((F_\parallel, F_\perp)\) (along the road, up) applied at the point \((\Delta X, \Delta z)\) from the centre has the torque \(\Delta X F_\perp - \Delta z F_\parallel\), positive nose-up. The front strut pushes up at \(\Delta X = a_f\cos\theta\), giving \(a_f\cos\theta\,F_f\); the rear one, at \(-a_r\cos\theta\), gives \(-a_r\cos\theta\,F_r\). The arms pass the horizontal force that the deck needs to the deck at their hinges, \(\Delta z = -d\); that force follows from the deck’s own law of motion along the road, \(M_s\ddot X = H + F_x\), so \(H = M_s\ddot X - F_x\) and its torque is \(+dH\): when the cart speeds up, the hinges pull the bottom of the deck forward and the nose rises, as a car squats when it accelerates. The stout pushes at S, \(\Delta z = h_g\), with the torque \(-h_g F_x\). The horizontal levers are taken at \(\theta = 0\), which is accurate to first order in \(\theta\).
4.3The rhythms of the cart
For the controller, (6), (7), (9), (10) and (11) are linearised about steady driving at the speed \(v_0\) on a flat road: every quantity is written as its steady value plus a small change, and only terms of first order in the changes are kept. The result has the form
\[ \dot{\mathbf x} = A\,\mathbf x + B\,\mathbf u + E\,\mathbf w . \tag{12} \]The state \(\mathbf x\) holds twelve numbers: the error of the speed \(\dot X - v_0\) and its time integral \(\sigma\) (how far the cart lags behind a cart that kept \(v_0\)), the deck’s height \(z_c\), pitch \(\theta\) and their rates, the two axles’ heights and rates, and the swing \(q\) and its rate, each measured from its steady value. The input \(\mathbf u = (F_d, u_f, u_r)\) holds what the controller sets. The road input \(\mathbf w\) holds the axle-path height and slope under each axle. \(A\), \(B\) and \(E\) are matrices of fixed numbers, read off from the linearised equations (linear_model in cart4.py). In this linear model the stout feels the deck through (6) and (7), but its push back on the deck is left out.
With the inputs held at zero, the solutions of (12) are combinations of modes, each \(\mathbf x \propto e^{\lambda t}\) with \(\lambda\) an eigenvalue of \(A\). For an oscillating mode \(\lambda = -\zeta\omega_n \pm j\omega_n\sqrt{1 - \zeta^2}\) (\(j^2 = -1\)), so the natural frequency is \(f_n = |\lambda|/2\pi\), the frequency at which a free oscillation rings is \(|\operatorname{Im}\lambda|/2\pi\), and the damping ratio is \(\zeta = -\operatorname{Re}\lambda/|\lambda|\). The eigenvalues of the cart’s \(A\) at 1.0 m/s, computed on Kaggle (tools/fig16/kaggle/modes16.py) and recomputed for this note (notes/fig16/note_numbers.py), give Table 2.
| mode | natural frequency | rings at | damping ratio | largest shares |
|---|---|---|---|---|
| the stout’s swing | 2.92 Hz | 2.64 Hz | 0.43 | swing 1.00 |
| the deck’s heave (up and down) | 3.47 Hz | 3.33 Hz | 0.28 | heave 0.92 |
| the deck’s pitch, with the stout it drives | 4.08 Hz | 3.85 Hz | 0.33 | pitch 0.23, swing 0.75 |
| the rear axle’s hop | 20.40 Hz | 20.28 Hz | 0.11 | rear axle 0.80 |
| the front axle’s hop | 26.34 Hz | 26.08 Hz | 0.14 | front axle 0.85 |
The swing appears unchanged, 2.92 Hz and 0.43, because in the linear model the stout does not push back on the deck. The pitch mode, at 4.08 Hz, is close to the bare deck’s 4.13 Hz of Example 2.1; its eigenvector carries a large swing of the stout, because a pitching deck drives the stout through both \(g\theta\) and \(h_g\ddot\theta\) in (6). The axles hop on their tyres at about \(\sqrt{(k + k_t)/m_r}/2\pi = 20.6\) Hz and \(\sqrt{(k + k_t)/m_f}/2\pi = 26.6\) Hz, which the full model confirms.
4.4Two axles read the road twice
The rear axle meets every bump a time \(t_\ell = \ell/v\) after the front one. The deck pitches when its two ends rise differently and heaves when they rise together, so the pitch is driven by the difference of the two road inputs and the heave by their sum. Take a road that repeats with frequency \(f\) as the cart drives over it, so that the front axle feels \(w_f(t) = W\cos 2\pi f t\) and the rear one \(w_r(t) = W\cos 2\pi f(t - t_\ell)\). Writing \(\alpha = 2\pi f t_\ell\) and using \(\cos A - \cos B = -2\sin\tfrac{A+B}{2}\sin\tfrac{A-B}{2}\),
\[ w_f - w_r = -2W\sin\tfrac{\alpha}{2}\,\sin\!\big(2\pi f t - \tfrac{\alpha}{2}\big), \qquad w_f + w_r = 2W\cos\tfrac{\alpha}{2}\,\cos\!\big(2\pi f t - \tfrac{\alpha}{2}\big) . \]relative to one axle alone. A road whose bumps are a whole number of wheelbases apart cannot pitch the deck, and one whose bumps are an odd number of half-wheelbases apart pitches it twice as hard as a single axle could.
The five 20 mm bumps of Fig. 12 are 0.29 m apart; at 1.0 m/s they arrive 3.45 times a second. With \(\ell = 0.22\) m, (13) gives a pitch drive of \(|2\sin(\pi\times3.45\times0.22/1.0)| = 1.38\) and a heave drive of 1.45. The pitch mode of Table 2 has the natural frequency 4.08 Hz and the damping ratio 0.33. A damped oscillator driven at the frequency \(f\) answers most strongly at \(f_n\sqrt{1 - 2\zeta^2} = 3.60\) Hz, and the bumps come at 85 % of the natural frequency, close to that peak. With the control off, each bump therefore rocks the deck at nearly its own rhythm, and the rocking deck rocks the stout. Section 7 shows what that costs.
05The control system
A good driver does three things at once: she looks at the state of the car, she looks at the road ahead, and she keeps a feel for what she cannot see directly, such as how the load in the back is shifting.
The control system does the same three things, each in a form that can be computed. Every \(T_s = 1\) ms it reads the state, reads 0.25 s of road ahead from the scanner, and estimates the swing of the stout, which no sensor measures directly. Then it sets the three forces \(\mathbf u\). We first write down what “good” means, then find the forces that are best in that sense.
5.1What we ask for
We want the swing small, but not at any price: the deck must stay within the struts’ travel, the forces within what the motors and actuators can give, and the cart must keep roughly to its speed. We express all of this as one number to be made as small as possible, the cost
\[ \mathcal J = \sum_{k=0}^{\infty}\big(\mathbf x_k^\top Q\,\mathbf x_k + \mathbf u_k^\top R\,\mathbf u_k\big)\,T_s , \tag{14} \]where \(\mathbf x_k\) and \(\mathbf u_k\) are the state and the input at the \(k\)-th sample, \(^\top\) means the transpose, and \(Q\) and \(R\) are matrices of weights. A simple and sensible choice is Bryson’s rule [2, exercise 7.16]: make \(Q\) and \(R\) diagonal, each entry one over the square of the largest value of its variable that we are willing to accept. Each term of (14) is then 1 when its variable reaches that value, so all the demands are counted on the same scale. The values used are: swing 0.25 mm and its rate 9.2 mm/s; pitch 4.6° and its rate 1.5 rad/s; deck height 10 mm and its rate 0.2 m/s; axle heights 30 mm and rates 1 m/s; strut strokes 20 mm; speed error 0.05 m/s and its integral 20 mm; drive force 40 N and actuator forces 40 N each. The tight value for the swing says what this machine is for.
5.2Optimal state feedback ★
The controller works with samples, so we first replace (12) by its sampled form \(\mathbf x_{k+1} = A_d\mathbf x_k + B_d\mathbf u_k + E_d\mathbf w_k\), which is exact when the inputs are held constant between samples: \(A_d = e^{AT_s}\), and \(B_d, E_d\) follow from integrating (12) over one sample (the code computes all three with one matrix exponential). To keep the formulas readable we drop the subscript \(d\) in this section and the next.
We use the idea of dynamic programming [3]. Define \(V(\mathbf x)\), the cost-to-go, as the smallest cost (14) that can still be achieved from the state \(\mathbf x\), without road input for the moment. Whatever we do now, the best we can do afterwards is \(V\) of the next state, so
\[ V(\mathbf x) = \min_{\mathbf u}\Big[\mathbf x^\top Q\mathbf x + \mathbf u^\top R\mathbf u + V(A\mathbf x + B\mathbf u)\Big] \](the factor \(T_s\) of (14) is absorbed into \(Q\) and \(R\)). We guess that \(V\) is quadratic, \(V(\mathbf x) = \mathbf x^\top P\mathbf x\) with \(P\) symmetric, and check that the guess reproduces itself. The bracket is then a quadratic function of \(\mathbf u\); its minimum is where its derivative with respect to \(\mathbf u\) vanishes:
\[ 2R\mathbf u + 2B^\top P(A\mathbf x + B\mathbf u) = 0 \quad\Rightarrow\quad \mathbf u = -(R + B^\top PB)^{-1}B^\top PA\,\mathbf x \equiv -K\mathbf x . \]Putting this \(\mathbf u\) back into the bracket, every term is of the form \(\mathbf x^\top(\ldots)\mathbf x\), and the guess holds provided
\[ P = Q + A^\top PA - A^\top PB\,(R + B^\top PB)^{-1}B^\top PA . \tag{15} \]This is the discrete algebraic Riccati equation. It is solved once, before the ride (scipy.linalg.solve_discrete_are).
with \(P\) from (15). The best forces are a fixed linear combination of the state’s twelve numbers. This is the linear quadratic regulator (LQR).
The closed loop \(\mathbf x_{k+1} = (A - BK)\mathbf x_k\) shrinks each mode by the factor \(|z|\) per sample, where \(z\) is an eigenvalue of \(A - BK\). At 1.5 m/s the largest is \(|z| = 0.99745\), below 1, so the controlled cart is stable. A factor \(|z|\) per \(T_s\) is a decay \(e^{-t/\tau}\) with \(\tau = -T_s/\ln|z| = 0.39\) s: this slowest mode is the cart’s speed error settling together with a slow lean of the deck. The least damped oscillating mode of the closed loop rings at 20.2 Hz with the damping ratio 0.11: the rear axle’s hop of Table 2, which the controller leaves almost as it was.
5.3Using the road ahead ★
Now let the road input \(\mathbf w_k\) be known for the next \(N_p\) samples. We repeat the argument with the guess \(V_k(\mathbf x) = \mathbf x^\top P\mathbf x + 2\mathbf x^\top\mathbf s_k + c_k\), where the vector \(\mathbf s_k\) and the number \(c_k\) depend on the road still to come. With \(\mathbf y = A\mathbf x + B\mathbf u + E\mathbf w_k\), the bracket is \(\mathbf x^\top Q\mathbf x + \mathbf u^\top R\mathbf u + \mathbf y^\top P\mathbf y + 2\mathbf y^\top\mathbf s_{k+1} + c_{k+1}\). Setting its derivative with respect to \(\mathbf u\) to zero,
\[ R\mathbf u + B^\top P\mathbf y + B^\top\mathbf s_{k+1} = 0 \quad\Rightarrow\quad \mathbf u = -K\mathbf x - G\,(PE\,\mathbf w_k + \mathbf s_{k+1}), \qquad G = (R + B^\top PB)^{-1}B^\top . \]To find \(\mathbf s_k\) we look at how \(V_k\) changes with \(\mathbf x\). Because \(\mathbf u\) minimises the bracket, a small change of \(\mathbf x\) changes \(V_k\) only through the places where \(\mathbf x\) appears explicitly; the accompanying change of \(\mathbf u\) costs nothing to first order, as at the bottom of a valley. So the gradient of \(V_k\) is \(2Q\mathbf x + 2A^\top(P\mathbf y + \mathbf s_{k+1})\), and its part that does not depend on \(\mathbf x\) must equal \(2\mathbf s_k\). With the optimal \(\mathbf u\) inserted, \(\mathbf y = A_\text{cl}\mathbf x + E\mathbf w_k - BG(PE\mathbf w_k + \mathbf s_{k+1})\), where \(A_\text{cl} = A - BK\) is the closed-loop matrix, so the part of \(P\mathbf y + \mathbf s_{k+1}\) free of \(\mathbf x\) is \((I - PBG)(PE\mathbf w_k + \mathbf s_{k+1})\). Finally \(A^\top(I - PBG) = A^\top - (GPA)^\top B^\top = A_\text{cl}^\top\), using the symmetry of \(P\) and of \(R + B^\top PB\). The result is the backward recursion \(\mathbf s_k = A_\text{cl}^\top(PE\,\mathbf w_k + \mathbf s_{k+1})\). Starting from \(\mathbf s = 0\) beyond the last road sample and unrolling it gives \(\mathbf s_{k+1} = \sum_{j\ge1}(A_\text{cl}^\top)^{j}PE\,\mathbf w_{k+j}\). So:
The first term answers what has already happened. The second acts on what is coming: each future piece of road is weighted by how much the controlled cart will still remember of it when it arrives. The feedback gain \(K\) is the same as without preview.
The same law is stated and proved in [4] (Theorems 4 and 5). As a check of the algebra, we solved the optimisation directly for a small random system with a known disturbance, treating every future state and input as an unknown, and compared the first optimal input with (17): −0.164887 and −0.164887. In the cart the scanner gives the road under the front and the rear axle at 250 future samples, assuming the present speed. The weights fade with \(j\) because \(A_\text{cl}\) is stable: \(\|K_{100}\|/\|K_0\| = 0.29\) and \(\|K_{249}\|/\|K_0\| = 0.033\), so road more than 0.25 s ahead would add little.
5.4Estimating the swing
Every state except the swing is measured directly: speeds and heights by the encoders, the stroke sensors and the IMU. In this model those sensors are ideal. The swing \(q\) is seen only through Fig. 12’s two level probes on the glass’s wall, front and back, which give \(y = (h_\text{front} - h_\text{back})/2\), half the difference of the surface’s heights there, once per fluid step. In the kerb rides with control each probe reads, like a real level sensor, over an area: the median of the surface’s height in nine columns of the grid next to the wall, a patch 4.5 mm square, divided by the first mode’s shape there (0.971) so that it gives the height at the wall. A single column that jumps for one picture cannot move a median. The probes are noisy and their reading includes higher modes and splashes. A Kalman filter [5] combines them with the model (7). It keeps an estimate \(\hat{\mathbf q} = (\hat q, \hat{\dot q})\) and repeats two steps.
Predict, every \(T_s\): advance \(\hat{\mathbf q}\) by the sampled form of (7), driven by \(a_\text{eff}\) as the IMU measures it. Correct, whenever the probes have a new reading \(y\): move the estimate towards it in proportion to the surprise,
\[ \hat{\mathbf q} \leftarrow \hat{\mathbf q} + \mathbf L\,(y - \hat q) . \tag{18} \]The gain \(\mathbf L\) balances trust in the model against trust in the probes. It comes from the filter’s own Riccati equation, given how wrong the model may be (an unmodelled sideways push of 2 (m/s²)² s) and how noisy the probes are (0.8 mm). The result is \(\mathbf L = (0.347,\ 73.6\ \mathrm{s^{-1}})\).
If the probes read 1 mm more than predicted, (18) raises \(\hat q\) by 0.347 mm and \(\hat{\dot q}\) by 73.6 mm/s. The prediction’s error shrinks by the factor \(1 - L_1 = 0.653\) at each correction. Corrections come once per fluid step, on average every 1.85 ms on the kerb, so the filter forgets an error with the time constant \(-1.85/\ln 0.653 = 4.3\) ms, much shorter than a swing (343 ms).
5.5What the hardware allows
The controller asks for forces; the hardware gives what it can. The motor current follows its command with the lag \(\tau_I\), but never beyond \(\pm I_\text{max}\), nor beyond what the battery can drive through the motor’s resistance against its back-voltage, \((\pm V_\text{max} - bv)/R_a\). The force at the road is further limited by the rear tyres’ grip, \(\mu N_r\). The actuators follow their commands with the lag \(\tau_U\), within \(\pm U_\text{max}\).
At 1.5 m/s each motor’s back-voltage is \(bv = 3\times1.5 = 4.5\) V (\(b\) in N/A equals V s/m). The battery could drive \((24 - 4.5)/0.6 = 32.5\) A, more than \(I_\text{max}\), so the current limit decides: \(n_m b I_\text{max} = 48\) N. The tyres’ grip at the static load is only \(\mu N_r = 0.8\times23.81 = 19.0\) N, so on a level road the grip, not the motor, sets the limit. Fig. 12’s motor gave 11.25 N at this speed. On the kerb the controller asked for the full 8 A, and in 12 of the stored pictures between 0.62 s and 0.88 s the rear wheels carried no load and could push nothing at all.
5.6Choosing the weights
Bryson’s rule gives a starting point, not an answer. Before the rides, the notebook itself tried 5 weightings on the kerb with a few-mode model of the stout that had been fitted to and checked against Fig. 12’s stored rides (tools/fig16/slosh_model.py, notes/fig16/model.md). All of them kept the head in the glass in that model; the one with the smallest rise of the stout at the wall was kept, a swing weight of 0.25 mm. Table 3 shows them.
| changed from section 5.1 | wall rise | tilt | largest pitch |
|---|---|---|---|
| nothing (the values of section 5.1 with a swing of 0.50 mm) | 2.23 mm | 4.46 mm | 4.3° |
| swing 1.00 mm | 2.25 mm | 4.49 mm | 5.3° |
| swing 0.25 mm (kept) | 1.77 mm | 3.54 mm | 3.8° |
| swing 0.50 mm, pitch 8.6°, strokes 25 mm | 2.22 mm | 4.44 mm | 4.2° |
| swing 0.50 mm, actuator forces 60 N | 2.63 mm | 5.25 mm | 5.3° |
The model predicted a tilt of 3.54 mm on the kerb; the full fluid computation gave 4.99 mm (section 7). The few-mode model ranks controllers; the fluid solver measures them.
06How the rides were computed
Nothing on this page is computed on your device. Every ride was computed in advance on a rented graphics card and stored, picture by picture.
The stout is Fig. 12’s, computed by Fig. 12’s code unchanged (Fig. 12, section 8): 1,001,952 small parcels of stout carried on a grid of 1.5 mm cells, with the head of foam as a layer of measured thickness and mass on top, and the drops and lumps that leave over the rim followed in flight. A fluid step lasts at most 2 ms and is shortened when the stout moves fast, so that nothing crosses more than 0.8 of a cell in one step; on the controlled kerb the steps averaged 1.85 ms. The only changes are that the solver now receives (4) as its gravity and the turning terms of (8), and, in the rides with the control off, the volume correction described below.
Within each fluid step the cart is advanced in sub-steps of 0.1 ms with the stout’s push of the previous fluid step: each sub-step first updates the velocities from the accelerations (11), then the positions from the new velocities. This is the semi-implicit Euler method, of first order: halving the step halves its error. The current and the actuator forces follow their commands exactly as first-order lags, \(i \leftarrow i_\text{cmd} + (i - i_\text{cmd})e^{-h/\tau_I}\). The controller acts every 1 ms within the sub-steps. The effective gravity handed to the fluid is the average over the sub-steps. After the fluid step, the stout’s push on the glass is computed from the change of its momentum \(\mathbf p\) relative to the glass during the step, \(-(\Delta\mathbf p/\Delta t + \boldsymbol\Omega\times\mathbf p)\) with the turning glass’s rotation (in the glass’s axes, \(\boldsymbol\Omega\times\mathbf p = \dot\theta(-p_z, 0, p_x)\)), and acts on the deck at S.
The rides come from three versions of the Kaggle notebook fig-16-guinness-cart-with-control on a Tesla T4. Version 2 (14 November 2026) computed the two gentle roads with control, storing 30 pictures a second. Version 9 (18 November) computed the kerb with control twice, from two different random seedings of the particles, with the turning terms of (8), the probes of section 5.4 that read over an area, and 60 pictures a second. Version 8 (15 November) computed every road with the control off, with the volume correction described next. Before any ride the pint stood still for 2 s and had to stay flat and full, or the notebook stopped; in version 2 its surface stayed flat to 0.50 mm, under the limit of half a cell, and versions 9 and 8, which would have stopped otherwise, went on to compute their rides. In every stored picture the books close: no parcel of stout is lost, and the head in the glass plus the head broken off equals the head served to within 1.7 × 10⁻8 mL. A fluid step took about 115 ms with control and 197 ms without it, where far more stout is in the air.
The volume correction. After violent splashing the parcels of stout did not close up again: the solver makes the flow incompressible on the grid, but nothing pulled scattered parcels back to their resting spacing, and the surface was read from where any parcel is. A glass that had lost 18 % of its stout was then drawn fuller than at the start. Version 7 adds a correction that nudges the parcels’ positions, never their velocities, back towards their resting spacing, by a second pressure-like solve of the kind proposed in [6]; it acts only while the whole pint has swollen by more than 4 % and does nothing in gentle rides. Measured on the stored pictures, the surface at the end of each ride now stands where the stout still in the glass would fill it at rest to within 1.4 % (kerb), 0.6 % (five bumps) and 1.8 % (one bump) of its volume; the controlled kerb, computed without the correction, to 0.07 %.
Errors to expect. The scatter between the two seedings of the controlled kerb is 0.24 mm rms in the tilt over all 241 stored pictures (at most 0.55 mm), and 0.039 against 0.011 mL in the head spilled; read every kerb number against it. The particle method also damps a swing on its own: on this grid it adds a damping ratio of 0.0152 to the bare stout, 3.6 % of the 0.425 that the head provides.
07What the rides show
The test is the one the hand passes every day: the kerb at walking pace, with the foam to spare.
Every ride is read the same way. The tilt of a stored picture is twice the part of the surface that varies as \(\cos\varphi\) around the glass, \(\varphi\) being the angle from the front, read on a ring just inside the glass from the columns more than one cell from the wall; for a pure first mode it is about \(2q\). The head and stout spilled are the solver’s own books.
| Road | Fig. 12, best controller | Fig. 16, control on |
|---|---|---|
| one sharp 30 mm bump (the kerb), 1.5 m/s | 20.81 mm; 1.63 mL | 4.99 mm; 0.039 mL |
| five 20 mm bumps, 1.0 m/s | 1.00 mm; 0.00 mL | 0.65 mm; 0.00 mL |
| one 25 mm bump, 1.0 m/s | 1.03 mm; 0.00 mL | 0.50 mm; 0.00 mL |
On the kerb the controlled deck pitches by at most 5.4°, the motors ask for their limit of 8 A, the actuators reach 50.0 N of their 50 N, and the struts are pressed 33.7 mm (front) and 30.7 mm (rear) beyond their static length, into the bump stops at 30 mm. The machine is at the edge of what it can do. The second seeding gave 4.58 mm and 0.011 mL.
A peak that lasts a few hundredths of a second can fall between two pictures. The controlled kerb stores 60 pictures a second, and its largest tilt is 4.99 mm, at 0.75 s. Keeping only every second picture, as if 30 a second had been stored, gives 2.58 mm if the even pictures are kept and 4.99 mm if the odd ones are: the peak survives or not depending on where the pictures fall. Fig. 12’s rides store 30 pictures a second, so their peaks in Table 4 may be read low; the comparison flatters Fig. 12.
| Road | largest deck pitch | largest tilt | head spilled (of 91 mL) | stout spilled (of 430 g) |
|---|---|---|---|---|
| the kerb, 1.5 m/s | 20° | 96 mm | 14.4 mL | 76 g |
| five 20 mm bumps, 1.0 m/s | 8° | 79 mm | 14.6 mL | 77 g |
| one 25 mm bump, 1.0 m/s | 9° | 73 mm | 11.2 mL | 40 g |
Without control the deck rocks on its soft struts. Example 3.2 showed that 5.1° of steady tilt brings the head to the rim and 10.9° breaks it off; the uncontrolled deck pitches by 8° to 20°, and not slowly. So the head goes over at the first bump and the stout follows. On the five bumps the deck is driven near its pitch mode (Example 4.1), and each bump adds to the rocking the last one left. With control the deck still moves, but it moves so that the stout feels little sideways push: on the gentle roads the largest tilt is 0.65 and 0.50 mm, and on the kerb the head loses 0.039 mL instead of 14.4 mL.
08What is on the screen
The left pane plays Fig. 12’s best stored ride on the chosen road, the right pane the new cart’s, on one clock. Each stored picture holds the stout’s surface height on the solver’s columns, the head’s thickness, the drops and lumps in flight, the cart’s pose and its control signals; the page draws them and computes nothing physical. The glass, the stout, the head and the drops are drawn by Fig. 12’s own drawing code. The deck is placed by the stored \(z_c\) and \(\theta\), the axles by \(z_f\) and \(z_r\); the actuators’ colour follows the stored \(u_f, u_r\). Under each pane the same stored picture is drawn again in 3D, with the camera riding with the glass.
The readouts are stored values of the right ride at the picture shown: the tilt; the head and stout spilled so far; the deck’s pitch \(\theta\), measured from its first stored value; the hub motors’ current \(i\); the actuators’ forces \(u_f\) and \(u_r\); and the speed \(\dot X\). For Fig. 12, whose files store only the largest tilt, the page reads the tilt of each picture from the stored surface in the same way. The table beside the controls reads the largest values from the rides’ indexes.
Three things are drawn but not stored. The wheels’ angle is the kinematic \(-X/R_w\), drawn at the screen’s rate, so that the spokes do not appear to turn backwards between pictures (the wagon-wheel effect of film). The light, gloss and tint of the 3D close-up are drawing only. And of the drops in flight, at most 2,048 per picture are drawn, an even selection of those stored; the count stored is the true one.
09Limits, and the next model
The cart is planar: both wheels of an axle meet the same road, so it cannot roll sideways, and a real road that lifts one wheel alone would also roll the glass. A three-dimensional cart, with four struts controlled separately, is the next model. Every sensor except the probes is ideal, without noise or delay, and the controller’s linear model leaves out the stout’s push back on the deck, the factor \(1 + a_z/g\) of the swing and the higher modes of the stout; the fluid solver has all of them, so the rides show how much these omissions cost, but the design does not account for them. The few-mode model used to choose the weights (section 5.6) takes its push mass from a fit that the audit of these figures found inflated by the sampling of the stored data (notes/guinness-rebuild/audit.md, item K); only the choice of weights depends on it.
On the kerb the control system is at its limits: the motors at their current, the rear wheels in the air for part of the time, the actuators at their force and the struts on their stops. A taller kerb or a higher speed would need stronger actuators, longer struts, or a lower speed. An earlier computation of the controlled kerb taught one lesson about sensors. Its probes read the surface at two points and extended the line between them out to the wall, which multiplies any error by more than two and a half. At 3.9 s, long after the kerb, single columns of the grid beside one probe jumped by up to 5 mm for one picture, probably where a drop landed at the wall; the filter (18), which trusts the probes strongly, took the jump for a swing, and the actuators answered with up to 28 N. With probes that read the median over an area (section 5.4), the rides on this page stay calm after the kerb: after 3.2 s the actuators push against each other by at most 0.2 N in the first seeding and 4.5 N in the second. A real cart should also check each probe reading against the model before trusting it.
9.1 Differentiate \(\mathbf r_S\) of section 3.2 twice and arrive at (3). Show that the terms in \(\dot\theta^2\) form \(-h_g\dot\theta^2\mathbf e_z\), and explain in one sentence why a centripetal acceleration must point from S towards the deck’s centre.
9.2 Show from (4) that \(g_x^2 + g_z^2 = a_x^2 + (g + a_z)^2\) for every \(\theta\): tilting the glass changes the direction of the effective gravity in the glass’s axes, not its size.
9.3 A cart brakes steadily at 2 m/s² on a level road. Find the waiter’s tilt (5), and the steady swing \(q\) that (7) predicts at the front wall if the deck stays level. (Answer: 11.5°; \(q = -\beta a_\text{eff}/\omega_0^2 = 7.4\) mm with \(a_\text{eff} = -2\ \mathrm{m/s^2}\).)
9.4 Bumps a distance \(\lambda\) apart arrive at \(f = v/\lambda\). Show that the pitch drive (13) is then \(|2\sin(\pi\ell/\lambda)|\) at every speed, and evaluate it for the five bumps. Which spacing would leave the deck unpitched?
9.5 For a single state with \(x_{k+1} = a x_k + b u_k\) and cost \(\sum(Qx_k^2 + Ru_k^2)\), write (15) as a quadratic equation for \(P\) and solve it. Show that \(K \to a/b\) as \(R \to 0\) (the input cancels the state in one step) and \(K \to 0\) as \(R \to \infty\).
9.6 In Example 2.1 the tyres were taken as rigid. Put each axle’s tyre (\(k_t\)) in series with its springs (\(k\)): the combined stiffness is \(kk_t/(k + k_t)\). Recompute the bounce frequency and compare with Table 2.
9.1Further reading
- D. Tong, Classical Dynamics, lecture notes, University of Cambridge, 2004–05: section 2.2.1, the centrifugal and Coriolis forces of a rotating frame.
- K. J. Åström and R. M. Murray, Feedback Systems, 2nd edition, chapter 7, “State feedback”, Princeton University Press, 2021: section 7.5 on linear quadratic regulators, and exercise 7.16 on Bryson’s rule.
- S. Boyd, “Linear quadratic regulator: discrete-time finite horizon”, EE363 lecture 1, Stanford University, 2003–04: the derivation by dynamic programming and the Riccati recursion used in section 5.2.
- J. Liu, L. Lessard and P. Seiler, “Stochastic LQR design with disturbance preview”, arXiv:2412.06662: Theorems 4 and 5 give the optimal use of a known future disturbance, the law (17).
- G. Welch and G. Bishop, “An Introduction to the Kalman Filter”, University of North Carolina at Chapel Hill, TR 95-041 (updated 2004): section 1, the discrete filter’s predict and correct steps, equations (1.9) to (1.13).
- T. Kugelstadt, A. Longva, N. Thuerey and J. Bender, “Implicit density projection for volume conserving liquids”, IEEE Transactions on Visualization and Computer Graphics 27, 2021: why particle methods lose volume, and correcting the particles’ positions without touching their velocities.
- Fig. 12, “A pint of Guinness on a one-wheel cart”, this site: the stout, its first mode (section 4), its head of foam (section 6) and the fluid solver (section 8), all used here unchanged.