From b96379cf783c2814887932ccaac1ef0d602105fc Mon Sep 17 00:00:00 2001 From: abeck70 Date: Sun, 19 Apr 2015 18:18:14 +1000 Subject: [PATCH] OP-1760 landing fixes : avoid false positives on ground detection from accel vibration Viper found that a badly mounted FC can trigger ground detection. --- flight/modules/PathFollower/vtollandfsm.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flight/modules/PathFollower/vtollandfsm.cpp b/flight/modules/PathFollower/vtollandfsm.cpp index 2594d0235..550c7f5d2 100644 --- a/flight/modules/PathFollower/vtollandfsm.cpp +++ b/flight/modules/PathFollower/vtollandfsm.cpp @@ -82,7 +82,7 @@ extern "C" { #define LANDING_PID_SCALAR_I 10.0f #define LANDING_SLOWDOWN_HEIGHT -5.0f #define BOUNCE_VELOCITY_TRIGGER_LIMIT -0.3f -#define BOUNCE_ACCELERATION_TRIGGER_LIMIT -6.0f +#define BOUNCE_ACCELERATION_TRIGGER_LIMIT -9.0f // -6.0 found to be too sensitive #define BOUNCE_TRIGGER_COUNT 4 #define GROUNDEFFECT_SLOWDOWN_FACTOR 0.3f #define GROUNDEFFECT_SLOWDOWN_COUNT 4 @@ -529,7 +529,7 @@ void VtolLandFSM::run_wtg_for_groundeffect(__attribute__((unused)) uint8_t flTim mLandData->fsmLandStatus.WtgForGroundEffect.BounceAccel = 0.0f; } - if (flBounce || flBounceAccel) { + if (flBounce ) { // || flBounceAccel) { // accel trigger can occur due to vibration and is too sensitive mLandData->observation2Count++; if (mLandData->observation2Count > BOUNCE_TRIGGER_COUNT) { setState(LAND_STATE_GROUNDEFFECT, (flBounce ? STATUSVTOLLAND_STATEEXITREASON_BOUNCEVELOCITY : STATUSVTOLLAND_STATEEXITREASON_BOUNCEACCEL)); @@ -594,7 +594,7 @@ void VtolLandFSM::run_groundeffect(__attribute__((unused)) uint8_t flTimeout) float north_error = mLandData->expectedLandPositionNorth - positionState.North; float east_error = mLandData->expectedLandPositionEast - positionState.East; float positionError = sqrtf(north_error * north_error + east_error * east_error); - if (positionError > 0.3f) { + if (positionError > 1.5f) { setState(LAND_STATE_THRUSTDOWN, STATUSVTOLLAND_STATEEXITREASON_POSITIONERROR); return; }