I am trying to identify a nonlinear system. This system is a differential drive AGV. Somehow the motion equations I found in a paper and the one from Simulinks Mobile Robotics Toolbox don't fit at all to my system. Hence I try to identify my system using step responses.
I have measurements regarding its lateral deviation and its orientation. Since its a differential drive AGV I also have two inputs (RPM right wheel, RPM left wheel).
Somehow, I receive quite okayish accuracy results for my estimation data set but really bad accuracy for my validation data set.
Here is a quick working example of my MATLAB script:
% read measurements from CSV
T = readtable("step response\StepResponse.csv");
y_dev = yDev;
theta = theta;
right = rpmRight;
left = rpmLeft;
% create iddata object
y_est = [y_dev theta];
u_est = [right left];
data_est = iddata(y_est, u_est, 0.008);
% fit model to data
Orders = [[2, 2; 2, 2], ones(2, 2), 0*ones(2, 2)];
NL = [idGaussianProcess, idWaveletNetwork];
sys = nlarx(data_est, Orders, NL);
compare(data_est, sys)
set(findall(gca, 'Type', 'Line'),'LineWidth',4);
grid on
Doing so, I receive an accuracy of 94,77% for the first output channel and 83,61% for the second. I know that this isn't the best accuracy but right now, I don't know how to improve the accuracy.
Then, I compare another measurement series to my model like following:
T = readtable("step response\StepResponse_3.csv");
y_dev = yDev;
theta = theta;
right = rpmRight;
left = rpmLeft;
y_val = [y_dev, theta];
u_val = [right left];
data_val = iddata(y_val, u_val, 0.008);
compare(data_val, sys)
set(findall(gca, 'Type', 'Line'),'LineWidth',4);
grid on
On my validation data set i receive -228.3% accuracy on first output channel and -86.21% accuracy for the second output channel. I expect the system to have a significantly better accuracy on my validation data set.
The estimation data set is monitored for 0 RPM on my right wheel and 410 RPM on my left wheel. The validation data set is created by using 500 RPM on my right wheel and 0 RPM on my left wheel.
Does anyone of you have an Idea why I get so bad validation results whilst estimation works quite okay? What can I do to even increase estimation accuracy?
EDIT: I have to add that I cutted the measurements where my magnetic sensor lost the signal of the magnet stripe. The loss of the signal leads to a steady part in my lateral deviation followed by a negative shift to the first value measured by the sensor. I'm not quite sure but I guess its quite hard to precisely identify this behaviour.