Kalman Filter Velocity data looking too similar to position data
Mostrar comentarios más antiguos
I'm creating a Kalman filter that intakes Accelerometer and Angular Velocity measurements from Matlab mobil IMU sensors, and filters it, then calculates the position and velocity. My question is on if I am going about calculating the position and velocity wrong, of if this is a good result but it looks strange for some reason?
Here is an abridged look at the sections of code I'm concerned with
dt = 0.1;
% Initial R and V calculation
aRaw = [Accx, Accy, Accz];
vi = aRaw .* dt;
ri = .5 * aRaw .* (dt^2);
% ~~Data is filtered here~~
% Filtered R and V calculation
af = [Accxf, Accyf, Acczf];
vf = af .* dt;
rf = .5 * af .* (dt^2);
af is the filtered acceleration data in x,y,z. I just followed basic kinematics equations, is that the wrong way to calculate it? Initial velocity and positioned are calculated the same way but from the raw data, charts are provided.

If this isn't the issue, where should I be looking to figure this out? My only other guess is maybe its an issue with the state variables. Thank you.
Tried changing sensor data, adjusting kinematic formulas, and debugging. Expected different looking results for position and velocity.
Respuesta aceptada
Más respuestas (1)
Les Beckham
el 8 de Oct. de 2024
0 votos
It appears that you aren't differentiating the position to get the velocity, you are just multiplying it by dt. Thus the two plots look the same with only a scale factor difference. Similarly for the acceleration, you should be differentiating the velocity, not just applying a scale factor.
1 comentario
Wyatt
el 8 de Oct. de 2024
Categorías
Más información sobre Mathematics en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

