1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-23 16:25:31 +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

Conflicts:

	src/config.c
	src/drivers/accgyro_l3g4200d.c
	src/drivers/accgyro_mpu3050.c
	src/drivers/accgyro_mpu6050.c
	src/flight_imu.c
	src/mw.c
	src/mw.h
	src/serial_cli.c
	src/serial_msp.c
	src/utils.c
	src/utils.h
This commit is contained in:
Lukas S 2013-11-03 03:40:16 +01:00 committed by Dominic Clifton
parent 1df79e65fc
commit cffdfb782c
15 changed files with 222 additions and 39 deletions

5
src/flight_imu.c Normal file → Executable file
View file

@ -62,7 +62,7 @@ float throttleAngleScale;
int32_t BaroPID = 0;
float magneticDeclination = 0.0f; // calculated at startup from config
float gyroScaleRad;
// **************
// gyro+acc IMU
@ -80,6 +80,7 @@ void imuInit(void)
smallAngle = lrintf(acc_1G * cosf(RAD * 25.0f));
accVelScale = 9.80665f / acc_1G / 10000.0f;
throttleAngleScale = (1800.0f / M_PI) * (900.0f / currentProfile.throttle_correction_angle);
gyroScaleRad = gyro.scale * (M_PI / 180.0f) * 0.000001f;
#ifdef MAG
// if mag sensor is enabled, use it
@ -278,7 +279,7 @@ static void getEstimatedAttitude(void)
float scale;
fp_angles_t deltaGyroAngle;
deltaT = currentT - previousT;
scale = deltaT * gyro.scale;
scale = deltaT * gyroScaleRad;
previousT = currentT;
// Initialization