Compare steady-state error with P and PI

English translation

Control Engineering I · Week 13

This week's goal · Distinguish the effects of poles from tracking error according to system type.

Run: After signing in to MathWorks, open .mlx in your workspace. Click inside the code → Live Editor → Run Section to run one section at a time. Run runs everything. After changing a value, rerun the relevant section. Edit the text in ⟦enter here⟧ response fields; do not execute them. You can use Ctrl+Enter on Windows/Linux and ⌘+Enter on Mac.

Set the final error before comparing

This exercise defines tracking error as e(t)=r(t)−y(t). P is proportional to the current error, while PI adds a term that accumulates error over time. Next week, we will examine error definitions in non-unity feedback and compare error over the entire response using a performance index. Here, first distinguish step and ramp tracking with unity feedback.

1. Pole locations and transient response

A pole's negative real part relates to the decay rate, and its imaginary part to the oscillation frequency. Models with the same poles can have different response magnitudes or shapes if their numerators differ. Check both the pole locations and the actual response graphs.

Pole locations and transient response

The two models have denominators [1 2 10] and [1 10 100]. The real parts, imaginary parts, and damping ratio all change simultaneously. Do not attribute the observed differences to just one factor.

2. System type is the number of poles at the origin in the loop

In standard unity negative feedback, system type is the number of poles at the origin in the loop transfer function L. If the closed loop is stable, the remaining error when tracking a constant target (step) or a target increasing at a constant rate (ramp) depends on the type.

System type is the number of poles at the origin in the loop

System type is the number of poles at s=0s=0, not the denominator degree. Check for common factors that cancel between numerator and denominator before counting origin poles. If the system is unstable, the standard steady-state error table cannot be applied directly.

3. Connect P and PI to the same plant

Compare G=10.5s+1G=\frac1{0.5s+1}, P=10, and CPI=10+5sC_{\mathrm{PI}}=10+\frac5s. P leaves a step error; PI drives the step error to 0 when stable. For a ramp, PI generally also leaves a constant error.

Connect P and PI to the same plant

An integrator responds to accumulated error. Saturation and integral windup in real systems are not included in this linear example. Keep the assumptions behind the observed performance in mind.

4. Finite-time error and limiting values

With the PI controller in this example, part of the error decreases slowly, so the final value may not be reached even at 5 seconds. Extend the observation time and check whether the error stops changing. Calculate the theoretical unit-step error as 1−dcgain(T) and the theoretical unit-ramp error as 1Kv\frac1{K_v}, and compare them with the plots.

Finite-time error and limiting values

The plant DC gain K in this exercise is 1. When changing KpK_p to 20, calculate the theoretical unit-step error 1/(1+KpK_p×K). Rebuild the model when rerunning so that the changed controller takes effect.

Check your understanding

  1. What values should go into the code, and what does each row and column of the resulting array represent? If calculating physical quantities, have you also checked the units?
  2. Can you identify which parts to rerun when you change one condition?
  3. Do the results match your expectations? If they differ, can you explain why using the output values or plots?

Official MATLAB documentation · Control System Toolbox

Practice materials