diff --git a/UAV-ControlSystem/src/Flight/pid.c b/UAV-ControlSystem/src/Flight/pid.c index ad5a3ee..4acc068 100644 --- a/UAV-ControlSystem/src/Flight/pid.c +++ b/UAV-ControlSystem/src/Flight/pid.c @@ -174,7 +174,7 @@ void getPointRate(float *desiredCommand, uint8_t ID_profile) //desiredCommand[THROTTLE] = convertData(RADIO_RANGE, BAROMETER_RANGE, 0, rc_input.Throttle*throttleRate); - desiredCommand[THROTTLE] = 1*20; + desiredCommand[THROTTLE] = 3*20; break; default: @@ -349,6 +349,8 @@ 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], -(int)pidProfile->pid_out_limit, (int)pidProfile->pid_out_limit); + } break;