[SOLVED] Gyroscope becomes uncalibrated during flight

Post here to get support
Post Reply
Phasitron477
Beginner
Posts: 8
Joined: Tue May 02, 2017 8:29 pm

[SOLVED] Gyroscope becomes uncalibrated during flight

Post by Phasitron477 »

Hey guys,

To start out, I've been experimenting with using the crazyflie for FPV applications. Whenever I start flying the crazyflie takes off smoothly, and this lasts for a few seconds. However, the longer it is in the air the more erratic it begins to fly, until finally it reaches a point that is beyond all control and it tumbles down and crashes. The few times it does this and I've been able to land it, I've noticed the gyroscope readout on the cfclient is way out of whack, and takes several seconds before it finally steadies. I've tried replacing the propellers more than once to see if that might have had anything to do with it, and it had no effect. I've also tried to fly it without the FPV using just the stock quadcopter, and the same thing happens. I'm wondering if there is a way to possibly fix this.

Thanks for any help,
Luke
Last edited by Phasitron477 on Sun May 21, 2017 6:25 am, edited 1 time in total.
tobias
Bitcraze
Posts: 2339
Joined: Mon Jan 28, 2013 7:17 pm
Location: Sweden

Re: Gyroscope becomes uncalibrated during flight

Post by tobias »

Hard to tell but might be some issue with the sensor. Have you tried to trouble shoot the sensor, such as looking at the virtual horizon in the cfclient. Or have a look at the console output in cfclient if it outputs some error. What firmware are you running?
Phasitron477
Beginner
Posts: 8
Joined: Tue May 02, 2017 8:29 pm

Re: Gyroscope becomes uncalibrated during flight

Post by Phasitron477 »

After flying it for a few seconds I looked at the virtual horizon when I got the crazyflie to be steady (which required holding the controls at about +23 pitch and +18 roll), and saw that it was about 20 degrees off or so. After landing, the horizon slowly returned to where it should be. Prior to yesterday I was running the latest release (04/2017). However, I managed to find someone posted a .bin of the firmware used to test the gyroscope during manufacturing in a different thread. After uploading it to the crazyflie and powering it on I got the following readout on the console:

Code: Select all

SYS: Crazyflie is up and running!
SYS: Build 6+:29624e7f6e3b (2014.12.0) MODIFIED
SYS: I am 0x31323832313347153C001F and I have 1024KB of flash!
IMU: MPU9250 I2C connection [OK].
IMU: AK8963 I2C connection [OK].
IMU: LPS25H I2C connection [OK].
EXPBRD: Found 0 memories.
30 78 42 43 0 50 0 0 0 0 0 0 0 0 0 7D 
Status 0
EEPROM: I2C connection [OK].
MPU6500: Self test [OK].
IMU: Gyro variance test [OK]
IMU: Acc level test [OK]
AK8963: Self test [OK].
LPS25H: Self test [OK].
OW: Found 0.
SYS: Free heap: 5880 bytes
Edit: after immobilizing the crazyflie and running the engines I noticed the virtual horizon "drifted" just like it does when I'm flying it. The amount and rate of drift was proportional to how hard the engines were being run. I balanced the propellers though. It it possible there's a problem with the motors (the shafts seem to be straight thought), and if so is there a way to find out?
tobias
Bitcraze
Posts: 2339
Joined: Mon Jan 28, 2013 7:17 pm
Location: Sweden

Re: Gyroscope becomes uncalibrated during flight

Post by tobias »

Thanks for the detailed feedback, helps a lot. I'm pretty sure the problem comes from extensive vibrations. You can for a short moment hold three of the propellers and thrust up to test each propeller until you find the problematic one.

You could also try my very experimental propeller test FW. It uses the accelerometer while spinning the each prop to try and decide if the prop is fine or not (and the conclusion is very experimental). It will beep three times with the motor that has a bad prop (or bent motor axis).
Attachments
CF2 propeller test (experimetal) .bin
(152.67 KiB) Downloaded 318 times
Phasitron477
Beginner
Posts: 8
Joined: Tue May 02, 2017 8:29 pm

Re: Gyroscope becomes uncalibrated during flight

Post by Phasitron477 »

Thanks for the test firmware, and sorry for the long response time. The output when run was:

Code: Select all

SYS: ----------------------------
SYS: Crazyflie 2.0 is up and running!
SYS: Build 120:5f7f54d9b33d (2016.09-120) MODIFIED
SYS: I am 0x31323832313347153C001F and I have 1024KB of flash!
CFGBLK: v1, verification [OK]
MPU9250 I2C connection [OK].
AK8963 I2C connection [OK].
LPS25H I2C connection [OK].
DECK_DRIVERS: Found 9 drivers
DECK_INFO: Found 0 deck memory.
DECK_CORE: 0 deck enumerated
EEPROM: I2C connection [OK].
AK8963: Self test [OK].
SYS: Free heap: 11592 bytes
STAB: Acc noise floor variance X:0.000377, Y:0.000345, Z:0.001251
STAB: Motor M1 variance X:6.058402, Y:10.242078, Z:21.755966
STAB: Motor M2 variance X:0.392412, Y:3.583018, Z:6.433296
STAB: Motor M3 variance X:3.592194, Y:3.066173, Z:1.851669
STAB: Motor M4 variance X:0.615624, Y:1.447719, Z:16.841369
STAB: Propeller test on M1 [FAIL]. low: 0.0, high: 2.0, measured: 16.30
STAB: Propeller test on M2 [FAIL]. low: 0.0, high: 2.0, measured: 3.97
STAB: Propeller test on M3 [FAIL]. low: 0.0, high: 2.0, measured: 6.65
STAB: Propeller test on M4 [FAIL]. low: 0.0, high: 2.0, measured: 2.06
I re-balanced the M1 and M3 propellers as well as switched out the motors. It still fails the test most of the time, but the numbers are much lower and the gyroscope barely drifts anymore.
tobias
Bitcraze
Posts: 2339
Joined: Mon Jan 28, 2013 7:17 pm
Location: Sweden

Re: Gyroscope becomes uncalibrated during flight

Post by tobias »

Great that its working better now!

The pass/fail levels are very experimental but the test gives good information. Looks like M1 was the problematic motor and maybe M2 a bit. The others are probably fine.
Post Reply