diff --git a/flight/Modules/Actuator/actuator.c b/flight/Modules/Actuator/actuator.c index 2766e1e0a..b2f143adf 100644 --- a/flight/Modules/Actuator/actuator.c +++ b/flight/Modules/Actuator/actuator.c @@ -198,8 +198,12 @@ static void actuatorTask(void* parameters) float curve2 = MixerCurve(desired.Throttle,mixerSettings.ThrottleCurve2); for(int ct=0; ct < MAX_MIX_ACTUATORS; ct++) { - if(mixers[ct].type == MIXERSETTINGS_MIXER1TYPE_DISABLED) + if(mixers[ct].type == MIXERSETTINGS_MIXER1TYPE_DISABLED) { + // Set to minimum if disabled. This is not the same as saying PWM pulse = 0 us + status[ct] = -1; + command.Channel[ct] = 0; continue; + } status[ct] = ProcessMixer(ct, curve1, curve2, &mixerSettings, &desired, dT); @@ -400,14 +404,19 @@ static void setFailsafe() // Reset ActuatorCommand to safe values for (int n = 0; n < ACTUATORCOMMAND_CHANNEL_NUMELEM; ++n) { + if(mixers[n].type == MIXERSETTINGS_MIXER1TYPE_MOTOR) { command.Channel[n] = settings.ChannelMin[n]; } - else + else if(mixers[n].type == MIXERSETTINGS_MIXER1TYPE_SERVO) { command.Channel[n] = settings.ChannelNeutral[n]; } + else + { + command.Channel[n] = 0; + } } // Set alarm