172,6 → 172,7 |
signed int KopplungsteilNickRoll,KopplungsteilRollNick; |
signed int tmp_motorwert[MAX_MOTORS]; |
char VarioCharacter = ' '; |
unsigned int HooverGasEmergencyPercent = 0; // The gas value for Emergency landing |
|
#define LIMIT_MIN(value, min) {if(value <= min) value = min;} |
#define LIMIT_MAX(value, max) {if(value >= max) value = max;} |
678,12 → 679,19 |
static long ausgleichNick, ausgleichRoll; |
int IntegralNickMalFaktor,IntegralRollMalFaktor; |
unsigned char i; |
unsigned int HooverGas80Percent; |
Mittelwert(); |
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// Gaswert ermitteln |
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
HooverGas80Percent = HoverGas/(STICK_GAIN + STICK_GAIN/4); // 80% of Hovergas |
if(EE_Parameter.GlobalConfig3 & CFG3_VARIO_FAILSAFE) |
{ |
if(HoverGas && HoverGas < 150 * STICK_GAIN) |
{ |
HooverGasEmergencyPercent = (HoverGas/(STICK_GAIN) * EE_Parameter.NotGas) / 100; // i.e. 80% of Hovergas |
} |
else HooverGasEmergencyPercent = 45; // default if the Hoovergas was could not calculated yet |
} else HooverGasEmergencyPercent = EE_Parameter.NotGas; |
|
GasMischanteil = StickGas; |
if(GasMischanteil < MIN_GAS + 10) GasMischanteil = MIN_GAS + 10; |
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
701,11 → 709,7 |
ROT_ON; |
if(modell_fliegt > 1000 && Capacity.MinOfMaxPWM > 100) // wahrscheinlich in der Luft --> langsam absenken |
{ |
GasMischanteil = EE_Parameter.NotGas; |
if(EE_Parameter.GlobalConfig3 & CFG3_VARIO_FAILSAFE) |
{ |
if(HoverGas && HoverGas < 150 * STICK_GAIN) GasMischanteil = HooverGas80Percent; // 80% of Hovergas |
} |
GasMischanteil = HooverGasEmergencyPercent; |
FC_StatusFlags |= FC_STATUS_EMERGENCY_LANDING; |
PPM_diff[EE_Parameter.Kanalbelegung[K_NICK]] = 0; |
PPM_diff[EE_Parameter.Kanalbelegung[K_ROLL]] = 0; |
1735,13 → 1739,14 |
FC_StatusFlags |= (FC_STATUS_VARIO_TRIM_UP|FC_STATUS_VARIO_TRIM_DOWN); |
} // EOF no height control |
|
// limit gas to parameter setting |
// Linits the maximum gas in case of "Out of Range emergency landing" |
if(NC_To_FC_Flags & NC_TO_FC_EMERGENCY_LANDING) |
{ |
if(GasMischanteil/STICK_GAIN > HooverGas80Percent && HoverGas) GasMischanteil = HooverGas80Percent * STICK_GAIN; |
if(GasMischanteil/STICK_GAIN > HooverGasEmergencyPercent && HoverGas) GasMischanteil = HooverGasEmergencyPercent * STICK_GAIN; |
beeptime = 15000; |
BeepMuster = 0x0E00; |
} |
// limit gas to parameter setting |
LIMIT_MIN(GasMischanteil, (MIN_GAS + 10) * STICK_GAIN); |
if(GasMischanteil > (MAX_GAS - 20) * STICK_GAIN) GasMischanteil = (MAX_GAS - 20) * STICK_GAIN; |
|