Rev 1639 | Rev 1652 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1639 | Rev 1643 | ||
---|---|---|---|
1 | /*####################################################################################### |
1 | /*####################################################################################### |
2 | Flight Control |
2 | Flight Control |
3 | #######################################################################################*/ |
3 | #######################################################################################*/ |
4 | 4 | ||
5 | #ifndef _FC_H |
5 | #ifndef _FC_H |
6 | #define _FC_H |
6 | #define _FC_H |
7 | //#define GIER_GRAD_FAKTOR 1291L // Abhängigkeit zwischen GyroIntegral und Winkel |
7 | //#define GIER_GRAD_FAKTOR 1291L // Abhängigkeit zwischen GyroIntegral und Winkel |
8 | //#define GIER_GRAD_FAKTOR 1160L |
8 | //#define GIER_GRAD_FAKTOR 1160L |
9 | extern long GIER_GRAD_FAKTOR; // Abhängigkeit zwischen GyroIntegral und Winkel |
9 | extern long GIER_GRAD_FAKTOR; // Abhängigkeit zwischen GyroIntegral und Winkel |
10 | #define STICK_GAIN 4 |
10 | #define STICK_GAIN 4 |
11 | 11 | ||
12 | #define FCFLAG_MOTOR_RUN 0x01 |
12 | #define FCFLAG_MOTOR_RUN 0x01 |
13 | #define FCFLAG_FLY 0x02 |
13 | #define FCFLAG_FLY 0x02 |
14 | #define FCFLAG_CALIBRATE 0x04 |
14 | #define FCFLAG_CALIBRATE 0x04 |
15 | #define FCFLAG_START 0x08 |
15 | #define FCFLAG_START 0x08 |
16 | #define FCFLAG_NOTLANDUNG 0x10 |
16 | #define FCFLAG_NOTLANDUNG 0x10 |
17 | #define FCFLAG_LOWBAT 0x20 |
17 | #define FCFLAG_LOWBAT 0x20 |
18 | #define FCFLAG_SPI_RX_ERR 0x40 |
18 | #define FCFLAG_SPI_RX_ERR 0x40 |
19 | #define FCFLAG_I2CERR 0x80 |
19 | #define FCFLAG_I2CERR 0x80 |
20 | 20 | ||
21 | #define Poti1 Poti[0] |
21 | #define Poti1 Poti[0] |
22 | #define Poti2 Poti[1] |
22 | #define Poti2 Poti[1] |
23 | #define Poti3 Poti[2] |
23 | #define Poti3 Poti[2] |
24 | #define Poti4 Poti[3] |
24 | #define Poti4 Poti[3] |
25 | #define Poti5 Poti[4] |
25 | #define Poti5 Poti[4] |
26 | #define Poti6 Poti[5] |
26 | #define Poti6 Poti[5] |
27 | #define Poti7 Poti[6] |
27 | #define Poti7 Poti[6] |
28 | #define Poti8 Poti[7] |
28 | #define Poti8 Poti[7] |
29 | 29 | ||
30 | 30 | ||
31 | extern volatile unsigned char FCFlags; |
31 | extern volatile unsigned char FCFlags; |
32 | extern volatile unsigned int I2CTimeout; |
32 | extern volatile unsigned int I2CTimeout; |
33 | extern unsigned char Sekunde,Minute; |
33 | extern unsigned char Sekunde,Minute; |
34 | extern unsigned int BaroExpandActive; |
34 | extern unsigned int BaroExpandActive; |
35 | extern long IntegralNick,IntegralNick2; |
35 | extern long IntegralNick,IntegralNick2; |
36 | extern long IntegralRoll,IntegralRoll2; |
36 | extern long IntegralRoll,IntegralRoll2; |
37 | //extern int IntegralNick,IntegralNick2; |
37 | //extern int IntegralNick,IntegralNick2; |
38 | //extern int IntegralRoll,IntegralRoll2; |
38 | //extern int IntegralRoll,IntegralRoll2; |
39 | extern unsigned char Poti[9]; |
39 | extern unsigned char Poti[9]; |
40 | 40 | ||
41 | extern long Mess_IntegralNick,Mess_IntegralNick2; |
41 | extern long Mess_IntegralNick,Mess_IntegralNick2; |
42 | extern long Mess_IntegralRoll,Mess_IntegralRoll2; |
42 | extern long Mess_IntegralRoll,Mess_IntegralRoll2; |
43 | extern long IntegralAccNick,IntegralAccRoll; |
43 | extern long IntegralAccNick,IntegralAccRoll; |
44 | extern volatile long Mess_Integral_Hoch; |
44 | extern volatile long Mess_Integral_Hoch; |
45 | extern long Integral_Gier,Mess_Integral_Gier,Mess_Integral_Gier2; |
45 | extern long Integral_Gier,Mess_Integral_Gier,Mess_Integral_Gier2; |
46 | extern int KompassValue; |
46 | extern int KompassValue; |
47 | extern int KompassStartwert; |
47 | extern int KompassStartwert; |
48 | extern int KompassRichtung; |
48 | extern int KompassRichtung; |
49 | extern int TrimNick, TrimRoll; |
49 | extern int TrimNick, TrimRoll; |
50 | extern long ErsatzKompass; |
50 | extern long ErsatzKompass; |
51 | extern int ErsatzKompassInGrad; // Kompasswert in Grad |
51 | extern int ErsatzKompassInGrad; // Kompasswert in Grad |
52 | extern long HoehenWert; |
52 | extern long HoehenWert; |
53 | extern long SollHoehe; |
53 | extern long SollHoehe; |
54 | extern int MesswertNick,MesswertRoll,MesswertGier; |
54 | extern int MesswertNick,MesswertRoll,MesswertGier; |
55 | extern int AdNeutralNick,AdNeutralRoll,AdNeutralGier, Mittelwert_AccNick, Mittelwert_AccRoll; |
55 | extern int AdNeutralNick,AdNeutralRoll,AdNeutralGier, Mittelwert_AccNick, Mittelwert_AccRoll,Mittelwert_AccHoch; |
56 | extern int NeutralAccX, NeutralAccY,Mittelwert_AccHoch; |
56 | extern unsigned int NeutralAccX, NeutralAccY; |
57 | extern unsigned char HoehenReglerAktiv; |
57 | extern unsigned char HoehenReglerAktiv; |
58 | extern int NeutralAccZ; |
58 | extern int NeutralAccZ; |
59 | extern long Umschlag180Nick, Umschlag180Roll; |
59 | extern long Umschlag180Nick, Umschlag180Roll; |
60 | extern signed int ExternStickNick,ExternStickRoll,ExternStickGier; |
60 | extern signed int ExternStickNick,ExternStickRoll,ExternStickGier; |
61 | extern unsigned char Parameter_UserParam1,Parameter_UserParam2,Parameter_UserParam3,Parameter_UserParam4,Parameter_UserParam5,Parameter_UserParam6,Parameter_UserParam7,Parameter_UserParam8; |
61 | extern unsigned char Parameter_UserParam1,Parameter_UserParam2,Parameter_UserParam3,Parameter_UserParam4,Parameter_UserParam5,Parameter_UserParam6,Parameter_UserParam7,Parameter_UserParam8; |
62 | extern int NaviAccNick,NaviAccRoll,NaviCntAcc; |
62 | extern int NaviAccNick,NaviAccRoll,NaviCntAcc; |
63 | extern unsigned int modell_fliegt; |
63 | extern unsigned int modell_fliegt; |
64 | extern void MotorRegler(void); |
64 | extern void MotorRegler(void); |
65 | extern void SendMotorData(void); |
65 | extern void SendMotorData(void); |
66 | //void CalibrierMittelwert(void); |
66 | //void CalibrierMittelwert(void); |
67 | //void Mittelwert(void); |
67 | //void Mittelwert(void); |
68 | extern void SetNeutral(unsigned char AccAdjustment); |
68 | extern void SetNeutral(unsigned char AccAdjustment); |
69 | extern void Piep(unsigned char Anzahl, unsigned int dauer); |
69 | extern void Piep(unsigned char Anzahl, unsigned int dauer); |
70 | extern void CopyDebugValues(void); |
70 | extern void CopyDebugValues(void); |
71 | 71 | ||
72 | extern unsigned char h,m,s; |
72 | extern unsigned char h,m,s; |
73 | extern volatile unsigned char Timeout ; |
73 | extern volatile unsigned char Timeout ; |
74 | extern unsigned char CosinusNickWinkel, CosinusRollWinkel; |
74 | extern unsigned char CosinusNickWinkel, CosinusRollWinkel; |
75 | extern int DiffNick,DiffRoll; |
75 | extern int DiffNick,DiffRoll; |
76 | //extern int Poti1, Poti2, Poti3, Poti4; |
76 | //extern int Poti1, Poti2, Poti3, Poti4; |
77 | extern volatile unsigned char SenderOkay; |
77 | extern volatile unsigned char SenderOkay; |
78 | extern int StickNick,StickRoll,StickGier; |
78 | extern int StickNick,StickRoll,StickGier; |
79 | extern char MotorenEin; |
79 | extern char MotorenEin; |
80 | extern unsigned char RequiredMotors; |
80 | extern unsigned char RequiredMotors; |
81 | extern unsigned char Parameter_Servo3,Parameter_Servo4,Parameter_Servo5; |
81 | extern unsigned char Parameter_Servo3,Parameter_Servo4,Parameter_Servo5; |
82 | extern char VarioCharacter; |
82 | extern char VarioCharacter; |
83 | 83 | ||
84 | extern unsigned char Parameter_Luftdruck_D; |
84 | extern unsigned char Parameter_Luftdruck_D; |
85 | extern unsigned char Parameter_MaxHoehe; |
85 | extern unsigned char Parameter_MaxHoehe; |
86 | extern unsigned char Parameter_Hoehe_P; |
86 | extern unsigned char Parameter_Hoehe_P; |
87 | extern unsigned char Parameter_Hoehe_ACC_Wirkung; |
87 | extern unsigned char Parameter_Hoehe_ACC_Wirkung; |
88 | extern unsigned char Parameter_KompassWirkung; |
88 | extern unsigned char Parameter_KompassWirkung; |
89 | extern unsigned char Parameter_Gyro_P; |
89 | extern unsigned char Parameter_Gyro_P; |
90 | extern unsigned char Parameter_Gyro_I; |
90 | extern unsigned char Parameter_Gyro_I; |
91 | extern unsigned char Parameter_Gier_P; |
91 | extern unsigned char Parameter_Gier_P; |
92 | extern unsigned char Parameter_ServoNickControl; |
92 | extern unsigned char Parameter_ServoNickControl; |
93 | extern unsigned char Parameter_ServoRollControl; |
93 | extern unsigned char Parameter_ServoRollControl; |
94 | extern unsigned char Parameter_AchsKopplung1; |
94 | extern unsigned char Parameter_AchsKopplung1; |
95 | extern unsigned char Parameter_AchsKopplung2; |
95 | extern unsigned char Parameter_AchsKopplung2; |
96 | //extern unsigned char Parameter_AchsGegenKopplung1; |
96 | //extern unsigned char Parameter_AchsGegenKopplung1; |
97 | extern unsigned char Parameter_J16Bitmask; // for the J16 Output |
97 | extern unsigned char Parameter_J16Bitmask; // for the J16 Output |
98 | extern unsigned char Parameter_J16Timing; // for the J16 Output |
98 | extern unsigned char Parameter_J16Timing; // for the J16 Output |
99 | extern unsigned char Parameter_J17Bitmask; // for the J17 Output |
99 | extern unsigned char Parameter_J17Bitmask; // for the J17 Output |
100 | extern unsigned char Parameter_J17Timing; // for the J17 Output |
100 | extern unsigned char Parameter_J17Timing; // for the J17 Output |
101 | extern signed char MixerTable[MAX_MOTORS][4]; |
101 | extern signed char MixerTable[MAX_MOTORS][4]; |
102 | #endif //_FC_H |
102 | #endif //_FC_H |
103 | 103 | ||
104 | 104 |