S9 · Lesson 6 · System identification
Models from data: step tests and the two-point FOPDT fit, second-order fits from overshoot, frequency-response tests, least squares for discrete models, and why the input must excite the plant
Lesson 2 built models from physics: masses, resistances, motor constants. Real plants rarely come with all their numbers. The heater's thermal resistance depends on airflow, the motor's friction on temperature, the process's dead time on pipe lengths nobody measured. So control engineers routinely measure the model instead: kick the plant with a step, a sine or a random signal, record what comes out, and fit a model with the few parameters a controller design needs.
- The solid curve is the step response of a plant ; the dashed one is a first-order-plus-dead-time (FOPDT) model fitted by the two-point method.
- The fit matches the true response where it crosses 28.3% and 63.2%, at 1.85 s and 3.26 s, giving τ = 2.11 s and θ = 1.15 s.
- Elsewhere it's off by up to 0.11 of the step, good enough to tune a PI controller and a reminder that every model is an approximation.
Predict
A step test's output reaches 28.3% of its final change at 1.7 s and 63.2% at 3.0 s after the step. What time constant does the two-point method give?
A first-order response reaches 28.3% at θ + τ/3 and 63.2% at θ + τ, so the two times differ by 2τ/3: τ = 1.5 × (3.0 − 1.7) = 1.95 s, and the dead time is θ = 3.0 − 1.95 = 1.05 s. The two-point method uses the middle of the response, where noise matters least.
Name it
Step tests
Step the input by Δu with the plant at rest and record the output. The gain is the final change over the step, . For a first-order-plus-dead-time model , with and the times to 28.3% and 63.2% of the final change,
A response that overshoots is fitted with a second-order model instead: the overshoot gives ζ (lesson 7's formula), and the period of the ringing gives and .
Model reduction by the half rule
Skogestad's half rule turns a known higher-order model into FOPDT: keep the largest time constant, add half the second largest to it and the other half to the dead time, and add all the smaller ones to the dead time.
Frequency-response tests
Drive the plant with a sine at ω, wait for the transient to die, and measure the output's amplitude ratio and phase. A first-order plant lags by and has gain , so one measured phase gives τ and the gain then gives K. A sweep over frequency gives the whole Bode plot, including resonances a step test would blur.
Least squares for discrete models
Sampled every T, a first-order plant obeys . Stacking the samples into a regression and solving the normal equations
gives the parameters, and from them and .
Excitation
Data identify only what the input excites. A constant input says nothing about dynamics; a slow input says nothing about fast poles. With noise of standard deviation σ, a gain estimated from N samples of an input with mean square P has standard deviation , so bigger, richer inputs and longer records both help.
Worked example
Fit an FOPDT model to the plant by the two-point method, and compare with the half rule.
Show the solution
- Read the two crossings. The step response crosses 28.3% at 1.85 s and 63.2% at 3.26 s.
- Time constant.
- Dead time.
- Half rule. It gives a slower model with more dead time, which tunes a more cautious controller.
- Gain. Both have the same gain, 1.
Answer the two-point fit gives τ = 2.11 s and θ = 1.15 s, and the half rule gives τ = θ = 1.5 s; both have a gain of 1.
Worked example
Sampled every 0.1 s, a plant's data fit . What continuous model does that describe?
Show the solution
- Time constant. The pole a = 0.9 corresponds to , so
- DC gain. At steady state the difference equation reads , so
- The model. Assuming a hold on the input, which is how the data were taken:
Answer the data describe , a gain of 2 with a 0.949 s time constant.
Worked example
A sine test at 2 Hz on a first-order plant measures a gain of 0.5 and a phase of −60°. What are K and τ?
Show the solution
- Time constant from the phase.
- Gain from the magnitude.
- Check the model. A second frequency would check the first-order assumption: if the phase there disagreed with , the plant has more dynamics than one pole.
Answer K = 1.0 and τ = 0.138 s.
Check
A step of 5 in the input changes the output by 10 in the end; it reaches 28.3% of that change 6 s after the step and 63.2% 1.5 s after the 28.3% point.
(a)
What time constant does the two-point method give?
Write units the way you normally would: 1.5 s and 1500 ms are the same answer.
(b)
What dead time?
(c)
What gain?
Check
A least-squares fit of sampled data gives with a sample period of 100 ms.
(a)
What time constant does that describe?
Write units the way you normally would: 1.5 ms, 1500 µs and 0.0015 s are the same answer.
(b)
What DC gain?
Check
A sine test on a first-order plant at 2 Hz measures a phase of −30° and a gain of 4.
(a)
What is τ?
Write units the way you normally would: 1.5 s and 1500 ms are the same answer.
(b)
What is K?
Check
A step test overshoots by 20% and rings with a period of 0.1 s.
(a)
What damping ratio does a second-order fit give?
(b)
What natural frequency?
Write units the way you normally would: 1.5 rad/s and 1500 mrad/s are the same answer.
Check
A plant is reduced to FOPDT by the half rule.
(a)
What time constant results?
Write units the way you normally would: 1.5 s and 1500 ms are the same answer.
(b)
What dead time?
Check
A gain is estimated by least squares from 100 samples of an input with mean square 4, with output noise σ = 0.05.
(a)
What is the estimate's standard deviation?
(b)
How many samples would bring it to 0.003?
Check
A plant's data were logged for an hour while its controller held the setpoint perfectly steady and nothing disturbed it. Why can't a model be fitted from them?
Check
A sampled first-order model with sample period T.
Step 1
What is the time constant?
Type it the way you would write it, like 3sin(2πft) or 3*sin(2*pi*f*t). Angles can be in radians or carry a degree sign, like 45°.
Step 2
What is the DC gain?
Step 3
Where is the continuous pole?
Check
Write fit_arx(u, y): the least-squares a and b in from lists u and y (use pairs k = 0 to N − 2), and two_point(t, y): τ and θ by the two-point method from a sampled step response starting at rest (interpolate the crossing times linearly; take the final value as the last sample).
Python 3.14 with numpy and matplotlib, running in your browser. Tab indents; press Esc and then Tab to move on.
Explain why
Why does identifying a plant require an input that excites it, and what makes a good test signal?
A model describes how the output responds to changes in the input, so the data must contain such changes at the frequencies the model needs to capture. If the input stays constant, every model with the right gain ratio fits the data equally well and the dynamics are invisible. A good test signal is large enough to rise well above the noise but small enough to keep the plant in its linear range, and rich enough in frequency to excite the poles that matter: a step excites low frequencies and the main time constant, while sweeps or random binary sequences reach faster dynamics. Longer records average the noise down, as the square root of the number of samples.
Practice
Keep practicing
9 kinds of problem on this topic, dealt one at a time with new numbers every time, for as long as you like.