mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-15 20:35:33 +03:00
synced with mwc 2.1. it's suprising how many "new" things in 2.1 didn't actually matter on a real platform.
removed camtrig stuff since it wasnt possible. somewhat replaced with aux forwarding (see below) 2.1 buzzer code changed, untested. removed flying wing mixer. nobody used that. added alt_hold_throttle_neutral, nav_slew_rate and looptime configuration to cli. default looptime set to 3000. changed default gyro_cmpf to 400 to sync with 2.1. increased bmp085 oversampling added gimbal_flags (bit 4 set) flag which, in PPM mode, forwards AUX1..4 to the lower 4 PWM outputs instead of using them as motors. set gimbal_flags=8 to test it out. output is fixed to 50Hz. merged 2.1 gps changes (not many) casting in gyro smoothing (nobody uses that anyway) calibrate accel in gimbal mode, set smallangle in gyro-only mode vtail4 mixer fix flight tested on quadx w/ppm. git-svn-id: https://afrodevices.googlecode.com/svn/trunk/baseflight@182 7c89a4a9-59b9-e629-4cfe-3a2d53b20e61
This commit is contained in:
parent
e70d7b5d16
commit
c98113b82c
19 changed files with 5363 additions and 5696 deletions
12
src/imu.c
12
src/imu.c
|
@ -72,7 +72,7 @@ void computeIMU(void)
|
|||
for (axis = 0; axis < 3; axis++) {
|
||||
gyroADCinter[axis] = gyroADC[axis] + gyroADCp[axis];
|
||||
// empirical, we take a weighted value of the current and the previous values
|
||||
gyroData[axis] = (gyroADCinter[axis] + gyroADCprevious[axis] + 1) / 3;
|
||||
gyroData[axis] = (gyroADCinter[axis] + gyroADCprevious[axis]) / 3;
|
||||
gyroADCprevious[axis] = gyroADCinter[axis] / 2;
|
||||
if (!sensors(SENSOR_ACC))
|
||||
accADC[axis] = 0;
|
||||
|
@ -89,11 +89,11 @@ void computeIMU(void)
|
|||
Smoothing[YAW] = (cfg.gyro_smoothing_factor) & 0xff;
|
||||
}
|
||||
for (axis = 0; axis < 3; axis++) {
|
||||
gyroData[axis] = (gyroSmooth[axis] * (Smoothing[axis] - 1) + gyroData[axis] + 1) / Smoothing[axis];
|
||||
gyroData[axis] = (int16_t)(((int32_t)((int32_t)gyroSmooth[axis] * (Smoothing[axis] - 1)) + gyroData[axis] + 1 ) / Smoothing[axis]);
|
||||
gyroSmooth[axis] = gyroData[axis];
|
||||
}
|
||||
} else if (cfg.mixerConfiguration == MULTITYPE_TRI) {
|
||||
gyroData[YAW] = (gyroYawSmooth * 2 + gyroData[YAW] + 1) / 3;
|
||||
gyroData[YAW] = (gyroYawSmooth * 2 + gyroData[YAW]) / 3;
|
||||
gyroYawSmooth = gyroData[YAW];
|
||||
}
|
||||
}
|
||||
|
@ -127,12 +127,6 @@ void computeIMU(void)
|
|||
/* Default WMC value: n/a*/
|
||||
//#define MG_LPF_FACTOR 4
|
||||
|
||||
/* Set the Gyro Weight for Gyro/Acc complementary filter */
|
||||
/* Increasing this value would reduce and delay Acc influence on the output of the filter*/
|
||||
/* Default WMC value: 300*/
|
||||
// #define GYR_CMPF_FACTOR 310.0f
|
||||
// #define GYR_CMPF_FACTOR 500.0f
|
||||
|
||||
/* Set the Gyro Weight for Gyro/Magnetometer complementary filter */
|
||||
/* Increasing this value would reduce and delay Magnetometer influence on the output of the filter*/
|
||||
/* Default WMC value: n/a*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue