Context: I am programming a flight controller for an autonomous drone. I want it to be able to hover in place so I am working on a PID controller for the throttle to keep the vertical velocity at 0 (assume the drone is level with respect to gravity as I have a separate PID controller for that).
Since I am dealing with velocity rather than acceleration but my only sensor is an IMU, I am trying to integrate the acceleration data to get velocity. However, when I do this it introduces a lot of drift, and I have tried several ways of correcting for the drift but none of them have produced useable results.
My question is this: Can I use a lowpass filter on the acceleration data instead of an integrator and would it eliminate drift? I don't care about the accuracy of the result because I am finding the gains of the PID controller experimentally. As long as it is precise and does not drift it should work.