Page 1 of 1

Help understanding something about the Kalman filter

PostPosted: Sat May 07, 2016 7:10 am
by Debian
Hi guys,
I'm struggling right now, to understand why my copter sometime behaves incorrectly. It seems to go in 'divergence' and I have to switch immediately to manual mode to regain control over the copter.
At the very beginning I thought that that could be a problem with the GPS. Could be that sometime it gets some not valid information from satellites and get crazy. So I took a look at the log files and found something that I cannot really explain.

Look at the picture here:
Image
In blue is the GPS height and marked in green is the estimation from the Kalman Filter (POSD) also the vertical position of the copter. They should match but it seems that during the progagation calculation the Kalman filter divergence a little bit and than converge after some time. The spikes on the picture are the calculated estimated of the altitude. It seems to me that the process noise of the system not really match what has been programmed in the code.

So I have few question for you experts :geek:
1) Are the spikes above a problem? Or could be the cause of the rapid loosing altitude of the copter?
2) Is there any possibility to change the process noise of the Kalman filter in the code, without recompiling it?
3) Do you experiment sometime the same thing?

Re: Help understanding the Kalman filter

PostPosted: Sat May 07, 2016 7:12 am
by Debian
I forgot to say that I have an AQ6. Gyros and Accs are digital.

Re: Help understanding the Kalman filter

PostPosted: Sat May 07, 2016 7:45 am
by Max
Debian wrote:Look at the picture here:

It's very hard to tell what we're looking at. Including the legend, scale, and perhaps the whole log would be a lot more useful.

Debian wrote:In blue is the GPS height and marked in green is the estimation from the Kalman Filter (POSD)

If you're referring to GPS_HEIGHT and UKF_POSD log fields, then I think there is something wrong with your setup (equipment/wiring/placement/settings/etc). I've never seen anything quite like that graph, assuming it is actually showing what I think it is.

You should post a lot more information about your complete setup -- version, pictures, logs, parameters, video if you have it. It is not possible to diagnose a complex system based on a few small snippets of information.

Debian wrote:1) Are the spikes above a problem? Or could be the cause of the rapid loosing altitude of the copter?

Yes and yes.
Debian wrote:2) Is there any possibility to change the process noise of the Kalman filter in the code, without recompiling it?

No. Nor would I recommend changing any of those numbers in the code.

-Max

Re: Help understanding something about the Kalman filter

PostPosted: Sat May 07, 2016 12:26 pm
by Debian
Yeah, you are right. I didn't give too many informations about that. That's because I have the impression, that if you put too much information in an email, then other people feel overwehlmed and don't read carefully what I mean. So I prefer a "small-step" approach. I give not too many details at first because I want to understand the concept and then slowly I add some more informations.

Yes, I meant the parameters: GPS_HEIGHT and UKF_POSD.
I must confess I changed the PID values a little bit. Now I m abroad for working, but I m going to put the default parameters in the copter and check again the log-files again. I'm going to do that in the next weeks.

Anyway thanks for your advice. That that spikes are not normal, it is obviuos to me. But as automation engineer I know that those things come up if the process noise (the covariant matrix) too much differs from the modelled system. For this reason I asked if it is possible to change such parameters