syouichi imamori
/
MulticopterQuadX
Quad X Type Multicopter
config.h@7:16bf0085d914, 2015-04-28 (annotated)
- Committer:
- komaida424
- Date:
- Tue Apr 28 01:48:21 2015 +0000
- Revision:
- 7:16bf0085d914
- Parent:
- 6:a50e6d3924f1
- Child:
- 8:1db19b529b22
rev.3.11 bug fix
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 | 7:16bf0085d914 | 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 | 7:16bf0085d914 | 36 | #define THR_MIDRANGE 80 |
komaida424 | 0:cca1c4e84da4 | 37 | |
komaida424 | 6:a50e6d3924f1 | 38 | enum PlaneType{Quad_X=0,Quad_VP,Quad_3D,Delta,Delta_TW,AirPlane}; |
komaida424 | 4:4060309b9cc0 | 39 | enum JR{_THR=0,_AIL,_ELE,_RUD,_GYRO,_AUX1,_AUX2,_AUX3,_AUX4}; //JR 信号の順番 |
komaida424 | 4:4060309b9cc0 | 40 | //enum Futaba{_AIL=0,_ELE,_THR,_RUD,_GYRO,_AUX1,_AUX2,_AUX3,_AUX4}; //Futaba 信号の順番 |
komaida424 | 4:4060309b9cc0 | 41 | enum stknum{ROL=0,PIT,YAW,COL,GAIN,AUX2}; // Stick[]の順番 |
komaida424 | 4:4060309b9cc0 | 42 | /* |
komaida424 | 4:4060309b9cc0 | 43 | struct pidinf { |
komaida424 | 4:4060309b9cc0 | 44 | float kp; |
komaida424 | 4:4060309b9cc0 | 45 | float ki; |
komaida424 | 4:4060309b9cc0 | 46 | float kd; |
komaida424 | 4:4060309b9cc0 | 47 | float limit; |
komaida424 | 4:4060309b9cc0 | 48 | float integral_limit; |
komaida424 | 4:4060309b9cc0 | 49 | float differential_limit; |
komaida424 | 4:4060309b9cc0 | 50 | };*/ |
komaida424 | 0:cca1c4e84da4 | 51 | struct config { |
komaida424 | 0:cca1c4e84da4 | 52 | float Revision; |
komaida424 | 0:cca1c4e84da4 | 53 | int Struct_Size; |
komaida424 | 2:59ac9df97701 | 54 | char StartMode; //'c':config mode 'f':flight mode |
komaida424 | 4:4060309b9cc0 | 55 | char Model_Type; // 0x00:Quad-X 0x01:Quad-H-3D |
komaida424 | 4:4060309b9cc0 | 56 | signed char Gyro_Gain_Setting; |
komaida424 | 6:a50e6d3924f1 | 57 | int Stick_Ref[6]; //Stick Neutral Position |
komaida424 | 0:cca1c4e84da4 | 58 | float Stick_Mix[3]; //Mixing ratio of stick operation |
komaida424 | 0:cca1c4e84da4 | 59 | signed char Gyro_Dir[4]; |
komaida424 | 0:cca1c4e84da4 | 60 | float Gyro_Gain[6]; |
komaida424 | 4:4060309b9cc0 | 61 | signed char Servo_Dir[6]; |
komaida424 | 2:59ac9df97701 | 62 | float Accel_Ref[3]; |
komaida424 | 4:4060309b9cc0 | 63 | // float Accel_Gain[3]; |
komaida424 | 3:27407c4984cf | 64 | float PID_Interval; |
komaida424 | 2:59ac9df97701 | 65 | float Cutoff_Freq; |
komaida424 | 2:59ac9df97701 | 66 | int Flight_Time; |
komaida424 | 0:cca1c4e84da4 | 67 | int LCD_Contrast; |
komaida424 | 0:cca1c4e84da4 | 68 | int PWM_Mode; |
komaida424 | 6:a50e6d3924f1 | 69 | int Throttl_Trim; |
komaida424 | 0:cca1c4e84da4 | 70 | int PWM_Interval; |
komaida424 | 4:4060309b9cc0 | 71 | // pidinf pid[4]; |
komaida424 | 6:a50e6d3924f1 | 72 | float Active_Gyro_Gain; |
komaida424 | 4:4060309b9cc0 | 73 | // float Gimbal_Gain; |
komaida424 | 4:4060309b9cc0 | 74 | // int Gimbal_Neutral_Width; |
komaida424 | 4:4060309b9cc0 | 75 | // int Gimbal_Dir; |
komaida424 | 6:a50e6d3924f1 | 76 | int Reverse_Point; |
komaida424 | 6:a50e6d3924f1 | 77 | float Thro_Limit_Val; |
komaida424 | 6:a50e6d3924f1 | 78 | float Thro_Limit_Rate; |
komaida424 | 0:cca1c4e84da4 | 79 | public: |
komaida424 | 0:cca1c4e84da4 | 80 | config() { |
komaida424 | 7:16bf0085d914 | 81 | Revision = 3.11; |
komaida424 | 0:cca1c4e84da4 | 82 | Struct_Size = sizeof(config); |
komaida424 | 0:cca1c4e84da4 | 83 | Stick_Ref[0] = 1500; |
komaida424 | 0:cca1c4e84da4 | 84 | Stick_Ref[1] = 1500; |
komaida424 | 0:cca1c4e84da4 | 85 | Stick_Ref[2] = 1500; |
komaida424 | 6:a50e6d3924f1 | 86 | Stick_Ref[3] = 1080; |
komaida424 | 0:cca1c4e84da4 | 87 | Stick_Ref[4] = 1500; |
komaida424 | 6:a50e6d3924f1 | 88 | Stick_Ref[5] = 1500; |
komaida424 | 4:4060309b9cc0 | 89 | Stick_Mix[0] = 0.4; |
komaida424 | 4:4060309b9cc0 | 90 | Stick_Mix[1] = 0.4; |
komaida424 | 2:59ac9df97701 | 91 | Stick_Mix[2] = 0.65; |
komaida424 | 3:27407c4984cf | 92 | Gyro_Dir[0] = -1; |
komaida424 | 3:27407c4984cf | 93 | Gyro_Dir[1] = -1; |
komaida424 | 0:cca1c4e84da4 | 94 | Gyro_Dir[2] = 1; |
komaida424 | 0:cca1c4e84da4 | 95 | Gyro_Dir[3] = -1; |
komaida424 | 4:4060309b9cc0 | 96 | Gyro_Gain[0] = 0.50; |
komaida424 | 4:4060309b9cc0 | 97 | Gyro_Gain[1] = 0.50; |
komaida424 | 4:4060309b9cc0 | 98 | Gyro_Gain[2] = 0.50; |
komaida424 | 0:cca1c4e84da4 | 99 | Gyro_Gain[3] = 0.00; |
komaida424 | 0:cca1c4e84da4 | 100 | Gyro_Gain[4] = 0.00; |
komaida424 | 0:cca1c4e84da4 | 101 | Gyro_Gain[5] = 0.00; |
komaida424 | 4:4060309b9cc0 | 102 | Servo_Dir[0] = 1; |
komaida424 | 4:4060309b9cc0 | 103 | Servo_Dir[1] = 1; |
komaida424 | 4:4060309b9cc0 | 104 | Servo_Dir[2] = 1; |
komaida424 | 4:4060309b9cc0 | 105 | Servo_Dir[3] = 1; |
komaida424 | 6:a50e6d3924f1 | 106 | Servo_Dir[4] = 1; |
komaida424 | 6:a50e6d3924f1 | 107 | Servo_Dir[5] = 1; |
komaida424 | 2:59ac9df97701 | 108 | Accel_Ref[0] = 0; |
komaida424 | 2:59ac9df97701 | 109 | Accel_Ref[1] = 0; |
komaida424 | 2:59ac9df97701 | 110 | Accel_Ref[2] = 0; |
komaida424 | 4:4060309b9cc0 | 111 | // Accel_Gain[0] = 0.50; |
komaida424 | 4:4060309b9cc0 | 112 | // Accel_Gain[1] = 0.50; |
komaida424 | 4:4060309b9cc0 | 113 | // Accel_Gain[2] = 0.50; |
komaida424 | 4:4060309b9cc0 | 114 | Model_Type = 0; |
komaida424 | 0:cca1c4e84da4 | 115 | Gyro_Gain_Setting = -1; |
komaida424 | 2:59ac9df97701 | 116 | Cutoff_Freq=0.15; |
komaida424 | 2:59ac9df97701 | 117 | Flight_Time=360; |
komaida424 | 0:cca1c4e84da4 | 118 | LCD_Contrast = 60; |
komaida424 | 0:cca1c4e84da4 | 119 | PWM_Mode = 1; |
komaida424 | 6:a50e6d3924f1 | 120 | Throttl_Trim = 0; |
komaida424 | 6:a50e6d3924f1 | 121 | PWM_Interval = 3000; |
komaida424 | 0:cca1c4e84da4 | 122 | StartMode = 'C'; |
komaida424 | 6:a50e6d3924f1 | 123 | PID_Interval = 0.004; |
komaida424 | 6:a50e6d3924f1 | 124 | Active_Gyro_Gain = 0.6; |
komaida424 | 6:a50e6d3924f1 | 125 | Reverse_Point = 1500; |
komaida424 | 6:a50e6d3924f1 | 126 | Thro_Limit_Val = 100; |
komaida424 | 6:a50e6d3924f1 | 127 | Thro_Limit_Rate = 0.2; |
komaida424 | 0:cca1c4e84da4 | 128 | } |
komaida424 | 0:cca1c4e84da4 | 129 | }; |
komaida424 | 0:cca1c4e84da4 | 130 | #endif |
komaida424 | 0:cca1c4e84da4 | 131 | |
komaida424 | 0:cca1c4e84da4 | 132 | |
komaida424 | 0:cca1c4e84da4 | 133 | |
komaida424 | 0:cca1c4e84da4 | 134 | |
komaida424 | 0:cca1c4e84da4 | 135 | |
komaida424 | 0:cca1c4e84da4 | 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 | 2:59ac9df97701 | 154 | |
komaida424 | 2:59ac9df97701 | 155 | |
komaida424 | 2:59ac9df97701 | 156 | |
komaida424 | 2:59ac9df97701 | 157 | |
komaida424 | 2:59ac9df97701 | 158 | |
komaida424 | 2:59ac9df97701 | 159 | |
komaida424 | 2:59ac9df97701 | 160 | |
komaida424 | 2:59ac9df97701 | 161 | |
komaida424 | 2:59ac9df97701 | 162 | |
komaida424 | 2:59ac9df97701 | 163 | |
komaida424 | 3:27407c4984cf | 164 | |
komaida424 | 3:27407c4984cf | 165 | |
komaida424 | 3:27407c4984cf | 166 | |
komaida424 | 3:27407c4984cf | 167 | |
komaida424 | 3:27407c4984cf | 168 | |
komaida424 | 3:27407c4984cf | 169 | |
komaida424 | 3:27407c4984cf | 170 | |
komaida424 | 4:4060309b9cc0 | 171 | |
komaida424 | 4:4060309b9cc0 | 172 | |
komaida424 | 4:4060309b9cc0 | 173 | |
komaida424 | 4:4060309b9cc0 | 174 | |
komaida424 | 4:4060309b9cc0 | 175 | |
komaida424 | 4:4060309b9cc0 | 176 | |
komaida424 | 4:4060309b9cc0 | 177 | |
komaida424 | 4:4060309b9cc0 | 178 | |
komaida424 | 4:4060309b9cc0 | 179 | |
komaida424 | 4:4060309b9cc0 | 180 | |
komaida424 | 4:4060309b9cc0 | 181 | |
komaida424 | 6:a50e6d3924f1 | 182 | |
komaida424 | 6:a50e6d3924f1 | 183 |