Subversion Repositories FlightCtrl

Compare Revisions

Ignore whitespace Rev 1645 → Rev 1646

/branches/dongfang_FC_rewrite/analog.h
2,8 → 2,9
#define _ANALOG_H
#include <inttypes.h>
 
// #include "invenSense.h"
#include "ENC-03_FC1.3.h"
//#include "invenSense.h"
//#include "ENC-03_FC1.3.h"
#include "ADXRS610_FC2.0.h"
 
/*
* How much low pass filtering to apply for gyro_PID.
10,7 → 11,7
* 0=illegal, 1=no filtering, 2=50% last value + 50% new value, 3=67% last value + 33 % new value etc...
* Temporarily replaced by userparam-configurable variable.
*/
#define GYROS_PIDFILTER 1
// #define GYROS_PID_FILTER 1
 
/*
* How much low pass filtering to apply for gyro_ATT.
17,10 → 18,10
* 0=illegal, 1=no filtering, 2=50% last value + 50% new value, 3=67% last value + 33 % new value etc...
* Temporarily replaced by userparam-configurable variable.
*/
#define GYROS_INTEGRALFILTER 1
// #define GYROS_ATT_FILTER 1
 
// Temporarily replaced by userparam-configurable variable.
//#define ACC_FILTER 4
// #define ACC_FILTER 4
 
/*
About setting constants for different gyros:
28,7 → 29,10
The "Positive direction" is the rotation direction around an axis where
the corresponding gyro outputs a voltage > the no-rotation voltage.
A gyro is considered, in this code, to be "forward" if its positive
direction is the same as in FC1.0-1.3, and reverse otherwise.
direction is:
- Nose down for pitch
- Left hand side down for roll
- Clockwise seen from above for yaw.
Declare the GYRO_REVERSE_YAW, GYRO_REVERSE_ROLL and
GYRO_REVERSE_PITCH #define's if the respective gyros are reverse.
100,6 → 104,9
#define GYRO_SUMMATION_FACTOR_PITCHROLL 4
#define GYRO_SUMMATION_FACTOR_YAW 2
 
#define ACC_SUMMATION_FACTOR_PITCHROLL 2
#define ACC_SUMMATION_FACTOR_Z 1
 
/*
Integration:
The HiResXXXX values are divided by 8 (in H&I firmware) before integration.
160,6 → 167,8
 
#define PITCH 0
#define ROLL 1
#define YAW 2
#define Z 2
/*
* The values that this module outputs
* These first 2 exported arrays are zero-offset. The "PID" ones are used
180,12 → 189,12
/*
* This is not really for external use - but the ENC-03 gyro modules needs it.
*/
extern volatile int16_t rawGyroSum[2], rawYawGyroSum;
extern volatile int16_t rawGyroSum[3];
 
/*
* The acceleration values that this module outputs. They are zero based.
*/
extern volatile int16_t acc[2], ZAcc;
extern volatile int16_t acc[3];
extern volatile int16_t filteredAcc[2];
 
/*