Chapter 1 · From a balance law to a measured plant
Predict a transient from conservation of energy, then use measurements to decide whether a first-order model is credible.
From first principles
Turn a thermal energy balance into a step response
A well-stirred body of heat capacity \(C\) stores the energy increment \(C\,dT\) for a small temperature increase \(dT\). Assume the ambient temperature \(T_a\) is constant, the heater supplies power \(u\), and heat loss is proportional to temperature excess with coefficient \(H>0\). Conservation of energy then gives a differential equation, with every term measured in watts.
Hold the power at a constant value after a step. The new equilibrium requires zero stored-energy change, hence \(T_\infty=T_a+u/H\). Subtracting that constant solution leaves an equation proportional to the deviation itself, which integrates exponentially.
The steady temperature rise per watt identifies \(1/H\). The time required for the residual deviation to fall to \(1/e\) identifies \(\tau\). Together these observations determine the stored heat capacity as \(C=H\tau\) under the assumed single-temperature model.
Derivation and applications
Identify a first-order time constant without knowing the final level
A thermometer in a stirred bath often stops recording before the new equilibrium is reached. Three equally spaced readings can still determine that equilibrium if a single relaxation dominates. Assume a fixed step in heat input, constant heat capacity and a linear heat-loss coefficient over the observed temperature range. Take the first observation after the input has finished changing. If the sampling interval is \(h\), the unknown remaining difference from equilibrium is multiplied by the same factor \(a\) over every interval.
Subtract successive readings. The unknown equilibrium cancels and the ratio of consecutive increments measures \(a\). The inversion uses differences of readings, so temperature offsets cancel as well. Once \(a\) is known, rearrange the one-step update to recover equilibrium in the original temperature scale.
A fourth reading tests the model against data excluded from the estimate. It can be predicted directly from the last increment. The condition for a stable monotonic first-order response is that \(a\) lie strictly between zero and one. Ratios near unity make the extrapolated final level very sensitive to measurement error.
Worked example
Recover thermal capacity from a short record
A heater adds 6.00 W to a bath initially at equilibrium. At 20.0 s intervals the thermometer reads 20.0, 24.0 and 26.0 °C. The increments give \(a=2/4=0.500\), so \(\tau=28.9\) s and \(T_\infty=28.0\) °C. The heat-loss coefficient is \(6.00/8.00=0.750\) W/K. Multiplying by the time constant gives a lumped heat capacity of 21.6 J/K. The next predicted reading is 27.0 °C.
Change the inputs and inspect this calculation below
Second application
Test whether one relaxation fits a cooling record
An independent 5.00 s interval record reads 90.0, 80.0, 74.0 and 68.0 °C. The first three values give \(a=0.600\) and \(\tau=9.79\) s. They predict a fourth value of \(74.0-0.600(6.00)=70.4\) °C. The residual is \(-2.4\) K. With sensor repeatability of 0.1 K this discrepancy calls for checking the assumption of constant ambient temperature or a single thermal state.
Interactive calculation · Change the inputs of this example
Use the adjustable quantities to test the two worked calculations above. The plot recomputes this derivation’s balance or constitutive relation; its numerical readout reports the quantities needed for the forward calculation and the inverse or design question. Keep the fixed assumptions stated in the readout when comparing with the example values.
Start from this chapter. Read the time constant and gain of the first-order plant, then predict how the fitted closed-loop time scale changes when proportional gain increases.
OneSimulation laboratory · Predict the settling time and offset of a feedback loop
Choose variables that describe stored energy
A heater warms a well-stirred tank. A sensor measures only the liquid temperature, and a controller will eventually change the heating power. Before designing the controller, ask what information fixes the future of the plant when the power is given. If the tank, its contents and the thermometer can be represented by one uniform temperature, a single initial temperature suffices. A slow thermometer or a heavy tank wall may require its own initial condition. This is a physical way of deciding how many states to put in a model.
Let \(C\) in J/K be the combined heat capacity, \(H\) in W/K the thermal conductance to the room, \(T_a\) the ambient temperature and \(u\) the delivered heater power. Over an interval \(dt\) the heater adds \(u\,dt\), the room receives \(H(T-T_a)\,dt\), and storage increases by \(C\,dT\). Taking the limit of a short interval gives
The signs can be checked without solving anything. Set \(u=0\) while \(T>T_a\). Stored energy must decrease. At equilibrium \(\dot T=0\), so a constant 20 W input and \(H=5\) W/K sustain a 4 K excess over the surroundings. This check will later reveal a faulty actuator calibration even if the transient looks smooth.
Separate gain, time scale and initial condition
Choose an operating point \((u_0,T_0)\) in equilibrium, keep the ambient temperature fixed and write \(v=u-u_0\), \(y=T-T_0\). Subtracting the equilibrium balance cancels the constant terms. Dividing by \(H\) gives
where \(K=1/H\) is the steady gain and \(\tau=C/H\) is a time. An input step of amplitude \(v_s\) moves the equilibrium to \(Kv_s\). Subtract this new equilibrium to leave a homogeneous decay equation. Integrating from zero time yields
After one time constant, 36.8% of the initial distance to the new value remains. Reaching a specified fraction of the final temperature and reaching a tolerance relative to the final change are equivalent only if the output is initially zero in the chosen coordinates. Working in temperature deviations makes the convention explicit.
Background · How can three samples reveal a time constant without knowing the final level?
For a stable, noise-free first-order response after a single input step, take three measurements \(y_0,y_1,y_2\) equally spaced by \(h\). Each difference contains the same unknown amplitude. Their ratio isolates the exponential decay.
With one second spacing and readings 2.00, 3.20 and 3.92 V, the ratio is 0.60 and the inferred time constant is 1.96 s. A constant sensor offset cancels. Near the final level both differences become small, so quantisation may dominate the ratio. In real data, evaluate multiple triples or fit all samples with a noise model.
Recover a model from a step experiment
Start from equilibrium and increase the power by 30 W. The final rise is 6 K. At 20 s the rise is 2.36 K. The final measurement identifies the gain and heat-loss conductance.
Next divide the distance still to go at 20 s by the initial distance to the new equilibrium. The logarithm of this dimensionless fraction gives the time constant, which in turn gives the effective heat capacity.
At 60 s the predicted rise is
This third measurement tests a prediction made using the earlier data.
The same experiment can expose a missing state. Plot the logarithm of the remaining fraction against time. A single time constant gives a straight line with slope \(-1/\tau\). If the early trace has a shoulder but the late trace is straight, the sensor or a second thermal mass might be responsible. In the last few samples, the temperature difference in the logarithm may be comparable to measurement noise. Use those samples to estimate the final temperature rather than relying on their individual log slopes.
Transfer the argument to a rotating shaft
With shaft inertia \(J\), viscous drag \(b\) and driving torque \(u\), conservation of angular momentum gives
A suspended flywheel with \(J=0.12\) kg·m² and \(b=0.030\) N·m·s/rad has a 4.0 s time constant. A 0.30 N·m step from rest eventually gives 10 rad/s. The equilibrium gain and transient have the same mathematical form as the thermal problem. Their units and the physical meaning of a disturbance differ. A load torque enters the shaft equation directly. A change in ambient temperature enters the tank balance through \(H\). This distinction matters once the loop must reject disturbances.
Linearise a gravity-drained tank around an operating level
A model identified with one small power step can be accurate locally and fail after the operating point shifts. A tank with a gravity outlet illustrates this without invoking an unknown internal mechanism. Let its horizontal cross-sectional area \(A\) be constant and inlet flow \(q\) be directly controlled. Approximate outlet flow by \(c\sqrt h\), where \(h\) is liquid level above the outlet datum and \(c\) includes effective opening area and gravity. With incompressible liquid, mass conservation reduces to
Both sides of this equation have units of volume per time.
At an equilibrium \(h_0>0\) the inlet is \(q_0=c\sqrt{h_0}\). Set \(h=h_0+\eta\) and \(q=q_0+u\), retaining only terms linear in the deviations. Since the tangent of \(c\sqrt h\) at \(h_0\) is \(c/(2\sqrt{h_0})\), the constant terms cancel and the incremental model is
The gain \(K\) converts inlet-flow change into equilibrium level change, while the time constant contains the additional storage area. Increasing level makes the outlet characteristic flatter, increasing both gain and time constant. At an empty tank the square-root derivative is singular; the small-signal model around a positive level cannot be continued through that point.
Compare a small step with a finite change
Let \(A=0.20\,\mathrm{m^2}\), \(h_0=0.25\,\mathrm m\), and \(q_0=0.0010\,\mathrm{m^3/s}\). Then \(c=0.0020\,\mathrm{m^{5/2}/s}\), \(k_h=0.0020\,\mathrm{m^2/s}\), \(K=500\,\mathrm{s/m^2}\) and \(\tau=100\,\mathrm s\). Increasing inlet flow by \(0.00010\,\mathrm{m^3/s}\) predicts a 0.050 m final rise in the linear model. The exact steady level is \((0.00110/0.0020)^2=0.3025\,\mathrm m\), a rise of 0.0525 m. Initially both models predict \(\dot h=0.00010/0.20=0.00050\,\mathrm{m/s}\), since the level has not yet changed. Immediate slope agreement therefore does not validate the predicted final gain.
Repeat the thought experiment for a 50% inlet increase. The linear result is 0.50 m absolute level, whereas the nonlinear equilibrium is 0.5625 m. The difference now matters for a level limit. An informative commissioning test uses small upward and downward steps of equal amplitude at more than one operating point. The tangent model predicts symmetric final increments; the measured curvature contributes a positive quadratic term to both absolute levels. Comparing that asymmetry with sensor uncertainty can distinguish a genuine level-dependent gain from a drifting measurement zero.
One can reconstruct the physical parameters independently from two parts of a measured step record. If a flow step of \(0.00010\,\mathrm{m^3/s}\) produces an initial level slope of \(0.00050\,\mathrm{m/s}\), the immediate mass balance gives \(A=\Delta q/\dot h(0)=0.20\,\mathrm{m^2}\), without knowing the outlet law. A sufficiently small steady rise of 0.050 m would separately give
Their quotient predicts the 100 s time scale. A sensor mounted behind a narrow side passage could delay the observed initial rise, making this area estimate too large without changing the final level. Comparing a direct sight-glass record with the remote sensor helps locate that additional lag before adding another state to the tank model.
Distinguish delay from a slow first-order response
Three devices have the same DC gain and the same area under their step-error curve, two seconds, but represent different mechanisms. A transport delay contributes a dead interval; two identical first-order states give the factor \((1+t)e^{-t}\) in the step error.

Read values from the plot
| Time after command (s) | Two-second lag | One-second delay, one-second lag | Two cascaded one-second lags |
|---|---|---|---|
| 0 | 0 | 0 | 0 |
| 2 | 0.63212 | 0.63212 | 0.59399 |
| 4 | 0.86466 | 0.95021 | 0.90842 |
| 6 | 0.95021 | 0.99326 | 0.98265 |
| 8 | 0.98168 | 0.99909 | 0.99698 |
Interactive calculation · change the inputs of this example
Allocate more of the total error-area time to pure delay. Compare the dead interval with the initial slopes of the lag models.
The curves below are recalculated from this section’s equations in your browser. The fixed reference plot above remains available for comparison.
Study the full derivation
Estimating velocity from position with a model-based observer · System dynamics, feedback and estimation
An optical encoder returns position and the actuator drive supplies a commanded acceleration. Reconstruct an unmeasured velocity without differentiating successive noisy samples. Derive the observer, explain what a pair of chosen poles guarantees, and predict the tradeoff visible when the encoder carries periodic interference.
Chapter 2 · Transfer functions and connections between systems
Build a model of a sensor-actuator chain from individual balances and determine which responses a measurement can reveal.
From first principles
Eliminate the feedback signal to find a closed-loop transfer
A linear transfer function relates an input perturbation to an output perturbation with zero initial deviations. For example, a first-order balance \(\tau\dot y+y=Ku\) transforms to \((\tau s+1)Y=KU\) because the time derivative transforms to \(sY\) under that initial condition. Thus the plant transfer \(P\) is
Add a controller \(C\) acting on negative feedback from a sensor with transfer \(H\). The error compares reference \(R\) with measured output \(HY\). Write each intermediate relation before eliminating it; feedback makes the command depend on the very output being solved for.
Collect the terms containing \(Y\) and divide by the reference. The common denominator is the characteristic factor of the connected loop.
This signal algebra assumes the subsystems' transfers remain valid after connection. In an actual mechanical or hydraulic interconnection, loading may change the plant equations themselves and must be included before forming the blocks.
Background · Transfer function
State the input, output and zero initial condition. Interconnection signs and unmodelled dynamics affect what a measured closed-loop response represents.
Open full-size diagram
Derivation and applications
Eliminate the states of a motor with electrical back reaction
A voltage-controlled motor resembles a circuit followed by a mechanical stage until the rotor is allowed to generate a back voltage. Consider a rigid rotor with inertia \(J\), viscous drag \(b\), winding resistance \(R\) and inductance \(L\). With constant torque and back-emf coefficients \(k_t,k_e\), use positive armature current for positive torque. Ignore load torque for the voltage-to-speed transfer and start with zero perturbations about a steady operating point. The transformed balances are
Multiply the second balance by the electrical impedance and substitute the first. The back voltage is proportional to the output and opposes the applied voltage. It therefore contributes a positive constant to the denominator.
If the electrical time \(L/R\) is short relative to the mechanical transient of interest, current approximately follows its instantaneous resistive balance. The resulting speed gain and time constant both reflect extra damping supplied by current flowing in response to a speed change.
The reduced model has one state fewer and retains the exact DC speed gain. It predicts an instantaneous current change at a voltage step, so estimates of the initial current derivative still require the full electrical state.
Worked example
Predict the unloaded speed and rise time
Take \(R=2.00\) Ω, \(L=10.0\) mH, \(J=0.0100\) kg m², \(b=0.0200\) N m s/rad and \(k_t=k_e=0.200\) in consistent SI units. The feedback adds \(0.200^2/2=0.0200\) N m s/rad. The mechanical time becomes 0.250 s against an electrical time of 0.00500 s. The gain is 2.50 rad/s/V, so a 4.00 V step produces a final 10.0 rad/s.
Change the inputs and inspect this calculation below
Second application
Infer viscous drag from a DC test
A second motor has \(R=4.00\) Ω and \(k_t=k_e=0.100\) in SI units. A steady 6.00 V produces 30.0 rad/s with no external load. Back voltage consumes 3.00 V, leaving 0.750 A of current and 0.0750 N m torque. Balancing viscous drag gives \(b=0.0750/30.0=0.00250\) N m s/rad. The exact transfer expression then gives \(K_\omega=5.00\) rad/s/V, consistent with the measured voltage and speed.
Interactive calculation · Change the inputs of this example
Use the adjustable quantities to test the two worked calculations above. The plot recomputes this derivation’s balance or constitutive relation; its numerical readout reports the quantities needed for the forward calculation and the inverse or design question. Keep the fixed assumptions stated in the readout when comparing with the example values.
Start from this chapter. Eliminate the error and actuator signals algebraically. Compare the static gain of the resulting closed loop with the final value sampled by the OneSimulation signal graph.
OneSimulation laboratory · Predict the settling time and offset of a feedback loop
Eliminate a state in the transform domain
Chapter 1 gave a differential equation and an initial condition for a single energy store. Cascading several components leads to simultaneous equations. The Laplace transform changes the time derivative into \(sY(s)-y(0)\). Applied to \(\tau\dot y+y=Kv\), this gives
With zero initial deviation the ratio \(G(s)=Y/V=K/(\tau s+1)\) describes the forced response. For nonzero initial state the extra term predicts free decay. This is why an experimental transfer function should identify a particular operating point and initialisation procedure.
The pole at \(s=-1/\tau\) locates the decaying exponential. The DC gain is \(G(0)=K\). The high-frequency magnitude of this model tends to zero because the energy store cannot change its state instantaneously in response to bounded power. A transfer function can thus be assessed from dimensions, a static balance and a short-time thought experiment before any curve fitting.
Connect the sensor and plant
A sensor may have its own lag. Let the actual plant output be \(y\) and the indicated value \(z\). With plant \(G_p=1/(4s+1)\) and sensor \(G_s=1/(s+1)\), the individual relations \(Y=G_p U\) and \(Z=G_s Y\) give
For a unit step divide by \(s\); partial fractions or substitution in the differential equation gives
Check \(z(0)=0\), \(z(\infty)=1\) and \(\dot z(0)=0\). The actual plant slope begins at \(1/4\) per second, but the indicated output starts with a horizontal tangent. At 4 s the plant has reached 0.632 and the indicator only 0.516. A designer who assigns the entire delay to the plant may demand an unnecessarily powerful actuator. A designer who ignores the sensor will underestimate the phase lag in feedback.
Close a loop algebraically
Let \(C(s)\) be a controller and use the indicated output in negative feedback, so \(U=C(R-G_sY)\). Substitute this in \(Y=G_pU\) and collect all terms multiplying \(Y\). The result is
The same denominator occurs in other responses, but the numerator depends on where the signal enters. A disturbance \(D\) added at the plant input gives \(Y/D=G_p/(1+G_pCG_s)\) with zero reference. Measurement noise added to the feedback signal gives
Forcing every disturbance to enter at the reference would predict the wrong amplitudes.
Recognise an invisible mode
A rational expression may simplify by cancellation. Consider a cascade of an integrator-like unstable stage \(1/(s-1)\) and a downstream stage \((s-1)/(s+2)\). The algebraic transfer from external input to final output is \(1/(s+2)\) at zero initial conditions. The state between stages can still grow as \(e^t\). A small mismatch in either factor also leaves an unstable component in the observed output. Physically realising two factors gives internal variables that still need checking even when their product has a well-behaved step response.
For a stable example, the measured lag above can be estimated with a first-order fit from late observations alone. The resulting single pole describes the slow tail but loses the zero initial slope. Choosing the level of model detail therefore requires stating the quantity of interest: a long-time energy estimate and a rapid feedback correction need different bandwidths. The next chapter uses the true characteristic polynomial to determine stability before assessing accuracy of tracking.
Derive two interacting liquid levels before drawing blocks
It is tempting to represent every pair of connected tanks as a cascade of two independent first-order blocks. If the pipe between the tanks is submerged at both ends, the downstream level applies a back pressure to the upstream tank. Consider small deviations \(h_1,h_2\) from equilibrium, with positive forward intertank flow \(q_{12}=(h_1-h_2)/R_1\) and outlet flow \(q_o=h_2/R_2\). The incremental hydraulic resistances measure level difference per flow and have units s/m². They can represent local tangent slopes of nonlinear valve characteristics. Take constant tank areas \(A_1,A_2\) and a perturbation \(u\) of inlet flow.
The two balances are \(A_1\dot h_1=u-q_{12}\) and \(A_2\dot h_2=q_{12}-q_o\). For zero initial deviations, write \(H_1=(1+R_1/R_2+A_2R_1s)H_2\) from the second balance and substitute it into the first. Collecting equal powers of \(s\) leads to
The static gain equals \(R_2\), since at equilibrium all three volume rates are equal and \(h_2=R_2u\). The coefficient of \(s\) contains an interaction term absent if tank 1 drains freely to atmosphere. It describes the return action of the downstream level on intertank flow. An individual transfer block measured with downstream level fixed does not capture this additional path unless it is reconnected explicitly.
Distinguish a loaded connection from a cascade in a step test
Use \(A_1=A_2=0.10\,\mathrm{m^2}\) and \(R_1=R_2=100\,\mathrm{s/m^2}\). Each isolated area–resistance product is 10 s. The interacting transfer function is \(100/(100s^2+30s+1)\). Its decay rates are \((-30\pm\sqrt{900-400})/200=-0.0382\) and \(-0.2618\,\mathrm{s^{-1}}\), giving time constants 26.18 and 3.82 s. Two independent identical drains would instead give \(100/(10s+1)^2\), with repeated time constant 10 s. Both have the same final gain and initial zero slope at the downstream tank.
For a sustained flow increase of \(0.00050\,\mathrm{m^3/s}\), both models predict a 0.050 m final rise. Using the two interacting time constants, the normalised step value at 20 s is \(1-[26.18e^{-20/26.18}-3.82e^{-20/3.82}]/(26.18-3.82)\simeq0.455\), giving 22.8 mm. The independent cascade predicts \(1-(1+2)e^{-2}=0.594\), or 29.7 mm. Recording intermediate levels therefore distinguishes two plant structures that an equilibrium calibration cannot separate. As \(R_1\) approaches zero the two levels equalise rapidly; the limiting first-order time constant becomes \((A_1+A_2)R_2\), consistent with a single tank of combined storage area.
There is also a check that uses both level sensors without differentiating noisy data. Add the original tank balances and integrate over the first 20 s:
The intertank flow disappears identically. In this experiment the added inlet volume is 10.0 litres, so added liquid stored plus additional outlet delivery must equal that quantity. If the two measured storage changes already exceed 10 litres, no passive choice of intertank resistance can explain the data. Conversely, outlet and storage agreement validates the external balance but leaves the internal connection undetermined. The intermediate time reading and knowledge of whether the interconnecting pipe is submerged provide the extra evidence needed for choosing the internal transfer model.
Problem sheet 1 · Modelling a plant and interpreting its signals
Use balances, local linearisation and block diagrams to decide which parameters a commissioning test actually measures.
1. A step on a heated plate
A plate initially in equilibrium at 22 °C receives a further 40 W. Its final temperature is 32 °C and it reaches 28.32 °C after 50 s. (a) Estimate the incremental static gain and time constant. (b) Recover heat capacity and heat-loss conductance in a one-capacity model. (c) Describe a second experiment that could expose a temperature-dependent loss.
Recover the physical coefficients
Write \(C\dot\theta+G\theta=\Delta P\) about the initial equilibrium. The 10 K final increment gives \(K=0.25\) K/W and \(G=4\) W/K. The recorded increment is 63.2% of the final value, giving \(\tau=50\) s and \(C=\tau G=200\) J/K. Repeat a small equal step about a higher initial temperature with the same airflow. A change in incremental gain indicates a changed local loss slope; a second slow exponential could instead indicate another stored-energy state. One measurement at 50 s cannot distinguish these hypotheses.
2. A tank drained by gravity
An open tank of cross-section \(A=0.50\) m² discharges \(q_\mathrm{out}=c\sqrt H\) with \(c=0.020\) \(\mathrm{m}^{5/2}/\mathrm{s}\) and level \(H\) in metres. (a) Find the inflow at a 1 m operating level. (b) Derive the incremental transfer function and predict the rise for a sustained additional 0.002 m³/s. (c) Check the new equilibrium exactly and identify the sign of the approximation error.
Linearise the outflow at the operating level
The balance is
At \(H_0=1\) m, \(q_0=0.020\) m³/s. The slope of the outflow is 0.010 m²/s, so \(\delta H/\delta q=1/(0.50s+0.010)\) in the Laplace domain. Its time constant is 50 s and its final incremental prediction is 0.20 m. The exact new level is
The local model underestimates the rise by 0.01 m because the outflow curve becomes flatter as the level rises.
3. A slow sensor on a fast drive
The transfer functions from torque to speed and from speed to the recorded signal are \(P=2/(1+0.5s)\) and \(H=1/(1+2s)\). (a) Determine the transfer from torque to the recording and its DC gain. (b) For a unit step derive the recording in time. (c) Would the dominant time visible in this record be a good plant-only identification?
Distinguish dynamics by tracing the signal
The recording has transfer \(PH=2/[(1+0.5s)(1+2s)]\) and DC gain 2. Partial fractions for a unit step give
Its value and slope are zero at switch-on, whereas physical speed has initial slope 4 in the chosen units. The late transient is dominated by the sensor's 2 s time constant. An independently calibrated sensor model or a faster sensor separates its effect from the 0.5 s plant response.
Explore the governing equations after solving the sheet: From a balance law to a measured plant; Transfer functions and connections between systems. Compare the assumptions and units before transferring your chosen parameters; the controls may cover a different numerical range from the written exercise.
Chapter 3 · Closed-loop poles, damping and performance
Translate a time-domain requirement into acceptable poles and find when additional gain destabilises a higher-order plant.
From first principles
Connect characteristic roots to decay and oscillation
Near an equilibrium, many closed-loop positioning stages reduce to a constant-coefficient second-order equation. Consider the free response after the reference has become constant. Let \(x\) be deviation from its final value, \(\omega_n>0\) the natural frequency and \(\zeta\) the dimensionless damping ratio. Try an exponential response because time derivatives of an exponential reproduce the same waveform.
For \(0<\zeta<1\) solving the quadratic produces conjugate roots. Their real part sets the exponential decay rate and their imaginary part sets the observed angular oscillation frequency.
Here \(\omega_d=\omega_n\sqrt{1-\zeta^2}\) and the initial displacement and velocity set \(A,B\). A measured period gives \(\omega_d\) while the decaying peak envelope gives \(\zeta\omega_n\). Stable poles describe decay of free modes. The numerator of a forced response also influences how prominently each mode appears.
Derivation and applications
Separate a cubic stability boundary from oscillation frequency
Feedback gain can move an oscillatory pair across the imaginary axis even with every characteristic coefficient positive. Take a continuous linear unity-feedback loop whose open-loop transfer is \(K/[s(s+a)(s+b)]\) with positive \(a,b,K\). The integral mode can represent a position obtained from velocity; the other poles can represent actuator and measurement dynamics. Add unity to the loop transfer and clear its denominator to obtain the closed-loop polynomial.
A marginal oscillation has \(s=i\omega\) with real nonzero \(\omega\). Separate the real and imaginary parts. The imaginary equation sets the frequency without requiring the gain, while the real equation selects the gain that supports it.
At this gain the cubic factors exactly into a real stable pole and a pair of purely imaginary roots. The cubic Routh first column determines which side of the boundary is stable. Its first two entries are positive, making the sign of the third entry decisive for positive gain.
Below the threshold all entries have the same sign. Above it there are two sign changes and therefore two right-half-plane roots. The model treats actuator authority as unlimited and omits nonlinear friction; a finite observed oscillation amplitude requires additional physics beyond the pole crossing.
Worked example
Predict the onset period of a positioning loop
Set \(a=2.00\) s⁻¹ and \(b=8.00\) s⁻¹. Marginal gain is \(K_{\rm crit}=160\) s⁻³. The oscillation has frequency \(4.00\) rad/s, hence period \(2\pi/4.00=1.57\) s. At \(K=120\) s⁻³ the third entry is \(16-12=4.00\), giving stability. At \(K=180\) s⁻³ it is \(-2.00\) and the pair grows.
Change the inputs and inspect this calculation below
Second application
Recover the two lag rates from a marginal test
Another loop reaches marginality at \(K=60.0\) s⁻³ with a measured oscillation of \(\sqrt{10}\) rad/s. The rates have product \(ab=10.0\) s⁻² and sum \(K/(ab)=6.00\) s⁻¹. These observations cannot describe two positive real lag rates because the maximum product at fixed sum is \(6^2/4=9.00\) s⁻². The failed consistency check flags model structure or calibration before attributing a unique time constant to either stage.
Interactive calculation · Change the inputs of this example
Use the adjustable quantities to test the two worked calculations above. The plot recomputes this derivation’s balance or constitutive relation; its numerical readout reports the quantities needed for the forward calculation and the inverse or design question. Keep the fixed assumptions stated in the readout when comparing with the example values.
Start from this chapter. Locate the real closed-loop pole for two controller gains. Compare its inverse magnitude with the time constant fitted to the numerical step response.
OneSimulation laboratory · Predict the settling time and offset of a feedback loop
Relate polynomial coefficients to observed motion
For a normalised second-order system, the free response satisfies \(\ddot y+2\zeta\omega_n\dot y+\omega_n^2y=0\). Substitution of \(e^{st}\) gives
The real part sets the decay rate. For \(0<\zeta<1\), the imaginary part \(\omega_d=\omega_n\sqrt{1-\zeta^2}\) sets the time between successive extrema. Doubling \(\omega_n\) at fixed \(\zeta\) halves all characteristic times but leaves the fraction of overshoot unchanged.
Assume a unit DC gain, a constant numerator and zero initial displacement and velocity. The step response is
Differentiate the bracket together with its envelope. The cosine terms cancel and the remaining derivative is proportional to \(e^{-\zeta\omega_n t}\sin(\omega_dt)\). The first peak occurs at \(t_p=\pi/\omega_d\). Substituting that time gives the fractional overshoot
Design for a specified peak
Suppose a positioning axis may overshoot a 10 mm command by at most 1 mm. Solving the previous expression for the limiting damping ratio gives
At \(\omega_n=5\) rad/s the corresponding poles are approximately \(-2.96\pm4.03i\) per second and the first peak occurs at 0.779 s. A nominal oscillatory second-order system with this damping just meets the 1 mm bound. A zero near the dominant poles, a saturated drive or another slow pole changes the transient, so the result should be checked against the full model after the poles are chosen.
A settling specification differs from a peak specification. The absolute normalised error stays below the envelope \(e^{-\zeta\omega_n t}/\sqrt{1-\zeta^2}\). To guarantee a 2% settling band using this bound, solve \(t\ge-\ln[0.02\sqrt{1-\zeta^2}]/(\zeta\omega_n)\). This conservative time for the example is about 1.40 s. The commonly used \(4/(\zeta\omega_n)\) is a convenient estimate. The envelope bound spells out both the tolerance and its assumptions.
Follow a gain change on a third-order plant
A plant with two lags and an integrator has open-loop transfer \(K/[s(s+1)(s+2)]\) in units normalised to a common time base. Close unity negative feedback. The characteristic polynomial is \(s^3+3s^2+2s+K\). Its coefficients are all positive for \(K>0\), which rules out positive real roots but allows an unstable complex pair. Form the first column of the Routh array: \(1,\ 3,\ (6-K)/3,\ K\). All entries must have the same sign for strict stability. Thus \(0<K<6\).
At \(K=6\) the polynomial factors as \((s+3)(s^2+2)\). The step excites an undamped pair at angular frequency \(\sqrt2\), alongside a decaying component. At \(K=7\) the first-column signs change twice, so two roots have crossed into the right half-plane. The input-output gain alone did not reveal this upper bound. Additional lags allow feedback to arrive out of phase with motion. Chapter 4 reaches the same type of conclusion by examining sine-wave responses, which can often be measured even when coefficients of a polynomial are poorly known.
Find the effect of a finite closed-loop zero
Pole locations specify the available exponential terms of a causal linear response. Their coefficients depend on the numerator and initial condition. To isolate this distinction, choose two positive times \(\tau_1\ne\tau_2\) and a transfer function \(G(s)=(1+T_zs)/[(1+\tau_1s)(1+\tau_2s)]\). It has unit static gain for every \(T_z\), so changing the numerator neither moves the poles nor changes the final unit-step response. For zero initial state and a unit step \(Y(s)=G(s)/s\). Write \(Y=1/s+A/(s+1/\tau_1)+B/(s+1/\tau_2)\).
The initial value \(y(0^+)=0\) gives \(A+B=-1\). The initial-slope theorem gives
equivalently \(-A/\tau_1-B/\tau_2=T_z/(\tau_1\tau_2)\). Solving and transforming back gives
For \(T_z=\tau_1\) one mode has zero coefficient in this particular input–output map. A physical internal state with that mode can still respond to a nonzero initial condition or another input. With \(T_z<0\) the zero lies in the right half-plane and the initial output slope opposes the eventual response. That inverse response can be a serious limitation when interpreting an early excursion as a sign error in the actuator.
Time the undershoot of two competing actuator paths
Consider an actuator that changes a measured quantity through a slow positive effect and an immediate faster opposing effect. Let \(\tau_1=4\) s, \(\tau_2=1\) s and \(T_z=-2\) s. The poles are both stable, and the output approaches one under a unit command. Yet the response is
with initial slope \(-0.50\,\mathrm{s^{-1}}\). Set \(\dot y=0.5e^{-t/4}-e^{-t}=0\). It follows that \(e^{-3t/4}=0.5\), so the minimum occurs after \(t=4\ln2/3=0.924\,\mathrm s\). Its value is
For a 10 mm final position change this model briefly produces about 1.91 mm motion in the wrong direction. A physical travel limit 1.0 mm behind the starting point would therefore be violated even though the real parts of both poles meet a settling-time target. Compare instead \(T_z=0\) with identical poles and DC gain: the initial slope vanishes and the response rises monotonically. Before changing controller gain to correct an observed undershoot, measure which pathway acts first. Inverting the right-half-plane zero with a causal stable feedforward filter is impossible, since exact inversion would introduce an unstable pole.
For this response the first crossing back through the initial position is later than the minimum. Let \(u=e^{-t/4}\); solving \(1-2u+u^4=0\) gives the trivial root \(u=1\) at release and a further root near 0.544. Thus the measured position remains on the wrong side for about \(-4\ln(0.544)=2.44\) s. A simple diagnostic that samples only once after two seconds would label the overall gain as negative. At one minute the same test reads nearly the full positive change. Recording the full waveform distinguishes an initial inverse response from an overall sensor polarity error. A disturbance entering the two paths at a different location can exhibit yet another zero, which is why a zero should always be quoted for a specified input and output.
OneSimulation · Which path is responsible for the initial undershoot?
Two stable first-order actuators contribute to the same output. Give the slow path gain \(+2\) and a two-second time constant, the fast path gain \(-1\) and a quarter-second time constant. Both start at rest and receive the same unit step. Predict the direction of the first and last movements from the initial slope and final value.
Integrate the two state equations using the fourth-order OneSimulation time stepper and compare every sample with the exponential solution. The grid minimum is −0.436 at 0.40 s. The component curves identify the mechanism. Initially the negative path builds up fastest; once it has nearly settled the slow positive path continues to grow. Vary the two time constants while keeping their gains fixed to see when the initial slope changes sign.
"""A positive step drives two stable paths with opposite output signs."""
import matplotlib.pyplot as plt
import numpy as np
from onesim.numerics.time.methods.backends.fixed_step import FixedStepRungeKutta
tau = np.array([2., 0.25]) # seconds, slow and fast paths
weights = np.array([2., -1.])
solver = FixedStepRungeKutta("rk4")
run = solver.integrate(lambda t, x: (1-x)/tau, np.zeros(2), 0., 8., step=0.02)
t = run.times
terms = run.states * weights
output = terms.sum(axis=1)
reference = (1-np.exp(-t[:, None]/tau)) @ weights
assert np.max(abs(output-reference)) < 1e-6
index = np.argmin(output)
print(f"First minimum on the grid: {output[index]:.3f} at {t[index]:.2f} s")
fig, ax = plt.subplots(figsize=(7, 4), constrained_layout=True)
ax.plot(t, terms[:, 0], "--", color="#51809c", label="Slow path")
ax.plot(t, terms[:, 1], ":", color="#a5442e", label="Fast path")
ax.plot(t, output, color="#19596a", label="Measured sum")
ax.axhline(0, color="0.5", linewidth=0.7)
ax.set(xlabel="Time after unit step (s)", ylabel="Normalised output")
ax.legend()
fig.savefig("control-engineering.png", dpi=170)

Change the inputs of this exact example and compare the recalculated curves with the recorded OneSimulation output above. The browser evaluates the stated analytical or modal reference.
Assign the poles of a spring-mounted positioning stage with PID
A positioning loop can measure displacement, accumulate position error and damp measured motion. Let a stage of mass \(m\), viscous damping \(c\) and return spring \(k\) obey \(m\ddot y+c\dot y+ky=u+d\), with actuator force \(u\) and disturbance force \(d\). The controller uses \(e=r-y\), \(\dot z=e\), and \(u=K_pe+K_iz-K_d\dot y\). Differentiating the measured position supplies damping without turning a step in commanded position into an impulsive force command.
To find the natural motion, set \(r=d=0\) and substitute \(u=-K_py+K_iz-K_d\dot y\). Move the feedback terms to the left and differentiate once to eliminate \(z\), using \(\dot z=-y\). The resulting characteristic polynomial is
The derivative gain adds viscous damping, the proportional gain adds stiffness, and closing an integral loop adds a state. At any stable equilibrium with a constant reference, \(\dot z=0\) requires \(y=r\). The integrator can then supply whatever constant force the spring and disturbance require, within actuator limits. The transient still depends on how the reference enters the controller.
Take \(m=2.0\,\mathrm{kg}\),
Suppose the desired poles are \(-2,-3,-4\,\mathrm{s^{-1}}\). Multiplying the three factors gives the desired polynomial \(2(s+2)(s+3)(s+4)=2s^3+18s^2+52s+48\). Comparing coefficients produces \(K_d=15\,\mathrm{N\,s\,m^{-1}}\),
For a 20 mm command from rest the initial proportional force is \(0.940\,\mathrm N\). At the final resting position with \(d=0\), the spring needs \(0.100\,\mathrm N\). \(K_i z\) supplies it and the proportional contribution is zero. A filtered derivative introduces an additional pole, so this ideal coefficient match must be checked again against the implemented controller bandwidth.
Practise on sheet 2 · Assign a repeated pole and check a holding-force constraint. Further reading · MIT · 16.06 Principles of Automatic Control · Lecture 10, PID Control.
Settle a tracking step without hiding its peak
Apply a unit step to a unity-DC second-order transfer function with no zeros. Keep natural frequency fixed. The first maximum occurs when \(\omega_d t=\pi\); use the waveform both to check the overshoot formula and to see how late oscillations affect a settling band.

Read values from the plot
| Time × natural frequency | Damping ratio 0.25 | Damping ratio 0.55 | Damping ratio 0.8 |
|---|---|---|---|
| 0 | 0 | 0 | 0 |
| 3 | 1.4306 | 1.0794 | 0.90282 |
| 6 | 0.82772 | 1.0124 | 1.0122 |
| 9 | 1.0621 | 0.99325 | 1.0003 |
| 12 | 0.98137 | 1.0016 | 0.99989 |
Interactive calculation · change the inputs of this example
Move through critical damping and compare overshoot, peak time and the duration of the tail.
The curves below are recalculated from this section’s equations in your browser. The fixed reference plot above remains available for comparison.
Chapter 4 · Frequency response, disturbance rejection and robustness
A loop that tracks slowly changing commands may amplify a disturbance at another frequency. Work from the sinusoidal response to a defensible choice of bandwidth.
From first principles
Read sinusoidal tracking and disturbance rejection from one loop
For a stable linear time-invariant plant driven at angular frequency \(\omega\), time derivatives of \(e^{i\omega t}\) multiply it by \(i\omega\). After transients decay, the ratio of complex output and input amplitudes is therefore the transfer function evaluated at \(s=i\omega\). Its magnitude measures the amplitude ratio; its argument measures phase shift. With an ideal negative-feedback sensor define loop transfer \(L=PC\) for plant \(P\) and controller \(C\).
Here \(D\) is a disturbance added to the physical output. Rearrangement separates the contributions of the command and disturbance at the same frequency.
Adding the two ratios gives \(S+T=1\). Large loop magnitude generally permits tracking and disturbance reduction at low frequency. When the loop phasor approaches \(-1\), the common denominator becomes small; phase information is therefore essential when interpreting a measured gain curve.
Derivation and applications
Infer damping and bandwidth from a resonant frequency sweep
A measured sinusoidal peak need not occur at the undamped natural frequency. Consider a stable second-order plant with positive static gain \(K\), no finite zero and transfer \(G(s)=K\omega_n^2/(s^2+2\zeta\omega_ns+\omega_n^2)\). A slow swept-sine test measures the steady response after transients have decayed. With the frequency ratio \(r=\omega/\omega_n\), the squared magnitude has a denominator that is a quadratic in \(r^2\).
Find the minimum of the denominator at a positive frequency by differentiating with respect to \(r^2\). A positive root requires \(\zeta<1/\sqrt2\). Substitution at this root gives the peak gain relative to the measured static gain.
A different frequency occurs where the gain has fallen to \(K/\sqrt2\). Set the squared denominator to two and select the positive root in \(r^2\). This bandwidth is referenced to the DC gain, even when the system has a large resonant peak.
The location of the measured peak approaches \(\omega_n\) only for small damping. As damping approaches the threshold from below, the peak moves to zero frequency and becomes difficult to distinguish from the static response.
Worked example
Interpret a peak in a stage measurement
A stage has \(\zeta=0.300\) and \(\omega_n=20.0\) rad/s. The predicted peak occurs at \(20\sqrt{0.820}=18.1\) rad/s. Its amplitude is \(1/[0.600\sqrt{0.910}]=1.75\) times the static response. The DC-referenced bandwidth is
A test recording only the peak frequency would therefore underestimate the bandwidth.
Change the inputs and inspect this calculation below
Second application
Estimate damping without measuring phase
A second stage shows a peak twice its static gain at 12.0 Hz. Solving \(4\zeta^2(1-\zeta^2)=1/4\) on the resonant branch gives \(\zeta^2=(1-\sqrt{3/4})/2\) and \(\zeta=0.259\). Its natural frequency is
The phase should be \(-90^\circ\) there, offering a separate frequency-response check on the no-zero model.
Interactive calculation · Change the inputs of this example
Use the adjustable quantities to test the two worked calculations above. The plot recomputes this derivation’s balance or constitutive relation; its numerical readout reports the quantities needed for the forward calculation and the inverse or design question. Keep the fixed assumptions stated in the readout when comparing with the example values.
Read a complex gain as an experiment
Drive a stable linear plant with a small sinusoid about its operating point. Once the transient dies away, the output is a sinusoid at the same angular frequency. Inserting \(u=Ue^{i\omega t}\) and \(y=Ye^{i\omega t}\) in the differential equation gives
The modulus gives the amplitude ratio and the argument gives the time shift as a fraction of a cycle. The units on a Bode plot matter: for a dimensional plant gain its magnitude in decibels presupposes a reference gain. The product around a feedback loop is dimensionless.
For \(P=K/(1+s\tau)\), the modulus falls to \(K/\sqrt{2}\) at \(\omega=1/\tau\), where its phase is \(-45^\circ\). Above this break, doubling frequency roughly halves the output amplitude. Adding a transport delay multiplies the frequency response by \(e^{-i\omega T}\); the magnitude is unchanged while phase falls by \(\omega T\) radians. A magnitude measurement alone cannot detect this mechanism.
Background · How does a timing offset appear in a measured frequency response?
If the output data acquisition channel lags the input clock by a fixed \(\Delta t\), every recorded sinusoid has the correct amplitude but an additional phase lag. Multiplying the physical response by the time-delay factor gives
At 20 Hz a 5 ms offset produces a −36° phase error. At 2 Hz it produces only −3.6°. If the magnitude agrees with a plant model but the unwrapped phase discrepancy grows nearly linearly with frequency, repeat the sweep with a common input pulse on both acquisition channels. A real process delay and a clock offset have the same transfer factor but different remedies.
Derive the sensitivity functions
Let \(u=C(r-y-n)\) for command \(r\) and sensor noise \(n\), with disturbance \(d\) added directly to the physical plant output \(y=Pu+d\). Substitution gives
The identity \(S+T=1\) holds for complex numbers at each frequency. A slow output disturbance is strongly rejected when the loop gain is large and far from \(-1\). Sensor noise at the same frequency is then nearly reproduced by the physical output with opposite sign. At high frequencies a deliberately small loop gain protects the output against measurement noise. If the disturbance enters at the actuator instead, its output transfer function is \(PS\). Mark its point of entry before reading any plot.
How much delay can a loop tolerate?
For a unity feedback loop take \(L(s)=4/[s(1+s)]\), with time in seconds. A unity-gain crossover satisfies \(\omega^2(1+\omega^2)=16\). The positive root gives
At that frequency the phase is
A further \(28.0^\circ\) of lag would bring the Nyquist curve through \(-1\), where the closed-loop denominator vanishes. For pure delay alone the first corresponding delay is about \(0.489/1.88=0.260\) s. A 0.10 s delay consumes about \(10.8^\circ\) at crossover.
This estimate uses this plant's unique gain crossover and its initially stable closed loop. Multiple crossovers, unstable plant poles and poorly measured resonances require inspection of the entire Nyquist curve. Even before a pole crosses into instability, the distance to \(-1\) controls amplification: \(|S|=1/|1+L|\). For example \(L=-0.9+0.1i\) gives \(|S|=7.07\). A loop with low steady error may therefore magnify a narrow band of disturbance by a factor of seven.
Translate specifications into a measurement
Suppose a speed drive must reject load variations below 0.5 rad/s while its encoder contains noise above 20 rad/s. First locate the disturbance and noise on the block diagram. Specify maximum allowed output amplitude per unit amplitude at each point. Shape the gain, then inspect the two resulting transfer functions across the entire frequency range, including the transition between bands. Raising proportional gain alone shifts the crossover into regions of additional lag. A measured resonance there can set the achievable speed even when the motor model at low frequency is excellent.
Derive the phase contributed by a lead compensator
Suppose a plant has enough low-frequency authority to reject a slowly varying disturbance, but its phase at the desired gain crossover leaves too little damping margin. A real lead compensator \(C(s)=K(1+s/\omega_z)/(1+s/\omega_p)\) with \(0<\omega_z<\omega_p\) contributes phase \(\phi=\arctan(\omega/\omega_z)-\arctan(\omega/\omega_p)\). It also raises gain towards high frequencies. A useful design therefore fixes the desired crossover, calculates the new phase there and then accounts for the gain change rather than assuming crossover stays where it was.
Differentiate phase with respect to \(\ln\omega\). Its stationary point satisfies \((\omega/\omega_z)/[1+(\omega/\omega_z)^2]=(\omega/\omega_p)/[1+(\omega/\omega_p)^2]\), giving \(\omega_m=\sqrt{\omega_z\omega_p}\). Let \(\alpha=\omega_z/\omega_p<1\). At this frequency the magnitude ratio excluding \(K\) is \(1/\sqrt\alpha\) and \(\sin\phi_{\max}=(1-\alpha)/(1+\alpha)\). One can consequently choose a target phase, infer \(\alpha\), centre the lead at crossover and determine \(K\) from \(|CP|=1\).
The increased gain at high frequency can pass measurement noise into the actuator. Check the control-signal sensitivity as well as the output’s disturbance attenuation, particularly when the plant attenuates high frequencies and the sensor has its own noise floor.
Design a compensator from a measured frequency point
Take the normalised positioning plant \(P(s)=1/[s(1+0.2s)]\) and target crossover 5 rad/s. Its magnitude there is \(1/[5\sqrt2]=0.1414\); phase is
A constant gain chosen for that crossover would leave 45° phase margin. Allow an extra 15° of phase for a target 60° nominal margin before measurement delay. Choosing 15° peak lead gives
The zero and pole are placed at \(5\sqrt\alpha=3.84\) and \(5/\sqrt\alpha=6.52\) rad/s.
The lead factor’s magnitude at crossover is \(1/\sqrt{0.589}=1.303\), so
The loop crosses with phase −120°, leaving the intended nominal margin. A previously omitted 20 ms pure delay adds \(-5(0.020)=-0.100\) rad, or −5.73°, at this point without changing magnitude. The resulting margin is approximately 54.3°. The compensator gain tends to \(K/\alpha=9.22\) at high frequency, compared with the proportional-only crossover gain 7.07. A noisy encoder can therefore change the actuator demand when this seemingly modest phase correction is installed. Verify the measured return ratio near crossover and observe the actuator spectrum above it after implementation.
Estimate the timing allowance explicitly by converting the margin reserve back into seconds. If the specification requires at least 45°, a nominal 60° design has 15° available for a pure delay at its unchanged crossover. The maximum delay under this model is \(15\pi/[180(5)]=0.0524\,\mathrm s\), leaving about 32 ms beyond the omitted 20 ms. This is a local phase-margin budget and assumes a single relevant gain crossover and a stable Nyquist configuration. An unmodelled resonance can create another crossover with a smaller margin. The frequency measured by a signal generator may be labelled in hertz; the relevant crossover here is
Mistakenly using five hertz in the delay calculation would consume more than six times the actual phase and lead to an unnecessarily severe timing constraint.
Use a winding count when the uncontrolled plant is unstable
A gain or phase margin read at a single crossover can hide unstable modes if the open loop already has right-half-plane poles. For negative unity feedback the closed-loop characteristic condition is
Trace the boundary of the right half-plane up the imaginary axis from \(-i\infty\) to \(+i\infty\) and return on a large semicircle to the right. This contour runs clockwise. Assume a strictly proper rational loop with no poles or characteristic roots on the contour, and no hidden unstable pole cancellations.
A factor \(s-z\) with \(z\) inside contributes one clockwise turn of \(F\). An enclosed denominator factor contributes a turn in the opposite direction. If \(Z\) is the number of right-half-plane zeros of \(F\) and \(P\) its number of right-half-plane poles, the net counterclockwise winding of \(F\) about zero is \(P-Z\). Equivalently, count the turns \(N\) of \(L\) about \(-1\) with counterclockwise positive. Then \(Z=P-N\). Closed-loop stability requires \(N=P\) under this stated contour and sign convention.
Consider a linearized temperature imbalance with loop transfer \(L(s)=K/(s-a)\), where \(a=2\,\mathrm{s^{-1}}\) and \(K>0\) has the same unit. The unregulated imbalance grows exponentially. Along \(s=i\omega\), the real and imaginary parts of \(L\) are \(-Ka/(a^2+\omega^2)\) and \(-K\omega/(a^2+\omega^2)\). Completing the square shows a circle centred at \(-K/(2a)\) on the real axis with radius \(K/(2a)\). Increasing frequency traces its upper half first and then the lower half, one counterclockwise turn. At \(K=3\,\mathrm{s^{-1}}\) the circle spans \([-1.5,0]\) and encloses \(-1\). Hence \(P=1\), \(N=1\), \(Z=0\). At \(K=1.5\,\mathrm{s^{-1}}\) the circle spans only \([-0.75,0]\), giving \(Z=1\). The explicit characteristic root \(s=a-K\) confirms both conclusions. At \(K=a\) the locus passes through \(-1\) at zero frequency and the closed loop has a pole at the origin.
Practise on sheet 2 · Explain why a stable three-lag plant can acquire two unstable poles. Further reading · University of Washington · X. Chen, Introduction to Control Theory (ME 545) · Lecture 24, Nyquist Stability: Encirclements and the Nyquist Criterion.
Where does load rejection give way to noise sensitivity?
For unity feedback with loop transfer \(4/[s(1+s)]\), inject the disturbance at the plant output and the noise at the sensor. Plot the magnitudes of the resulting two closed-loop maps. The identity \(S+T=1\) involves phase and does not imply that their magnitudes add to one.

Read values from the plot
| Angular frequency (rad/s) | Output disturbance |S| | Sensor noise |T| |
|---|---|---|
| 0.03 | 0.0075049 | 1.0002 |
| 0.1687 | 0.043039 | 1.0063 |
| 0.94868 | 0.40336 | 1.2338 |
| 5.3348 | 1.1566 | 0.15977 |
| 30 | 1.0045 | 0.0044618 |
Interactive calculation · change the inputs of this example
Increase gain and observe both low-frequency rejection and resonance amplification. The magnitudes do not obey a scalar sum rule.
The curves below are recalculated from this section’s equations in your browser. The fixed reference plot above remains available for comparison.
Study the full derivation
Sensitivity, bandwidth and the integral price of disturbance rejection · System dynamics, feedback and estimation
A regulator attenuates a slowly varying output load yet amplifies another disturbance at a higher frequency. Separate the paths by which reference, measurement noise and physical disturbance reach the recorded variable, then derive an integral identity that explains why a stable loop can redistribute sensitivity across frequency.
Problem sheet 2 · Pole placement, gain and phase
Design a second-order transient, examine a hidden stability limit, and test a delay budget against a frequency response.
1. Select damping from a peak
A unity-static-gain second-order system has no zeros. Specify 10% overshoot and first peak at 1 s after a step. (a) Derive damping ratio and damped frequency. (b) Find the desired characteristic polynomial. (c) State which prediction fails if a numerator zero is added and the poles are held fixed.
Start with the logarithm of the overshoot
The positive logarithmic decrement to the first peak is \(-\ln(0.10)=2.303=\pi\zeta/\sqrt{1-\zeta^2}\), giving \(\zeta=0.591\). The damped frequency is \(\omega_d=\pi\) rad/s, and the exponential decay rate is \(2.303\) s⁻¹. The poles are \(-2.303\pm3.142i\), so the monic polynomial is \(s^2+4.605s+15.17\). A zero changes the residues and the step shape. The poles still give the natural frequencies and decay rates, but first-peak time and overshoot need recalculation.
2. Three time constants and one gain
For \(L=g/[s(s+1)(s+3)]\) under unity negative feedback, (a) derive the closed-loop characteristic polynomial, (b) find the positive gain range for stability and the crossing frequency, and (c) compare the pole result with the open-loop frequency response at the crossing.
Locate the imaginary-axis pair
The polynomial is \(s^3+4s^2+3s+g\). The first column of the Routh array is \(1,4,(12-g)/4,g\); all signs agree for \(0\lt g\lt12\). At \(g=12\) factor the polynomial as \((s+4)(s^2+3)\). The crossing frequency is \(\sqrt3\) rad/s, with the third pole still at \(-4\). Substituting \(s=i\sqrt3\) in the open-loop denominator gives \(-12\), so \(L=-1\) at the same gain and frequency.
3. Delay on a positioning stage
With \(L=2/[s(1+s/2)]\), (a) find the gain crossover, (b) estimate the delay that would use all phase margin, and (c) evaluate the remaining margin after including 0.10 s delay. Count angles consistently.
Convert delay to a phase at crossover
Writing \(x=\omega_c^2\) gives \(x(1+x/4)=4\), so
The phase margin is \(90^\circ-\arctan(1.572/2)=51.8^\circ\), or 0.905 rad. A pure delay leaves the crossover magnitude fixed, so the first crossing occurs at about \(0.905/1.572=0.576\) s. A 0.10 s delay costs 0.157 rad or 9.0°, leaving approximately 42.8°. This calculation assumes the given loop is otherwise accurately modelled.
Assign a repeated pole and check a holding-force constraint
A second stage has \(m=1.0\,\mathrm{kg}\),
Select the PID gains for poles at \(-2,-2,-5\,\mathrm{s^{-1}}\). A constant \(+0.50\,\mathrm N\) force then acts on the stage while its position command is \(+0.020\,\mathrm m\). Determine the holding force and whether an actuator limited to \(\pm0.30\,\mathrm N\) can achieve zero steady position error.
Show the worked solution
Subtract the passive coefficients to obtain \(K_d=7.0\,\mathrm{N\,s\,m^{-1}}\),
At rest the plant requires \(u=kr-d=6(0.020)-0.50=-0.38\,\mathrm N\), outside the range. Even with \(u=-0.30\,\mathrm N\), the equilibrium is
The pole assignment describes unsaturated dynamics. Tuning the three gains cannot provide the missing holding authority.
Revisit chapter 3 · Assign the poles of a spring-mounted positioning stage with PID.
Explain why a stable three-lag plant can acquire two unstable poles
Three identical first-order lags with one-second time constants give \(L(s)=K/(1+s)^3\), using seconds as the time unit. Find the frequency at which the locus reaches the negative real axis and the corresponding critical positive gain. For \(K=27\), determine the unstable pole count and the signed Nyquist winding.
Show the worked solution
The loop phase is \(-3\arctan\omega\), so \(-\pi\) is reached at \(\omega=\tan(\pi/3)=\sqrt 3\,\mathrm{rad\,s^{-1}}\). The magnitude there is \(K/(1+3)^{3/2}=K/8\). The critical gain is 8. At \(K=27\), solve \((s+1)^3=-27\). The three roots are \(-4\) and \(0.5\pm i(3\sqrt3/2)\), so \(Z=2\). Since the three open-loop poles all lie at \(-1\), \(P=0\) and \(N=P-Z=-2\), two net clockwise turns. At the critical gain a conjugate pair lies on the imaginary axis and the winding through the critical point is undefined.
Revisit chapter 4 · Use a winding count when the uncontrolled plant is unstable.
Explore the governing equations after solving the sheet: Closed-loop poles, damping and performance; Frequency response, disturbance rejection and robustness. Compare the assumptions and units before transferring your chosen parameters; the controls may cover a different numerical range from the written exercise.
Identify a controller from a finite-time observation
A zero-initial-state, first-order proportional-feedback loop has plant static gain 2. A unit step gives error 0.11331 at six fitted closed-loop time constants. The fitted time constant is 2.22222 s. Infer the controller gain and the original plant time constant, retaining the residual exponential at the sample time.
Work through the solution
The first-order error is
Thus \(e_\infty=(0.11331-e^{-6})/(1-e^{-6})=0.11111\) to rounding. With negative unity feedback, \(e_\infty=1/(1+2K_p)\) gives \(K_p\simeq4.00\). The closed-loop denominator gives \(\tau_c=\tau_p/(1+2K_p)\), so \(\tau_p\simeq20.0\) s. Treating the sampled error as the asymptotic value would slightly underestimate gain.
Vary the corresponding laboratory reference interactively. Compare the recalculated observable with the recorded OneSimulation runs and the approximation used in this exercise.
Chapter 5 · States, reachability and estimation
Two mechanisms can produce the same output at one instant and different outputs an instant later. Determine what the actuator can change and what a sensor history can reveal.
From first principles
Build a position and velocity state model from force balance
For a moving mass \(m\) acted on by commanded force \(u\), a spring \(k\) and viscous drag \(b\), Newton's second law relates acceleration to present displacement and velocity. Assume constant coefficients, a rigid base and small linear motions. Defining \(x_1\) as position and \(x_2\) as velocity turns the second-order relation into two first-order state equations.
State feedback chooses force from the measured or estimated state. For \(u=-k_px_1-k_vx_2+nr\), the command \(r\) also supplies a reference input. Collecting terms yields the closed-loop position equation.
Comparing its characteristic polynomial with a desired \(s^2+2\zeta\omega_ns+\omega_n^2\) determines both feedback coefficients directly.
With \(n=k+k_p\), a constant position reference is reproduced at equilibrium in the nominal unloaded model. Position measurements alone cannot specify the instantaneous force law until velocity is also measured or reconstructed from the sensor history.
Background · Observability
Full column rank in the standard finite-dimensional linear model allows the initial state to be inferred from ideal output history. Noise still controls achievable precision.
Derivation and applications
Separate observer error from the state-feedback poles
When only position is measured, feedback must operate on estimated position and velocity. Consider a continuous linear plant \(\dot x=Ax+Bu\), \(y=Cx\), with constant matrices and a known applied input. Use a full-order observer with correction proportional to the difference between measured and predicted output. Subtract its state equation from the plant with estimation error \(e=x-\hat x\).
The known input cancels exactly. Now apply \(u=-K\hat x\) and use \(\hat x=x-e\). The physical plant sees a perturbing term proportional to the residual estimation error. Writing the pair of equations together exposes an upper triangular block structure.
Taking the determinant of the characteristic matrix gives the product of the two diagonal determinants. For a controllable and observable nominal model the feedback poles and observer poles can therefore be chosen separately. Faster estimation may amplify sensor noise, which this deterministic pole calculation does not quantify.
Worked example
Place poles for a position stage
Use the unit-mass double integrator \(\dot x_1=x_2\), \(\dot x_2=u\), \(y=x_1\). The feedback polynomial is \(s^2+k_2s+k_1\) and the observer polynomial is \(s^2+l_1s+l_2\). For feedback poles \(-2,-3\) s⁻¹ select \(K=(6,5)\). For observer poles \(-8,-9\) s⁻¹ select \(L=(17,72)^\mathsf T\) in consistent units. The complete system has all four requested poles. The observer correction on the velocity state is large because it must reconstruct velocity from a position discrepancy.
Change the inputs and inspect this calculation below
Second application
Predict the effect of an unknown constant acceleration
For a separate double integrator take \(L=(10,24)^\mathsf T\) and an unmodelled constant acceleration \(d=0.120\) m/s². At steady state \(0=e_2-10e_1\) and \(0=-24e_1+d\), giving position error 5.00 mm and velocity error 0.0500 m/s. Stable observer poles remove initial-state errors, while this persistent disturbance supplies a continuing input to the error dynamics. A sensor recording the innovation should see the 5.00 mm bias.
Interactive calculation · Change the inputs of this example
Use the adjustable quantities to test the two worked calculations above. The plot recomputes this derivation’s balance or constitutive relation; its numerical readout reports the quantities needed for the forward calculation and the inverse or design question. Keep the fixed assumptions stated in the readout when comparing with the example values.
From balances to independent states
A cart of mass \(m\) moves against a spring \(k\) and damper \(b\). Choose \(x=(q,v)^\mathsf{T}\), displacement and velocity. Newton's law gives
A state contains the initial information needed to propagate the motion with specified input. Measuring displacement at one instant supplies only half of that information. The state choice is not unique: replacing velocity by momentum changes the matrix entries, yet the predicted displacement history is the same.
With zero input the transition \(e^{At}\) propagates initial conditions. Integrating the effect of forces applied at each earlier time gives
This decomposition explains why both the autonomous motion and the input direction enter control design.
Test an actuator and a sensor
Over a short time, the vectors \(e^{At}B=B+tAB+\cdots\) show the directions that a force can excite. In two dimensions \(B,AB\) suffice by the characteristic equation of \(A\). For the cart their columns have determinant \(-1/m^2\); a finite mass allows the actuator to change both position and velocity over time. This rank test assumes arbitrary inputs and sufficient time. Getting to a distant position in a very short time can still exceed an actuator limit.
With a known input, output and its first derivative contain \(Cx\) and \(CAx\). Here they are position and velocity, so the observability matrix has full rank. As a counterexample, consider two uncoupled tanks with equal decay rates, driven equally, and one sensor measuring the sum of levels. The difference evolves autonomously and never enters the sum. Recording a longer noiseless trace with that sensor cannot recover the initial difference. Moving a sensor or adding a distinct excitation has to break the symmetry responsible for the missing information.
Place poles and restore the reference scale
Take \(m=1,\ b=1,\ k=2\) in compatible SI units. Apply \(u=-f_q q-f_v v+n r\). The homogeneous characteristic polynomial is \(s^2+(1+f_v)s+(2+f_q)\). Desired poles at \(-2,-3\) give \(f_v=4,\ f_q=4\) by coefficient matching. At constant reference the velocity vanishes and \((2+f_q)q=nr\), so \(n=6\) gives \(q=r\) in the nominal model. A constant unmodelled force shifts this equilibrium. State feedback with a static reference multiplier alone supplies no mechanism to learn that force.
Reconstruct velocity without differentiating noisy measurements
An observer runs the model and uses the disagreement with the measured output to correct its state. Write \(\dot{\hat x}=A\hat x+Bu+H(y-C\hat x)\). In the ideal deterministic model the estimation error obeys \(\dot e=(A-HC)e\). Here its polynomial is \(s^2+(1+h_1)s+(h_1+2+h_2)\). Desired observer poles \(-4,-5\) give
Thus an initial state error decays even though the sensor supplies only displacement.
With the control law evaluated at \(\hat x\), the combined state and estimation-error dynamics are block triangular. The two sets of assigned poles therefore survive in the ideal linear model. Faster observer poles also give sensor noise larger correction gains. Compare simulated or measured velocity estimates during a quiet hold and during a sharp manoeuvre before accepting the faster design. A missing mode, a noisy estimate and the inability to measure an initial state exactly have distinct engineering implications.
For additional examples of state estimation and output feedback, see Åström and Murray’s Feedback Systems.
Add a state that estimates a constant load through tracking error
A feedforward reference gain can remove steady offset for an exact plant model. When an unknown constant load enters at an actuator, the equilibrium input changes. Integrating the tracking error gives the controller a memory with which to supply the missing steady effort. For a state model \(\dot x=Ax+Bu+Ed,\ y=Cx\), augment the state by \(z\) with \(\dot z=r-Cx\). If the augmented closed loop is stable and reaches equilibrium, then \(\dot z=0\) enforces \(y=r\). This argument assumes constant feasible \(r,d\), no actuator saturation and an unbiased measurement.
Take a velocity servo \(\dot v=-av+bu+d\) with \(u=-k_vv+k_i z\); use \(v\) in m/s, \(u\) in volts and \(z\) in metres. The augmented characteristic polynomial follows by differentiating the velocity equation for a constant disturbance, or directly from its two-by-two state matrix:
The augmented controllability test is important in more general plants: a servo integrator at zero frequency cannot arbitrarily impose an output that the input cannot sustain. Even here \(b=0\) would make the augmented system uncontrollable. Physical travel or voltage limits can also restrict the equilibrium although the ideal linear test passes.
Place the integral servo poles and check the required voltage
Assume \(a=2\,\mathrm{s^{-1}}\), \(b=3\,\mathrm{(m/s^2)/V}\) and target poles at −3 and −4 s⁻¹. Matching \(p(s)=s^2+7s+12\) gives
At command \(r=1.0\,\mathrm{m/s}\) and constant opposing disturbance \(d=-0.60\,\mathrm{m/s^2}\), equilibrium requires
The integrator settles at \(z=(u+k_vr)/k_i=0.633\,\mathrm m\). The unit assigned to this internal state is integrated velocity error, not physical servo displacement.
For a pure disturbance step with reference held fixed, eliminating \(z\) gives \(V(s)/D(s)=s/[(s+3)(s+4)]\) in deviation variables. A −0.60 m/s² step therefore produces \(\Delta v(t)=-0.60(e^{-3t}-e^{-4t})\,\mathrm{m/s}\). Its minimum occurs at \(t=\ln(4/3)=0.288\,\mathrm s\), with a speed error of about −0.063 m/s before recovery. An actuator limited to ±0.75 V could not maintain the stated final speed even though the assigned poles are stable. Integral feedback enforces the available equilibrium, and a command governor or anti-windup logic becomes necessary when the physical equilibrium lies outside the reachable input range.
The disturbance response also gives a way to separate a constant accelerative load from a sensor bias. Once a real opposing load has been rejected, an independent speed measurement still reads the requested 1.0 m/s while the final actuator voltage has risen by \(-d/b=0.20\) V above its no-load value. A constant positive sensor bias of 0.05 m/s instead drives the measured velocity to the set point with a true speed of 0.95 m/s. If both effects are allowed but only the controller’s own sensor is logged, a final reading exactly at set point does not identify the source of error. An independent tachometer or a measured load torque supplies the missing observation. Integral convergence cannot by itself validate sensor calibration.
Study the full derivation
Estimating velocity from position with a model-based observer · System dynamics, feedback and estimation
An optical encoder returns position and the actuator drive supplies a commanded acceleration. Reconstruct an unmeasured velocity without differentiating successive noisy samples. Derive the observer, explain what a pair of chosen poles guarantees, and predict the tradeoff visible when the encoder carries periodic interference.
Chapter 6 · Sampling, saturation and commissioning
Carry a continuous-time design onto a sampled actuator, predict where its operating assumptions fail, and distinguish an observed final value from an equilibrium.
From first principles
Integrate a held command across one sample
A sampled actuator holds its command fixed until the next update. Consider a stable first-order plant \(\tau\dot y+y=Ku\) with constant coefficients and sample interval \(h\). Let \(y_k\) be the value at the start of interval \(k\) and \(u_k\) the command held throughout it. During that interval the equilibrium for the applied command is the constant \(Ku_k\). Subtract it and integrate the homogeneous decay over exactly one interval.
Set \(a=e^{-h/\tau}\). The resulting discrete plant is an exact sample-to-sample model under a zero-order hold. For proportional feedback with unit reference scale, substitute \(u_k=g(r_k-y_k)\) to see where the sampled free response pole lies.
A sample-to-sample deviation is multiplied repeatedly by \(z_{\rm cl}\), so decay requires \(|z_{\rm cl}|<1\). This condition depends on the time at which the command is applied. A full sample of computational delay changes the state update and its characteristic equation.
Background · Discrete pole
This maps a continuous modal exponent into a sampled multiplier over interval Ts. Different continuous frequencies can give the same sampled phase.
Derivation and applications
Quantify the phase and attenuation introduced by a hold
A digital controller sends a piecewise-constant command to a continuous actuator. Even ideal sampling and instantaneous arithmetic do not make the resulting fundamental sinusoid identical to the requested one. Consider samples of a complex sinusoid at period \(h\). A zero-order hold outputs each sample unchanged over the following interval. For times \(t=kh+s\) within interval \(k\), the ratio of held signal to the desired continuous sinusoid is periodic in the within-sample time \(s\).
The zero-frequency Fourier coefficient of this periodic ratio gives the component at the original sinusoidal frequency. The remaining coefficients produce spectral images spaced by the sample frequency. Integrate the ratio over one hold interval and factor out the midpoint phase.
Below Nyquist the sine factor is positive. The fundamental therefore has phase equivalent to a delay of half a sample and a frequency-dependent gain. For small \(\omega h\), the sine expansion makes the leading attenuation quadratic while phase lag is linear.
This calculation concerns the fundamental component of a held command. Additional computation latency and sensor filtering accumulate their own phase. Frequencies approaching Nyquist also require examining the sampled closed-loop dynamics directly.
Worked example
Check a servo's phase allowance
At 50.0 Hz crossover and 1.00 kHz sampling,
The hold contributes \(-9.00^\circ\) and its fundamental magnitude is 0.9959. A further full sample of computation delay contributes \(-18.0^\circ\), giving \(-27.0^\circ\) combined at that frequency. The small gain change would conceal this phase cost in a magnitude-only measurement.
Change the inputs and inspect this calculation below
Second application
Choose a sampling interval from a phase budget
At a proposed crossover of 80.0 Hz, allocate at most 6.00° lag to the hold. Since the magnitude of the phase in degrees is \(180fh\), the interval must satisfy \(h\leq6/(180\times80)=0.417\) ms, or a sample rate of at least 2.40 kHz. At this limit the fundamental magnitude is
The resulting condition addresses the hold alone.
Interactive calculation · Change the inputs of this example
Use the adjustable quantities to test the two worked calculations above. The plot recomputes this derivation’s balance or constitutive relation; its numerical readout reports the quantities needed for the forward calculation and the inverse or design question. Keep the fixed assumptions stated in the readout when comparing with the example values.
Why one sample of latency can change the stability margin
A desktop position servo has a first-order response with time constant \(\tau\). A digital controller samples position every \(h\) seconds and holds each command constant until another is applied. Two firmware versions use the same sample period and proportional gain, yet one applies the command one whole sample later. Derive their closed-loop recurrences before attributing an observed oscillation to a different physical plant.
For the unit-gain plant \(\tau\dot x+x=u\), solve the differential equation over a single interval with constant input \(u_k\). The result is
where \(a=e^{-h/\tau}\) and \(b=1-a\). Under immediate regulation to zero the command is \(u_k=-Kx_k\). Then there is one closed-loop pole, \(a-bK\), and the positive gain range is \(0\le K<(1+a)/b\). At equality the pole sits at minus one and a step-to-step sign alternation persists.
With a one-sample delay the command is \(u_k=-Kx_{k-1}\). A trial solution \(x_k=z^k\) now gives
For \(0<a<1\) and \(K\ge0\) the two roots both lie inside the unit circle exactly when \(bK<1\). One can see the source of the upper limit by following the roots. At low gain they are real, lie between zero and \(a\), and meet when \(bK=a^2/4\). Beyond that value they are conjugate and their common modulus is \(\sqrt{bK}\), since their product equals \(bK\).

Take \(\tau=0.50\) s, \(h=0.10\) s and \(K=4.5\). The exact hold gives \(a=0.81873\), \(b=0.18127\). Immediate application produces a pole near 0.0030, while the delayed poles are about \(0.4094\pm0.8051i\), of modulus 0.903. Starting at unit displacement with the old stored sample equal to zero, the delayed plant first decays naturally. If the old sample had instead already equalled one, the first two data points would differ even though the subsequent recurrence and its poles were unchanged.
The complex argument of a delayed pole supplies another quantity to measure. At the default gain the pole angle is approximately 1.10 radians per sample. The damped oscillation therefore takes \(2\pi/1.10\) samples per cycle, approximately 0.57 s of physical time. Its envelope shrinks to about \(0.903^{10}=0.36\) of its original value over one second. Estimate both quantities from a simulated sequence. Divide the measured period by the sampling interval before comparing with the pole angle. When the response is sampled sparsely, looking only at the step-to-step change of sign can obscure an oscillation that takes nearly six samples to repeat.
Choose a gain for which immediate feedback is stable and delayed feedback is unstable, and quantify the growth.
Work through the solution
The two limiting gains are 10.033 and 5.517. At \(K=7\), the immediate pole is
The delayed conjugate pair has modulus \(\sqrt{7(0.18127)}\simeq1.126\), so its envelope grows by about 12.6% per sample. In the notebook, compare these predictions using the same physical-time horizon. If an actual processor has a fixed time delay, shortening \(h\) changes the delay in samples; the one-sample derivation must then be replaced with the actual timing model.
Interactive calculation · Sample delay motion
Vary the notebook inputs and compare both plotted observables. The same equations generate the browser curves and the notebook reference; fixed material, geometry and model assumptions are stated in the readout.
Interactive calculation · Sample delay poles
Vary the notebook inputs and compare both plotted observables. The same equations generate the browser curves and the notebook reference; fixed material, geometry and model assumptions are stated in the readout.
Derive the held-input model
A processor reads a sensor every \(h\) seconds and holds its most recent command until the next sample. Solve \(\tau\dot y+y=Ku_k\) exactly from \(kh\) to \((k+1)h\) with this constant input. The result is
where \(a=e^{-h/\tau}\). This recursion is exact at the sampling instants for the assumed hold. Taking a large Euler step through the continuous closed-loop equation describes a different experiment. A real controller has only the sampled information available when it computes \(u_k\).
With proportional control \(u_k=K_p(r_k-y_k)\) the discrete pole is \(z=a-KK_p(1-a)\). Stability requires \(|z|\lt1\). A negative pole of modulus less than one alternates sign each update while decaying. For \(K=1,\ \tau=1\) s and \(K_p=3\), \(h=0.2\) s gives \(z=0.275\); \(h=0.8\) s gives \(z=-1.203\). The same nominal continuous design gives radically different sampled records. For positive gain the upper gain limit is \((1+a)/[K(1-a)]\). Additional computation and transport delays lower the available margin further.

Locate the sampling limit in a computed trace
Keep the plant integration at 40 RK4 substeps per hold. Predict which sample intervals give a monotone response, a decaying oscillation or a growing one. Compare the stored OneSimulation traces on either side of 0.69 s. Estimate the discrete pole from two successive output increments; their ratio removes the unknown equilibrium.
| Update | Time (s) | Output |
|---|
At 0.65 s the measured pole is −0.9118, while at 0.70 s it is −1.0137. The latter increasingly overshoots even though the internal integration resolves each hold. Try 0.69 s and 0.70 s with python sampled-feedback.py --period 0.69, then double --substeps to check that the stability change is a sampling effect. Download the runnable OneSimulation model.
Why a saturated integrator remembers the past
Let \(v_k=K_p e_k+I_k\) be the requested command, and \(u_k\) its value clipped to the actuator range. An unconstrained integrator adds \(hK_i e_k\) to \(I_k\) at every sample. While an unreachable command holds a heater at its upper limit, positive error keeps accumulating; when the command becomes reachable again the stored integral may keep the heater fully on. This delayed recovery is called windup. Logging only actual heater power hides the growth of the internal demand. Log both signals and the integral state.
A back-calculation update feeds the clipping discrepancy back to the integrator:
When the request exceeds the upper stop, the second term is negative. At fixed error and fixed clipping level, this update attracts the requested command toward a value consistent with saturation, provided its discrete tracking dynamics are stable. For example, with \(h=0.1\) s, \(K_i=1\), \(e=2\), \(u=5\), \(v=8\), and \(T_t=0.5\) s, the integral increment is \(-0.4\), compared with \(+0.2\) without correction. Tuning \(T_t\) must account for the sample interval and actuator dynamics. Anti-windup cannot make an infeasible steady torque available.
Use a numerical result to distinguish two errors
Return to the OneSimulation tracking experiment. It models a continuous, unsaturated proportional loop and reports the error at a finite time. For a unit step from rest with loop gain \(g=KK_p\), the error after \(N\) closed-loop time constants is \(e_N=(1+g e^{-N})/(1+g)\). With \(g=8\) and \(N=6\), predict \(0.11331\). Its difference from the equilibrium \(1/9\) is transient motion. Halving the plant speed changes the physical time needed to reach the same dimensionless sample, while this sampled error stays fixed.
Test the interpretation by recording at three and six time constants and taking the ratio of the two deviations from equilibrium. Predict \(e^{-3}\) for the later deviation divided by the earlier. A persistent discrepancy warrants checking the recorded timestamps, the implementation of the step and whether a limit was active. To examine sampling or clipping, explicitly add these mechanisms to the model before comparing with the equations above. The logged linear-loop runs answer the finite-record question directly.
Derive an exact sampled stability boundary with a delayed command
A digital controller may acquire a sample at the start of an interval but only deliver its computed command at the following update. The one-sample computation delay then introduces an additional dynamic state. Consider a first-order plant \(\tau\dot y+y=Ku\) with an ideal zero-order hold and sampling period \(T\). Its exact sample-to-sample relation is
with \(a=e^{-T/\tau}\) and \(b=K(1-a)\). Assume proportional negative feedback about a zero reference and express gains with dimensions chosen so that \(bg\) is dimensionless.
With negligible computation delay, \(u_k=-gy_k\) yields one pole \(a-bg\), so stability requires \(|a-bg|<1\). With a one-sample delay the applied command is \(u_k=-gy_{k-1}\), giving \(y_{k+1}=a y_k-bg y_{k-1}\). Substitution of a trial sequence \(z^k\) gives the characteristic polynomial \(z^2-az+bg\). For a real monic quadratic \(z^2+c_1z+c_0\), the unit-disc conditions are \(1+c_1+c_0>0,\ 1-c_1+c_0>0,\ 1-c_0>0\). For \(0<a<1,\ b>0,\ g>0\) only the last condition limits increasing gain: \(bg<1\).
Once the delayed poles form a complex pair, their product equals their squared modulus. That makes the bound physically transparent: as \(bg\) reaches one the oscillation no longer decays between samples. This mechanism is invisible if a continuously implemented controller is analysed and merely evaluated at plotting intervals.
Compare two software schedules at the same sampling rate
Take \(K=1\),
The exact coefficients are
Without delay the positive gain limit is
With a delayed command it is \(1/b=5.52\). A gain of 7.0 gives a stable immediate pole \(0.8187-7(0.1813)=-0.450\). The negative sign predicts an alternating error whose sample values decrease in magnitude.
Apply the same gain through the delayed schedule. The characteristic polynomial becomes \(z^2-0.8187z+1.2689\). Its roots are complex with modulus \(\sqrt{1.2689}=1.126\), implying about 12.6% growth per sample in the envelope. An input limit may eventually bound the motion or produce a limit cycle, but it does not restore local linear stability around the unsaturated equilibrium. A controller test that records sensor samples and commanded values with separate timestamps can distinguish this delay from a sign error or an incorrectly discretised plant. Reduce the delayed gain to 4.0 and the predicted modulus becomes 0.852; the same clock can operate stably with a different response speed.
To recognise the delayed oscillation in a recorded trace, compute its angle as well as its modulus. At gain seven each real part is
Dividing by the modulus 1.126 gives \(\cos\theta=0.364\), so \(\theta=1.20\,\mathrm{rad/sample}\). The apparent oscillation period is about \(2\pi(0.10)/1.20=0.52\) s. By comparison the immediate negative real pole produces a two-sample alternating pattern with period 0.20 s. A controller log showing roughly five samples per growing cycle accords with the delayed implementation, whereas alternating every sample points towards the immediate model operating too aggressively. This interpretation uses the synchronised physical actuator output; a software variable computed today for application tomorrow may have a different timestamp from the hardware.
Why a fast vibration can appear as a slow feedback error
An analogue position sensor may detect a genuine low-frequency displacement and a much faster frame vibration. Sampling can make the two contributions indistinguishable. For a sampling interval \(T_s=1/f_s\), evaluate a complex sinusoid at sample \(n\):
A real cosine is also unchanged by reversal of frequency, so its apparent frequency can be folded into \(0\le f_a\le f_s/2\). At \(f_s=100\,\mathrm{Hz}\), a 92 Hz cosine gives precisely the samples of an 8 Hz cosine with reversed phase angle. If both are present, their sampled amplitudes combine according to phase. Removing 8 Hz in software would remove the true 8 Hz motion as well. Filter the continuous sensor signal before sampling if the higher component must be attenuated independently.
Suppose an encoder sees an unwanted sinusoidal displacement of amplitude \(0.50\,\mathrm{mm}\) at 92 Hz, while feedback must track motion through 8 Hz. A fourth-order analogue Butterworth low-pass filter with cutoff 20 Hz has magnitude \(|H(f)|=[1+(f/20\,\mathrm{Hz})^8]^{-1/2}\). At 92 Hz the ratio is 0.00223, or approximately \(-53.0\,\mathrm{dB}\): the folded displacement amplitude is only \(1.12\,\mathrm{\mu m}\). At 8 Hz the ratio is 0.99967, so a \(0.10\,\mathrm{mm}\) desired component retains about \(99.97\,\mathrm{\mu m}\). These are separate amplitude tests on the analogue filter. If both vibrations persist, the sampled 8 Hz component can vary with their relative phase.
A passband magnitude close to one does not bound the filter's phase lag. A controller designed with substantial gain near 8 Hz must also include the filter's complex frequency response in its phase-margin calculation. Aliasing, sample-and-hold delay and computational delay are three different contributions to the observed loop dynamics.
Practise on sheet 3 · Choose an analogue filter order against a folding vibration. Further reading · University of Pennsylvania · ESE 1500 Digital Audio Basics · Lecture 5, Anti-Aliasing, Parts 1–2.
Find the stability boundary from three measured outputs
Sample the unit first-order plant three times with gain 3 and a constant reference. A one-pole response gives \(\Delta y_{k+1}=z\Delta y_k\), so the ratio of increments identifies the discrete pole without knowing the final value. Here the plant uses forty RK4 substeps per controller interval.

Read values from the plot
| Controller hold period (s) | OneSimulation plant | Alternating stability boundary |
|---|---|---|
| 0.45 | −0.44949 | −1 |
| 0.57 | −0.7379 | −1 |
| 0.67 | −0.95317 | −1 |
| 0.77 | −1.1479 | −1 |
| 0.89 | −1.3574 | −1 |
Download the OneSimulation model (Python)
Interactive calculation · change the inputs of this example
Change controller gain and plant time constant, then find the sample interval where the discrete pole crosses minus one.
The curves below are recalculated from this section’s equations in your browser. The fixed reference plot above remains available for comparison.
Problem sheet 3 · What a controller can learn and deliver
Use rank tests, an exact sampled model and a finite-time numerical observation to diagnose three different limits.
1. A pair of decaying modes
Let \(A=\operatorname{diag}(-1,-2),\ B=(1,1)^\mathsf{T}\). (a) Test reachability. (b) Test observability for \(C=(1,1)\) and then for \(C=(1,0)\). (c) For zero input, recover the initial state from the first sensor when \(y(0)=3,\dot y(0)=-5\).
Use both direction and time history
The reachability columns are \((1,1)\) and \((-1,-2)\); their determinant is \(-1\). The first observability matrix has rows \((1,1),(-1,-2)\) and also has full rank. The second has rows \((1,0),(-1,0)\), hence never sees the second mode. Solving \(x_1+x_2=3,\ -x_1-2x_2=-5\) gives
In practice several noisy time samples are more reliable than a single numerical derivative.
2. A sampled proportional loop
A held-input plant has \(K=2,\ \tau=1\) s. Use \(K_p=2\). (a) Find the largest sample interval for asymptotic stability. (b) Pick an interval giving a zero discrete pole. (c) For a unit step from rest, find the corresponding output at the first update and its equilibrium error.
Solve both bounds using the exponential
The pole is \(z=5e^{-h}-4\). For a positive sample interval it stays below 1; the lower bound requires \(e^{-h}>3/5\), giving \(h\lt\ln(5/3)=0.511\) s. Equality gives an undamped alternating mode. For \(z=0\), take \(h=\ln(5/4)=0.223\) s. The initial held input is 2, so the first output is
It stays there on subsequent samples, leaving error 0.2. A fast transient and accurate steady tracking are independent specifications.
3. Explain a numerical tracking record
Use the feedback experiment. (a) Predict the output errors at three and six closed-loop time constants for \(K=2,K_p=4\). (b) Predict which values change if the plant time constant doubles. (c) A drive limited to 2 command units shows a different early trace after a unit step. Identify a signal that could confirm the cause before changing gains.
Compare a finite observation with the steady balance
Here \(e_N=(1+8e^{-N})/9\). The two predictions are 0.15537 and 0.11331; the steady error is 0.11111. Doubling \(\tau\) doubles the times in seconds while preserving those two dimensionless observations. At switch-on the controller asks for \(K_p e=4\), twice the limit. Plot requested and delivered command on the same axes and identify the interval when they differ. The unsaturated model still supplies a valid comparison after checking the actual initial condition for recovery.
Choose an analogue filter order against a folding vibration
A sampled displacement loop runs at 100 Hz. Genuine motion below 10 Hz must retain at least 99% of its amplitude. A 78 Hz frame oscillation must be attenuated to at most 2% before sampling. With a 20 Hz cutoff, decide whether a second- or third-order Butterworth filter meets both amplitude conditions. Determine where the residual vibration appears after sampling.
Show the worked solution
For order \(n\), use \(G(f)=[1+(f/20)^{2n}]^{-1/2}\). At 10 Hz the ratios are 0.9701 and 0.9923 for orders two and three. At 78 Hz they are 0.0656 and 0.0169. Thus the third-order candidate meets both requirements. The second-order candidate misses both. The vibration folds to \(100-78=22\,\mathrm{Hz}\). Even though it lies outside the specified tracking band after sampling, it can still enter sampled diagnostics or excite a controller with appreciable gain there.
Revisit chapter 6 · Why a fast vibration can appear as a slow feedback error.
Explore the governing equations after solving the sheet: States, reachability and estimation; Sampling, saturation and commissioning. Compare the assumptions and units before transferring your chosen parameters; the controls may cover a different numerical range from the written exercise.
Notebook practice · Why one sample of latency can change the stability margin
Chapter 7 · Following poles as a controller gain changes
Use the geometry of the characteristic equation to discover which transient specifications one adjustable gain can meet.
From first principles
Derive the angle and gain conditions for a root locus
For a linear negative-feedback system with open-loop transfer \(K G(s)\), the free closed-loop motion has a nonzero amplitude only when the characteristic factor vanishes. Treat \(K\) as a real nonnegative adjustable parameter. A candidate pole \(s\) is on the root locus precisely when the complex number \(K G(s)\) equals the real number \(-1\).
Factor the fixed transfer into real positive leading gain \(g\), zeros \(z_i\) and poles \(p_j\). Multiplication adds complex angles and division subtracts them. The resulting geometric test and gain value are
A point can have an attractive decay rate or oscillation frequency yet fail the angle condition for every positive gain. Once that condition holds, the distance products give the unique gain at an ordinary, finite point of the locus. At zero gain the branches start at the open-loop poles by continuity.
Derivation and applications
Predict where a root-locus branch approaches its asymptote
A pole sketch can show the direction in which a gain change sends fast modes. Consider real-coefficient negative feedback with characteristic equation \(D(s)+KN(s)=0\). Take monic polynomials with \(n\) open-loop poles \(p_j\), \(m\) finite zeros \(z_j\), \(n>m\), and positive adjustable gain \(K\). Include repeated roots with their multiplicities and absorb any constant numerator factor into the gain. For large \(|s|\), expand the product of root factors and divide the leading terms.
Write \(q=n-m\). A shifted power \((s-\sigma)^q\) has the same first two large-\(s\) coefficients if \(q\sigma\) equals the difference of root sums. The remaining characteristic equation for distant branches then reduces to a power equal to negative real gain.
Taking the \(q\) roots gives the asymptote directions. Complex poles and zeros come in conjugate pairs, so the centroid \(\sigma\) lies on the real axis. These are asymptotic guides; a branch at finite gain generally curves towards its line.
Worked example
Identify a high-gain difficulty in a three-lag loop
For poles at \(-1,-2,-6\) s⁻¹ and no finite zeros, \(q=3\) and \(\sigma=-3\) s⁻¹. The three angles are 60°, 180° and 300°. Two branches ultimately enter the right half-plane. As a check the exact polynomial is \(s^3+9s^2+20s+12+K\); cubic stability demands \(9(20)>12+K\), or \(K<168\). The sketch predicted a finite gain limit and the polynomial supplies its exact value.
Change the inputs and inspect this calculation below
Second application
Recover a missing zero from measured asymptotes
A separate system has poles at \(0,-4,-8\) s⁻¹ and one real zero. Its two high-gain branches approach vertical lines with real coordinate \(-4.50\) s⁻¹. The centroid equation gives \(2(-4.50)=-12-z\), hence \(z=-3.00\) s⁻¹. The remaining finite branch tends to that zero as gain grows. Vertical asymptotes alone identify the pole excess; their real intercept supplies the missing location.
Interactive calculation · Change the inputs of this example
Use the adjustable quantities to test the two worked calculations above. The plot recomputes this derivation’s balance or constitutive relation; its numerical readout reports the quantities needed for the forward calculation and the inverse or design question. Keep the fixed assumptions stated in the readout when comparing with the example values.
Start from this chapter. Follow the single proportional-feedback pole as gain varies. Use the sampled step to distinguish its settling rate from the remaining steady tracking error.
OneSimulation laboratory · Predict the settling time and offset of a feedback loop
A family of closed-loop systems
The earlier pole calculations chose a gain and found the poles. Reverse that question: if an engineer turns one gain dial continuously, which parts of the complex plane can the poles ever visit? For unity negative feedback write the open-loop transfer as \(K N(s)/D(s)\), with \(N,D\) coprime and \(K\ge0\). The closed-loop characteristic equation is
At a trial complex point away from an open-loop zero, the required gain is \(-D(s)/N(s)\). The point is attainable only if this number is real and nonnegative. Its magnitude gives the gain; its phase supplies a separate feasibility test.
At \(K=0\) branches begin at open-loop poles. At very large gain, finite roots must approach zeros of \(N\). If the denominator has greater degree, the remaining roots go to infinity. Since a real-coefficient polynomial has conjugate roots, the locus is symmetric about the real axis. These observations put strong constraints on a sketch even before computing roots.
Derive a breakaway and read the transient
Take a positioning plant \(P=1/[s(s+4)]\) with proportional gain \(K\). The closed-loop poles are \(s=-2\pm\sqrt{4-K}\). They start at 0 and −4, approach each other along the real axis and meet at −2 when \(K=4\). Equivalently the real-axis gain \(K(s)=-s(s+4)\) has a stationary point at −2. Above the breakaway the complex pair moves vertically, so raising gain increases oscillation frequency while leaving the exponential envelope \(e^{-2t}\) unchanged.
The constant term gives \(\omega_n=\sqrt K\) and the linear coefficient gives
A specification of decay rate 3 s⁻¹ and damped frequency 4 rad/s would require poles \(-3\pm4i\). Since every complex pole here has real part −2, no choice of proportional gain meets both requirements. Failure to find such a gain numerically is a statement about controller structure.
Add a second degree of freedom
Feed back measured velocity as well as position:
The closed-loop denominator becomes \(s^2+(4+K_v)s+K_p\); the reference numerator is just \(K_p\). For desired poles \(-3\pm4i\) the polynomial is \(s^2+6s+25\), hence
The derivative acts only on measured output, so a discontinuous reference does not directly request an impulse. Differentiating a noisy measurement can nevertheless demand excessive actuator effort. A separate velocity sensor or a filtered estimate changes the high-frequency dynamics and must be included in the design check.
Include the numerator when interpreting a pole plot
Moving a controller zero also reshapes the locus because it changes the angle of \(N/D\). A zero in the reference-to-output map changes step-response residues even if the poles coincide with a previous design. In particular a positive real zero imposes a severe tracking constraint. For the stable unit-DC transfer \(G=(1-s/z)/(1+s\tau)^2\) with \(z>0\), the unit-step initial slope is \(\lim_{s\to\infty}sG(s)=-1/(z\tau^2)\). Yet the final output is positive. The initial motion in the wrong direction follows directly from the zero. Increasing gain to make the initial transient faster cannot remove that geometry.
Place a controller zero from a specified root
A proportional controller moves poles along the root locus of its plant. A chosen design point off that locus can sometimes be made reachable with a controller zero. For a unity-feedback plant \(P(s)=1/[s(s+2)]\), take an ideal proportional–derivative compensator \(C(s)=K(s+z)\) with real \(K,z>0\). The locus condition \(1+C(s)P(s)=0\) becomes
For a desired nonreal pole \(s_d\), this ratio must be real and positive. This single complex constraint is equivalent to one phase and one magnitude condition.
Choose \(s_d=-3+4i\,\mathrm{s^{-1}}\), so the target characteristic polynomial is \(s^2+6s+25\). Coefficient matching is particularly transparent for this second-order plant: the characteristic polynomial is \(s^2+(2+K)s+Kz\). Equating coefficients gives \(K=4\) and \(z=6.25\,\mathrm{s^{-1}}\). Geometrically the zero at −6.25 supplies precisely the missing phase at the specified point. Substituting \(s_d\) in \(-s(s+2)/(s+6.25)\) recovers positive real gain 4, an independent check that this is the positive-gain branch.
The target pair has \(\omega_n=5\,\mathrm{rad/s}\) and \(\zeta=0.60\). The ideal controller contributes derivative gain 4 and proportional gain 25 in consistent normalised units. The closed-loop reference numerator contains the zero, so predicting exact overshoot requires the complete response even though the poles now match the design point.
Determine the consequence of giving differentiation a finite bandwidth
The ideal derivative gain grows without bound at high frequency. A real implementation can use \(C_f=25+4s/(1+s/20)\), placing a filter pole at −20 s⁻¹ on the derivative path. Combining terms gives
which shifts the controller zero to \(-25/5.25=-4.76\,\mathrm{s^{-1}}\). The characteristic equation of the actual loop is
The target point no longer satisfies it: inserting \(-3+4i\) gives \(28+96i\), a nonzero residual in the monic characteristic polynomial. The implementation remains stable by the cubic Routh test because all coefficients are positive and \(22(145)>500\), but its exact transient differs. The high-frequency controller gain approaches \(25+4(20)=105\), now finite and directly relevant when estimating actuator activity from encoder noise. Placing the filter much farther left reduces the difference near the designed poles while increasing this asymptotic noise gain. A design specification with both pole placement and an allowable actuator-noise level must therefore include the filter during synthesis rather than adding it only in software.
A reference ramp distinguishes this controller from a high static-gain proportional loop that happens to yield similar dominant poles. With unity feedback and plant integrator, the ramp error to \(r(t)=vt\) tends to \(v/K_v\) provided the closed loop is stable, where \(K_v=\lim_{s\to0}s C(s)P(s)\). Both ideal and filtered designs have \(C(0)=25\), giving \(K_v=25/2=12.5\,\mathrm{s^{-1}}\). A 5 mm/s position ramp therefore leaves a 0.40 mm asymptotic tracking error. Moving the derivative filter changes fast behaviour while leaving this low-frequency comparison unchanged. If a much smaller ramp error is required, speed feedforward or additional low-frequency loop gain must be assessed separately; the selected complex poles by themselves do not establish that tracking specification.
Chapter 8 · Uncertainty envelopes and robust stability
Turn a bounded discrepancy between plant and model into a frequency-by-frequency test of the feedback design.
From first principles
Derive a feedback bound from a fractional plant error
A frequency-dependent model error matters through the feedback path in which it enters. Suppose an actual plant can be represented as \(P=P_0(1+W\Delta)\), with nominal plant \(P_0\), a known stable weight \(W\) and stable uncertainty satisfying \(|\Delta(i\omega)|\leq1\). Use a fixed controller \(C\) and assume the nominal interconnection is internally stable. Define \(L_0=CP_0\) and expand the perturbed characteristic factor.
The second factor describes how the unknown part feeds back around the nominal closed loop. If the magnitude of its variable term stays strictly below one at every frequency, it cannot reach the critical value \(-1\). The small-gain condition for stable interconnected factors is
This gives a sufficient certificate for every uncertainty in the specified class. The bound permits less modelling error where the complementary sensitivity is large. A failed inequality identifies a missing certificate; determining actual instability requires the particular plant error or a tighter description of it.
Background · Sensitivity
For a scalar unity negative-feedback loop this gives one closed-loop transfer. The point where a disturbance enters determines which transfer the observer measures.
Derivation and applications
Represent a transport-delay error as multiplicative uncertainty
A frequency sweep of a conveyor or thermal transport path may fit the gain well while leaving an uncertain delay. Suppose the actual stable plant is \(P(s)=P_0(s)e^{-s\Delta t}\), with a nominal model containing the accurately known part of the delay. Let the extra delay lie between zero and \(d\). At sinusoidal frequency \(\omega\), define the fractional model error as \(E=P/P_0-1\). Factoring the difference of the two unit phasors gives
This is a chord on the unit circle. Its magnitude grows with delay until the phasors point in opposite directions. Maximising over the stated delay interval therefore gives a monotone envelope which stays at two after the interval first contains a half-cycle delay.
For nominal loop \(L_0=C P_0\) the perturbation multiplies the complementary sensitivity \(T_0=L_0/(1+L_0)\) in the characteristic equation. If the nominal closed loop is internally stable and the bounded error is stable, keeping the product below unity at all frequencies gives a sufficient robust-stability test.
At low frequencies the envelope approaches \(\omega d\). This dependence on frequency explains how an almost exact steady gain can coexist with a substantial feedback discrepancy near crossover.
Worked example
Audit a transport path at one frequency
A thermal experiment bounds extra delay by 20.0 ms. At \(\omega=30.0\) rad/s the worst relative error is \(2\sin(0.300)=0.591\). If \(|T_0|=1.40\), the pointwise product is 0.827, within the bound at that frequency. Repeating at every relevant frequency is necessary for the full small-gain conclusion; this single value establishes only the local allowance.
Change the inputs and inspect this calculation below
Second application
Derive a timing requirement from a measured peak
At 40.0 rad/s another loop has \(|T_0|=2.00\). The allowable envelope must be below 0.500. On the rising branch the maximum extra delay is therefore
A measured 15.0 ms spread would give \(4\sin(0.300)=1.18\) for the product, so this sufficient certificate would no longer settle stability there.
Interactive calculation · Change the inputs of this example
Use the adjustable quantities to test the two worked calculations above. The plot recomputes this derivation’s balance or constitutive relation; its numerical readout reports the quantities needed for the forward calculation and the inverse or design question. Keep the fixed assumptions stated in the readout when comparing with the example values.
What do several plant tests tell us?
The gain of a drive changes as it warms up, and a flexible mounting introduces poorly measured phase lag at high frequency. Let \(P_0\) be a nominal model. One useful description is multiplicative uncertainty, \(P=P_0(1+W\Delta)\), with stable dimensionless \(\Delta\) of gain at most one and a specified frequency weight \(W\). The magnitude of \(W\) bounds relative error. Estimate it from \(|P/P_0-1|\) across an ensemble of measurements, retaining phase in the complex ratio. A 20% amplitude difference and a 20° phase difference generally produce a larger relative error than either alone.
Where \(P_0\) is close to zero this relative description can be poorly conditioned. An additive uncertainty \(P=P_0+W_a\Delta\) can describe an absolute error floor there. A bound fitted only at sampled frequencies requires a reason to hold between samples, especially near flexible resonances. A robustness calculation is conditional on this modelling work.
Factor the perturbed characteristic equation
For the nominal controller \(C\), set \(L_0=P_0C\) and \(T_0=L_0/(1+L_0)\). Under multiplicative perturbation,
Assume internal stability of the nominal interconnection and stable, proper uncertainty factors with no hidden unstable cancellation. If \(\sup_\omega|W(i\omega)T_0(i\omega)|<1\), the perturbation loop has gain less than one and cannot destabilise the feedback. One way to see the mechanism is the convergent inverse series \(1-G+G^2-\cdots\) for \(G=WT_0\Delta\) in the stable-system norm. The pointwise bound protects against all allowed dynamic phase choices. Failure of a sufficient test alone does not prove the particular measured plant unstable.
Work a frequency-domain budget
At one frequency a nominal loop has \(L_0=-0.8+0.4i\). Then \(|1+L_0|=\sqrt{0.2}\), \(|L_0|=\sqrt{0.8}\), and \(|T_0|=2\). Relative uncertainty below 50% at that frequency keeps \(|W T_0|<1\) there. A measured 60% bound crosses this threshold. Geometrically the perturbed loop samples a disk centred at \(L_0\) of radius \(|L_0 W|\). At 50% its rim touches \(-1\). Other frequencies still require examination, and a physically narrower family such as a single real gain may occupy far less than the full disk.
Add a performance requirement
A stable loop can still amplify an output disturbance unacceptably. For the uncertain plant the sensitivity is \(S=S_0/(1+WT_0\Delta)\). The triangle inequality gives \(|S|\le |S_0|/(1-|WT_0|)\) where the denominator is positive. If \(|S_0|=0.10\) and \(|WT_0|\le0.25\), disturbances can be amplified by at most 0.133 in this bound. Very near the robustness limit that bound becomes large. Shaping the nominal loop for a small uncertainty product near troublesome resonances can therefore protect both stability and useful performance. Record the sensor configuration, loading and frequency band over which the underlying plant measurements were made.
Distinguish absolute from relative uncertainty
Several tested plants may differ by an approximately fixed absolute transfer at high frequency although their nominal output gain is nearly zero there. Dividing each difference by a near-zero nominal transfer gives an enormous relative error and may make a multiplicative envelope awkward. An additive description writes \(P_a=P_0+W_a\Delta\), where \(|\Delta(i\omega)|\le1\), the stable filter \(W_a\) has the same units as the plant and its magnitude bounds absolute discrepancies. The controller \(C\) and nominal plant first form an internally stable feedback system. Assume the uncertainty interconnection is well posed and the normalised uncertainty is stable.
Factor the uncertain return difference using the nominal sensitivity \(S_0=1/(1+C P_0)\):
For unstructured complex uncertainty the small-gain bound \(\|W_a C S_0\|_\infty<1\) is sufficient for robust stability. The relevant nominal transfer is from measurement error to control effort, \(CS_0\), rather than complementary sensitivity alone. At high frequency \(S_0\) often approaches one, so a derivative action that increases high-frequency controller gain can stress an additive uncertainty bound even where nominal loop gain has already fallen.
The inequality uses the worst permitted complex phase at each frequency. A point violating the envelope test indicates loss of this guarantee. It does not by itself establish that a particular measured plant is unstable. Conversely a few passing frequency samples do not certify the continuous-frequency supremum.
Budget uncertainty for a lightly coupled actuator resonance
Suppose a calibration expresses position in millimetres and actuator input in volts. At 40 rad/s the nominal gain is only \(0.020\,\mathrm{mm/V}\), while an unmodelled flexible path can add up to \(0.030\,\mathrm{mm/V}\) in any phase. A measured nominal loop has \(|CS_0|=18\,\mathrm{V/mm}\) there, giving an uncertainty product \(0.030(18)=0.54\). The corresponding allowable absolute uncertainty before the unit threshold is
Stating only the 150% relative plant discrepancy would conceal the controller-dependent margin at that frequency.
At 70 rad/s suppose the absolute uncertainty bound increases to \(0.045\,\mathrm{mm/V}\) and \(|CS_0|=25\,\mathrm{V/mm}\). Their product is 1.125. To reserve a factor of 1.25 on the uncertainty envelope, impose a target product of at most 0.80. Then \(|CS_0|\) must be at most \(0.80/0.045=17.8\,\mathrm{V/mm}\) at that frequency. A revised compensator with measured \(|CS_0|=16\) gives 0.72 at the suspect point. Check the complete response around any new filter resonance and recompute nominal tracking. Reducing this single frequency peak cannot establish whether the remainder of the frequency band also satisfies the reserve.
Suppose the absolute uncertainty envelope comes from three nominally identical machines. At each frequency calculate the complex difference of each measured response from the nominal complex response before taking magnitudes. At 70 rad/s, two transfer measurements of equal magnitude but opposite phase can differ by twice that magnitude. Subtracting magnitudes alone would assign zero discrepancy. Also retain independent test uncertainty such as force calibration and motion-sensor noise, which may be especially important where nominal motion is small. The largest observed discrepancy only covers those three machines and operating conditions. A justified production bound requires considering the frequency regions between measurement points and whether later mounting or payload changes can introduce another flexible path.
Test a frequency-dependent uncertainty budget
Use the same nominal loop and model multiplicative uncertainty by the weight \(W(s)=(0.1+a s)/(1+s)\) times a stable unit-gain perturbation. Inspect the product \(|WT|\) rather than the two factors separately. A uniform bound below one supplies a sufficient robust-stability test.

Read values from the plot
| Angular frequency (rad/s) | High-frequency relative error 0.4 | High-frequency relative error 0.8 | High-frequency relative error 1.2 | Small-gain threshold |
|---|---|---|---|---|
| 0.03 | 0.10069 | 0.10281 | 0.10626 | 1 |
| 0.17533 | 0.12112 | 0.17082 | 0.231 | 1 |
| 1.0247 | 0.37743 | 0.73878 | 1.1037 | 1 |
| 5.9887 | 0.048717 | 0.097371 | 0.14604 | 1 |
| 35 | 0.0013094 | 0.0026187 | 0.003928 | 1 |
Interactive calculation · change the inputs of this example
Increase the high-frequency uncertainty budget and locate the maximum weighted response over the plotted band.
The curves below are recalculated from this section’s equations in your browser. The fixed reference plot above remains available for comparison.
Study the full derivation
Sensitivity, bandwidth and the integral price of disturbance rejection · System dynamics, feedback and estimation
A regulator attenuates a slowly varying output load yet amplifies another disturbance at a higher frequency. Separate the paths by which reference, measurement noise and physical disturbance reach the recorded variable, then derive an integral identity that explains why a stable loop can redistribute sensitivity across frequency.
Problem sheet 4 · Pole geometry and plant uncertainty
Find which poles are achievable, then test what happens when the plant deviates from the nominal design.
1. A position loop with one gain
Take \(P=1/[s(s+6)]\) and \(u=K(r-y)\). (a) Find the breakaway gain and pole location. (b) Choose the gain that gives damped frequency 4 rad/s. (c) Add velocity feedback and select both gains for poles at \(-4\pm3i\).
Compare the desired monic polynomial with the plant
The roots are \(-3\pm\sqrt{9-K}\); they meet at \(-3\) for \(K=9\). A damped frequency of 4 requires \(K=25\), yielding poles \(-3\pm4i\). The second desired pair has polynomial \(s^2+8s+25\). With \(u=K_p(r-y)-K_v\dot y\) its coefficients give
Both designs have the same natural frequency but different envelopes and peak times.
2. An initial movement in the wrong direction
Let \(G=(1-s/2)/(1+s)^2\). (a) Determine the final response and initial slope for a unit step. (b) Obtain the full step response. (c) Find the time and value of its minimum.
Resolve the step into a repeated-pole response
The DC value is 1 and \(\lim_{s\to\infty}sG=-1/2\), giving the initial slope. Partial fractions of \(G/s\) yield
Its derivative is \((-0.5+1.5t)e^{-t}\); the minimum occurs at \(t=1/3\) s and equals
It is a zero-induced inverse response in a stable system.
3. How much complex model error fits?
At one frequency \(L_0=-0.6+0.3i\). (a) Compute \(|S_0|,|T_0|\). (b) Test a multiplicative uncertainty radius of 40%. (c) Estimate a worst-case upper bound on uncertain sensitivity there. Explain what remains to establish robust stability.
Measure the distance to the critical point
The distance \(|1+L_0|=0.5\) gives \(|S_0|=2\) and \(|T_0|=\sqrt{0.45}/0.5=1.342\). The uncertainty product is about 0.537, below one here. The triangle bound yields
Check the full frequency band, nominal internal stability and the properties of the uncertainty class before drawing a loop-wide conclusion.
Explore the governing equations after solving the sheet: Following poles as a controller gain changes; Uncertainty envelopes and robust stability. Compare the assumptions and units before transferring your chosen parameters; the controls may cover a different numerical range from the written exercise.
Chapter 9 · Optimal state feedback and the Riccati equation
Choose how heavily to penalise tracking error and actuator effort, then derive the feedback gain that minimises that stated cost.
From first principles
Derive a feedback gain by minimising future cost
A control objective must say what counts as expensive. Consider a known continuous linear system \(\dot x=Ax+Bu\) with state penalty \(x^\mathsf TQx\) and effort penalty \(u^\mathsf TRu\), where \(Q\) is positive semidefinite and \(R\) positive definite. Assume the usual stabilisability and detectability conditions for the infinite-horizon problem. If \(V(x)\) is the least remaining accumulated cost, minimising over one short interval and then using the optimal continuation gives
Take the quadratic value form \(V=x^\mathsf TPx\) with symmetric \(P\). Differentiate the expression inside braces with respect to \(u\). The positive effort penalty makes its stationary value a minimum.
Substitute this control back into the optimality condition and require the quadratic state coefficient to vanish for every state.
The stabilising solution gives the feedback gain and the predicted least cost from the initial state. Hard limits on actuator effort require a further model constraint.
Derivation and applications
Relate an optimal feedback value function to energy spent
The Riccati solution predicts more than a feedback gain. Consider a scalar integrator \(\dot x=bu\) with \(b>0\) and a cost accumulated over an unlimited horizon. Use positive weights \(q,r\) and charge both state deviation and control amplitude squared. Assume the actuator has no amplitude or rate limit and the chosen stabilising control returns the state to zero. A quadratic candidate value \(V=Px^2\) changes at rate \(2Pbxu\). Add this derivative to the running cost and complete the square in the control.
Choose \(P\) so that the residual state term vanishes. The positive solution makes the candidate value nonnegative and gives a stabilising feedback. Integrating in time then writes the entire cost as its initial value plus a nonnegative penalty for departures from that control.
Equality holds when \(u=-Kx\) with \(K=\sqrt{q/r}\). Substitution into the state balance gives an exponential return with time constant \(1/(bK)\). The optimum assigns equal instantaneous penalties to state and effort in this specific integrator model.
Worked example
Price a change in the initial deviation
A normalised stage has \(b=2.00\), \(q=9.00\) and \(r=4.00\). Its optimal \(K=1.50\) gives a decay rate of 3.00 s⁻¹. For \(x_0=0.400\), the minimum cost is \((\sqrt{36}/2)(0.400)^2=0.480\) weighted units. Half comes from control effort. Doubling the starting deviation quadruples total cost to 1.92 and doubles the magnitude of the initial command.
Change the inputs and inspect this calculation below
Second application
Test a proposed control weight against an actuator limit
A second integrator has \(b=1.00\), \(q=4.00\), initial deviation 0.300 and an available command magnitude of 0.200. Since peak command is \(K|x_0|\), the unconstrained solution fits this experiment only when \(K\leq2/3\), requiring \(r\geq9.00\). At the boundary the time constant is 1.50 s and total optimal cost is
A larger starting deviation would need its own constraint check.
Interactive calculation · Change the inputs of this example
Use the adjustable quantities to test the two worked calculations above. The plot recomputes this derivation’s balance or constitutive relation; its numerical readout reports the quantities needed for the forward calculation and the inverse or design question. Keep the fixed assumptions stated in the readout when comparing with the example values.
Make the design objective explicit
Pole placement prescribes decay rates but says nothing about how much actuator energy a manoeuvre consumes. For a continuous linear system \(\dot x=Ax+Bu\) consider the regulator objective \(J=\int_0^\infty(x^\mathsf{T}Qx+u^\mathsf{T}Ru)\,dt\). Assume \(Q\) positive semidefinite and \(R\) positive definite. A large displacement penalty or a small control penalty generally encourages stronger corrective action. The ratio matters: multiplying both matrices by the same positive scalar leaves the best control unchanged. Scale states and inputs before comparing entries; a displacement in millimetres and a velocity in metres per second cannot share an arbitrary numerical weight without a unit convention.
Derive the continuous algebraic Riccati equation
For an infinite-horizon stationary problem propose a quadratic remaining cost \(V(x)=x^\mathsf{T}Px\). During a short interval \(dt\), optimality requires the minimum of instantaneous cost plus the change in remaining cost to vanish. In the limit this gives
Completing the square in \(u\) yields
The desired solution is the stabilising symmetric solution. Under standard stabilisability and detectability conditions it exists and yields finite nonnegative cost. Other algebraic roots need not make sense as stored future cost. Once a candidate is found, check the eigenvalues of \(A-BR^{-1}B^\mathsf{T}P\) and the residual of the matrix equation.
Solve the scalar unstable case
Let \(\dot x=x+u\) with \(Q=R=1\). The scalar equation is \(2P-P^2+1=0\), giving \(P=1\pm\sqrt2\). Only \(1+\sqrt2\) is positive and makes the closed-loop pole \(1-P=-\sqrt2\). From initial state \(x_0=2\), the theoretical minimum cost is \(4(1+\sqrt2)\simeq9.657\). Verify independently: insert \(x=2e^{-\sqrt2t}, u=-Px\) into the cost integral to obtain \(4(1+P^2)/(2\sqrt2)\), the same value. By contrast a stabilising gain of 2 gives state pole −1 and cost 10. Stabilising the state is necessary but still leaves a meaningful optimisation problem.
Distinguish control penalties from hard actuator limits
The optimal initial input for the scalar example has magnitude \(2P=4.83\). If the actuator is limited to 3, clipping the command invalidates the quadratic unconstrained solution during the clipped interval. Increasing \(R\) makes large inputs more expensive but generally supplies no absolute guarantee for arbitrary initial conditions. A concrete certificate is possible inside a stated region. In one dimension \(|u|\le u_{\max}\) is guaranteed by \(|x|\le u_{\max}/P\) under this gain, and the resulting stable exponential stays in that interval. Later we will impose hard constraints directly in a finite-horizon design.
The MIT notes on linear quadratic regulators extend this derivation to time-varying and finite-horizon problems.
Solve the Riccati equation for a position-and-velocity plant
A carriage moving on nearly frictionless guides is locally a double integrator. Take its position error \(x_1\) and velocity \(x_2\) as states and acceleration command \(u\) as input. After selecting consistent physical scales, use \(A=\left(\begin{smallmatrix}0&1\\0&0\end{smallmatrix}\right)\), \(B=(0,1)^T\) and diagonal cost \(Q=\operatorname{diag}(q_x,q_v)\), \(R=r\). Assume \(q_x>0,\ q_v\ge0,\ r>0\). Both states are reachable because acceleration changes velocity immediately and position through integration. Choosing a positive position penalty also makes a stationary position error visible to the cost.
Set \(P=\left(\begin{smallmatrix}p_{11}&p_{12}\\p_{12}&p_{22}\end{smallmatrix}\right)\) in \(A^TP+PA-PBr^{-1}B^TP+Q=0\). Matching the upper-left, lower-right and off-diagonal entries gives three scalar equations:
Choose the positive roots giving stabilising feedback. The gains in \(u=-k_x x_1-k_v x_2\) become
Substitution into the state equations gives
The effort penalty and position penalty enter the squared natural frequency through a square root; the natural frequency itself varies as a fourth root. This explains why a moderate change of settling speed may require a surprisingly large change in a numerical cost weight.
Set a settling speed and calculate its actuator cost
In chosen metre, second and acceleration units let \(q_x=16,\ q_v=0,\ r=1\), with weights understood to include the needed unit conversions. Then
The poles are \(-1.414\pm1.414i\,\mathrm{s^{-1}}\), with natural frequency 2 rad/s and damping ratio \(1/\sqrt2\). From an initial positive position error of 0.20 m and zero speed, commanded acceleration is −0.80 m/s². The optimum quadratic cost is \(V=x^TPx\). Here \(p_{12}=4\), \(p_{22}=2.828\), \(p_{11}=11.314\), so the initial cost value is \(11.314(0.2)^2=0.453\) in the chosen cost units.
To double natural frequency while keeping \(q_v=0,\ r=1\), increase \(q_x\) by sixteen to 256. The new position gain is 16 s⁻², velocity gain is \(\sqrt{32}=5.657\,\mathrm{s^{-1}}\), and the same initial condition demands −3.2 m/s². An acceleration-limited drive rated for ±1.5 m/s² cannot execute this ideal motion from that initial error. For the larger gain, the zero-velocity initial error must be no more than \(1.5/16=0.0938\,\mathrm m\) for the first command to lie within its limit. That calculation addresses the initial state only; subsequent velocity feedback must also be checked. Comparing physical demand rather than weight values makes the practical tradeoff visible.
The chosen gains can be tested without explicitly solving the Riccati equation again. Along an optimal unconstrained trajectory \(V=x^TPx\) decreases according to \(\dot V=-(x^TQx+u^TRu)\). At the original initial state the instantaneous cost is \(16(0.20)^2+(-0.80)^2=1.28\) cost units per second. Directly differentiating \(V\) there gives \(2x^TP\dot x=2(0.20)(4)(-0.80)=-1.28\), since initial speed is zero and acceleration equals the command. The sign and magnitude agree. This check simultaneously tests the gain sign, state ordering and cost convention. Introducing an input clip breaks the square-completion identity for the proposed unconstrained controller, so the same matrix cannot simply be read as the realised accumulated cost of the clipped manoeuvre.
Chapter 10 · Estimating hidden states from noisy measurements
Propagate both the state estimate and its uncertainty, and derive how much of an unexpected sensor reading to trust.
From first principles
Choose a measurement gain by minimising estimation variance
Suppose a scalar prediction \(\hat x^-\) has zero-mean error of variance \(P^-\), while an independent unbiased sensor gives \(y=x+v\) with noise variance \(R\). Correct the prediction by a fraction \(K\) of its disagreement with the sensor. The posterior estimation error combines the original error and sensor noise with different weights.
Independence eliminates the cross term when the squared error is averaged. Differentiate the resulting variance with respect to the gain and solve for its minimum.
The optimum gain grows when prediction uncertainty rises relative to sensor uncertainty. Substituting it into the variance gives
The innovation \(y-\hat x^-\) has variance \(P^-+R\) under the same assumptions. Monitoring that disagreement in actual samples checks whether the stated uncertainty model is consistent with the observed data.
Derivation and applications
Find the steady uncertainty of a repeatedly sampled sensor
A sequence of scalar Kalman updates can settle to a fixed confidence even if the physical state continues wandering. Model the state as \(x_{k+1}=x_k+w_k\) with independent zero-mean increments of variance \(Q\). A sensor gives \(y_k=x_k+v_k\) with independent noise variance \(R>0\). Use the same sampling interval each time and assume known, constant variances. If \(P\) denotes the posterior variance immediately after one reading, propagation adds the process variance before the next reading.
At steady operation set \(P_{\rm next}=P\) and multiply by the denominator. The product \(RP\) cancels from both sides, leaving a quadratic. Variance must be nonnegative, so only one root is admissible for \(Q>0\).
Since the posterior update can also be written \(P_{\rm next}=RK\), its steady value immediately fixes the long-run gain. Conversely, measuring a gain and knowing sensor variance supplies an estimate of the assumed process increment variance.
For large \(Q/R\), the state changes substantially between readings and the gain approaches one. With vanishing process noise repeated independent readings continue reducing uncertainty; the positive fixed point then tends to zero.
Worked example
Predict a level sensor's residual spread
A drifting liquid level has \(Q=1.00\) mm² per sample and sensor variance \(R=4.00\) mm². The posterior variance tends to \((\sqrt{17}-1)/2=1.56\) mm², giving a posterior standard deviation of 1.25 mm. The steady gain is 0.390. A 3.00 mm innovation consequently moves the estimate 1.17 mm. The innovation variance includes both prediction and sensor uncertainty, giving \(1.56+1+4=6.56\) mm².
Change the inputs and inspect this calculation below
Second application
Infer the assumed drift from a filter log
Another estimator settles at gain 0.200 with independently measured \(R=9.00\) K². Then \(Q=9(0.200)^2/(1-0.200)=0.450\) K² per sample and posterior variance is \(RK=1.80\) K². If the physical drift is a random walk with variance proportional to elapsed time, doubling the sample interval would double \(Q\) to 0.900 K². The predicted new steady gain becomes
Interactive calculation · Change the inputs of this example
Use the adjustable quantities to test the two worked calculations above. The plot recomputes this derivation’s balance or constitutive relation; its numerical readout reports the quantities needed for the forward calculation and the inverse or design question. Keep the fixed assumptions stated in the readout when comparing with the example values.
A prediction and an observation carry different information
Consider a sampled model \(x_{k+1}=Ax_k+Bu_k+w_k\), \(y_k=Cx_k+v_k\). Model disturbances \(w_k\) describe unmeasured forcing or model error, while \(v_k\) describes measurement error. Suppose they are independent, zero mean and white, with known covariances \(W,V\), and independent of the initial estimation error. Start each update with a predicted mean \(\hat x^-\) and covariance \(P^-\). The innovation \(y-C\hat x^-\) is the part of the reading that the model did not predict. Its covariance is \(S=CP^-C^\mathsf{T}+V\). Units are those of the sensor squared; a large innovation in volts is meaningful only relative to this scale.
Minimise posterior variance
Update the estimate by \(\hat x^+=\hat x^-+K(y-C\hat x^-)\). In the scalar direct-measurement case the squared error has expected value \(P^+=(1-K)^2P^-+K^2V\). Differentiating with respect to \(K\) yields
A precise sensor raises the gain; a precise prior prediction lowers it. The same covariance minimisation gives the matrix update
The displayed covariance formula retains positive-semidefinite structure in computation better than a raw subtraction of nearly equal matrices. For the next prediction use \(\hat x^-_{k+1}=A\hat x^+_k+Bu_k\) and \(P^-_{k+1}=AP^+_kA^\mathsf{T}+W\). The control input affects the mean; assumed known exactly, it adds no direct covariance term. With Gaussian assumptions the recursion gives the conditional mean and covariance, and with just second moments it gives the optimal linear estimate under the stated model.
Recover velocity from a position reading
Suppose the prior covariance for position and velocity is \(\left(\begin{smallmatrix}4&1.5\\1.5&1\end{smallmatrix}\right)\) in compatible metre and second units. A position sensor has variance 1. Then \(S=5\),
If measured position exceeds prediction by 2 m, the updated position increases by 1.6 m and velocity by 0.6 m/s. The sensor did not measure velocity directly: the nonzero cross-covariance makes a position surprise informative about velocity. The posterior covariance is \(\left(\begin{smallmatrix}0.8&0.3\\0.3&0.55\end{smallmatrix}\right)\). A robust implementation would obtain the gain by solving with \(S\) instead of constructing a matrix inverse.
Test innovations during commissioning
Under a correct linear Gaussian model the standardised innovations should have mean zero, appropriate variance and little serial correlation. A persistent offset points toward a biased sensor or missing force. A succession of innovations of the same sign during accelerations suggests unmodelled dynamics or too little process uncertainty. Simply enlarging \(V\) to suppress the innovations in the correction makes the filter trust the model more; it does not remove a systematic error. Compare held-out records that include manoeuvres and quiet intervals. When observer and regulator are combined, estimation and control share the quality of the underlying dynamic model.
Fuse two measurements with a shared error source
Two temperature sensors mounted on one test head can share calibration drift or electromagnetic interference. Treating their errors as independent exaggerates the information gained by averaging. Suppose they measure the same scalar state at a single instant, \(y_1=x+v_1,\ y_2=x+v_2\), with zero-mean errors, variances \(r_1,r_2\) and covariance \(c\). Seek an unbiased linear estimate \(\hat x=w y_1+(1-w)y_2\), initially without a separate prior. Its error variance is
Known covariance makes this a scalar optimisation rather than a heuristic choice of weights.
Differentiating and setting \(J'(w)=0\) gives
The denominator is exactly the variance of the sensor difference. If their errors are identical, this difference contains no information for estimating a weighting and the duplicate measurement cannot improve precision. Positive semidefiniteness of the covariance requires
Negative weights can appear when one error contains a predictable correlated component that can be subtracted. Such weights require a well-supported covariance model, especially when the denominator is small.
Update one state without counting a common disturbance twice
Take sensor standard deviations 2 K and 3 K and covariance \(c=3\,\mathrm K^2\), corresponding to correlation 0.50. The first sensor’s optimal weight is \((9-3)/(4+9-6)=6/7\), with \(1/7\) on the second. Readings of 305 and 308 K give a fused reading of 305.429 K and variance \((36-9)/7=3.857\,\mathrm K^2\). The independent-sensor formula would instead claim \(36/13=2.769\,\mathrm K^2\), materially overstating the improvement. Each sensor may appear repeatable by itself while both shift in the same direction between experiments.
Suppose a prior estimate from a thermal model is 302 K with variance 4 K², independent of both current measurement errors. One scalar Kalman update using the fused measurement has gain \(4/(4+3.857)=0.5091\). Its estimate is \(302+0.5091(305.429-302)=303.745\,\mathrm K\) and its posterior variance is
The same answer follows from a two-row measurement matrix and the full covariance matrix with its off-diagonal terms. If the model has already incorporated sensor 1 at this same instant, reusing the fused reading as an independent update counts some evidence twice. Synchronisation and calibration history therefore determine which covariance belongs in the estimator, as well as the arithmetic of its gain.
Sensor disagreement provides a second diagnostic that does not require knowing the true temperature. Because the two sensors observe the same instantaneous state, their difference \(y_1-y_2\) should have variance \(r_1+r_2-2c=7\,\mathrm K^2\). The observed difference of −3 K corresponds to about \(-3/\sqrt7=-1.13\) standard deviations. A long sequence of such differences tests the assumed relative-error covariance without a calibrated thermal reference. It cannot identify a common offset, since that cancels from every difference. If both instruments warm their local mounting head or use the same drifting reference voltage they may agree closely while being wrong together. Periodic comparison against an independent standard is needed before interpreting small disagreement as strong evidence of absolute accuracy.
Watch repeated observations change the Kalman gain
A scalar random walk has initial predicted variance 4 and independent measurement variance 1. At each reading use \(K=P^-/(P^-+1)\), then update \(P^+=(1-K)P^-\) and predict \(P^-_{\rm next}=P^++Q\).

Read values from the plot
| Measurement number | Process variance Q = 0 | Process variance Q = 0.1 | Process variance Q = 1 |
|---|---|---|---|
| 1 | 0.8 | 0.8 | 0.8 |
| 5 | 0.19048 | 0.29438 | 0.61811 |
| 9 | 0.10811 | 0.27204 | 0.61803 |
| 12 | 0.081633 | 0.27044 | 0.61803 |
| 16 | 0.061538 | 0.27018 | 0.61803 |
Interactive calculation · change the inputs of this example
Separate the effect of initial uncertainty from uncertainty added at every step. Measurement variance sets how much confidence to put in each observation.
The curves below are recalculated from this section’s equations in your browser. The fixed reference plot above remains available for comparison.
Study the full derivation
Estimating velocity from position with a model-based observer · System dynamics, feedback and estimation
An optical encoder returns position and the actuator drive supplies a commanded acceleration. Reconstruct an unmeasured velocity without differentiating successive noisy samples. Derive the observer, explain what a pair of chosen poles guarantees, and predict the tradeoff visible when the encoder carries periodic interference.
Problem sheet 5 · Regulate a state and estimate it from data
Calculate an optimal feedback policy and decide when filtering or sensor placement limits its implementation.
1. Energy and effort on an integrator
For \(\dot x=u\), minimise \(\int_0^\infty(9x^2+4u^2)\,dt\). (a) Find the stabilising Riccati solution and feedback gain. (b) For \(x_0=2\) calculate the optimal cost directly from the exponential trajectory. (c) If \(|u|\le2\), identify a region where the unconstrained policy is feasible.
Check the cost with a direct integral
The algebraic equation \(9-P^2/4=0\) gives \(P=6\); \(u=-1.5x\). Then \(x=2e^{-1.5t}\) and the integrand is \(72e^{-3t}\). Its integral 24 agrees with \(Px_0^2\). Feasibility is guaranteed for \(|x_0|\le4/3\) since the magnitude then decreases monotonically. The initial state 2 is outside this region.
2. A scalar filter through a missed measurement
A random-walk model has initial predicted mean 8, variance 4, and measurement variance 1. A reading of 10 arrives. (a) Calculate the corrected mean and variance. (b) Predict one step with process variance 0.5. (c) One reading is then lost. Find the gain at the following available reading.
Follow the prediction and correction chronology
The first gain is \(4/5\), so the corrected mean is 9.6 and variance 0.8. The next prior mean is 9.6 and variance 1.3. With no reading there is no correction; another prediction raises variance to 1.8. The next available reading obtains gain \(1.8/2.8=0.643\). Setting a missed reading equal to its prediction and carrying out a normal update would falsely shrink the variance.
3. An apparently quiet but unreliable sensor
A scalar innovation sequence is \(2.0,2.0,1.8,2.2,2.0\) in sensor units, with predicted innovation standard deviation 0.5. (a) Compute the standardised mean and range. (b) Compare two mechanisms that could generate the trace. (c) Propose a test that separates the mechanisms.
Use sign and time structure as well as magnitude
The standardised values are \(4,4,3.6,4.4,4\), with mean 4 and range 3.6 to 4.4. A biased sensor and a missing nearly constant load can both produce a sustained signed discrepancy. During a known calibration hold compare the device with an independent sensor. Then vary the load while holding sensor conditions fixed; innovations that follow the load implicate the model. Simply increasing the assumed noise variance could hide both effects.
Explore the governing equations after solving the sheet: Optimal state feedback and the Riccati equation; Estimating hidden states from noisy measurements. Compare the assumptions and units before transferring your chosen parameters; the controls may cover a different numerical range from the written exercise.
Chapter 11 · Interacting actuators, pairing and decoupling
Predict how closing one loop changes the apparent gain of another, and identify a physically expensive actuator combination.
From first principles
Eliminate the second actuator to find a constrained gain
With several actuators and outputs, a gain depends on what the other controller holds fixed. Consider small steady deviations described by a square two-by-two gain matrix \(G\). First hold \(u_2\) fixed at zero. The direct response of \(y_1\) to \(u_1\) has slope \(g_{11}\). Now assume an ideal second controller adjusts \(u_2\) slowly enough to maintain \(y_2=0\) in steady state.
For \(g_{22}\neq0\), the second actuator must move by \(-g_{21}u_1/g_{22}\). Substitution gives the constrained gain seen by the first loop and the ratio of the direct to constrained gains.
The ratio requires a nonsingular matrix. A value near unity means closing the second loop changes this steady gain little. A negative value signals a reversal of the gain sign under the constraint. Dynamic phase and actuator limits still affect whether the pairing is usable.
Derivation and applications
Determine how actuator limits reshape the reachable demands
A two-actuator mechanism may have abundant force in either output separately but be unable to deliver the two requested forces simultaneously. Work with a static local model and identical actuator units. Choose outputs as the sum \(y_1\) and difference \(y_2\) of two actuator forces \(u_1,u_2\). Assume each is bidirectional and bounded by magnitude \(U\), and the static gain holds over the region of interest. The forward and inverse maps are
Substitution of the inverse map into the two component limits gives a pair of strips in output space. Their intersection is the reachable region. The maximum of the absolute sum and absolute difference of two real numbers is their absolute-value sum, which simplifies the description to a diamond.
A supervisor can retain the relative amounts of the two requested outputs by scaling a nonzero desired vector \(d\) by one factor. The largest such factor up to unity follows by placing the scaled request on the reachable boundary whenever the original request exceeds capacity.
This allocation preserves the requested direction. If one output has priority, it may be preferable to maintain that output and use only the residual capacity for the other. The physical feasible set is the same for both decisions.
Worked example
Preserve the direction of a combined request
Two linear actuators each permit 50.0 N. A requested combination \((80,60)\) N would need \((70,10)\) N. Scaling by \(100/140=0.7143\) yields outputs \((57.1,42.9)\) N and actuator loads \((50.0,7.14)\) N. Checking the inverse transformation shows exactly which actuator has reached its limit while the other retains substantial headroom.
Change the inputs and inspect this calculation below
Second application
Preserve a preload while alternating the differential force
A separate rig with \(U=30.0\) N requires total preload \(y_1=44.0\) N throughout a test. The reachable inequality leaves \(|y_2|\leq60.0-44.0=16.0\) N. At the positive extreme the actuator forces are \((30.0,14.0)\) N; at the negative extreme they exchange roles. A demanded 20.0 N alternating differential amplitude would require reducing the fixed preload to at most 40.0 N.
Interactive calculation · Change the inputs of this example
Use the adjustable quantities to test the two worked calculations above. The plot recomputes this derivation’s balance or constitutive relation; its numerical readout reports the quantities needed for the forward calculation and the inverse or design question. Keep the fixed assumptions stated in the readout when comparing with the example values.
A second loop changes the experiment
Imagine two thermal zones with separate heaters and two temperature sensors. At steady state let \(y=G u\), with \(G=\left(\begin{smallmatrix}2&1\\1&2\end{smallmatrix}\right)\) K per unit power. Increasing heater 1 with heater 2 fixed raises both temperatures. Increasing heater 1 while actively holding temperature 2 fixed is a different experiment: heater 2 must back off. The effective gain in the first channel changes. This difference matters when a controller is tuned with its neighbour disconnected and then commissioned with both loops active.
For a general nonsingular two-by-two matrix hold \(y_2=0\). Solving \(g_{21}u_1+g_{22}u_2=0\) gives
The ratio of the fixed-input gain to this fixed-output gain is \(g_{11}g_{22}/\det G\). More generally the relative gain array has entries \(\Lambda_{ij}=g_{ij}(G^{-1})_{ji}\). Its rows and columns each sum to one. Large magnitudes suggest cancellation. A negative relative gain indicates that the paired steady response changes sign when the other output is perfectly held, an important warning for independent-loop tuning.
Compare candidate pairings
For the two-zone matrix above the diagonal relative gains are \(4/3\) and the off-diagonal gains are \(-1/3\). The direct pairing has fixed-input gain 2 and fixed-other-output gain 1.5. The cross-pairing changes sign. These steady results do not include transport delays or transient coupling. If the direct heater path is very slow but the cross path changes quickly, a frequency-dependent model is needed around the intended control bandwidth.
Diagonalise a symmetric plant by physical combinations
Commanding both heaters together excites the common direction \((1,1)\) with gain 3; commanding them oppositely excites \((1,-1)\) with gain 1. For the desired temperature increment \((1,-1)\), exactly equal and opposite input increments \((1,-1)\) are required. Negative input here is a reduction from a positive bias; a heater already at zero cannot supply it. Inspecting a transformed system without retaining the original actuator limits can make an impossible target seem easy.
Now bring the gains closer together:
The common gain is 1.98, while the differential gain is just 0.02. A unit differential target requires differential input of magnitude 50 in each actuator. Static inversion \(u=G^{-1}v\) algebraically decouples the two commands but amplifies measurement, calibration and modelling errors along that weak direction. If both temperature sensors move together during every available test, the weak direction is also particularly hard to identify.
Choose a practical validation test
First perturb each actuator separately about the operating bias and measure both outputs. Repeat at different loads and frequencies. Next excite the predicted weakest input combination within safe operating limits and check whether the differential output emerges above the noise. A design can prioritise the common temperature and relax allowable imbalance when the plant is inherently hard to split. A constrained controller can express this trade directly by penalising both output errors while respecting individual actuator bounds.
Find difficult demand directions with a singular-value decomposition
Relative gains help pair individual inputs and outputs, but some machines are controlled through combinations of actuators. A steady mapping \(y=Gu\) with adequate static rank can still require a large actuator change in a particular direction. Scale inputs by allowed physical excursions and outputs by meaningful error or command scales. After scaling, the Euclidean norm is interpretable and singular values quantify directional gains. Without scaling, changing position units from metres to millimetres could dominate the result.
For a real square nonsingular \(G\), the symmetric positive definite matrix \(G^TG\) has orthonormal eigenvectors \(v_j\) and positive eigenvalues \(\sigma_j^2\). A unit actuator pattern \(v_j\) yields an output of length \(\sigma_j\) in direction \(u_j=Gv_j/\sigma_j\). Writing \(G=U\Sigma V^T\) then gives a transparent inverse. A desired output \(y_r\) requires actuator components \((u_j^Ty_r)/\sigma_j\) along \(v_j\). The smallest singular value therefore controls the largest gain of the inverse, and the ratio \(\sigma_{\max}/\sigma_{\min}\) measures conditioning.
This geometry describes steady input effort, not necessarily dynamic stability. Two channels with different lags can have different difficult directions at higher frequencies. The singular values of the complex frequency-response matrix can reveal that change after consistent scaling at every frequency.
Allocate two actuators with a tight current budget
Consider a scaled steady plant \(G=\left(\begin{smallmatrix}1&0.9\\0.9&1\end{smallmatrix}\right)\). Its symmetry gives unit common and differential directions \((1,1)/\sqrt2\) and \((1,-1)/\sqrt2\), with singular values 1.9 and 0.1. A common output target \((0.2,0.2)\) requires only \(u=(0.1053,0.1053)\). A differential target \((0.2,-0.2)\) needs \(u=(2,-2)\), a factor nineteen more effort for the same output norm. If each drive is limited to magnitude one, the first target is feasible and the second is not.
One possible allocation trades exact tracking against effort by minimising \(\|Gu-y_r\|^2+\lambda\|u\|^2\). The stationary normal equations are
each inverse singular value is replaced by \(\sigma_j/(\sigma_j^2+\lambda)\). For \(\lambda=0.01\) and the differential target, that factor is
The resulting input is \((1,-1)\) and output \((0.1,-0.1)\). The allocation respects these particular bounds while openly accepting half the requested differential change. A penalty does not enforce an input limit for every possible target. If exact limit enforcement is required, solve the bounded allocation problem or constrain the admissible command directions explicitly.
A simple perturbation test makes the weak direction visible in hardware. Command \(u=(0.1,0.1)\) in scaled units and predict \(y=(0.19,0.19)\). Reversing only the second command gives \(u=(0.1,-0.1)\) and outputs only \((0.01,-0.01)\). If each sensor has an uncertainty of ±0.01 output units, the first test has a comfortable signal level but the second barely resolves its predicted value. A poorly estimated differential gain may therefore vary considerably between identification records even though the common gain is repeatable. Increasing the differential test amplitude within operating bounds or averaging repeated experiments improves that estimate. A static inverse based on a single small pulse at each actuator may otherwise amplify calibration error precisely in the least observable output combination.
Study the full derivation
Relative gains, loop pairing and nearly singular process measurements · System dynamics, feedback and estimation
Two heaters act on two temperature sensors. With the second heater fixed, a test of the first gives a well-determined positive response. Closing a loop around the other temperature can change both the size and sign of that apparent gain. Derive the relative gain array from the experiment one actually performs.
Chapter 12 · Finite-horizon control with real actuator constraints
Build a small predictive controller from a sampled model and determine when the requested target is physically reachable.
From first principles
Predict a finite trajectory before choosing the first command
Consider a scalar sampled plant \(x_{k+1}=ax_k+bu_k\), with a measured initial state and known coefficients. A predictive controller uses the model repeatedly to compare candidate future command sequences. For two steps, substitute the first state update into the second; each input affects a different interval and the first input also affects the second predicted state through propagation.
Even a one-step horizon shows how a quadratic objective selects a command. Let \(r\) be the desired next state, \(q>0\) a tracking penalty and \(\rho>0\) an effort penalty. Differentiate the objective after substituting its predicted state.
For this single scalar step, an interval limit on \(u_0\) clips the unconstrained minimiser to the nearest feasible endpoint. Over longer horizons the state and input constraints couple the commands. Only the first chosen command is applied before the state is measured again and the prediction repeated.
Derivation and applications
Predict the stopping distance of a sampled axis
A predictive controller can satisfy every instantaneous position bound and still enter a state from which the next position constraint must be violated. To see the role of velocity, consider a frictionless axis moving towards a positive position limit. The command is constant over sample interval \(h\) and bounded in acceleration by \(a>0\). Suppose the current speed \(v\) is positive, the axis must stop without reversing, and a final fractional braking command is allowed. Constant acceleration integrates exactly over each step.
Apply maximum braking for \(n=\lfloor v/(ah)\rfloor\) full samples. The remaining speed \(w=v-nah\) is in \([0,ah)\). During these \(n\) samples the speed decreases linearly, so the travelled distance is their duration times the average of initial and final speed.
If \(w>0\), select \(u=-w/h\) for the last interval. The last step travels \(hw/2\) and ends at rest exactly on a sampling instant. Combining the two contributions yields the minimum stopping distance with this no-reversal and held-command requirement.
Maximum early braking minimises future speeds and hence the travelled distance. The extra term compared with continuous switching is nonnegative and vanishes for an integer number of full braking intervals. A position-only terminal constraint can overlook this extra travel.
Worked example
Check if a carriage can stop before its limit
Let \(v=0.550\) m/s, \(a=2.00\) m/s² and \(h=0.100\) s. Two full braking steps leave \(w=0.150\) m/s. They consume \(0.200(0.550+0.150)/2=0.0700\) m. The final step needs \(u=-1.50\) m/s² and travels 7.50 mm, giving 77.5 mm total. A remaining clearance of 76.0 mm exceeds the continuous stopping distance of 75.6 mm but is insufficient for the sampled axis.
Change the inputs and inspect this calculation below
Second application
Bound the error without knowing the initial speed
For \(a=1.20\) m/s² and \(h=0.200\) s the correction is largest at \(w=ah/2\). Its maximum is
At \(v=0.360\) m/s a full step leaves exactly 0.120 m/s, so the continuous estimate of 54.0 mm increases to 60.0 mm. Reducing the sample interval by half reduces this worst-case excess distance by a factor of four.
Interactive calculation · Change the inputs of this example
Use the adjustable quantities to test the two worked calculations above. The plot recomputes this derivation’s balance or constitutive relation; its numerical readout reports the quantities needed for the forward calculation and the inverse or design question. Keep the fixed assumptions stated in the readout when comparing with the example values.
Predict a sequence before applying the first action
For \(x_{k+1}=Ax_k+Bu_k\) with measured or estimated \(x_k\), successive substitutions give
The initial state sets the free response; the planned input sequence contributes linearly. With quadratic tracking and effort penalties, linear dynamics and linear bounds on states or inputs, planning becomes a convex quadratic programme. At each update apply only the first planned command, acquire a new measurement and solve again. Receding the horizon provides feedback when disturbances make actual motion depart from the earlier prediction.
Solve a two-step constrained problem
Take the dimensionless integrator \(x_{k+1}=x_k+u_k\), \(x_k=2\), and target zero. Minimise \(x_{k+1}^2+x_{k+2}^2+u_k^2+u_{k+1}^2\). With \(u=u_k,v=u_{k+1}\), the objective is \((2+u)^2+(2+u+v)^2+u^2+v^2\). Its stationary equations are
The unconstrained plan \(u=-1.2,\ v=-0.4\) reaches states 0.8 and 0.4. If both input magnitudes are limited to one, the first command is infeasible. Fixing \(u=-1\) and reoptimising the second gives \(v=-0.5\), reaching 1 and 0.5. The derivative with respect to \(u\) points toward smaller \(u\) at this boundary, confirming the active limit.
After applying −1, suppose the new state is exactly 1. The next two-step unconstrained plan scales the original one by one half, giving first action −0.6. The earlier second action was −0.5. This change is consistent even without disturbances, since the new optimisation includes a further future step. A terminal cost approximating the remaining cost of control can reduce this artificial dependence on the planning horizon.
Feasible commands and feasible trajectories differ
A command bound always has feasible choices if zero lies within it. Adding a hard state constraint, such as a position stop, may make all predicted trajectories infeasible from the current state. Before asking for a time-optimal move, compute elementary reachability bounds. With \(|u|\le1\), a scalar integrator can move at most \(N\) units in \(N\) samples. A terminal constraint demanding zero from state 3 in two samples is impossible. Allowing slack in a comfort-related temperature band may be defensible; a physical actuator limit must still be enforced. Report which constraints were active and what performance was sacrificed.
Close the engineering loop
For a practical comparison, first establish a verified baseline with the OneSimulation proportional-loop record. Reconstruct its pole and finite-record bias from the model parameters. This record witnesses how an unconstrained linear loop behaves; it does not itself exercise a predictive optimiser. Now design a separate held-input or constrained test whose command reaches a known bound, record measured timestamps and actuator signals, and compare with a by-hand prediction of the first active limit. The useful performance claims differ: accurate steady tracking, stable sampled dynamics, adequate estimator uncertainty and feasibility under limits each require an observation capable of testing them.
Derive a terminal region that can be maintained indefinitely
A finite-horizon planner can reach a state at its last predicted sample that looks inexpensive but has no feasible continuation. A terminal set provides a constructive remedy. For \(x_{k+1}=Ax_k+Bu_k\), choose local feedback \(u=Kx\). A set \(X_f\) is positively invariant under this feedback if every \(x\in X_f\) satisfies the state and input bounds and \((A+BK)x\in X_f\). Requiring the last predicted state to belong to this set gives the next optimisation a candidate, provided the model is exact and a feasible plan already exists.
To see this, suppose the accepted plan contains controls \(u_0,\ldots,u_{N-1}\) and states \(x_0,\ldots,x_N\in X\), with \(x_N\in X_f\). Apply \(u_0\). At the next time, shift the remaining controls one step and append \(Kx_N\). Its last state is \((A+BK)x_N\), still in \(X_f\). Every intermediate state and command came from the old feasible plan. This argument establishes recursive feasibility for the ideal deterministic system; the cost can then be chosen to establish a separate performance or stability claim.
For an unstable scalar plant \(x^+=1.2x+u\), bounds \(|u|\le0.5,\ |x|\le2\), choose \(u=-0.7x\). The resulting factor is 0.5. Choosing \(|x|\le0.5/0.7=5/7\) protects the local input limit and the next-state magnitude contracts. This interval is one admissible terminal set; it need not be the largest invariant region obtainable with all possible controls.
Construct the two-step feasible region by working backwards
For the same plant, suppose a terminal interval is \([-b,b]\). A current state can reach it in one step if the reachable interval \([1.2x-0.5,1.2x+0.5]\) intersects \([-b,b]\). Solving the two endpoint inequalities gives \(|x|\le(b+0.5)/1.2\), additionally restricted by \(|x|\le2\). Starting from \(b_0=5/7=0.7143\), the one-step interval has half-width \(b_1=1.0119\), and the two-step interval has \(b_2=1.2599\). A current error \(x=1.20\) is therefore feasible for two steps but cannot reach the terminal set in one.
A feasible two-step plan applies \(u_0=u_1=-0.5\). It generates \(x_1=0.94,\ x_2=0.628\), inside the terminal interval. The appended local command is \(-0.7(0.628)=-0.440\), generating \(x_3=0.314\). From \(x=1.40\), however, even two maximal negative commands yield
A solver reporting infeasibility there has identified a physical horizon limitation. Lengthening the horizon can enlarge the feasible region. External disturbances and estimator error can spoil the exact shifted-plan construction, motivating reserve inside the hard bounds or an explicitly disturbance-aware terminal set.
Observe the limiting sequence of backwards-reachable interval widths. Ignoring the physical state cap for a moment, the recursion has fixed point \(b=(b+0.5)/1.2=2.5\). At \(x=2.5\) the strongest negative input merely holds position, and beyond it even that input allows outward divergence. With the stated state limit the physically relevant bound is tighter at 2.0. From \(x=2.0\) the strongest input moves to 1.9, so that boundary can be brought inward over enough samples. This examination distinguishes insufficient horizon from insufficient actuator authority. A solver change cannot rescue a state above the unrestricted 2.5 threshold with the given input, whereas increasing horizon can rescue a feasible physical state that lies just beyond the current backwards-reachable interval.
Now suppose implementation records establish an additive one-step disturbance bound \(|w|\le0.05\) in \(x^+=1.2x+u+w\). At local feedback \(u=-0.7x\), guaranteeing that \([-b,b]\) maps to itself under every such disturbance requires
The terminal interval above satisfies this because \(b=0.7143>0.10\), and the feedback still respects the input limit. To guarantee that a chosen predecessor reaches this interval in one step, the nominal next state needs to lie within \([-b+0.05,b-0.05]\). The robust predecessor half-width is thus \((b-0.05+0.5)/1.2=0.970\), smaller than the nominal 1.012.
Applying the backward rule twice gives the robust two-step half-width \((0.970-0.05+0.5)/1.2=1.183\) when an updated action can be selected at the intermediate state. The previously feasible initial state 1.20 is outside that guarantee. Indeed maximal negative actuation with two consecutive positive disturbances yields
A nominally feasible trajectory and an invariant terminal set alone therefore do not make the whole finite-horizon plan robust. The intermediate constraints and the information available when choosing the next input must also be included in the guarantee.
Locate the first active constraint in a predictive policy
For \(x^+=x+u\), penalise the sum of squared future states and inputs. In one step the unconstrained action is \(-x/2\). Eliminating the second action in a two-step plan gives first action \(-3x/5\). Solve again on the active face once the input bound is reached.

Read values from the plot
| Initial state | Two steps, unconstrained | Two steps, |u| ≤ 1 | One step, |u| ≤ 1 |
|---|---|---|---|
| −3.5 | 2.1 | 1 | 1 |
| −1.75 | 1.05 | 1 | 0.875 |
| 0 | 0 | 0 | 0 |
| 1.75 | −1.05 | −1 | −0.875 |
| 3.5 | −2.1 | −1 | −1 |
Interactive calculation · change the inputs of this example
Raise the actuator penalty and then reduce its magnitude limit. Compare when the one-step and two-step policies first saturate.
The curves below are recalculated from this section’s equations in your browser. The fixed reference plot above remains available for comparison.
Study the full derivation
Predicting a delayed process and testing a Smith controller · System dynamics, feedback and estimation
A heater is upstream of a temperature sensor. Its internal thermal response begins immediately while a material parcel reaches the sensor several seconds later. Build a feedback signal from two model outputs, derive which transfer function loses its delay, and then deliberately introduce a delay mismatch to see why a plausible prediction may fail.
Problem sheet 6 · Coupled plants and constrained predictions
End the course by testing an actuator pairing, a finite-horizon plan and a specification that initially looks feasible.
1. Unequal heat paths
For \(G=\left(\begin{smallmatrix}3&1\\2&2\end{smallmatrix}\right)\), (a) compute its relative gain array. (b) Calculate both actuator changes needed to raise output 1 by one unit while holding output 2 fixed. (c) Are these changes available if both actuators already sit at their lower bounds?
Solve the outputs before choosing a controller
The determinant is 4, so the array has diagonal entries \(6/4=1.5\) and cross entries \(-2/4=-0.5\). The desired change \(G^{-1}(1,0)^\mathsf{T}=(0.5,-0.5)^\mathsf{T}\) needs the second heater to reduce its command. At its lower bound this is infeasible. Reassigning loop pairings does not remove this physical constraint.
2. Active limits in a predictive move
Use the chapter's two-step integrator problem with initial state 3 and \(|u|,|v|\le1\). (a) Find the unconstrained plan. (b) Optimise the second action when the first is at its lower bound and compute the objective. (c) Can a requirement \(x_{k+2}=0\) be added?
Check the unconstrained optimum, then the active face
Scaling the unconstrained plan gives \((-1.8,-0.6)\). Fix \(u=-1\); the remaining derivative is \(2(2+v)+2v\), giving \(v=-1\), which is feasible. The input gradients at the lower bounds are nonnegative (the second is zero), establishing optimality for the convex objective. The states are 2 and 1, so the cost is \(4+1+1+1=7\). The largest two-step reduction is 2, so the terminal equality is infeasible.
3. A requirement beyond actuator authority
A speed loop has steady plant \(y=2u-d\), with \(|u|\le2\), opposing disturbance \(d=1\) and desired speed 4 in normalised units. (a) Test whether any controller can track that command indefinitely. (b) Find the best possible steady output and error. (c) Give the measurements needed to distinguish saturation from an incorrect model gain in a logged experiment.
Apply the balance before retuning the loop
Steady tracking requires \(u=(4+1)/2=2.5\), beyond the upper bound. The maximum steady speed is 3, leaving error 1. Log the controller's requested action, the delivered actuator signal, the load and the measured response. Verify the gain using smaller feasible steady commands; if delivered and requested signals diverge at the limit, the balance predicts the observed loss of tracking. Increasing integral gain cannot change the feasible steady range.
Commission a sampled loop with a limited actuator
A first-order plant has unit gain and time constant 1 s. A proportional controller of gain 3 holds its command for h seconds. With a unit reference and zero initial output, find the steady error, the sampling limit and the first three sampled outputs for h = 0.50 s. Then limit the command to [0, 1]. Predict the first sample at which the upper limit releases.
Worked solution
Integration during one hold gives yₖ₊₁ = ayₖ+(1−a)uₖ with a = exp(−h). Before clipping, uₖ = 3(1−yₖ), the pole is 4a−3, and the equilibrium is 0.75. The error 0.25 is independent of h for a stable loop. Requiring the pole to exceed −1 gives h less than ln 2 seconds. At h = 0.50 the pole is −0.5739; the other stability inequality holds for positive h.
The first three outputs are 0.75[1−(4a−3)ᵏ] for k = 1, 2 and 3, approximately 1.180, 0.503 and 0.892. The first unconstrained command is 3. After clipping the actuator stays at one until a sample reaches y ≥ 2/3, when the requested input no longer exceeds one.
While the limit is active the output ticks follow yₖ = 1−exp(−0.5k). At k = 2 the output is 0.632 and the controller still requests 1.104. At k = 3 the output is 0.777 and the request is 0.669. The upper limit releases at 1.5 s. In the course experiment compare the unlimited trajectory first. Applying the scalar pole relation across a saturated interval would identify a different dynamics.
Explore the governing equations after solving the sheet: Interacting actuators, pairing and decoupling; Finite-horizon control with real actuator constraints. Compare the assumptions and units before transferring your chosen parameters; the controls may cover a different numerical range from the written exercise.
Chapter 13 · Proving a region of attraction with the energy of a pendulum
Pole locations describe a small neighbourhood of a nonlinear equilibrium. An energy argument can prove that a much larger set of initial conditions converges to the same resting point. Work out the region explicitly and test individual trajectories against its boundary.
Extract a storage function from a torque balance
Measure angle \(\theta\) from the downward vertical, let \(\omega=\dot\theta\), and use pivot inertia J and gravitational torque coefficient \(K=mgl\). Add viscous damping b and a control torque \(u=-k_d\omega\) that opposes motion. The closed dynamics are \(J\dot\omega=-K\sin\theta-(b+k_d)\omega\). Define a scalar function with units of energy by adding kinetic energy to the integral of the restoring torque from zero angle:
A positive damping coefficient ensures energy cannot increase. On the branch \(-\pi<\theta<\pi\), V is positive away from the hanging rest state and zero there. Its derivative is zero whenever velocity vanishes, including ordinary turning points. To justify eventual convergence we need to establish whether any motion can remain indefinitely in this zero-derivative set.
Distinguish a turning point from an invariant state
At \(\omega=0\) a nonzero \(\sin\theta\) produces angular acceleration, taking the trajectory immediately away from zero velocity. Inside the well the only state remaining forever at zero velocity is \((0,0)\). The upright position sits at potential energy \(2K\). Each closed sublevel \(V\le c<2K\) containing the downward rest state is compact and cannot leave the well, because reaching \(\theta=\pm\pi\) would cost at least \(2K\). LaSalle's invariance principle then establishes asymptotic convergence on that component.
This expresses the strict sublevel as a speed allowance at each angle. A state outside it can still settle in the same well because damping removes energy before it reaches the top. The inequality is a sufficient certificate that can be tested from an initial measurement. Exactly at the upright rest state no damping torque acts and the system can remain there.
Compare two releases at the same angle
Let \(J=0.20\) kg m², \(K=2.0\) N m and \(b+k_d=0.30\) N m s/rad. At 60° the potential energy is 1.0 J and the certificate allows speeds below \(\sqrt{30}=5.48\) rad/s. At 4 rad/s the total is 2.6 J, safely below the 4 J barrier. The turning angle cannot exceed \(\arccos(1-2.6/2)=107.5^\circ\) in magnitude. Positive damping reduces the actual maximum further.
At 6 rad/s the initial energy is 4.6 J, outside that guarantee. The instantaneous dissipation is \(0.30(6)^2=10.8\) W, so dissipation before any top crossing may be substantial. Integrate the equation with the same initial angle and compare the true energy trace with the barrier. Moving the damping slider changes the rate of energy loss, while the sublevel calculated from J and K remains fixed.
Raise the starting speed until the initial energy just exceeds the barrier. Compare a damped run with a zero-damping run. Use the two traces to distinguish a guaranteed sublevel from energy actually removed during a particular trajectory.
Tutorial · design an admissible release speed
At 120° with the same parameters, choose a speed ensuring the trajectory remains below 90% of the barrier. What changes in the proof if the velocity gain cancels the physical damping exactly?
Show the energy budget
The potential energy is
The target maximum total energy is 3.6 J, leaving 0.6 J of kinetic energy. Thus \(|\omega_0|\le\sqrt{2(0.6)/0.20}=2.45\) rad/s to the quoted precision. When \(b+k_d=0\), energy is constant. The sublevel remains invariant, but whole undamped orbits now lie in the zero-derivative set, so convergence to rest no longer follows.
Further reading · Åström and Murray, Feedback Systems · chapter 5, Lyapunov stability
Chapter 14 · Why integral action rejects an unknown constant load
A motor regulates speed while an unknown torque is applied to its shaft. A proportional controller allows a steady speed offset. Add a state that remembers the offset and derive the complete load transient as well as its eventual rejection.
Find the equilibrium before tuning poles
Use \(J\dot y+by=u-d\), where y is angular speed, u is motor torque, and d is an opposing load. For \(u=K_p(r-y)\) at constant reference r and load d the steady speed is \((K_pr-d)/(b+K_p)\). With r=0 and a positive load the speed settles below zero in these deviation variables. A constant motor torque is needed to cancel the load, yet pure proportional control at zero error produces zero torque.
Introduce \(z' = r-y\) and \(u=K_p(r-y)+K_i z\). At any equilibrium the condition \(z'=0\) requires \(y=r\); the plant equation then requires
The controller state can store the torque needed at zero error. This reasoning assumes available actuator torque and closed-loop stability. If the actuator cannot supply \(br+d\), no such regulated equilibrium exists.
Place the poles and solve a disturbance step
Set r=0 and transform from initial equilibrium with zero deviations. Eliminating z gives
The numerator zero at s=0 removes constant disturbances in steady state. It follows from the integrator pole in the open loop. For a load step \(D=d_0/s\), the initial rate is \(-d_0/J\) regardless of gains because the feedback states have not had time to change. For a repeated real pole at \(-a\), inversion yields
A peak and recovery are expected even with exact final rejection. Increasing a improves that peak in the ideal model, at the price of higher control gains and possible sensitivity to sensor noise or actuator limits.
Quantify how a speed loop recovers
Let \(J=0.20\) kg m², \(b=0.50\) N m s/rad and choose \(a=4\) s⁻¹. The critical gains are \(K_p=1.10\) N m s/rad and \(K_i=3.20\) N m/rad. A step of 2 N m gives a peak deviation of −0.920 rad/s after 0.25 s. At 1 s it has recovered to −0.183 rad/s and ultimately reaches zero. The stored state supplies exactly 2 N m once speed has recovered.
With the same \(K_p\) but no integral action, the step gives \(y(t)=-2[1-e^{-(1.6/0.2)t}]/1.6\), tending to −1.25 rad/s. Its initial slope is also −10 rad/s². Use the two traces to identify an interval where a short measurement could make the controllers look similar, and compare their final speed offsets. For a disturbance of the opposite sign the curves reverse by linearity.
Double the pole rate and predict the new peak time and peak magnitude. Compare the very first slopes of PI and proportional-only responses. Which of the measurements could reveal increased bandwidth and which depends only on inertia?
A related OneSimulation calculation
Use the course first-order feedback study to measure how proportional gain changes the transient. Compare the trends with the proportional-only curve above before introducing the extra integral state.
Tutorial · pick poles from a peak-error specification
A 1.5 N m load step must produce at most 0.50 rad/s peak error with \(J=0.20\) kg m² and the same b. Choose the smallest critical pole rate meeting this condition and calculate the gains. What torque must remain available after the transient?
Show the bound and gains
Using the exact peak gives \(a\ge1.5/[0.20e(0.50)]=5.52\) s⁻¹. Thus \(K_i\simeq6.09\) and \(K_p\simeq1.71\) in the units above. The motor needs at least 1.5 N m of extra steady torque to reject the new load at the original speed. Pole placement alone cannot establish the available transient or steady torque margin.
Further reading · Åström and Murray, Feedback Systems · chapter 7, integral action
Chapter 15 · Separating reference tracking from disturbance rejection
A positioning or speed loop can reject a load well but follow a demanded trajectory poorly. Add a feedforward signal computed from the requested motion, and derive precisely how mismatch and command smoothness affect tracking.
Use a physical balance to predict the required input
Take a first-order plant \(J\dot y+by=u-d\) with positive inertia and drag. Suppose the commanded speed \(r(t)\) and its derivative are available from a trajectory generator. From the plant balance the model input that would exactly sustain \(y=r\) at zero disturbance is \(\widehat J\dot r+\widehat b r\), where hats indicate estimated parameters. Add ordinary proportional correction on the tracking error \(e=r-y\):
This error equation separates three causes of deviation. Feedback changes the decay rate and attenuates each forcing term. With exact parameters, zero disturbance and correct initial conditions, arbitrary differentiable trajectories are tracked exactly in this ideal model. A discontinuous step calls for an impulse through the derivative term; a finite actuator cannot follow it. A generated smooth trajectory supplies a realizable alternative.
Background · Complementary sensitivity
For the same feedback configuration S plus T is one. Measurement noise and plant-input disturbances reach the output on different paths.
Design a command with finite endpoint slopes
Move from zero to target R during an interval T with \(r=R(3s^2-2s^3)\), \(s=t/T\). It has zero velocity derivative at both ends and peak \(\dot r=1.5 R/T\) at the midpoint. Doubling T halves the inertial part of the nominal torque without changing the final drag torque. An acceleration or torque budget can therefore determine trajectory duration before feedback gains are selected. A sensor derivative of a noisy measured speed is unnecessary here because \(\dot r\) is computed from the commanded polynomial.
For a constant-slope segment \(r=vt\), suppose drag is estimated exactly and the load is zero. The mismatch forcing is \((J-\widehat J)v\). Away from segment transitions the settled tracking lag is \((J-\widehat J)v/(b+K_p)\). At a hold after the segment the mismatch forcing disappears, and this lag decays with time constant \(J/(b+K_p)\).
A tracking error that reveals the wrong inertia
Let \(J=0.20\), \(b=0.50\) and \(K_p=1.5\) in consistent SI units. The tracking time constant is 0.10 s. With \(\widehat J=0.15\), correct drag and a 4 rad/s² ramp, the lag approaches \(0.05(4)/2=0.10\) rad/s. After 0.30 s it reaches
A constant opposing load of 0.40 N m adds a steady 0.20 rad/s lag regardless of this inertia mismatch. Correcting feedforward inertia can improve tracking without changing load rejection.
For a cubic transition to 4 rad/s in 1 s, the midpoint has \(r=2\) rad/s and \(\dot r=6\) rad/s². The nominal motor torque at that instant is \(0.20(6)+0.50(2)=2.20\) N m. Repeating the move in 2 s reduces the midpoint request to 1.60 N m; the final torque remains 2.0 N m for both durations. The plot integrates the error equation, so it also captures lag while the slope changes.
Set estimated inertia equal to the actual 0.20 kg m² before changing move duration. Then halve the estimate and compare lag during acceleration and during the hold. Explain how shortening move duration tests the available torque separately from feedback damping.
Tutorial · distinguish drag bias from inertia bias
With no external load, a long constant-speed hold at 4 rad/s leaves a 0.10 rad/s lag. Use the same true b and tuned \(K_p\) to estimate \(\widehat b\). Can a measurement during this hold identify the feedforward inertia as well?
Show the identification argument
At constant reference \(\dot r=0\) and at equilibrium \(\dot e=0\). Thus \(0.10=(0.50-\widehat b)(4)/2\), giving \(\widehat b=0.45\) N m s/rad. The inertia term vanishes identically on this data segment. A segment with nonzero \(\dot r\), ideally repeated at opposite slopes at the same speed, supplies an independent observation of inertial mismatch.
Further reading · Åström and Murray, Feedback Systems · chapter 12, feedforward design
Chapter 16 · How much transport delay a feedback loop can tolerate
A communication or transport delay changes phase at every frequency while leaving gain untouched. Use that property to derive the first stability boundary for a specific loop and to interpret the phase margin in units of seconds.
Locate the critical imaginary-axis crossing
Use negative unity feedback with \(L(s)=K e^{-s\tau}/(1+sT)\), where K is dimensionless, T is a plant time constant and \(\tau\) is a pure delay. With \(\tau=0\) and positive K the single closed-loop pole is \(-(1+K)/T\). At a purely imaginary characteristic root \(s=j\omega\), the condition \(1+L(j\omega)=0\) requires both unit magnitude and an odd multiple of \(-\pi\) phase. Since the delay has magnitude one, the unique positive gain-crossover frequency for \(K>1\) obeys
The undelayed plant contributes \(-\arctan(\omega_cT)\). The delay contributes an unwrapped phase \(-\omega_c\tau\) in radians. The first critical delay therefore satisfies
Further crossings at the same frequency would require another \(2\pi\) of delay phase. The first one governs the delay margin because the zero-delay system is stable. For \(0<K<1\) no positive frequency reaches unit gain in this particular first-order model. At \(K=1\) the only unit magnitude occurs at zero frequency where the phase is zero.
Background · Loop delay
A pure delay leaves the magnitude unchanged and adds frequency-dependent phase. Use angular frequency when converting a margin to seconds.
Check that the first crossing enters instability
The characteristic equation can be written \(1+sT+K e^{-s\tau}=0\). Implicit differentiation and substitution of \(K e^{-s\tau}=-(1+sT)\) give
To test the direction it is simpler to invert this derivative:
A complex number and its reciprocal have real parts of the same sign. Thus the conjugate pair enters the right half-plane when the delay increases past the first critical value. The oscillation period there is \(2\pi/\omega_c\).
Latency budget at two loop gains
With \(T=0.50\) s and \(K=2\), \(\omega_c=3.464\) rad/s. The undelayed phase at crossover is −60°, leaving 120° or 2.094 rad. The critical delay is 0.605 s and the crossing period is 1.81 s. An installation with 0.30 s of delay retains about 60.5° of phase margin.
Raise K to 4 with the same T. Then \(\omega_c=7.746\) rad/s, the undelayed phase is −75.5°, and the delay margin falls to 0.235 s. The same 0.30 s installation would cross the stability boundary. Reading a phase plot wrapped modulo 360° can conceal such a crossing. Use the unwrapped curves and locate the frequency where gain equals one before judging stability.
At fixed loop gain increase delay until the reported margin vanishes. Use the frequency of that point to estimate the oscillation period. Repeat after increasing gain and check whether the same physical time delay spends the same phase budget.
A related OneSimulation calculation
Measure how a gain change affects the undelayed first-order closed loop in the course laboratory. Then use its increased bandwidth to explain the reduced delay budget calculated here.
Tutorial · allocate a reserve in degrees
With \(K=2,\ T=0.50\) s require at least 45° phase margin. Calculate the largest total delay and the spare time when fixed transport already takes 0.20 s. Explain the effect of using degrees directly in \(\omega\tau\).
Show the phase budget
Subtract the required 45° from the undelayed 120°, leaving 75° for delay. Converting to radians gives \(1.309/3.464=0.378\) s total. The remaining budget is about 0.178 s. The expression \(\omega\tau\) is in radians for \(\omega\) in rad/s. Dividing the number 75 directly by 3.464 would overestimate the budget by \(180/\pi\).
Further reading · Åström and Murray, Feedback Systems · chapter 10, Nyquist criterion and stability margins
Study the full derivation
Predicting a delayed process and testing a Smith controller · System dynamics, feedback and estimation
A heater is upstream of a temperature sensor. Its internal thermal response begins immediately while a material parcel reaches the sensor several seconds later. Build a feedback signal from two model outputs, derive which transfer function loses its delay, and then deliberately introduce a delay mismatch to see why a plausible prediction may fail.
Chapter 17 · Why a stable plant can initially move in the wrong direction
Two processes may act on a measured output at different speeds and with opposite signs. Their combined output can first fall after a positive command and later rise. Derive that transient and see why trying to cancel its zero creates an unstable internal state.
Build a right-half-plane zero from two stable responses
Let a unit input drive two stable first-order processes in parallel. A slow path has gain \(a>0\) and time constant \(T_s\); a fast path is subtracted, with gain \(b>0\) and time constant \(T_f<T_s\). The measured output transfer function is
Choose \(a>b\) so the final step response is positive. Its initial slope is \(a/T_s-b/T_f\). When this slope is negative, \(bT_s>aT_f\), so the numerator has a real positive zero \(z=(a-b)/(bT_s-aT_f)\). Each storage process has a stable pole. The right-half-plane zero expresses the way their contributions are combined in the output.
Locate the undershoot without a numerical search
For a unit step apply each path's time-domain solution and subtract. Setting the time derivative to zero and taking logarithms gives the time of minimum.
For the inverse-response conditions this is positive. The steady value diagnosis alone would see only \(a-b\); a short test would reveal mostly the fast negative path. Identifying both requires measurements on both time scales. When the fast and slow slopes exactly match, the numerator loses its s term and the finite zero moves to infinity.
Read a time-domain constraint directly from the zero
For a bounded causal unit-step response \(Y(s)=G(s)/s\). At the zero \(Y(z)=0\), hence
An output ultimately settling to a positive constant cannot stay positive at every time while obeying this weighted integral. A controller implementing the exact inverse \(1/G\) would have a pole at z and an exponentially growing response to small errors in its internal state. Shaping the command over a longer interval can reduce an undershoot without introducing that unstable inversion.
Two experiments with the same final reading
Take \(a=2,\ b=1,\ T_s=4\) s and \(T_f=0.50\) s. The zero is at \(1/3\) s⁻¹. The initial slope is \(0.5-2=-1.5\) s⁻¹ and the minimum occurs at 0.792 s. Evaluating the response gives about −0.435 before it ultimately reaches +1. This initial dip can look like a sensor wired with the wrong sign until the slow path has had time to act.
Lengthen the fast path to 1.5 s. The same final value +1 now accompanies a less negative initial slope of −0.167 s⁻¹. The zero moves to \(1/(4-3)=1\) s⁻¹ and the minimum occurs at 0.690 s with an undershoot about −0.052. Try moving the fast time constant through 2 s. Predict the initial slope and disappearance of the undershoot before examining the curves.
Increase the fast time constant through the equal-slope value of 2 s at the default gains. Predict the disappearance of the negative excursion. Reduce the subtracted gain and derive the new equal-slope condition before repeating the test.
Tutorial · infer a hidden fast time constant
A fitted slow path has \(a=2,\ T_s=4\) s. The steady step response is 1 and the measured initial slope is −0.75 s⁻¹. Infer b, \(T_f\), the zero position and the time of minimum.
Show the parameter recovery
The final reading gives
The initial slope gives \(1/T_f=2/4+0.75=1.25\) s⁻¹, so \(T_f=0.80\) s. The zero is \(1/(4-1.6)=0.417\) s⁻¹ and \(t_{\min}=\ln(4/1.6)/(1.25-0.25)=0.916\) s. Combining a static observation with a dynamic one makes both path parameters identifiable in this ideal two-path model.
Further reading · Åström and Murray, Feedback Systems · chapter 14 on fundamental limits
Chapter 18 · Designing a lead network at a specified gain crossover
A loop is too lightly damped at the bandwidth needed for tracking. A lead network can supply positive phase over a frequency band. Locate the band mathematically, set its gain crossover deliberately and measure the accompanying high-frequency gain increase.
Build a lead element from one pole and one zero
Take \(C(s)=K(1+sT)/(1+sT/\alpha)\) with \(\alpha>1\). The zero occurs at \(1/T\) and the pole at the higher frequency \(\alpha/T\). Its phase contribution is \(\phi=\arctan(\omega T)-\arctan(\omega T/\alpha)\). At very low or very high frequency that phase tends to zero. Differentiate with respect to \(z=\omega T\) to locate the interior maximum:
The maximum occurs at the geometric mean of the zero and pole frequencies. At this same frequency the magnitude of the dynamic part is \(\sqrt\alpha\), obtained by substituting \(z^2=\alpha\) into \(\sqrt{(1+z^2)/(1+z^2/\alpha^2)}\). Thus positive phase comes with a magnitude change. Adding lead without resetting scalar K can move crossover to a frequency where the anticipated plant phase and lead are different.
Set the phase and magnitude at a common design point
For a stable minimum-phase design example with an open-loop integrator, take \(G(s)=1/[s(1+s)]\) and select \(\omega_c=2\) rad/s. Plant phase there is
Choose 30° extra lead, giving nominal phase margin 56.57°. Invert the peak-phase relation and put the peak at the target frequency:
A scalar-gain controller chosen for the same crossover would have \(K_P=1/|G(i\omega_c)|\) and margin only 26.57°. This comparison holds crossover fixed, so the phase advantage can be attributed to the compensator. The return ratio magnitude must still be checked away from crossover, especially for a plant with additional modes or delay.
Calculate the network and identify a robustness cost
For the 30° design \(\alpha=3,\ T=0.866\) s, giving zero and pole frequencies of 1.155 and 3.464 rad/s. Plant magnitude at 2 rad/s is \(1/(2\sqrt5)=0.2236\), so K=2.582. The high-frequency control gain tends to \(K\alpha=7.746\), while its low-frequency gain is 2.582. High-frequency measurement noise passed through a feedback controller can therefore induce larger actuator activity than a low-frequency calculation suggests. The actual noise transfer to the input must include the loop sensitivity.
Require a more aggressive 45° boost at the same crossover. Then \(\alpha=5.828,\ T=1.207\) s and \(K=1.852\). Margin becomes 71.57° and the high-frequency gain reaches 10.80. The larger boost also lowers the DC controller gain, which changes low-frequency disturbance attenuation in this plant. Comparing the two phase traces alongside their designed crossover avoids selecting a controller purely from its maximum phase number.
Keep crossover at 2 rad/s and increase the required phase from 30 to 45 degrees. Compare the high-frequency controller gains. Now fix lead and move crossover upward to inspect how plant phase can consume the added margin.
Tutorial · allow for a known delay
Return to the 30° design and insert a 0.10 s pure delay. Compute the remaining phase margin at 2 rad/s. What maximum additional delay is compatible with a required 40° margin? Why is there no gain crossover shift for this change?
Spend the phase reserve in radians
At crossover 0.10 s adds \(2(0.10)=0.20\) rad or 11.46° of phase lag. Margin falls to 45.11°. To retain 40° permits a further \((45.11-40)\pi/[180(2)]=0.0446\) s. Pure delay has unit magnitude at every frequency, so the designed crossover stays fixed. In contrast, adding a physical low-pass filter would change both gain and phase and require a fresh crossover calculation.
Further reading · Åström and Murray, Feedback Systems · chapter 12, feedback design by loop shaping
Study the full derivation
Sensitivity, bandwidth and the integral price of disturbance rejection · System dynamics, feedback and estimation
A regulator attenuates a slowly varying output load yet amplifies another disturbance at a higher frequency. Separate the paths by which reference, measurement noise and physical disturbance reach the recorded variable, then derive an integral identity that explains why a stable loop can redistribute sensitivity across frequency.
Chapter 19 · The period and duty cycle of a thermostat with hysteresis
A two-position thermostat can have a stable, repeatable temperature oscillation even though neither operating state has an equilibrium inside the chosen control band. Use event times to calculate the cycle and test its heat balance.
Couple a thermal balance to a discrete memory state
Let a uniform thermal mass have heat capacity C, conductance G to ambient at \(T_a\), and heater power P when the switch state \(s=1\). With heater off \(s=0\). The continuous state obeys \(C\dot T=-G(T-T_a)+Ps\). The relay turns on when cooling reaches \(T_-\), and turns off when heating reaches \(T_+>T_-\). Between thresholds it retains the most recent switch state. Thus specifying a temperature inside the band without the binary state does not fully specify the future.
Both thresholds must be reachable in their respective modes for periodic cycling: \(T_a<T_-<T_+<T_{\rm on}\). If \(T_{\rm on}=T_+\) the threshold is approached only asymptotically in this ideal model. A temperature outside the band initially can lead to a transient before the repeating orbit begins.
Solve the crossing conditions exactly
Start at \(T_-\) with the heater on. Solve the exponential trajectory for the time to \(T_+\). Switch state, set that endpoint as the cooling initial condition and solve for the return time. Each logarithm compares distances from the relevant equilibrium:
Integrate the energy equation over one complete period. Net stored energy change is zero, so \(PD=G(\bar T-T_a)\). This gives the actual time-average temperature directly from the duty ratio. The arithmetic midpoint of the thresholds need not be the time average, because heating and cooling speeds vary across the swing.
Choose band width and estimate switching frequency
Let \(C=2000\) J/K, \(G=10\) W/K, \(P=200\) W and \(T_a=15^\circ\)C. The time constant is 200 s and the heating equilibrium is 35 °C. For thresholds 20 and 22 °C the on-time is \(200\ln(15/13)=28.62\) s and the off-time \(200\ln(7/5)=67.29\) s. Period is 95.9 s and duty 29.84%. Mean power is 59.7 W and the implied mean temperature 20.97 °C. The shorter heating interval reflects the larger temperature distance from the heated equilibrium.
Narrow the band to 20.5 and 21.5 °C at the same midpoint. The on-time falls to 14.29 s and off-time to 33.41 s. Switching frequency roughly doubles while duty remains close to 30%. In a real relay, sensor lag can permit overshoot beyond thresholds. A narrow hysteresis band then ceases to predict the observed extrema. Increasing numerical resolution in a continuous integrator only helps if its logic also detects the threshold crossing at the proper time.
Narrow the switching band by half while keeping its midpoint fixed. Predict the switching frequency and mean heating power, then read both event times. Raise heater power and identify which branch of the thermal trajectory should remain unchanged.
Tutorial · infer the thermal capacitance from one cycle
Suppose the wider band gives a measured cooling time of 80.0 s with ambient at 15 °C and the same conductance. Infer C and predict heating time if heater power remains 200 W. If the observed heating time disagrees but the cooling curve fits, identify one additional independent measurement.
Infer the time constant then check the energized mode
The cooling expression gives
Predicted heating time is
Measuring electrical heating power or the long-time temperature reached under a continuous on command tests \(P/G\). The cooling branch alone identifies the ratio C/G and does not determine that energized equilibrium.
Further reading · UC Berkeley Ptolemy Project · thermostat as a continuous plant controlled by a finite-state machine
Chapter 20 · Learn a repeatable positioning move from its previous error
An inspection stage follows the same position command on hundreds of nominally identical passes. A small force disturbance returns at the same part of each move. The complete tracking record from the previous pass is available before the next move begins. Derive a learning update that uses the stage dynamics to turn that record into a new feedforward command. Its convergence can be predicted from singular values and tested with a few lines of code.
Separate time within the move from the number of the move
Let \(k=0,\ldots,N-1\) index input samples during a single pass, and let \(j\) count completed learning updates between passes. Before every pass return the stage to the same initial state. The reference trajectory, sampling period and number of samples must match from one pass to the next. If the fixture slips in time or the first sample corresponds to a slightly different position, an otherwise repeatable disturbance appears to move through the record. Alignment of trials is thus a physical part of implementing the mathematical assumptions.
Take the simple sampled model \(x_{k+1}=a x_k+(1-a)u_k\), with \(0<a<1\) and \(x_0=0\). It can represent a position servo whose fast inner control loop has already been stabilised. The outer experiment changes its feedforward command between repetitions. A unit command produces a downstream effect starting at the next sample. Stack the commands as \((u_0,\ldots,u_{N-1})\) and the readings as \((y_1,\ldots,y_N)\). This ordering keeps the direct response of each command on the diagonal of a square matrix. Stacking \(y_0\) instead introduces a row carrying no information about any command.
For the first three readings, direct substitution gives \(x_1=(1-a)u_0\),
Repeated substitution produces a lower triangular matrix \(G\). In zero-based row and column indexing \(G_{kn}=(1-a)a^{k-n}\) for \(k\ge n\), and zero otherwise. Its columns are shifted, truncated impulse responses. Assemble the repeatable output disturbance into a vector \(d\). For the \(j\)th pass the measured output is \(\mathbf y_j=G\mathbf u_j+\mathbf d\).
Use virtual changes of the command to obtain the update direction
Let \(\mathbf r\) be the desired trajectory and define error \(\mathbf e_j=\mathbf r-\mathbf y_j\). Consider the scalar tracking objective \(J(\mathbf u)=\|\mathbf r-G\mathbf u-\mathbf d\|^2/2\). A perturbation \(\delta\mathbf u\) changes the measured output by \(G\delta\mathbf u\). Multiplying out the new squared error and retaining the linear term gives
The gradient in input coordinates is therefore \(-G^T\mathbf e\). Taking a step in the opposite direction gives the update
with a positive learning step \(\gamma\). Each input sample receives a weighted sum of subsequent output errors from the preceding trial. This apparent use of the future is ordinary causality when the two time indices are kept separate. At the moment the new command file is written, every sample from the previous pass is already known. No sensor can deliver the future errors of the pass currently being executed.
For a three-sample example let \(a=1/2\) and take the error record \((0,0,1)\). The last row of \(G\) is \((1/8,1/4,1/2)\). Consequently
An error in the final output calls for some correction to each earlier input because the plant remembers each command. Assigning the entire correction to the input with the same array index would neglect two of the available physical paths. An imperfect model can give poorly scaled weights, which is one reason to examine actual error after each update.
Derive a bound for every repeatable error direction
Substitute the new command into the output equation and subtract from the reference. The unknown disturbance cancels because it is the same vector in both trials. The result is \(\mathbf e_{j+1}=(I-\gamma GG^T)\mathbf e_j\). This gives a closed dynamical equation across trials. Its eigenvalues describe learning convergence; they are not the within-trial pole \(a\) of the servo.
Take a singular value decomposition \(G=U\Sigma V^T\). Expressing the output error in the orthogonal basis \(U\) shows that its \(i\)th component is multiplied by \(1-\gamma\sigma_i^2\). Thus all attainable directions contract monotonically in the Euclidean norm provided
Here \(G\) is nonsingular because its diagonal is nonzero. A more general stage with unobservable samples, missing actuators or pure delay longer than the chosen alignment can have zero singular values. Components of error outside its reachable output space then persist, however many trials are available. Inspecting the norm alone cannot reveal whether a plateau comes from this structural limit, measurement noise or a deliberately imposed actuator bound.
The slow directions have small singular values: a substantial command correction produces only a small output change. Inverting \(G\) directly would eliminate the deterministic error in one idealised iteration, but the same inversion magnifies sensor noise and can demand impractically oscillatory commands. Gradient learning spends many more trials on these directions while retaining a tunable update size. For a positive full-rank spectrum, balancing the two endpoint contraction magnitudes gives the ideal minimax step \(2/(\sigma_{\max}^2+\sigma_{\min}^2)\). Its usefulness still depends on how accurate the assumed plant is.
Read the stage trajectory and the trial history together

Interactive calculation · Learning motion
Change the physical and numerical inputs of the notebook model. Compare the updated curves and balance checks with the recorded notebook figures. Each plot uses the same equations and assumptions documented in that notebook; its readout names any analytical or reduced-model reference.
Interactive calculation · Learning errors
Change the physical and numerical inputs of the notebook model. Compare the updated curves and balance checks with the recorded notebook figures. Each plot uses the same equations and assumptions documented in that notebook; its readout names any analytical or reduced-model reference.
Use 48 commands, an inner-loop pole of 0.75 and a smooth reference combined with a smaller oscillation. Add a repeatable sinusoidal displacement to the output as a model of the fixture. The largest singular value is 0.9788 and the smallest is 0.1429. Choosing 90% of the upper admissible step gives \(\gamma=1.879\) and \(q=0.9616\). In the notebook the RMS tracking error falls from 0.56264 to about 0.00073 after thirty updates. The norm bound predicts a slower worst-case decline because the chosen reference has limited content along some slowly learned directions.
A change of step can produce alternating signs in a well-observed error direction while its magnitude still shrinks. For the strongest direction at the default step the multiplier is
Comparing signed errors at one time instant may look oscillatory even though the total norm decreases. Conversely, a deliberately excessive step can produce several initially improving records if the unstable direction is weakly represented in the original error. Evaluate a proposed step with the singular spectrum and with independent repeated trials.
Account for trial variation before interpreting a plateau
Let the disturbance differ between passes. Redoing the same subtraction now adds \(\mathbf d_j-\mathbf d_{j+1}\) to the nominal error update. A slowly changing load introduces drift in trial number. Independent sensor noise produces a new random input to every update. Learning too aggressively can write the noise of one trial into the command of the next. To distinguish this mechanism from an unlearnable repeatable error, run several identical command files without updating and compare the within-sample scatter across the repeats.
Other practical departures have different signatures. An amplitude-limited actuator clips the proposed command and breaks the linear update law. A stage with backlash may respond differently around reversal, even when two command records are close. A safely implemented laboratory algorithm can stop updating after the measured repeats reach their uncertainty floor and can retain a copy of the previous feasible input. These choices follow from the measured limitations of the particular motion and do not change the algebraic result for the unconstrained model.
Identify a lifted column from two physical trials
Suppose the stage dynamics are imperfectly known. Start with one baseline run and save its entire output record. On a second run change the third input sample by a small positive amount \(\delta\), leaving the other inputs fixed. If the reset and disturbance repeat, subtracting the baseline record gives \(\delta\) times the third column of \(G\). The first response increment appears at the following reading. For the assumed pole \(a=0.75\), a unit perturbation gives the sequence \(0.25,0.1875,0.140625\) at the first three affected readings. Their successive ratio estimates the pole without requiring the disturbance to be known. The absolute size of the first increment identifies the input gain. A departure from a constant ratio is evidence to inspect the one-pole model or the measurement repeatability.
When measurement resolution is poor, a perturbation can be too small to distinguish from baseline variability. Try perturbations of the same size and opposite signs on otherwise identical passes. Divide the difference in recorded outputs by \(2\delta\). A common offset cancels and an even quadratic dependence on input amplitude cancels as well. A large difference between the columns estimated at two perturbation sizes signals curvature or saturation. Repeat the calibration at an earlier and a later command index. Their overlapping samples should agree after an appropriate time shift if the closed-loop stage is time invariant during the move. This experiment tests the actual matrix used in the update, including timing and reset assumptions.
A final notebook cell forms the error-propagation matrix explicitly and asks OneSimulation for its symmetric eigenvalues when available locally. Their largest absolute value must agree with the worst error gain computed from singular values. The two computations expose a misplaced transpose or an incorrectly scaled learning step.
Exercises on what can be learned
1. With a memoryless sampled plant \(G=gI\), what step removes every deterministic output error in one update?
Work through the solution
The multiplier in each direction is \(1-\gamma g^2\). For \(g\ne0\), the choice \(\gamma=1/g^2\) sets it to zero. If \(g\) is overestimated, this choice takes too small a step and more trials are needed. If its magnitude is sufficiently underestimated, the learning gain can exceed the contraction bound.
2. Suppose the control engineer includes the initial reading \(y_0\) and drops the final one. Which output sample can no feedforward input in that move change?
Work through the solution
The initial reading precedes every available command. Its row in the lifted matrix is zero; the corresponding error direction has singular value zero. Choosing a larger gain leaves that component untouched. Align the output record with the first response sample or state explicitly that the initial mismatch belongs to the reset procedure.
3. Why can reducing the measured error in one pass make the next pass look worse when an external disturbance is freshly drawn?
Work through the solution
The update uses the previous measured error, which includes a random component. Its correction can point in a direction unrelated to the newly drawn disturbance. The term \(\mathbf d_j-\mathbf d_{j+1}\) survives the subtraction and the deterministic norm bound fails. Repeat the unmodified input several times to estimate a repeatable mean and the variability around it before changing the learning rate.
Compare the lifted calculation with experimental learning control
Bristow, Tharayil and Alleyne’s survey of iterative learning control relates time-domain learning laws to frequency-domain and robustness considerations. Identify the role of a stable within-trial feedback loop before applying a between-trial update to an actual positioning system.
Problem sheet 7 · A speed regulator with an unknown load and a measured delay
A motor must reject sudden torque changes and track a smooth speed request over a delayed feedback connection. Select nominal integral gains from a time-domain requirement, calculate the delay margin for the actual PI loop and separate reference feedforward from feedback stability.
1 · Recover from a load with a bounded speed excursion
The motor obeys \(J\dot y+by=u-d\) with \(J=0.20\) kg m² and \(b=0.50\) N m s/rad. Use \(u=K_p(r-y)+K_i z,\ \dot z=r-y\). A 2 N m step load should cause a nominal peak error below 1.0 rad/s. Place both undelayed closed-loop poles at −4 s⁻¹. Find the gains and peak.
Check the pole choice against the performance requirement
The characteristic polynomial is \(Js^2+(b+K_p)s+K_i=J(s+4)^2\), so \(K_p=1.10,\ K_i=3.20\) in SI units. At constant reference the step load gives \(y=-10te^{-4t}\) in deviation coordinates. Its largest magnitude is \(10/(4e)=0.920\) rad/s at 0.25 s, meeting the undelayed specification. The controller must retain 2 N m extra torque after recovery. Saturation can invalidate this nominal transient.
Recover the peak excursion and compare proportional-only regulation
2 · Calculate the margin of this actual loop
The entire feedback command is delayed by \(\tau\). Before adding delay, the loop transfer function is \(L_0(s)=(K_ps+K_i)/[s(Js+b)]\). Obtain its positive gain-crossover frequency by equating squared magnitudes. Calculate the first critical delay and the largest delay retaining at least 45° phase margin.
Use the PI zero, integrator and motor pole together
Write \(z=\omega^2\). Unit gain requires
With the chosen values the positive root is \(z=32\), giving \(\omega_c=5.657\) rad/s. Undelayed phase is \(\arctan(K_p\omega_c/K_i)-\pi/2-\arctan(J\omega_c/b)\), giving margin 86.63°. The first critical delay is therefore
A 45° reserve permits about 0.128 s. The separate delay experiment uses a first-order proportional loop. Check there that pure delay changes phase by \(-\omega\tau\), then apply that relation here at the PI loop's own crossover.
3 · Predict feedforward torque during a smooth transition
Command 0 to 4 rad/s in 1 s with \(r=4(3s^2-2s^3)\), where \(s=t/(1\ {\rm s})\). Add \(u_{\rm ff}=\widehat J\dot r+\widehat b r\). Determine nominal feedforward torque at midpoint and hold. What mismatch appears at midpoint if the estimate is \(\widehat J=0.15\) while drag is correct?
Calculate required and modeled input at the same time
Midpoint speed is 2 rad/s and acceleration is 6 rad/s². The nominal torque is \(0.20(6)+0.50(2)=2.20\) N m. During the final hold it is 2.00 N m. With the low inertia estimate the midpoint command is 1.90 N m, leaving a 0.30 N m shortfall for the feedback loop. The pure reference path changes tracking forcing while leaving the nominal feedback characteristic equation unchanged when signals sum linearly and actuators stay unsaturated.
Set the estimated inertia to 0.15 and 0.20 kg m² during the same move
4 · Interpret a measured commissioning delay
Timing measurements give a repeatable delay of 0.100 s. Calculate the remaining nominal phase margin and the spare latency compatible with the 45° reserve. Can the undelayed 0.920 rad/s load peak now be reported as the delayed result?
Separate the frequency and transient checks
The delay costs \(5.657(0.100)=0.566\) rad or 32.4°, leaving about 54.2°. The spare latency is roughly 0.028 s. The delayed system has a transcendental characteristic equation, so the repeated real poles and analytic load transient of the zero-delay model no longer describe its exact step. A disturbance step experiment or an integration retaining the delay is needed to check the peak requirement at this operating point.
Problem sheet 8 · A saturated PI loop remembers an impossible set point
A first-order laboratory speed loop has a bounded actuator. A high command exceeds its available steady speed and is later replaced by a reachable command. Predict how long the output remains stuck near its limit, derive a controller that tracks the actual actuation and use a reproducible time sweep to distinguish actuator saturation from slow mechanical response.
Start with the linear closed-loop model
Normalise steady actuator gain and plant time constant to one, so \(\dot y=-y+u\). Take \(e=r-y\), proposed command \(v=2e+I\), ordinary integral update \(\dot I=e\) and actual actuation \(u=\min(1,\max(0,v))\). Begin at \(y=I=0\). Derive the characteristic polynomial without saturation and explain why its stable poles cannot answer the high-command experiment.
Close the loop within the valid linear region
With \(u=v\), Laplace transformation under zero initial conditions gives a PI controller \(2+1/s\) in series with plant \(1/(s+1)\). The reference-to-output transfer function is \((2s+1)/(s^2+3s+1)\). Its poles are approximately minus 0.382 and minus 2.618 per second, both stable. The integral action makes the steady error zero for a constant attainable reference. At \(r=2\), however, a steady plant output of two requires \(u=2\), which the actuator cannot deliver. The clipping creates a different dynamical regime immediately because the proportional term alone requests four units.
No linear pole of this original model describes the growth of the integral memory during the unreachable hold. Saturation also differs from a time delay: a delayed but sufficiently powerful actuator could eventually attain two, whereas the bounded plant cannot. A reference step within the range is a useful control experiment, although a rapid step may still transiently saturate due to the proportional kick.
Compute the integral state before the reference drops
Hold \(r=2\) for six seconds. Solve for plant output and integral state while the actuator is saturated. At \(t=6\) replace the reference by 0.4. Estimate how long the plain PI controller keeps the actuator at its upper limit after this switch.
Integrate the actual plant input rather than the requested command
During the high reference \(u=1\), hence \(y=1-e^{-t}\). Error is \(1+e^{-t}\), so \(I=t+1-e^{-t}\). At six seconds \(y=0.9975\) and \(I=6.9975\). Immediately after the drop, \(v=2(0.4-0.9975)+6.9975\simeq5.80\), so the actuator still clips at one even though the error is now negative. The plant remains near one while the integrator slowly unwinds.
Let \(s\) denote time after switching during this second saturated interval. Then \(y=1-e^{-6-s}\), and \(I=I(6)-0.6s+e^{-6}(1-e^{-s})\). Substituting into the command gives
Setting \(v=1\) gives approximately 8.00 further seconds at the upper limit. A first-order plant with a one-second time constant can therefore appear unresponsive much longer than its own transient. Inspecting the actual and requested commands makes the cause identifiable.
Derive a back-calculation update and test its consequences
Replace the integrator by \(\dot I=e+(u-v)/T_t\). Explain the sign of the correction and derive its approximate long-hold value for \(r=2\), \(u=y=1\) and tracking time \(T_t=0.5\) s. Does the modified controller change the small-signal dynamics when no limit is active?
Track the attainable input and preserve the unforced integral law
At upper saturation the requested command exceeds the actual one and \(u-v\) is negative. The correction cancels continued integral growth rather than adding to it. At the long-hold steady state \(0=1+(1-v)/T_t\), giving \(v=1+T_t=1.5\) and \(I=v-2e=-0.5\). When reference falls to 0.4 the raw command immediately becomes approximately minus 1.7. The lower actuator limit then becomes active; the plant can finally decay. On leaving both limits \(u=v\) and the modification disappears exactly from the linear controller.
Compare the two time traces at equal plant, gains and limits. At the default hold the unmodified controller spends about eight additional seconds pinned at the upper limit while its output exceeds 0.6. The tracking controller spends essentially none there. Reducing the tracking time does not give an unlimited physical speedup: plant dynamics and the lower input bound remain. An extremely small tracking time can also make a sampled implementation numerically stiff if its discretisation does not resolve the tracking correction.
Separate time-step error, sensor clipping and true actuator saturation
The graph uses a held actuator on short time intervals, an exact first-order plant update over each interval and an explicit integral-state update. Describe how to verify a digital implementation with a longer sample interval and how an experiment could distinguish an output sensor limit from genuine actuator saturation.
Compare independent diagnostics before changing gains
Halve the integration step at fixed switch time and compare the times at which the requested command first returns within its limits. A good trace should reproduce the analytic eight-second release time for ordinary PI. In the tracking controller a bounded integrating step must resolve both the one-second plant time and \(T_t\). If actuator dynamics, rate limiting or a downstream safety cap changes actual actuation, feed back the measured or appropriately modelled applied value. Tracking only the software clamp in front of an additional physical limit can leave substantial windup.
Log reference, raw command, applied actuator signal, integral state and an independent output measurement. An output sensor clipped at one can conceal a real plant response above one, while an actually bounded actuator will show the applied input pinned even as its request grows. Reverse the operating sequence and use several hold durations. An additional release delay growing with unreachable hold time is characteristic of integral memory; an unchanged time constant after every switch suggests a different plant or measurement limitation.
Åström and Murray · Feedback Systems, integral windup and tracking in PID control
Notebook practice · Learn a repeatable positioning move from its previous error
System dynamics, feedback and estimation
Start from a physical plant and its measured signals. Derive a feedback or estimation model and test which dynamical behaviour can be controlled or inferred.
- Estimating velocity from position with a model-based observer
An optical encoder returns position and the actuator drive supplies a commanded acceleration. Reconstruct an unmeasured velocity without differentiating successive noisy samples. Derive the observer, explain what a pair of chosen poles guarantees, and predict the tradeoff visible when the encoder carries periodic interference.
- Relative gains, loop pairing and nearly singular process measurements
Two heaters act on two temperature sensors. With the second heater fixed, a test of the first gives a well-determined positive response. Closing a loop around the other temperature can change both the size and sign of that apparent gain. Derive the relative gain array from the experiment one actually performs.
- Predicting a delayed process and testing a Smith controller
A heater is upstream of a temperature sensor. Its internal thermal response begins immediately while a material parcel reaches the sensor several seconds later. Build a feedback signal from two model outputs, derive which transfer function loses its delay, and then deliberately introduce a delay mismatch to see why a plausible prediction may fail.
- Sensitivity, bandwidth and the integral price of disturbance rejection
A regulator attenuates a slowly varying output load yet amplifies another disturbance at a higher frequency. Separate the paths by which reference, measurement noise and physical disturbance reach the recorded variable, then derive an integral identity that explains why a stable loop can redistribute sensitivity across frequency.
- Which sampling times reveal the velocity of an oscillator?
A sensor measures displacement while a controller needs velocity as well. Use the exact free vibration between two readings to recover the missing state, then quantify how a poorly chosen sample interval amplifies measurement noise.
- When does a stable operating point disappear?
A shaft can hold a static torque against gravity up to a finite limit. Trace the equilibrium branches and distinguish local stability, loss of an equilibrium and the possibility of oscillation.
- Can any controller meet this bandwidth and peak-gain specification?
Delay uses up phase at the crossover even when it changes no gain. An unstable pole near a right-half-plane zero imposes a separate peak-gain limit. Derive each restriction before tuning a controller.
- Designing current, speed and position loops for a drive
An encoder measures shaft motion, while the power stage acts on voltage. Decide which disturbances each measurement can reject and how fast each loop can move before the unseen inner dynamics erode the position margin.
System dynamics, feedback and estimation · 1. Estimating velocity from position with a model-based observer
An optical encoder returns position and the actuator drive supplies a commanded acceleration. Reconstruct an unmeasured velocity without differentiating successive noisy samples. Derive the observer, explain what a pair of chosen poles guarantees, and predict the tradeoff visible when the encoder carries periodic interference.
Find out which initial conditions are distinguishable
Model a translating stage over its usable travel by \(\dot x_1=x_2,\ \dot x_2=u\), with measured output \(y=x_1+n\). Here the input is an acceleration in the chosen position and time units. With zero noise and known input, two different initial positions give different initial readings. Two different initial velocities with the same position yield traces whose initial slopes differ. Formally the observability matrix stacks \(C=(1,0)\) above \(CA=(0,1)\), giving rank two. If only velocity were measured, a constant offset of initial position would remain invisible, whatever the command. Observability belongs to the chosen model and output together.
Run a copy of the plant and drive it with both the known command and a correction proportional to innovation \(y-\hat x_1\):
Define error as true minus estimated state. For a perfect model and noise-free measurement the error matrix has rows \((-l_1,1)\) and \((-l_2,0)\). Expanding the determinant of \(sI-(A-LC)\) gives \(s^2+l_1s+l_2\). Matching the standard oscillator denominator sets \(l_1=2\zeta\omega_o\) and \(l_2=\omega_o^2\). The units are inverse seconds and inverse seconds squared. A constant position innovation can therefore request corrections to both estimated velocity and acceleration. Stable poles guarantee decay of initial error for the ideal model. They do not specify how large the measurement error becomes when injected continually.
Follow one sensor tone all the way to the velocity estimate
Set the true state and command to zero and solve the two linear equations in the Laplace domain with zero initial condition. Eliminating estimated position gives the transfer of position noise to estimated velocity:
For slow variation it behaves like a differentiator, so a constant position offset ultimately produces zero spurious velocity. At high frequency the gain falls as \(l_2/\omega\), whereas differentiating raw data multiplies its amplitude by frequency. Noise near the observer bandwidth can nevertheless be strongly visible. With observer frequency 2 Hz, damping ratio 0.75 and a 10 Hz sensor oscillation of amplitude 0.03 mm, the predicted velocity ripple is about 0.075 mm/s. The stage moves at 0.40 mm/s in the example. Compare the late-time difference between clean and noisy traces with the predicted peak ripple. The initial position estimate is deliberately displaced to reveal transient convergence.
Background · What if successive position errors are correlated?
Estimate velocity as the difference between consecutive positions divided by the sample interval \(h\). Suppose each position error has variance \(\sigma^2\) and the correlation between successive errors is \(\rho\). The variance of the difference contains the covariance twice with a negative sign.
A constant sensor bias cancels exactly from this difference, although the reconstructed position can remain wrong. Independent 0.10 mm position errors sampled 0.01 s apart give a 14.1 mm/s velocity standard deviation. With the same marginal variance and correlation 0.9 it falls to 4.47 mm/s. A sensor data sheet reporting only RMS position noise leaves this prediction underdetermined.
Use the innovation as a diagnostic signal
If the true acceleration exceeds the commanded value by constant \(d\), the steady error equations yield
Raising the observer frequency reduces these model-error terms while passing more encoder noise at a fixed sufficiently high frequency. Adding a slowly evolving bias state is another modelling choice; its observability and process-noise assumptions need to be checked again. A near-zero innovation in a high-gain observer alone is weak evidence of correct velocity, since the algorithm was designed to force estimated position toward the sensor.
On the bench, estimate the encoder noise spectrum with the stage held stationary and the illumination and sampling electronics operating normally. During motion, compare estimated speed with an independently timed travel between two reference marks. An encoder fitted only by its own residual offers no independent absolute scale. If a motion command changes numerically from metres to millimetres, transform acceleration, position and initial estimates together. Pole locations have units of inverse time and do not depend on this uniform length conversion.
Check whether an apparent velocity ripple aliases from above the sampling band
Suppose the encoder is sampled at 100 Hz and its electronics pick up a 90 Hz sinusoid. At those sampling instants the measured sequence is indistinguishable from a ten-hertz sinusoid with suitable phase. A downstream digital observer cannot determine which analogue frequency generated the samples. Repeating with a different acquisition clock moves an alias while leaving a genuine ten-hertz process feature at its physical frequency. An analogue anti-alias filter can attenuate the high-frequency signal before sampling.
Compare this experiment with the frequency knob in the displayed model. The browser directly synthesises a known tone at the integration rate and therefore tests the observer frequency response in isolation. A measured disagreement on a real sampled encoder can reveal an upstream acquisition effect even when the observer discretisation is accurate.
Tutorial · Identify a constant offset and an acceleration mismatch
An encoder reads 0.20 mm high at rest. Separately, an unmodelled 0.20 mm/s squared acceleration acts on an otherwise perfect stage. Find steady errors for the two cases at the default observer setting.
Solve the steady error equations for each input
A sensor offset eventually places estimated position 0.20 mm above truth while the estimated velocity returns to zero. For the acceleration mismatch, \(l_2=157.91\) and \(l_1=18.85\) in the appropriate second-based units. The true position exceeds the estimate by 0.00127 mm and true velocity exceeds its estimate by 0.0239 mm/s. The persistent residual in the second case is tiny despite a clear velocity bias. Repeat the test while changing bandwidth to distinguish a bias in the sensor from a mismatch in acceleration.
Tutorial · Compare with numerical differentiation
With 1 ms sample separation, independent position errors have standard deviation 0.01 mm per reading. What standard deviation does a backward difference produce for velocity? Explain how this differs from the deterministic 10 Hz test.
Propagate the variance of the difference
Subtracting independent zero-mean errors adds their variances. Divide the resulting standard deviation by the time step to obtain
A 10 Hz interference tone has correlated neighbouring samples and a fixed phase evolution. Its output is predicted from sinusoidal frequency response, not from independence. Averaging a longer interval reduces random position-difference noise but measures a longer-time mean speed and responds more slowly to acceleration.
Tutorial · Check discrete implementation before increasing gain
A software observer updates by explicit Euler every 10 ms. If the continuous error poles are both minus 300 per second, what happens to an initial error? How could the implementation preserve the intended decay?
Map a continuous pole through the actual update
The scalar Euler factor is
its magnitude exceeds one, so errors grow while changing sign. Exact discretisation would map the pole to \(e^{-3}=0.0498\). A suitably faster sample interval, a correctly discretised observer, or a discrete observer designed directly for the sampled measurement can restore stability. These choices still depend on the actual measurement rate. Interpolating old encoder samples at a faster software clock does not create independent new position information.
Caltech · Åström and Murray, Output Feedback, observability and state estimation
System dynamics, feedback and estimation · 2. Relative gains, loop pairing and nearly singular process measurements
Two heaters act on two temperature sensors. With the second heater fixed, a test of the first gives a well-determined positive response. Closing a loop around the other temperature can change both the size and sign of that apparent gain. Derive the relative gain array from the experiment one actually performs.
Compare two physically different partial derivatives
Linearise a two-input, two-output process about an equilibrium, using deviations from the original input and output settings. Write its steady gain matrix as \(K\), with entry \(k_{ij}=\partial y_i/\partial u_j\) with the other input held fixed. If instead the second output is held fixed by feedback, the other input must move too. Eliminate it from the second row:
The relative gain for this pairing is the open-other-input gain divided by the gain with the other output held constant. Inverting the gain matrix gives the general expression \(\Lambda_{ij}=k_{ij}(K^{-1})_{ji}\), an element-by-element product with the transposed inverse. It requires a nonsingular square matrix; the alternative ratio interpretation requires that the selected constrained experiment also be well defined. Each row and column sums to one. A quick check uses the diagonal of \(KK^{-1}=I\). A negative element signals a gain reversal between the two experiments. A very large element indicates considerable cancellation in the constrained response.
For matrices \(K=\left(\begin{smallmatrix}2&1\\1&2\end{smallmatrix}\right)\), the diagonal relative gains are 4/3 and the off-diagonal entries are minus one third. A unit increase of the first input holding the second output fixed requires reducing the second input by one half. The first output then rises by 1.5, compared with 2 when the other input is held fixed. Off-diagonal pairing would confront a reversal when the other loop closes. A static array can guide selection, but faster dynamics, delays, actuator bounds and output priorities still matter.
Show which numerical conclusions depend on chosen units
Let individual output units be rescaled by a diagonal matrix \(D_y\) and input units by \(D_u\). The new gain matrix is \(D_y K D_u^{-1}\) and its inverse transforms in the opposite order. The scale factors cancel separately in each product defining a relative gain. Reporting a temperature deviation in millikelvin instead of kelvin does not change the array. Singular values, by contrast, do depend on units; meaningful comparisons require physical normalisation such as allowed input ranges and tolerated output deviations.
For \(K=\left(\begin{smallmatrix}1&0.9\\1.1&1\end{smallmatrix}\right)\) the determinant is 0.01. The diagonal entries of the array reach 100 and the off-diagonal entries minus 99. Nominally holding the second output constant requires \(du_2=-1.1du_1\), leaving only 0.01 output units per unit of first input. A requested unit output therefore asks for input changes of 100 and minus 110 in this local model. Saturation or departure from the linear neighbourhood would usually intervene first. A nearly singular response indicates that the two actuators push in almost the same output direction.
A test programme distinguishes cancellation from sensor drift
Perturb each input on both sides of the reference point with the other held fixed, allow slow transients to settle, and fit slopes including an offset for drift. Repeat with both inputs coordinated to hold one output near its initial value. The small difference of large responses may have uncertainty as large as its point estimate. Record confidence intervals for the matrix elements and propagate them through the determinant before prescribing a controller pairing. Independent tests on a second operating point reveal whether the conclusion survives gain changes. A temperature sensor substituted into both output channels can accidentally make an otherwise invertible plant look rank deficient.
Make the nearly invisible constrained response visible
The first curve holds the second input constant; the second holds the second output constant. Both pass through the reference point because the model uses deviations about a common equilibrium. With the nominal gains the latter slope is only one hundredth of the former. Change the lower-right coefficient from one to 0.99 and then to 0.98. The constrained slope passes through zero and reverses sign. At the singular value a finite relative gain is undefined, while the physical experiment remains perfectly interpretable: the coordinated input direction makes no output change.
A change of less than the uncertainty of a single gain measurement can thus reverse the preferred feedback direction. If the second actuator reaches a limit during the constrained test, the measured slope shifts back toward the first curve because the supposedly fixed second output can no longer be maintained. Record both actuator trajectories and the residual at the constrained output before claiming to have measured a relative gain.
Tutorial · Infer the hidden actuator motion
A two-zone stage has gain matrix with rows (3, 1) and (2, 2), in consistent scaled units. Increase the first actuator by one unit while regulating the second output exactly. Find the first output and relative gain.
Write the constrained row first
The second row requires \(du_2=-1\). The first output changes by \(3-1=2\). With the second input fixed it would have changed by three, so the first relative gain is 1.5. The complementary entries are minus one half, since row and column sums must equal one. For a slowly regulating second loop the early transient can resemble the fixed-input experiment while the settled change follows the constrained one. Compare time scales before using the settled gain in a fast-loop tuning rule.
Tutorial · Quantify a near-singular inference
Suppose only the lower-right coefficient of the nearly singular example is uncertain by plus or minus 0.02. Can the sign of the diagonal relative gain be inferred from the nominal values?
Bound the determinant before taking the ratio
At the endpoints the determinant becomes minus 0.01 and plus 0.03. At 0.99 for that coefficient the matrix is exactly singular, so the interval crosses a pole of the calculation. The sign is not identified. A covariance estimate or repeated constrained tests may narrow the uncertainty. Taking an arithmetic average of very large positive and negative sampled gains around a singularity is especially misleading; the two sides correspond to qualitatively different controller directions.
Tutorial · Test a proposed decoupling command
For the first symmetric matrix, request changes (1, minus 1) in the two temperatures. Compare the required inputs with those for (1, 1). Why is the independent-channel approximation misleading?
Invert the matrix along its two physical directions
The equal direction has gain three and needs input changes (one third, one third). The differential direction has gain one and needs (1, minus 1). Treating both diagonal gains as two would predict changes of magnitude one half for either case. A common-mode validation therefore overstates ability to control a gradient. Test both common and differential directions at suitable amplitudes before reporting usable output ranges, especially with bounded actuators.
ETH Zürich · Control Systems II, multivariable systems and control design
ETH Zürich · MIMO directionality, singular values and relative gain
System dynamics, feedback and estimation · 3. Predicting a delayed process and testing a Smith controller
A heater is upstream of a temperature sensor. Its internal thermal response begins immediately while a material parcel reaches the sensor several seconds later. Build a feedback signal from two model outputs, derive which transfer function loses its delay, and then deliberately introduce a delay mismatch to see why a plausible prediction may fail.
Keep the measured and predicted signals distinct
Represent a stable process as a rational delay-free part \(G_0(s)\) followed by transport delay \(e^{-Ls}\). Let the controller see a prediction \(y_p=y+\hat G_0u-\hat G_0e^{-\hat Ls}u\). The two model terms are the currently predicted response and a stored, delayed prediction. On a perfect model, the delayed part cancels the measured response to the command, leaving an undelayed estimate in the feedback path. The measured output remains at the physical sensor downstream. Nothing in the arrangement advances an unknown disturbance in time.
With controller \(u=C(r-y_p)\) and actual command-to-output plant \(P\), direct substitution gives
The characteristic denominator is delay-free in the exact model. The reference-to-measurement signal still includes the full delay. Internal stability requires sensible models and implementation. In particular, cancelling an unstable physical mode in a transfer expression can hide a divergent internal signal. This elementary design assumes a stable plant and meaningful initial conditions for the stored model trajectory.
Calculate the entire nominal step before adjusting a tuning knob
Take \(G_0=1/(4s+1)\), proportional gain two and a delay of three seconds. The measured unit step response is zero until three seconds. Afterwards it is \((2/3)[1-\exp(-3(t-3)/4)]\). Its final offset is one third because a proportional controller is being used. It attains 63.2 percent of its own final change at 4.333 seconds after the reference step and about 95 percent at seven seconds. A plotted prediction rising before three seconds is perfectly consistent with a real sensor trace that remains flat. Labelling a model trajectory as a sensor measurement would conceal a missing or jammed sensor.
Now suppose the true transport delay is four seconds while the model still stores three. A sinusoid of angular frequency \(\omega\) gives a mismatch between the two unit-magnitude delay factors equal to \(2|\sin[\omega(L-\hat L)/2]|\). At one radian per second and one second timing error this is 0.959, even though the steady mismatch vanishes. Multiply by the plant gain at that frequency before interpreting its effect. Time stamps, sample-and-hold, filtering and passage distance each contribute phase. Fitting a single dead time over a narrow frequency band cannot tell them apart.
Track an unknown load applied at the measured output
Let \(y=Pu+d\), where a load disturbance is added after the physical process. In the exact predictor the feedback observation becomes \(G_0u+d\). With reference zero it follows that \(u=-C d/(1+C G_0)\), so the actual output responds according to \(1-PC/(1+CG_0)\). An abrupt output disturbance appears immediately at the sensor, but the compensating physical response arrives only after transport. Input disturbances occurring upstream have a different transfer path. Sketching the injection point avoids confusing these two bench tests.
Measure the transport delay by recording a known actuator perturbation and the two temperatures on a common clock. A feature appearing at an electronic sensor downstream may include sensor lag as well as travel. Move the sensor a known distance without changing flow and repeat. A shift proportional to added distance is evidence for transport; a constant extra lag suggests sensor or actuator dynamics. Repeat at another flow rate and revise the model if the material speed has changed.
Distinguish the two delayed model buffers in a simulation
The experiment stores the output history of the first-order lag. One buffer index represents the actual transit time and another supplies the delayed copy subtracted by the predictor. When the two delay sliders match, the difference between the physical measured curve and its ideal reference is limited to the small time-discretisation error. Change only the actual delay to test mismatch. The correction begins when one delayed signal has arrived and the other has not. Watch the predicted feedback signal separately from the physical output across that interval.
Raise proportional gain at the mismatched delay. The physical transit time stays fixed but the model-based correction becomes more sensitive to cancellation errors. A measurement which shows oscillatory excursions in this demonstration can still settle to the nominal final offset, since a pure delay has unit gain at zero frequency. Agreement at the final value cannot by itself verify the timing model.
Tutorial · Distinguish two time constants on a response plot
Two labelled traces reach 0.42 output units at 1.33 s and 4.33 s respectively after a unit step. A technician calls the second plant three times slower. Explain both traces in the nominal example and design a second check.
Align the response origins
The 63.2 percent level of the 0.667 final value is about 0.421. An undelayed prediction reaches it at the closed-loop time constant of 1.33 s. The measured trace reaches it one transport interval later at 4.33 s. Shift the measured trace three seconds earlier and compare its entire shape, amplitude and late drift. Agreement at one level alone would also occur for many models combining a different lag and delay.
Tutorial · Quantify a frequency at which a delay error matters
For an error of 0.2 seconds, at what first positive angular frequency does the difference of unit delay factors reach magnitude one? Is that automatically a stability boundary?
Solve the phasor geometry and inspect the remaining loop
Set \(2\sin(0.1\omega)=1\), giving \(\omega=\pi/(0.6)=5.24\) rad/s. The physical plant magnitude there is about 0.048 for the stated first-order lag. Controller gain and phase, additional modes and the nominal denominator determine the closed-loop consequence. A unit difference of raw delay phasors is an interpretable timing-error measure and does not by itself place a closed-loop pole on the imaginary axis.
Tutorial · Explain a failed transport assumption
A predictor tuned at constant flow develops oscillatory residuals when flow periodically changes. Name observations that could distinguish model-delay variation from an oscillating load.
Use independent transport and command records
Compute the passage delay from an independent flow measurement and known pipe volume, accounting for the actual parcel history when speed varies appreciably during transit. Compare residual phase against the command and repeat with a small deliberate input perturbation at a different frequency. A response phase tracking flow supports a varying delay. An output oscillation continuing at fixed flow with no corresponding command suggests an external load or another mode. Preserve a baseline with the predictor disabled to identify plant changes independently of the feedback algorithm.
ETH Zürich · Control Systems II, dead-time compensation and the Smith predictor
System dynamics, feedback and estimation · 4. Sensitivity, bandwidth and the integral price of disturbance rejection
A regulator attenuates a slowly varying output load yet amplifies another disturbance at a higher frequency. Separate the paths by which reference, measurement noise and physical disturbance reach the recorded variable, then derive an integral identity that explains why a stable loop can redistribute sensitivity across frequency.
Solve the loop once for three independent inputs
Let the actual output be \(y=Pu+d\), the measured output be \(y+n\), and the command be \(u=C(r-y-n)\). Here \(d\) is an additive load at the output and \(n\) is sensor error. Division by \(1+PC\) gives
Thus \(S+T=1\) as a complex identity. Magnitudes generally do not add to one. Strong rejection of a slow physical load requires small sensitivity at that frequency; the measured noise can then appear almost unchanged, with opposite sign, in the actual output. A readout of the same sensor used by the controller can hide this motion. A second independent sensor can reveal it. An input load inserted before the plant would instead have transfer \(PS\), so always identify the disturbance injection point in a reported test.
For \(L=4/[(s+1)(s+2)]\), both the open and closed loops are stable. The zero-frequency sensitivity is one third. At three radians per second the numerator is \(-7+9i\) and denominator is \(-3+9i\), giving magnitude \(\sqrt{130/90}=1.202\). A 0.10-unit output disturbance at that frequency produces a 0.120-unit actual output oscillation. A time plot of reference following alone would miss this amplification. The sensitivity peak also measures proximity of the Nyquist curve to minus one, since \(1/|S|=|1+L|\).
Derive the stable rational case from its pole and zero distances
For a closed-loop stable rational sensitivity tending to one at high frequency, write its numerator and denominator as monic products of roots. For a real negative root at minus \(a\), a factor contributes \(\frac12\log(\omega^2+a^2)\). The difference for two such factors integrates by differentiating under the integral in parameter \(a\). The derivative \(a/(\omega^2+a^2)\) has integral \(\pi/2\) over the positive frequency axis. Integration back gives \(\pi(a-b)/2\). For complex conjugate roots the same result follows by pairing both signs of frequency and shifting the full-axis integration variable by the imaginary part. The area contribution depends on the absolute real part.
The sensitivity zeros are the open-loop poles and its poles are the closed-loop poles in a minimal description. For relative degree at least two the coefficient of the next-to-highest power in the open- and closed-loop characteristic polynomials is unchanged; their signed root sums therefore coincide. If every open-loop pole lies in the left half-plane, the absolute-real-part sums also coincide and the integral vanishes. An open-loop pole in the right half-plane reverses its absolute-real-part contribution and leaves the general result
This statement assumes internal closed-loop stability, suitable high-frequency roll-off and no imaginary-axis poles in the elementary derivation. It is an area on a linear angular-frequency axis with natural logarithm. Estimating it as signed visual area on a conventional log-frequency Bode plot weights the frequencies differently. A stable low-pass system can reduce sensitivity over a wide low-frequency interval by allowing higher sensitivity elsewhere. The identity does not fix an individual peak without bandwidth or shape constraints.
Connect the complementary sensitivity to model error
For multiplicative plant uncertainty \(P_{\rm actual}=P(1+W\Delta)\), factor the return difference as \((1+L)(1+TW\Delta)\). If nominal interconnection is internally stable, the uncertainty and weighting are stable, and \(\|TW\|_\infty<1\), the small-gain theorem ensures stability for all such perturbations with \(\|\Delta\|_\infty\le1\). A failure of this sufficient check invites closer analysis of the particular physical uncertainty. A poorly known resonance above bandwidth can matter even after a nominal step trace has settled smoothly. State the frequency range on which input-output identification actually constrains the model.
Change a lead network and compare crossover with measured sensitivity near a resonance.
Locate the sensitivity peak and test vector addition
Sweep the gain numerator at fixed pole locations. At zero gain the load sees essentially no correction. Increasing gain initially improves low-frequency load rejection but can create a distinct sensitivity maximum between the pole scales and the high-frequency range. Find the frequency where the sensitivity curve crosses one. At that point the distance of the loop phasor from minus one equals one. The complementary-sensitivity magnitude there need not vanish; the sum identity concerns complex values with their phases retained.
To check the curves on a real apparatus, inject small reference tones to estimate complementary sensitivity and separate, calibrated output loads to estimate sensitivity. Record coherent amplitude and phase at matching frequencies with the same time origin. Sum the two complex estimates and compare against unity. Delay in the reference measurement chain alone can spoil that check, even if both measured magnitudes seem plausible. The test is most informative where both responses have appreciable amplitude.
Tutorial · Test an apparent counterexample
For \(L=K/(s+a)\) with positive \(K,a\), sensitivity is below one at all finite frequencies. Evaluate the logarithmic area and locate the failed assumption.
Integrate the log-distance difference directly
The sensitivity equals \((s+a)/(s+a+K)\). The real-root identity gives
This loop has relative degree one. Its numerator and denominator root sums differ by \(K\), invalidating the high-frequency cancellation used for the zero-area result. Adding a finite fast actuator pole restores relative degree two and can move the compensating sensitivity region far beyond the frequencies first plotted. Check both the analytical degree and measurement bandwidth before diagnosing a contradiction.
Tutorial · Use two independent sensors
At a low frequency the loop has real positive gain 19. A calibrated sinusoid of amplitude 0.20 mm is electronically added to the feedback sensor with no physical load. Predict the actual motion and its indicated motion at that sensor.
Follow the noise to two separate outputs
Sensitivity is 0.05 and complementary sensitivity 0.95. The actual stage moves with amplitude 0.19 mm opposite the injected signal. Its indicated position at the corrupted sensor has amplitude 0.01 mm in phase with the injection. An independent reference encoder sees the much larger actual motion. Increasing gain further would make the feedback readout look quieter while causing more physical motion in this particular test.
Tutorial · Bound uncertainty at a measured spectral line
At one frequency the nominal measured complementary sensitivity is 1.25 and the magnitude bound on multiplicative uncertainty is 0.60. At a second frequency the values are 1.05 and 1.10. Interpret both products.
Apply the pointwise ingredient of the small-gain check
The products are 0.75 and 1.155. The first frequency meets the sufficient magnitude bound there. The second exceeds it, so a claim based on that global criterion is unavailable. A tighter phase-aware model or structured uncertainty can refine the conclusion. Checking two isolated frequencies cannot establish a supremum bound, since resonant features may occur between samples. Estimate frequency resolution from the narrowest expected damping bandwidth and verify both sides of each measured peak.
Åström and Murray · Feedback Systems, chapters on sensitivity functions and Bode's integral formula
System dynamics, feedback and estimation · 5. Which sampling times reveal the velocity of an oscillator?
A sensor measures displacement while a controller needs velocity as well. Use the exact free vibration between two readings to recover the missing state, then quantify how a poorly chosen sample interval amplifies measurement noise.
Observe a rotation through one coordinate
For an undamped, unforced oscillator \(\ddot x+\omega^2x=0\), use the state \(z=[x,\dot x/\omega]^T\). Both entries then have units of length. A delay \(\Delta t\) advances phase by \(\theta=\omega\Delta t\). Integrating the equation exactly gives
The velocity equation follows by differentiating with respect to \(\Delta t\). Together they rotate the state by a matrix with first row \((\cos\theta,\sin\theta)\) and second row \((-\sin\theta,\cos\theta)\).
The position sensor has observation row \((1,0)\). At consecutive samples its noiseless readings obey
The determinant is \(\sin\theta\). At integer half-period intervals the sensor measures the same direction in the state plane twice, allowing opposite velocities to produce exactly the same pair of readings. Away from those intervals,
The determinant diagnoses whether an exact reconstruction exists. The singular values describe whether that reconstruction will tolerate small errors. Because \(OO^T\) has diagonal entries one and off-diagonal entries \(\cos\theta\), its eigenvalues are \(1\pm|\cos\theta|\). Their square roots are the singular values of \(O\) in the chosen state scaling.
Propagate the uncertainty in two readings
Suppose each recorded position has independent zero-mean noise of standard deviation \(\sigma_x\). A linear combination \(y_1-y_0\cos\theta\) has variance \(\sigma_x^2(1+\cos^2\theta)\). Multiply by the square of the velocity gain to obtain
An exact knowledge of the sample times and natural frequency is assumed in this expression.
A 2 Hz oscillator has period 0.5 s and angular frequency \(4\pi\) rad/s. With a 0.125 s interval the second reading directly measures \(v_0/\omega\). For 0.10 mm position noise the recovered velocity has standard deviation 1.257 mm/s. Increasing the delay to 0.240 s moves the second observation close to the direction opposite the first. The same position uncertainty now produces 14.12 mm/s of velocity uncertainty, although the mathematical reconstruction still exists. The notebook varies the sampling interval continuously and checks the formula against noise propagation through the inverse matrix.
Open full-size diagram
Open full-size diagramProblem 1 · Take more readings at exactly one half-period
A colleague proposes collecting 100 equally spaced positions to recover velocity at \(\Delta t=T/2\). Does the larger data set recover the missing state for this exact model?
Work through the solution
After \(k\) steps the observation row is \((\cos k\pi,\sin k\pi)=((-1)^k,0)\). Every reading measures only the initial position, up to its alternating sign. Averaging can reduce the noise in \(x_0\), while the initial velocity remains arbitrary. One extra measured position at a known quarter-period after the first would add row \((0,1)\) and restore the missing independent equation.
Problem 2 · Relate observability to a finite difference
For \(\omega\Delta t\ll1\), derive the leading noise in the reconstructed velocity. Explain why decreasing the interval can increase the velocity error here.
Work through the solution
Use \(\sin\theta\simeq\theta=\omega\Delta t\) and \(\cos\theta\simeq1\). The estimate becomes \((y_1-y_0)/\Delta t\) to leading order and \(\sigma_v\simeq\sqrt{2}\sigma_x/\Delta t\). The actual displacement accumulated over a short interval shrinks, while the two independent noise samples have a difference of fixed standard deviation. This result applies to the two-reading estimate; fitting many accurately timed readings over a fixed observation duration uses different information.
Interactive calculation · Oscillator sampling
Change the physical and numerical inputs of the notebook model. Compare the updated curves and balance checks with the recorded notebook figures. Each plot uses the same equations and assumptions documented in that notebook; its readout names any analytical or reduced-model reference.
Interactive calculation · Sampling noise
Change the physical and numerical inputs of the notebook model. Compare the updated curves and balance checks with the recorded notebook figures. Each plot uses the same equations and assumptions documented in that notebook; its readout names any analytical or reduced-model reference.
System dynamics, feedback and estimation · 6. When does a stable operating point disappear?
A shaft can hold a static torque against gravity up to a finite limit. Trace the equilibrium branches and distinguish local stability, loss of an equilibrium and the possibility of oscillation.
Construct the operating diagram from a torque balance
A pendulum driven by a constant torque \(u\) obeys \(J\ddot\theta+d\dot\theta+k\sin\theta=u\), where \(k=mg\ell\), \(d>0\) and \(J>0\). With \(v=\dot\theta\) the state arrows are \((v,(u-dv-k\sin\theta)/J)\). The first nullcline is \(v=0\). The second is \(v=(u-k\sin\theta)/d\). Plotting both gives the local arrow directions before any time integration. Their intersections are precisely static operating points.
For \(|u|<k\) there are two intersections per revolution: \(\theta_s=\arcsin(u/k)\) and \(\theta_u=\pi-\theta_s\), modulo \(2\pi\). Linearize about an intersection to obtain
Positive incremental restoring stiffness gives stable poles for \(d>0\). Negative stiffness gives roots of opposite signs and therefore a saddle. At \(u=k\) the branches meet and one pole is zero. For \(u>k\) there is no static balance. A gain tuned from a linearization on the former branch cannot hold a nonexistent open-loop equilibrium at the same constant torque.
Recover the saddle-node scaling without fitting data
Set \(\theta=\pi/2+x\) and \(u=k+\mu\). Since \(\sin(\pi/2+x)=1-x^2/2+O(x^4)\), the slow balance near the merging points is \(d\dot x\simeq\mu+kx^2/2\). The omitted acceleration changes the fast transient; at the merger one eigenvalue remains \(-d/J\) while the other vanishes. For \(\mu<0\) the displacement from the merger scales as \(|x|\simeq\sqrt{-2\mu/k}\). The restoring torque gradient tends to zero and perturbations take longer to decay. This is a fold or saddle-node bifurcation.
Use \(J=1\) kg m², \(d=0.4\) N m s/rad, \(k=1\) N m and \(u=0.8\) N m. The equilibria are 0.9273 and 2.2143 rad. Their stiffnesses are +0.6 and −0.6 N m/rad. The stable poles are \(-0.2\pm0.748i\) s⁻¹. The saddle poles are \(+0.6\) and \(-1.0\) s⁻¹. A simulated trajectory that sits exactly at the saddle can stay there indefinitely in exact arithmetic. Perturb it along either eigenvector to identify its phase-plane structure.

Interactive calculation · Move through the loss of a static operating point
Increase the applied torque to and beyond the gravity limit. Change the starting angle to approach either side of the saddle. The browser integrates the actual pendulum equation with RK4, using inertia1 kg m² and gravity-torque scale1 N m.
Compare a fold with the onset of a periodic motion
A local stability change need not destroy the equilibrium. In the illustrative planar normal form \(\dot x=\mu x-y-(x^2+y^2)x\), \(\dot y=x+\mu y-(x^2+y^2)y\), put \(r^2=x^2+y^2\). Differentiation gives \(\dot r=\mu r-r^3\) and \(\dot\varphi=1\). The origin persists on both sides. For \(\mu>0\) it loses stability and a stable periodic orbit of radius \(\sqrt\mu\) appears. This supercritical Hopf example has a fundamentally different phase portrait from the torque fold.
What a sweep should record
A bifurcation diagram needs an observable appropriate to each branch. Record equilibrium angles after transients for static branches and maxima and minima for cycles. Direct forward simulation usually misses unstable branches. Solving the equilibrium equations and inspecting their Jacobian recovers them.
Exercises on stability evidence
At \(u/k=0.99\), use the fold expansion to estimate the angular separation of the two equilibria.
Worked solution
The near-merger displacement is \(\sqrt{2(0.01)}=0.1414\) rad on either side. The separation is 0.2828 rad, close to the exact \(2\arccos(0.99)=0.2831\) rad.
At \(\mu=0.04\) in the planar normal form, what does a radial perturbation to the periodic orbit do?
Worked solution
The orbit radius is 0.2. The radial derivative \(\mu-3r^2=-0.08\) gives local decay with time constant 12.5 model time units. A phase shift along the orbit persists.
Further reading · Åström and Murray, Feedback Systems, 2nd ed., Chapter 5.
System dynamics, feedback and estimation · 7. Can any controller meet this bandwidth and peak-gain specification?
Delay uses up phase at the crossover even when it changes no gain. An unstable pole near a right-half-plane zero imposes a separate peak-gain limit. Derive each restriction before tuning a controller.
Spend a phase budget at the gain crossover
In a scalar negative-feedback loop let \(L=PC\), \(S=1/(1+L)\) and \(T=L/(1+L)\). At \(|L(i\omega_c)|=1\), a required margin \(\phi_m\) imposes \(\arg L(i\omega_c)\geq-\pi+\phi_m\) on the continuously unwrapped phase at the crossing relevant to stability. Factor a right-half-plane zero at \(z>0\) into a minimum-phase zero and the unit-gain all-pass factor \((z-s)/(z+s)\). Its phase is \(-2\arctan(\omega/z)\). Pure delay contributes \(-\omega\tau\). Magnitude data alone cannot reveal these phase costs.
For a nominal minimum-phase design contributing \(-90°\) at crossover, the available phase budget gives the following exact condition under that assumption. An attainable gain crossover with multiple crossings still requires the full Nyquist stability test.
If \(z=40\) rad/s, \(\tau=0\) and \(\phi_m=45°\), then \(\omega_c\leq40\tan(\pi/8)=16.57\) rad/s. A proposed 25 rad/s crossover would leave only \(90°-2\arctan(25/40)=25.99°\). A changed controller may buy lead with noise amplification or a steeper high-frequency roll-off. Reevaluate the complete minimum-phase contribution rather than treating this particular 16.57 as universal.
Use the maximum-modulus principle for a controller-independent test
Now suppose the plant has a simple real unstable pole \(p>0\) and a right-half-plane zero \(z>0\) with \(p\ne z\). Assume rational proper internally stabilizing feedback without unstable cancellations. \(S\) and \(T\) are bounded and analytic in the open right half plane. Internal stability of \(PS\) requires \(S(p)=0\), hence \(T(p)=1\). At the plant zero \(T(z)=0\). Divide \(T\) by the stable all-pass factor \(B_z(s)=(s-z)/(s+z)\). The apparent singularity at \(z\) is removable. On the imaginary axis \(|B_z|=1\), so \(F=T/B_z\) and \(T\) have identical boundary magnitudes.
The maximum-modulus principle bounds the interior value \(|F(p)|\) by the largest boundary magnitude (including the limit at infinity). Substituting the interpolation values gives
For \(p=2\) and \(z=3\) s⁻¹ the peak is at least 5, approximately 14.0 dB. A claimed peak below 2 is infeasible for every controller obeying the stated assumptions, even if the measured range missed the peak. When the pole and zero approach each other the bound diverges. Trying to cancel them inside the controller sacrifices internal stability.
Why the sensitivity integral and this test say different things
The Bode integral constrains the area of log sensitivity across frequency. The maximum-modulus argument uses exact internal interpolation at two specific plant singularities to bound a peak of complementary sensitivity. Which result is sharper depends on the requirement and measured plant.

Interactive calculation · Move a positive zero toward an unstable pole
Compare the necessary peak-gain bound with the specified target. The delay affects the separate45° phase budget, not the interpolation inequality.
Exercises on impossible requirements
A measured minimum-phase loop has −110° phase at its proposed crossover of 30 rad/s. How much additional pure delay permits a 45° margin?
Worked solution
The spare phase is \(180-110-45=25°=0.4363\) rad. At the stated unchanged crossover this permits at most \(0.4363/30=14.5\) ms.
How far must a positive zero \(z>p\) lie above an unstable pole \(p=2\) to avoid ruling out a peak target of 2 by the interpolation bound alone?
Worked solution
Require \((z+2)/(z-2)\leq2\), giving \(z\geq6\) s⁻¹. This removes one necessary-condition violation. It does not construct a controller satisfying every constraint.
Further reading · Åström and Murray, Feedback Systems, 2nd ed., Chapters 13–14, especially sections 14.3–14.4.
System dynamics, feedback and estimation · 8. Designing current, speed and position loops for a drive
An encoder measures shaft motion, while the power stage acts on voltage. Decide which disturbances each measurement can reject and how fast each loop can move before the unseen inner dynamics erode the position margin.
Place a fast loop where the disturbance enters
Use the small-signal motor equations \(L\dot i+Ri=v-k_e\omega\), \(J\dot\omega+B\omega=k_t i-\tau_L\), and \(\dot\theta=\omega\). Measure current at the converter and motion at the shaft. A speed loop alone leaves rapid electrical disturbances to propagate before they appear in shaft motion. Close a fast local current loop and send it a current reference from the mechanical loop. Treat back EMF as a disturbance or add measured-speed feedforward.
Choose \(C_i(s)=k_{pi}+k_{ii}/s\) with \(k_{ii}/k_{pi}=R/L\). For the nominal \(1/(Ls+R)\) current plant the open loop reduces to \(k_{pi}/(Ls)\) and the closed transfer is \(\omega_i/(s+\omega_i)\), with \(k_{pi}=L\omega_i\) and \(k_{ii}=R\omega_i\). At \(L=0.010\) H, \(R=1\) ohm and \(\omega_i=1000\) rad/s the gains are 10 V/A and 1000 V/(A s). The approximation presupposes adequate measurement, switching and computation bandwidth.
Choose the middle loop against an inner-loop error budget
If current follows its command over the speed-loop band, the torque-to-speed plant is \(k_t/(Js+B)\). A speed PI controller with \(k_{p\omega}=J\omega_v/k_t\) and \(k_{i\omega}=B\omega_v/k_t\) gives an approximate closed speed response \(\omega_v/(s+\omega_v)\). With \(J=0.020\), \(B=0.020\), \(k_t=0.40\) in SI and \(\omega_v=100\) rad/s, the gains are 5 in the corresponding current-per-speed and integral units. The neglected current lag contributes \(\arctan(100/1000)=5.71°\) at that speed-loop crossover. Reserve this phase when validating the full model. A torque disturbance enters the mechanical balance directly and is primarily rejected by this middle loop.
Convert a position requirement into a realizable crossover
Use position proportional feedback \(\omega_{ref}=K(\theta_{ref}-\theta)\), the achieved speed model \(\omega_v/(s+\omega_v)\) and total outer-path delay \(\tau\). In this reduced model the exact position-loop frequency response is \(L(s)=K e^{-s\tau}/[s(1+s/\omega_v)]\). Choosing \(K\) for a desired amplitude crossover separates magnitude tuning from the residual phase budget:
At \(\tau=6\) ms, \(\omega_v=100\) rad/s and required margin 45°, solving the monotone equation gives \(\omega_c\leq51.56\) rad/s. The 50 rad/s design has only 46.25° before any additional sensor or drive lag. At 20 rad/s the nominal margin is 71.81°. The notebook separately evaluates the delay-free closed-loop poles with OneSimulation. Their decay rate and the delayed loop’s phase margin measure different properties.
Interactive experiment · Spend the phase budget with bandwidth and delay sliders
Choose the achieved inner-loop bandwidth, the outer-path delay and the intended outer crossover. The browser adjusts the proportional gain to place the amplitude crossover exactly at that frequency, then evaluates the remaining phase margin. The 45° line is a design target; it is not the boundary of stability itself.
Begin at an inner bandwidth of 100 rad/s, delay 6 ms and crossover 50 rad/s. Double the delay and observe the lost 17.19°. Then lower the requested crossover until the target is recovered. The zero-delay pole margin in the readout is computed from the quadratic closed-loop characteristic polynomial. Compare it with the OneSimulation stability diagnostic in the notebook; it does not certify the delayed system.
Continue in the OneSimulation notebook · Download its Python model
OneSimulation experiment · An achieved inner speed bandwidth and transport delay bound the outer-loop crossover
Run the notebook with OneSimulation 0.2.0, NumPy, SciPy and Matplotlib. Change the input data and compare your run with the recorded result.
"""Evaluate inner-lag and transport-delay limits on an outer position loop."""
import numpy as np
import matplotlib.pyplot as plt
from onesim.physics.systems.control import stability_margin
inner_pole = 100.0 # rad/s, achieved bandwidth of the closed speed loop
def outer_gain(crossover):
return crossover*np.sqrt(1+(crossover/inner_pole)**2)
def phase_margin(crossover, delay):
return 90-np.rad2deg(np.arctan(crossover/inner_pole)+crossover*delay)
frequencies = np.linspace(1,90,250)
fig, ax = plt.subplots(figsize=(6.4,3.7), layout="constrained")
for delay in [0.0,0.006,0.012]:
ax.plot(frequencies, phase_margin(frequencies,delay),label=f"{1000*delay:.0f} ms delay")
for crossover in [20.0, 50.0]:
gain = outer_gain(crossover)
poles = np.roots([1.0,inner_pole,inner_pole*gain])
print(f"crossover {crossover:.0f} rad/s: delay-free pole margin = "
f"{stability_margin(poles,discrete=False):.3f} /s, "
f"6 ms phase margin = {phase_margin(crossover,0.006):.2f} deg")
ax.axhline(45,color="0.4",ls=":",label="45° requirement")
ax.set(xlabel="Outer gain crossover (rad/s)",ylabel="Phase margin (degrees)")
ax.legend()
plt.show()Reference run
crossover 20 rad/s: delay-free pole margin = 28.543 /s, 6 ms phase margin = 71.81 deg crossover 50 rad/s: delay-free pole margin = 50.000 /s, 6 ms phase margin = 46.25 deg

Inspect failure signatures from the inside out
Measure the current-reference response with the mechanical loop open in the model. Then close speed feedback and compare measured torque-step recovery with the linear prediction. Finally apply a position command and log reference and achieved current, shaft speed and position together. Under voltage clipping the actual current cannot track its command at speed. A speed integrator that keeps charging can dominate the later position excursion. Use actuator feedback for anti-windup and check the actual limits at the operating speed.
Which loop receives the position sample delay?
A rotor-position timestamp used to derive speed can delay both mechanical loops. A transport delay introduced only between the supervisory controller and the drive delays the outer loop. Draw the measurement paths before inserting a single lumped delay or counting it twice.
Exercises on a changed architecture
Keep crossover at 50 rad/s while total delay rises from 6 to 12 ms. What does this do to the reduced-model margin?
Worked solution
The gain is unchanged by pure delay. The added lag is \(50(0.006)=0.30\) rad, or 17.19°. Margin falls from 46.25° to 29.06°, below the target.
At high speed the current sensor follows its local model but digital speed estimates have 4 ms of additional filtering delay. Where should the new uncertainty enter?
Worked solution
Place it in the speed measurement path. Recompute the middle-loop closed dynamics before using them as the position plant. Adding it only to the outer-loop delay would miss loss of speed-loop robustness.
Further reading · Åström and Murray, Feedback Systems, 2nd ed., Chapters 10–11 and 15.
From a moving plant to identified dynamics
Derive a plant from force and energy, then compare its modes with measured shifts and decay. Examine the uncertainty that remains when two parameters produce similar responses.
- Free vibration, energy loss and ring-down data
- Harmonic forcing, phase and dissipated power
- Coupled oscillators and normal coordinates
- Energy coordinates and Lagrange’s equation
- Finite-amplitude oscillations and model validity
- A moving-coil galvanometer as an electrical and mechanical system
- Coupled optical and mechanical resonances
- Predictions, parameter profiles and nonlinear uncertainty
- Learning a drifting temperature from a sequence of readings
- Predicting a new measurement when the fitted parameters are correlated
- Measure gravity with a pendulum of finite amplitude
- Measure inertia and gravity with two suspension axes
Time stepping and robust computation
Investigate state growth in apparently stable systems, propagate derivatives and judge whether numerical error can account for a switching event.
- Absolute stability and stiffness
- Adaptive steps and event locations
- Tangent equations and adjoint outputs
- How two decaying modes produce a growing signal
- Locating a grazing event between time steps
- Eigenvalues, modes and spectral gaps
- Singular values and minimum-norm solutions
- Deciding how far to trust a linearised residual
- Master equations, detailed balance and probability currents
Applied study
Design feedback for a tracking requirement and examine how loop gain changes speed, offset and stability.
Turn a machine balance into a plant model
A speed controller drives a motor against viscous drag. The shaft has inertia \(J\), drag coefficient \(b\), angular speed \(\omega\) and commanded torque \(u\). With a constant opposing load torque \(d\), the balance is
Without feedback a step in load changes the steady speed by \(-d/b\). An engineer who can measure speed can command more torque as soon as the speed falls.
Divide by \(b\). With output \(y=\omega\), time constant \(\tau=J/b\) and static gain \(K=1/b\), the unloaded plant becomes
A heating element with finite heat capacity and heat loss has the same first-order form under constant material properties. Transfer functions or step-response measurements can therefore guide controller design before the full machine is available.
Choose the loop gain from a tracking requirement
A proportional controller applies \(u=K_p(r-y)\) for a reference \(r\). Substitution gives
If \(1+KK_p>0\), the closed loop settles with time constant \(\tau_{\rm cl}=\tau/(1+KK_p)\). Following a step from rest,
The steady error supplies the command that balances the drag. For a normalised model with \(K=2\), \(\tau=20\) s, \(r=1\) and \(K_p=4\), the loop gain is 8. The output tends to \(8/9=0.8889\) with time constant 2.222 s. Keeping the steady error within 5% of the setpoint requires \(1/(1+2K_p)\le0.05\), hence \(K_p\ge9.5\). At the instant of a unit step this higher gain asks for 9.5 units of actuator effort. A drive limited to 5 units initially saturates, so the linear prediction for the rise time must be revised.
Reject a load disturbance with integral action
For the motor with a constant load, proportional control settles at \(y=(K_pr-d)/(b+K_p)\). Adding \(K_i\int (r-y)\,dt\) to the command lets the controller supply constant torque even at zero error. If the loop settles and the actuator has sufficient reserve, a bounded steady integrator state requires \(r-y=0\).
The extra state changes stability and damping. For the normalised plant and a PI controller, the closed-loop characteristic polynomial is \(\tau s^2+(1+KK_p)s+KK_i\). At \(K=2\), \(\tau=20\) s, \(K_p=4\) and \(K_i=1\) per second, its roots are \(-0.225\pm0.222i\) per second. Both decay, but a disturbance can now excite an oscillation. A gain that removes steady error can change the transient response substantially.
Problem class
A motor picks up a load
Take \(b=0.50\) N·m·s/rad, \(K_p=2.0\) N·m·s/rad and reference speed 10 rad/s. A 1 N·m load is added after the motor has settled. Find the two steady speeds and the torque an integral controller would need to restore 10 rad/s.
Balance torque before and after the load step
Before the load, \(y=20/2.5=8.0\) rad/s. After it, \(y=(20-1)/2.5=7.6\) rad/s. At the desired speed the drag is 5 N·m, so the restored steady state needs a total of 6 N·m from the motor. At zero error the integral term supplies that torque.
Design for critical damping
Keep the normalised plant and \(K_p=4\). Find the integral gain for a repeated pole. Predict the effect of doubling this integral gain on the pole locations.
Find the poles from the characteristic polynomial
Critical damping requires \((1+KK_p)^2-4\tau KK_i=0\), giving \(K_i=81/160=0.50625\) per second. The pole is \(s=-9/40=-0.225\) per second. Doubling \(K_i\) leaves the real part unchanged and gives an imaginary part of magnitude 0.225 per second. The poles now form a complex pair.
OneSimulation laboratory
Predict the settling time and offset of a feedback loop
Compare recorded OneSimulation runs on this page. To test your own inputs, download the notebook and model files and run the model in an activated OneSimulation environment.
The OneSimulation signal graph connects a setpoint, error junction, controller and first-order plant. Start with plant_gain = 2.0 and setpoint = 1.0. Change proportional_gain or time_constant, keeping the other parameters fixed. Before comparing, decide which change affects the asymptotic error.
| Controller gain and plant time constant | Fitted time (s) | Sampled error |
|---|---|---|
| Gain 4 · plant 20 s | 2.22222 | 0.11331 |
| Gain 2 · plant 20 s | 4.00000 | 0.20198 |
| Gain 4 · plant 40 s | 4.44444 | 0.11331 |

Try \(K_p=9.5\) in the download. Compare the recorded final error against \(e_\infty=0.05\). To explain the difference, evaluate the exponential at the actual last sample time. Inspect the signal graph and its time histories.
Download experiment files (ZIP) Extract the files together and open first_order_plant_p_control.ipynb in a local OneSimulation environment.
Interactive reference for the OneSimulation laboratory
Change gain and plant lag independently. The browser evaluates the unsaturated analytical reference for the linked OneSimulation signal graph.
Problem sheet 2 · Identify a controller from a finite-time observation
Notation and assumptions
Read each defining equation with its assumptions and units, then follow the link to the argument that gives the equation its meaning.
Complementary sensitivity
For the same feedback configuration S plus T is one. Measurement noise and plant-input disturbances reach the output on different paths.
Derivation · Separating reference tracking from disturbance rejection
Discrete pole
This maps a continuous modal exponent into a sampled multiplier over interval Ts. Different continuous frequencies can give the same sampled phase.
Loop delay
A pure delay leaves the magnitude unchanged and adds frequency-dependent phase. Use angular frequency when converting a margin to seconds.
Derivation · How much transport delay a feedback loop can tolerate
Observability
Full column rank in the standard finite-dimensional linear model allows the initial state to be inferred from ideal output history. Noise still controls achievable precision.
Sensitivity
For a scalar unity negative-feedback loop this gives one closed-loop transfer. The point where a disturbance enters determines which transfer the observer measures.
Transfer function
State the input, output and zero initial condition. Interconnection signs and unmodelled dynamics affect what a measured closed-loop response represents.
Derivation · Transfer functions and connections between systems
Further reading
Compare time-domain pole placement with loop-shaping predictions. Trace an input disturbance and measurement noise separately through the same feedback loop. Åström and Murray · Feedback Systems
Use the cost-to-go derivation to relate the Riccati matrix to the geometry of a controlled trajectory and its terminal cost. Russ Tedrake · Linear Quadratic Regulators









