The same machine and the same balancing gains, but the motor answers long after it is told: today's delay is two to four times the forty milliseconds the plain loop survives. The controller keeps every command it has sent and carries the measured state forward through the ones still on their way, then acts on where the machine will be when this command lands. Choose how far ahead it guesses. The delay is hidden; the ghost's mismatch is not.
The controller is the lab's LQR, u = −K x̂, where x̂ is the state the model predicts for h steps from now, integrated from the measured state through the commands the controller believes are still on their way. With the horizon equal to the true delay and the model right, the loop behaves as if there were no delay at all. Before you run, an unseen hand holds the machine up with the true delay, so that you can watch your ghost and its mismatch: the force the cart actually felt against the force your predictor assumed, in newtons, over the last four seconds. It is smallest when your horizon is the delay. Cost is ∫(10θ₁² + 10θ₂² + x² + ½(u/umax)²) dt over thirty seconds of growing gusts, plus five per second after a fall. Hidden today: the delay, in whole steps of 4.17 ms, and a top link a little off the model.
Feedback wants the state now, and a delay gives it the state as it was when the last command was sent. Every command since is known, because the controller sent them; the model says what they will do. So the controller integrates forward, over exactly the delay, and closes the loop on the result. The mathematics is exact for the model: the closed loop's characteristic equation loses the delay entirely, which is why a machine that falls at forty milliseconds stands at a hundred and fifty. What it does not lose is the disturbance: a gust is seen at once and answered a delay later, and in that time an inverted pendulum has already moved, so the gusts here are gentler than Kick's. And the guess must be right to the step. A horizon one step long or short at a long delay is a loop that oscillates and falls, and no stiffness saves it, because the error is not a gain but a shift of the whole command history. The mismatch readout is the way in: the machine's answer to a command it received is the one clue about when it received it.
An input delay means the plant integrates a command sent τ ago. The controller knows every command it sent in the last τ, and it knows the model, so it can compute where the state will be when the command it is about to send arrives, and feed that back instead of the stale measurement. The result is called finite spectrum assignment: the infinitely many poles a delay brings collapse to the finite set the gains place. Here the model is the lab's, integrated with the same fourth-order step the plant uses, so with the right horizon and a nominal top link the prediction is exact to rounding.
The price is fragility. The prediction is only as good as the model and the horizon, and an error in either is a shift of the command history, amplified by the plant's unstable modes over the horizon. The robustness to a delay error shrinks like e−pτ for an unstable pole p: at 60 ms this machine forgives a step or two, at 180 ms none. That is the honest shape of the theory, and the reason this game is about finding the delay before it is about holding.
The first delay compensator, for chemical processes with long dead times: run a model of the plant inside the controller, feed back the model's undelayed output, and correct with the difference between the real and the modelled delayed outputs. Nominally the loop sees no delay, and the delay only postpones the response. It does not work for an unstable plant, because the internal model runs open loop and diverges with it; the predictor on this page is the state-space repair (a modified Smith predictor), and reduces to Smith's for a stable one.
Both share the same weakness, and it is the weakness of every model-based fix: they trade robustness to the delay for knowledge of it. A Smith predictor with the wrong dead time can be worse than none. The literature since is largely about how much error survives, and the answer is a margin that closes as the delay grows.
A model plus a guess of the input makes a prediction of the next state; the measured next state disagrees by a residual. When the guess of the delay is right and the model is right, the residual is measurement noise, here nothing. When the horizon is off, the command the model assumes is not the command the motor delivers, and the residual is the difference between them, in newtons, which is large whenever the controller is working. So the readout has a sharp minimum at the true delay, and the minimum is the delay to the step, even though nothing in the loop ever measures time.
This is system identification done by hand: an input–output record and a family of models, and the model whose prediction error is smallest wins. A wrong top link mass leaves a residual the horizon cannot remove, which is how a model error and a delay error can be told apart in principle, and confused in practice. Identify makes the whole game of it.