Subversion Repositories FlightCtrl

Rev

Rev 712 | 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
7
 
703 killagreg 8
typedef struct
9
{
711 killagreg 10
        uint8_t Hight_D;
703 killagreg 11
        uint8_t MaxHight;
12
        uint8_t Hight_P;
13
        uint8_t Hight_ACC_Effect;
14
        uint8_t CompassYawEffect;
15
        uint8_t Gyro_P;
16
        uint8_t Gyro_I;
17
        uint8_t Gier_P;
18
        uint8_t I_Factor;
19
        uint8_t UserParam1;
20
        uint8_t UserParam2;
21
        uint8_t UserParam3;
22
        uint8_t UserParam4;
23
        uint8_t UserParam5;
24
        uint8_t UserParam6;
25
        uint8_t UserParam7;
26
        uint8_t UserParam8;
27
        uint8_t ServoPitchControl;
707 killagreg 28
        uint8_t LoopThrustLimit;
706 killagreg 29
        uint8_t Yaw_PosFeedback;
30
        uint8_t Yaw_NegFeedback;
703 killagreg 31
        uint8_t DynamicStability;
32
} fc_param_t;
33
 
34
extern fc_param_t FCParam;
35
 
36
extern volatile uint16_t I2CTimeout;
37
 
38
// attitude
39
extern volatile int32_t IntegralPitch, IntegralRoll, IntegralYaw;
711 killagreg 40
extern volatile int16_t Reading_GyroPitch, Reading_GyroRoll, Reading_GyroYaw;
703 killagreg 41
 
42
// offsets
43
extern volatile int16_t AdNeutralPitch, AdNeutralRoll, AdNeutralYaw;
44
extern volatile int16_t NeutralAccX, NeutralAccY;
45
extern volatile float NeutralAccZ;
46
 
47
 
48
extern volatile int32_t Reading_Integral_Top; // calculated in analog.c
49
 
50
// compass navigation
51
extern volatile int16_t  CompassHeading;
52
extern volatile int16_t  CompassCourse;
53
extern volatile int16_t  CompassOffCourse;
54
 
55
// hight control
701 killagreg 56
extern int ReadingHight;
57
extern int SetPointHight;
703 killagreg 58
 
59
// mean accelarations
60
extern volatile int16_t Mean_AccPitch, Mean_AccRoll, Mean_AccTop;
61
 
62
// looping params
701 killagreg 63
extern long TurnOver180Pitch, TurnOver180Roll;
1 ingob 64
 
703 killagreg 65
// external control
66
extern int16_t ExternStickPitch, ExternStickRoll, ExternStickYaw;
67
 
68
 
712 killagreg 69
void MotorControl(void);
1 ingob 70
void SendMotorData(void);
701 killagreg 71
void CalibMean(void);
72
void Mean(void);
1 ingob 73
void SetNeutral(void);
703 killagreg 74
void Beep(uint8_t numbeeps);
1 ingob 75
 
76
 
703 killagreg 77
extern int16_t  Poti1, Poti2, Poti3, Poti4;
1 ingob 78
 
703 killagreg 79
// setpoints for motors
80
extern volatile uint8_t Motor_Front, Motor_Rear, Motor_Right, Motor_Left; //used by twimaster isr
1 ingob 81
 
726 killagreg 82
// current stick values
703 killagreg 83
extern int16_t StickPitch, StickRoll, StickYaw;
726 killagreg 84
// current stick elongations
85
extern int16_t MaxStickPitch, MaxStickRoll, MaxStickYaw;
703 killagreg 86
extern uint8_t MotorsOn;
396 hbuss 87
 
703 killagreg 88
 
1 ingob 89
#endif //_FC_H
90