From 0ece1a1fb397422472ee2bb9d0f20d63fc4f1470 Mon Sep 17 00:00:00 2001 From: Corvus Corax Date: Sun, 9 Mar 2014 10:00:58 +0100 Subject: [PATCH] OP-1216 removed "reverseThrottle" systemsetting and have reversethrottle implicitly allowed for REVERSABLEMOTOR type outputs --- flight/modules/Actuator/actuator.c | 23 ++++++------------- shared/uavobjectdefinition/systemsettings.xml | 8 ------- 2 files changed, 7 insertions(+), 24 deletions(-) diff --git a/flight/modules/Actuator/actuator.c b/flight/modules/Actuator/actuator.c index f8e354ddd..d33772606 100644 --- a/flight/modules/Actuator/actuator.c +++ b/flight/modules/Actuator/actuator.c @@ -170,7 +170,6 @@ static void actuatorTask(__attribute__((unused)) void *parameters) MixerStatusData mixerStatus; FlightStatusData flightStatus; SystemSettingsThrustControlOptions thrustType; - SystemSettingsAllowReverseThrottleOptions allowReverseThrottle; float throttleDesired; float collectiveDesired; @@ -228,7 +227,6 @@ static void actuatorTask(__attribute__((unused)) void *parameters) ActuatorDesiredGet(&desired); ActuatorCommandGet(&command); SystemSettingsThrustControlGet(&thrustType); - SystemSettingsAllowReverseThrottleGet(&allowReverseThrottle); // read in throttle and collective -demultiplex thrust switch (thrustType) { @@ -248,12 +246,10 @@ static void actuatorTask(__attribute__((unused)) void *parameters) bool armed = flightStatus.Armed == FLIGHTSTATUS_ARMED_ARMED; // safety settings - if (allowReverseThrottle == SYSTEMSETTINGS_ALLOWREVERSETHROTTLE_FALSE && (throttleDesired < 0 || !armed)) { - throttleDesired = -1; - } else if (allowReverseThrottle == SYSTEMSETTINGS_ALLOWREVERSETHROTTLE_TRUE && !armed) { + if (!armed) { throttleDesired = 0; } - if (throttleDesired < 0 || !armed) { + if (throttleDesired <= 0.00f || !armed) { // force set all other controls to zero if throttle is cut (previously set in Stabilization) if (actuatorSettings.LowThrottleZeroAxis.Roll == ACTUATORSETTINGS_LOWTHROTTLEZEROAXIS_TRUE) { desired.Roll = 0; @@ -283,14 +279,9 @@ static void actuatorTask(__attribute__((unused)) void *parameters) AlarmsClear(SYSTEMALARMS_ALARM_ACTUATOR); - bool activeThrottle; - // note: throttle==0 is an inactive throttle and turns motors off - if (allowReverseThrottle == SYSTEMSETTINGS_ALLOWREVERSETHROTTLE_TRUE) { - activeThrottle = throttleDesired > 0.00f || throttleDesired < 0.00f; - } else { - activeThrottle = throttleDesired > 0.00f; - } - bool spinWhileArmed = actuatorSettings.MotorsSpinWhileArmed == ACTUATORSETTINGS_MOTORSSPINWHILEARMED_TRUE; + bool activeThrottle = (throttleDesired < 0.00f || throttleDesired > 0.00f); + bool positiveThrottle = (throttleDesired > 0.00f); + bool spinWhileArmed = actuatorSettings.MotorsSpinWhileArmed == ACTUATORSETTINGS_MOTORSSPINWHILEARMED_TRUE; float curve1 = MixerCurve(throttleDesired, mixerSettings.ThrottleCurve1, MIXERSETTINGS_THROTTLECURVE1_NUMELEM); @@ -354,13 +345,13 @@ static void actuatorTask(__attribute__((unused)) void *parameters) if (mixers[ct].type == MIXERSETTINGS_MIXER1TYPE_MOTOR) { // If not armed or motors aren't meant to spin all the time if (!armed || - (!spinWhileArmed && !activeThrottle)) { + (!spinWhileArmed && !positiveThrottle)) { filterAccumulator[ct] = 0; lastResult[ct] = 0; status[ct] = -1; // force min throttle } // If armed meant to keep spinning, - else if ((spinWhileArmed && !activeThrottle) || + else if ((spinWhileArmed && !positiveThrottle) || (status[ct] < 0)) { status[ct] = 0; } diff --git a/shared/uavobjectdefinition/systemsettings.xml b/shared/uavobjectdefinition/systemsettings.xml index cafd62737..778b42e8d 100644 --- a/shared/uavobjectdefinition/systemsettings.xml +++ b/shared/uavobjectdefinition/systemsettings.xml @@ -15,14 +15,6 @@ use "collective" and use the collective channel to control the brakes for optimum autopilot performance) --> - -