Modelling, Stability, Compensators, PID and State-Space

Section 7 of the GATE Electrical Engineering (EE) paper: the mathematics that decides whether a feedback loop settles, oscillates or runs away, and what to do about it. Start with how a physical system is turned into a transfer function via block diagrams and signal flow graphs; then how that transfer function's step response is read in the time domain; then the three classical routes to the same stability question — Routh-Hurwitz, Nyquist and Bode — plus root locus, a fourth view of the same s-plane; and finally the tools that actually shape a design — lag, lead and lag-lead compensators, P/PI/PID controllers, and the state-space model that scales to systems a single transfer function cannot describe.

1. Mathematical modelling, feedback, block diagrams and signal flow graphs

A physical system (electrical, mechanical, thermal) is modelled by writing its governing differential equations and Laplace-transforming them (assuming zero initial conditions) into a transfer function G(s) = output/input in the s-domain — an algebraic object that can be manipulated far more easily than the differential equation it replaces. A feedback system compares its output against a reference and acts on the error; negative feedback trades away some open-loop gain for reduced sensitivity to disturbances and to variation in the plant itself, which is the entire reason feedback control is used at all rather than open-loop control.

A block diagram represents a system as boxes (transfer functions) connected by signal-carrying arrows, reduced to a single overall transfer function by systematic rules (cascade, parallel, feedback-loop reduction, moving a summing or takeoff point across a block). A signal flow graph is the same information as nodes (signals) and directed, weighted branches (gains), solved instead by Mason's gain formula: overall gain = sum over forward paths of (path gain times its cofactor) divided by the graph determinant Delta, where Delta accounts for every individual loop gain and every product of non-touching (no shared node) loop gains.

⚠️ Non-touching loops are the term everyone forgets
Two loops are non-touching only if they share NO node at all. A signal flow graph with three loops where any two share a node contributes no second-order term to Delta from that pair, but a pair that shares nothing does — stopping at the single-loop-gain sum in Delta, without checking every pair for a shared node, is the standard arithmetic error when applying Mason's formula to anything beyond the simplest graphs.

2. Transient and steady-state analysis of LTI systems

A standard second-order system's step response is read off two numbers: damping ratio zeta and natural frequency omega_n. Percentage overshoot depends on zeta alone; settling time depends on zeta*omega_n alone (the real part of the poles); rise time depends mainly on omega_n. The system is underdamped for 0 < zeta < 1 (oscillatory decay, the practically common case), critically damped at zeta = 1 (fastest response with no overshoot) and overdamped for zeta > 1 (slower still, no oscillation).

Steady-state error by system type and input
System type (poles at origin)Step inputRamp inputParabolic input
Type 0finite, 1/(1+Kp)infiniteinfinite
Type 1zerofinite, 1/Kvinfinite
Type 2zerozerofinite, 1/Ka
🎯 One integrator per system type erases one polynomial order of error
Each pole the open-loop gain carries at the origin is one free integration, and an integrator's whole job is to drive its input (the error) to zero in steady state against a constant demand. A Type 1 system already integrates once, enough to erase a constant (step) error but not a linearly growing (ramp) one; it takes a second integration, Type 2, to erase that ramp error too — and a Type 2 system still fails against an accelerating (parabolic) input, needing a third integration it does not have.

3. Routh-Hurwitz, Nyquist, Bode plots and root locus

  • Routh-Hurwitz works on the closed-loop characteristic equation's coefficients alone — no plot needed — and a sign change in the first column of the Routh array signals one right-half-plane pole for each change; a row of all zeros signals a pair of symmetric roots (on the imaginary axis or symmetric about the origin) and is handled with the auxiliary polynomial.
  • The Nyquist criterion counts encirclements of the point (-1, 0) by the open-loop frequency response as frequency sweeps the whole imaginary axis, and relates that count to closed-loop right-half-plane poles through the KNOWN number of open-loop right-half-plane poles — the one method that still certifies stability correctly even when the open loop is itself unstable.
  • A Bode plot reads stability off gain margin (how much gain can rise before instability, at the phase-crossover frequency) and phase margin (how much extra phase lag can be absorbed at the gain-crossover frequency) — both must be positive for a stable minimum-phase system, and a larger phase margin generally means a better-damped closed loop.

The root locus is a fourth view of the same question: it traces every closed-loop pole location as one gain parameter K varies from zero (where poles start at the open-loop poles) to infinity (where they end at the open-loop zeros, or at infinity along asymptotes if zeros are fewer than poles) — a design that must keep zeta above some floor or settling time below some ceiling is read directly as a region the locus must pass through, with no frequency sweep and no coefficient array needed.

⚠️ Gain margin in dB is not automatically safe at 0
Gain margin is usually reported in decibels as -20*log10(|G(jw)|) at the phase-crossover frequency (where phase = -180 degrees), and a POSITIVE dB value means stable with room to spare; reading 0 dB as safe rather than as the exact boundary of instability is the standard slip, since 0 dB means the loop gain already equals 1 exactly where the phase margin has run out.

4. Compensators, P/PI/PID controllers and state-space

A lead compensator adds positive phase near the gain-crossover frequency, speeding the transient response and raising phase margin; a lag compensator sacrifices some phase to boost low-frequency gain instead, shrinking steady-state error; a lag-lead compensator does both, in two separate frequency bands, combining the lag section's steady-state benefit with the lead section's transient-speed and margin benefit. A proportional (P) controller alone leaves a residual steady-state offset; adding integral action (PI) erases that offset (raising the system type by one) at some cost to speed and stability margin; adding derivative action too (PID) anticipates the rate of change of error, improving damping and reducing overshoot, at the cost of amplifying high-frequency measurement noise.

State-space writes a system as x-dot = Ax + Bu, y = Cx + Du — a first-order vector differential equation plus an output map, in place of one high-order scalar equation. Its advantage over a single transfer function is exactly the case a transfer function handles poorly: multiple inputs and multiple outputs, and internal behaviour a transfer function can hide entirely (an unstable or uncontrollable mode that happens to cancel against a zero and so vanishes from the input-output transfer function, even though it is still physically present inside the system).

ℹ️ Solving the state equation
The homogeneous solution of x-dot = Ax is x(t) = e^(At) * x(0), where e^(At) is the state transition matrix — the matrix generalisation of the scalar exponential e^(at) that solves a first-order scalar equation, computed via the Laplace transform as the inverse Laplace transform of (sI - A)^(-1). The full solution with input adds a convolution (integral) term carrying B*u(t)'s effect, exactly the way a scalar first-order ODE's forced response is the convolution of its impulse response with the input.

Key takeaways

  • Two loops in a signal flow graph are non-touching only if they share NO node at all; Delta needs every such non-touching product, not just the single-loop-gain sum.
  • Overshoot depends only on zeta; settling time depends only on zeta*omega_n — a Type-N system erases steady-state error up to input order N-1 and no further.
  • Routh-Hurwitz needs only the characteristic polynomial's coefficients; Nyquist alone remains valid when the open loop is itself unstable; Bode needs both gain margin and phase margin positive, and 0 dB gain margin is the boundary, not safety.
  • Lead adds phase near crossover for speed and margin; lag boosts low-frequency gain for steady-state error; PID adds derivative action to PI for anticipation and damping, at the cost of noise sensitivity.
  • State-space extends naturally to multiple inputs/outputs and can expose an internal mode a transfer function hides entirely by pole-zero cancellation; e^(At) is the matrix generalisation of the scalar exponential.

Practice questions (10)

Attempt each one before opening the answer. Every explanation names the tempting wrong option as well as the right one, because that is where marks are lost.

  1. Two loops of a signal flow graph are called non-touching when they

    1. have equal loop gain
    2. share no common node
    3. lie on the same forward path
    4. both pass through the output node
    Show answer

    Answer: B — share no common node

    Non-touching means no shared node, and this exact condition lets Delta pick up a product-of-two-loop-gains term. Equal gain, sharing a forward path or both touching the output are unrelated properties and none determines whether the loops are touching.
  2. A unity-feedback system has open-loop transfer function K/(s(s+2)). Its steady-state error to a unit ramp input is

    1. zero
    2. 2/K
    3. infinite
    4. 1/K
    Show answer

    Answer: B — 2/K

    One pole at the origin makes this Type 1, so the ramp error is finite and equal to 1/Kv, where Kv = lim s*G(s) as s tends to 0 = K/2. So the error is 1/(K/2) = 2/K — answering zero confuses this with a Type 2 system's ramp response.
  3. A second-order system with damping ratio zeta = 1 has a step response that is

    1. oscillatory with decaying amplitude
    2. critically damped, the fastest non-oscillatory response
    3. overdamped and slower than critical damping
    4. undamped, sustained oscillation
    Show answer

    Answer: B — critically damped, the fastest non-oscillatory response

    zeta = 1 is exactly the critically damped case, the fastest response that still has no overshoot; zeta between 0 and 1 is underdamped, zeta greater than 1 is overdamped, and zeta = 0 is undamped.
  4. The Nyquist stability criterion remains valid and useful specifically in the case where

    1. the system has no poles in the right half-plane at all
    2. the open-loop system itself has poles in the right half-plane
    3. only gain margin is required, never phase margin
    4. the system is a pure time delay with no poles at all
    Show answer

    Answer: B — the open-loop system itself has poles in the right half-plane

    The Nyquist criterion relates encirclements of -1 to closed-loop right-half-plane poles through the KNOWN number of open-loop right-half-plane poles, so it remains valid and answers the question even when the open loop is itself unstable, a case ordinary Bode-margin reading does not cleanly handle.
  5. Which of the following are true of gain margin and phase margin?

    1. Both must be positive for a stable minimum-phase closed loop.
    2. 0 dB gain margin means the system is safely stable.
    3. A larger phase margin generally means a better-damped closed loop.
    4. Gain margin is read at the phase-crossover frequency.
    Show answer

    Answer: A — Both must be positive for a stable minimum-phase closed loop.; C — A larger phase margin generally means a better-damped closed loop.; D — Gain margin is read at the phase-crossover frequency.

    Both margins positive is the stability condition for a minimum-phase system, a larger phase margin does correlate with better damping, and gain margin is indeed read at the phase-crossover frequency (where phase = -180 degrees). 0 dB gain margin is the exact boundary of instability, not a safe value.
  6. The root locus of a unity-feedback system plots, as gain K varies from 0 to infinity, the

    1. open-loop zero locations only
    2. closed-loop pole locations
    3. phase margin as a function of frequency
    4. steady-state error as a function of K
    Show answer

    Answer: B — closed-loop pole locations

    The root locus traces where the closed-loop poles sit in the s-plane as K sweeps from zero (starting at the open-loop poles) to infinity (ending at the open-loop zeros or at infinity along asymptotes); it says nothing directly about frequency-response margins or steady-state error.
  7. A lead compensator is added to a control loop chiefly to

    1. boost low-frequency gain and shrink steady-state error
    2. add phase near crossover, speeding response and raising phase margin
    3. attenuate all frequencies equally
    4. replace the need for a PID controller entirely
    Show answer

    Answer: B — add phase near crossover, speeding response and raising phase margin

    A lead compensator's job is to add positive phase in the crossover region, speeding the transient response and increasing phase margin. Boosting low-frequency gain to shrink steady-state error is the LAG compensator's job instead, and a lead-lag combines both in separate bands.
  8. Adding derivative action to a PI controller, making it PID, primarily

    1. removes steady-state error entirely by itself
    2. anticipates the rate of change of error, improving damping, at the cost of noise sensitivity
    3. converts the loop from Type 1 to Type 2
    4. is only usable with a lag compensator present
    Show answer

    Answer: B — anticipates the rate of change of error, improving damping, at the cost of noise sensitivity

    Derivative action acts on the rate of change of error, giving an anticipatory, damping effect that reduces overshoot, at the cost of amplifying high-frequency measurement noise. Integral action, not derivative, is what removes steady-state error and raises system type; PID needs no lag compensator to function.
  9. Compared to a transfer function, the state-space representation's principal advantage is that it

    1. always gives a lower-order model
    2. extends naturally to multiple inputs and outputs and can expose internal states hidden by pole-zero cancellation
    3. eliminates the need for any stability criterion
    4. applies only to single-input, time-invariant systems
    Show answer

    Answer: B — extends naturally to multiple inputs and outputs and can expose internal states hidden by pole-zero cancellation

    State-space handles multiple inputs and outputs naturally and can reveal an internal unstable or unobservable mode that cancels against a zero and so is invisible in the transfer function. It does not shrink model order by itself, does not remove the need to check stability, and is not restricted to single-input systems.
  10. A unity-feedback system has open-loop transfer function K/(s+5). Its Type number (the number of poles of the open loop at the origin) is ___

    Numerical answer — type the value.

    Show answer

    Answer: 0

    K/(s+5) has its only pole at s = -5, not at the origin, so it carries zero poles at the origin — Type 0 — and therefore has a finite (non-zero) steady-state error even to a step input.