S96 of 55
0 XP
  1. Hook
  2. Play
  3. Predict
  4. Name it
  5. Check
  6. Explain

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 1/(s+1)3; 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?

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, K=Δy/Δu. For a first-order-plus-dead-time model Ke−θs/(τs+1), with t28 and t63 the times to 28.3% and 63.2% of the final change,

τ=1.5(t63−t28),θ=t63−τ

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 Td gives ωd=2π/Td and ωn=ωd/1−ζ2.

Model reduction by the half rule

Skogestad's half rule turns a known higher-order model Ke−θ0s/∏(τis+1) 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 K/(τs+1) lags by tan−1⁡ωτ and has gain K/1+ω2τ2, 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 yk+1=ayk+buk. Stacking the samples into a regression and solving the normal equations

(∑yk2∑ykuk∑ykuk∑uk2)(ab)=(∑yk+1yk∑yk+1uk)

gives the parameters, and from them τ=−T/ln⁡a and K=b/(1−a).

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 σ/NP, so bigger, richer inputs and longer records both help.

Worked example

Fit an FOPDT model to the plant 1/(s+1)3 by the two-point method, and compare with the half rule.

Show the solution
  1. Read the two crossings. The step response y(t)=1−e−t(1+t+t2/2) crosses 28.3% at 1.85 s and 63.2% at 3.26 s.
  2. Time constant. τ=1.5×(3.26−1.85)=1.5×1.41=2.11s
  3. Dead time. θ=3.26−2.11=1.15s
  4. Half rule. It gives τ=1+0.5=1.5sθ=0.5+1=1.5s a slower model with more dead time, which tunes a more cautious controller.
  5. 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 yk+1=0.9yk+0.2uk. What continuous model does that describe?

Show the solution
  1. Time constant. The pole a = 0.9 corresponds to e−T/τ, so τ=−0.1sln⁡0.9=0.949s
  2. DC gain. At steady state the difference equation reads y=0.9y+0.2u, so K=0.20.1=2
  3. The model. Assuming a hold on the input, which is how the data were taken: P(s)=20.949s+1

Answer the data describe 2/(0.949s+1), 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
  1. Time constant from the phase. ωτ=tan⁡60°=1.732τ=1.7322π×2=0.138s
  2. Gain from the magnitude. K=0.51+1.7322=0.5×2=1.0
  3. Check the model. A second frequency would check the first-order assumption: if the phase there disagreed with tan−1⁡ωτ, 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 yk+1=0.8yk+0.05uk 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 e−1s/((5s+1)(4s+1)(0.5s+1)) 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 yk+1=ayk+buk 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°.

Check

Write fit_arx(u, y): the least-squares a and b in yk+1=ayk+buk 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?

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.