diff --git a/UAV-ControlSystem/src/Flight/pid.c b/UAV-ControlSystem/src/Flight/pid.c index 0bf95bc..6ca9571 100644 --- a/UAV-ControlSystem/src/Flight/pid.c +++ b/UAV-ControlSystem/src/Flight/pid.c @@ -37,6 +37,8 @@ #define PID_MAX_I 256 /*Constrains ITerm*/ #define PID_MAX_D 512 /*Constrains DTerm*/ +#define DESIRED_HEIGHT 5 + /*Struct that belongs to a certain PID controller*/ typedef struct pidProfileBuff_s { @@ -176,7 +178,7 @@ void getPointRate(float *desiredCommand, uint8_t ID_profile) //desiredCommand[THROTTLE] = convertData(RADIO_RANGE, BAROMETER_RANGE, 0, rc_input.Throttle*throttleRate); - desiredCommand[THROTTLE] = 5*BAROMETER_SCALE; + desiredCommand[THROTTLE] = DESIRED_HEIGHT*BAROMETER_SCALE; break; default: