Electrical Engineering‹›⌂ 0:00 studied

Module 13 · 12 min read · Free chapter

Lead-lag compensators, P, PI and PID control, and state-space analysis

In short

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.

What are you preparing for? We show the practice and previous year questions of your exam.

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:

u(t)=Kpe(t)+Ki∫0te(τ) dτ+Kdde(t)dt,Gc(s)=Kp+Kis+Kdsu(t) = K_p e(t) + K_i \int_0^t e(\tau)\,d\tau + K_d \frac{de(t)}{dt}, \qquad G_c(s) = K_p + \frac{K_i}{s} + K_d s

Proportional (P). The output is proportional to the present error. Raising KpK_p 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 −KiKp-\dfrac{K_i}{K_p}. 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 −KpKd-\dfrac{K_p}{K_d}. 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 KpK_p 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 1s+1\dfrac{1}{s + 1} under P control with Kp=9K_p = 9 has a step error of 11+9=0.1\dfrac{1}{1 + 9} = 0.1, 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:

Gc(s)=1+aTs1+Ts,a>1G_c(s) = \frac{1 + aTs}{1 + Ts}, \quad a > 1

The zero comes before the pole, so the network gives a positive phase (lead) between the two corner frequencies 1aT\dfrac{1}{aT} and 1T\dfrac{1}{T}. The maximum lead occurs at their geometric mean:

ωm=1Ta,sin⁡ϕm=a−1a+1\omega_m = \frac{1}{T\sqrt{a}}, \qquad \sin\phi_m = \frac{a - 1}{a + 1}

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, 1+aTs1+Ts\dfrac{1 + aTs}{1 + Ts} with a < 1, or written as 1+Ts1+βTs\dfrac{1 + Ts}{1 + \beta Ts} 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 sin⁡−135≈36.9°\sin^{-1}\dfrac{3}{5} \approx 36.9°. If T = 0.05 s, this lead is at ωm=10.05×2=10\omega_m = \dfrac{1}{0.05 \times 2} = 10 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.

x˙=Ax+Bu,y=Cx+Du\dot{x} = Ax + Bu, \qquad y = Cx + Du

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 x1=ix_1 = i (inductor current) and x2=vCx_2 = v_C (capacitor voltage), with input u=vu = v and output y=vCy = v_C. KVL gives Ldidt=v−Ri−vCL\dfrac{di}{dt} = v - Ri - v_C, and the capacitor gives CdvCdt=iC\dfrac{dv_C}{dt} = i. So:

A=[−RL−1L1C0],B=[1L0],C=[01],D=0A = \begin{bmatrix} -\frac{R}{L} & -\frac{1}{L} \\ \frac{1}{C} & 0 \end{bmatrix}, \quad B = \begin{bmatrix} \frac{1}{L} \\ 0 \end{bmatrix}, \quad C = \begin{bmatrix} 0 & 1 \end{bmatrix}, \quad D = 0

Back to a transfer function. Taking Laplace transforms with zero initial state gives:

G(s)=C(sI−A)−1B+DG(s) = C(sI - A)^{-1}B + D

The denominator of G(s) is det⁡(sI−A)\det(sI - A), so the eigenvalues of A are the poles. For the RLC example, det⁡(sI−A)=s2+RLs+1LC\det(sI - A) = s^2 + \dfrac{R}{L}s + \dfrac{1}{LC}, the familiar characteristic equation.

Solving state equations, controllability and observability

The state transition matrix. With no input, x˙=Ax\dot{x} = Ax has the solution x(t)=eAtx(0)x(t) = e^{At}x(0). The matrix ϕ(t)=eAt\phi(t) = e^{At} is the state transition matrix: it carries the state from time 0 to time t. It is found most easily by Laplace transform:

ϕ(t)=L−1[(sI−A)−1]\phi(t) = \mathcal{L}^{-1}\left[(sI - A)^{-1}\right]

With an input, the full solution adds the response to u:

x(t)=ϕ(t)x(0)+∫0tϕ(t−τ)Bu(τ) dτx(t) = \phi(t)x(0) + \int_0^t \phi(t - \tau)Bu(\tau)\,d\tau

Properties. ϕ(0)=I\phi(0) = I, ϕ−1(t)=ϕ(−t)\phi^{-1}(t) = \phi(-t) and ϕ(t1+t2)=ϕ(t1)ϕ(t2)\phi(t_1 + t_2) = \phi(t_1)\phi(t_2). These are quick checks in multiple-choice questions.

Worked example. For A=[01−2−3]A = \begin{bmatrix} 0 & 1 \\ -2 & -3 \end{bmatrix}, (sI−A)−1=1(s+1)(s+2)[s+31−2s](sI - A)^{-1} = \dfrac{1}{(s + 1)(s + 2)}\begin{bmatrix} s + 3 & 1 \\ -2 & s \end{bmatrix}. Taking inverse transforms term by term, the first entry of φ(t) is 2e−t−e−2t2e^{-t} - e^{-2t}, 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 Qc=[B    AB    …    An−1B]Q_c = [B \;\; AB \;\; \dots \;\; A^{n-1}B] 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 Qo=[CT    ATCT    …    (AT)n−1CT]Q_o = [C^T \;\; A^TC^T \;\; \dots \;\; (A^T)^{n-1}C^T] 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 KuK_u and the period PuP_u. The classic PID settings are then Kp=0.6KuK_p = 0.6K_u, integral time Ti=0.5PuT_i = 0.5P_u and derivative time Td=0.125PuT_d = 0.125P_u. 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:

  1. Compare: the effects of P, I and D actions, or lead and lag compensation, with sketches.
  2. Derive: the maximum phase lead of a lead network and the frequency at which it occurs.
  3. Model: write the state equations of a circuit or mechanism and find its transfer function.
  4. Solve and test: find the state transition matrix, and check controllability and observability.

Practice questions (our own, not previous-year questions).

  1. 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)
  2. Derive the maximum phase lead of a lead compensator 1+aTs1+Ts\dfrac{1 + aTs}{1 + Ts} and the frequency at which it occurs. Find a to give 45° of lead. (12 marks)
  3. For A=[01−2−3]A = \begin{bmatrix} 0 & 1 \\ -2 & -3 \end{bmatrix}, B=[01]B = \begin{bmatrix} 0 \\ 1 \end{bmatrix} and C=[10]C = \begin{bmatrix} 1 & 0 \end{bmatrix}, find the transfer function and the state transition matrix, and test controllability. (15 marks)

Answer plan for question 2.

  • The phase is ϕ=tan⁡−1(aωT)−tan⁡−1(ωT)\phi = \tan^{-1}(a\omega T) - \tan^{-1}(\omega T).
  • Setting dϕdω=0\dfrac{d\phi}{d\omega} = 0 gives ωm=1Ta\omega_m = \dfrac{1}{T\sqrt{a}}.
  • Substituting, tan⁡ϕm=a−12a\tan\phi_m = \dfrac{a - 1}{2\sqrt{a}}, which is the same as sin⁡ϕm=a−1a+1\sin\phi_m = \dfrac{a - 1}{a + 1}.
  • For 45°, a−1a+1=0.707\dfrac{a - 1}{a + 1} = 0.707, 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 Kp+Kis+KdsK_p + \dfrac{K_i}{s} + K_d s: 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 1+aTs1+Ts\dfrac{1 + aTs}{1 + Ts} with a > 1 gives maximum lead sin⁡−1a−1a+1\sin^{-1}\dfrac{a - 1}{a + 1} at 1Ta\dfrac{1}{T\sqrt{a}}.
  • Lead improves phase margin and bandwidth, while lag lifts low-frequency gain to cut steady-state error.
  • The state model is x˙=Ax+Bu\dot{x} = Ax + Bu and y=Cx+Duy = Cx + Du, with G(s)=C(sI−A)−1B+DG(s) = C(sI - A)^{-1}B + D.
  • The eigenvalues of A are the poles, and the state transition matrix is ϕ(t)=L−1[(sI−A)−1]\phi(t) = \mathcal{L}^{-1}[(sI - A)^{-1}].
  • The system is controllable if [B  AB  … ][B \; AB \; \dots] has rank n, and observable if [CT  ATCT  … ][C^T \; A^TC^T \; \dots] has rank n.
  • Ziegler-Nichols gives Kp=0.6KuK_p = 0.6K_u, Ti=0.5PuT_i = 0.5P_u and Td=0.125PuT_d = 0.125P_u.

Check yourself

Exam-style questions on this chapter. Pick an answer to see the explanation. 0 of 16 answered

  1. Which controller action removes the steady-state error to a step input in a type 0 plant?

  2. Derivative action in a controller mainly:

  3. A PI controller adds to the open-loop transfer function:

  4. A pure derivative controller is not used alone because:

  5. The maximum phase lead of 1+aTs1+Ts\dfrac{1 + aTs}{1 + Ts} is given by:

  6. A lead network has a = 4 and T = 0.05 s. Its maximum lead and the frequency are:

  7. A lead compensator is used mainly to:

  8. A lag compensator improves mainly the:

  9. In the state model ẋ = Ax + Bu, the poles of the system are:

  10. The transfer function from a state-space model is:

  11. The number of state variables of a system equals its:

  12. The state transition matrix φ(t) satisfies:

  13. For A=[01−2−3]A = \begin{bmatrix} 0 & 1 \\ -2 & -3 \end{bmatrix}, the (1,1) entry of φ(t) is:

  14. A system is controllable if the matrix [B AB … Aⁿ⁻¹B]:

  15. A pole-zero cancellation in a transfer function usually indicates a mode that is:

  16. In the Ziegler-Nichols ultimate-gain method, the proportional gain of a PID controller is set to:

Previous year questions

Previous year questions for UPSC CSE will appear here once each one is checked word for word against the official question paper.

Learn with AI

A tutor that asks instead of telling, a partner that argues the other side, and this chapter told through your own district.

Tell the tutor what you are stuck on. It will guide you with questions and give the answer after a few tries.

🙋 Raise a doubt or feedback

Stuck somewhere, or spotted a mistake? Write to the ExamHike team. We usually reply within a day, and you will see the reply on My progress.

Log in to ask a doubt or send feedback →

Frequently asked questions

What does integral action do?

It raises the system type by one and so removes steady-state error to a step, but can slow the response and add overshoot.

When is a lead compensator used?

When the phase margin or speed of response must be improved.

How is controllability tested?

The matrix [B AB A²B ...] must have full rank n.

What is the state transition matrix?

e^(At), the inverse Laplace transform of (sI − A)⁻¹, which carries the initial state forward in time.

More in this module: Control systems

Official sources

Facts in this chapter were checked against these official sources.

  1. GATE 2026 Electrical Engineering (EE) syllabus, IIT Guwahati
  2. BPSC Assistant Engineer (Electrical) syllabus, Papers 5 and 6, Bihar Engineering Service Rules 2019
  3. NPTEL Control Engineering (IIT Madras, 108106098)