Skip to content

ArduPlane: fix quadplane stopping speed equation #29712

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 14, 2025

Conversation

eppravitra
Copy link
Contributor

I'm not sure if you are aware of this, @tridge, but I think this is the correct equation to calculate the stopping speed. From my test, I don't notice any difference. I only test using SITL with Gazebo though.

Copy link
Member

@IamPete1 IamPete1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have done a geogebra of the change.

https://www.geogebra.org/calculator/frtg2bry

The current equation gets to 0 speed at distance threshold, the new equation gets to target speed at the distance threshold.

image

The change certainly makes the equation do what the comment says it should.

@tridge
Copy link
Contributor

tridge commented Apr 22, 2025

@eppravitra thanks! we just need to do some testing both in RealFlight and in some real vehicles, @peterbarker and I can test on 2 quadplanes at SpringValley on a weekend, likely in 2 weeks time (I will be away this weekend)

@tridge
Copy link
Contributor

tridge commented Apr 22, 2025

@eppravitra I'd also note that this code is also bad if you'd like to fix it - should not depend on wp_speed

        // limit target speed to a the pos1 speed limit, which starts out at the initial speed
        // but is adjusted if we start putting our nose down. We always allow at least twice
        // the WP speed
        target_speed = MIN(MAX(poscontrol.pos1_speed_limit, 2*wp_speed), target_speed);

@tridge tridge force-pushed the quadplane-stopping-speed branch from ca4c2b7 to 88b5469 Compare May 3, 2025 00:28
@tridge
Copy link
Contributor

tridge commented May 4, 2025

tested on a MakeFlyEasy Hero, no issues

@tridge tridge force-pushed the quadplane-stopping-speed branch from 88b5469 to 1d94ec2 Compare May 5, 2025 10:18
@eppravitra eppravitra force-pushed the quadplane-stopping-speed branch 2 times, most recently from 7e84017 to 67eb20e Compare May 10, 2025 01:51
@eppravitra
Copy link
Contributor Author

Hi Andrew @tridge,

The ship landing test keeps failing. I wonder if it has to do with this change.

I quickly looked at plane_ship_landing.lua, and I still can't spot anything obvious.

Your help would be greatly appreciated.

@peterbarker
Copy link
Contributor

Hi Andrew @tridge,

The ship landing test keeps failing. I wonder if it has to do with this change.

I quickly looked at plane_ship_landing.lua, and I still can't spot anything obvious.

Your help would be greatly appreciated.

It's absolutely a regression as far as the autotest is concerned. I haven't seen the test fail in CI before this PR.

It's also trivially reproducible locally.

@IamPete1
Copy link
Member

I have had a look at the failing test but I'm not that familiar with ship landing. It looks to me that its failing/passing due to mostly luck. This code change can only affect POS1. The final stage of landing is not affected.

This is QPOS distance on master after POS1:

image

For the failure:

image

Both show a "ring down" it happens that one lands at a low point and the other lands at a high point.

@tridge
Copy link
Contributor

tridge commented May 13, 2025

@eppravitra I think your PR has inadvertently exposed a flaw in the ship landing lua script. It does not slow down the landing if it is outside an acceptance cone for the landing on the target. We will need to fix that to get this to pass CI

@tridge
Copy link
Contributor

tridge commented May 14, 2025

it turns out the key problem is Q_WP_SPEED=500 and the ship is moving at 5m/s
I've added a commit that changes Q_WP_SPEED to 700 in the ShipLanding test

@tridge tridge force-pushed the quadplane-stopping-speed branch from 67eb20e to 5b813d5 Compare May 14, 2025 06:42
Copy link
Member

@IamPete1 IamPete1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@IamPete1 IamPete1 merged commit a8cb982 into ArduPilot:master May 14, 2025
76 of 77 checks passed
@eppravitra
Copy link
Contributor Author

Thanks everyone!

@eppravitra eppravitra deleted the quadplane-stopping-speed branch May 14, 2025 14:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants