Extended Kalman Filter for IMU

I am trying to use a multilayer perceptron to make a flight controller for a ROV. I have a MPU-9250 IMU and I need to remove the noise from the sensor before I can train my MLP. The IMU has a accelerometer, gyro and a magnetometer. I know my state vector is supposed to be

[acc_x, Acc_y, Acc_z, gyro_x, gyro_y, gyro_z, mag_x, magy, mag_z]


I am not sure about the rest. Since I want the clean Acc, gyro and mag's x, y and z values can I just use an identity matrix for everything in EKF?

I want to pass the IMU data to the MLP after cleaning it and try to predict the control signal for all my thrusters. For my dataset I recoded the IMU information from a ROV2 and I also recorded the pwm signals for each thruster. If it does work I won't be able to control things like PID values of the thrusters but for now I don't really care about it.

• Could you please be more specific with what you're trying to do? You want to use a neural network to do what, exactly? What would the inputs and outputs be? The problem with IMU data generally isn't noise but sensor bias and especially bias drift. You could of course record data and then filter it to remove noise (like the Matlab function filtfilt), but then you're left training a neural network with unrealistic (unobtainable) data. Did you want to use the NN to get from raw IMU output to a pose estimate or are you trying to use the NN to get from a reference error to a control signal? – Chuck Jun 16 '17 at 19:46
• Why do you decide to use EKF? UKF is looks like easy to implement and it's performance usually is better than EKF. – Gluttton Jun 17 '17 at 20:04
• From what I understand about Kalman Filters EKF is better over KF cause it can handle non gaussian distributions and UKF is better when the data is very non linear.So, I thought about using a UKF but then I say that Ardupilot is using a EKF and I figured an EKF is better suited for the problem. – Kalvik Jakkala Jun 17 '17 at 20:09
• @Chuck About the drift I read that by using sensor fusion with a 9dof IMU we can get stable values from an IMU for long periods. So I figured the bias wouldn't be a big issue. – Kalvik Jakkala Jun 18 '17 at 2:26