Just a note:
The equations given in text state the following:
POUT = KP * KERR
But your code shows the proper integer based math method of performing this expression.
POUT = KERR * KP
It's quite clear why the variables need to assume this order, but I did not find it documented that there IS a difference between the "text book" equation and your example.. (it is more accurate to "round" later in the equation, after your numbers have built up.)
Either way, great paper! I plan to include this in my "required reading" for new programmers on my team.
