Landing Detection Logic Doesn't Work for High Powered Copter with KDE Motors

We have copter with that require these settings due to using KDE motors and ESCs:
MOT_SPIN_ARM=.22
MOT_SPIN_MIN=.225
MOT_THST_HOVER=.33 (from the auto hover learning process)

But, the logic in 3.4.4 for landing detection uses .125 of the hover value for throttle:
https://github.com/ArduPilot/ardupilot/blob/Copter-3.4/ArduCopter/land_detector.cpp#L63

We’ve noticed that when we land it using the LAND command that it tries to spin up after hitting the ground and then topples over and spins itself into the ground breaking many props in the process. Are there any other parameters that would impact the landing detection process.

Also, why not use mot_spin_min for the landing throttle test rather than .125 * mot_thst_hover?

Thanks,

Rob

Any comments Randy @rmackay9?

@OXINARF Another theory for the copter spinning up during landing is that the set_land_complete is being set to false based on this test:

https://github.com/ArduPilot/ardupilot/blob/master/ArduCopter/land_detector.cpp#L54
https://github.com/ArduPilot/ardupilot/blob/master/ArduCopter/Attitude.cpp#L219

Code below that though checks for other throttle settings. I haven’t figured out all the logic yet.

What values of throttle are used to set the throttle_lower and is_throttle_mix_min()?
https://github.com/ArduPilot/ardupilot/blob/master/ArduCopter/land_detector.cpp#L63

Do you think that having:
MOT_SPIN_MIN=.225
MOT_THST_HOVER=.33

defeats the current land detection logic?

The only way that I can see that the first check would executed is if the last set of logic that sets land_complete(true) didn’t disarm the motors for some reason. The code appears to disarm the motors when land_complete is set.

Perhaps related problems:

http://discuss.ardupilot.org/t/copter-3-4-rc5-almost-flip-landing-detection-failure/11520

http://discuss.ardupilot.org/t/fail-to-disarm-after-landing/14140

http://discuss.ardupilot.org/t/post-landing-flip-with-3-4-2-rc2/13001

I tried running these parameters in the simulator

MOT_SPIN_ARM 0.220000
MOT_SPIN_MAX 1.000000
MOT_SPIN_MIN 0.225000
MOT_THST_EXPO 0.000000
MOT_THST_HOVER 0.360000

but the simulator didn’t exhibit the behavior we are seeing. Are there other parameters that would impact landing detection?

I updated most of the parameters in SITL to match my copter’s and noticed that the output to the motors didn’t decrease to 1000 or even RCMIN3:

3.BIN (1.8 MB)

copter-landing.param (9.7 KB)

I noticed that the simulator would not turn off the motors after landing with FS_THR_ENABLE=0, but would sometimes with 1. Not sure if it is a fluke in SITL or a real bug.

copter-landing.param (9.7 KB)

I also noticed that
param set RC3_MIN 1000
turned off the motors after landing whereas RC3_MIN 1100 didn’t turn off the motors.

Just noticed that if I set these parameters in SITL:
MOT_PWM_MAX 2000.000000
MOT_PWM_MIN 1000.000000
that the motors turn off even if RC3_MIN=1100.

The KDE ESCs don’t require calibration, but maybe these parameters need to be set for them?

Rob,

I have your thread open for at least a week but my time is lacking to look at it. But I can answer your last question: if your ESC have fixed min/max points, yes, you need to set up those parameters, otherwise ArduPilot will use whatever are the min/max of your RC3 values.

I agree with @OXINARF that if the ESCs can’t be calibrated the MOT_PWM_MIN/MAX should be set. I’m pretty sure this is mentioned on the wiki but please tell me if you think it’s not clear enough.

I don’t think there’s a conflict in the code re MOT_SPIN_MIN value and the parts of the code that check 0.125*hover or hover/2. It’s hard to explain but the throttle output and hover throttle are in the 0 ~ 1 range where 0 is controlled by the MOT_SPIN_MIN.

The most likely cause of the failure to detect the landing is the vehicle’s accelerations are too high. That could also be caused by vibration. Really we’d need to see a log to be sure.

P.S. I’ve been off in Australia for the last two weeks at the ardupilot un-conference and then some unrelated work but I’m back on it now and hope to release AC3.5-rc2 this week.