iNavFlight / inav

INAV: Navigation-enabled flight control software
https://inavflight.github.io
GNU General Public License v3.0
3.09k stars 1.46k forks source link

Do not use throttle when RTH triggers with thr low (plane) #3195

Closed ABLomas closed 6 years ago

ABLomas commented 6 years ago

Previous INAV versions had feature (not a bug ;-) - if RTH is triggered (manual switch or failsafe) AND thr was low - autopilot would not use throttle, only control surfaces for navigating home. Many autopilots use the same logic and this is perfect for unplanned landings with empy battery and so on.

But in current (and 1.8.x branch) logic changed, INAV will use throttle in any case, which complicates things a lot. So, i see two solutions for this problem:

P.S. discussed in telegram inav channel, examples why current logic is bad provided here, but could copy to issue, too, if required.

romanas commented 6 years ago

if RTH triggered by switch (not LOST rc link or other factors) and throttle is below 5% (some has bad trims), go fully RTH with no motor usage. But when adding throttle go normal RTH[L] as planed and declared in min max speeds.

digitalentity commented 6 years ago

I believe failsafe should always have motor control. Otherwise a glide with no power might end up badly if you fly out of range.

As for the manual RTH option - I think this should be configurable.

ABLomas commented 6 years ago

@digitalentity i disagree here. There's video on telegram channel 20:45 yesterday with valid use case, when RTH sent plane in tree. At least 4 similar incidents around in season ;-) In short, few examples:

Just make it configurable, not default behavior, but keep older functionality. Now this "fix" for non-existent bug is one-way battery and plane killer.

digitalentity commented 6 years ago

@ABLomas It's not a non-existent bug. We made RTH ignore motor stop because of multiple reports of crashes when engaging RTH (or going into failsafe). So the bug is perfectly valid for some of the flyers. Apparently you want other behavior.

I suggest implementing an CLI option nav_ignore_motor_stop with choices NEVER (what @ABLomas is requesting), FS_ONLY (only when RC link is down), PILOT (only when RC link is active), ALWAYS (default, navigation will always disregard MOTOR_STOP and throttle position).

This should cover all possible scenarios.

romanas commented 6 years ago

It has to work fully as is now, but only without motor if thr is at zero. and needs not to disarm or do other things (like reset GPS fix home) when thr is down.

ABLomas commented 6 years ago

Another possible option would be "disable failsafe" switch. When enabled - would set "failsafe_procedure" to NONE, ignoring current AUX channel value. Should be easy to implement, no? (still, i think that setting based on throttle pos. is better option)

ABLomas commented 6 years ago

Another idea - make failsafe mode configurable! Now ppl who test waypoints set failsafe procedure to NONE. While this is fine fo testing - it's dangerous for everyday flying. Moving into mountains of flying in forest - better set failsafe procedure to LAND, not RTH ....and so on...

So, adding switchable failsafe procedure to switch would resolve all mentioned issues:

So, need to land with empty battery or wanna go autonomous? Switch failsafe procedure to NONE. Wanna clear that gap, but worry about link? Switch to "LAND". In all other cases - go with RTH (or smth like that).

giacomo892 commented 6 years ago

Indeed having the possibility to set FS as land while doing acro in low altitude near obstacles would be awesome. In such scenarios start climbing can mean wing trapped on a tree :P

danarrib commented 6 years ago

I am one of the people who had problems with the old RTH/FS behavior. I did a VERY LONG walk of shame when I lost the RC Link and the plane did the RTH without motor... Wind made RTH without motor impossible and plane just landed 1 km away from last known location. I guess the @digitalentity suggestion of a nav_ignore_motor_stop covers it all. It's perfect and makes everybody happy.

romanas commented 6 years ago

im talking about controlled rth with no throttle. if you lost rc link let normal fs with motor and throttle do theyr job. but if you manualy made RTH and removed throttle let it glide! then if you add throttle let it climb back to rth activation height. everybody will be happy.

danarrib commented 6 years ago

Ok now I guess I understood:

It's actually a good idea. Just need to add a way so aircraft can keep moving forward and don't stall... Like start diving when speed reach some minimum value.

romanas commented 6 years ago

rth without motor should try to maintain height of activated rth (hot air winds). But mainly this topic is not about thr RTH at zero. i needed to read Ablomas text more careful =)

digitalentity commented 6 years ago

Without thrust FCs attempt to maintain altitude or level will result in a tip stall. Until we have full support for TECS with airspeed sensor not using throttle in autonomous modes is highly dangerous.

On Sun, May 27, 2018, 03:29 Romanas notifications@github.com wrote:

rth without motor should try to maintain height of activated rth (hot air winds). But mainly this topic is not about thr RTH at zero. i needed to read Ablomas text more careful =)

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/iNavFlight/inav/issues/3195#issuecomment-392276043, or mute the thread https://github.com/notifications/unsubscribe-auth/AKi_mwObpW9EZIeQVVywHAwzA0-Oo2pjks5t2ZESgaJpZM4T7LlU .

ABLomas commented 6 years ago

There's no need to maintain altitude if returning, for example, from 2km altitude and 2km distance. Current code will keep motor running even at this extreme angle. We do not ask to make swichable motor modes as default. But keep it please as option, at least as it was earlier. -1 plane today, not exactly inav fault, but precisely burned remains of battery when link was lost, making recovery next to impossible.

digitalentity commented 6 years ago

@ABLomas would an option nav_ignores_motorstop defaulting to YES suffice?

ABLomas commented 6 years ago

Yes, if this would restore "pre-1.8 inav" behavior - it would be nice. Based on comments it should be not default.

TL;DR version: if throttle was at zero before activating RTH (by switch or failsafe) airplane should not be using throttle but still try to navigate back home (plane leveled and gliding to home direction). Very usefull for high-altitude flights, too (3km alt, 1km to home - airplane still use throttle to reach home pos, using battery, when it could just glide ~10km easily).

stale[bot] commented 6 years ago

This issue / pull request has been automatically marked as stale because it has not had any activity in 60 days. The resources of the INAV team are limited, and so we are asking for your help. This issue / pull request will be closed if no further activity occurs within two weeks.

digitalentity commented 6 years ago

Fixed by #3349