Unstable Position Control 1.10.1 quadcopter


I built a relatively large quad-copter and started to tune and test it. SW version is 1.10. 1
The initial testing was done indoors with ring safety cable over blocks (not to let it fly away). No reliable GPS was available. Only OpticalFlow was activated in EKF2.
The vehicle was very stable in the stabilized mode. In position mode though the oscillations appeared at take off then vehicle stabilized (while in velocity control) for a while but switching to position control the oscillations diverged leading to a crash. Most of the parameters for the position controller were default as simulations tests (SIH) were ok for the position and the mission flight modes.

Log file url is enclosed.


Thank you for your support and appreciate any ideas,


What optical flow sensor are you using? And were you actually sure that optical flow is being used, and that the rotations of the sensor were correct, etc.? For instance, I would do a check where you move the vehicle without actually flying to see if the velocity and position telemetry is correct. And I assume the ground had enough texture for the flow sensor?

Hi Julian,

Thank you for your answer. Im using PX4flow sensor and LidarLite, following the procedure on PX4 documentation. Y axis of the PX4flow sensor is pointing to Forward direction and the SENS_FLOW_ROT is set at 270. I did a check as per your advise, looking at Local_Position_NED , and it appears OK, e.g. while moving forward the Vx is positive / X grows and reverse. Both distance_sensor and optical_flow_rad topics are published and visible in the mavlink inspector.

Looking at the log of the crush flight I did check the quality of the optical flow and it was way above 100 confirming OK texture of the ground. EKF2_AID_MASK was set at 2 (Optical Flow).

As the quad copter I have built is quite large (2x2m) and heavy (around 70kg) with Max Trust of around 170kg. I may have a suspicion on the position controller. For example looking at the log you could see setpoint on roll and pitch oscillations right before take off.

Looking forward to your support,
Thank you and Best Regards,


P.S. As mentioned in the original email the flights in stabilised mode were OK and very stable suggesting that rate PID controllers are tuned


Would you pls consider the message below with answers to your questions?

Thank you,