Thanks Henrik. I have got one more question for you, for now:
Code:
pid_Kp = $0700                     'Set Kp to 7.0
pid_Ki = $0080                     'Set Ki to 0.5
pid_Kd = $0225                     'Set Kd to 2.14
In your code above, you take $0225 to 2.14, $0080 to 0.5, how is that? I do not see calculations for converting numbers to decimal digits, as you are multiplying them as it is to the error variable. Please explain me how this is working and I will also be interested in knowing what is the maximum number I can assign to the gain this way, I will clamp it later as I intend to use pot for setting these. Cheers