The Basics of Control Theory
Running a technical process — holding a chemical reactor at temperature, keeping a bank balance in the black, steering a spacecraft along a planned trajectory — combines three activities. The first is planning: forming a conception of the process and defining the target state we want it to reach. The other two are about actually getting there, and they are not the same thing. There is usually more than one way to drive a process toward its target, and choosing between them is a genuine modeling decision that shapes everything downstream.
Non-feedback control (also called open-loop control) strives for the target state by adjusting the control variables ahead of time, according to a fixed plan, without checking the actual result.
Example: switch on additional cooling every day at noon, on the assumption that noon is when it gets hot — regardless of what the temperature actually turns out to be.
Feedback control (also called closed-loop control) constantly monitors the process and minimizes the difference between the target state and the actual state, correcting as it goes. It is a real-time task: the decision of what to do next is made on the spot, from the current measurement.
Example: keep a reactor temperature constant by measuring it continuously and reacting immediately to any drift.
The distinction is the one between a strategy fixed in advance and a strategy that responds to what is actually happening. The rest of this page is about the second kind.
Outer and inner control loops
Feedback control comes in two flavors, separated by how fast the loop has to react and how much deviation it can tolerate.
- outer loop: slow reaction, a larger deviation from the target is allowed, and the loop can be implemented in software. A bank giro (current) account is a typical example — the balance may drift well away from where we want it before any correction is made, and the correction itself is a leisurely, software-mediated transaction.
- inner loop: time-critical, only small deviations are allowed, and a hardware implementation is necessary because software would be too slow. Holding the temperatures inside a chemical reactor constant is the standard example — a runaway there develops in moments, so the correction must be immediate and physical.
Notation: the feedback loop
A feedback controller is drawn as a loop of signals flowing through a few standard blocks. The reference value enters on the left, the difference between reference and measurement is formed at a summing junction, that difference drives a controller, the controller acts on the controlled system, and the system’s measured output is fed back to the summing junction — closing the loop.
The signals carry the following meanings:
- reference value : the value we want — for a heating loop, the target temperature we would like the system to sit at.
- deviation (error) : how far the current measured value is from the reference, formed at the summing junction. This error is what the controller actually sees.
- control variable : the controller’s action. If the temperature is above the reference, the controller might respond by opening a valve to release cooling liquid.
- disturbance : an external disturbance (noise) acting on the controlled system from outside the loop. In the simple treatment here it is left out of the model.
- measured value : what we measure at the system’s output. It is fed back to the summing junction, where it is subtracted from to form the next error — and the loop repeats.
The aim is to choose the control variable so that the target/actual difference stays as small as possible. What “small” should mean is itself a choice, and different processes call for different optimization criteria:
- deviation tends to zero as fast as possible: every bit of sustained error is unacceptable, so the loop drives it out as quickly as it can. Typical of medical applications, where a drifting controlled quantity is dangerous.
- deviation stays within a certain band: we accept any error inside a tolerance and only act when it leaves the band — no need for constant real-time correction.
- statistical average of the deviation is zero: the error may be large in either direction at any moment, as long as it averages out over time. A bank account fits this — a long stretch in the negative is fine provided a long stretch in the positive balances it out.
- cost of control as small as possible: tracking the reference matters less than the energy spent adjusting the control variables. On a spacecraft, where every maneuver burns a limited fuel budget, conserving that budget can outweigh holding the reference tightly.
Important types of controllers
The simplest controller reacts to the error in direct proportion to its size.
A P controller (proportional controller) contains only a proportional element: the control variable is proportional to the target/actual deviation,
A large deviation produces a large action and a small deviation a small action. Its weakness is that a permanent deviation can remain.
The permanent deviation is structural, not a tuning mistake. A pure proportional element produces an action only when the error is non-zero, so against a constant load the loop settles at whatever small but non-zero error is just large enough to hold the system in place. It removes most of the deviation but never quite the last of it. Fixing this — and a few other shortcomings — is what motivates the more capable controller below.
A PID controller (proportional–integral–differential controller) is more powerful: alongside the proportional element it adds an integral element and a differential element. Discretized at discrete points , with step , its action is
where is the deviation at step .
Each of the three elements does a qualitatively different job, and the cleanest way to see the controller is by what each term fights:
- proportional element (): the action is geared to the current deviation, so it counteracts whatever is going wrong right now. This is the term that fights the present error.
- integral element (): the action is geared to the sum of all deviations accumulated so far (the term), so it counteracts deviation in the long run. This is the term that fights the history of error — and because it keeps building as long as any error persists, it is what guarantees the deviation vanishes, , curing the permanent offset a pure P controller leaves behind.
- differential element (): the action is geared to the change of deviation from one step to the next (the difference quotient ), so it reacts to how fast the error is moving. This is the term that fights escalations and oscillations, damping the loop before it overshoots.
So a natural question is whether all three elements are really needed. What is clear already is that the hard part is not writing the controller down but dimensioning it: choosing the parameters , , is the actual modeling problem, and it is complex. The example below makes both points concrete.
Example: linear feedback control
To turn the loop into something we can analyze, model the process to be controlled as a homogeneous system of linear ordinary differential equations (homogeneous meaning there is no constant forcing term — the right-hand side is purely the state acted on by a matrix, with nothing added). The ingredients are:
- a state vector describing the process;
- a time-invariant coefficient matrix ;
- a control-variable vector ;
- a time-invariant control-coefficient matrix .
Without any control loop, the process simply evolves on its own — call this version I:
This is the same shape as the arms race of two superpowers seen earlier, which carried an extra constant term, . As there, the basic question is whether the trajectory settles down: starting from some state , we do not know in advance whether drives the system toward a limit or away from it. Ensuring that it does approach a stable limit is exactly what we want the control loop to enforce. So we add control variables — version II:
The control variables are produced by measuring the system and converting that observation from the -dimensional state space into the -dimensional space of control actions. The simplest such conversion is a linear one.
In linear feedback control the control variables depend linearly on the state , through a time-invariant feedback matrix :
Substituting this into version II turns the controlled process back into a homogeneous linear ODE system, but with a new system matrix:
The task is to determine so that the control target and any constraints are met. It helps to see who owns which matrix. The matrix is given — it is fixed by whoever built the system, and we have no influence over it; it may have good properties or bad ones. The matrix is likewise part of the given plant: it describes how the control variables feed into the system. The one matrix we actually get to design is — how we build the control variable from an observation of the system. The whole job is, for whatever and we are handed, to determine so that the resulting closed-loop matrix has good properties. The payoff is that with the right , the system converges to a stable limit no matter where the state starts. The aim is precisely such a stationary limit state — one where the derivative is zero — and without loss of generality we can take that target to be the origin. What “good properties” means exactly is settled by solving the system.
Solution of the ODE system
We now solve the closed-loop system
The standard procedure for a homogeneous linear ODE starts from an ansatz (an educated guess for the form of the solution, to be confirmed by substitution): assume
with a constant vector and a scalar. Differentiating, the left-hand side becomes , while the right-hand side is . Since the scalar factor is never zero, it can be cancelled from both sides, leaving
This is the eigenvalue equation: the ansatz solves the ODE exactly when is an eigenvalue of and a corresponding eigenvector. So and are not arbitrary; chosen as an eigenpair of , the guessed form always works.
One thing is still missing: the initial condition. Setting in the ansatz gives , so a single eigenpair only satisfies in the lucky case where happens to equal . To hit an arbitrary we combine eigenpairs. If has linearly independent eigenvectors — guaranteed, for instance, when is symmetric or has distinct eigenvalues — then those eigenvectors form a basis of , so the initial vector can be written as a unique linear combination of them. Folding those coefficients into the eigenvectors, the solution is
This works for two reasons at once. Because the ODE is linear, a sum of solutions is again a solution, and each term solves it on its own (each is an eigenpair). And it respects the initial condition: at every exponential collapses to , so the sum reduces to , which we arranged to equal . If does not have a full set of independent eigenvectors the situation is more involved, but the matrix exponential
always works.
The eigenvalues control the long-term behavior directly, because each mode carries the factor . Writing a complex eigenvalue as , Euler’s formula (the identity ) splits its exponential into : the real part sets the growth or decay, while a non-zero imaginary part produces the oscillating and . Reading the eigenvalues of then tells us, at a glance, which regime the solution is in — this is the substance of linear stability analysis:
- all real parts negative: every mode decays, so the solution is stable, stationary, and tends to zero. This is the regime we are aiming for.
- at least one positive real part: that mode grows without bound, giving an exponentially growing component — unstable.
- all real parts zero: the modes neither grow nor decay, leaving a periodically oscillating solution.
- all real parts negative and all imaginary parts zero: the ideal case — pure decay to zero with no oscillation at all.
Dimensioning of the controller (matrix )
With the solution understood, “control” now has a precise meaning: determine the feedback matrix so that the closed-loop matrix becomes better than — that is, so its eigenvalues sit where we want them. Three goals, in order:
- real parts of all eigenvalues as negative as possible — impact: decay. Negative real parts are what make the solution return to the target at all.
- absolute value of those real parts as large as possible — impact: fast decay. A real part of is far better than , because collapses to zero much faster than ; for convergence, more negative is better.
- absolute value of the imaginary parts as small as possible — impact: no high-frequency oscillations. Small imaginary parts mean low oscillation frequencies; high frequencies are not just unpleasant but physically damaging, the way opening and closing a valve too rapidly to chase the temperature would wear out the hardware.
One caveat sits underneath all of this. Stability ought to survive small disturbances too — the controller should still hold up when the process is nudged off course. But the linear feedback model as written does not allow for that, because it contains no disturbance term at all (the from the loop diagram was dropped when we wrote the model down). Accounting for disturbances needs a more complicated model.
A concrete realization of everything above is a PID controller acting on a linear ODE system: the proportional, integral, and differential elements are exactly the tools for pushing the eigenvalues of where the three goals want them, which also answers the earlier question of whether all three elements are needed.