Subversion Repositories FlightCtrl

Rev

Rev 2418 | Rev 2427 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2418 Rev 2426
Line 258... Line 258...
258
// Messwerte beim Ermitteln der Nullage
258
// Messwerte beim Ermitteln der Nullage
259
void CalibrierMittelwert(void)
259
void CalibrierMittelwert(void)
260
//############################################################################
260
//############################################################################
261
{
261
{
262
    unsigned char i;
262
    unsigned char i;
263
    if(PlatinenVersion == 13) SucheGyroOffset();
263
//    if(PlatinenVersion == 13) SucheGyroOffset();
264
    // ADC auschalten, damit die Werte sich nicht während der Berechnung ändern
264
    // ADC auschalten, damit die Werte sich nicht während der Berechnung ändern
265
        ANALOG_OFF;
265
        ANALOG_OFF;
266
        MesswertNick = AdWertNick;
266
        MesswertNick = AdWertNick;
267
        MesswertRoll = AdWertRoll;
267
        MesswertRoll = AdWertRoll;
268
        MesswertGier = AdWertGier;
268
        MesswertGier = AdWertGier;
Line 546... Line 546...
546
 
546
 
547
   MesswertNick = HiResNick / 8;
547
   MesswertNick = HiResNick / 8;
Line 548... Line 548...
548
   MesswertRoll = HiResRoll / 8;
548
   MesswertRoll = HiResRoll / 8;
549
 
549
 
-
 
550
   if(AdWertNick < 15)   MesswertNick = -1000;  if(AdWertNick <  7)   MesswertNick = -2000;
550
   if(AdWertNick < 15)   MesswertNick = -1000;  if(AdWertNick <  7)   MesswertNick = -2000;
551
//   if(PlatinenVersion == 10)  { if(AdWertNick > 1010) MesswertNick = +1000;  if(AdWertNick > 1017) MesswertNick = +2000; }
551
   if(PlatinenVersion == 10)  { if(AdWertNick > 1010) MesswertNick = +1000;  if(AdWertNick > 1017) MesswertNick = +2000; }
552
//   else  
552
   else  {  if(AdWertNick > 2000) MesswertNick = +1000;  if(AdWertNick > 2015) MesswertNick = +2000; }
553
   {  if(AdWertNick > 2000) MesswertNick = +1000;  if(AdWertNick > 2015) MesswertNick = +2000; }
-
 
554
   if(AdWertRoll < 15)   MesswertRoll = -1000;  if(AdWertRoll <  7)   MesswertRoll = -2000;
553
   if(AdWertRoll < 15)   MesswertRoll = -1000;  if(AdWertRoll <  7)   MesswertRoll = -2000;
555
//   if(PlatinenVersion == 10) { if(AdWertRoll > 1010) MesswertRoll = +1000;  if(AdWertRoll > 1017) MesswertRoll = +2000; }
Line 554... Line 556...
554
   if(PlatinenVersion == 10) { if(AdWertRoll > 1010) MesswertRoll = +1000;  if(AdWertRoll > 1017) MesswertRoll = +2000; }
556
//   else 
555
   else { if(AdWertRoll > 2000) MesswertRoll = +1000;  if(AdWertRoll > 2015) MesswertRoll = +2000;  }
557
   { if(AdWertRoll > 2000) MesswertRoll = +1000;  if(AdWertRoll > 2015) MesswertRoll = +2000;  }
556
 
558
 
557
  if(Parameter_Gyro_D)
559
  if(Parameter_Gyro_D)
Line 1619... Line 1621...
1619
    GasMischanteil = ((unsigned int)GasMischanteil * BattLowVoltageWarning) / UBat; // Gas auf das aktuelle Spannungvieveau beziehen
1621
    GasMischanteil = ((unsigned int)GasMischanteil * BattLowVoltageWarning) / UBat; // Gas auf das aktuelle Spannungvieveau beziehen
1620
  }
1622
  }
1621
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1623
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1622
// Auto-Landing
1624
// Auto-Landing
1623
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1625
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1624
#if (defined(__AVR_ATmega1284__) || defined(__AVR_ATmega1284P__))
1626
//#if (defined(__AVR_ATmega1284__) || defined(__AVR_ATmega1284P__))
1625
 static unsigned char slower;
1627
 static unsigned char slower;
1626
 if(!slower--)
1628
 if(!slower--)
1627
  {
1629
  {
1628
   static unsigned int u_filter = 0;
1630
   static unsigned int u_filter = 0;
1629
   if(!u_filter) u_filter = UBat;
1631
   if(!u_filter) u_filter = UBat;
Line 1645... Line 1647...
1645
  if(LowVoltageLandingActive && FromNC_AltitudeSetpoint >= 0)
1647
  if(LowVoltageLandingActive && FromNC_AltitudeSetpoint >= 0)
1646
     {
1648
     {
1647
                FromNC_AltitudeSpeed = EE_Parameter.LandingSpeed;
1649
                FromNC_AltitudeSpeed = EE_Parameter.LandingSpeed;
1648
                FromNC_AltitudeSetpoint = -20000;
1650
                FromNC_AltitudeSetpoint = -20000;
1649
         }
1651
         }
1650
#endif
1652
//#endif
1651
//DebugOut.Analog[16] = StickGasMiddle;
1653
//DebugOut.Analog[16] = StickGasMiddle;
1652
if(BytegapSPI == 0)  SPI_TransmitByte();
1654
if(BytegapSPI == 0)  SPI_TransmitByte();
Line 1653... Line 1655...
1653
 
1655
 
1654
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1656
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++