Magnetometer and Fused Sensor Output

Firmware/software/electronics/mechanics
Post Reply
poizone
Member
Posts: 59
Joined: Thu Feb 05, 2015 3:59 am
Location: Ohio, USA

Magnetometer and Fused Sensor Output

Post by poizone »

I'm looking through the stabilizer and sensor fusion code, and I came across a comment mentioning that magnetometer data isn't yet used. Is this completely true, or does that ignore using magnetometer data for gyro drift? I'm all about getting as much 3D data available from the flie to go into the stabilization code. The more info, the better it knows where it is, where it was, and where it should be next.

EDIT: This code base is a little all over the place, but I answered my own question when I stumbled on this comment:

Code: Select all

// TODO: Investigate possibility to subtract gyro drift.
One day our flies will drown out the sun in an autonomous Skynet of whirring motors and blinking lights.
tobias
Bitcraze
Posts: 2339
Joined: Mon Jan 28, 2013 7:17 pm
Location: Sweden

Re: Magnetometer and Fused Sensor Output

Post by tobias »

The code does not yet make use of the magnetometer to correct gyro yaw drift. There are some forks which make use of the magnetometer which I can't find now.
There are a few hurdles to overcome before it improves things. When flying inside there are many stray magnetic fields and the magnetometer tend to make it worse. Another thing is that a calibration is needed before it can be used. The last thing is that the battery current effect the magnetometer, for it to work well the battery needs to be placed below the PCB or further away from the sensor. These hurdles can be overcome but we have not had any time for it. It would be awesome if you would like to give it a try ;)

We have for a looooong time had the idea of incorporating the FreeIMU calibration GUI into the cfclient, some day... It is also written in python and Qt so it shouldn't be too hard.
tobias
Bitcraze
Posts: 2339
Joined: Mon Jan 28, 2013 7:17 pm
Location: Sweden

Re: Magnetometer and Fused Sensor Output

Post by tobias »

// TODO: Investigate possibility to subtract gyro drift.
This was actually written to investigate the possibility to feedback the roll and pitch gyro drift when flying in rate mode.
Post Reply