1,6 → 1,6 |
/*####################################################################################### |
Attitude sense system (processing of gyro, accelerometer and altimeter data) |
#######################################################################################*/ |
/*********************************************************************************/ |
/* Attitude sense system (processing of gyro, accelerometer and altimeter data) */ |
/*********************************************************************************/ |
|
#ifndef _ATTITUDE_H |
#define _ATTITUDE_H |
33,7 → 33,7 |
* Gyro readings are divided by this before being used in attitude control. This will scale them |
* to match the scale of the stick control etc. variables. This is just a rough non-precision |
* scaling - the below definitions make precise conversion factors. |
* Will be about 4 for InvenSense, 8 for FC1.3 and 13 for ADXRS610 (hmmm - originally is was only 8???) |
* Will be about 4 for InvenSense, 8 for FC1.3 and 8 for ADXRS610. |
* The number 1250 is derived from the original code: It has about 225000 = 1250 * 180 for 180 degrees. |
*/ |
#define HIRES_GYRO_INTEGRATION_FACTOR (int)((GYRO_RATE_FACTOR_PITCHROLL * INTEGRATION_FREQUENCY * GYRO_PITCHROLL_CORRECTION) / 1250) |
81,13 → 81,13 |
/* |
* Rotation rates |
*/ |
extern int16_t pitchRate_PID, rollRate_PID, yawRate; |
extern int16_t pitchDifferential, rollDifferential; |
extern int16_t rate_PID[2], yawRate; |
extern int16_t differential[2]; |
|
/* |
* Attitudes calcualted by numerical integration of gyro rates |
* Attitudes calculated by numerical integration of gyro rates |
*/ |
extern int32_t pitchAngle, rollAngle, yawAngle; |
extern int32_t angle[2], yawAngle; |
|
// extern volatile int32_t ReadingIntegralTop; // calculated in analog.c |
|
104,12 → 104,6 |
extern uint16_t badCompassHeading; |
|
/* |
* Height control |
*/ |
extern int readingHeight; |
extern int setPointHeight; |
|
/* |
* Interval wrap-over values for attitude integrals |
*/ |
extern long turnOver180Pitch, turnOver180Roll; |
127,8 → 121,7 |
* - Detect which way the pilot pulls the stick to keep the copter steady, and correct by that |
* - Invent your own... |
*/ |
extern int16_t dynamicOffsetPitch, dynamicOffsetRoll, dynamicOffsetYaw; |
// extern int16_t savedDynamicOffsetPitch, savedDynamicOffsetRoll; |
extern int16_t dynamicOffset[2], dynamicOffsetYaw; |
|
/* |
* Re-init flight attitude, setting all angles to 0 (or to whatever can be derived from acc. sensor). |