Subversion Repositories FlightCtrl

Rev

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

Rev 2099 Rev 2102
Line 114... Line 114...
114
// 1:11 voltage divider, 1024 counts per 3V, and result is divided by 3.
114
// 1:11 voltage divider, 1024 counts per 3V, and result is divided by 3.
115
#define UBAT_AT_5V (int16_t)((5.0 * (1.0/11.0)) * 1024 / (3.0 * 3))
115
#define UBAT_AT_5V (int16_t)((5.0 * (1.0/11.0)) * 1024 / (3.0 * 3))
Line 116... Line 116...
116
 
116
 
117
extern sensorOffset_t gyroOffset;
117
extern sensorOffset_t gyroOffset;
118
//extern sensorOffset_t accOffset;
118
//extern sensorOffset_t accOffset;
Line 119... Line 119...
119
extern sensorOffset_t gyroAmplifierOffset;
119
//extern sensorOffset_t gyroAmplifierOffset;
120
 
120
 
121
/*
121
/*
122
 * This is not really for external use - but the ENC-03 gyro modules needs it.
122
 * This is not really for external use - but the ENC-03 gyro modules needs it.
Line 134... Line 134...
134
 * Diagnostics: Gyro noise level because of motor vibrations. The variables
134
 * Diagnostics: Gyro noise level because of motor vibrations. The variables
135
 * only really reflect the noise level when the copter stands still but with
135
 * only really reflect the noise level when the copter stands still but with
136
 * its motors running.
136
 * its motors running.
137
 */
137
 */
138
extern uint16_t gyroNoisePeak[3];
138
extern uint16_t gyroNoisePeak[3];
139
extern uint16_t accNoisePeak[3];
139
//extern uint16_t accNoisePeak[3];
Line 140... Line 140...
140
 
140
 
141
/*
141
/*
142
 * Air pressure.
142
 * Air pressure.
143
 * The sensor has a sensitivity of 45 mV/kPa.
143
 * The sensor has a sensitivity of 45 mV/kPa.
Line 166... Line 166...
166
3503 mV = 5V(0.009P-0.095)  P = 88.4   kPa  h = 384m  Diff: 1079.5m
166
3503 mV = 5V(0.009P-0.095)  P = 88.4   kPa  h = 384m  Diff: 1079.5m
167
Pressure at sea level: 101.3 kPa. voltage: 5V * (0.009P-0.095) = 4.0835V
167
Pressure at sea level: 101.3 kPa. voltage: 5V * (0.009P-0.095) = 4.0835V
168
This is OCR2 = 143.15 at 1.5V in --> simple pressure =
168
This is OCR2 = 143.15 at 1.5V in --> simple pressure =
169
*/
169
*/
Line 170... Line -...
170
 
-
 
171
#define AIRPRESSURE_OVERSAMPLING 14
-
 
172
#define AIRPRESSURE_FILTER 8
-
 
173
// Minimum A/D value before a range change is performed.
-
 
174
#define MIN_RAWPRESSURE (200 * 2)
-
 
175
// Maximum A/D value before a range change is performed.
-
 
176
#define MAX_RAWPRESSURE (1023 * 2 - MIN_RAWPRESSURE)
-
 
177
 
-
 
178
#define MIN_RANGES_EXTRAPOLATION 15
-
 
179
#define MAX_RANGES_EXTRAPOLATION 240
-
 
180
 
-
 
181
#define PRESSURE_EXTRAPOLATION_COEFF 25L
-
 
182
#define AUTORANGE_WAIT_FACTOR 1
-
 
183
 
-
 
184
#define ABS_ALTITUDE_OFFSET 108205
-
 
185
 
170
 
186
extern uint16_t simpleAirPressure;
-
 
187
/*
-
 
188
 * At saturation, the filteredAirPressure may actually be (simulated) negative.
-
 
189
 */
-
 
190
extern int32_t filteredAirPressure;
-
 
191
 
-
 
192
extern int16_t magneticHeading;
-
 
193
 
171
extern uint16_t simpleAirPressure;
Line 194... Line 172...
194
extern uint32_t gyroActivity;
172
extern uint16_t airspeedVelocity;
195
 
173
 
196
/*
174
/*
197
 * Flag: Interrupt handler has done all A/D conversion and processing.
175
 * Flag: Interrupt handler has done all A/D conversion and processing.
Line 230... Line 208...
230
/*
208
/*
231
 * Zero-offset accelerometers and write the calibration data to EEPROM.
209
 * Zero-offset accelerometers and write the calibration data to EEPROM.
232
 */
210
 */
233
//void analog_calibrateAcc(void);
211
//void analog_calibrateAcc(void);
Line 234... Line -...
234
 
-
 
235
 
-
 
236
void analog_setGround(void);
-
 
237
 
-
 
238
int32_t analog_getHeight(void);
-
 
239
int16_t analog_getDHeight(void);
-
 
240
 
212