ardupilot
ardupilot copied to clipboard
Accel limit for big copters while precison-land
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.
these should be two separate PRs
Hey @Hwurzburg I have amends the updates as per yours. Thanks
Hi I have corrected the param name to "LAND_ACCEL". Mentioned the param units, etc. And added this in mode auto for landing.
Applied all changes and rebase all to a single commit
Should this be m/s/s instead of cm/s/s?
guess copter is cm/s until the big conversion in the future...but might save a conversion even if it's inconsistent now
We will want @lthall's input on this because he most recently changed the repositioning feature
Does the position controller not automatically do this? I always assumed it did. Can we see logs where this change has been helpful?
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.
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 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.
Ping @rahulOCR - there are review comments in here which have not been acted upon.
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.
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