Subversion Repositories FlightCtrl

Rev

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

Rev 2407 Rev 2408
Line 181... Line 181...
181
unsigned int GasIsZeroCnt = 0; // to detect that the gas-stick is down for a while
181
unsigned int GasIsZeroCnt = 0; // to detect that the gas-stick is down for a while
182
signed int Variance = 0;
182
signed int Variance = 0;
183
signed int CosAttitude; // for projection of hoover gas
183
signed int CosAttitude; // for projection of hoover gas
184
unsigned char ACC_AltitudeControl = 0;
184
unsigned char ACC_AltitudeControl = 0;
185
unsigned char LowVoltageLandingActive = 0;
185
unsigned char LowVoltageLandingActive = 0;
-
 
186
unsigned char LowVoltageHomeActive = 0;
Line 186... Line 187...
186
 
187
 
187
#if (defined(__AVR_ATmega1284__) || defined(__AVR_ATmega1284P__))
188
#if (defined(__AVR_ATmega1284__) || defined(__AVR_ATmega1284P__))
188
#define OPA_OFFSET_STEP 5
189
#define OPA_OFFSET_STEP 5
189
#else
190
#else
Line 1606... Line 1607...
1606
   static unsigned int u_filter = 0;
1607
   static unsigned int u_filter = 0;
1607
   if(!u_filter) u_filter = UBat;
1608
   if(!u_filter) u_filter = UBat;
1608
   if(UBat > u_filter) u_filter++; else
1609
   if(UBat > u_filter) u_filter++; else
1609
   if(UBat < u_filter) u_filter--;
1610
   if(UBat < u_filter) u_filter--;
1610
   slower = 100; // 5Hz
1611
   slower = 100; // 5Hz
1611
//   if(FromNC_AltitudeSetpoint >= 0) hysteresis *= 2;
-
 
1612
   if(u_filter < EE_Parameter.AutoLandingVoltage)
1612
   if(u_filter < EE_Parameter.AutoLandingVoltage)
1613
         {
1613
         {
1614
          LowVoltageLandingActive = 10; // 2 sek
1614
          LowVoltageLandingActive = 10; // 2 sek
1615
         }
1615
         }
1616
         else if(u_filter > EE_Parameter.AutoLandingVoltage + LipoCells && LowVoltageLandingActive) LowVoltageLandingActive--;
1616
         else if(u_filter > EE_Parameter.AutoLandingVoltage + LipoCells && LowVoltageLandingActive) LowVoltageLandingActive--;
-
 
1617
 
-
 
1618
   if(u_filter < EE_Parameter.ComingHomeVoltage)
-
 
1619
         {
-
 
1620
          LowVoltageHomeActive = 25; // min. 5 sek
-
 
1621
         }
-
 
1622
         else if(u_filter > EE_Parameter.ComingHomeVoltage + LipoCells && LowVoltageHomeActive) LowVoltageHomeActive--;
1617
  }
1623
  }
1618
  if(LowVoltageLandingActive && FromNC_AltitudeSetpoint >= 0)
1624
  if(LowVoltageLandingActive && FromNC_AltitudeSetpoint >= 0)
1619
     {
1625
     {
1620
                FromNC_AltitudeSpeed = EE_Parameter.LandingSpeed;
1626
                FromNC_AltitudeSpeed = EE_Parameter.LandingSpeed;
1621
                FromNC_AltitudeSetpoint = -20000;
1627
                FromNC_AltitudeSetpoint = -20000;