Subversion Repositories FlightCtrl

Rev

Rev 1742 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
1 ingob 1
/*#######################################################################################
2
Flight Control
3
#######################################################################################*/
4
 
5
#ifndef _FC_H
6
#define _FC_H
1111 hbuss 7
//#define GIER_GRAD_FAKTOR 1291L // Abhängigkeit zwischen GyroIntegral und Winkel
1243 killagreg 8
//#define GIER_GRAD_FAKTOR 1160L
1121 hbuss 9
extern long GIER_GRAD_FAKTOR; // Abhängigkeit zwischen GyroIntegral und Winkel
855 hbuss 10
#define STICK_GAIN 4
1703 holgerb 11
#define ACC_AMPLIFY    6
921 hbuss 12
 
1420 killagreg 13
#define FCFLAG_MOTOR_RUN        0x01
14
#define FCFLAG_FLY              0x02
15
#define FCFLAG_CALIBRATE        0x04
16
#define FCFLAG_START            0x08
17
#define FCFLAG_NOTLANDUNG       0x10
18
#define FCFLAG_LOWBAT           0x20
19
#define FCFLAG_SPI_RX_ERR       0x40
1423 hbuss 20
#define FCFLAG_I2CERR           0x80
1254 killagreg 21
 
1702 holgerb 22
#define DEFEKT_G_NICK           0x01
23
#define DEFEKT_G_ROLL           0x02
24
#define DEFEKT_G_GIER           0x04
25
#define DEFEKT_A_NICK           0x08
26
#define DEFEKT_A_ROLL           0x10
27
#define DEFEKT_A_Z              0x20
28
#define DEFEKT_PRESSURE         0x40
29
#define DEFEKT_CAREFREE_ERR 0x80
30
 
31
#define DEFEKT_I2C              0x01
32
#define DEFEKT_BL_MISSING       0x02
33
#define DEFEKT_SPI_RX_ERR       0x04
34
#define DEFEKT_PPM_ERR          0x08
35
#define DEFEKT_MIXER_ERR    0x10
36
 
1377 hbuss 37
#define Poti1 Poti[0]
38
#define Poti2 Poti[1]
39
#define Poti3 Poti[2]
40
#define Poti4 Poti[3]
41
#define Poti5 Poti[4]
42
#define Poti6 Poti[5]
43
#define Poti7 Poti[6]
44
#define Poti8 Poti[7]
1254 killagreg 45
 
1749 - 46
extern unsigned char Motors0,Motors1,Motors2,Motors3,Motors4,Motors5,Motors6,Motors7;
47
extern unsigned char updatemotors;
48
extern unsigned char loop1, loop2, loop3, loop4;
49
extern unsigned char pos1, pos2, pos3, pos4;
50
extern int keynumber;
51
 
52
 
1739 - 53
extern signed char jetivalue1,jetivalue2,jetivalue3,jetivalue4;
1420 killagreg 54
extern volatile unsigned char FCFlags;
1 ingob 55
extern unsigned char Sekunde,Minute;
1352 hbuss 56
extern unsigned int BaroExpandActive;
693 hbuss 57
extern long IntegralNick,IntegralNick2;
58
extern long IntegralRoll,IntegralRoll2;
1153 hbuss 59
//extern int IntegralNick,IntegralNick2;
60
//extern int IntegralRoll,IntegralRoll2;
1420 killagreg 61
extern unsigned char Poti[9];
1153 hbuss 62
 
693 hbuss 63
extern long Mess_IntegralNick,Mess_IntegralNick2;
64
extern long Mess_IntegralRoll,Mess_IntegralRoll2;
65
extern long IntegralAccNick,IntegralAccRoll;
1685 holgerb 66
extern long SummeNick,SummeRoll;
1 ingob 67
extern volatile long Mess_Integral_Hoch;
693 hbuss 68
extern long Integral_Gier,Mess_Integral_Gier,Mess_Integral_Gier2;
1153 hbuss 69
extern int  KompassValue;
70
extern int  KompassStartwert;
71
extern int  KompassRichtung;
1664 holgerb 72
extern unsigned char ControlHeading;
1166 hbuss 73
extern int  TrimNick, TrimRoll;
717 hbuss 74
extern long  ErsatzKompass;
75
extern int   ErsatzKompassInGrad; // Kompasswert in Grad
1246 killagreg 76
extern long HoehenWert;
77
extern long SollHoehe;
1690 holgerb 78
extern unsigned char CareFree;
1153 hbuss 79
extern int MesswertNick,MesswertRoll,MesswertGier;
1703 holgerb 80
extern int AdNeutralNick,AdNeutralRoll,AdNeutralGier, Mittelwert_AccNick, Mittelwert_AccRoll;
1643 holgerb 81
extern unsigned int NeutralAccX, NeutralAccY;
1215 hbuss 82
extern unsigned char HoehenReglerAktiv;
1639 holgerb 83
extern int NeutralAccZ;
396 hbuss 84
extern long Umschlag180Nick, Umschlag180Roll;
492 hbuss 85
extern signed int ExternStickNick,ExternStickRoll,ExternStickGier;
513 hbuss 86
extern unsigned char Parameter_UserParam1,Parameter_UserParam2,Parameter_UserParam3,Parameter_UserParam4,Parameter_UserParam5,Parameter_UserParam6,Parameter_UserParam7,Parameter_UserParam8;
805 hbuss 87
extern int NaviAccNick,NaviAccRoll,NaviCntAcc;
871 hbuss 88
extern unsigned int modell_fliegt;
1639 holgerb 89
extern void MotorRegler(void);
90
extern void SendMotorData(void);
1622 killagreg 91
//void CalibrierMittelwert(void);
92
//void Mittelwert(void);
1639 holgerb 93
extern void SetNeutral(unsigned char AccAdjustment);
94
extern void Piep(unsigned char Anzahl, unsigned int dauer);
95
extern void CopyDebugValues(void);
1 ingob 96
 
304 ingob 97
extern unsigned char h,m,s;
98
extern volatile unsigned char Timeout ;
99
extern unsigned char CosinusNickWinkel, CosinusRollWinkel;
1153 hbuss 100
extern int  DiffNick,DiffRoll;
1377 hbuss 101
//extern int  Poti1, Poti2, Poti3, Poti4;
304 ingob 102
extern volatile unsigned char SenderOkay;
103
extern int StickNick,StickRoll,StickGier;
104
extern char MotorenEin;
1403 hbuss 105
extern unsigned char Parameter_Servo3,Parameter_Servo4,Parameter_Servo5;
1591 holgerb 106
extern char VarioCharacter;
1692 holgerb 107
extern int HoverGas;
1739 - 108
extern int StickGas;
1 ingob 109
extern unsigned char Parameter_Luftdruck_D;
110
extern unsigned char Parameter_MaxHoehe;
111
extern unsigned char Parameter_Hoehe_P;
112
extern unsigned char Parameter_Hoehe_ACC_Wirkung;
113
extern unsigned char Parameter_KompassWirkung;
114
extern unsigned char Parameter_Gyro_P;
115
extern unsigned char Parameter_Gyro_I;
116
extern unsigned char Parameter_Gier_P;
117
extern unsigned char Parameter_ServoNickControl;
1232 hbuss 118
extern unsigned char Parameter_ServoRollControl;
396 hbuss 119
extern unsigned char Parameter_AchsKopplung1;
1120 hbuss 120
extern unsigned char Parameter_AchsKopplung2;
121
//extern unsigned char Parameter_AchsGegenKopplung1;
921 hbuss 122
extern unsigned char Parameter_J16Bitmask;             // for the J16 Output
123
extern unsigned char Parameter_J16Timing;              // for the J16 Output
124
extern unsigned char Parameter_J17Bitmask;             // for the J17 Output
125
extern unsigned char Parameter_J17Timing;              // for the J17 Output
1243 killagreg 126
extern signed char MixerTable[MAX_MOTORS][4];
1 ingob 127
#endif //_FC_H
128