1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-15 12:25:20 +03:00

new Baseflight PID

full gyro scale is used now
and a new pid with float calculations was added based on PIDrewrite
eeprom size was also increased from 1kB to 2kB
This commit is contained in:
Lukas S 2013-11-03 03:40:16 +01:00
parent bff260c7c6
commit b996b26cbb
11 changed files with 192 additions and 31 deletions

View file

@ -19,6 +19,7 @@ int32_t vario = 0; // variometer in cm/s
int16_t throttleAngleCorrection = 0; // correction of throttle in lateral wind,
float magneticDeclination = 0.0f; // calculated at startup from config
float accVelScale;
float gyroScaleRad;
// **************
// gyro+acc IMU
@ -34,6 +35,7 @@ void imuInit(void)
{
accZ_25deg = acc_1G * cosf(RAD * 25.0f);
accVelScale = 9.80665f / acc_1G / 10000.0f;
gyroScaleRad = gyro.scale * (M_PI / 180.0f) * 0.000001f;
#ifdef MAG
// if mag sensor is enabled, use it
@ -261,7 +263,7 @@ static void getEstimatedAttitude(void)
uint32_t deltaT;
float scale, deltaGyroAngle[3];
deltaT = currentT - previousT;
scale = deltaT * gyro.scale;
scale = deltaT * gyroScaleRad;
previousT = currentT;
// Initialization