ArduPilot / ardupilot

ArduPlane, ArduCopter, ArduRover, ArduSub source
http://ardupilot.org/
GNU General Public License v3.0
11k stars 17.54k forks source link

Rover: RC failsafe / throttle failsafe fails #12316

Closed Hwurzburg closed 5 years ago

Hwurzburg commented 5 years ago

Bug report

**Issue details

All rc failsafes, and throttle failsafe do not function. Throttle apparently is forced to neutral internally on SBUS RC failsafe and/or throttle failsafe since vehicle switches to target mode (assuming RTL/SmartRTL is the FS_ACTION) and fails to move. This should occur also on RX failsafe on protocols without the FS bit being sent by RX if the RX is set to force throttle channel low. Currently, having any RC or throttle FS capability is mute.

The desire to maintain throttle nudge (actually full speed control I believe), I can understand, but FS should force throttle in RTL or SmartRTL to RTL_SPEED or CRUISE_SPEED (at a minimum) to allow a return to occur. Whether this should occur for other FS types (BATT,EKF,GCS) should be discussed, but GCS FS is a similar situation to RC FS IMHO.

Version Master

Platform [ ] All [ ] AntennaTracker [ ] Copter [ ] Plane [X ] Rover [ ] Submarine

Airframe type What type of airframe (flying wing, glider, hex, Y6, octa etc)

Hardware type What autopilot hardware was used? (Pixhawk, Cube, Pixracer, Navio2, etc)

Logs Please provide a link to any relevant logs that show the issue

Hwurzburg commented 5 years ago

I did some diagnostic cruising today and I think I understand the issue from a top level. I believe it has to do with the "NUDGE THROTTLE" controller. I did some brief testing with stable several days ago and don't recall these issues, so I believe it really to be only a MASTER issue. It behaves as though there are two issues:

1) In modes not using THROTTLE NUDGE (Acro,etc.), CRUISE_THROTTLE results in CRUISE_SPEED, idle throttle (RC3_TRIM) in no motor output, and Max Throttle at full motor output... ....but when NUDGE is active in a mode (RTL,AUTO,etc.), if throttle input is below the CRUISE_THROTTLE , then it assumes its really reverse? and forces SERVO3 output to SERVO3_TRIM, killing the motor..but it should just continue outputting CRUISE_THROTTLE.....and if RC3 is raised above this, the mode (RTL, AUTO,etc.) starts outputting on SERVO3, but

2 ) issue 2: its scaled wrong....if you raise throttle above this, it doesn't jump to CRUISE_SPEED like it cruises at in ACRO at that position, it acts as if RC3 in is really half way between CRUISE_SPEED and maximum throttle...raising throttle above this (where RC3 is above RC3_TRIM ) increases speed to max throttle as throttle increases....the slowest it will go is 50% above CRUISE_SPEED and max throttle when just above RC3_TRIM...lowering below CRUISE_THROTTLE kills the motor output.

The end result: 1) if throttle failsafe is active, there is no motor ouput, until released and throttle is above CRUISE_THROTTLE...FS failure since throttle below FS_THROTTLE should be FS. 2) RC failsafe puts throttle input at RC3_TRIM?....so its not above CRUISE_THROTTLE and no motor output.....FS failure. 3) in AUTO,RTL,etc. vehicle stops at throttle idle, and begins moving at wrong cruise speed when throttle gets above CRUISE_SPEED throttle position. THROTTLE NUDGE failure.

I noticed other problems and I dont think they are related to this:

A. Disarming does not reset failsafe set mode...Disarming should either return to the pre-failsafe mode or to initial_mode. B. Entering Loiter from cruising in MANUAL mode results in motor output being disabled, independent of stick position when entering or while in LOITER...seems broken C. Entering LOITER mode at the end of a mission results in the boat tightly circling at speed, instead of LOITERING.

I will enter A,and B/C as new issues.

All these are shown in the data flash log here: https://www.dropbox.com/s/oiq9mkgp636jxci/FailsafeFailures.BIN?dl=0

Hwurzburg commented 5 years ago

@rmackay9 determined that WP_SPEED was not set, and since master now does not fall back to CRUISE_SPEED, the behavior is expected. Randy is considering ways to either prevent WP_SPEED from being set to 0 unknowingly, or send a message or pre-arm param fail to user so that they know to set it to something non-zero if they want auto modes to work correctly...

Hwurzburg commented 5 years ago

entered PR to linearize throttle nudge/set actual max speed instead of linear calculation from cruise speed/throttle