发表于:2005-05-10 16:25:00
楼主
大家好,我现在做了一个pid控件的框架,接口已经弄好,算法还未加进去,我想请求大家帮忙给我加进去,并且能用,导入intouch里后能够把接口都与外部联系起来(通过编脚本文件),谢谢大家了!
我想用pid增量算法:vb里--
Dim KP As Single
Dim KI As Single
Dim KD As Single
Dim k As Single
Dim E_k As Single
Dim E_k_Sub_1 As Single
Dim E_k_Sub_2 As Single
Dim Deltau As Single
Dim out As Long
Deltau = KP * (E_k - E_k_Sub_1) + KI * E_k + KD * (E_k - 2 * E_k_Sub_1 + E_k_Sub_2)
out = Deltau
这样好像不对,希望大家能帮我改改!谢谢!