Fundamentals / Mechanical engineering

Control engineering

Model a plant, design and test a feedback loop in time and frequency, then design estimators and controllers that handle sampling, actuator limits and interacting channels.

Prerequisites Linear first-order differential equations and basic dynamics.

Investigate with OneSimulation Predict the settling time and offset of a feedback loop

Read the subject in depth

Each volume develops its arguments in sequence, with worked problems and links to experiments.

How the course fits together

  1. Chapters 1–4

    Identify a dynamic plant from measurements. Connect input, error, controller and plant to obtain a transfer function. Its poles and frequency response predict settling and the phase lag of the output.

  2. Chapters 5–8

    Move from a measured output to a state description and sample the loop in time. Trace poles as gain changes and ask how sensitive the proposed controller is to an uncertain plant.

  3. Chapters 9–12

    Choose feedback using an explicit cost and estimate hidden states from noisy data. Several channels can interact, and actuator constraints make a finite-horizon control problem depend on the current state.

Chapters

  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.

  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.

  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.

  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.

  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.

  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.

  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.

  8. Uncertainty envelopes and robust stability

    Turn a bounded discrepancy between plant and model into a frequency-by-frequency test of the feedback design.

  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.

  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.

  11. Interacting actuators, pairing and decoupling

    Predict how closing one loop changes the apparent gain of another, and identify a physically expensive actuator combination.

  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.

Further chapters and interactive tutorials

  1. 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.

  2. 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.

  3. 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.

  4. 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.

  5. 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.

  6. 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.

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

  8. 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.

Computational notebooks

Run the Python calculations in your browser and compare the figures with the derivations.

Problem sheets

Sheets 1–6 accompany the first twelve chapters. The final projects bring several methods together. Attempt each stage before opening its worked solution.

  1. Modelling a plant and interpreting its signalsFor chapters 1 and 2

    Use balances, local linearisation and block diagrams to decide which parameters a commissioning test actually measures.

  2. Pole placement, gain and phaseFor chapters 3 and 4

    Design a second-order transient, examine a hidden stability limit, and test a delay budget against a frequency response.

  3. What a controller can learn and deliverFor chapters 5 and 6

    Use rank tests, an exact sampled model and a finite-time numerical observation to diagnose three different limits.

  4. Pole geometry and plant uncertaintyFor chapters 7 and 8

    Find which poles are achievable, then test what happens when the plant deviates from the nominal design.

  5. Regulate a state and estimate it from dataFor chapters 9 and 10

    Calculate an optimal feedback policy and decide when filtering or sensor placement limits its implementation.

  6. Coupled plants and constrained predictionsFor chapters 11 and 12

    End the course by testing an actuator pairing, a finite-horizon plan and a specification that initially looks feasible.

  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.

  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.

Final synthesis problem · Commission a sampled loop with a limited actuator

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

\[J\dot\omega=u-b\omega-d.\]

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

\[\tau\dot y+y=Ku.\]

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

\[\tau\dot y+(1+KK_p)y=KK_pr.\]

If \(1+KK_p>0\), the closed loop settles with time constant \(\tau_{\rm cl}=\tau/(1+KK_p)\). Following a step from rest,

\[y(t)=\frac{KK_p}{1+KK_p}r\,(1-e^{-t/\tau_{\rm cl}}),\]
\[e_\infty=\frac{r}{1+KK_p}.\]

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.

Numerically fitted time constant and tracking error sampled after six closed-loop time constants. The unit step starts from rest.
Controller gain and plant time constantFitted time (s)Sampled error
Gain 4 · plant 20 s2.222220.11331
Gain 2 · plant 20 s4.000000.20198
Gain 4 · plant 40 s4.444440.11331
Reducing proportional gain slows the loop. Doubling the plant time constant with gain fixed doubles the fitted closed-loop time while leaving the error at six closed-loop time constants almost unchanged.
Reducing proportional gain slows the loop. Doubling the plant time constant with gain fixed doubles the fitted closed-loop time while leaving the error at six closed-loop time constants almost unchanged.

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

Advanced study across the subject

Each sequence connects the course to detailed chapters in neighbouring subjects. The complete course PDF includes their derivations, examples and exercises.

  1. 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.

  2. 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.

Trace the poles of a moving-coil instrument back to inertia, restoring torque and damping. Use its measured response to test the model.

A moving-coil galvanometer as an electrical and mechanical system

Further reading

Compare specific topics with the university sources