Subversion Repositories FlightCtrl

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
463 Nick666 1
/*#######################################################################################
2
Flight Control
3
#######################################################################################*/
4
 
5
#ifndef _FC_H
6
#define _FC_H
7
 
8
extern volatile unsigned char Timeout;
9
extern unsigned char Sekunde,Minute;
477 Nick666 10
extern long IntegralNick,IntegralNick2;
11
extern long IntegralRoll,IntegralRoll2;
12
extern long Integral_Gier;
463 Nick666 13
extern volatile long Mess_IntegralNick,Mess_IntegralNick2;
14
extern volatile long Mess_IntegralRoll,Mess_IntegralRoll2;
15
extern volatile long Mess_Integral_Hoch;
477 Nick666 16
extern volatile long Mess_Integral_Gier,Mess_Integral_Gier2;
470 Nick666 17
extern int KompassValue;
18
extern int KompassStartwert;
19
extern int KompassRichtung;
463 Nick666 20
extern int HoehenWert;
21
extern int SollHoehe;
477 Nick666 22
extern int MesswertNick,MesswertRoll,MesswertGier;
23
extern int Mittelwert_AccNick, Mittelwert_AccRoll,Mittelwert_AccHoch;
24
 
25
extern volatile int AdNeutralNick,AdNeutralRoll,AdNeutralGier;
26
extern volatile int NeutralAccX, NeutralAccY;
463 Nick666 27
extern volatile float NeutralAccZ;
28
 
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
void DefaultKonstanten1(void);
37
void DefaultKonstanten2(void);
38
 
39
unsigned char h,m,s;
470 Nick666 40
volatile unsigned char Timeout;
477 Nick666 41
 
42
 
43
int DiffNick,DiffRoll;
463 Nick666 44
extern int  Poti1, Poti2, Poti3, Poti4;
477 Nick666 45
volatile unsigned char Motor_Vorne,Motor_Hinten,Motor_Rechts,Motor_Links;
463 Nick666 46
unsigned char MotorWert[5];
47
volatile unsigned char SenderOkay;
48
int StickNick,StickRoll,StickGier;
49
char MotorenEin;
50
extern void DefaultKonstanten(void);
51
 
52
 
53
struct mk_param_struct
54
 {
55
   unsigned char Kanalbelegung[8];        // GAS[0], GIER[1],NICK[2], ROLL[3], POTI1, POTI2, POTI3
56
   unsigned char GlobalConfig;            // 0x01=Höhenregler aktiv,0x02=Kompass aktiv, 0x04=GPS aktiv, 0x08=Heading Hold aktiv
57
   unsigned char Hoehe_MinGas;            // Wert : 0-100
58
   unsigned char Luftdruck_D;             // Wert : 0-250
59
   unsigned char MaxHoehe;                // Wert : 0-32
60
   unsigned char Hoehe_P;                 // Wert : 0-32
61
   unsigned char Hoehe_Verstaerkung;      // Wert : 0-50
62
   unsigned char Hoehe_ACC_Wirkung;      // Wert : 0-250
63
   unsigned char Stick_P;                // Wert : 1-6
64
   unsigned char Stick_D;                // Wert : 0-64
65
   unsigned char Gier_P;                 // Wert : 1-20
66
   unsigned char Gas_Min;                // Wert : 0-32
67
   unsigned char Gas_Max;                // Wert : 33-250
68
   unsigned char GyroAccFaktor;          // Wert : 1-64
69
   unsigned char KompassWirkung;         // Wert : 0-32
70
   unsigned char Gyro_P;                 // Wert : 10-250
71
   unsigned char Gyro_I;                 // Wert : 0-250
72
   unsigned char UnterspannungsWarnung;  // Wert : 0-250
73
   unsigned char NotGas;                 // Wert : 0-250     //Gaswert bei Empängsverlust
74
   unsigned char NotGasZeit;             // Wert : 0-250     // Zeitbis auf NotGas geschaltet wird, wg. Rx-Problemen
75
   unsigned char UfoAusrichtung;         // X oder + Formation
76
   unsigned char I_Faktor;               // Wert : 0-250
77
   unsigned char UserParam1;             // Wert : 0-250
78
   unsigned char UserParam2;             // Wert : 0-250
79
   unsigned char UserParam3;             // Wert : 0-250
80
   unsigned char UserParam4;             // Wert : 0-250
81
   unsigned char ServoNickControl;       // Wert : 0-250     // Stellung des Servos
82
   unsigned char ServoNickComp;          // Wert : 0-250     // Einfluss Gyro/Servo
83
   unsigned char ServoNickMin;           // Wert : 0-250     // Anschlag
84
   unsigned char ServoNickMax;           // Wert : 0-250     // Anschlag
85
   unsigned char ServoNickRefresh;       // Wert : 0-250     // Richtung Einfluss Gyro/Servo
86
   unsigned char ServoNickCompInvert;    // Wert : 0-250     // Richtung Einfluss Gyro/Servo
87
   unsigned char Reserved[7];
88
   char Name[12];
89
 };
90
 
91
struct acc_neutral_struct
92
{
477 Nick666 93
        volatile int X;
94
        volatile int Y;
95
        volatile float Z;
463 Nick666 96
};
97
 
98
extern struct acc_neutral_struct acc_neutral;
99
extern void calib_acc(void);
100
 
101
 
102
extern struct mk_param_struct EE_Parameter;
103
 
104
extern unsigned char Parameter_Luftdruck_D;
105
extern unsigned char Parameter_MaxHoehe;
106
extern unsigned char Parameter_Hoehe_P;
107
extern unsigned char Parameter_Hoehe_ACC_Wirkung;
108
extern unsigned char Parameter_KompassWirkung;
109
extern unsigned char Parameter_Gyro_P;
110
extern unsigned char Parameter_Gyro_I;
111
extern unsigned char Parameter_Gier_P;
112
extern unsigned char Parameter_ServoNickControl;
113
 
114
#endif //_FC_H
115