Subversion Repositories FlightCtrl

Rev

Rev 1880 | 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
 
1765 killagreg 13
// FC STATUS FLAGS
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
 
1861 holgerb 23
// FC STATUS FLAGS2
24
#define FC_STATUS2_CAREFREE                 0x01
25
#define FC_STATUS2_ALTITUDE_CONTROL         0x02
1702 holgerb 26
 
1861 holgerb 27
extern volatile unsigned char FC_StatusFlags, FC_StatusFlags2;
1862 holgerb 28
extern void ParameterZuordnung(void);
1861 holgerb 29
 
1377 hbuss 30
#define Poti1 Poti[0]
31
#define Poti2 Poti[1]
32
#define Poti3 Poti[2]
33
#define Poti4 Poti[3]
34
#define Poti5 Poti[4]
35
#define Poti6 Poti[5]
36
#define Poti7 Poti[6]
37
#define Poti8 Poti[7]
1254 killagreg 38
 
1897 - 39
/// MartinW; added vars
40
extern unsigned char Motors0,Motors1,Motors2,Motors3,Motors4,Motors5,Motors6,Motors7;
41
unsigned char Motors0max,Motors1max,Motors2max,Motors3max,Motors4max,Motors5max,Motors6max,Motors7max;
42
unsigned short MotorsTmax;
43
extern unsigned char updatemotors;
44
extern unsigned char loop1, loop2, loop3;
45
extern unsigned char settingdest;
46
extern unsigned char pos1, pos2, pos3, pos4;
47
extern int keynumber;
48
extern unsigned short CurrentOffset;///
49
extern signed char jetivalue1,jetivalue2,jetivalue3,jetivalue4;
50
 
51
extern int degreeold;
52
extern int degreedivold;
53
extern int degreediv;
54
extern unsigned int panograd;
55
extern unsigned char panotrigger;
56
extern int StickGas;
57
extern unsigned char calibration_done;
58
/// MartinW; added vars
59
 
60
 
1 ingob 61
extern unsigned char Sekunde,Minute;
1352 hbuss 62
extern unsigned int BaroExpandActive;
693 hbuss 63
extern long IntegralNick,IntegralNick2;
64
extern long IntegralRoll,IntegralRoll2;
1153 hbuss 65
//extern int IntegralNick,IntegralNick2;
66
//extern int IntegralRoll,IntegralRoll2;
1420 killagreg 67
extern unsigned char Poti[9];
1153 hbuss 68
 
693 hbuss 69
extern long Mess_IntegralNick,Mess_IntegralNick2;
70
extern long Mess_IntegralRoll,Mess_IntegralRoll2;
71
extern long IntegralAccNick,IntegralAccRoll;
1685 holgerb 72
extern long SummeNick,SummeRoll;
1 ingob 73
extern volatile long Mess_Integral_Hoch;
1897 - 74
//extern long Integral_Gier,Mess_Integral_Gier,Mess_Integral_Gier2;
75
extern long Integral_Gier,Mess_Integral_Gier;///
1153 hbuss 76
extern int  KompassValue;
1837 holgerb 77
extern int  KompassSollWert;
1153 hbuss 78
extern int  KompassRichtung;
1839 holgerb 79
extern char CalculateCompassTimer;
80
extern unsigned char KompassFusion;
1664 holgerb 81
extern unsigned char ControlHeading;
1166 hbuss 82
extern int  TrimNick, TrimRoll;
717 hbuss 83
extern long  ErsatzKompass;
84
extern int   ErsatzKompassInGrad; // Kompasswert in Grad
1246 killagreg 85
extern long HoehenWert;
86
extern long SollHoehe;
1855 holgerb 87
extern long FromNC_AltitudeSetpoint;
88
extern unsigned char FromNC_AltitudeSpeed;
89
 
1690 holgerb 90
extern unsigned char CareFree;
1153 hbuss 91
extern int MesswertNick,MesswertRoll,MesswertGier;
1703 holgerb 92
extern int AdNeutralNick,AdNeutralRoll,AdNeutralGier, Mittelwert_AccNick, Mittelwert_AccRoll;
1643 holgerb 93
extern unsigned int NeutralAccX, NeutralAccY;
1215 hbuss 94
extern unsigned char HoehenReglerAktiv;
1639 holgerb 95
extern int NeutralAccZ;
396 hbuss 96
extern long Umschlag180Nick, Umschlag180Roll;
492 hbuss 97
extern signed int ExternStickNick,ExternStickRoll,ExternStickGier;
513 hbuss 98
extern unsigned char Parameter_UserParam1,Parameter_UserParam2,Parameter_UserParam3,Parameter_UserParam4,Parameter_UserParam5,Parameter_UserParam6,Parameter_UserParam7,Parameter_UserParam8;
805 hbuss 99
extern int NaviAccNick,NaviAccRoll,NaviCntAcc;
871 hbuss 100
extern unsigned int modell_fliegt;
1639 holgerb 101
extern void MotorRegler(void);
102
extern void SendMotorData(void);
1622 killagreg 103
//void CalibrierMittelwert(void);
104
//void Mittelwert(void);
1639 holgerb 105
extern void SetNeutral(unsigned char AccAdjustment);
106
extern void Piep(unsigned char Anzahl, unsigned int dauer);
107
extern void CopyDebugValues(void);
1 ingob 108
 
304 ingob 109
extern unsigned char h,m,s;
110
extern volatile unsigned char Timeout ;
111
extern unsigned char CosinusNickWinkel, CosinusRollWinkel;
1153 hbuss 112
extern int  DiffNick,DiffRoll;
1377 hbuss 113
//extern int  Poti1, Poti2, Poti3, Poti4;
304 ingob 114
extern volatile unsigned char SenderOkay;
115
extern int StickNick,StickRoll,StickGier;
116
extern char MotorenEin;
1403 hbuss 117
extern unsigned char Parameter_Servo3,Parameter_Servo4,Parameter_Servo5;
1591 holgerb 118
extern char VarioCharacter;
1692 holgerb 119
extern int HoverGas;
1 ingob 120
 
121
extern unsigned char Parameter_Luftdruck_D;
122
extern unsigned char Parameter_MaxHoehe;
123
extern unsigned char Parameter_Hoehe_P;
124
extern unsigned char Parameter_Hoehe_ACC_Wirkung;
125
extern unsigned char Parameter_KompassWirkung;
126
extern unsigned char Parameter_Gyro_P;
127
extern unsigned char Parameter_Gyro_I;
128
extern unsigned char Parameter_Gier_P;
129
extern unsigned char Parameter_ServoNickControl;
1232 hbuss 130
extern unsigned char Parameter_ServoRollControl;
396 hbuss 131
extern unsigned char Parameter_AchsKopplung1;
1120 hbuss 132
extern unsigned char Parameter_AchsKopplung2;
133
//extern unsigned char Parameter_AchsGegenKopplung1;
921 hbuss 134
extern unsigned char Parameter_J16Bitmask;             // for the J16 Output
135
extern unsigned char Parameter_J16Timing;              // for the J16 Output
136
extern unsigned char Parameter_J17Bitmask;             // for the J17 Output
137
extern unsigned char Parameter_J17Timing;              // for the J17 Output
1243 killagreg 138
extern signed char MixerTable[MAX_MOTORS][4];
1760 holgerb 139
extern const signed char sintab[31];
1 ingob 140
#endif //_FC_H
141