Course materials · Control Engineering II
Programming language

Compensator Design

English translation

Decide whether to adjust lead or lag compensation when speed, damping, and steady-state error must be met together.

The Python option uses python-control. If the module is missing, run %pip install control==0.10.2 in a Colab or Jupyter code cell.

MATLAB · Control System Toolbox

Before practice

01 Can a single gain meet speed, damping, and steady-state-error targets together?

Description

If the conditions conflict, change the root locus or frequency response using compensator poles and zeros.

02 How do the purposes of lead and lag compensation differ?

Description

Lead compensation mainly improves phase margin and transient response; lag compensation mainly improves low-frequency gain and steady-state error. Also examine trade-offs.

Practice

Preview practice notebookDownload practice notebookPreview practice mlx scriptDownload practice mlx script

1. Baseline plant and lead design point

Starting conditions

G(s)=40s(s+2)G(s)=\frac{40}{s(s+2)}. Targets: ζ=.4\zeta=.4, ωn=10\omega_n=10 rad/s.

Procedure

  1. Calculate the real and imaginary parts of the target complex poles and mark them on the root locus.
  2. Choose the lead compensator's zero and pole, calculate its gain using the angle and magnitude conditions at the target point, and write the compensator expression.
  3. Calculate the distance between the selected point and the actual closed-loop pole.

Results to retain

Items to record and points to check
Design item
Target value
Calculated or selected value
Difference

Points to check

  • Did you distinguish pole and zero coordinate signs from compensator coefficient signs?
  • Did you record the approximation error of the gain selected by grid search?

2. Checking design objectives with metrics

Starting conditions

Apply a unit step and unit ramp to baseline G and the compensated model from Activity 1. Use 0~5 s and 0~20 s, respectively.

Procedure

  1. Apply the same unit step and unit ramp to the compensator from Activity 1 and the uncompensated model. Use 0–5 s for the step and 0–20 s for the ramp.
  2. Find step overshoot and settling time. For the ramp, plot e(t)=r(t)−y(t)e(t)=r(t)-y(t), obtained by subtracting the output from r(t)=tr(t)=t. Record the final-sample error for each model.
  3. Find Kv=lim⁡s→0sL(s)K_v=\lim_{s\to0}sL(s) from the loop transfer function to calculate 1/Kv1/K_v, and record its absolute difference from the final ramp error above. Using the table values, explain which aspects of response speed and final error improved or worsened after compensation.

Results to retain

Items to record and points to check
Model
Overshoot [%]
Settling Time [s]
Kv
Late ramp error

Points to check

  • Did you use an interval where the ramp error had become sufficiently constant?
  • Did you compare the compensated and uncompensated systems using the same inputs and metrics?

3. Repeating the design for a different target

Starting conditions

For the same G, change the target to (ζ,ωn)=(.5,8), or follow the procedure in the first ‘Phase-lag compensator using root locus’ section of W12_CompensatorDesign.ipynb (conditions Kv>20K_v>20, ζ=0.4\zeta=0.4, starting code Kv_desired=20) to target Kv=20K_v=20. Choose either option.

Procedure

  1. First state the changed target and the fixed plant.
  2. Create a new compensator and performance table in the same format.
  3. Summarize the metrics achieved and those sacrificed in no more than 5 sentences.

Results to retain

Items to record and points to check
Design
Objective
Compensator expression
Achieved value
Metrics that changed together

Points to check

  • Did you avoid reusing the old compensator as your result after changing the target?
  • Did you also record unmet targets with their actual values?