Rev 1888 | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1888 | Rev 1892 | ||
---|---|---|---|
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 | #define ACC_AMPLIFY 6 |
11 | #define ACC_AMPLIFY 6 |
12 | 12 | ||
13 | // FC STATUS FLAGS |
13 | // FC STATUS FLAGS |
14 | #define FC_STATUS_MOTOR_RUN 0x01 |
14 | #define FC_STATUS_MOTOR_RUN 0x01 |
15 | #define FC_STATUS_FLY 0x02 |
15 | #define FC_STATUS_FLY 0x02 |
16 | #define FC_STATUS_CALIBRATE 0x04 |
16 | #define FC_STATUS_CALIBRATE 0x04 |
17 | #define FC_STATUS_START 0x08 |
17 | #define FC_STATUS_START 0x08 |
18 | #define FC_STATUS_EMERGENCY_LANDING 0x10 |
18 | #define FC_STATUS_EMERGENCY_LANDING 0x10 |
19 | #define FC_STATUS_LOWBAT 0x20 |
19 | #define FC_STATUS_LOWBAT 0x20 |
20 | #define FC_STATUS_VARIO_TRIM_UP 0x40 |
20 | #define FC_STATUS_VARIO_TRIM_UP 0x40 |
21 | #define FC_STATUS_VARIO_TRIM_DOWN 0x80 |
21 | #define FC_STATUS_VARIO_TRIM_DOWN 0x80 |
22 | 22 | ||
23 | // FC STATUS FLAGS2 |
23 | // FC STATUS FLAGS2 |
24 | #define FC_STATUS2_CAREFREE 0x01 |
24 | #define FC_STATUS2_CAREFREE 0x01 |
25 | #define FC_STATUS2_ALTITUDE_CONTROL 0x02 |
25 | #define FC_STATUS2_ALTITUDE_CONTROL 0x02 |
26 | 26 | ||
27 | extern volatile unsigned char FC_StatusFlags, FC_StatusFlags2; |
27 | extern volatile unsigned char FC_StatusFlags, FC_StatusFlags2; |
28 | extern void ParameterZuordnung(void); |
28 | extern void ParameterZuordnung(void); |
29 | 29 | ||
30 | #define Poti1 Poti[0] |
30 | #define Poti1 Poti[0] |
31 | #define Poti2 Poti[1] |
31 | #define Poti2 Poti[1] |
32 | #define Poti3 Poti[2] |
32 | #define Poti3 Poti[2] |
33 | #define Poti4 Poti[3] |
33 | #define Poti4 Poti[3] |
34 | #define Poti5 Poti[4] |
34 | #define Poti5 Poti[4] |
35 | #define Poti6 Poti[5] |
35 | #define Poti6 Poti[5] |
36 | #define Poti7 Poti[6] |
36 | #define Poti7 Poti[6] |
37 | #define Poti8 Poti[7] |
37 | #define Poti8 Poti[7] |
38 | 38 | ||
39 | extern unsigned char Sekunde,Minute; |
39 | extern unsigned char Sekunde,Minute; |
40 | extern unsigned int BaroExpandActive; |
40 | extern unsigned int BaroExpandActive; |
41 | extern long IntegralNick,IntegralNick2; |
41 | extern long IntegralNick,IntegralNick2; |
42 | extern long IntegralRoll,IntegralRoll2; |
42 | extern long IntegralRoll,IntegralRoll2; |
43 | //extern int IntegralNick,IntegralNick2; |
43 | //extern int IntegralNick,IntegralNick2; |
44 | //extern int IntegralRoll,IntegralRoll2; |
44 | //extern int IntegralRoll,IntegralRoll2; |
45 | extern unsigned char Poti[9]; |
45 | extern unsigned char Poti[9]; |
46 | 46 | ||
47 | extern long Mess_IntegralNick,Mess_IntegralNick2; |
47 | extern long Mess_IntegralNick,Mess_IntegralNick2; |
48 | extern long Mess_IntegralRoll,Mess_IntegralRoll2; |
48 | extern long Mess_IntegralRoll,Mess_IntegralRoll2; |
49 | extern long IntegralAccNick,IntegralAccRoll; |
49 | extern long IntegralAccNick,IntegralAccRoll; |
50 | extern long SummeNick,SummeRoll; |
50 | extern long SummeNick,SummeRoll; |
51 | extern volatile long Mess_Integral_Hoch; |
51 | extern volatile long Mess_Integral_Hoch; |
52 | extern long Integral_Gier,Mess_Integral_Gier,Mess_Integral_Gier2; |
52 | extern long Integral_Gier,Mess_Integral_Gier,Mess_Integral_Gier2; |
53 | extern int KompassValue; |
53 | extern int KompassValue; |
54 | extern int KompassSollWert; |
54 | extern int KompassSollWert; |
55 | extern int KompassRichtung; |
55 | extern int KompassRichtung; |
56 | extern char CalculateCompassTimer; |
56 | extern char CalculateCompassTimer; |
57 | extern unsigned char KompassFusion; |
57 | extern unsigned char KompassFusion; |
58 | extern unsigned char ControlHeading; |
58 | extern unsigned char ControlHeading; |
59 | extern int TrimNick, TrimRoll; |
59 | extern int TrimNick, TrimRoll; |
60 | extern long ErsatzKompass; |
60 | extern long ErsatzKompass; |
61 | extern int ErsatzKompassInGrad; // Kompasswert in Grad |
61 | extern int ErsatzKompassInGrad; // Kompasswert in Grad |
62 | extern long HoehenWert; |
62 | extern long HoehenWert; |
63 | extern long SollHoehe; |
63 | extern long SollHoehe; |
64 | extern long FromNC_AltitudeSetpoint; |
64 | extern long FromNC_AltitudeSetpoint; |
65 | extern unsigned char FromNC_AltitudeSpeed; |
65 | extern unsigned char FromNC_AltitudeSpeed; |
66 | 66 | ||
67 | extern unsigned char CareFree; |
67 | extern unsigned char CareFree; |
68 | extern int MesswertNick,MesswertRoll,MesswertGier; |
68 | extern int MesswertNick,MesswertRoll,MesswertGier; |
69 | extern int AdNeutralNick,AdNeutralRoll,AdNeutralGier, Mittelwert_AccNick, Mittelwert_AccRoll; |
69 | extern int AdNeutralNick,AdNeutralRoll,AdNeutralGier, Mittelwert_AccNick, Mittelwert_AccRoll; |
70 | extern unsigned int NeutralAccX, NeutralAccY; |
70 | extern unsigned int NeutralAccX, NeutralAccY; |
71 | extern unsigned char HoehenReglerAktiv; |
71 | extern unsigned char HoehenReglerAktiv; |
72 | extern int NeutralAccZ; |
72 | extern int NeutralAccZ; |
73 | extern long Umschlag180Nick, Umschlag180Roll; |
73 | extern long Umschlag180Nick, Umschlag180Roll; |
74 | extern signed int ExternStickNick,ExternStickRoll,ExternStickGier; |
74 | extern signed int ExternStickNick,ExternStickRoll,ExternStickGier; |
75 | extern unsigned char Parameter_UserParam1,Parameter_UserParam2,Parameter_UserParam3,Parameter_UserParam4,Parameter_UserParam5,Parameter_UserParam6,Parameter_UserParam7,Parameter_UserParam8; |
75 | extern unsigned char Parameter_UserParam1,Parameter_UserParam2,Parameter_UserParam3,Parameter_UserParam4,Parameter_UserParam5,Parameter_UserParam6,Parameter_UserParam7,Parameter_UserParam8; |
76 | extern int NaviAccNick,NaviAccRoll,NaviCntAcc; |
76 | extern int NaviAccNick,NaviAccRoll,NaviCntAcc; |
77 | extern unsigned int modell_fliegt; |
77 | extern unsigned int modell_fliegt; |
78 | extern void MotorRegler(void); |
78 | extern void MotorRegler(void); |
79 | extern void SendMotorData(void); |
79 | extern void SendMotorData(void); |
80 | //void CalibrierMittelwert(void); |
80 | //void CalibrierMittelwert(void); |
81 | //void Mittelwert(void); |
81 | //void Mittelwert(void); |
82 | extern void SetNeutral(unsigned char AccAdjustment); |
82 | extern void SetNeutral(unsigned char AccAdjustment); |
83 | extern void Piep(unsigned char Anzahl, unsigned int dauer); |
83 | extern void Piep(unsigned char Anzahl, unsigned int dauer); |
84 | extern void CopyDebugValues(void); |
84 | extern void CopyDebugValues(void); |
85 | 85 | ||
86 | extern unsigned char h,m,s; |
86 | extern unsigned char h,m,s; |
87 | extern volatile unsigned char Timeout ; |
87 | extern volatile unsigned char Timeout ; |
88 | extern unsigned char CosinusNickWinkel, CosinusRollWinkel; |
88 | extern unsigned char CosinusNickWinkel, CosinusRollWinkel; |
89 | extern int DiffNick,DiffRoll; |
89 | extern int DiffNick,DiffRoll; |
90 | //extern int Poti1, Poti2, Poti3, Poti4; |
90 | //extern int Poti1, Poti2, Poti3, Poti4; |
91 | extern volatile unsigned char SenderOkay; |
91 | extern volatile unsigned char SenderOkay; |
92 | extern int StickNick,StickRoll,StickGier; |
92 | extern int StickNick,StickRoll,StickGier; |
93 | extern char MotorenEin; |
93 | extern char MotorenEin; |
94 | extern unsigned char Parameter_Servo3,Parameter_Servo4,Parameter_Servo5; |
94 | extern unsigned char Parameter_Servo3,Parameter_Servo4,Parameter_Servo5; |
95 | extern char VarioCharacter; |
95 | extern char VarioCharacter; |
96 | extern int HoverGas; |
96 | extern int HoverGas; |
97 | 97 | ||
98 | extern unsigned char Parameter_Luftdruck_D; |
98 | extern unsigned char Parameter_Luftdruck_D; |
99 | extern unsigned char Parameter_MaxHoehe; |
99 | extern unsigned char Parameter_MaxHoehe; |
100 | extern unsigned char Parameter_Hoehe_P; |
100 | extern unsigned char Parameter_Hoehe_P; |
101 | extern unsigned char Parameter_Hoehe_ACC_Wirkung; |
101 | extern unsigned char Parameter_Hoehe_ACC_Wirkung; |
102 | extern unsigned char Parameter_KompassWirkung; |
102 | extern unsigned char Parameter_KompassWirkung; |
103 | extern unsigned char Parameter_Gyro_P; |
103 | extern unsigned char Parameter_Gyro_P; |
104 | extern unsigned char Parameter_Gyro_I; |
104 | extern unsigned char Parameter_Gyro_I; |
105 | extern unsigned char Parameter_Gier_P; |
105 | extern unsigned char Parameter_Gier_P; // MartinR: deaktivieren, da unbenutzt ? |
106 | extern unsigned char Parameter_ServoNickControl; |
106 | extern unsigned char Parameter_ServoNickControl; |
107 | extern unsigned char Parameter_ServoRollControl; |
107 | extern unsigned char Parameter_ServoRollControl; |
108 | extern unsigned char Parameter_AchsKopplung1; |
108 | extern unsigned char Parameter_AchsKopplung1; |
109 | extern unsigned char Parameter_AchsKopplung2; |
109 | extern unsigned char Parameter_AchsKopplung2; |
110 | //extern unsigned char Parameter_AchsGegenKopplung1; |
110 | //extern unsigned char Parameter_AchsGegenKopplung1; |
111 | extern unsigned char Parameter_J16Bitmask; // for the J16 Output |
111 | extern unsigned char Parameter_J16Bitmask; // for the J16 Output |
112 | extern unsigned char Parameter_J16Timing; // for the J16 Output |
112 | extern unsigned char Parameter_J16Timing; // for the J16 Output |
113 | extern unsigned char Parameter_J17Bitmask; // for the J17 Output |
113 | extern unsigned char Parameter_J17Bitmask; // for the J17 Output |
114 | extern unsigned char Parameter_J17Timing; // for the J17 Output |
114 | extern unsigned char Parameter_J17Timing; // for the J17 Output |
115 | 115 | ||
116 | extern unsigned char Parameter_NaviGpsModeControl; // MartinR: wird wiederverwendet für GPS free bei HH |
116 | extern unsigned char Parameter_NaviGpsModeControl; // MartinR: wird wiederverwendet für GPS free bei HH |
117 | 117 | ||
118 | extern signed char MixerTable[MAX_MOTORS][4]; |
118 | extern signed char MixerTable[MAX_MOTORS][4]; |
119 | extern const signed char sintab[31]; |
119 | extern const signed char sintab[31]; |
120 | #endif //_FC_H |
120 | #endif //_FC_H |
121 | 121 | ||
122 | 122 |