Go to most recent revision | Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
758 | walter | 1 | /*####################################################################################### |
2 | Flight Control |
||
3 | #######################################################################################*/ |
||
4 | |||
5 | #ifndef _FC_H |
||
6 | #define _FC_H |
||
7 | |||
8 | extern volatile unsigned int I2CTimeout; |
||
9 | extern unsigned char Sekunde,Minute; |
||
10 | extern volatile long IntegralNick,IntegralNick2; |
||
11 | extern volatile long IntegralRoll,IntegralRoll2; |
||
12 | extern volatile long Mess_IntegralNick,Mess_IntegralNick2; |
||
13 | extern volatile long Mess_IntegralRoll,Mess_IntegralRoll2; |
||
14 | extern volatile long IntegralAccNick,IntegralAccRoll; |
||
15 | extern volatile long Mess_Integral_Hoch; |
||
16 | extern volatile long Integral_Gier,Mess_Integral_Gier,Mess_Integral_Gier2; |
||
17 | extern volatile int KompassValue; |
||
18 | extern volatile int KompassStartwert; |
||
19 | extern volatile int KompassRichtung; |
||
20 | extern int HoehenWert; |
||
21 | extern int SollHoehe; |
||
22 | extern volatile int MesswertNick,MesswertRoll,MesswertGier; |
||
23 | extern volatile int AdNeutralNick,AdNeutralRoll,AdNeutralGier, Mittelwert_AccNick, Mittelwert_AccRoll; |
||
24 | extern volatile int NeutralAccX, NeutralAccY,Mittelwert_AccHoch; |
||
25 | extern volatile float NeutralAccZ; |
||
26 | extern long Umschlag180Nick, Umschlag180Roll; |
||
27 | extern signed int ExternStickNick,ExternStickRoll,ExternStickGier; |
||
28 | extern unsigned char Parameter_UserParam1,Parameter_UserParam2,Parameter_UserParam3,Parameter_UserParam4,Parameter_UserParam5,Parameter_UserParam6,Parameter_UserParam7,Parameter_UserParam8; |
||
29 | |||
30 | void MotorRegler(void); |
||
31 | void SendMotorData(void); |
||
32 | void CalibrierMittelwert(void); |
||
33 | void Mittelwert(void); |
||
34 | void SetNeutral(void); |
||
35 | void Piep(unsigned char Anzahl); |
||
36 | extern void DefaultKonstanten(void); |
||
37 | void DefaultKonstanten1(void); |
||
38 | void DefaultKonstanten2(void); |
||
39 | void DefaultKonstanten3(void); |
||
40 | |||
41 | extern unsigned char h,m,s; |
||
42 | extern volatile unsigned char Timeout ; |
||
43 | extern unsigned char CosinusNickWinkel, CosinusRollWinkel; |
||
44 | extern volatile long IntegralNick,IntegralNick2; |
||
45 | extern volatile long IntegralRoll,IntegralRoll2; |
||
46 | extern volatile long Integral_Gier; |
||
47 | extern volatile long Mess_IntegralNick,Mess_IntegralNick2; |
||
48 | extern volatile long Mess_IntegralRoll,Mess_IntegralRoll2; |
||
49 | extern volatile long Mess_Integral_Gier; |
||
50 | extern volatile int DiffNick,DiffRoll; |
||
51 | extern int Poti1, Poti2, Poti3, Poti4; |
||
52 | extern volatile unsigned char Motor_Vorne,Motor_Hinten,Motor_Rechts,Motor_Links, Count; |
||
53 | extern unsigned char MotorWert[5]; |
||
54 | extern volatile unsigned char SenderOkay; |
||
55 | extern int StickNick,StickRoll,StickGier; |
||
56 | extern char MotorenEin; |
||
57 | extern void DefaultKonstanten1(void); |
||
58 | extern void DefaultKonstanten2(void); |
||
59 | |||
60 | #define STRUCT_PARAM_LAENGE 71 |
||
61 | struct mk_param_struct |
||
62 | { |
||
63 | unsigned char Kanalbelegung[8]; // GAS[0], GIER[1],NICK[2], ROLL[3], POTI1, POTI2, POTI3 |
||
64 | unsigned char GlobalConfig; // 0x01=Höhenregler aktiv,0x02=Kompass aktiv, 0x04=GPS aktiv, 0x08=Heading Hold aktiv |
||
65 | unsigned char Hoehe_MinGas; // Wert : 0-100 |
||
66 | unsigned char Luftdruck_D; // Wert : 0-250 |
||
67 | unsigned char MaxHoehe; // Wert : 0-32 |
||
68 | unsigned char Hoehe_P; // Wert : 0-32 |
||
69 | unsigned char Hoehe_Verstaerkung; // Wert : 0-50 |
||
70 | unsigned char Hoehe_ACC_Wirkung; // Wert : 0-250 |
||
71 | unsigned char Stick_P; // Wert : 1-6 |
||
72 | unsigned char Stick_D; // Wert : 0-64 |
||
73 | unsigned char Gier_P; // Wert : 1-20 |
||
74 | unsigned char Gas_Min; // Wert : 0-32 |
||
75 | unsigned char Gas_Max; // Wert : 33-250 |
||
76 | unsigned char GyroAccFaktor; // Wert : 1-64 |
||
77 | unsigned char KompassWirkung; // Wert : 0-32 |
||
78 | unsigned char Gyro_P; // Wert : 10-250 |
||
79 | unsigned char Gyro_I; // Wert : 0-250 |
||
80 | unsigned char UnterspannungsWarnung; // Wert : 0-250 |
||
81 | unsigned char NotGas; // Wert : 0-250 //Gaswert bei Empängsverlust |
||
82 | unsigned char NotGasZeit; // Wert : 0-250 // Zeitbis auf NotGas geschaltet wird, wg. Rx-Problemen |
||
83 | unsigned char UfoAusrichtung; // X oder + Formation |
||
84 | unsigned char I_Faktor; // Wert : 0-250 |
||
85 | unsigned char UserParam1; // Wert : 0-250 |
||
86 | unsigned char UserParam2; // Wert : 0-250 |
||
87 | unsigned char UserParam3; // Wert : 0-250 |
||
88 | unsigned char UserParam4; // Wert : 0-250 |
||
89 | unsigned char ServoNickControl; // Wert : 0-250 // Stellung des Servos |
||
90 | unsigned char ServoNickComp; // Wert : 0-250 // Einfluss Gyro/Servo |
||
91 | unsigned char ServoNickMin; // Wert : 0-250 // Anschlag |
||
92 | unsigned char ServoNickMax; // Wert : 0-250 // Anschlag |
||
93 | unsigned char ServoNickRefresh; // |
||
94 | unsigned char LoopGasLimit; // Wert: 0-250 max. Gas während Looping |
||
95 | unsigned char LoopThreshold; // Wert: 0-250 Schwelle für Stickausschlag |
||
96 | unsigned char LoopHysterese; // Wert: 0-250 Hysterese für Stickausschlag |
||
97 | unsigned char AchsKopplung1; // Wert: 0-250 Faktor, mit dem Gier die Achsen Roll und Nick koppelt (NickRollMitkopplung) |
||
98 | unsigned char AchsGegenKopplung1; // Wert: 0-250 Faktor, mit dem Gier die Achsen Roll und Nick Gegenkoppelt (NickRollGegenkopplung) |
||
99 | unsigned char WinkelUmschlagNick; // Wert: 0-250 180°-Punkt |
||
100 | unsigned char WinkelUmschlagRoll; // Wert: 0-250 180°-Punkt |
||
101 | unsigned char GyroAccAbgleich; // 1/k (Koppel_ACC_Wirkung) |
||
102 | unsigned char Driftkomp; |
||
103 | unsigned char DynamicStability; |
||
104 | unsigned char UserParam5; // Wert : 0-250 |
||
105 | unsigned char UserParam6; // Wert : 0-250 |
||
106 | unsigned char UserParam7; // Wert : 0-250 |
||
107 | unsigned char UserParam8; // Wert : 0-250 |
||
108 | |||
109 | //------------------------------------------------ |
||
110 | unsigned char LoopConfig; // Bitcodiert: 0x01=oben, 0x02=unten, 0x04=links, 0x08=rechts / wird getrennt behandelt |
||
111 | unsigned char ServoNickCompInvert; // Wert : 0-250 0 oder 1 // WICHTIG!!! am Ende lassen |
||
112 | unsigned char Reserved[4]; |
||
113 | char Name[12]; |
||
114 | }; |
||
115 | |||
116 | |||
117 | /* |
||
118 | unsigned char ServoNickMax; // Wert : 0-250 |
||
119 | unsigned char ServoNickRefresh; // |
||
120 | unsigned char LoopGasLimit; // Wert: 0-250 max. Gas während Looping |
||
121 | unsigned char LoopThreshold; // Wert: 0-250 Schwelle für Stickausschlag |
||
122 | //------------------------------------------------ |
||
123 | unsigned char LoopConfig; // Bitcodiert: 0x01=oben, 0x02=unten, 0x04=links, 0x08=rechts / wird getrennt behandelt |
||
124 | unsigned char ServoNickCompInvert; // Wert : 0-250 0 oder 1 // WICHTIG!!! am Ende lassen |
||
125 | unsigned char Reserved[4]; |
||
126 | char Name[12]; |
||
127 | */ |
||
128 | |||
129 | extern struct mk_param_struct EE_Parameter; |
||
130 | |||
131 | extern unsigned char Parameter_Luftdruck_D; |
||
132 | extern unsigned char Parameter_MaxHoehe; |
||
133 | extern unsigned char Parameter_Hoehe_P; |
||
134 | extern unsigned char Parameter_Hoehe_ACC_Wirkung; |
||
135 | extern unsigned char Parameter_KompassWirkung; |
||
136 | extern unsigned char Parameter_Gyro_P; |
||
137 | extern unsigned char Parameter_Gyro_I; |
||
138 | extern unsigned char Parameter_Gier_P; |
||
139 | extern unsigned char Parameter_ServoNickControl; |
||
140 | extern unsigned char Parameter_AchsKopplung1; |
||
141 | extern unsigned char Parameter_AchsGegenKopplung1; |
||
142 | |||
143 | |||
144 | #endif //_FC_H |
||
145 |