From a5a888f5534ed81309a8b8f8bb8437739269a511 Mon Sep 17 00:00:00 2001 From: Jonas Holmberg Date: Fri, 11 Nov 2016 11:01:43 +0100 Subject: [PATCH] Small value changes before second barometer test flight --- UAV-ControlSystem/src/Flight/pid.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/UAV-ControlSystem/src/Flight/pid.c b/UAV-ControlSystem/src/Flight/pid.c index 6ca9571..2c7844e 100644 --- a/UAV-ControlSystem/src/Flight/pid.c +++ b/UAV-ControlSystem/src/Flight/pid.c @@ -37,7 +37,7 @@ #define PID_MAX_I 256 /*Constrains ITerm*/ #define PID_MAX_D 512 /*Constrains DTerm*/ -#define DESIRED_HEIGHT 5 +#define DESIRED_HEIGHT 1.5 /*Height value in meters*/ /*Struct that belongs to a certain PID controller*/ typedef struct pidProfileBuff_s { @@ -68,7 +68,7 @@ float accRollFineTune = 0; float accPitchFineTune = 0; float throttleRate = 1; -int HoverForce = 1485;/*Struct profile for input data from sensor*/ +int HoverForce = 1475;/*Struct profile for input data from sensor*/ /************************************************************************** * BRIEF: Scales data from input range to output range * @@ -353,7 +353,7 @@ void pidRun(uint8_t ID) else { pidUAV(&PidProfile[PID_ID_BAROMETER], &PidProfileBuff[PID_ID_BAROMETER]); - PidProfile[PID_ID_BAROMETER].PID_Out[0] = constrainf(PidProfile[PID_ID_BAROMETER].PID_Out[0], -1, (int)PidProfile[PID_ID_BAROMETER].pid_out_limit); + PidProfile[PID_ID_BAROMETER].PID_Out[0] = constrainf(PidProfile[PID_ID_BAROMETER].PID_Out[0], -15, (int)PidProfile[PID_ID_BAROMETER].pid_out_limit); }