Skip to content

Loiter: limit Loiter coordinated turn acceleration to the pilot lean angle - #35213

Open
lthall wants to merge 1 commit into
ArduPilot:masterfrom
lthall:20261117_Loiter_Coordinated_Turn_Limit
Open

lthall wants to merge 1 commit into
ArduPilot:masterfrom
lthall:20261117_Loiter_Coordinated_Turn_Limit

Conversation

@lthall

@lthall lthall commented Nov 17, 2026

Copy link
Copy Markdown
Contributor

Summary

Limit the Loiter coordinated turn acceleration so that, combined with the pilot's acceleration request, it stays within the pilot lean angle limit. This fixes the speed surge after releasing the sticks reported in Loiter: speed surge after releasing pitch + yaw with coordinated turns on (4.7.2 SITL logs).

Classification & Testing (check all that apply and add your own)

  • Checked by a human programmer
  • Non-functional change
  • No-binary change
  • Infrastructure change (e.g. unit tests, helper scripts)
  • Automated test(s) verify changes (e.g. unit test, autotest)
  • Tested manually, description below (e.g. SITL)
  • Tested on hardware
  • Logs attached
  • Logs available on request

Description

With LOIT_OPTIONS coordinated turns enabled, the turn acceleration (desired speed times yaw rate) was added to the pilot's acceleration without any limit. At moderate speed and full yaw the result exceeds the maximum lean angle, so the desired velocity turns faster than the aircraft can follow. The logs in the discussion show this, with the desired velocity at 6.8 m/s and the aircraft at 3.2 m/s when the sticks are released and the position error at its 2 m limit. The aircraft then speeds up to catch the desired velocity and stops about 12 m from the release point, compared with under 3 m with coordinated turns disabled.

The turn acceleration is now shortened along its own direction so that the pilot acceleration plus the turn acceleration does not exceed the Loiter pilot lean angle, capped by the AltHold lean angle limit. The remaining margin up to the full lean angle stays available for position correction. The limit is calculated once from the pilot's desired acceleration and added to both the desired and predicted accelerations. When the pilot's own request uses the whole budget, the turn acceleration is zero and Loiter behaves as it does with coordinated turns disabled.

@github-actions

Copy link
Copy Markdown

Global Size Summary (Total Flash delta in bytes)

Built from 5ddf689 rebased onto a42f84a

Board Periph tracker blimp bootloader copter heli iofw plane rover sub
DrotekP3Pro _ _ _ * _ _ _ _ _ _
Durandal _ * * _ +240 +240 _ +240 * +240
Hitec-Airspeed * _ _ _ _ _ _ _ _ _
KakuteF7 _ * * _ +240 +240 _ +240 * +240
MambaH743v4 _ * * _ +236 +236 _ +236 * +236
MatekF405-CAN _ _ _ * _ _ _ _ _ _
MatekF405 _ * * _ +240 +240 _ +240 * +240
MatekH743-bdshot _ * * _ +240 +240 _ +240 * +240
Pixhawk1-1M _ * * _ +240 +240 _ +240 * +240
disco _ * * _ +380 +384 _ +384 * +368
f103-GPS * _ _ _ _ _ _ _ _ _

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant