嘿,亲!知识可是无价之宝呢,但咱这精心整理的资料也耗费了不少心血呀。小小地破费一下,绝对物超所值哦!如有下载和支付问题,请联系我们QQ(微信同号):78630559
本次赞助数额为: 5 元微信扫码支付:5 元
请留下您的邮箱,我们将在2小时内将文件发到您的邮箱
PID学习软件(C#实现PID)
if ( stepCnt >= Nstep)
{
errorLast = error;
// PID - Difference between curVal and refVal
error = curVal - refVal;
integral = error;
// PID
curVal = curVal Kp * error Ki * integral Kd * (error - errorLast);
stepCnt = 0;
}
if (curVal > 99999 || curVal < -99999)
{
timerData.Stop();
curVal = 0;
resetArgs();
textBox_PSet.Text = "-0.1";
textBox_ISet.Text = "-0.1";
textBox_DSet.Text = "-0.1";
textBox_NAmpSet.Text = "1";
textBox_NShiftSet.Text = "0";
buttonQSpid_Click(buttonQSpid, new EventArgs());
button_NoiseSet_Click(button_NoiseSet, new EventArgs());
button_PIDSet_Click(button_PIDStepSet, new EventArgs());
MessageBox.Show("计算值超出安全范围,可能是PID参数设置不合适,已设置为默认值。","警告");
timerData.Start();
}