Subversion Repositories FlightCtrl

Compare Revisions

Ignore whitespace Rev 2261 → Rev 2262

/test_branches/FC2_2/analog.c
69,7 → 69,7
unsigned char AnalogOffsetNick = 115,AnalogOffsetRoll = 115,AnalogOffsetGier = 115;
volatile unsigned char AdReady = 1;
volatile long HoehenWertF = 0, HoehenDiff, HoeheAlt;
volatile long vv, vvSum;
volatile long vv, vvSum, AccVertical;
//signed int AccZSum = 0;
 
//#######################################################################################
328,9 → 328,19
case 17:
HoehenDiff = HoehenWert - HoeheAlt;
// vvSum = vvSum - vv + ((Aktuell_az - NeutralAccZ) - AccShorter)*7 + HoehenDiff*500; // Fusion vert. velocity
vvSum = vvSum - vv + AdWertAccHoch*13 + HoehenDiff*500; // Fusion vert. velocity, T=2s
AltLoss = HoehenWertF - HoehenWert;
if((AltLoss > 50) && (Parameter_UserParam1 > 50)) vvSum -= AltLoss*2; // avoids height loss
J17_ON; //Qopter: testweise zur Rechenzeitmessung
if(Parameter_UserParam1 > 50)
{
AccVertical = (long)(AdWertAccHoch + 172)*CosAttitude/8192 - 172;
vvSum = vvSum - vv + AccVertical*13 + HoehenDiff*500; // Fusion vert. velocity, T=2s
}
else
{
vvSum = vvSum - vv + AdWertAccHoch*13 + HoehenDiff*500; // Fusion vert. velocity, T=2s
}
J17_OFF;
// AltLoss = HoehenWertF - HoehenWert;
// if((AltLoss > 50) && (Parameter_UserParam1 > 50)) vvSum -= AltLoss*2; // avoids height loss
vv = (vvSum + 512)/1024; // cm/s
HoeheAlt = HoehenWert;
SummenHoehe = SummenHoehe - HoehenWertF + vv + HoehenWert; //Fusion Hoehe
345,10 → 355,8
MessLuftdruck = ADC;
result[messanzahl_Druck] = MessLuftdruck - 523 * (long)ExpandBaro; // -523 counts per offset step
messanzahl_Druck = (messanzahl_Druck + 1)&(15);
//J17_ON; //Qopter: testweise zur Rechenzeitmessung
tmpLuftdruck = 0;
for(int j=0;j<16;j++) {tmpLuftdruck+=result[j];}
//J17_OFF;
// Luftdruck = tmpLuftdruck;
Luftdruck = (15 * Luftdruck + tmpLuftdruck) / 16; // noise reduction
HoehenWert = StartLuftdruck - Luftdruck;
/test_branches/FC2_2/fc.c
179,6 → 179,7
unsigned int HooverGasEmergencyPercent = 0; // The gas value for Emergency landing
unsigned int GasIsZeroCnt = 0; // to detect that the gas-stick is down for a while
int Variance = 0;
int CosAttitude; // for projection of hoover gas
 
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// Debugwerte zuordnen
1428,7 → 1429,7
static int HeightDeviation = 0, FilterHCGas = 0;
static unsigned long HoverGasFilter = 0;
static unsigned char delay = 100, BaroAtUpperLimit = 0, BaroAtLowerLimit = 0;
int CosAttitude; // for projection of hoover gas
// int CosAttitude; // for projection of hoover gas
 
// get the current hooverpoint
DebugOut.Analog[21] = HoverGas;
/test_branches/FC2_2/fc.h
136,5 → 136,6
extern unsigned char Parameter_ExtraConfig;
extern signed char MixerTable[MAX_MOTORS][4];
extern const signed char sintab[31];
extern int CosAttitude;
#endif //_FC_H