Since it already works with my original code, I think the 2nd term in my formula may prevent/reduce any bumps, if I choose the proper value for gain2. Will experiment. Coming soon is Yaw. Also working on a fixed wing.
You can see the red line in the video does not perfectly match the movement of the sensor. There is still a delay. The peaks don't line up chronologically with reality. Sometimes the line is going up, when there is no movement etc. I admit it is better than I can do with pressure alone, because I cannot even detect 6" of movement with my cheap sensor. I have a delay also. But what good is such amazing resolution when it is often wrong? It will cause the quadcopter to shoot up or down when these errors happen, as you admitted they will. For my application I would rather have a reliable algorithm that keeps the craft within 10ft, instead of one that sometimes detects 6" of motion, other times screws up by a few feet. I am considering to make a similar demonstration using the same 2 sensors.