Subversion Repositories FlightCtrl

Compare Revisions

Ignore whitespace Rev 982 → Rev 983

/branches/KalmanFilter MikeW/FlightControl.c
55,6 → 55,7
unsigned char SenderOkay = 0;
unsigned int I2CTimeout = 100;
char MotorenEin = 0;
unsigned int modell_fliegt = 0;
 
extern unsigned long maxDistance;
extern signed int GPS_Nick, GPS_Roll;
75,6 → 76,7
**************************************************************************** */
void SetNeutral(void)
{
beeptime = 2000;
Delay_ms(1000);
if((EE_Parameter.GlobalConfig & CFG_HOEHENREGELUNG)) // Höhenregelung aktiviert?
{
167,16 → 169,36
LastAltitude = CurrentAltitude;
}
AirPressureCnt++;
 
//if ((GPS_Roll == 0 && GPS_Nick == 0) || (maxDistance / 10 > 10))
if(modell_fliegt < 0x250)
{
//if ((GPS_Roll == 0 && GPS_Nick == 0) || (maxDistance / 10 > 10))
AdNeutralNick = 0.998F * AdNeutralNick + 0.002F * AdWertNick_Raw;
AdNeutralRoll = 0.998F * AdNeutralRoll + 0.002F * AdWertRoll_Raw;
if (abs(StickGier) < 15 || MotorenEin == 0)
{
AdNeutralGier = 0.998F * AdNeutralGier + 0.002F * AdWertGier_Raw;
}
}
else if(modell_fliegt < 0x2000)
{
//if ((GPS_Roll == 0 && GPS_Nick == 0) || (maxDistance / 10 > 10))
AdNeutralNick = 0.999F * AdNeutralNick + 0.001F * AdWertNick_Raw;
AdNeutralRoll = 0.999F * AdNeutralRoll + 0.001F * AdWertRoll_Raw;
if (abs(StickGier) < 15 || MotorenEin == 0)
{
AdNeutralGier = 0.999F * AdNeutralGier + 0.001F * AdWertGier_Raw;
AdNeutralGier = 0.999F * AdNeutralGier + 0.001F * AdWertGier_Raw;
}
}
else
{
AdNeutralNick = 0.9995F * AdNeutralNick + 0.0005F * AdWertNick_Raw;
AdNeutralRoll = 0.9995F * AdNeutralRoll + 0.0005F * AdWertRoll_Raw;
if (abs(StickGier) < 15 || MotorenEin == 0)
{
AdNeutralGier = 0.9995F * AdNeutralGier + 0.0005F * AdWertGier_Raw;
}
}
#if 1
DebugOut.Analog[6] = AdWertNick_Raw;
187,7 → 209,7
DebugOut.Analog[10] = AdNeutralRoll;
DebugOut.Analog[11] = AdNeutralGier;
#endif
 
AccumulatedRoll = 0;
AccumulatedRoll_cnt = 0;
AccumulatedNick = 0;
258,7 → 280,6
{
static unsigned char delay_neutral = 0;
static unsigned char delay_einschalten = 0,delay_ausschalten = 0;
static unsigned int modell_fliegt = 0;
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// Gaswert ermitteln