Subversion Repositories FlightCtrl

Rev

Details | Last modification | View Log | RSS feed

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