Yaw drift

Post here to get support
Post Reply
ibrahima
Beginner
Posts: 4
Joined: Fri Feb 13, 2015 11:36 pm

Yaw drift

Post 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!
poizone
Member
Posts: 59
Joined: Thu Feb 05, 2015 3:59 am
Location: Ohio, USA

Re: Yaw drift

Post 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.
One day our flies will drown out the sun in an autonomous Skynet of whirring motors and blinking lights.
chad
Expert
Posts: 555
Joined: Sun Sep 28, 2014 12:54 am
Location: New York, USA
Contact:

Re: Yaw drift

Post 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)?
Crazyflier - my CF journal...
4x Crazyflie Nano (1.0) 10-DOF + NeoPixel Ring mod.
3x Crazyflie 2.0 + Qi Charger and LED Decks.
Raspberry Pi Ground Control.
Mac OS X Dev Environment.
Walkera Devo7e, ESky ET6I, PS3 and iOS Controllers.
poizone
Member
Posts: 59
Joined: Thu Feb 05, 2015 3:59 am
Location: Ohio, USA

Re: Yaw drift

Post 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.
One day our flies will drown out the sun in an autonomous Skynet of whirring motors and blinking lights.
ibrahima
Beginner
Posts: 4
Joined: Fri Feb 13, 2015 11:36 pm

Re: Yaw drift

Post 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 :D. I was mostly just wondering if it's likely to be causing the difficulty in control that I'm experiencing.
ibrahima
Beginner
Posts: 4
Joined: Fri Feb 13, 2015 11:36 pm

Re: Yaw drift

Post 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.
Post Reply