Rev 2390 | Rev 2404 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2390 | Rev 2402 | ||
---|---|---|---|
Line 1593... | Line 1593... | ||
1593 | // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
1593 | // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
1594 | if(!(FC_StatusFlags & FC_STATUS_LOWBAT)) |
1594 | if(!(FC_StatusFlags & FC_STATUS_LOWBAT)) |
1595 | { |
1595 | { |
1596 | GasMischanteil = ((unsigned int)GasMischanteil * BattLowVoltageWarning) / UBat; // Gas auf das aktuelle Spannungvieveau beziehen |
1596 | GasMischanteil = ((unsigned int)GasMischanteil * BattLowVoltageWarning) / UBat; // Gas auf das aktuelle Spannungvieveau beziehen |
1597 | } |
1597 | } |
1598 | - | ||
1599 | // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
1598 | // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
1600 | // Auto-Landing |
1599 | // Auto-Landing |
1601 | // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
1600 | // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
- | 1601 | #if (defined(__AVR_ATmega1284__) || defined(__AVR_ATmega1284P__)) |
|
1602 | static unsigned char slower; |
1602 | static unsigned char slower; |
1603 | if(!slower--) |
1603 | if(!slower--) |
1604 | { |
1604 | { |
- | 1605 | static unsigned int u_filter = 0; |
|
- | 1606 | if(!u_filter) u_filter = UBat; |
|
- | 1607 | if(UBat > u_filter) u_filter++; else |
|
- | 1608 | if(UBat < u_filter) u_filter--; |
|
1605 | slower = 50; // 10Hz |
1609 | slower = 100; // 5Hz |
- | 1610 | // if(FromNC_AltitudeSetpoint >= 0) hysteresis *= 2; |
|
1606 | if(UBat < EE_Parameter.AutoLandingVoltage) |
1611 | if(u_filter < EE_Parameter.AutoLandingVoltage) |
1607 | { |
1612 | { |
1608 | LowVoltageLandingActive = 20; // 2 sek |
1613 | LowVoltageLandingActive = 10; // 2 sek |
1609 | } |
1614 | } |
1610 | else if(UBat > EE_Parameter.AutoLandingVoltage + 2 && LowVoltageLandingActive) LowVoltageLandingActive--; |
1615 | else if(u_filter > EE_Parameter.AutoLandingVoltage + LipoCells && LowVoltageLandingActive) LowVoltageLandingActive--; |
1611 | } |
1616 | } |
1612 | if(LowVoltageLandingActive && FromNC_AltitudeSetpoint >= 0) |
1617 | if(LowVoltageLandingActive && FromNC_AltitudeSetpoint >= 0) |
1613 | { |
1618 | { |
1614 | FromNC_AltitudeSpeed = EE_Parameter.LandingSpeed; |
1619 | FromNC_AltitudeSpeed = EE_Parameter.LandingSpeed; |
1615 | FromNC_AltitudeSetpoint = -20000; |
1620 | FromNC_AltitudeSetpoint = -20000; |
1616 | } |
1621 | } |
1617 | 1622 | #endif |
|
1618 | //DebugOut.Analog[16] = StickGasMiddle; |
1623 | //DebugOut.Analog[16] = StickGasMiddle; |
1619 | // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
1624 | // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
1620 | // Höhenregelung |
1625 | // Höhenregelung |
1621 | // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
1626 | // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
1622 | GasMischanteil *= STICK_GAIN; |
1627 | GasMischanteil *= STICK_GAIN; |
Line 2184... | Line 2189... | ||
2184 | else if(Mixer.Motor[i][3] == -64) tmp_int -= GierMischanteil; |
2189 | else if(Mixer.Motor[i][3] == -64) tmp_int -= GierMischanteil; |
2185 | else tmp_int += ((long)GierMischanteil * Mixer.Motor[i][3]) / 64L; |
2190 | else tmp_int += ((long)GierMischanteil * Mixer.Motor[i][3]) / 64L; |
Line 2186... | Line 2191... | ||
2186 | 2191 | ||
2187 | if(Motor[i].Version & MOTOR_STATE_FAST_MODE || tmp_int > tmp_motorwert[i]) tmp_int = (tmp_motorwert[i] + tmp_int) / 2; // Beschleunigen |
2192 | if(Motor[i].Version & MOTOR_STATE_FAST_MODE || tmp_int > tmp_motorwert[i]) tmp_int = (tmp_motorwert[i] + tmp_int) / 2; // Beschleunigen |
2188 | else |
2193 | else |
2189 | { |
2194 | { // BL-Ctrl 1.0 or 2.0 |
2190 | if(EE_Parameter.MotorSmooth == 0) |
2195 | if(EE_Parameter.MotorSmooth == 0) |
2191 | { |
2196 | { |
2192 | tmp_int = 2 * tmp_int - tmp_motorwert[i]; // original MotorSmoothing |
2197 | tmp_int = 2 * tmp_int - tmp_motorwert[i]; // original MotorSmoothing |
2193 | } |
2198 | } |