Pololu Robotics & Electronics
Menu
My account Comments or questions? About Pololu Contact Ordering information Distributors

Pololu Forum

Altimu 10v5 help for arduino

Hello all,
I am using arduino due with an Altimu 10v5 for a drone.
To get roll and pitch. I have several quetions :
-How to set register to filter the accelerometer and gyrometer to avoid vibration from frame of the drone ? What is the lowest filter ?
-My gyrometer drift a lot…and the drift increase like an exponentielle ! Have you an idea to avoid it ? At the begining it’s 1 degree per second.

Here my code to caliber the sensors :slight_smile:
void init() {
gyro_acc.init();
gyro_acc.enableDefault();
gyro_acc.writeReg(LSM6::CTRL4_C, 0x80); // Bandwith determined by CTRL1_XL
gyro_acc.writeReg(LSM6::CTRL1_XL, 0x3D); // 104Hz Hz data rate, 8g, 50Hz filtering
gyro_acc.writeReg(LSM6::CTRL2_G, 0x44); // 104 Hz, 500 dps full scale
}

Consider using Pololu’s libraries for that sensor, which include calibration routines to reduce gyro drift. I don’t know if any will run unmodified on the Due, but if not, the code examples should be very useful.

Hello,

Thank you for your return !

I try with the code without modification. I made mistake in my last code, I have no more drift :slight_smile: . Now it is corrected.
But i still have issue, do you know in the code if there is a parameter which will avoid (decrease) disturbance created by my motors (I have 10 degrees disturbance sometimes) ?

Move the sensor away from the motors.

Also, the sensor should be calibrated in place. I recommend this excellent calibration tutorial: https://thecavepearlproject.org/2015/05/22/calibrating-any-compass-or-accelerometer-for-arduino/

Thank you for your advice.

I buy some caoutchouc damper my motors…It’s a bit better

Also I reduce my PID to avoid to take in account the disturbance to quickly :slight_smile:

Thank you for your Help