gergelytakacs/AutomationShield

Identified SS model current offset

xboldocky opened this issue · 2 comments

Hi, I'm facing a problem, where identified State space model of MotoShield fits only to Detrended data. As soon as I compare model to Raw data, the angular velocity fits, but measured current doesn't. See below

Detrended data comparison-->
image

Raw data Comparison-->
image

Kalman Filter Result-->
image

Note: when the initial condition value of current ifltr(1) is subtracted from filtered current, result is spot on-->
image

  • I have tried changing the initial conditions for Identification algorithm without success.
  • Tried adding zero input/output the beginning and at the end of a data.
  • Tried to identify data without detrend - The identified model
    match is far worse/lesser.

The only solution I see is to simply compensate offset by subtracting the filtered value.
Thx.

PS: here is a script and a dataset.
identification_data.zip

Data-model comparison solution: When output offset is compensated by following:

compopt=compareOptions('OutputOffset',[0; -ifltr(1)]);
compare(trenddata,model,compopt)

OUTPUT -->

image

I think that I found out what the problem is...

The A matrix after identification contains zero values, so the initial conditions in kalman filter become irrelevant.

This occurs because system has super fast dynamics (response).

I'm going to try identification with lower sampling period (3 ms).