Subversion Repositories FlightCtrl

Rev

Rev 704 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 704 Rev 706
1
/*#######################################################################################
1
/*#######################################################################################
2
Flight Control
2
Flight Control
3
#######################################################################################*/
3
#######################################################################################*/
4
 
4
 
5
#ifndef _FC_H
5
#ifndef _FC_H
6
#define _FC_H
6
#define _FC_H
7
 
7
 
8
typedef struct
8
typedef struct
9
{
9
{
10
        uint8_t AirPressure_D;
10
        uint8_t AirPressure_D;
11
        uint8_t MaxHight;
11
        uint8_t MaxHight;
12
        uint8_t Hight_P;
12
        uint8_t Hight_P;
13
        uint8_t Hight_ACC_Effect;
13
        uint8_t Hight_ACC_Effect;
14
        uint8_t CompassYawEffect;
14
        uint8_t CompassYawEffect;
15
        uint8_t Gyro_P;
15
        uint8_t Gyro_P;
16
        uint8_t Gyro_I;
16
        uint8_t Gyro_I;
17
        uint8_t Gier_P;
17
        uint8_t Gier_P;
18
        uint8_t I_Factor;
18
        uint8_t I_Factor;
19
        uint8_t UserParam1;
19
        uint8_t UserParam1;
20
        uint8_t UserParam2;
20
        uint8_t UserParam2;
21
        uint8_t UserParam3;
21
        uint8_t UserParam3;
22
        uint8_t UserParam4;
22
        uint8_t UserParam4;
23
        uint8_t UserParam5;
23
        uint8_t UserParam5;
24
        uint8_t UserParam6;
24
        uint8_t UserParam6;
25
        uint8_t UserParam7;
25
        uint8_t UserParam7;
26
        uint8_t UserParam8;
26
        uint8_t UserParam8;
27
        uint8_t ServoPitchControl;
27
        uint8_t ServoPitchControl;
28
        uint8_t LoopGasLimit;
28
        uint8_t LoopGasLimit;
29
        uint8_t AchsKopplung1;
29
        uint8_t Yaw_PosFeedback;
30
        uint8_t AchsGegenKopplung1;
30
        uint8_t Yaw_NegFeedback;
31
        uint8_t DynamicStability;
31
        uint8_t DynamicStability;
32
} fc_param_t;
32
} fc_param_t;
33
 
33
 
34
extern fc_param_t FCParam;
34
extern fc_param_t FCParam;
35
 
35
 
36
extern volatile uint16_t I2CTimeout;
36
extern volatile uint16_t I2CTimeout;
37
 
37
 
38
// attitude
38
// attitude
39
extern volatile int32_t IntegralPitch, IntegralRoll, IntegralYaw;
39
extern volatile int32_t IntegralPitch, IntegralRoll, IntegralYaw;
40
extern volatile int16_t ReadingPitch, ReadingRoll, ReadingYaw;
40
extern volatile int16_t ReadingPitch, ReadingRoll, ReadingYaw;
41
 
41
 
42
// offsets
42
// offsets
43
extern volatile int16_t AdNeutralPitch, AdNeutralRoll, AdNeutralYaw;
43
extern volatile int16_t AdNeutralPitch, AdNeutralRoll, AdNeutralYaw;
44
extern volatile int16_t NeutralAccX, NeutralAccY;
44
extern volatile int16_t NeutralAccX, NeutralAccY;
45
extern volatile float NeutralAccZ;
45
extern volatile float NeutralAccZ;
46
 
46
 
47
 
47
 
48
extern volatile int32_t Reading_Integral_Top; // calculated in analog.c
48
extern volatile int32_t Reading_Integral_Top; // calculated in analog.c
49
 
49
 
50
// compass navigation
50
// compass navigation
51
extern volatile int16_t  CompassHeading;
51
extern volatile int16_t  CompassHeading;
52
extern volatile int16_t  CompassCourse;
52
extern volatile int16_t  CompassCourse;
53
extern volatile int16_t  CompassOffCourse;
53
extern volatile int16_t  CompassOffCourse;
54
 
54
 
55
// hight control
55
// hight control
56
extern int ReadingHight;
56
extern int ReadingHight;
57
extern int SetPointHight;
57
extern int SetPointHight;
58
 
58
 
59
// mean accelarations
59
// mean accelarations
60
extern volatile int16_t Mean_AccPitch, Mean_AccRoll, Mean_AccTop;
60
extern volatile int16_t Mean_AccPitch, Mean_AccRoll, Mean_AccTop;
61
 
61
 
62
// looping params
62
// looping params
63
extern long TurnOver180Pitch, TurnOver180Roll;
63
extern long TurnOver180Pitch, TurnOver180Roll;
64
 
64
 
65
// external control
65
// external control
66
extern int16_t ExternStickPitch, ExternStickRoll, ExternStickYaw;
66
extern int16_t ExternStickPitch, ExternStickRoll, ExternStickYaw;
67
 
67
 
68
 
68
 
69
void MotorRegler(void);
69
void MotorRegler(void);
70
void SendMotorData(void);
70
void SendMotorData(void);
71
void CalibMean(void);
71
void CalibMean(void);
72
void Mean(void);
72
void Mean(void);
73
void SetNeutral(void);
73
void SetNeutral(void);
74
void Beep(uint8_t numbeeps);
74
void Beep(uint8_t numbeeps);
75
 
75
 
76
 
76
 
77
//extern unsigned char h,m,s;
77
//extern unsigned char h,m,s;
78
 
78
 
79
extern int16_t  Poti1, Poti2, Poti3, Poti4;
79
extern int16_t  Poti1, Poti2, Poti3, Poti4;
80
 
80
 
81
// setpoints for motors
81
// setpoints for motors
82
extern volatile uint8_t Motor_Front, Motor_Rear, Motor_Right, Motor_Left; //used by twimaster isr
82
extern volatile uint8_t Motor_Front, Motor_Rear, Motor_Right, Motor_Left; //used by twimaster isr
83
 
83
 
84
extern int16_t StickPitch, StickRoll, StickYaw;
84
extern int16_t StickPitch, StickRoll, StickYaw;
85
extern uint8_t MotorsOn;
85
extern uint8_t MotorsOn;
86
 
86
 
87
 
87
 
88
#endif //_FC_H
88
#endif //_FC_H
89
 
89
 
90
 
90