电机PID调节
无刷直流电机,想采用增量式PID调节,速度闭环。请问PID的输出结果 iIncpid,怎么和占空比、转速联系起来,十分感谢! (越详细越好)以下是增量式PID的程序
int IncPIDCalc(int NextPoint)
{
int iError, iIncpid; //当前误差
iError = SetPoint - NextPoint; //增量计算
iIncpid = Proportion * iError //E项
- Integral * LastError //E项
+ Derivative * PrevError; //E项
//存储误差,用于下次计算
PrevError = sptr->LastError;
LastError = iError;
//返回增量值
return(iIncpid);
}
SetPoint - 设定转速
NextPoint当前转速
iIncpid占空比
页:
[1]