gergelytakacs / AutomationShield

Arduino library and MATLAB/Simulink API for the AutomationShield Arduino expansion boards for control engineering education.
Other
38 stars 16 forks source link

Identified SS model current offset #318

Open xboldocky opened 2 years ago

xboldocky commented 2 years ago

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

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

xboldocky commented 2 years ago

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

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

OUTPUT -->

image

xboldocky commented 2 years ago

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).