mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-05-23 12:57:34 +08:00
Merge pull request #45 from thomasgubler/master_origin
re-adding pid limitation & mavlink waypoint handling fix
This commit is contained in:
@@ -172,9 +172,9 @@ __EXPORT float pid_calculate(PID_t *pid, float sp, float val, float val_dot, flo
|
||||
// Calculate the output. Limit output magnitude to pid->limit
|
||||
float output = (pid->error_previous * pid->kp) + (i * pid->ki) + (d * pid->kd);
|
||||
|
||||
//if (output > pid->limit) output = pid->limit;
|
||||
if (output > pid->limit) output = pid->limit;
|
||||
|
||||
//if (output < -pid->limit) output = -pid->limit;
|
||||
if (output < -pid->limit) output = -pid->limit;
|
||||
|
||||
if (isfinite(output)) {
|
||||
pid->last_output = output;
|
||||
|
||||
Reference in New Issue
Block a user