Fundamentals / Mechanical engineering / Control engineering

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.

\[\dot x_1=x_2,\]
\[m\dot x_2=u-kx_1-bx_2 .\]

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.

\[m\ddot x_1+(b+k_v)\dot x_1+(k+k_p)x_1=nr .\]

Comparing its characteristic polynomial with a desired \(s^2+2\zeta\omega_ns+\omega_n^2\) determines both feedback coefficients directly.

\[k_p=m\omega_n^2-k,\]
\[k_v=2m\zeta\omega_n-b.\]

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
\[\mathcal O=[C^\mathsf T,(CA)^\mathsf T,\ldots]^\mathsf T\]

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\).

\[\dot{\hat x}=A\hat x+Bu+L(y-C\hat x),\]
\[\dot e=(A-LC)e .\]

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.

\[\frac{d}{dt}\begin{pmatrix}x\\e\end{pmatrix}=\begin{pmatrix}A-BK&BK\\0&A-LC\end{pmatrix}\begin{pmatrix}x\\e\end{pmatrix}.\]

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.

\[p(s)=\det(sI-A+BK)\det(sI-A+LC).\]

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

\[\dot q=v,\ m\dot v=-kq-bv+u.\]

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.

\[\dot x=Ax+Bu,\quad y=Cx,\qquad A=\begin{pmatrix}0&1\\-k/m&-b/m\end{pmatrix},\ B=\binom{0}{1/m},\ C=(1\;\;0).\]

With zero input the transition \(e^{At}\) propagates initial conditions. Integrating the effect of forces applied at each earlier time gives

\[x(t)=e^{At}x(0)+\int_0^t e^{A(t-s)}Bu(s)\,ds.\]

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

\[h_1=8,\ h_2=10.\]

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:

\[\dot v=-(a+bk_v)v+bk_i z+d,\]
\[\dot z=r-v,\]
\[p(s)=s^2+(a+bk_v)s+bk_i .\]

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

\[k_v=(7-2)/3=1.667\,\mathrm{V\,s/m},\]
\[k_i=12/3=4.0\,\mathrm{V/m}.\]

At command \(r=1.0\,\mathrm{m/s}\) and constant opposing disturbance \(d=-0.60\,\mathrm{m/s^2}\), equilibrium requires

\[u=(ar-d)/b=0.867\,\mathrm V.\]

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.