Subversion Repositories FlightCtrl

Rev

Rev 1994 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
1995 - 1
/*#######################################################################################
2
Flight Control
3
#######################################################################################*/
4
 
5
#ifndef _FC_H
6
#define _FC_H
7
//#define GIER_GRAD_FAKTOR 1291L // Abhängigkeit zwischen GyroIntegral und Winkel
8
//#define GIER_GRAD_FAKTOR 1160L
9
extern long GIER_GRAD_FAKTOR; // Abhängigkeit zwischen GyroIntegral und Winkel
10
#define STICK_GAIN 4
11
#define ACC_AMPLIFY    6
12
 
13
// FC_StatusFlags
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
20
#define FC_STATUS_VARIO_TRIM_UP                 0x40
21
#define FC_STATUS_VARIO_TRIM_DOWN               0x80
22
 
23
// FC_StatusFlags2
24
#define FC_STATUS2_CAREFREE                 0x01
25
#define FC_STATUS2_ALTITUDE_CONTROL         0x02
26
#define FC_STATUS2_RC_FAILSAVE_ACTIVE       0x04
27
 
28
extern volatile unsigned char FC_StatusFlags, FC_StatusFlags2;
29
extern void ParameterZuordnung(void);
30
 
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]
39
 
40
#define CHK_POTI(b,a) {if(a < 248) b = a; else b = Poti[255 - a];}
41
#define CHK_POTI_OFF(b,a,off) {if(a < 248) b = a; else b = Poti[255 - a] - off;}
42
#define CHK_POTI_MM(b,a,min,max) {CHK_POTI(b,a); LIMIT_MIN_MAX(b, min, max);}
43
#define CHK_POTI_MM_OFF(b,a,min,max,off) {CHK_POTI_OFF(b,a,off); LIMIT_MIN_MAX(b, min, max);}
44
 
45
/// MartinW; added vars
46
extern unsigned char Motors[8];
47
unsigned char Motorsmax[8];
48
unsigned short MotorsTmax;
49
extern unsigned char updatemotors;
50
extern unsigned char loop1, loop2, loop3;
51
extern unsigned char settingdest;
52
extern unsigned char pos1, pos2, pos3, pos4;
53
extern int keynumber;
54
extern unsigned short CurrentOffset;///
55
extern signed char jetivalue1,jetivalue2,jetivalue3,jetivalue4;
56
 
57
extern int degreeold;
58
extern int degreedivold;
59
extern int degreediv;
60
extern unsigned int panograd;
61
extern unsigned char panotrigger;
62
extern int StickGas;
63
extern unsigned char calibration_done;
64
/// MartinW; added vars
65
 
66
 
67
extern unsigned char Sekunde,Minute;
68
extern unsigned int BaroExpandActive;
69
extern long IntegralNick,IntegralNick2;
70
extern long IntegralRoll,IntegralRoll2;
71
//extern int IntegralNick,IntegralNick2;
72
//extern int IntegralRoll,IntegralRoll2;
73
extern unsigned char Poti[9];
74
 
75
extern long Mess_IntegralNick,Mess_IntegralNick2;
76
extern long Mess_IntegralRoll,Mess_IntegralRoll2;
77
extern long IntegralAccNick,IntegralAccRoll;
78
extern long SummeNick,SummeRoll;
79
extern volatile long Mess_Integral_Hoch;
80
//extern long Integral_Gier,Mess_Integral_Gier,Mess_Integral_Gier2;
81
extern long Integral_Gier,Mess_Integral_Gier;///
82
extern int  KompassValue;
83
extern int  KompassSollWert;
84
extern int  KompassRichtung;
85
extern char CalculateCompassTimer;
86
extern unsigned char KompassFusion;
87
extern unsigned char ControlHeading;
88
extern int  TrimNick, TrimRoll;
89
extern long  ErsatzKompass;
90
extern int   ErsatzKompassInGrad; // Kompasswert in Grad
91
extern long HoehenWert;
92
extern long SollHoehe;
93
extern long FromNC_AltitudeSetpoint;
94
extern unsigned char FromNC_AltitudeSpeed;
95
extern unsigned char Parameter_HoehenSchalter;      // Wert : 0-250
96
extern unsigned char CareFree;
97
extern int MesswertNick,MesswertRoll,MesswertGier;
98
extern int AdNeutralNick,AdNeutralRoll,AdNeutralGier, Mittelwert_AccNick, Mittelwert_AccRoll;
99
extern unsigned int NeutralAccX, NeutralAccY;
100
extern unsigned char HoehenReglerAktiv;
101
extern int NeutralAccZ;
102
extern long Umschlag180Nick, Umschlag180Roll;
103
extern signed int ExternStickNick,ExternStickRoll,ExternStickGier;
104
extern unsigned char Parameter_UserParam1,Parameter_UserParam2,Parameter_UserParam3,Parameter_UserParam4,Parameter_UserParam5,Parameter_UserParam6,Parameter_UserParam7,Parameter_UserParam8;
105
extern int NaviAccNick,NaviAccRoll,NaviCntAcc;
106
extern unsigned int modell_fliegt;
107
extern void MotorRegler(void);
108
extern void SendMotorData(void);
109
//void CalibrierMittelwert(void);
110
//void Mittelwert(void);
111
extern void SetNeutral(unsigned char AccAdjustment);
112
extern void Piep(unsigned char Anzahl, unsigned int dauer);
113
extern void CopyDebugValues(void);
114
 
115
extern unsigned char h,m,s;
116
extern int StickNick,StickRoll,StickGier,StickGas;
117
extern volatile unsigned char Timeout ;
118
extern unsigned char CosinusNickWinkel, CosinusRollWinkel;
119
extern int  DiffNick,DiffRoll;
120
//extern int  Poti1, Poti2, Poti3, Poti4;
121
extern volatile unsigned char SenderOkay;
122
extern int StickNick,StickRoll,StickGier;
123
extern char MotorenEin;
124
extern unsigned char Parameter_Servo3,Parameter_Servo4,Parameter_Servo5;
125
extern char VarioCharacter;
126
extern signed int AltitudeSetpointTrimming;
127
extern signed char WaypointTrimming;
128
extern int HoverGas;
129
extern unsigned char Parameter_Luftdruck_D;
130
extern unsigned char Parameter_MaxHoehe;
131
extern unsigned char Parameter_Hoehe_P;
132
extern unsigned char Parameter_Hoehe_ACC_Wirkung;
133
extern unsigned char Parameter_KompassWirkung;
134
extern unsigned char Parameter_Gyro_P;
135
extern unsigned char Parameter_Gyro_I;
136
extern unsigned char Parameter_Gier_P;
137
extern unsigned char Parameter_ServoNickControl;
138
extern unsigned char Parameter_ServoRollControl;
139
extern unsigned char Parameter_AchsKopplung1;
140
extern unsigned char Parameter_AchsKopplung2;
141
//extern unsigned char Parameter_AchsGegenKopplung1;
142
extern unsigned char Parameter_J16Bitmask;             // for the J16 Output
143
extern unsigned char Parameter_J16Timing;              // for the J16 Output
144
extern unsigned char Parameter_J17Bitmask;             // for the J17 Output
145
extern unsigned char Parameter_J17Timing;              // for the J17 Output
146
extern unsigned char Parameter_GlobalConfig;
147
extern unsigned char Parameter_ExtraConfig;
148
extern signed char MixerTable[MAX_MOTORS][4];
149
extern const signed char sintab[31];
150
#endif //_FC_H
151