我正在尝试将此 PID 控制代码添加到我的 VB.net 项目中,但对所有感叹号都一无所知。有人可以向我解释如何在 VB.NET 中实现此代码吗?
Dim Er!, Derivative!, Proportional!
Static Olderror!, Cont!, Integral!
Static Limiter_Switch%
Limiter_Switch% = 1
Er = setpoint - process
If ((Cont >= 1 And Er > 0) Or (Cont <= 0 And Er < 0) Or (Integ >= 9999)) Then
Limiter_Switch = 0
Else
Limiter_Switch = 1
End If
Integral = Integral + Gain / Integ * Er * deltaT * Limiter_Switch
Derivative = Gain * deriv * (Er - Olderror) / deltaT
Proportional = Gain * Er
Cont = Proportional + Integral + Derivative
Olderror = Er
If (Cont > 1) Then
Cont = 1
End If
If (Cont < 0) Then
Cont = 0
End If
Return ()