Subversion Repositories FlightCtrl

Rev

Details | Last modification | View Log | RSS feed

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