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.
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