Subversion Repositories FlightCtrl

Rev

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

Rev 1979 Rev 2015
Line 14... Line 14...
14
 * How much low pass filtering to apply for gyro_ATT.
14
 * How much low pass filtering to apply for gyro_ATT.
15
 * 0=illegal, 1=no filtering, 2=50% last value + 50% new value, 3=67% last value + 33 % new value etc...
15
 * 0=illegal, 1=no filtering, 2=50% last value + 50% new value, 3=67% last value + 33 % new value etc...
16
 * Temporarily replaced by userparam-configurable variable.
16
 * Temporarily replaced by userparam-configurable variable.
17
 */
17
 */
18
// #define GYROS_ATT_FILTER 1
18
// #define GYROS_ATT_FILTER 1
19
 
-
 
20
// Temporarily replaced by userparam-configurable variable.
19
// Temporarily replaced by userparam-configurable variable.
21
// #define ACC_FILTER 4
20
// #define ACC_FILTER 4
Line 22... Line 21...
22
 
21
 
23
/*
22
/*
Line 173... Line 172...
173
 * integration to angles. For the same axis, the PID and ATT variables
172
 * integration to angles. For the same axis, the PID and ATT variables
174
 * generally have about the same values. There are just some differences
173
 * generally have about the same values. There are just some differences
175
 * in filtering, and when a gyro becomes near saturated.
174
 * in filtering, and when a gyro becomes near saturated.
176
 * Maybe this distinction is not really necessary.
175
 * Maybe this distinction is not really necessary.
177
 */
176
 */
178
extern volatile int16_t gyro_PID[2];
177
extern int16_t gyro_PID[2];
179
extern volatile int16_t gyro_ATT[2];
178
extern int16_t gyro_ATT[2];
180
extern volatile int16_t gyroD[2];
179
extern int16_t gyroD[2];
181
extern volatile int16_t yawGyro;
180
extern int16_t yawGyro;
182
extern volatile uint16_t ADCycleCount;
181
extern volatile uint16_t ADCycleCount;
183
extern volatile int16_t UBat;
182
extern int16_t UBat;
Line 184... Line 183...
184
 
183
 
185
// 1:11 voltage divider, 1024 counts per 3V, and result is divided by 3.
184
// 1:11 voltage divider, 1024 counts per 3V, and result is divided by 3.
Line 186... Line 185...
186
#define UBAT_AT_5V (int16_t)((5.0 * (1.0/11.0)) * 1024 / (3.0 * 3))
185
#define UBAT_AT_5V (int16_t)((5.0 * (1.0/11.0)) * 1024 / (3.0 * 3))
Line 190... Line 189...
190
extern sensorOffset_t gyroAmplifierOffset;
189
extern sensorOffset_t gyroAmplifierOffset;
Line 191... Line 190...
191
 
190
 
192
/*
191
/*
193
 * This is not really for external use - but the ENC-03 gyro modules needs it.
192
 * This is not really for external use - but the ENC-03 gyro modules needs it.
194
 */
193
 */
Line 195... Line 194...
195
extern volatile int16_t rawGyroSum[3];
194
//extern volatile int16_t rawGyroSum[3];
196
 
195
 
197
/*
196
/*
198
 * The acceleration values that this module outputs. They are zero based.
197
 * The acceleration values that this module outputs. They are zero based.
199
 */
198
 */
200
extern volatile int16_t acc[3];
199
extern int16_t acc[3];
Line 201... Line 200...
201
extern volatile int16_t filteredAcc[3];
200
extern int16_t filteredAcc[3];
202
// extern volatile int32_t stronglyFilteredAcc[3];
201
// extern volatile int32_t stronglyFilteredAcc[3];
203
 
202
 
204
/*
203
/*
205
 * Diagnostics: Gyro noise level because of motor vibrations. The variables
204
 * Diagnostics: Gyro noise level because of motor vibrations. The variables
206
 * only really reflect the noise level when the copter stands still but with
205
 * only really reflect the noise level when the copter stands still but with
207
 * its motors running.
206
 * its motors running.
Line 208... Line 207...
208
 */
207
 */
209
extern volatile uint16_t gyroNoisePeak[3];
208
extern uint16_t gyroNoisePeak[3];
210
extern volatile uint16_t accNoisePeak[3];
209
extern uint16_t accNoisePeak[3];
211
 
210
 
Line 252... Line 251...
252
#define PRESSURE_EXTRAPOLATION_COEFF 25L
251
#define PRESSURE_EXTRAPOLATION_COEFF 25L
253
#define AUTORANGE_WAIT_FACTOR 1
252
#define AUTORANGE_WAIT_FACTOR 1
Line 254... Line 253...
254
 
253
 
Line 255... Line 254...
255
#define ABS_ALTITUDE_OFFSET 108205
254
#define ABS_ALTITUDE_OFFSET 108205
256
 
255
 
257
extern volatile uint16_t simpleAirPressure;
256
extern uint16_t simpleAirPressure;
258
/*
257
/*
259
 * At saturation, the filteredAirPressure may actually be (simulated) negative.
258
 * At saturation, the filteredAirPressure may actually be (simulated) negative.
Line 260... Line 259...
260
 */
259
 */
261
extern volatile int32_t filteredAirPressure;
260
extern int32_t filteredAirPressure;
262
 
261
 
263
/*
262
/*
Line 264... Line 263...
264
 * Flag: Interrupt handler has done all A/D conversion and processing.
263
 * Flag: Interrupt handler has done all A/D conversion and processing.
Line 265... Line 264...
265
 */
264
 */
-
 
265
extern volatile uint8_t analogDataReady;
-
 
266
 
-
 
267
void analog_init(void);
-
 
268
 
-
 
269
/*
-
 
270
 * This is really only for use for the ENC-03 code module, which needs to get the raw value
266
extern volatile uint8_t analogDataReady;
271
 * for its calibration. The raw value should not be used for anything else.
267
 
272
 */
268
void analog_init(void);
273
uint16_t rawGyroValue(uint8_t axis);
Line 269... Line 274...
269
 
274