I agree with all others that it would be the best to change to a actual flight controller.
But still I am think about your problem.
The local air pressure is never really static. It changes on local weather conditions, changes of hight over reference level and also on direct air speed at the sensor.
So the algorithm of the flight controller (FC) must reset the ground level to zero just before take off.
So if you power on the FC while the the drone is placed maybe on a work bench on a different level than you airfield the startup value should be wrong. So the FC should not take this value. The FC has to take the value just before take off while the drone is placed on the airfield. To detect this condition the FC can use the arming command as this is command only if you are ready for take off.
If this, my thinking, is correct you can test your system fixed on the work bench.
Monitor the FC barometer reading with the fixed drone from power up and try to arm. At some point the reading must go to zero. Than let the drone powered for a while, serveral minutes; without moving or touching the drone. The reading must be stable. If so, you can than take your drone for example 1m up or down and check again the readings. It must be again stable with a difference of the changed level. Than put the drone back on the bench and the reading must go back to the first value. If this all work than the FC barometer function is principal ok and you have another undetected problem so far. And if so you run maybe in the same problem with the next FC.
1 Like