ardupilot icon indicating copy to clipboard operation
ardupilot copied to clipboard

Accel limit for big copters while precison-land

Open rahulOCR opened this issue 1 year ago • 13 comments

Hey I am submitting this PR to merge into master: I observed that due to acceleration limits in land mode of copter, copter oscillates a lots while doing precision landing. I have created new user parameter whose values can be adjusted to adjust acceleration limits:

I have achieved good results when I drops acceleration limit from defaults to 10 cm/s/s.

Note: I am using vision based landing target send over landing_target mavlink message.

rahulOCR avatar Apr 25 '24 13:04 rahulOCR

these should be two separate PRs

Hwurzburg avatar Apr 25 '24 13:04 Hwurzburg

Hey @Hwurzburg I have amends the updates as per yours. Thanks

rahulOCR avatar Apr 25 '24 13:04 rahulOCR

Hi I have corrected the param name to "LAND_ACCEL". Mentioned the param units, etc. And added this in mode auto for landing.

rahulOCR avatar Apr 26 '24 10:04 rahulOCR

Applied all changes and rebase all to a single commit

rahulOCR avatar Apr 26 '24 13:04 rahulOCR

Should this be m/s/s instead of cm/s/s?

magicrub avatar Apr 26 '24 17:04 magicrub

guess copter is cm/s until the big conversion in the future...but might save a conversion even if it's inconsistent now

Hwurzburg avatar Apr 26 '24 18:04 Hwurzburg

We will want @lthall's input on this because he most recently changed the repositioning feature

rmackay9 avatar Apr 27 '24 00:04 rmackay9

Does the position controller not automatically do this? I always assumed it did. Can we see logs where this change has been helpful?

rishabsingh3003 avatar Apr 27 '24 04:04 rishabsingh3003

Hey @rishabsingh3003 , initially I also assume that position controller will handle automatically but I have seen too much oscillation when landing in precision land. I have tried couple of things but limiting acceleration given us good results. I will post the logs as well for better understanding.

rahulOCR avatar Apr 27 '24 07:04 rahulOCR

We will need to change this line: https://github.com/ArduPilot/ardupilot/blob/54bfaa4438a8e7112b0f2a539d446093ea7abcc6/ArduCopter/mode.cpp#L724

const float max_pilot_vel = wp_nav->get_wp_acceleration() * 0.5;

To use get_max_accel_xy_cmss(). So it will need to be something like: const float max_pilot_vel = pos_control->get_max_accel_xy_cmss() * 0.5;

Does the position controller not automatically do this? I always assumed it did. Can we see logs where this change has been helpful?

The position controller uses WP_Nav accelerations. So this will mean the autopilot can use much softer accelerations on both the position error correction and the change in position. In a perfectly setup system this would make no difference, however if the precision landing sensor doesn't account for latency correctly or struggles with a moving image, this will reduce the impact of both these error sources. Both of these can cause oscillation.

lthall avatar Apr 27 '24 12:04 lthall

@lthall reducing the limits like const float max_pilot_vel = pos_control->get_max_accel_xy_cmss() * 0.5; is also perfectly alright. This 0.5 factor can be inside the param bucket [ percentage then]. But I think this limit is what set by setter methods in position control class.

rahulOCR avatar Apr 30 '24 05:04 rahulOCR

Ping @rahulOCR - there are review comments in here which have not been acted upon.

peterbarker avatar Sep 11 '24 02:09 peterbarker

Peter is correct that when oscillations are caused by external control loops these mechanisms are the right ones to use.

'AP::ahrs().getControlLimits(ahrsGndSpdLimit, ahrsControlScaleXY);'

These make the whole control loop more stable.

I note that we are not currently using 'ahrsGndSpdLimit' so there is room for improvement. It may be worth adding in a similar limit to acceleration.

lthall avatar Sep 11 '24 02:09 lthall

Hey @peterbarker, I am reviewing all again, can be taken this as a part of dev call. I have less idea about limiting so cannot say about this 'AP::ahrs().getControlLimits(ahrsGndSpdLimit, ahrsControlScaleXY); but I see significant result by limiting externally through pos_control

rahulOCR avatar Sep 18 '24 19:09 rahulOCR