Subversion Repositories FlightCtrl

Compare Revisions

Ignore whitespace Rev 2260 → Rev 2261

/test_branches/FC2_2/analog.c
193,8 → 193,8
static signed int accy, accx;
static long tmpLuftdruck = 0;
static long result[16];
// static signed char rampcount=1;
static unsigned char messanzahl_Druck = 0;
long AltLoss;
#define ANZ_RING 32
//static long VarioRing[ANZ_RING];
//static unsigned char RingPtr = 0;
329,6 → 329,8
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
vv = (vvSum + 512)/1024; // cm/s
HoeheAlt = HoehenWert;
SummenHoehe = SummenHoehe - HoehenWertF + vv + HoehenWert; //Fusion Hoehe
/test_branches/FC2_2/fc.c
165,7 → 165,7
unsigned char Parameter_MaximumAltitude;
unsigned char Parameter_Servo3,Parameter_Servo4,Parameter_Servo5;
unsigned char CareFree = 0;
signed char AccShorter = 0;
//signed char AccShorter = 0;
const signed char sintab[31] = { 0, 2, 4, 6, 7, 8, 8, 8, 7, 6, 4, 2, 0, -2, -4, -6, -7, -8, -8, -8, -7, -6, -4, -2, 0, 2, 4, 6, 7, 8, 8}; // 15° steps
 
signed int ExternStickNick = 0,ExternStickRoll = 0,ExternStickGier = 0, ExternHoehenValue = -20;
203,7 → 203,7
DebugOut.Analog[16] = Variance;
DebugOut.Analog[17] = vv;
DebugOut.Analog[18] = HoehenWertF;
DebugOut.Analog[19] = Parameter_Hoehe_ACC_Wirkung;
DebugOut.Analog[19] = Parameter_UserParam1;
DebugOut.Analog[20] = ServoNickValue;
DebugOut.Analog[22] = Capacity.ActualCurrent;
DebugOut.Analog[23] = Capacity.UsedCapacity;
1423,9 → 1423,9
#else
#define OPA_OFFSET_STEP 10
#endif
int HCGas, HeightDeviation = 0,GasReduction = 0;
int HCGas, GasReduction = 0;
static int HeightTrimming = 0; // rate for change of height setpoint
static int FilterHCGas = 0;
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
1520,7 → 1520,7
LIMIT_MAX(CosAttitude, 60); // limit effective attitude angle
CosAttitude = c_cos_8192(CosAttitude); // cos of actual attitude
//AccShorter = CosAttitude / 32 - 256;
AccShorter = (CosAttitude - 8192) / 40;
//AccShorter = (CosAttitude - 8192) / 40;
VarioCharacter = ' ';
AltitudeSetpointTrimming = 0;
if(HoehenReglerAktiv && !(FC_StatusFlags & FC_STATUS_EMERGENCY_LANDING))
1550,6 → 1550,7
{ // gas stick is above hoover point
if(StickGas > (StickGasHover + HEIGHT_CONTROL_STICKTHRESHOLD) && !BaroAtUpperLimit)
{
if(HeightDeviation > 20) SollHoehe = HoehenWertF; // update setpoint to current heigth
if(FC_StatusFlags & FC_STATUS_VARIO_TRIM_DOWN)
{
FC_StatusFlags &= ~FC_STATUS_VARIO_TRIM_DOWN;
/test_branches/FC2_2/fc.h
33,7 → 33,7
 
extern volatile unsigned char FC_StatusFlags, FC_StatusFlags2;
extern void ParameterZuordnung(void);
extern signed char AccShorter;
//extern signed char AccShorter;
 
#define Poti1 Poti[0]
#define Poti2 Poti[1]