During an indoor flight test, I observed a potentially critical issue with altitude control using an MTF01 Micro Air Optical Flow sensor. I configured the system to perform a controlled takeoff via QGroundControl with a MIS_TAKEOFF_ALT set to 0.7m, but the drone continued to ascend beyond that and hit the ceiling.
Observed Behavior:
The drone armed and took off (Command Given from Q Ground Control )
Expected behavior: Climb to 0.7m then hover.
Actual behavior: The drone kept ascending and collided with the ceiling.
Before the flight, I checked the distance sensor and optical flow sensor output in Mavlink Inspector
Your log shows you armed in position control mode and then you switched to takeoff mode, not mission mode. As QGC let’s you select the takeoff altitude, this will override the MIS_TAKEOFF_ALT, what did you select?
Thanks @Benja
I didn’t use Mission mode. I used the Takeoff button from the QGroundControl home screen (top-left corner). I didn’t explicitly set any altitude there .
Also, can you please confirm if PX4 actually used the MTF01 MicroAir’s optical flow and rangefinder (LiDAR) data for altitude and position estimation in this flight?
Could you (without taking off) check what’s the default altitude it sets there? It’ s to confirm that a reasonable value was set there (10m for example) and somehow it became 702m.
PX4 used and fused distance from a distance sensor and optical flow from an optical flow sensor. Arcording to the data sensor ID, the data is coming from MAVLINK.
I am thinking of trying to fly the drone in position mode , so i can check if the optical flow is working ,or I will just plan a mission to takeoff (small altitude ) and then land .
@Benja thank you for your valuable advice,
what do you think about this plan ?
Disable GPS in EKF (EKF2_GPS_CTRL = 0) and fly position mode, you won’t even be able to arm if the OF does not work properly.
As an intermediate step, fly altitude mode (so the position is not used for control) and the check the log to see if the estimated local position matched the movement you did