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

Arduplane : RTL Altitude problem #39

Closed
kitsen13 opened this issue Jan 19, 2013 · 10 comments
Closed

Arduplane : RTL Altitude problem #39

kitsen13 opened this issue Jan 19, 2013 · 10 comments
Labels

Comments

@kitsen13
Copy link

When RTL mode is engaged, arduplane set default altitude.
Problem : it can cause crash
Solution : if current altitude>default altitude, keep current altitude as target in RTL mode
avant3
apres

@kitsen13
Copy link
Author

Code solution

in command.pde modify read_alt_to_hold() function

BEFORE :

static int32_t read_alt_to_hold()
{
    if (g.RTL_altitude_cm < 0) {
        return current_loc.alt;
    }
    return g.RTL_altitude_cm + home.alt;
}

AFTER :

static int32_t read_alt_to_hold()
{
    if ((g.RTL_altitude_cm < 0) || (current_loc.alt > (g.RTL_altitude_cm + home.alt))) {  
        return current_loc.alt;
    }
    return g.RTL_altitude_cm + home.alt;
}

@kitsen13 kitsen13 reopened this Jan 19, 2013
@pchickey
Copy link
Contributor

Just to make sure I've understood your bug report and proposed solution:

Currently, in RTL, alt will always go to the RTL_altitude_cm offset, if a valid value exists.

You'd like for RTL to never cause the vehicle to descend, because its possible the RTL altitude offset is set to an altitude where this causes a crash.

My first impression is that this is a user error - what's the problem with configuring your RTL altitude to an altitude which is always safe?

@kitsen13
Copy link
Author

It's not a user error,
and the plane can descend only when the plane reach home position.

In the current code, I think it's not safe because:
Firstly , to be safe, you have to set the higher alitude you can. ie altitude of the obstacle.
Secondly, in order to set this altitude, you have to know the real altitude of the obstacle.
Finally, you must have a pc with mission planner to set this parameter

In my opinion, to be safe, it's not simple.
And I'm obliged to set "RTL_altitude_cm" each time i want to fly.

How it works (and how it could work safier) :

-Set "RTL_altitude_cm" to 100 meters high above the ground.

In actual Arduplane code:

  1. If you engage (or your failsafe engages) a RTL when your plane is under "default alt".

Your plane climbs to reach "default alt" -> OK

  1. If you engage (or your failsafe engages) a RTL when your plane is above"default alt".

Your plane dive to reach "default alt" -> Problem because you loose lot of potential energy to return to home. (In FPV flight, you could easyly lose your plane). Another problem , if there is an obstacle on the way of the return to home, you could crash.

The other solution could be that :

  1. If you engage (or your failsafe engages) a RTL when your plane is under "default alt".

Your plane climbs to reach "default alt" -> OK

  1. If you engage (or your failsafe engages) a RTL when your plane is above"default alt".

Your plane keep the current altitude -> It's safer because you keep a maximum of energy keeping current altitude. If you loose your motor battery, your plane will accomplish more distance to home than the actual code.

(option : when the plane reaches home position, we can imagine circle down until "default alt")

Some post about the problem :

http://diydrones.com/forum/topics/arduplane-rtl-descends-height-fir...

http://diydrones.com/forum/topics/rtl-mode-and-height?commentId=705...

http://diydrones.com/forum/topics/problem-with-rtl-and-circle-mode?...

@meee1
Copy link
Contributor

meee1 commented Jan 19, 2013

in MP untick hold default alt. and it uses the current alt.

@kitsen13
Copy link
Author

it's not the same because you loose "default alt" safety.

If plane is under "default alt" it climbs to reach "default alt".

@fpvwannabe
Copy link

i second the usability of this feature. kitsens proposed code change is the easiest way to solve a very real problem for us who use arduplane primarily for its rtl feature while doing long range fpv. you almost always want the plane to ascent to default altitude if you are flying close to the surface, yet its rarely a good idea to do a rapid descent to default altitude at extended range. not only does it waste energy and risks collision with tall obstacles; since signal quality deteriorates with decreased altitude, any chance of regaining control or video is quickly lost as the plane is rapidly descending.

@pgregg88
Copy link

pgregg88 commented Jul 4, 2013

Count me as a third! This is an important feature. I like to set my default altitude to 50M above my home spot. However, I fly high altitude FPV. When failsafe kicks in, my planes initial reaction is to do a high speed nose dive until it reaches the default altitude. This move is extremely dramatic, inefficient and potentially unsafe. Once it reaches the default altitude, then it aims toward home. Another potential fix is to limit the dive angle to something subtle.

@proficnc
Copy link
Contributor

proficnc commented Jul 5, 2013

I agree with this, it is a great suggestion, it allows maximum chance of radio signal re-connection, and leaves lots of potential energy for the "glide" home.

maybe set a min speed option on the altitude hold, that way if the engine has failed, Max Glide speed could be instigated if the AC is failing to hold altitude. this would allow the AC to use all that potential energy to return to a safe "crash area"

tridge pushed a commit that referenced this issue Jul 5, 2013
when above the target altitude in RTL come down slowly, when below
climb rapidly

This fixes issue #39
@fpvwannabe
Copy link

i'm delighted to see that not only has tridge addressed this issue, but also that it was addressed with a glide-slope rather than the more minimalistic approach to retain current altitude if above target altitude, as suggested by kitsen. in my environment, the glide-slope descent behavior is ideal. i can see some scenarios involving hills where kitsens approach would be better, but for me, the solution chosen is perfect!

if someone is interested, i got frustrated and incorporated kitsens change myself, so i have a hex file containing the firmware for arduplane 2.73 + kitsens one-line change. it is trivial to upload using MP custom firmware option. i'm flying with it right now and it works as advertised.

as for me, i'll be moving to 2.74 and the new glide-slope rtl once it becomes available :)

rmackay9 pushed a commit to rmackay9/rmackay9-ardupilot that referenced this issue Jul 11, 2013
when above the target altitude in RTL come down slowly, when below
climb rapidly

This fixes issue ArduPilot#39
@goochpw goochpw mentioned this issue Sep 27, 2013
@squilter
Copy link
Member

Set ALT_HOLD_RTL to -1.

IamPete1 pushed a commit to IamPete1/ardupilot that referenced this issue Jul 26, 2021
…otests

Parachute Update + more SB autotests
shellixyz added a commit to shellixyz/ardupilot that referenced this issue Jul 5, 2022
shellixyz added a commit to shellixyz/ardupilot that referenced this issue Apr 20, 2023
peterbarker pushed a commit to peterbarker/ardupilot that referenced this issue Sep 27, 2023
…safe-check-engine-telemetry_lua

Ov3 461 advance failsafe check engine telemetry lua
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants