Skip to content
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

fixed wing - dive at waypoints if target altitude is not reached #9026

Closed
RomanLut opened this issue May 2, 2023 · 8 comments · Fixed by #9224
Closed

fixed wing - dive at waypoints if target altitude is not reached #9026

RomanLut opened this issue May 2, 2023 · 8 comments · Fixed by #9224
Labels

Comments

@RomanLut
Copy link
Contributor

RomanLut commented May 2, 2023

Current Behavior

If target altitude is not reached at the waypoint, navigation produces dangerous dive, with down pitch and minimum navigation throttle.

If mission is started at the taget altitude, then behaviour is ok.

Steps to Reproduce

  1. Setup mission at very high altitude
  2. Start mission below waypoint 1

Expected behavior

Navigation should gain altitude contantly

Demo

Mission is setup at 900m, with navigation throttle override enable, and throttle at 100% (where this effect is even more dramatic).

mission-dive.mp4

If mission is started at target altitude ( 900m), behaviour is ok:

mission-no-dive.mp4

In the real flight, mission was set to 300m altitude and flight was started at 30m altitude. Plane has climb ratio about 1.5m/s. Plane crashed at the last RTH waypoint

CADDX000005-mission-dive-crash.2.2.mp4

Unfortunatelly I do not have blackbox (only FPV recording with OSD and onboard HD), but problem can be easily reproduced in HITL.

Affected versions: 6.0 release and current master.

INAV_6.0.0_cli_FPV_SURFWING_dive-mission.txt

@RomanLut
Copy link
Contributor Author

RomanLut commented May 2, 2023

Attached blackbox log, generated in HITL.

blackbox_log_2023-05-02_143047.TXT

@breadoven
Copy link
Collaborator

This does look like the issue hopefully fixed by #8896. I'm surprised nobody noticed it before because it's probably been there for some time.

@breadoven
Copy link
Collaborator

Actually looking at the log it's the same issue as #8882 but working in a different way due to the way target altitude is set during each WP leg and the affect this has in the altitude PID P and I values. It would need a different fix, probably resetting the PIDs at the start of each leg. Flagging as a bug for now.

@RomanLut
Copy link
Contributor Author

RomanLut commented May 3, 2023

Not fixed by #8896.

Attached is a video from 6.0 + #8896,
nav_fw_pos_z_p=35
nav_fw_pos_z_p = 5
nav_fw_pos_z_d = 10
with POSZ PID controller outputs on OSD.

Note that real flight video above is done on firmware from master branch (later than 6.1 release)

mission-dive-60-8896.mp4

@breadoven
Copy link
Collaborator

I've actually tested using vertical velocity for fixed wing to control altitude change rather than using Z position which is the way it works currently. Using velocity doesn't upset the PID loop the way it does using Z position so avoids the problem shown here. Seems the reason velocity wasn't used for fixed wing was because a fixed wing might not use a Barometer ... which doesn't really make sense. Even without a Baro the Z velocity should still be consistent enough to adequately control fixed wing altitude.

Seems to work better using velocity when testing on HITL and offers other benefits as well. Would need flight testing with Baro disabled though to really understand how well it works with variations in GPS altitude.

@shota3527
Copy link
Contributor

I dont think this is a bug, this issue is just caused by anti-windup in nav pid controller, iterm turns the opposite when the controller is saturated

@b14ckyy
Copy link
Collaborator

b14ckyy commented Mar 21, 2024

Was this fixed with #9224?

@RomanLut
Copy link
Contributor Author

The BUG is fixed.
Still drops throttle in waypoints. I guess because target height slope is built starting from current altitude in each waypoint, as can be seen by P term drop.
Closing.

X-Plane.2024.03.24.-.13.45.12.01.2.mp4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
4 participants