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

RTH straight #4188

Merged
merged 8 commits into from
May 9, 2019
Merged

RTH straight #4188

merged 8 commits into from
May 9, 2019

Conversation

shellixyz
Copy link
Collaborator

The aircraft will go down linearly until hitting rth_altitude just before starting to circle above home if RTH was started above rth_altitude and rth_straight is set to ON

@Mckenzie74
Copy link

Awesome!
That’s exactly what I try to do when coming back. I fly in cruise and pitch down just a little to achieve the ideal slope to home. Obviously I often do that wrong...

@teckel12
Copy link
Contributor

@shellixyz How is this different than nav_rth_alt_mode = FIXED? And if it's different in some way, why not creating a new RTH altitude control mode, STRAIGHT for example? Maybe this is some FW-only thing that I'm not familiar with.

@shellixyz
Copy link
Collaborator Author

shellixyz commented Jan 10, 2019

@teckel12 I believe FIXED will go down at the maximum pitch for planes until hitting rth_altitude. rth_straight is more efficient for FW. I added a setting instead of just adding an altitude mode because altitude mode is for specifying the altitude to start RTH at. This way you can still chose how you want it to behave altitude-wise before going home. You can still use MAX_ALT, FIXED_ALT or EXTRA_ALT. The only mode it doesn't make sense to use it with is CONST_ALT.

@shellixyz
Copy link
Collaborator Author

shellixyz commented Mar 3, 2019

Tested again today with 2.1 as base. All working fine

Here is a demo video: https://youtu.be/RznTuZbgDLk

Settings used:

  • rth_alt_mode = AT_LEAST
  • rth_altitude = 10000 # 100 meters
  • rth_home_altitude = 6000 # 60 meters
  • rth_straight = ON

@shellixyz shellixyz added this to the 2.2 milestone Mar 3, 2019
@digitalentity digitalentity self-requested a review March 4, 2019 18:14
@expipiplus1
Copy link
Contributor

Some diagrams to go with the existing ones would be useful I think.

@expipiplus1
Copy link
Contributor

I had a go with this and got some strange behavior; the plane would pitch down and glide (as expected), but after a few seconds it would pitch up back to neutral and fly powered for a few seconds before pitching down again to repeat the cycle.

My config:
https://gist.github.com/f3322e691f2c2d95844ca98c6606e7e6

@shellixyz
Copy link
Collaborator Author

shellixyz commented Mar 19, 2019

@expipiplus1 You probably need to tune ALTHOLD for your aircraft (altitude management PID loop settings nav_fw_pos_z_{p,i,d}).

Some diagrams to go with the existing ones would be useful I think.

You're right

@shellixyz shellixyz force-pushed the rth_straight branch 2 times, most recently from 60dd65a to 0bc7752 Compare March 21, 2019 15:48
@shellixyz
Copy link
Collaborator Author

I updated the code to make it clearer. I wrote this last year and didn't realize it was so obscure.

@shellixyz shellixyz merged commit 644259f into iNavFlight:development May 9, 2019
@wilco1967
Copy link

Just tried nav_rth_alt_mode = AT_LEAST_LINEAR_DESCENT at Yesterday development version.

However, linear descent doesn't seem to work.

When I enable RTH, it takes an immediate dive at what seems maximum down pitch angle, and stops only at 150 meters (nav_rth_altitude = 15000) as fast as it can while still far away.... Once it reaches 150 meters, it will continue RTH at 150 meters normally....

Plane: MiniTalon / R9M / MatekF722

here's the BB log
LOG00056.TXT

And here's my diff. (stripped of useless OSD lines)
iNav 2.2.0dev - MatekF722 - 20190601 DIFF.txt

This should be a great feature (once it works ;-).... Looking forward to be able to also have linear climb / descent during Waypoint missions as well.

Thanks !

@putimir
Copy link

putimir commented Jun 1, 2019

Same thing exactly today - diving until almost reaching nav_rth_altitude and then proceeding RTH @ nav_rth_altitude

@digitalentity
Copy link
Member

Yep, there seem to be a bug. See #4778

@wilco1967
Copy link

Update: 4-june
This issue has been resolved, and will probably be implemented in 2.2.0RC3
2.2.0 RC2 does NOT yet have the corrections, so be aware.

See #4778

Be aware of steep dives in RC2 or earlier versions, if trying nav_rth_alt_mode = AT_LEAST_LINEAR_DESCENT
It will do a RTH, but dive immediately to nav_rth_altitude

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.

7 participants