3
\$\begingroup\$

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.

\$\endgroup\$
  • \$\begingroup\$ 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. \$\endgroup\$ – PlasmaHH May 17 '16 at 13:11
  • 1
    \$\begingroup\$ 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. \$\endgroup\$ – Mishony May 17 '16 at 13:12
  • 1
    \$\begingroup\$ Power supply noise too. \$\endgroup\$ – Andy aka May 17 '16 at 14:07
  • \$\begingroup\$ The Kalman line is computed, or you just drawed a straight line and labeled it as Kalman? \$\endgroup\$ – Marko Buršič May 17 '16 at 14:28
  • \$\begingroup\$ 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. \$\endgroup\$ – Martynas Jankūnas May 17 '16 at 17:07
1
\$\begingroup\$

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.

\$\endgroup\$
  • \$\begingroup\$ I use brushed motors, so no ESC, I drive them with NMOS transistors directly from battery. Ground is common to all devices. \$\endgroup\$ – Martynas Jankūnas May 25 '16 at 11:33
1
\$\begingroup\$

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.

\$\endgroup\$
0
\$\begingroup\$

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

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.