"Loiter_To_Alt" behaviour?

Tried a “Loiter_To_Alt” (Loiter to 30m) today and the plane descended from 80m to 30m, did 1/16th of a loiter and then did the next command.

Is this correct behaviour?

I expected loitering WHILE descending to 30m not a descent to 30m then loiter?

Have you looked at the documentation? http://ardupilot.org/plane/docs/common-mavlink-mission-command-messages-mav_cmd.html#mav-cmd-nav-loiter-to-alt

I did, and I briefly looked at the code (not that I understand it all that much).

Docs: “Begin loiter at the specified Latitude and Longitude. Don’t consider the navigation command complete (don’t leave loiter) until the altitude has been reached.” - According to this then my observed behaviour is wrong.

The aircraft did not begin to loiter at the specified Latitude and Longitude. It flew towards the specified Latitude and Longitude while descending and then loitered. So seemingly inverting the steps…

Somewhat odd, I could understand if the command was “Alt_Then_Loiter” but it’s not.

Ahh, thank you. I misunderstood, sorry!

My reading of the documentation suggests that there’s several ways you could use this command:

  1. Provide Lat=0, Lng=0, but a different altitude, so that the plane ascends/descends while loitering around it’s present position. (Presumably, the position of the previous waypoint)
  2. Provide a new Lat/Lng/Alt. This would behave like a normal waypoint command, sending the plane towards the new Lat/Lng/Alt goal, except if the Lat/Lng were reached before achieving the correct alt, the aircraft would loiter while completing the ascend/descend goal.

(And it seems you could use the Heading_Required and Radius parameters to achieve additonal desired behavior.)

Could you post the dataflash log, so that we get to see the details that you observed, and the commands that you setup?

How can I modifiy the speed when in loiter_to_alt?
Because it uses the ARSPD_FBW_MAX speed wich is too much
Thank you

I believe you cannot. However you can limit the max decent rate or the max pitch in the TECS. However it would be universal. You should set those to what you are happy with in either case. Normal flight as well as a loiter to alt.