Subversion Repositories FlightCtrl

Rev

Rev 2089 | Rev 2095 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2089 Rev 2092
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
mixerMatrix_t mixerMatrix;
14
IMUConfig_t IMUConfig;
Line 14... Line 15...
14
volatile DynamicParams_t dynamicParams;
15
volatile DynamicParams_t dynamicParams;
15
 
16
 
16
uint8_t CPUType;
17
uint8_t CPUType;
Line 150... Line 151...
150
  staticParams.minThrottle = 8;
151
  staticParams.minThrottle = 8;
151
  staticParams.maxThrottle = 230;
152
  staticParams.maxThrottle = 230;
152
  staticParams.externalControl = 0;
153
  staticParams.externalControl = 0;
153
  staticParams.motorSmoothing = 0;
154
  staticParams.motorSmoothing = 0;
Line 154... Line -...
154
 
-
 
155
  // IMU
-
 
156
  staticParams.gyroPIDFilterConstant = 1;
-
 
157
  staticParams.gyroDFilterConstant = 1;
-
 
158
  staticParams.accFilterConstant = 10;
-
 
159
 
155
 
160
  staticParams.gyroP = 60;
156
  staticParams.gyroP = 60;
161
  staticParams.gyroI = 80;
157
  staticParams.gyroI = 80;
Line 162... Line 158...
162
  staticParams.gyroD = 4;
158
  staticParams.gyroD = 4;
163
 
159
 
164
  // set by gyro-specific code: gyro_setDefaults().
160
  // set by gyro-specific code: gyro_setDefaults().
165
  // staticParams.zerothOrderCorrection = 
161
  // staticParams.zerothOrderCorrection = 
Line 166... Line 162...
166
  // staticParams.driftCompDivider = 
162
  // staticParams.driftCompDivider = 
167
  // staticParams.driftCompLimit = 
-
 
168
 
-
 
169
  staticParams.dynamicStability = 50;
163
  // staticParams.driftCompLimit = 
170
  staticParams.rateTolerance = 10;
164
 
171
  staticParams.yawRateFactor = 4;
165
  staticParams.dynamicStability = 50;
172
  staticParams.IFactor = 52;
166
  staticParams.IFactor = 52;
173
  staticParams.yawIFactor = 100;  
167
  staticParams.yawIFactor = 100;  
Line 199... Line 193...
199
 
193
 
200
  staticParams.outputDebugMask = 8;
194
  staticParams.outputDebugMask = 8;
Line 201... Line 195...
201
  staticParams.outputFlags   = OUTPUTFLAGS_FLASH_0_AT_BEEP | OUTPUTFLAGS_FLASH_1_AT_BEEP | OUTPUTFLAGS_USE_ONBOARD_LEDS;
195
  staticParams.outputFlags   = OUTPUTFLAGS_FLASH_0_AT_BEEP | OUTPUTFLAGS_FLASH_1_AT_BEEP | OUTPUTFLAGS_USE_ONBOARD_LEDS;
-
 
196
 
-
 
197
  staticParams.naviMode = 0; // free.
-
 
198
  staticParams.airpressureWindowLength = 0;
-
 
199
  staticParams.airpressureDWindowLength = 24;
-
 
200
 
-
 
201
  staticParams.heightControlMaxIntegralIn = 125;
-
 
202
  staticParams.heightControlMaxIntegralOut = 75;
-
 
203
  staticParams.heightControlMaxThrottleChange = 75;
202
 
204
  staticParams.heightControlTestOscPeriod = 0;
Line 203... Line 205...
203
  staticParams.naviMode = 0; // free.
205
  staticParams.heightControlTestOscAmplitude = 0;
204
}
206
}
205
 
207
 
206
/***************************************************/
208
/***************************************************/
207
/*    Default Values for parameter set 1           */
209
/*    Default Values for parameter set 1           */
208
/***************************************************/
-
 
Line 209... Line 210...
209
void paramSet_default(uint8_t setnumber) {
210
/***************************************************/
210
  setOtherDefaults();
211
void paramSet_default(uint8_t setnumber) {
211
  gyro_setDefaultParameters();
212
  setOtherDefaults();
Line 212... Line 213...
212
 
213
 
213
  for (uint8_t i=0; i<8; i++) {
214
  for (uint8_t i=0; i<8; i++) {
Line 214... Line 215...
214
    staticParams.userParams[i] = 0;
215
    staticParams.userParams[i] = i;
215
  }
216
  }
Line -... Line 217...
-
 
217
 
-
 
218
  staticParams.bitConfig =
-
 
219
    CFG_GYRO_SATURATION_PREVENTION | CFG_COMPASS_ENABLED;
-
 
220
 
-
 
221
  memcpy(staticParams.name, "Default\0", 6);
-
 
222
}
-
 
223
 
-
 
224
void IMUConfig_default(void) {
-
 
225
  IMUConfig.gyroPIDFilterConstant = 1;
-
 
226
  IMUConfig.gyroDFilterConstant = 1;
216
 
227
  IMUConfig.accFilterConstant = 10;
217
  staticParams.bitConfig =
228
  IMUConfig.rateTolerance = 120;
218
    CFG_GYRO_SATURATION_PREVENTION | CFG_COMPASS_ENABLED;
229
  IMUConfig.yawRateFactor = 4;
219
 
230
 
220
  memcpy(staticParams.name, "Default\0", 6);
231
  gyro_setDefaultParameters();