11-21-2015 12:37 PM
First, you need to look at your math. I think your gains are actually Kc = 1178.5 * 0.0038 = 4.4783, and Ki = 1178.5, if you copied the numbers correctly from Matlab and the p's are in the right place. The proportional control does not vary with time so it's the value where the p's cancel. Those values seem suspicious to me, though - are you sure you have it right?
Let's say your transfer function is actually 1178.5 (0.0038 + p) / p which would be more common, because then Kc = 1178.5 and Ki = 1178.5 * 0.0038 = 4.4783 (this is equivalent to the LabVIEW normalization of Kc * Ts/Ti, where the factor of 60 is a conversion from seconds to minutes). From a mathematical point of view, you can divide 1178.5 by 16 (this is a simple bit-shift), then multiply the output by 16, and you'll get the same output, except in reality you'll lose precision. Instead you should cast your values to fixed-point, which will have the effect of dividing them, but maintaining precision. If this doesn't make sense, spend some time studying how fixed-point numbers work. The math is not that complicated and the PID computation is fully documented; you can work through it yourself. You can also easily test the LabVIEW outputs against your Matlab model.