I have a weird problem with my yaw drifting and I’m not sure why it happens.
I recently installed a couple of RM3100 magnetometers on the arms of a large hex (12kg without payload), configured them as the highest priority magnetometers (leaving the internal one as the third priority). The symptom that I found is that while the drone is on the ground the yaw keeps drifting: it usually picks a direction to drift toward and then it goes. Remarkably linear. The rate is about one degree per second, and it drifts 20-30 seconds at a time, then it slows down, then sometimes stops, and sometimes it goes backwards.
Have a look at the attached picture - for most of the time in the picture (in the middle) the drone is on the ground and not moving. Weirdly enough both the desired yaw and the “measured yaw” (based on the ATT dataflash log) are drifting in tandem (while the drone actually stays still). In case you wonder, the two changes in the desired yaw are the disarm and arm commands (in between it was disarmed).
Initially I feared that it’s the magnetometers: being both on the arms and under the RC antennas they are bound to have noise. However, we twisted the power wires going to through the arms to the motors, and the magnetometer is in the null of the antenna. Looking at magnetic fields during this time, they do not change (at all). Furthermore, we tried the compass-motor calibration and the interference was minimal (for our flying current of about 40A we had about 10-15% interference, well below the 30% where we need to worry about). Furthermore, the compas-motor tool seems to say that not much can be done to the compasses (I think).
What I suspect is happening is that this drone just had a … let’s call it a rough landing. OK, it was a crash, and that might have messed up the first z-axis gyroscope. Checking the log, it does show that gyroscope 0 has a constant bias with respect to gyroscopes 1 and 2. It kind of makes sense that if it thinks it constantly turns, then the integral of that turn will change the yaw linearly.
However, when I looked (a bit - both online and in Mission Planner) on how to disable gyroscope 0 (or even change the priorities) I was unable to find how to do it. I can’t physically disconnect it since it’s in the autopilot itself (a cube orange).
Other potential relevant information: immediately after an in-flight calibration of yaw the drone flew beautifully. Then we put it on a test stand and tested the compass-motor tool. Then flew it again and it started drifting, toilet-bowling in LOITER, and throwing compass errors like crazy in flight (even in ALT-HOLD). BTW, the drift also happens in flight: when the drone should stay put (hands off of the yaw) it keeps slowly (but visibly) drifting in yaw.
So, for questions:
- is there a decent way of disabling one of the gyroscopes (to see if that’s the problem)?
- is there some other “known” cause for constant drift in yaw?
- anything else you think it’s worth trying?
BTW, the compass-fit tool shows that the two RM3100 magnetometers on the arms are far superior to the internal magnetometer on the cube-orange (the error is 3-4 times larger on the internal magnetometer).
Thank you for the help,
Mihai