Subversion Repositories FlightCtrl

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
1 ingob 1
/*#######################################################################################
2
Flight Control
3
#######################################################################################*/
4
 
5
#ifndef _FC_H
6
#define _FC_H
1111 hbuss 7
//#define GIER_GRAD_FAKTOR 1291L // Abhängigkeit zwischen GyroIntegral und Winkel
1243 killagreg 8
//#define GIER_GRAD_FAKTOR 1160L
1121 hbuss 9
extern long GIER_GRAD_FAKTOR; // Abhängigkeit zwischen GyroIntegral und Winkel
855 hbuss 10
#define STICK_GAIN 4
1703 holgerb 11
#define ACC_AMPLIFY    6
921 hbuss 12
 
1420 killagreg 13
#define FCFLAG_MOTOR_RUN        0x01
14
#define FCFLAG_FLY              0x02
15
#define FCFLAG_CALIBRATE        0x04
16
#define FCFLAG_START            0x08
17
#define FCFLAG_NOTLANDUNG       0x10
18
#define FCFLAG_LOWBAT           0x20
19
#define FCFLAG_SPI_RX_ERR       0x40
1423 hbuss 20
#define FCFLAG_I2CERR           0x80
1254 killagreg 21
 
1702 holgerb 22
#define DEFEKT_G_NICK           0x01
23
#define DEFEKT_G_ROLL           0x02
24
#define DEFEKT_G_GIER           0x04
25
#define DEFEKT_A_NICK           0x08
26
#define DEFEKT_A_ROLL           0x10
27
#define DEFEKT_A_Z              0x20
28
#define DEFEKT_PRESSURE         0x40
29
#define DEFEKT_CAREFREE_ERR 0x80
30
 
31
#define DEFEKT_I2C              0x01
32
#define DEFEKT_BL_MISSING       0x02
33
#define DEFEKT_SPI_RX_ERR       0x04
34
#define DEFEKT_PPM_ERR          0x08
35
#define DEFEKT_MIXER_ERR    0x10
36
 
1377 hbuss 37
#define Poti1 Poti[0]
38
#define Poti2 Poti[1]
39
#define Poti3 Poti[2]
40
#define Poti4 Poti[3]
41
#define Poti5 Poti[4]
42
#define Poti6 Poti[5]
43
#define Poti7 Poti[6]
44
#define Poti8 Poti[7]
1254 killagreg 45
 
1420 killagreg 46
extern volatile unsigned char FCFlags;
1 ingob 47
extern unsigned char Sekunde,Minute;
1352 hbuss 48
extern unsigned int BaroExpandActive;
693 hbuss 49
extern long IntegralNick,IntegralNick2;
50
extern long IntegralRoll,IntegralRoll2;
1153 hbuss 51
//extern int IntegralNick,IntegralNick2;
52
//extern int IntegralRoll,IntegralRoll2;
1420 killagreg 53
extern unsigned char Poti[9];
1153 hbuss 54
 
693 hbuss 55
extern long Mess_IntegralNick,Mess_IntegralNick2;
56
extern long Mess_IntegralRoll,Mess_IntegralRoll2;
57
extern long IntegralAccNick,IntegralAccRoll;
1685 holgerb 58
extern long SummeNick,SummeRoll;
1 ingob 59
extern volatile long Mess_Integral_Hoch;
693 hbuss 60
extern long Integral_Gier,Mess_Integral_Gier,Mess_Integral_Gier2;
1153 hbuss 61
extern int  KompassValue;
62
extern int  KompassStartwert;
63
extern int  KompassRichtung;
1664 holgerb 64
extern unsigned char ControlHeading;
1166 hbuss 65
extern int  TrimNick, TrimRoll;
717 hbuss 66
extern long  ErsatzKompass;
67
extern int   ErsatzKompassInGrad; // Kompasswert in Grad
1246 killagreg 68
extern long HoehenWert;
69
extern long SollHoehe;
1690 holgerb 70
extern unsigned char CareFree;
1153 hbuss 71
extern int MesswertNick,MesswertRoll,MesswertGier;
1703 holgerb 72
extern int AdNeutralNick,AdNeutralRoll,AdNeutralGier, Mittelwert_AccNick, Mittelwert_AccRoll;
1643 holgerb 73
extern unsigned int NeutralAccX, NeutralAccY;
1215 hbuss 74
extern unsigned char HoehenReglerAktiv;
1639 holgerb 75
extern int NeutralAccZ;
396 hbuss 76
extern long Umschlag180Nick, Umschlag180Roll;
492 hbuss 77
extern signed int ExternStickNick,ExternStickRoll,ExternStickGier;
513 hbuss 78
extern unsigned char Parameter_UserParam1,Parameter_UserParam2,Parameter_UserParam3,Parameter_UserParam4,Parameter_UserParam5,Parameter_UserParam6,Parameter_UserParam7,Parameter_UserParam8;
805 hbuss 79
extern int NaviAccNick,NaviAccRoll,NaviCntAcc;
871 hbuss 80
extern unsigned int modell_fliegt;
1639 holgerb 81
extern void MotorRegler(void);
82
extern void SendMotorData(void);
1622 killagreg 83
//void CalibrierMittelwert(void);
84
//void Mittelwert(void);
1639 holgerb 85
extern void SetNeutral(unsigned char AccAdjustment);
86
extern void Piep(unsigned char Anzahl, unsigned int dauer);
87
extern void CopyDebugValues(void);
1 ingob 88
 
304 ingob 89
extern unsigned char h,m,s;
90
extern volatile unsigned char Timeout ;
91
extern unsigned char CosinusNickWinkel, CosinusRollWinkel;
1153 hbuss 92
extern int  DiffNick,DiffRoll;
1377 hbuss 93
//extern int  Poti1, Poti2, Poti3, Poti4;
304 ingob 94
extern volatile unsigned char SenderOkay;
95
extern int StickNick,StickRoll,StickGier;
96
extern char MotorenEin;
1403 hbuss 97
extern unsigned char Parameter_Servo3,Parameter_Servo4,Parameter_Servo5;
1591 holgerb 98
extern char VarioCharacter;
1692 holgerb 99
extern int HoverGas;
1 ingob 100
 
101
extern unsigned char Parameter_Luftdruck_D;
102
extern unsigned char Parameter_MaxHoehe;
103
extern unsigned char Parameter_Hoehe_P;
104
extern unsigned char Parameter_Hoehe_ACC_Wirkung;
105
extern unsigned char Parameter_KompassWirkung;
106
extern unsigned char Parameter_Gyro_P;
107
extern unsigned char Parameter_Gyro_I;
108
extern unsigned char Parameter_Gier_P;
109
extern unsigned char Parameter_ServoNickControl;
1232 hbuss 110
extern unsigned char Parameter_ServoRollControl;
396 hbuss 111
extern unsigned char Parameter_AchsKopplung1;
1120 hbuss 112
extern unsigned char Parameter_AchsKopplung2;
113
//extern unsigned char Parameter_AchsGegenKopplung1;
921 hbuss 114
extern unsigned char Parameter_J16Bitmask;             // for the J16 Output
115
extern unsigned char Parameter_J16Timing;              // for the J16 Output
116
extern unsigned char Parameter_J17Bitmask;             // for the J17 Output
117
extern unsigned char Parameter_J17Timing;              // for the J17 Output
1243 killagreg 118
extern signed char MixerTable[MAX_MOTORS][4];
1760 holgerb 119
extern const signed char sintab[31];
1 ingob 120
#endif //_FC_H
121