hey there! sorry i made an error. give me a sec and ill check
sorry for the mistake again. here are the two plots:
-
atan2 (y,z)
-
atan2 (z,y)
by the way the plots are the Kalman filter's output
plot 1 looks great. right? Everything is very close to 0 degrees.
in plot 2 that transient looks like an artifact of the initial state of your filter.
yes thank you so much. im near tears here, seriously. can you suggest ways on how i can further test our filter's peformance?
Are the plots above the output of the Kalman filter you have right now?
The good and bad news is it is impossible to do any better than a Kalman filter if you have a linear system (you do) with zero mean white Gaussian noise. You have a linear system. You've calibrated the system so your noise is zero mean and I bet the noise looks fairly close to Gaussian too.
The only place you can do better is if you don't have the right covariance matrices. In your case these matrices are scalars (single numbers) so all you need to do is take a bunch of readings while it is still and measure the variance. The gyro's variance is Q and the computed angle's (the output of atan2) variance is R, to use wikipedia's notation.
i will do just that. question though, how do i ensure that i am getting the right readings? what sort of tests or setups do i perform to know the "true" angle so that i can compare that with the kalman filter's angle?
I think the best you could do (cheaply and easily) would be to lay it flat for a few seconds then lay it on one side, then the other side and look at the data. If you see 0 then a ramp to 90 (or -90) then a ramp to -90 (or 90) then you're probably in the ball park.
You could also compare the filter output to the atan2(accy,accz) output. The filter would be smoother but they should both "agree". That would be a good sanity check.
Also, the kalman filter may freak out if you rotate past 180degrees (ie do a roll)