Subversion Repositories FlightCtrl

Rev

Rev 1984 | 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
 
1916 holgerb 13
// FC_StatusFlags
1765 killagreg 14
#define FC_STATUS_MOTOR_RUN                             0x01
15
#define FC_STATUS_FLY                                   0x02
16
#define FC_STATUS_CALIBRATE                             0x04
17
#define FC_STATUS_START                                 0x08
18
#define FC_STATUS_EMERGENCY_LANDING             0x10
19
#define FC_STATUS_LOWBAT                                0x20
1767 killagreg 20
#define FC_STATUS_VARIO_TRIM_UP                 0x40
21
#define FC_STATUS_VARIO_TRIM_DOWN               0x80
1254 killagreg 22
 
1916 holgerb 23
// FC_StatusFlags2
1861 holgerb 24
#define FC_STATUS2_CAREFREE                 0x01
25
#define FC_STATUS2_ALTITUDE_CONTROL         0x02
1916 holgerb 26
#define FC_STATUS2_RC_FAILSAVE_ACTIVE       0x04
1702 holgerb 27
 
1861 holgerb 28
extern volatile unsigned char FC_StatusFlags, FC_StatusFlags2;
1862 holgerb 29
extern void ParameterZuordnung(void);
1861 holgerb 30
 
1377 hbuss 31
#define Poti1 Poti[0]
32
#define Poti2 Poti[1]
33
#define Poti3 Poti[2]
34
#define Poti4 Poti[3]
35
#define Poti5 Poti[4]
36
#define Poti6 Poti[5]
37
#define Poti7 Poti[6]
38
#define Poti8 Poti[7]
1254 killagreg 39
 
1921 holgerb 40
#define CHK_POTI(b,a) {if(a < 248) b = a; else b = Poti[255 - a];}
1933 holgerb 41
#define CHK_POTI_OFF(b,a,off) {if(a < 248) b = a; else b = Poti[255 - a] - off;}
1921 holgerb 42
#define CHK_POTI_MM(b,a,min,max) {CHK_POTI(b,a); LIMIT_MIN_MAX(b, min, max);}
1933 holgerb 43
#define CHK_POTI_MM_OFF(b,a,min,max,off) {CHK_POTI_OFF(b,a,off); LIMIT_MIN_MAX(b, min, max);}
1921 holgerb 44
 
1 ingob 45
extern unsigned char Sekunde,Minute;
1352 hbuss 46
extern unsigned int BaroExpandActive;
693 hbuss 47
extern long IntegralNick,IntegralNick2;
48
extern long IntegralRoll,IntegralRoll2;
1153 hbuss 49
//extern int IntegralNick,IntegralNick2;
50
//extern int IntegralRoll,IntegralRoll2;
1420 killagreg 51
extern unsigned char Poti[9];
1153 hbuss 52
 
693 hbuss 53
extern long Mess_IntegralNick,Mess_IntegralNick2;
54
extern long Mess_IntegralRoll,Mess_IntegralRoll2;
55
extern long IntegralAccNick,IntegralAccRoll;
1685 holgerb 56
extern long SummeNick,SummeRoll;
1 ingob 57
extern volatile long Mess_Integral_Hoch;
693 hbuss 58
extern long Integral_Gier,Mess_Integral_Gier,Mess_Integral_Gier2;
1153 hbuss 59
extern int  KompassValue;
1837 holgerb 60
extern int  KompassSollWert;
1153 hbuss 61
extern int  KompassRichtung;
1839 holgerb 62
extern char CalculateCompassTimer;
63
extern unsigned char KompassFusion;
1664 holgerb 64
extern unsigned char ControlHeading;
1166 hbuss 65
extern int  TrimNick, TrimRoll;
717 hbuss 66
extern long  ErsatzKompass;
67
extern int   ErsatzKompassInGrad; // Kompasswert in Grad
1246 killagreg 68
extern long HoehenWert;
69
extern long SollHoehe;
1855 holgerb 70
extern long FromNC_AltitudeSetpoint;
71
extern unsigned char FromNC_AltitudeSpeed;
1921 holgerb 72
extern unsigned char Parameter_HoehenSchalter;      // Wert : 0-250
1690 holgerb 73
extern unsigned char CareFree;
1153 hbuss 74
extern int MesswertNick,MesswertRoll,MesswertGier;
1703 holgerb 75
extern int AdNeutralNick,AdNeutralRoll,AdNeutralGier, Mittelwert_AccNick, Mittelwert_AccRoll;
1643 holgerb 76
extern unsigned int NeutralAccX, NeutralAccY;
1215 hbuss 77
extern unsigned char HoehenReglerAktiv;
1639 holgerb 78
extern int NeutralAccZ;
396 hbuss 79
extern long Umschlag180Nick, Umschlag180Roll;
492 hbuss 80
extern signed int ExternStickNick,ExternStickRoll,ExternStickGier;
513 hbuss 81
extern unsigned char Parameter_UserParam1,Parameter_UserParam2,Parameter_UserParam3,Parameter_UserParam4,Parameter_UserParam5,Parameter_UserParam6,Parameter_UserParam7,Parameter_UserParam8;
805 hbuss 82
extern int NaviAccNick,NaviAccRoll,NaviCntAcc;
871 hbuss 83
extern unsigned int modell_fliegt;
1639 holgerb 84
extern void MotorRegler(void);
85
extern void SendMotorData(void);
1622 killagreg 86
//void CalibrierMittelwert(void);
87
//void Mittelwert(void);
1639 holgerb 88
extern void SetNeutral(unsigned char AccAdjustment);
89
extern void Piep(unsigned char Anzahl, unsigned int dauer);
90
extern void CopyDebugValues(void);
1 ingob 91
 
304 ingob 92
extern unsigned char h,m,s;
1943 holgerb 93
extern int StickNick,StickRoll,StickGier,StickGas;
304 ingob 94
extern volatile unsigned char Timeout ;
95
extern unsigned char CosinusNickWinkel, CosinusRollWinkel;
1153 hbuss 96
extern int  DiffNick,DiffRoll;
1377 hbuss 97
//extern int  Poti1, Poti2, Poti3, Poti4;
304 ingob 98
extern volatile unsigned char SenderOkay;
99
extern int StickNick,StickRoll,StickGier;
100
extern char MotorenEin;
1403 hbuss 101
extern unsigned char Parameter_Servo3,Parameter_Servo4,Parameter_Servo5;
1591 holgerb 102
extern char VarioCharacter;
1942 holgerb 103
extern signed int AltitudeSetpointTrimming;
104
extern signed char WaypointTrimming;
1692 holgerb 105
extern int HoverGas;
1 ingob 106
extern unsigned char Parameter_Luftdruck_D;
107
extern unsigned char Parameter_MaxHoehe;
108
extern unsigned char Parameter_Hoehe_P;
109
extern unsigned char Parameter_Hoehe_ACC_Wirkung;
110
extern unsigned char Parameter_KompassWirkung;
111
extern unsigned char Parameter_Gyro_P;
112
extern unsigned char Parameter_Gyro_I;
113
extern unsigned char Parameter_Gier_P;
114
extern unsigned char Parameter_ServoNickControl;
1232 hbuss 115
extern unsigned char Parameter_ServoRollControl;
396 hbuss 116
extern unsigned char Parameter_AchsKopplung1;
1120 hbuss 117
extern unsigned char Parameter_AchsKopplung2;
118
//extern unsigned char Parameter_AchsGegenKopplung1;
921 hbuss 119
extern unsigned char Parameter_J16Bitmask;             // for the J16 Output
120
extern unsigned char Parameter_J16Timing;              // for the J16 Output
121
extern unsigned char Parameter_J17Bitmask;             // for the J17 Output
122
extern unsigned char Parameter_J17Timing;              // for the J17 Output
1916 holgerb 123
extern unsigned char Parameter_GlobalConfig;
124
extern unsigned char Parameter_ExtraConfig;
1243 killagreg 125
extern signed char MixerTable[MAX_MOTORS][4];
1760 holgerb 126
extern const signed char sintab[31];
1 ingob 127
#endif //_FC_H
128