If the error term in the PID calculation is negative, I believe the PID calculation falls apart. For example, if iLimit is 1.0 and iSource is 1.1, it calculates grossSetPoint = 0, fineSetPoint = 65533. Since for iSource = 0.9 you get grossSetPoint = 1 and fineSetPoint = 2, and for 0 error you get 0, there is clearly something wrong (the PID output should be a continuous function of the input). Looking at the code, it is clear there was no thought given to handling negative PID output. While it is possible the load may appear to operate correctly, I strongly suspect it is subject to overshoot and instability.
If the error term in the PID calculation is negative, I believe the PID calculation falls apart. For example, if iLimit is 1.0 and iSource is 1.1, it calculates grossSetPoint = 0, fineSetPoint = 65533. Since for iSource = 0.9 you get grossSetPoint = 1 and fineSetPoint = 2, and for 0 error you get 0, there is clearly something wrong (the PID output should be a continuous function of the input). Looking at the code, it is clear there was no thought given to handling negative PID output. While it is possible the load may appear to operate correctly, I strongly suspect it is subject to overshoot and instability.