Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
1755 | - | 1 | /*####################################################################################### |
2 | Flight Control |
||
3 | #######################################################################################*/ |
||
4 | |||
5 | #ifndef _FC_H |
||
6 | #define _FC_H |
||
7 | //#define GIER_GRAD_FAKTOR 1291L // Abhängigkeit zwischen GyroIntegral und Winkel |
||
8 | //#define GIER_GRAD_FAKTOR 1160L |
||
9 | extern long GIER_GRAD_FAKTOR; // Abhängigkeit zwischen GyroIntegral und Winkel |
||
10 | #define STICK_GAIN 4 |
||
11 | #define ACC_AMPLIFY 6 |
||
12 | |||
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 |
||
20 | #define FCFLAG_I2CERR 0x80 |
||
21 | |||
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 | |||
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] |
||
45 | |||
46 | extern volatile unsigned char FCFlags; |
||
47 | extern unsigned char Sekunde,Minute; |
||
48 | extern unsigned int BaroExpandActive; |
||
49 | extern long IntegralNick,IntegralNick2; |
||
50 | extern long IntegralRoll,IntegralRoll2; |
||
51 | //extern int IntegralNick,IntegralNick2; |
||
52 | //extern int IntegralRoll,IntegralRoll2; |
||
53 | extern unsigned char Poti[9]; |
||
54 | |||
55 | extern long Mess_IntegralNick,Mess_IntegralNick2; |
||
56 | extern long Mess_IntegralRoll,Mess_IntegralRoll2; |
||
57 | extern long IntegralAccNick,IntegralAccRoll; |
||
58 | extern long SummeNick,SummeRoll; |
||
59 | extern volatile long Mess_Integral_Hoch; |
||
60 | extern long Integral_Gier,Mess_Integral_Gier,Mess_Integral_Gier2; |
||
61 | extern int KompassValue; |
||
62 | extern int KompassStartwert; |
||
63 | extern int KompassRichtung; |
||
64 | extern unsigned char ControlHeading; |
||
65 | extern int TrimNick, TrimRoll; |
||
66 | extern long ErsatzKompass; |
||
67 | extern int ErsatzKompassInGrad; // Kompasswert in Grad |
||
68 | extern long HoehenWert; |
||
69 | extern long SollHoehe; |
||
70 | extern unsigned char CareFree; |
||
71 | extern int MesswertNick,MesswertRoll,MesswertGier; |
||
72 | extern int AdNeutralNick,AdNeutralRoll,AdNeutralGier, Mittelwert_AccNick, Mittelwert_AccRoll; |
||
73 | extern unsigned int NeutralAccX, NeutralAccY; |
||
74 | extern unsigned char HoehenReglerAktiv; |
||
75 | extern int NeutralAccZ; |
||
76 | extern long Umschlag180Nick, Umschlag180Roll; |
||
77 | extern signed int ExternStickNick,ExternStickRoll,ExternStickGier; |
||
78 | extern unsigned char Parameter_UserParam1,Parameter_UserParam2,Parameter_UserParam3,Parameter_UserParam4,Parameter_UserParam5,Parameter_UserParam6,Parameter_UserParam7,Parameter_UserParam8; |
||
79 | extern int NaviAccNick,NaviAccRoll,NaviCntAcc; |
||
80 | extern unsigned int modell_fliegt; |
||
81 | extern void MotorRegler(void); |
||
82 | extern void SendMotorData(void); |
||
83 | //void CalibrierMittelwert(void); |
||
84 | //void Mittelwert(void); |
||
85 | extern void SetNeutral(unsigned char AccAdjustment); |
||
86 | extern void Piep(unsigned char Anzahl, unsigned int dauer); |
||
87 | extern void CopyDebugValues(void); |
||
88 | |||
89 | extern unsigned char h,m,s; |
||
90 | extern volatile unsigned char Timeout ; |
||
91 | extern unsigned char CosinusNickWinkel, CosinusRollWinkel; |
||
92 | extern int DiffNick,DiffRoll; |
||
93 | //extern int Poti1, Poti2, Poti3, Poti4; |
||
94 | extern volatile unsigned char SenderOkay; |
||
95 | extern int StickNick,StickRoll,StickGier; |
||
96 | extern char MotorenEin; |
||
97 | extern unsigned char Parameter_Servo3,Parameter_Servo4,Parameter_Servo5; |
||
98 | extern char VarioCharacter; |
||
99 | extern int HoverGas; |
||
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; |
||
110 | extern unsigned char Parameter_ServoRollControl; |
||
111 | extern unsigned char Parameter_AchsKopplung1; |
||
112 | extern unsigned char Parameter_AchsKopplung2; |
||
113 | //extern unsigned char Parameter_AchsGegenKopplung1; |
||
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 |
||
118 | extern signed char MixerTable[MAX_MOTORS][4]; |
||
119 | #endif //_FC_H |
||
120 |