FlowHold allows angles larger than max_angle

Hello all!

I have PX4Flow attached on the drone with teraranger EVO. PX4Flow orientation is confirmed from log to be correct. Outdoor conditions were good, little to no wind.

AltHold and loiter modes work as expected, but in FlowHold I’m able to command roll/pitch angles that are over the specified angle_max (32deg). You can confirm that on the log that I was able to do angles over 40 degrees. The desired angle shouldn’t go over 32 degrees in these conditions with good PID, right?

I have quickly checked the source code regarding the FlowHold control, but it looked go to me. So I’m a bit amazed how this can happen.

Log from a flight with the problem.
Log.bin (Google Drive)


Thanks for the report, it looks to me like there is a mistake on this line. The call to get_pilot_desired_lean_angles() is passing in the result of the “attitude_control->get_althold_lean_angle_max()” call twice instead of passing in aparm.angle_max.

I’ve created an issue here. It looks like an easy fix so I suspect we will fix and release with Copter-3.6.7.