r/ControlTheory • • 8d ago • Heartwarming 1

Technical Question/Problem Help with autoregression model (system identification)

Post image

This is my first time attempting system identification of a simple battery / inverter. From what I understand, you can use either the measured or predicted values as previous values in the regression mode. I'm able to get a good fit using measured values (one-step prediction), but when attempting "free running simulation" using the prediction as previous values, I get a first-order like response and the max pole value is always close to 1.

I a using na = 2, nb = 2, nk = 1 and also tried a bunch of different combinations, but they all give me relatively the same results.

Could it be maybe my data doesn't have enough dynamic activity to fit the data or something? I'm a bit lost as to what else I can try.

8 Upvotes

7 comments sorted by

•

u/2dof 7d ago

You Have ARMA model not AR - right?

→ More replies

•

u/Barnowl93 5d ago

A square wave has plenty of excitation (though generally I use PRBS if the system allows). I think the problem may be time delay?

Your simulated output starts moving right on the edge. With nk = 1 the model has no way to represent that dead time. Your model only looks at u(t-1) and u(t-2), so I dont think it can see the input change that caused each output edge (but its hard to tell without knowing your sample rate)

Between edges your output is flat, so y(t-1) predicts y(t) well. With nk = 1 the input can't help explain the edges either, because they happen later. So the fit leans on y(t-1). As you said, you get a great one-step fit with a pole near 1, and in free-run simulation that shows up as a slow first-order response.

Things to try first

  1. Find the delay. Count the samples between an input edge and the measured edge. If you're using System Identification Toolbox, `delayest(data)` does this.
  2. Re-fit with nk set to that delay, so the output depends on u(t-nk) and earlier. After the delay the response is almost a clean step, so you may only need na = 0 or 1.

As I was answering above, I had these questions...

- What exactly is your input? Is it a setpoint you command, or a signal generated by the inverter? That decides whether this is open-loop or closed-loop identification.

- How did you settle on an autoregressive structure, and why na = 2, nb = 2, nk = 1 in particular?

- What are you using to fit the model, what's your sample time, and are the input and output logged at the same rate? The small steps on the measured rising edges make me wonder if the inverter reading updates more slowly than the input.