• 已解决 73482 个问题
  • 已帮助 5993 位优秀工程师

关于增量式PID

FEItwo 2018-10-28 浏览量:602
在网上找到两种增量式PID 算法的程序,有区别,了解增量式PID 算法的高手,麻烦解释下,对增量的计算不同,都是增量式PID对控制系统的影响有什么区别?

[color=rgb(51 51 51) !important]int IncPIDCalc(int NextPoint)
[color=rgb(51 51 51) !important]{
[color=rgb(51 51 51) !important]register int iError, iIncpid; //当前误差
[color=rgb(51 51 51) !important]iError = sptr-》SetPoint - NextPoint; //增量计算
[color=rgb(51 51 51) !important]iIncpid = sptr-》Proportion * iError //E[k]项
[color=rgb(51 51 51) !important]- sptr-》Integral * sptr-》LastError //E[k-1]项
[color=rgb(51 51 51) !important]+ sptr-》Derivative * sptr-》PrevError; //E[k-2]项
[color=rgb(51 51 51) !important]//存储误差,用于下次计算
[color=rgb(51 51 51) !important]sptr-》PrevError = sptr-》LastError;
[color=rgb(51 51 51) !important]sptr-》LastError = iError;
[color=rgb(51 51 51) !important]//返回增量值
[color=rgb(51 51 51) !important]return(iIncpid);
[color=rgb(51 51 51) !important]}

float PID_realize(float speed)
{
    float incrementSpeed;
    pid.SetSpeed = speed;
    pid.err = pid.SetSpeed - pid.ActualSpeed;
     

    incrementSpeed = pid.Kp * (pid.err -pid.err_last ) + pid.Ki*pid.err + pid.Kd*(pid.err -2* pid.err_last + pid.err_last_next);

    pid.ActualSpeed += incrementSpeed;
    pid.err_last = pid.err;
    pid.err_last_next = pid.err_last;
    return pid.ActualSpeed;
}
0 0 收起

我来回答

上传资料:
选择文件 文件大小不超过15M(格式支持:doc、ppt、xls、pdf、zip、rar、txt)
最佳答案
  • 增量式PID核心就是增量,每次只考虑最近三次的误差值,用这次三次误差值产生控制量,加到最终控制量上,形成对系统的控制。
    • 发布于 2018-10-31
    • 举报
    • 评论 0
    • 0
    • 0

其他答案 数量:3
  • 简单来说增量式PID是位置式PID的微分形式,不过PID的三个参数的作用还是一样的,有些许差别,
    • 发布于2018-10-30
    • 举报
    • 评论 0
    • 0
    • 0

  • 这个是你的参数设置,实际来说都是一样的,控制的效果没有什么区别
    • 发布于2018-11-25
    • 举报
    • 评论 0
    • 0
    • 0

  • 增量式的PID就传统的PID变形,参数的使用有点差异,控制效果都是一样的
    • 发布于2018-12-09
    • 举报
    • 评论 0
    • 0
    • 0

相关问题

问题达人换一批

关于增量式PID