Problem understanding FPGA PID VI
The integral and derivative actions of PID do not seem to track equations shown in documentation.
Derivative â€“ PV set using triangle wave 0 â€“ 10 â€“ 0 at approx. 1 Hz the derivative of PV should alternate between +20 v/s and -20 v/s. The PID output maxes out at +/- 1 when Kd is set to 128. (Kp = Ki = 0.) Based on documentation the PID output should be +/- 20 when Kd = 1, and then 20*128 = 2560 when Kd = 128. Not sure why the effective gain is so small.
Integral â€“ The error is set by setting SP = constant = 10, and varying PV using triangle signal noted above. The error is then a triangle that varies from +10 to 0, again over Â½ second. The integral, therefore, should be varying from +2.50 to -2.50 over the complete cycle.
Issue 1: The integral effect on PID output does not change sign when error integral goes negative. It appears that there is some absolute value function that only allows positive integral action regardless of error integration. Likewise, if Ki is set to negative number the integral PID action only goes in negative direction. This implies that as the PV crosses over the SP level the integral action will keep adding to PID output that will then drive PV further past SP.
Issue 2: Unlike the derivative effective small gain, the effective integral gain is very large. With the Ki set to the smallest number available using FP 16.8, (approx. .0039). the PID output varies from 0 â€“ 12.5 with the actual integral varying from -2.5 to +2.5. Not sure why the effective gain is so large.