Page 1 of 1
Yaw drift
Posted: Tue Mar 03, 2015 12:15 am
by ibrahima
Hi, I've read here and in other places that MEMS gyros tend to drift over time, which is understandable. I've noticed this a lot on my CF 2.0, and I guess it's a "known issue." However, it seems like this causes the controls to become slowly rotated over time, which makes it very difficult to control, because what I thought was pitch became roll, or it's just not making sense to me which way is which. Is there any good way to work around this? Do others not have this issue? Thanks!
Re: Yaw drift
Posted: Tue Mar 03, 2015 3:45 am
by poizone
The only way to work around this is to write code into the firmware that fuses the magnetometer data and uses it as a reference for the gyro. Feel free to grab the firmware source from the Crazyflie GitHub and start working on it! Pull requests, while not always accepted, are always well received from members of the community, and this would be a great feature to add. I'm working on it along with some other things, but my CF isn't flyable right now, so there's no way for me to test any of my progress.
Re: Yaw drift
Posted: Wed Mar 04, 2015 1:37 am
by chad
You might want to take a look at
this Github pull request...
I also find it is sometimes easier for me to fly (specially in tight spaces) with yaw disabled in the controller. If you disable yaw (put a -1 in the Yaw control 'id' in your controller mapping) does it help the drift at all (i.e. is it totally due to MEMS gyro drift or partially due to tiny inputs on the controller)?
Re: Yaw drift
Posted: Thu Mar 05, 2015 7:03 pm
by poizone
Mostly it's MEMS drift. I use a deadzone on my controller because the sticks are loose, and even when P/R/Y setpoints are 0 I get yaw drift. It's relatively slow, but the accumulation is there.
Re: Yaw drift
Posted: Fri Mar 06, 2015 5:23 am
by ibrahima
It's definitely MEMS gyro drift, it drifts even when it's sitting still.
I actually do want to try to implement magnetometer sensor fusion later, but for now I have a class project due in 5 days for which I need the CF relatively stable, and I have other things to work on so simpler fixes are preferred

. I was mostly just wondering if it's likely to be causing the difficulty in control that I'm experiencing.
Re: Yaw drift
Posted: Fri Mar 06, 2015 6:14 am
by ibrahima
chad wrote:You might want to take a look at
this Github pull request...
I also find it is sometimes easier for me to fly (specially in tight spaces) with yaw disabled in the controller. If you disable yaw (put a -1 in the Yaw control 'id' in your controller mapping) does it help the drift at all (i.e. is it totally due to MEMS gyro drift or partially due to tiny inputs on the controller)?
Is carefree mode basically just a mode where it always keeps the yaw the way it was set at startup time? That should be useful for me, I'll check it out!
Edit: Hmm, doesn't seem to merge cleanly with the crazyflie2 branch, I'll take a look later. It feels like it shouldn't be that far reaching of a modification to the firmware.
Edit2: Comit 466911faf335bdd3d00545f89c758fa9725edd1b does apply cleanly and that's all I really needed, thanks! It helps a lot actually.