MPU non plane soldered

Firmware/software/electronics/mechanics
Post Reply
Yaro
Member
Posts: 31
Joined: Wed May 20, 2015 11:28 am

MPU non plane soldered

Post by Yaro »

Hi all,

I'm back with a new problem. Recently after doing some test I've found that MPU stop to answer to my I2C packets. After an inspection I've found a bad soldered joints and I've resoldered them. After this drone works again but I've a small deviation on Roll and Pitch, probably becouse I've placed to much solder on one side or moved it when I was soldering. I don't want to resolder IC again to avoid to damage MPU, so I want to try to compensate incode. Values from eulerRollActual and eulerPitchActual are respectively 3.2-3.4 and 0.7-1.1 and, if I place drone in plane, this cause PID to increase slowly the spin of two motors used for Roll to compensate this deviation.
What I want to ask before to procede to try to solve this problem is this:
- Shuldn't calibration in Stabilizer function avoid this kind of problems resetting to 0 all deviations?
- There is a part in code dedicated to this kind of manual/automatic corrections? Something like: "MPU deviations" and "Motor deviations".

Last question is particularly important so I will know if I should add custom code to correct this kind of deviations or if there's already a part of code that do this.(not only for MPU I'm also interested for motors deviation in case of problems with motors)

Thank you!
kristoffer
Bitcraze
Posts: 630
Joined: Tue Jun 30, 2015 7:47 am

Re: MPU non plane soldered

Post by kristoffer »

HI!

The accelerometers are not calibrated at startup but there are a few options for you.

1. It is possible to write trim settings for pitch and roll to compensate for a static offset. You do that in the "Connect/Configure 2.0" menu in the Crazyflie python client. The trim parameters will be written to flash so they are persisted and remain when you restart the Crazyflie. The trim should correspond to the errors you read in the pitch and roll boxes on the flight tab. In theory you should put your CF2 on a level surface, read the numbers in the flight tab and set them in the Configure 2.0 box. Restart your CF and you should be done. When I tried it seems as the pitch is reversed so you may have to change the sign for that.

2. There is a define in the firmware called IMU_TAKE_ACCEL_BIAS that is undefined by default. By defining it and rebuilding your FW you will get accelerometer calibration at startup. The drawback is that the CF must be level when calibrated every time it is started.

Hope it helps

- Kristoffer
Post Reply