Help with MPU6050

Hi,

I am making aa Arduino based drone and i need help with my mpu6050 sensor. Currently I am trying to make the drone able to hover at a set altitude. I know that this is done with a combination of a barometer and a MPU6050, but my barometer is not working and i need to get this project done. I will just have to use the MPU6050. My problem is that even when the drone is not moving vertically, the vertical velocity is increasing at a stable rate. This is after it calibrates itself. I need help to get the value to 0 when its not moving. Because it climbs at a steady rate it shouldn't be too big of a problem.

Here is a video demonstrating the problem. If you need parts of the scrip I can send them.

Video: WhatsApp Video 2024-12-15 at 12.45.23_b3b1a898.mp4 - Google Drive

Every time it climbs at a steady rate, but the rate differs.

Any help is appreciated

Calculate the slope of the drift and feed it back to the vertical velocity. At a hover velocity, does the drift exist?

How can you get the project done without a working barometer? All the corrections will be for nothing, requiring more work. Take a look back at your other topics... and see how things generally went.

Hi @gooddude546 ,

I agree with @xfpd that a working barometer is the required solution.

Regarding your calibration problems you might -if not already done- have a look at this tutorial

https://wired.chillibasket.com/2015/01/calibrating-mpu6050/

that gives some (probably personal but) helpful insights.

Good luck
ec2021

Thank you for your feedback. I am aware that I cannot finish this project without a barometer, but I cant get it to work in the time I have left. My plan is to check if the drone starts to accelerate in the vertical direction and then adjust power of all 4 motors to counter the acceleration. This will only happen when I have the drone set to hover mode. From my research a drift in the acceleration is common even after proper calibration. I already had a PID controller to stabilize the the X and Y axis, so I want to do the same for the Z.

How would I do this?

Thank you
GoodDude546

I do not have an answer, only a suggestion at manipulating the data geometry.

The point-slope equation (y = mx + b), has its negative, (y = - mx + b). The difference of the slopes (half way between the slopes) will be zero slope.

Just before using that raw data, adjust it with the difference of slopes.

However; Calibration and PID tuning is the accepted method (and waiting for stabilization). See the link in post #3.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.