Rev 2156 | Rev 2159 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2156 | Rev 2158 | ||
---|---|---|---|
Line 8... | Line 8... | ||
8 | #include "flight.h" |
8 | #include "flight.h" |
Line 9... | Line 9... | ||
9 | 9 | ||
10 | int16_t variables[VARIABLE_COUNT]; |
10 | int16_t variables[VARIABLE_COUNT]; |
11 | ParamSet_t staticParams; |
11 | ParamSet_t staticParams; |
12 | ChannelMap_t channelMap; |
12 | ChannelMap_t channelMap; |
13 | MixerMatrix_t mixerMatrix; |
13 | MotorMixer_t motorMixer; |
14 | IMUConfig_t IMUConfig; |
14 | IMUConfig_t IMUConfig; |
Line 15... | Line 15... | ||
15 | volatile DynamicParams_t dynamicParams; |
15 | volatile DynamicParams_t dynamicParams; |
16 | 16 | ||
Line 149... | Line 149... | ||
149 | staticParams.stickYawP = 12; |
149 | staticParams.stickYawP = 12; |
150 | staticParams.stickThrottleD = 12; |
150 | staticParams.stickThrottleD = 12; |
151 | staticParams.minThrottle = 8; |
151 | staticParams.minThrottle = 8; |
152 | staticParams.maxThrottle = 230; |
152 | staticParams.maxThrottle = 230; |
153 | staticParams.externalControl = 0; |
153 | staticParams.externalControl = 0; |
- | 154 | staticParams.attitudeControl = 0; |
|
154 | staticParams.motorSmoothing = 0; |
155 | staticParams.motorSmoothing = 0; |
Line 155... | Line 156... | ||
155 | 156 | ||
156 | staticParams.gyroP = 60; |
157 | staticParams.gyroP = 60; |
157 | staticParams.gyroI = 80; |
158 | staticParams.gyroI = 80; |
Line 189... | Line 190... | ||
189 | staticParams.outputFlash[0].bitmask = 1; //0b01011111; |
190 | staticParams.outputFlash[0].bitmask = 1; //0b01011111; |
190 | staticParams.outputFlash[0].timing = 15; |
191 | staticParams.outputFlash[0].timing = 15; |
191 | staticParams.outputFlash[1].bitmask = 3; //0b11110011; |
192 | staticParams.outputFlash[1].bitmask = 3; //0b11110011; |
192 | staticParams.outputFlash[1].timing = 15; |
193 | staticParams.outputFlash[1].timing = 15; |
Line 193... | Line 194... | ||
193 | 194 | ||
194 | staticParams.outputDebugMask = 8; |
195 | staticParams.outputDebugMask = DEBUG_ACC0THORDER; |
Line 195... | Line 196... | ||
195 | staticParams.outputFlags = OUTPUTFLAGS_FLASH_0_AT_BEEP | OUTPUTFLAGS_FLASH_1_AT_BEEP | OUTPUTFLAGS_USE_ONBOARD_LEDS; |
196 | staticParams.outputFlags = OUTPUTFLAGS_FLASH_0_AT_BEEP | OUTPUTFLAGS_FLASH_1_AT_BEEP | OUTPUTFLAGS_USE_ONBOARD_LEDS; |
196 | 197 | ||
197 | staticParams.naviMode = 0; // free. |
198 | staticParams.naviMode = 0; // free. |
Line 213... | Line 214... | ||
213 | 214 | ||
214 | for (uint8_t i=0; i<8; i++) { |
215 | for (uint8_t i=0; i<8; i++) { |
215 | staticParams.userParams[i] = i; |
216 | staticParams.userParams[i] = i; |
Line 216... | Line 217... | ||
216 | } |
217 | } |
217 | - | ||
Line 218... | Line 218... | ||
218 | staticParams.bitConfig = |
218 | |
219 | CFG_GYRO_SATURATION_PREVENTION | CFG_COMPASS_ENABLED; |
219 | staticParams.bitConfig = CFG_GYRO_SATURATION_PREVENTION; |
Line 220... | Line 220... | ||
220 | 220 | ||
221 | memcpy(staticParams.name, "Default\0", 6); |
221 | memcpy(staticParams.name, "Default\0", 6); |
222 | } |
222 | } |
223 | 223 | ||
224 | void IMUConfig_default(void) { |
224 | void IMUConfig_default(void) { |
225 | IMUConfig.gyroPIDFilterConstant = 1; |
225 | IMUConfig.gyroPIDFilterConstant = 1; |
226 | IMUConfig.gyroDWindowLength = 3; |
226 | IMUConfig.gyroDWindowLength = 3; |
Line 227... | Line 227... | ||
227 | IMUConfig.gyroDFilterConstant = 1; |
227 | // IMUConfig.gyroDFilterConstant = 1; |
228 | IMUConfig.accFilterConstant = 10; |
228 | IMUConfig.accFilterConstant = 10; |
Line 229... | Line 229... | ||
229 | IMUConfig.rateTolerance = 120; |
229 | IMUConfig.rateTolerance = 120; |
230 | IMUConfig.gyroActivityDamping = 24; |
230 | IMUConfig.gyroActivityDamping = 24; |
231 | 231 | ||
232 | gyro_setDefaultParameters(); |
232 | gyro_setDefaultParameters(); |
233 | } |
233 | } |
234 | - | ||
235 | /***************************************************/ |
234 | |
236 | /* Default Values for Mixer Table */ |
235 | /***************************************************/ |
237 | /***************************************************/ |
236 | /* Default Values for Mixer Table */ |
238 | void mixerMatrix_default(void) { // Quadro |
237 | /***************************************************/ |
239 | uint8_t i; |
238 | void motorMixer_default(void) { // Quadro |
240 | // mixerMatric.revision = EEMIXER_REVISION; |
239 | uint8_t i; |
241 | // clear mixer table (but preset throttle) |
240 | // clear mixer table (but preset throttle) |
242 | for (i = 0; i < 16; i++) { |
241 | for (i = 0; i < MAX_MOTORS; i++) { |
243 | mixerMatrix.motor[i][MIX_THROTTLE] = i < 4 ? 64 : 0; |
242 | motorMixer.matrix[i][MIX_THROTTLE] = i < 4 ? 64 : 0; |
244 | mixerMatrix.motor[i][MIX_PITCH] = 0; |
243 | motorMixer.matrix[i][MIX_PITCH] = 0; |
- | 244 | motorMixer.matrix[i][MIX_ROLL] = 0; |
|
- | 245 | motorMixer.matrix[i][MIX_YAW] = 0; |
|
245 | mixerMatrix.motor[i][MIX_ROLL] = 0; |
246 | } |
246 | mixerMatrix.motor[i][MIX_YAW] = 0; |
247 | // default = Quadro |
- | 248 | motorMixer.matrix[0][MIX_PITCH] = +64; |
|
- | 249 | motorMixer.matrix[0][MIX_YAW] = +64; |
|
247 | } |
250 | motorMixer.matrix[0][MIX_OPPOSITE_MOTOR] = 1; |
248 | // default = Quadro |
251 | |
- | 252 | motorMixer.matrix[1][MIX_PITCH] = -64; |
|
- | 253 | motorMixer.matrix[1][MIX_YAW] = +64; |
|
249 | mixerMatrix.motor[0][MIX_PITCH] = +64; |
254 | motorMixer.matrix[1][MIX_OPPOSITE_MOTOR] = 0; |
250 | mixerMatrix.motor[0][MIX_YAW] = +64; |
255 | |
- | 256 | motorMixer.matrix[2][MIX_ROLL] = -64; |
|
- | 257 | motorMixer.matrix[2][MIX_YAW] = -64; |
|
251 | mixerMatrix.motor[1][MIX_PITCH] = -64; |
258 | motorMixer.matrix[2][MIX_OPPOSITE_MOTOR] = 3; |
Line 252... | Line 259... | ||
252 | mixerMatrix.motor[1][MIX_YAW] = +64; |
259 | |
253 | mixerMatrix.motor[2][MIX_ROLL] = -64; |
260 | motorMixer.matrix[3][MIX_ROLL] = +64; |
254 | mixerMatrix.motor[2][MIX_YAW] = -64; |
261 | motorMixer.matrix[3][MIX_YAW] = -64; |
255 | mixerMatrix.motor[3][MIX_ROLL] = +64; |
262 | motorMixer.matrix[3][MIX_OPPOSITE_MOTOR] = 2; |
Line 271... | Line 278... | ||
271 | mixerMatrix.motor[2][MIX_YAW] = -64; |
278 | mixerMatrix.motor[2][MIX_YAW] = -64; |
Line 272... | Line 279... | ||
272 | 279 | ||
273 | mixerMatrix.motor[3][MIX_PITCH] = -45; |
280 | mixerMatrix.motor[3][MIX_PITCH] = -45; |
274 | mixerMatrix.motor[3][MIX_ROLL] = +45; |
281 | mixerMatrix.motor[3][MIX_ROLL] = +45; |
275 | mixerMatrix.motor[3][MIX_YAW] = -64; |
- | |
Line 276... | Line 282... | ||
276 | */ |
282 | mixerMatrix.motor[3][MIX_YAW] = -64; |
- | 283 | ||
277 | 284 | memcpy(motorMixer.name, "Quadro X\0", 9); |
|
Line 278... | Line 285... | ||
278 | memcpy(mixerMatrix.name, "X\0", 7); |
285 | */ |
279 | } |
286 | } |
280 | 287 |