Subversion Repositories FlightCtrl

Rev

Rev 2093 | 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
 
2040 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
2040 holgerb 27
#define FC_STATUS2_OUT1_ACTIVE                  0x08
28
#define FC_STATUS2_OUT2_ACTIVE                  0x10
1702 holgerb 29
 
2009 holgerb 30
//NC_To_FC_Flags
31
#define NC_TO_FC_FLYING_RANGE           0x01
32
#define NC_TO_FC_EMERGENCY_LANDING      0x02
33
 
1861 holgerb 34
extern volatile unsigned char FC_StatusFlags, FC_StatusFlags2;
1862 holgerb 35
extern void ParameterZuordnung(void);
1861 holgerb 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
 
1921 holgerb 46
#define CHK_POTI(b,a) {if(a < 248) b = a; else b = Poti[255 - a];}
1933 holgerb 47
#define CHK_POTI_OFF(b,a,off) {if(a < 248) b = a; else b = Poti[255 - a] - off;}
1921 holgerb 48
#define CHK_POTI_MM(b,a,min,max) {CHK_POTI(b,a); LIMIT_MIN_MAX(b, min, max);}
1933 holgerb 49
#define CHK_POTI_MM_OFF(b,a,min,max,off) {CHK_POTI_OFF(b,a,off); LIMIT_MIN_MAX(b, min, max);}
1921 holgerb 50
 
2093 - 51
/// MartinW; added vars
2174 - 52
extern unsigned char Motors[12]; //MartinR: sicherheitshalber geändert (war 8) 
53
unsigned char Motorsmax[12]; //MartinR: sicherheitshalber geändert (war 8)
2093 - 54
unsigned short MotorsTmax;
55
extern unsigned char updatemotors;
56
extern unsigned char loop1, loop2, loop3;
57
extern unsigned char settingdest;
58
extern char keynumber;
59
extern unsigned short CurrentOffset;///
60
extern signed char jetivalue1,jetivalue2,jetivalue3,jetivalue4;
61
 
62
extern int degreeold;
63
extern int degreedivold;
64
extern int degreediv;
65
extern unsigned int panograd;
66
extern unsigned char panotrigger;
67
extern int StickGas;
68
extern unsigned char calibration_done;
69
extern unsigned char jetibeepcode[];
70
/// MartinW; added vars
71
 
72
 
1 ingob 73
extern unsigned char Sekunde,Minute;
1352 hbuss 74
extern unsigned int BaroExpandActive;
693 hbuss 75
extern long IntegralNick,IntegralNick2;
76
extern long IntegralRoll,IntegralRoll2;
1153 hbuss 77
//extern int IntegralNick,IntegralNick2;
78
//extern int IntegralRoll,IntegralRoll2;
1420 killagreg 79
extern unsigned char Poti[9];
2093 - 80
extern unsigned char jetistepstep[], jetistep;
1153 hbuss 81
 
693 hbuss 82
extern long Mess_IntegralNick,Mess_IntegralNick2;
83
extern long Mess_IntegralRoll,Mess_IntegralRoll2;
84
extern long IntegralAccNick,IntegralAccRoll;
1685 holgerb 85
extern long SummeNick,SummeRoll;
1 ingob 86
extern volatile long Mess_Integral_Hoch;
693 hbuss 87
extern long Integral_Gier,Mess_Integral_Gier,Mess_Integral_Gier2;
1153 hbuss 88
extern int  KompassValue;
1837 holgerb 89
extern int  KompassSollWert;
1153 hbuss 90
extern int  KompassRichtung;
1839 holgerb 91
extern char CalculateCompassTimer;
92
extern unsigned char KompassFusion;
1664 holgerb 93
extern unsigned char ControlHeading;
1166 hbuss 94
extern int  TrimNick, TrimRoll;
717 hbuss 95
extern long  ErsatzKompass;
96
extern int   ErsatzKompassInGrad; // Kompasswert in Grad
1246 killagreg 97
extern long HoehenWert;
98
extern long SollHoehe;
1855 holgerb 99
extern long FromNC_AltitudeSetpoint;
100
extern unsigned char FromNC_AltitudeSpeed;
1921 holgerb 101
extern unsigned char Parameter_HoehenSchalter;      // Wert : 0-250
1690 holgerb 102
extern unsigned char CareFree;
1153 hbuss 103
extern int MesswertNick,MesswertRoll,MesswertGier;
1703 holgerb 104
extern int AdNeutralNick,AdNeutralRoll,AdNeutralGier, Mittelwert_AccNick, Mittelwert_AccRoll;
1643 holgerb 105
extern unsigned int NeutralAccX, NeutralAccY;
1215 hbuss 106
extern unsigned char HoehenReglerAktiv;
1639 holgerb 107
extern int NeutralAccZ;
396 hbuss 108
extern long Umschlag180Nick, Umschlag180Roll;
492 hbuss 109
extern signed int ExternStickNick,ExternStickRoll,ExternStickGier;
513 hbuss 110
extern unsigned char Parameter_UserParam1,Parameter_UserParam2,Parameter_UserParam3,Parameter_UserParam4,Parameter_UserParam5,Parameter_UserParam6,Parameter_UserParam7,Parameter_UserParam8;
805 hbuss 111
extern int NaviAccNick,NaviAccRoll,NaviCntAcc;
871 hbuss 112
extern unsigned int modell_fliegt;
1639 holgerb 113
extern void MotorRegler(void);
114
extern void SendMotorData(void);
1622 killagreg 115
//void CalibrierMittelwert(void);
116
//void Mittelwert(void);
1639 holgerb 117
extern void SetNeutral(unsigned char AccAdjustment);
118
extern void Piep(unsigned char Anzahl, unsigned int dauer);
119
extern void CopyDebugValues(void);
1 ingob 120
 
304 ingob 121
extern unsigned char h,m,s;
1943 holgerb 122
extern int StickNick,StickRoll,StickGier,StickGas;
304 ingob 123
extern volatile unsigned char Timeout ;
124
extern unsigned char CosinusNickWinkel, CosinusRollWinkel;
1153 hbuss 125
extern int  DiffNick,DiffRoll;
1377 hbuss 126
//extern int  Poti1, Poti2, Poti3, Poti4;
304 ingob 127
extern volatile unsigned char SenderOkay;
128
extern int StickNick,StickRoll,StickGier;
129
extern char MotorenEin;
2009 holgerb 130
extern unsigned char CalibrationDone;
1403 hbuss 131
extern unsigned char Parameter_Servo3,Parameter_Servo4,Parameter_Servo5;
1591 holgerb 132
extern char VarioCharacter;
1942 holgerb 133
extern signed int AltitudeSetpointTrimming;
134
extern signed char WaypointTrimming;
1692 holgerb 135
extern int HoverGas;
1 ingob 136
extern unsigned char Parameter_Luftdruck_D;
137
extern unsigned char Parameter_MaxHoehe;
138
extern unsigned char Parameter_Hoehe_P;
139
extern unsigned char Parameter_Hoehe_ACC_Wirkung;
140
extern unsigned char Parameter_KompassWirkung;
141
extern unsigned char Parameter_Gyro_P;
142
extern unsigned char Parameter_Gyro_I;
143
extern unsigned char Parameter_Gier_P;
144
extern unsigned char Parameter_ServoNickControl;
1232 hbuss 145
extern unsigned char Parameter_ServoRollControl;
396 hbuss 146
extern unsigned char Parameter_AchsKopplung1;
1120 hbuss 147
extern unsigned char Parameter_AchsKopplung2;
148
//extern unsigned char Parameter_AchsGegenKopplung1;
921 hbuss 149
extern unsigned char Parameter_J16Bitmask;             // for the J16 Output
150
extern unsigned char Parameter_J16Timing;              // for the J16 Output
151
extern unsigned char Parameter_J17Bitmask;             // for the J17 Output
152
extern unsigned char Parameter_J17Timing;              // for the J17 Output
1916 holgerb 153
extern unsigned char Parameter_GlobalConfig;
154
extern unsigned char Parameter_ExtraConfig;
2093 - 155
extern unsigned char Parameter_NaviGpsModeControl;     // MartinR: wird wiederverwendet für GPS free bei HH
1243 killagreg 156
extern signed char MixerTable[MAX_MOTORS][4];
2093 - 157
//extern const signed char sintab[31]; // MartinR: so war es
158
extern const signed char sintab[62]; // MartinR: für feinere Auflösung
1 ingob 159
#endif //_FC_H
160