[SOLVED] yaw values slowly but constantly growing

Post here to get support
Post Reply
krasin
Beginner
Posts: 2
Joined: Sun Jun 02, 2013 5:13 am

[SOLVED] yaw values slowly but constantly growing

Post by krasin »

Hi there,

my crazyflie seems to be a bit crazy. I would actually think that it's a faulty acceletometer or magnetometer, but I am not sure.

The evidence: crazyflie is sitting on a relatively flat surface (a table), thrust = 0%, pitch and roll have reasonable values (<3 by abs value) but jaw is constantly growing in the absolute value. Its value can reach as high as 100 in just about 5 minutes (see the attached screenshot)

Below is the contents of the Console tab after a series of reboots:

SYS: Crazyflie is up and running!
SYS: Build 38:e6f9fbdc42b3 (tip) CLEAN
SYS: I am 0x8712183954568549670FF50 and I have 128KB of flash!
IMU: MPU6050 I2C connection [OK].
IMU: HMC5883 I2C connection [OK].
IMU: MS5611 I2C connection [OK].
MPU6050: Self test [OK].
HMC5883L: Self test neg Z [FAIL]. low: 4294966726, high: 4294966916, measured: 4294963200
SYS: Crazyflie is up and running!
SYS: Build 38:e6f9fbdc42b3 (tip) CLEAN
SYS: I am 0x8712183954568549670FF50 and I have 128KB of flash!
IMU: MPU6050 I2C connection [OK].
IMU: HMC5883 I2C connection [OK].
IMU: MS5611 I2C connection [OK].
MPU6050: Self test [OK].
SYS: Crazyflie is up and running!
SYS: Build 38:e6f9fbdc42b3 (tip) CLEAN
SYS: I am 0x8712183954568549670FF50 and I have 128KB of flash!a
IMU: MPU6050 I2C connection [OK].
IMU: HMC5883 I2C connection [OK].
IMU: MS5611 I2C connection [OK].
MPU6050: Self test [OK].
HMC5883L: Self test [OK].
MS5611: Self test [OK].
SYS: Crazyflie is up and running!
SYS: Build 38:e6f9fbdc42b3 (tip) CLEAN
SYS: I am 0x8712183954568549670FF50 and I have 128KB of flash!
IMU: MPU6050 I2C connection [OK].
IMU: HMC5883 I2C connection [OK].
IMU: MS5611 I2C connection [OK].
MPU6050: Self test [OK].
HMC5883L: Self test [OK].
MS5611: Self test [OK].
: Self test neg Z [FAIL]. low: 4294966726, high: 4294966916, measured: 4294963200
SYS: Crazyflie is up and running!
SYS: Build 38:e6f9fbdc42b3 (tip) CLEAN
SYS: I am 0x8712183954568549670FF50 and I have 128KB of flash!
IMU: MPU6050 I2C connection [OK].
IMU: HMC5883 I2C connection [OK].
IMU: MS5611 I2C connection [OK].
MPU6050: Self test [OK].
HMC5883L: Self test neg Z [FAIL]. low: 4294966726, high: 4294966916, measured: 4294963200
SYS: Crazyflie is up and running!
SYS: Build 38:e6f9fbdc42b3 (tip) CLEAN
SYS: I am 0x8712183954568549670FF50 and I have 128KB of flash!
IMU: MPU6050 I2C connection [OK].
IMU: HMC5883 I2C connection [OK].
IMU: MS5611 I2C connection [OK].
MPU6050: Self test [OK].
SYS: Crazyflie is up and running!
SYS: Build 38:e6f9fbdc42b3 (tip) CLEAN
SYS: I am 0x8712183954568549670FF50 and I have 128KB of flash!
IMU: MPU6050 I2C connection [OK].
IMU: HMC5883 I2C connection [OK].
IMU: MS5611 I2C connection [OK].
MPU6050: Self test [OK].
HMC5883L: Self test [OK].
MS5611: Self test [OK].
: Self test [OK].
MS5611: Self test [OK].


There's some evidence that HMC5883L (compass / magnetometer) is faulty, but I don't know how to prove that.

Any ideas?
Attachments
crazy-yaw.png
Last edited by krasin on Sun Jun 02, 2013 6:42 pm, edited 1 time in total.
marcus
Bitcraze
Posts: 659
Joined: Mon Jan 28, 2013 7:02 pm
Location: Sweden
Contact:

Re: yaw values slowly but constantly growing on flat surface

Post by marcus »

Hi,

This is unfortunately something that all MEMS gyros have problems with. Since the gyro measures rotational rate, the values are integrated to give an absolute position. So small errors in rate will accumulate to big errors in absolute angle over time. The reason that roll/pitch doesn't drift over time is that the readings from the gyro is corrected using the reading from the accelerometer (which doesn't drift over time). The correction with the accelerometer only works with roll/pitch, not with yaw. So the yaw readings are never corrected by anything and will then drift over time. The plan is to use the magnetometer to do this correction in the future, but we haven't gotten that far yet.

As for the failing self-test for the magnetometer I'm not sure how much of a problem it is, it's not that much off. The readings will be affected by magnetic fields around in the room. If you have a laptop, could you try it outside and see if you still get the failing readings?

/Marcus
krasin
Beginner
Posts: 2
Joined: Sun Jun 02, 2013 5:13 am

Re: yaw values slowly but constantly growing on flat surface

Post by krasin »

Thanks, marcus.

I did not realize that yaw is the integral value (my guess was a rotational speed). This is clearly a newbie mistake. Sorry about that.
almaz_1c
Member
Posts: 43
Joined: Tue Dec 09, 2014 12:58 pm

Re: [SOLVED] yaw values slowly but constantly growing

Post by almaz_1c »

Same situation with crazyflie 2.0 - degree of yaw angle constantly growing. Can someone point to how to use magnetometer to correct yaw angle? Is there some alghorithm to do this?
Greensprings
Member
Posts: 30
Joined: Sat Feb 07, 2015 11:32 pm

Re: [SOLVED] yaw values slowly but constantly growing

Post by Greensprings »

I also just noticed this, the copter is still, but the yaw, in my case was decreasing until it became a negitive number, is this a problem?
poizone
Member
Posts: 59
Joined: Thu Feb 05, 2015 3:59 am
Location: Ohio, USA

Re: [SOLVED] yaw values slowly but constantly growing

Post by poizone »

Yes, the flie gyro has drift. Every gyro is going to drift like this, actually.

The algorithm for correction with a magnetometer is the same one currently implemented, actually. The current one is a 6DoF (Gyro and Accelerometer) version of the Madgwick and Mahoney filters for sensor fusion. There are 9DoF (Gyro, Accelerometer, and Magnetometer) versions that correct gyro drift with magnetometer data.

The magnetometer may or may not be useful for this. Flies are tiny, and the motors may move (0, 0, 0) on the magnetometer thanks to their magnetic fields.
One day our flies will drown out the sun in an autonomous Skynet of whirring motors and blinking lights.
Post Reply