syouichi imamori
/
MulticopterQuadX
Quad X Type Multicopter
config.h@4:4060309b9cc0, 2014-10-14 (annotated)
- Committer:
- komaida424
- Date:
- Tue Oct 14 08:15:03 2014 +0000
- Revision:
- 4:4060309b9cc0
- Parent:
- 3:27407c4984cf
- Child:
- 6:a50e6d3924f1
rev.2.1
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
komaida424 | 0:cca1c4e84da4 | 1 | #ifndef CONFIG_H |
komaida424 | 0:cca1c4e84da4 | 2 | #define CONFIG_H |
komaida424 | 0:cca1c4e84da4 | 3 | |
komaida424 | 2:59ac9df97701 | 4 | //#define SERIAL_LCD |
komaida424 | 2:59ac9df97701 | 5 | //#define SOFT_PWM |
komaida424 | 0:cca1c4e84da4 | 6 | //#define LPCXpresso |
komaida424 | 0:cca1c4e84da4 | 7 | //#define LocalFileOut |
komaida424 | 0:cca1c4e84da4 | 8 | |
komaida424 | 0:cca1c4e84da4 | 9 | #define TX_TYPE 0 // 0:FM 1:IR |
komaida424 | 2:59ac9df97701 | 10 | #define Thro_Zero 30 |
komaida424 | 0:cca1c4e84da4 | 11 | #define Thro_Lo 75 |
komaida424 | 0:cca1c4e84da4 | 12 | #define Thro_Hi 950 |
komaida424 | 0:cca1c4e84da4 | 13 | #define Pulse_Min 1000 |
komaida424 | 0:cca1c4e84da4 | 14 | #define Pulse_Max 2000 |
komaida424 | 2:59ac9df97701 | 15 | #define Stick_Limit 350 |
komaida424 | 0:cca1c4e84da4 | 16 | #define M1 M[0] |
komaida424 | 0:cca1c4e84da4 | 17 | #define M2 M[1] |
komaida424 | 0:cca1c4e84da4 | 18 | #define M3 M[2] |
komaida424 | 0:cca1c4e84da4 | 19 | #define M4 M[3] |
komaida424 | 0:cca1c4e84da4 | 20 | #define M5 M[4] |
komaida424 | 0:cca1c4e84da4 | 21 | #define M6 M[5] |
komaida424 | 0:cca1c4e84da4 | 22 | #define THR CH[0] |
komaida424 | 0:cca1c4e84da4 | 23 | #define AIL CH[1] |
komaida424 | 0:cca1c4e84da4 | 24 | #define ELE CH[2] |
komaida424 | 0:cca1c4e84da4 | 25 | #define RUD CH[3] |
komaida424 | 0:cca1c4e84da4 | 26 | #define AUX CH[4] |
komaida424 | 4:4060309b9cc0 | 27 | #define AX2 CH[5] |
komaida424 | 4:4060309b9cc0 | 28 | #define AX3 CH[6] |
komaida424 | 4:4060309b9cc0 | 29 | #define AX4 CH[7] |
komaida424 | 4:4060309b9cc0 | 30 | #define AX5 CH[8] |
komaida424 | 4:4060309b9cc0 | 31 | #define HEIGHT 3 |
komaida424 | 0:cca1c4e84da4 | 32 | #define _ITG3200 0x00 |
komaida424 | 0:cca1c4e84da4 | 33 | #define _L3GD20 0x01 |
komaida424 | 2:59ac9df97701 | 34 | #define TICK_TIME 0.05 |
komaida424 | 3:27407c4984cf | 35 | #define GYRO_ADJUST 2 |
komaida424 | 0:cca1c4e84da4 | 36 | |
komaida424 | 4:4060309b9cc0 | 37 | enum PlaneType{Quad_X=0,Quad_H,Delta,Delta_TW,AirPlane}; |
komaida424 | 4:4060309b9cc0 | 38 | enum JR{_THR=0,_AIL,_ELE,_RUD,_GYRO,_AUX1,_AUX2,_AUX3,_AUX4}; //JR 信号の順番 |
komaida424 | 4:4060309b9cc0 | 39 | //enum Futaba{_AIL=0,_ELE,_THR,_RUD,_GYRO,_AUX1,_AUX2,_AUX3,_AUX4}; //Futaba 信号の順番 |
komaida424 | 4:4060309b9cc0 | 40 | enum stknum{ROL=0,PIT,YAW,COL,GAIN,AUX2}; // Stick[]の順番 |
komaida424 | 4:4060309b9cc0 | 41 | /* |
komaida424 | 4:4060309b9cc0 | 42 | struct pidinf { |
komaida424 | 4:4060309b9cc0 | 43 | float kp; |
komaida424 | 4:4060309b9cc0 | 44 | float ki; |
komaida424 | 4:4060309b9cc0 | 45 | float kd; |
komaida424 | 4:4060309b9cc0 | 46 | float limit; |
komaida424 | 4:4060309b9cc0 | 47 | float integral_limit; |
komaida424 | 4:4060309b9cc0 | 48 | float differential_limit; |
komaida424 | 4:4060309b9cc0 | 49 | };*/ |
komaida424 | 0:cca1c4e84da4 | 50 | struct config { |
komaida424 | 0:cca1c4e84da4 | 51 | float Revision; |
komaida424 | 0:cca1c4e84da4 | 52 | int Struct_Size; |
komaida424 | 2:59ac9df97701 | 53 | char StartMode; //'c':config mode 'f':flight mode |
komaida424 | 4:4060309b9cc0 | 54 | char Model_Type; // 0x00:Quad-X 0x01:Quad-H-3D |
komaida424 | 4:4060309b9cc0 | 55 | signed char Gyro_Gain_Setting; |
komaida424 | 0:cca1c4e84da4 | 56 | int Stick_Ref[5]; //Stick Neutral Position |
komaida424 | 0:cca1c4e84da4 | 57 | float Stick_Mix[3]; //Mixing ratio of stick operation |
komaida424 | 0:cca1c4e84da4 | 58 | signed char Gyro_Dir[4]; |
komaida424 | 0:cca1c4e84da4 | 59 | float Gyro_Gain[6]; |
komaida424 | 4:4060309b9cc0 | 60 | signed char Servo_Dir[6]; |
komaida424 | 2:59ac9df97701 | 61 | float Accel_Ref[3]; |
komaida424 | 4:4060309b9cc0 | 62 | // float Accel_Gain[3]; |
komaida424 | 3:27407c4984cf | 63 | float PID_Interval; |
komaida424 | 2:59ac9df97701 | 64 | float Cutoff_Freq; |
komaida424 | 2:59ac9df97701 | 65 | int Flight_Time; |
komaida424 | 0:cca1c4e84da4 | 66 | int LCD_Contrast; |
komaida424 | 0:cca1c4e84da4 | 67 | int PWM_Mode; |
komaida424 | 2:59ac9df97701 | 68 | int ESC_Low; |
komaida424 | 0:cca1c4e84da4 | 69 | int PWM_Interval; |
komaida424 | 4:4060309b9cc0 | 70 | // pidinf pid[4]; |
komaida424 | 4:4060309b9cc0 | 71 | float Active_Jyro_Gain; |
komaida424 | 4:4060309b9cc0 | 72 | // float Gimbal_Gain; |
komaida424 | 4:4060309b9cc0 | 73 | // int Gimbal_Neutral_Width; |
komaida424 | 4:4060309b9cc0 | 74 | // int Gimbal_Dir; |
komaida424 | 0:cca1c4e84da4 | 75 | public: |
komaida424 | 0:cca1c4e84da4 | 76 | config() { |
komaida424 | 4:4060309b9cc0 | 77 | Revision = 2.10; |
komaida424 | 0:cca1c4e84da4 | 78 | Struct_Size = sizeof(config); |
komaida424 | 0:cca1c4e84da4 | 79 | Stick_Ref[0] = 1500; |
komaida424 | 0:cca1c4e84da4 | 80 | Stick_Ref[1] = 1500; |
komaida424 | 0:cca1c4e84da4 | 81 | Stick_Ref[2] = 1500; |
komaida424 | 0:cca1c4e84da4 | 82 | Stick_Ref[3] = 1100; |
komaida424 | 0:cca1c4e84da4 | 83 | Stick_Ref[4] = 1500; |
komaida424 | 4:4060309b9cc0 | 84 | Stick_Mix[0] = 0.4; |
komaida424 | 4:4060309b9cc0 | 85 | Stick_Mix[1] = 0.4; |
komaida424 | 2:59ac9df97701 | 86 | Stick_Mix[2] = 0.65; |
komaida424 | 3:27407c4984cf | 87 | Gyro_Dir[0] = -1; |
komaida424 | 3:27407c4984cf | 88 | Gyro_Dir[1] = -1; |
komaida424 | 0:cca1c4e84da4 | 89 | Gyro_Dir[2] = 1; |
komaida424 | 0:cca1c4e84da4 | 90 | Gyro_Dir[3] = -1; |
komaida424 | 4:4060309b9cc0 | 91 | Gyro_Gain[0] = 0.50; |
komaida424 | 4:4060309b9cc0 | 92 | Gyro_Gain[1] = 0.50; |
komaida424 | 4:4060309b9cc0 | 93 | Gyro_Gain[2] = 0.50; |
komaida424 | 0:cca1c4e84da4 | 94 | Gyro_Gain[3] = 0.00; |
komaida424 | 0:cca1c4e84da4 | 95 | Gyro_Gain[4] = 0.00; |
komaida424 | 0:cca1c4e84da4 | 96 | Gyro_Gain[5] = 0.00; |
komaida424 | 4:4060309b9cc0 | 97 | Servo_Dir[0] = 1; |
komaida424 | 4:4060309b9cc0 | 98 | Servo_Dir[1] = 1; |
komaida424 | 4:4060309b9cc0 | 99 | Servo_Dir[2] = 1; |
komaida424 | 4:4060309b9cc0 | 100 | Servo_Dir[3] = 1; |
komaida424 | 2:59ac9df97701 | 101 | Accel_Ref[0] = 0; |
komaida424 | 2:59ac9df97701 | 102 | Accel_Ref[1] = 0; |
komaida424 | 2:59ac9df97701 | 103 | Accel_Ref[2] = 0; |
komaida424 | 4:4060309b9cc0 | 104 | // Accel_Gain[0] = 0.50; |
komaida424 | 4:4060309b9cc0 | 105 | // Accel_Gain[1] = 0.50; |
komaida424 | 4:4060309b9cc0 | 106 | // Accel_Gain[2] = 0.50; |
komaida424 | 4:4060309b9cc0 | 107 | Model_Type = 0; |
komaida424 | 0:cca1c4e84da4 | 108 | Gyro_Gain_Setting = -1; |
komaida424 | 2:59ac9df97701 | 109 | Cutoff_Freq=0.15; |
komaida424 | 2:59ac9df97701 | 110 | Flight_Time=360; |
komaida424 | 0:cca1c4e84da4 | 111 | LCD_Contrast = 60; |
komaida424 | 0:cca1c4e84da4 | 112 | PWM_Mode = 1; |
komaida424 | 3:27407c4984cf | 113 | ESC_Low= 1080; |
komaida424 | 4:4060309b9cc0 | 114 | PWM_Interval = 5000; |
komaida424 | 0:cca1c4e84da4 | 115 | StartMode = 'C'; |
komaida424 | 4:4060309b9cc0 | 116 | PID_Interval = 0.005; |
komaida424 | 4:4060309b9cc0 | 117 | Active_Jyro_Gain = 0.5; |
komaida424 | 0:cca1c4e84da4 | 118 | } |
komaida424 | 0:cca1c4e84da4 | 119 | }; |
komaida424 | 0:cca1c4e84da4 | 120 | #endif |
komaida424 | 0:cca1c4e84da4 | 121 | |
komaida424 | 0:cca1c4e84da4 | 122 | |
komaida424 | 0:cca1c4e84da4 | 123 | |
komaida424 | 0:cca1c4e84da4 | 124 | |
komaida424 | 0:cca1c4e84da4 | 125 | |
komaida424 | 0:cca1c4e84da4 | 126 | |
komaida424 | 2:59ac9df97701 | 127 | |
komaida424 | 2:59ac9df97701 | 128 | |
komaida424 | 2:59ac9df97701 | 129 | |
komaida424 | 2:59ac9df97701 | 130 | |
komaida424 | 2:59ac9df97701 | 131 | |
komaida424 | 2:59ac9df97701 | 132 | |
komaida424 | 2:59ac9df97701 | 133 | |
komaida424 | 2:59ac9df97701 | 134 | |
komaida424 | 2:59ac9df97701 | 135 | |
komaida424 | 2:59ac9df97701 | 136 | |
komaida424 | 2:59ac9df97701 | 137 | |
komaida424 | 2:59ac9df97701 | 138 | |
komaida424 | 2:59ac9df97701 | 139 | |
komaida424 | 2:59ac9df97701 | 140 | |
komaida424 | 2:59ac9df97701 | 141 | |
komaida424 | 2:59ac9df97701 | 142 | |
komaida424 | 2:59ac9df97701 | 143 | |
komaida424 | 2:59ac9df97701 | 144 | |
komaida424 | 2:59ac9df97701 | 145 | |
komaida424 | 2:59ac9df97701 | 146 | |
komaida424 | 2:59ac9df97701 | 147 | |
komaida424 | 2:59ac9df97701 | 148 | |
komaida424 | 2:59ac9df97701 | 149 | |
komaida424 | 2:59ac9df97701 | 150 | |
komaida424 | 2:59ac9df97701 | 151 | |
komaida424 | 2:59ac9df97701 | 152 | |
komaida424 | 2:59ac9df97701 | 153 | |
komaida424 | 3:27407c4984cf | 154 | |
komaida424 | 3:27407c4984cf | 155 | |
komaida424 | 3:27407c4984cf | 156 | |
komaida424 | 3:27407c4984cf | 157 | |
komaida424 | 3:27407c4984cf | 158 | |
komaida424 | 3:27407c4984cf | 159 | |
komaida424 | 3:27407c4984cf | 160 | |
komaida424 | 4:4060309b9cc0 | 161 | |
komaida424 | 4:4060309b9cc0 | 162 | |
komaida424 | 4:4060309b9cc0 | 163 | |
komaida424 | 4:4060309b9cc0 | 164 | |
komaida424 | 4:4060309b9cc0 | 165 | |
komaida424 | 4:4060309b9cc0 | 166 | |
komaida424 | 4:4060309b9cc0 | 167 | |
komaida424 | 4:4060309b9cc0 | 168 | |
komaida424 | 4:4060309b9cc0 | 169 | |
komaida424 | 4:4060309b9cc0 | 170 | |
komaida424 | 4:4060309b9cc0 | 171 |