From 366bf09086dfce3d17a06c5b810e739430a281ff Mon Sep 17 00:00:00 2001 From: Jonas Holmberg Date: Tue, 29 Nov 2016 09:52:55 +0100 Subject: [PATCH] small changes to settings --- UAV-ControlSystem/src/Flight/pid.c | 2 +- UAV-ControlSystem/src/drivers/accel_gyro.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/UAV-ControlSystem/src/Flight/pid.c b/UAV-ControlSystem/src/Flight/pid.c index 6e7a73c..125b7d2 100644 --- a/UAV-ControlSystem/src/Flight/pid.c +++ b/UAV-ControlSystem/src/Flight/pid.c @@ -30,7 +30,7 @@ #define BAROMETER_SCALE 5 #define RADIO_RANGE 500 /*Radio range input*/ -#define BAROMETER_RANGE 10 /*Determines the range of the maximum height (limits the rc input)*/ +#define BAROMETER_RANGE 4 /*Determines the range of the maximum height (limits the rc input)*/ #define ACCELEROMETER_RANGE 30 /*Determines the range of the maximum angle (limits the rc input) & (Accelerometer takes int to max 16 G)*/ #define GYRO_RANGE 720 /*Determines the maximum rotational limit (limits the rc input)*/ #define COMPASS_RANGE 180 /*Determines the maximum compass limit (limits the rc input)*/ diff --git a/UAV-ControlSystem/src/drivers/accel_gyro.c b/UAV-ControlSystem/src/drivers/accel_gyro.c index 2a1879d..5dba96e 100644 --- a/UAV-ControlSystem/src/drivers/accel_gyro.c +++ b/UAV-ControlSystem/src/drivers/accel_gyro.c @@ -617,7 +617,7 @@ void mpu6000_read_angle(accel_t* accel, gyro_t* gyro) //accel->pitchAngle += (a_PitchAngle - accel->pitchAngle) / (float)4000; //Combine the gyro approximation with the accelerometer data to avoid drift - float ratio = 0.98; + float ratio = 0.9996; accel->rollAngle = (accel->rollAngle * ratio) + (a_RollAngle * (float)(1-ratio)); accel->pitchAngle = (accel->pitchAngle * ratio) + (a_PitchAngle * (float)(1-ratio)); }