Chapter 19: Lead, Lag, and Lead–Lag Compensation
Lesson 5: Design Examples for Motion and Process-Type Systems
This lesson applies lead, lag, and lead–lag compensators to two important classes of single-input single-output (SISO) systems: motion-type servo systems (e.g., robot joints, drives) and process-type systems (e.g., thermal, level, concentration). We formulate time- and frequency-domain specifications, derive compensator parameters analytically, and implement the resulting controllers in Python, C++, Java, MATLAB/Simulink, and Wolfram Mathematica using libraries commonly encountered in robotics software stacks.
1. Motion vs Process Systems and Design Objectives
In classical SISO control, a motion-type system typically represents the dynamics of a mechanical coordinate such as a robot joint angle or linear axis position. A simple linearized model for a position servo driven by a motor often has at least one pure integrator due to kinematics:
\[ G_m(s) \approx \frac{K_m}{s(T_m s + 1)}, \quad K_m > 0,\; T_m > 0. \]
In contrast, a process-type system (thermal, fluid, chemical, etc.) is frequently modeled, near an operating point, as a first-order or low-order lag:
\[ G_p(s) \approx \frac{K_p}{T_p s + 1} \quad \text{or} \quad G_p(s) \approx \frac{K_p}{(T_p s + 1)^n}, \quad K_p > 0,\; T_p > 0. \]
With a compensator \( C(s) \) and unity feedback, the closed-loop transfer function is
\[ T(s) = \frac{C(s)G(s)}{1 + C(s)G(s)}, \quad L(s) = C(s)G(s) \text{ (loop transfer function)}. \]
For motion systems, the main design objectives are:
- Transient response: rise time \( t_r \), settling time \( t_s \), overshoot \( M_p \).
- Frequency-domain robustness: bandwidth and phase margin.
- Tracking of reference motion with small steady-state error.
For process systems, typical objectives emphasize:
- Small steady-state error to step or ramp commands.
- Strong low-frequency disturbance rejection.
- Moderate speed of response without excessive overshoot or oscillation.
Lead compensators are predominantly used to improve phase margin and speed of response, while lag compensators are used to increase low-frequency gain (reduce steady-state error) with minimal change to crossover frequency. Lead–lag combinations allow both objectives to be met simultaneously.
flowchart TD
A["Start from physical model G(s)"] --> B["Classify: motion-type or process-type"]
B --> M["Motion-type: integrator plus lag, \ne.g. servo axis"]
B --> P["Process-type: pure lag \nor weak integrator"]
M --> Mspec["Specs: tr, ts, Mp, \nbandwidth, margins"]
P --> Pspec["Specs: steady-state error, \ndisturbance rejection"]
Mspec --> Mctrl["Choose lead or lead-lag \nto add phase and speed up response"]
Pspec --> Pctrl["Choose lag or lead-lag \nto boost low-frequency gain"]
Mctrl --> V1["Check Bode, margins, \nand time response"]
Pctrl --> V2["Check steady-state error \nand disturbance rejection"]
2. Motion Example – Position Servo with Lead Compensation
Consider a normalized position servo with plant
\[ G_m(s) = \frac{1}{s(s + 1)}. \]
This is a simplified model of a DC-motor-driven load with viscous friction (unit inertia and unit time constant). We assume unity feedback and a compensator \( C(s) \). The uncompensated closed-loop dynamics with proportional control have limited phase margin and relatively slow response.
We specify:
- Approximately second-order dominant behavior with damping ratio \( \zeta \approx 0.5 \) (overshoot \( M_p \approx 16\% \)).
- Settling time (2% criterion) \( t_s \lesssim 4 \,\text{s} \).
- Phase margin target around \( 50^\circ \).
For a standard second-order approximation,
\[ G_{2}(s) = \frac{\omega_n^2}{s^2 + 2 \zeta \omega_n s + \omega_n^2}, \]
the settling time is approximately
\[ t_s \approx \frac{4}{\zeta \omega_n}. \]
With \( \zeta = 0.5 \) and target \( t_s \approx 4\,\text{s} \), we obtain \( \omega_n \approx 2 \,\text{rad/s} \), which we use as a desired crossover frequency \( \omega_c \approx 2 \,\text{rad/s} \) for the loop \( L(s) = C(s) G_m(s) \).
The magnitude and phase of the uncompensated plant at frequency \( \omega \) are
\[ |G_m(\mathrm{j}\omega)| = \frac{1}{\omega \sqrt{1 + \omega^2}}, \quad \angle G_m(\mathrm{j}\omega) = -90^\circ - \tan^{-1}(\omega). \]
At \( \omega = 2 \,\text{rad/s} \) we have
\[ |G_m(\mathrm{j}2)| = \frac{1}{2\sqrt{5}}, \quad \angle G_m(\mathrm{j}2) = -90^\circ - \tan^{-1}(2) \approx -153.4^\circ. \]
The corresponding phase margin with unity loop gain at this frequency is
\[ \text{PM}_\text{uncomp} \approx 180^\circ + \angle G_m(\mathrm{j}2) \approx 26.6^\circ, \]
which is insufficient. We therefore introduce a lead compensator to add approximately \( 30^\circ \) of phase near \( \omega_c \approx 2 \,\text{rad/s} \).
3. Analytical Design of the Lead Compensator
We use the standard lead form
\[ C_\text{lead}(s) = K_c \frac{T s + 1}{\alpha T s + 1}, \quad 0 < \alpha < 1. \]
The phase contributed by the lead network at frequency \( \omega \) is
\[ \phi_\text{lead}(\omega) = \tan^{-1}(\omega T) - \tan^{-1}(\alpha \omega T). \]
The maximum of this phase lead occurs at \( \omega = \omega_m = \frac{1}{T\sqrt{\alpha}} \), with value
\[ \phi_{\max} = \tan^{-1}\!\left(\frac{\sqrt{1-\alpha}}{\sqrt{\alpha}}\right) - \tan^{-1}\!\left(\sqrt{\alpha(1-\alpha)}\right) = \sin^{-1}\!\left(\frac{1 - \alpha}{1 + \alpha}\right). \]
We target \( \phi_{\max} \approx 30^\circ \), which leads to
\[ \sin(30^\circ) = \frac{1}{2} = \frac{1 - \alpha}{1 + \alpha} \quad \Rightarrow \quad \alpha = \frac{1 - \tfrac{1}{2}}{1 + \tfrac{1}{2}} = \frac{1}{3}. \]
To place the maximum phase lead at the desired crossover frequency \( \omega_c = 2 \,\text{rad/s} \), we choose
\[ \omega_c = \omega_m = \frac{1}{T\sqrt{\alpha}} \quad \Rightarrow \quad T = \frac{1}{\omega_c \sqrt{\alpha}} = \frac{1}{2 \sqrt{1/3}} = \frac{\sqrt{3}}{2}. \]
The compensator thus has zero and pole at \( s = -1/T \) and \( s = -1/(\alpha T) \):
\[ z_c = -\frac{1}{T} = -\frac{2}{\sqrt{3}} \approx -1.155, \quad p_c = -\frac{1}{\alpha T} = -\frac{2}{\sqrt{3}} \cdot \frac{1}{\alpha} \approx -3.464. \]
The remaining parameter \( K_c \) is chosen to satisfy the magnitude condition at \( \omega_c \): \( |L(\mathrm{j}\omega_c)| = 1 \), i.e.,
\[ |C_\text{lead}(\mathrm{j}\omega_c)| \, |G_m(\mathrm{j}\omega_c)| = 1. \]
With \( T = \sqrt{3}/2 \) and \( \alpha = 1/3 \), the lead network magnitude at \( \omega_c \) (without the gain \( K_c \)) is
\[ |C_\text{lead,0}(\mathrm{j}\omega_c)| = \frac{\sqrt{1 + (\omega_c T)^2}}{\sqrt{1 + (\alpha \omega_c T)^2}} = \frac{\sqrt{1 + 1/\alpha}}{\sqrt{1 + \alpha}} = \frac{\sqrt{1 + 3}}{\sqrt{1 + 1/3}} = \frac{2}{\sqrt{4/3}} = \sqrt{3}. \]
The plant magnitude at \( \omega_c = 2 \) is \( |G_m(\mathrm{j}2)| = 1/(2\sqrt{5}) \), so
\[ |L(\mathrm{j}2)| = K_c \, |C_\text{lead,0}(\mathrm{j}2)| \, |G_m(\mathrm{j}2)| = K_c \, \sqrt{3} \, \frac{1}{2\sqrt{5}}. \]
Enforcing \( |L(\mathrm{j}2)| = 1 \) yields
\[ K_c = \frac{2\sqrt{5}}{\sqrt{3}} \approx 2.58. \]
The resulting compensator is
\[ C_\text{lead}(s) = 2.58 \,\frac{\tfrac{\sqrt{3}}{2}s + 1}{\tfrac{\sqrt{3}}{6}s + 1} = 2.58 \,\frac{0.866 s + 1}{0.289 s + 1}. \]
When combined with \( G_m(s) \), this lead network increases phase margin toward the desired value and speeds up the closed-loop response while preserving the type and steady-state accuracy properties of the original servo.
4. Process Example – Lag Compensation for a First-Order Plant
Consider a simple process-type plant,
\[ G_p(s) = \frac{2}{5 s + 1}, \]
representing, for example, a thermal or level process with gain \( K_p = 2 \) and time constant \( T_p = 5\,\text{s} \). We use unity feedback with controller \( C(s) \).
For a type 0 system (no pure integrator in the loop), the steady-state error to a unit step \( r(t) = 1 \) is
\[ e_{\text{ss}} = \frac{1}{1 + K_p^{\text{ol}}}, \quad K_p^{\text{ol}} = \lim_{s \to 0} L(s) = \lim_{s \to 0} C(s) G_p(s), \]
where \( L(s) = C(s) G_p(s) \) is the loop transfer function. We impose
\[ e_{\text{ss}} \le 0.02 \quad \Rightarrow \quad \frac{1}{1 + K_p^{\text{ol}}} \le 0.02 \quad \Rightarrow \quad K_p^{\text{ol}} \ge 49. \]
Using only proportional control \( C(s) = K_c \), we would need \( K_c K_p \ge 49 \), i.e., \( K_c \ge 24.5 \), which may lead to unacceptably small phase margin, especially if unmodeled time delays are present. Instead, we use a lag compensator:
\[ C_\text{lag}(s) = K_c \frac{T_{\ell} s + 1}{\beta T_{\ell} s + 1}, \quad \beta > 1. \]
The DC gain of the lag network is \( C_\text{lag}(0) = K_c \), while its high-frequency gain tends to \( K_c / \beta \). If the zero and pole are placed sufficiently below the crossover frequency, the lag network:
- Increases low-frequency loop gain by factor \( K_c K_p \) to reduce \( e_{\text{ss}} \).
- Keeps the crossover frequency and phase margin close to that of a loop with effective gain \( K_c / \beta \) at higher frequency.
We proceed in three steps:
- Choose \( K_c \) to satisfy the steady-state error constraint.
- Choose desired crossover frequency \( \omega_c \) and compute \( \beta \) so that the high-frequency gain is consistent with this \( \omega_c \).
- Place the lag zero and pole well below \( \omega_c \) by selecting \( T_{\ell} \).
First, choose \( K_c = 24.5 \) so that \( K_p^{\text{ol}} = K_c K_p = 49 \). Suppose we desire \( \omega_c \approx 0.4 \,\text{rad/s} \). The magnitude of the plant at this frequency is
\[ |G_p(\mathrm{j}\omega_c)| = \frac{K_p}{\sqrt{1 + (\omega_c T_p)^2}} = \frac{2}{\sqrt{1 + (0.4 \cdot 5)^2}} = \frac{2}{\sqrt{1 + 4^2}} = \frac{2}{\sqrt{17}}. \]
At frequencies near \( \omega_c \), the lag network behaves approximately as a constant gain \( K_c / \beta \) if its zero and pole lie well below \( \omega_c \). Thus we approximate
\[ |L(\mathrm{j}\omega_c)| \approx \frac{K_c}{\beta} |G_p(\mathrm{j}\omega_c)| = \frac{K_c K_p}{\beta \sqrt{1 + (\omega_c T_p)^2}}. \]
Enforcing \( |L(\mathrm{j}\omega_c)| \approx 1 \) gives
\[ \beta \approx \frac{K_c K_p}{\sqrt{1 + (\omega_c T_p)^2}} = \frac{49}{\sqrt{17}} \approx 22. \]
With \( \beta \approx 22 \), we choose \( T_{\ell} \) so that the lag zero and pole frequencies are well below \( \omega_c \). A typical choice is
\[ \omega_z = \frac{1}{T_{\ell}} \approx \frac{\omega_c}{10}, \quad \omega_p = \frac{1}{\beta T_{\ell}} = \frac{\omega_z}{\beta} \approx \frac{\omega_c}{10\beta}. \]
With \( \omega_c = 0.4 \), set \( T_{\ell} = 10/\omega_c = 25 \), giving
\[ \omega_z = \frac{1}{25} = 0.04 \,\text{rad/s}, \quad \omega_p = \frac{1}{22 \cdot 25} \approx 0.0018 \,\text{rad/s}. \]
The lag controller then reads
\[ C_\text{lag}(s) = 24.5 \,\frac{25 s + 1}{22 \cdot 25 s + 1} = 24.5 \,\frac{25 s + 1}{550 s + 1}. \]
This design:
- Meets the step steady-state error requirement via \( K_c K_p = 49 \).
- Keeps the crossover frequency near \( 0.4 \,\text{rad/s} \) with phase margin determined mainly by the plant.
- Introduces only modest additional phase lag because the lag pole-zero pair lies well below the crossover frequency.
5. Lead–Lag Compensation for Combined Specifications
In many applications, particularly in robotics and servo drive systems, we need both:
- Fast, well-damped transient response (motion-type objective), and
- Very small steady-state error and strong disturbance rejection (process-type objective).
A natural solution is to combine a lead and a lag network:
\[ C(s) = C_\text{lead}(s) C_\text{lag}(s) = K_c \frac{T_1 s + 1}{\alpha T_1 s + 1} \frac{T_2 s + 1}{\beta T_2 s + 1}, \quad 0 < \alpha < 1,\; \beta > 1. \]
The design steps are conceptually:
- Use \( C_\text{lead} \) to shape the phase and crossover frequency according to motion-type specifications (as in Sections 2–3).
-
Add \( C_\text{lag} \) with pole-zero frequencies
sufficiently below the crossover so that:
- DC gain is increased to meet steady-state error constraints.
- Crossover frequency and phase margin are only mildly affected.
- Re-check the resulting Bode plot and time response, and iterate if necessary.
Analytically, the lead part dominates the phase around \( \omega_c \), while the lag part primarily changes the low-frequency slope of the magnitude. Because all networks are linear and time invariant, the final closed-loop characteristic polynomial follows from the denominator of \( 1 + C(s) G(s) \), and its roots can be approximated by the dominant complex-conjugate pair associated with the chosen crossover frequency and phase margin.
6. Python and MATLAB/Simulink Implementation for the Motion Example
We now implement the motion-type design of Sections 2–3 using
python-control, a standard linear control library often
used together with robotics packages such as
roboticstoolbox-python for joint and end-effector loop
design.
import numpy as np
import matplotlib.pyplot as plt
# python-control library (commonly used in robotics and mechatronics)
# pip install control
import control as ctrl
# Plant: G_m(s) = 1 / (s (s + 1))
s = ctrl.TransferFunction.s
Gm = 1 / (s * (s + 1))
# Lead compensator parameters from Sections 2-3
alpha = 1.0 / 3.0
T = np.sqrt(3.0) / 2.0
Kc = 2.58 # numerical approximation
Cle = Kc * (T * s + 1) / (alpha * T * s + 1)
# Loop and closed-loop transfer functions
L = Cle * Gm
Tcl = ctrl.feedback(L, 1) # unity feedback
# Time-domain response (step in position reference)
t, y = ctrl.step_response(Tcl)
plt.figure()
plt.plot(t, y)
plt.xlabel("Time [s]")
plt.ylabel("Position response")
plt.title("Lead-compensated position servo (Python)")
plt.grid(True)
# Bode plot of loop transfer function
plt.figure()
mag, phase, omega = ctrl.bode(L, dB=True, Hz=False, omega_limits=(0.1, 100), omega_num=500)
plt.suptitle("Loop Bode plot with lead compensation")
plt.show()
In a robotics context, this transfer-function model can be derived from the linearized joint dynamics of a manipulator. The same controller can be implemented in real time using a robotics middleware (e.g., ROS) by discretizing the compensator.
In MATLAB/Simulink, we can implement the same design using the Control System Toolbox. The following script constructs the compensator and plant in transfer-function form and visualizes their response:
% MATLAB implementation of lead-compensated motion servo
s = tf('s');
Gm = 1 / (s * (s + 1));
alpha = 1/3;
T = sqrt(3) / 2;
Kc = 2.58;
Cle = Kc * (T * s + 1) / (alpha * T * s + 1);
L = Cle * Gm;
Tcl = feedback(L, 1); % unity feedback
figure;
step(Tcl);
grid on;
title('Lead-compensated position servo (MATLAB)');
figure;
margin(L); % Bode and margins
grid on;
% Simulink implementation:
% 1. Create a new model.
% 2. Place blocks: Step, Sum, Transfer Fcn (for Gm), Transfer Fcn (for Cle),
% and Scope.
% 3. Set the plant transfer function numerator and denominator to [1]
% and [1 1 0] corresponding to 1 / (s (s + 1)).
% 4. Set the lead compensator numerator to [Kc*T Kc] and denominator to [alpha*T 1].
% 5. Run the simulation and compare the step response with the MATLAB plot.
In Simulink-based robot models, this compensator block can be inserted into a joint servo loop, allowing co-simulation with multibody dynamics.
7. C++, Java, and Mathematica Implementation for the Process Example
For the process-type plant, we implement the lag controller in a simple
numerical simulation loop. Such loops underlie many real-time control
implementations in C++ (e.g., ROS control frameworks using
Eigen for linear algebra) and in Java (e.g., FRC robotics
using WPILib).
The plant ODE for \( G_p(s) = 2/(5 s + 1) \) is
\[ \dot{x}(t) = -\frac{1}{T_p} x(t) + \frac{K_p}{T_p} u(t), \quad y(t) = x(t), \]
with \( T_p = 5 \), \( K_p = 2 \). For the lag controller
\[ C_\text{lag}(s) = K_c \frac{T_{\ell} s + 1}{\beta T_{\ell} s + 1}, \]
a convenient realization without explicit derivatives is obtained by introducing a state \( w(t) \) with dynamics
\[ \beta T_{\ell} \dot{w}(t) + w(t) = e(t), \quad e(t) = r(t) - y(t), \]
and setting the control law
\[ u(t) = K_c\left(\left(1 - \frac{1}{\beta}\right) w(t) + \frac{1}{\beta} e(t)\right). \]
This realization is algebraically equivalent to \( C_\text{lag}(s) \).
7.1. C++ Numerical Simulation (Euler Method)
#include <iostream>
#include <vector>
// Simple Euler simulation of process with lag controller.
// This style is typical in low-level robotics controllers implemented in C++
// (for example inside a ROS control loop) where the continuous-time design
// is discretized with a fixed time step.
int main() {
const double Kp = 2.0;
const double Tp = 5.0;
const double Kc = 24.5;
const double beta = 22.0;
const double Tl = 25.0;
const double h = 0.01; // simulation step (s)
const double t_end = 50.0; // total simulation time (s)
const double r = 1.0; // unit step reference
double x = 0.0; // process state
double w = 0.0; // lag filter state
double y = 0.0; // process output
double e = 0.0; // tracking error
double u = 0.0; // control input
std::size_t steps = static_cast<std::size_t>(t_end / h);
for (std::size_t k = 0; k < steps; ++k) {
double t = k * h;
y = x;
e = r - y;
// Lag filter: beta * Tl * dw/dt + w = e
double dw = (e - w) / (beta * Tl);
w += h * dw;
// Control law: u = Kc * ((1 - 1/beta) * w + (1/beta) * e)
u = Kc * ((1.0 - 1.0 / beta) * w + (1.0 / beta) * e);
// Process dynamics: dx/dt = -(1/Tp) * x + (Kp/Tp) * u
double dx = -(1.0 / Tp) * x + (Kp / Tp) * u;
x += h * dx;
if (k % 100 == 0) {
std::cout << t << " " << y << std::endl;
}
}
return 0;
}
7.2. Java Numerical Simulation
public class LagControlledProcess {
// In robotics (e.g., FRC with WPILib), similar loops are executed
// periodically in the main robot control thread.
public static void main(String[] args) {
double Kp = 2.0;
double Tp = 5.0;
double Kc = 24.5;
double beta = 22.0;
double Tl = 25.0;
double h = 0.01;
double tEnd = 50.0;
double r = 1.0;
double x = 0.0; // process state
double w = 0.0; // lag filter state
double y;
double e;
double u;
int steps = (int) (tEnd / h);
for (int k = 0; k < steps; ++k) {
double t = k * h;
y = x;
e = r - y;
// Lag filter ODE: beta * Tl * dw/dt + w = e
double dw = (e - w) / (beta * Tl);
w += h * dw;
// Control law
u = Kc * ((1.0 - 1.0 / beta) * w + (1.0 / beta) * e);
// Process dynamics
double dx = -(1.0 / Tp) * x + (Kp / Tp) * u;
x += h * dx;
if (k % 100 == 0) {
System.out.println(t + " " + y);
}
}
}
}
7.3. Wolfram Mathematica Implementation
Mathematica has built-in support for transfer functions and time
responses. The following code constructs both the motion and process
examples using
TransferFunctionModel, which is widely used in symbolic
analysis of robot joint and process dynamics.
(* Motion-type system with lead compensation *)
s = LaplaceTransformVariable;
Gm = TransferFunctionModel[1/(s (s + 1)), s];
alpha = 1/3;
Tlead = Sqrt[3]/2;
Kc = 2.58;
Cle = TransferFunctionModel[
Kc (Tlead s + 1)/(alpha Tlead s + 1),
s
];
Lmotion = Series[Cle["Function"]*Gm["Function"], {s, Infinity, 0}];
TclMotion = SystemsModelFeedbackConnect[Cle*Gm, 1];
BodePlot[Cle*Gm, {0.1, 100},
PlotLayout -> "MagnitudePhase",
FrameLabel -> {"Frequency (rad/s)", "Magnitude / Phase"},
PlotLegends -> {"Loop L(s)"}
];
StepResponsePlot[TclMotion, {0, 10},
FrameLabel -> {"Time (s)", "Position"},
PlotLabel -> "Lead-compensated motion servo"
];
(* Process-type system with lag compensation *)
Gp = TransferFunctionModel[2/(5 s + 1), s];
betaLag = 22;
Tlag = 25;
KcLag = 24.5;
Clag = TransferFunctionModel[
KcLag (Tlag s + 1)/(betaLag Tlag s + 1),
s
];
TclProcess = SystemsModelFeedbackConnect[Clag*Gp, 1];
StepResponsePlot[TclProcess, {0, 100},
FrameLabel -> {"Time (s)", "Output"},
PlotLabel -> "Lag-compensated process"
];
The motion and process models can be extended to multi-axis robotic and multivariable process systems in courses on modern and multivariable control.
8. Problems and Solutions
Problem 1 (Lead design for a motion-type servo): A rotary position servo is approximated by \( G(s) = 1/\bigl(s(s + 4)\bigr) \). Design a lead compensator of the form \( C_\text{lead}(s) = K_c (T s + 1)/(\alpha T s + 1) \), \( 0 < \alpha < 1 \), such that:
- Crossover frequency \( \omega_c \approx 3 \,\text{rad/s} \).
- Phase margin approximately \( 50^\circ \).
Solution:
-
Compute plant phase at \( \omega_c \):
\[ G(\mathrm{j}\omega) = \frac{1}{\mathrm{j}\omega(\mathrm{j}\omega + 4)}, \quad \angle G(\mathrm{j}\omega) = -90^\circ - \tan^{-1}\left(\frac{\omega}{4}\right). \]
At \( \omega_c = 3 \), \( \angle G(\mathrm{j}3) = -90^\circ - \tan^{-1}(3/4) \approx -143.1^\circ \). -
Uncompensated phase margin at \( \omega_c \) is
\[ \text{PM}_\text{uncomp} \approx 180^\circ + \angle G(\mathrm{j}3) \approx 36.9^\circ. \]
To reach \( 50^\circ \), we need approximately \( \phi_{\max} \approx 15^\circ \) of additional phase (plus a few degrees of safety, if desired). -
Choose \( \phi_{\max} = 20^\circ \). Then
\[ \sin(20^\circ) = \frac{1 - \alpha}{1 + \alpha} \quad \Rightarrow \quad \alpha = \frac{1 - \sin(20^\circ)}{1 + \sin(20^\circ)}. \]
Numerically, \( \sin(20^\circ) \approx 0.342 \), so \( \alpha \approx 0.49 \). -
Place the lead maximum at \( \omega_c \):
\[ \omega_c = \frac{1}{T\sqrt{\alpha}} \quad \Rightarrow \quad T = \frac{1}{\omega_c \sqrt{\alpha}}. \]
With \( \omega_c = 3 \), \( \alpha \approx 0.49 \), we obtain \( T \approx 0.48 \). -
Determine \( K_c \) from the magnitude condition
\( |C_\text{lead}(\mathrm{j}\omega_c) G(\mathrm{j}\omega_c)| = 1
\). The plant magnitude at \( \omega_c \) is
\[ |G(\mathrm{j}\omega_c)| = \frac{1}{\omega_c \sqrt{\omega_c^2 + 4^2}}. \]
The lead magnitude (without \( K_c \)) is\[ |C_\text{lead,0}(\mathrm{j}\omega_c)| = \frac{\sqrt{1 + (\omega_c T)^2}}{\sqrt{1 + (\alpha \omega_c T)^2}}. \]
Thus\[ K_c = \frac{1}{|C_\text{lead,0}(\mathrm{j}\omega_c)|\,|G(\mathrm{j}\omega_c)|}. \]
Substituting numeric values yields a suitable gain \( K_c \).
The resulting lead compensator provides the desired crossover frequency and phase margin. Final verification is done via Bode and step-response plots.
Problem 2 (Lag design for process-type system): For \( G_p(s) = 3/(10 s + 1) \), design a lag compensator \( C_\text{lag}(s) = K_c (T_{\ell} s + 1)/(\beta T_{\ell} s + 1) \) such that:
- Step steady-state error \( e_{\text{ss}} \le 0.05 \).
- Crossover frequency near \( 0.2 \,\text{rad/s} \).
Solution:
-
The loop DC gain is
\( K_p^{\text{ol}} = K_c K_p = 3 K_c \). The step
steady-state error requirement
\( e_{\text{ss}} \le 0.05 \) implies
\[ \frac{1}{1 + 3 K_c} \le 0.05 \quad \Rightarrow \quad 1 + 3 K_c \ge 20 \quad \Rightarrow \quad K_c \ge \frac{19}{3} \approx 6.33. \]
Choose, for example, \( K_c = 6.5 \). -
At frequency \( \omega_c = 0.2 \), the plant
magnitude is
\[ |G_p(\mathrm{j}\omega_c)| = \frac{3}{\sqrt{1 + (0.2 \cdot 10)^2}} = \frac{3}{\sqrt{1 + 2^2}} = \frac{3}{\sqrt{5}}. \]
We want \( |L(\mathrm{j}\omega_c)| \approx 1 \), so for the high-frequency behavior \( C_\text{lag}(\mathrm{j}\omega_c) \approx K_c / \beta \) we require\[ \frac{K_c}{\beta} \cdot \frac{3}{\sqrt{5}} \approx 1 \quad \Rightarrow \quad \beta \approx \frac{3 K_c}{\sqrt{5}}. \]
With \( K_c = 6.5 \), we obtain \( \beta \approx 3 \cdot 6.5 / \sqrt{5} \approx 8.7 \). Choose \( \beta = 9 \). -
Place the lag zero and pole below \( \omega_c \), for
example \( \omega_z = 0.02 \,\text{rad/s} \) and
\( \omega_p = \omega_z / \beta \approx 0.0022 \,\text{rad/s}
\). Then
\[ T_{\ell} = \frac{1}{\omega_z} = 50, \quad \beta T_{\ell} = \frac{1}{\omega_p}. \]
The compensator \( C_\text{lag}(s) = 6.5 (50 s + 1)/(450 s + 1) \) achieves the desired steady-state accuracy and approximate crossover frequency. Final adjustment can be made iteratively using Bode and time-domain plots.
Problem 3 (Choosing compensation type): A control engineer is given two plants:
- Plant A: motion-type, \( G_A(s) \approx K_m/(s(T_m s + 1)) \).
- Plant B: process-type, \( G_B(s) \approx K_p/(T_p s + 1) \).
For Plant A, the specification is primarily on rise time and overshoot. For Plant B, the specification is primarily on steady-state error and disturbance rejection. Sketch a design decision flow: which network (lead, lag, or lead–lag) is most appropriate for each plant?
Solution (decision flow):
flowchart TD
S["Start with plant model and specs"] --> A1["Specs emphasize speed and overshoot?"]
A1 -->|yes| M["Motion-type focus"]
A1 -->|no| P1["Specs emphasize steady-state accuracy?"]
P1 -->|yes| P["Process-type focus"]
P1 -->|no| C1["Mixed or ambiguous specs"]
M --> ML["Use lead or lead-lag \n(phase boost, higher crossover)"]
P --> PL["Use lag or lead-lag \n(increase low-frequency gain)"]
C1 --> CL["Consider lead-lag to meet \nboth transient and steady-state specs"]
ML --> V1["Verify margins \nand time response"]
PL --> V2["Verify error constants \nand disturbance rejection"]
CL --> V3["Tune weights between \nlead and lag parts"]
9. Summary
In this lesson we applied lead, lag, and lead–lag compensators to two archetypal system classes in linear control:
- Motion-type systems (e.g., position servos) were improved by lead compensation, which increases phase margin and bandwidth to meet transient performance specifications such as settling time and overshoot.
- Process-type systems (e.g., thermal and level processes) were improved by lag compensation, which enhances low-frequency loop gain to reduce steady-state error while preserving a desirable crossover frequency.
We carried out explicit analytical designs for both plant types, including derivation of lead and lag parameters and loop-gain selection. We then implemented the resulting controllers across several programming environments (Python, C++, Java, MATLAB/Simulink, Mathematica) using numerical ODE simulation and standard control libraries frequently encountered in robotics and mechatronic applications. These examples form a bridge between the theoretical development of lead/lag networks and their concrete implementation in software-controlled physical systems.
10. References
- Bode, H. W. (1940). Relations between attenuation and phase in feedback amplifier design. Bell System Technical Journal, 19(3), 421–454.
- Evans, W. R. (1948). Control system synthesis by root locus method. Transactions of the AIEE, 67, 547–551.
- Nichols, N. B. (1947). The design of linear feedback control systems. Transactions of the AIEE, 66, 933–955.
- Black, H. S. (1934). Stabilized feedback amplifiers. Bell System Technical Journal, 13(1), 1–18.
- Horowitz, I. M. (1963). Synthesis of feedback systems. International Journal of Control, various contributions on loop shaping and sensitivity.
- MacFarlane, A. G. J., & Postlethwaite, I. (1977). The generalized Nyquist stability criterion and multivariable root loci. International Journal of Control, 25(1), 81–127.
- Zames, G. (1966). On the input-output stability of time-varying nonlinear feedback systems. IEEE Transactions on Automatic Control, 11(2), 228–238.
- Doyle, J. C., Francis, B. A., & Tannenbaum, A. R. (1989). Feedback control theory and robust performance. Several foundational papers in IEEE Transactions on Automatic Control.