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.
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.
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.
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.