3

I'm in process of making a quadcopter. At this point I encountered a problem with MPU-6050 angle calculation. When quadcopter is stationary with motors in off state and I'm tilting it, angle readings in all 3 axis is good, but when motors are in on state, readings starts to jump all over the place and can even differ from real value by 20 degrees. I assume this effect is due to mechanical vibrations caused by motors. I include images of MPU-6050 board mounting enter image description here and a graphs of angle readings of MPU-6050 in X axis using Kalman filter, complementary filter and MPU-6050 DMP (Kalman and complementary filter implementations as well as processing code for graphs is from Kristian Lauszus GitHub, DMP used with Jeff Rowberg I2Cdev library).enter image description here

UPDATE

I connected second MPU to different microcontroller, so it would not be connected electrically with a quadcopter and mounted MPU on board with two sponges from both sides of MPU. Results were pretty much the same. So now I really know that noise (at least majority of noise) isn't related with electrical switching noise from motors.

  • You might want to tell us a bit more about how you use the cpu and how you configure it, e.g. if you use motionfusion etc. – PlasmaHH May 17 '16 at 13:11
  • 1
    Vibrations was the reason I gave up my quadcopter project about an year ago. But, the problem is solvable, just extremely annoying to work on it. I guess you're combining accelerometer and gyro data (both Kalman and Comp. filters are sensor fusion algorithms) ... could you try adjusting the values so that gyro has much higher "contribution" to the result and accelerometer just corrects gyro drift. You could also try to low pass filter (in software) the angles. And, mechanical solutions (nylon spacers, better frame, etc.) also help. – Mishony May 17 '16 at 13:12
  • 1
    Power supply noise too. – Andy aka May 17 '16 at 14:07
  • The Kalman line is computed, or you just drawed a straight line and labeled it as Kalman? – Marko Buršič May 17 '16 at 14:28
  • In case of MPU DMP programming I used Jeff's Arduino example sketch,I just changed FIFO rate from 100 Hz to 25 Hz because FIFO overflowed a lot, In case of Kristian filter implementation: sample rate is 1 kHz; FSYNC disabled and set 260 Hz Acc filtering, 256 Hz Gyro filtering, 8 KHz sampling; gyro Full Scale Range is ±250deg/s; accelerometer Full Scale Range is ±2g; PLL set with X axis gyroscope reference; disabled sleep mode. Black straight line represents 0 degrees. Kalman filter line also is black, it's hard to see because Kalman values is close to complementary filter. – Martynas Jankūnas May 17 '16 at 17:07
  • @MartynasJankūnas I see now, I think it's time for me to buy some glasses. +1 for nice graphs and methods list. Probably the noise is the cause. – Marko Buršič May 18 '16 at 14:06
  • You need to understand how the sensors readings are affected by vibration, then "filter out" these effects. In addition, I would use metal shielding to make sure electrical noise is not contributing to the problem. – Guill May 19 '16 at 23:04
  • After reviewing your last statement, I came to a different conclusion. The fact that you used two sponges to reduce the vibrations and it did not make a difference, means that the problem is electrical, not mechanical! – Guill May 20 '16 at 03:33

3 Answers3

2

Make sure that the high power circuit driving your ESC's shares a common ground with the low power signal circuit from from the microcontroller. I found this to be very important when building my quad, as it also caused some errors with the other systems such as the Rx/Tx.

1

I have sucessfully developed a tricopter flight controller ,I also was having problems with vibrations so the only way to deel with it is to start from begining and balance motors ,propellers,etc ,only then you should be fine to go.If you buy a flight controller you will see that it will not work properly with your hardware unless you balance everything.You have also to filter the results from readings from de gyroscope .I have used a moving average filter with good results.Here you can see the some testing and the flying machine.

https://www.youtube.com/watch?v=5nwb1H-Vlss https://www.youtube.com/watch?v=M1lbETqdTiw

Good luck with your project.

user131008
  • 11
  • 1
0

I managed to lessen vibrations influence. Firstly I made and glued some supports from copper clad on quadcopter legs, then desoldered MPU-6050 from PCB and soldered it again with flexible wires and mounted MPU-6050 on "Moon Gel Drum Dampeners" I found on ebay, it helped a lot. Now I get max 3 degree fluctuations in angle calculation on low PWM. Pictures of quadcopter and graphs during the same test as in original post with Kalman filter is below. I managed to stabilize quadcopter on one axis with 2 motors on. I used B. Beauregards Arduino PID library, here is a link to the video: https://www.youtube.com/watch?v=nQLR8DWjOVo enter image description hereenter image description here