[LinuxCNC/linuxcnc PR#467] pid: use command-deriv when supplied

未分类 bolang 5个月前 (10-15) 27次浏览

Issue #467 | 状态: 已关闭 | 作者: jepler | 创建时间: 2018-07-19


Due to an oversight, the command-deriv value was only being used when computing the contribution of Dgain, and not to FF1. This corrects the problem. Before this change, with IPD FF0 FF2 gains all 0 and FF1=1, pid.0.output was a (co)sine wave rather than a triangle, when its command was driven from a sine and its command-deriv from a triangle.

!image

My halrun -I testing script:

loadrt threads
loadrt pid num_chan=2 debug=1
loadrt siggen
addf siggen.0.update thread1
addf pid.0.do-pid-calcs thread1
addf pid.1.do-pid-calcs thread1
net cmd siggen.0.sine pid.0.command pid.1.command
net cmdderiv siggen.0.triangle pid.0.command-deriv
setp pid.0.FF1 1
setp pid.1.FF1 1
setp pid.0.Pgain 0
setp pid.1.Pgain 0
setp pid.0.enable true
setp pid.1.enable true
start
#loadusr halscope

Closes: #466

原始Issue: https://github.com/LinuxCNC/linuxcnc/pull/467

喜欢 (0)