Module 13 · 12 min read · Free chapter
Lead-lag compensators, P, PI and PID control, and state-space analysis
Integral action removes steady-state error, derivative action adds damping, and PID combines both with proportional gain. A lead compensator adds phase to improve speed and margin, while a lag compensator raises low-frequency gain to cut error. State-space models write a system as first-order matrix equations, and controllability and observability are tested by matrix rank.
Start from zero: why a plant needs a controller
Suppose you have designed a motor drive and analysed it with the tools of the last three chapters. Its overshoot is 40%, its speed drifts 5% under load, and raising the gain makes it unstable. You cannot change the motor. What you can change is the controller that sits between the error and the motor.
The controller, also called a compensator, reshapes the loop so that it meets the specifications. There are two families. Industrial controllers (P, PI, PD and PID) act directly on the error and are tuned with knobs. Compensating networks (lead, lag and lead-lag) are designed with Bode plots or the root locus.
PID control is the workhorse of industry. In 1922 Nicolas Minorsky analysed ship steering and proposed proportional, integral and derivative action. In 1942 John Ziegler and Nathaniel Nichols gave simple tuning rules still used today. Most temperature, pressure, flow and speed loops in power plants, refineries and water works run on PID.
The state-space method came later, in the 1960s, driven by the space race and digital computers. Rudolf Kalman showed how to describe a system by its internal state, which handles many inputs and outputs at once.
Why it matters. GATE asks about the effect of each controller term, the maximum phase lead of a lead network, and state transition matrices. ESE asks for compensator design and controllability tests.
P, PI, PD and PID controllers
The PID controller produces its output from the error e(t) in three ways at once:
Proportional (P). The output is proportional to the present error. Raising makes the loop faster and cuts the steady-state error, but it also lowers damping and can cause instability. A type 0 plant under P control always keeps some offset to a step.
Integral (I). The output grows as long as any error remains, so it keeps pushing until the error is exactly zero. A PI controller adds a pole at the origin and a zero at . It raises the system type by one and removes the step offset. The price is more overshoot and a slower settling, because the added pole pushes the root locus to the right.
Derivative (D). The output responds to how fast the error is changing, so it acts before the error grows large. A PD controller adds a zero at . It adds damping, cuts overshoot and widens bandwidth. It does not change the steady-state error, and it amplifies high-frequency noise, so real PD controllers add a small filter.
PID together. The three terms cover the past (I), the present (P) and the future (D) of the error. A well-tuned PID loop is fast, well damped and free of offset.
| Action | Settling and overshoot | Steady-state error | Stability |
|---|---|---|---|
| Raise | Faster, more overshoot | Smaller (not zero for type 0) | Worse |
| Add I | More overshoot, slower settling | Zero for a step | Worse |
| Add D | Less overshoot, faster settling | No change | Better |
Worked example. A plant under P control with has a step error of , so it settles 10% short. Adding integral action makes the open loop type 1, and the step error becomes zero.
Lead, lag and lead-lag compensators
A compensating network is usually a small RC circuit, or its op-amp or digital equivalent, placed in series with the plant. Its transfer function has one zero and one pole.
Lead compensator. Its form is:
The zero comes before the pole, so the network gives a positive phase (lead) between the two corner frequencies and . The maximum lead occurs at their geometric mean:
What lead does. Placed near the gain-crossover frequency, the extra phase raises the phase margin. It also widens bandwidth, so the response is faster with less overshoot. Its drawback is that it amplifies high frequencies by a factor of a, which lets in more noise. A single stage gives at most about 60° of useful lead.
Lag compensator. Here the pole comes before the zero, with a < 1, or written as with β > 1. Both corners are placed well below the gain crossover.
At low frequency it raises the loop gain, which cuts steady-state error. Near crossover it adds almost no phase, so the transient response hardly changes. The cost is a slower final creep.
Lead-lag. When a design needs both better transients and smaller steady-state error, the two are combined. The lead part shapes the crossover region, and the lag part lifts the low-frequency gain.
Worked example. A lead network has a = 4. The maximum lead is . If T = 0.05 s, this lead is at rad/s.
State-space models
A transfer function only links one input to one output. It hides what happens inside, and it assumes zero initial conditions. The state-space model fixes both problems by tracking the system's internal state: the smallest set of variables that, with the input, fully decides the future.
Choosing states. Natural choices are the variables that store energy: inductor currents and capacitor voltages in a circuit, or positions and velocities in a mechanism. An n-th order system needs n state variables.
The standard form.
Here x is the state vector, u the input, and y the output. A is the system matrix, B the input matrix, C the output matrix and D the direct feed-through, which is often zero.
Worked example: series RLC. Take the states (inductor current) and (capacitor voltage), with input and output . KVL gives , and the capacitor gives . So:
Back to a transfer function. Taking Laplace transforms with zero initial state gives:
The denominator of G(s) is , so the eigenvalues of A are the poles. For the RLC example, , the familiar characteristic equation.
Solving state equations, controllability and observability
The state transition matrix. With no input, has the solution . The matrix is the state transition matrix: it carries the state from time 0 to time t. It is found most easily by Laplace transform:
With an input, the full solution adds the response to u:
Properties. , and . These are quick checks in multiple-choice questions.
Worked example. For , . Taking inverse transforms term by term, the first entry of φ(t) is , which equals 1 at t = 0 as it should.
Controllability. Can the input steer the state anywhere in a finite time? Kalman's test says yes if the controllability matrix has full rank n. If not, some part of the system cannot be reached by the input, however hard you push.
Observability. Can the state be worked out from the output? The test is that has rank n. If not, some internal motion never shows up at the output, so a fault there could go unseen.
Why it matters. A pole-zero cancellation in a transfer function often hides an uncontrollable or unobservable mode. If that hidden mode is unstable, the system can blow up internally while its output looks fine, which is why designers check these tests.
Tuning in practice and where these controllers live
Ziegler-Nichols tuning. In the ultimate-gain method, the plant runs under P control only. The gain is raised until the loop just oscillates steadily, which gives the ultimate gain and the period . The classic PID settings are then , integral time and derivative time . These give a quick, fairly aggressive start, which the engineer then refines.
Integral windup. If the actuator saturates, for example a valve already fully open, the integral term keeps growing while the error persists. When the error finally reverses, the oversized integral takes a long time to unwind, causing a big overshoot. Practical controllers clamp the integral, which is called anti-windup.
Derivative kick. A sudden step in the set point makes the derivative of the error huge for an instant. Many controllers therefore take the derivative of the measured output only, not of the error.
Where you meet them in electrical work. Generator automatic voltage regulators use PID or lead-lag blocks. Turbine governors use proportional droop with integral reset at the plant level. Variable-frequency drives use PI loops for current and speed. Switch-mode power supplies use lead (type II or type III) compensators in their voltage loop.
Descriptive lens: how this topic is asked in written papers
Written papers test this chapter in four ways:
- Compare: the effects of P, I and D actions, or lead and lag compensation, with sketches.
- Derive: the maximum phase lead of a lead network and the frequency at which it occurs.
- Model: write the state equations of a circuit or mechanism and find its transfer function.
- Solve and test: find the state transition matrix, and check controllability and observability.
Practice questions (our own, not previous-year questions).
- Explain the effects of proportional, integral and derivative actions on the transient and steady-state response. Why is a pure derivative controller never used alone? (12 marks)
- Derive the maximum phase lead of a lead compensator and the frequency at which it occurs. Find a to give 45° of lead. (12 marks)
- For , and , find the transfer function and the state transition matrix, and test controllability. (15 marks)
Answer plan for question 2.
- The phase is .
- Setting gives .
- Substituting, , which is the same as .
- For 45°, , so a ≈ 5.83.
- Note that the high-frequency gain rises by a, which is the noise cost of the lead.
Quick revision
- PID is : P speeds up, I removes offset, and D adds damping.
- PI adds a pole at the origin (raises type), and PD adds a zero (improves damping and speed).
- A lead network with a > 1 gives maximum lead at .
- Lead improves phase margin and bandwidth, while lag lifts low-frequency gain to cut steady-state error.
- The state model is and , with .
- The eigenvalues of A are the poles, and the state transition matrix is .
- The system is controllable if has rank n, and observable if has rank n.
- Ziegler-Nichols gives , and .