Crazyflie will not calibrate

Post here to get support
Post Reply
aforcefulthrust
Beginner
Posts: 7
Joined: Mon Jan 20, 2014 8:08 am

Crazyflie will not calibrate

Post by aforcefulthrust »

Hello,

I'm working on an offshore vessel and brought my crazyflie out to keep me occupied. I'm having trouble getting the crazyflie to calibrate (red light blinking 1hz). I'm guessing this is because i'm on a moving vessel that is allways moving with the seas. Is there a trick to force calibration or bypass?

Thanks
marcus
Bitcraze
Posts: 659
Joined: Mon Jan 28, 2013 7:02 pm
Location: Sweden
Contact:

Re: Crazyflie will not calibrate

Post by marcus »

Hi,

Interesting use-case :D When the Crazyflie starts up a bias is taken to remove the base noise from the gyro. This is done by sampling a number of times when the platform is still and then using the mean. To determine if the platform is still or not the variance is calculated using the same values, and when it's under a certain threshold the Crazyflie decides it's still and uses the mean as bias. To "make it easier" to pass this test you can either increase the threashold or reduce the number of samples. Both of these require that you change the code in the IMU that is in hal/src/imu.c, re-compile the firmware and flash it (could be done using the radio).

To reduce the number of samples change this line:

Code: Select all

#define IMU_NBR_OF_BIAS_SAMPLES  128
To increase the threashold for the variance change these lines:

Code: Select all

#define GYRO_VARIANCE_BASE        4000
#define GYRO_VARIANCE_THRESHOLD_X (GYRO_VARIANCE_BASE)
#define GYRO_VARIANCE_THRESHOLD_Y (GYRO_VARIANCE_BASE)
#define GYRO_VARIANCE_THRESHOLD_Z (GYRO_VARIANCE_BASE)
You could try both to see which gives you the best result, but I would start with lowering the number of samples. This will of course effect the flight performance though.
Post Reply