Subversion Repositories FlightCtrl

Compare Revisions

Ignore whitespace Rev 971 → Rev 972

/branches/KalmanFilter MikeW/FlightControl.c
168,15 → 168,15
LastAltitude = CurrentAltitude;
}
AirPressureCnt++;
 
//if ((GPS_Roll == 0 && GPS_Nick == 0) || (maxDistance / 10 > 10))
{
Roll_X_Offset = 0.9995F * Roll_X_Offset + 0.0005F * (float) (MAX(-60, MIN(60,AverageRoll_X)));
Roll_Y_Offset = 0.9995F * Roll_Y_Offset + 0.0005F * (float) (MAX(-60, MIN(60,AverageRoll_Y)));
Roll_X_Offset = 0.9995F * Roll_X_Offset + 0.0005F * (float) (MAX(-60, MIN(60,AverageRoll_X)));
Roll_Y_Offset = 0.9995F * Roll_Y_Offset + 0.0005F * (float) (MAX(-60, MIN(60,AverageRoll_Y)));
if (abs(StickGier) < 15 || MotorenEin == 0)
{
Roll_Z_Offset = 0.9998F * Roll_Z_Offset + 0.0002F * (float) ( MAX(-60, MIN(60,AverageRoll_Z)));
Roll_Z_Offset = 0.9998F * Roll_Z_Offset + 0.0002F * (float) ( MAX(-60, MIN(60,AverageRoll_Z)));
}
}
419,7 → 419,6
int motorwert = 0;
int pd_ergebnis;
/*****************************************************************************
Update noimial attitude
**************************************************************************** */
474,6 → 473,7
//DebugOut.Analog[13] = (int) GasMischanteil;
#ifdef X_FORMATION
/* Overide in case the remote link got lost */
if (RemoteLinkLost == 0)
{ /* We are flying in X-Formation */
486,6 → 486,21
StickNick45 = (int) (0.707F * (float)(-GPS_Roll) + 0.707F * (float)(-GPS_Nick));
StickGier = 0;
}
#else
/* Overide in case the remote link got lost */
if (RemoteLinkLost == 0)
{ /* We are flying in X-Formation */
StickRoll45 = StickRoll - GPS_Roll;
StickNick45 = StickNick - GPS_Nick;
}
else
{ /* GPS overide is aktive */
StickRoll45 = -GPS_Roll;
StickNick45 = -GPS_Nick;
StickGier = 0;
}
#endif
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// Yaw
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++