System Identification

I have some real life data that I collected, and I have a signal that is essentially a step impulse (with a step impulse response).

​

I've been looking at figuring out how to identify the system and there are two things I don't understand (or not sure of).

The data in question is here: Image of data

​

  1. How can you tell if the system is 1st or 2nd order?
    I'm assuming you can't tell the difference between a 1st order and a over damped 2nd order system (and it doesn't matter how you model it), but if the step response contains oscillations, then you know it is 2nd order. Is this logic correct?
  2. Assuming I can model it as a 1st order system, why would I choose 63% of the steady state value to be the time constant? The number 63% seems arbitrary.
    Initially, I tried to model it as a 2nd order system according to the "System Identification using the Step Response: System with two real poles" on the step response Wikipedia page, but the result gave me an unstable system, which is not what I have here. In contrast, Wikipedia says that the time constant at 25% and 75% are the relevant numbers. Were these just randomly chosen?

Posted Jun 14, 2019, 9:31 PM UTC

1113
sentry5588•

For Q2, 63% isn't randomly chosen. It has a very rich meaning.

Mathematically, it's 1-1/e. It comes from the solution of the 1st order ordinary differential equation, which can be found by the inverse Laplace transform of the identified transfer function (identified model).

Practically, this time constant (Tau) can conviniently determine when the system reaches the +/-5% band (3 Tau) and +/-2% band (4 Tau) of the steady state.

Edit: corrected question #.

12
TechRepSirOP•

Thank you. This is exactly what I was looking for.

1
sentry5588•

glad it helped

1
N1M0N1M•

A1) You are correct, you can't tell. Real life systems are usually nonlinear, time-variant, and of higher order, so there's no way to know for sure the order of the system. But it doesn't matter since we're just choosing a model to fit our data. Looking at your data, I think you could fit it to a FOPDT (first order plus dead time) model. A second order system does not necessarily have to have oscillations. If the poles are both on the real axis, you will observe no oscillations in the step response.

A2) As someone already pointed out, 63% is not arbitrary but in fact comes from the very definition of the time constant: the time constant is the time it takes for the system output to reach 63% of it's final steady state value.

6
nickeltoes•

A way to differentiate an over damped second order from a first order is the slope at t=0. The latter has a positive slope while a second order is flat

3
[deleted]•

Depending on how in depth you want to go there is a book called "Robust Adaptive Control" that is essentially a Bible on adaptive/system ID techniques.

There are a few methods that are viable. I like recursive least squares approaches because they are mathematically intuitive, flexible, and dont require something called the "persistent excitation" condition to be satisfied to ensure convergence.

https://en.wikipedia.org/wiki/Recursive_least_squares_filter

2
sentry5588•

Just to add some comments, since OP already has offline data, so recursive least square isn't necessary. Least square should be fine. Essentially it's the same. This method should solve Q#2.

In addition, in order to use (recursive) least square, a model structure (eg system order) shall be firstly determined. Then least square can choose a best system parameters. But least square cannot help choosing the system structure (1st or 2nd order).

6
[deleted]•

Yes, if you can write the system in the form of (x-ub), where b is an unknown vector and u is the excitation signals, then this will work.

1
nickeltoes•

Have you ever tried a least square on noisy data? Very hard to converge to a solution that is Hurwitz.

1
leovailati•

It probably doesn't matter in this case, but one important difference between first order systems and real-pole second order systems is that the step response of second order systems have smooth time derivatives, unlike first order systems which produce "sharp corners" when a step is applied. That difference is easily proven with the initial value theorem.

Another thing that may be important to note is that the 63% rule should be applied based on when the response approaches 63% of the total variation, not final value. That is, subtract the initial value (before input applied) from the final value and compute based on 63% of that.

2
fibonatic•

Why is there a setpoint in your data plot? Shouldn't it be an open loop measurement, so no reference setpoint. Also are the stars the only actual data, because they do not seem to be evenly spaced in time, otherwise you could have calculated a frequency response function using a fast Fourier transform. Unevenly spaced data might also make fitting a model more complicated.

For Q1 indeed when you see an oscillation in the impulse response the system has to be at least of order two or higher (requires complex conjugate poles). However 2nd or higher order systems do not have to oscillate if it is over critically damped. But if this is indeed an impulse response then your system should at least be 2nd order, namely an integrator (otherwise you can't get a nonzero steady state value) and normal pole.

1
TechRepSirOP•

The setpoint is a misnomer. It's rather just another input.

I have cascading PIDs I'm treating a certain subset as "the open loop".

In this context, it should be called input, not setpoint.

1
Mancheee•

You would not necessarily see oscillations even if the system is second order if it is critically damped or overdamped. I dont know how you would do system id on that though, you could try modeling it and using least squares/ non linear least squares to estimate system parameters, but that would take a lot of work to figure out how to do if you dont get that already. MY knowledge is limited there.

Differential equations have solutions that are often times involving exponential functions, 'e^(-alpha*time). when the exponent reaches one, the value is diminished by 63%. So thats where it comes from. It is arbitrary, but it gives you clues about your system by telling you the decay rate.

1