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

Hello all,

Back after a year :slight_smile:

I test the code from Pololu on my drone. The Altimu works quite well when my motor turn at low speed. I get a stable roll and pitch…
But when my motor turn at 100% I have some big disturbance. It seems that this disturbance happens on the accelerometer value.

To avoid that :
I changed my platic blade by carbon blade, I isolated a little my motor with caoutchouc damper and the IMU with foam. Still, there are vibrations which pollute my roll and pitch.

I would like to know if there is some parameters which I can tune to decrease the disturbance ?

Best regards,

Amaury

I can send you picture and a video if it can help us :slight_smile:

For best results the sensor requires a clean, well filtered power supply. From your description of the problem, it seems likely that the power supply decoupling is inadequate.

Please post a clear and complete schematic of the drone wiring.

Hello Jim,
After new tests with a bench a have just created, I isolated the Altimu 10V5, after that I get no more disturbance even if the motor turn at high speed.
It means the disturbance comes from the motor vibration. Even I isolate as much I can, the Altimu is still constraint by vibrations.
So I would like to know if I can set a filter or a parameter like a low pass filter or EKF ?
I join a photo of my drone for information :slight_smile:

Sorry, the photo is not helpful.

If you don’t have a schematic, now might be a good time to make one. You probably won’t remember where all those wires go, six months from now.

Finally, a protoboard does not make reliable connections when moved or vibrated, and is a poor choice for circuitry in any mobile robot.