I think I'm missing something on the PID theory.
I have a motor rotating at X rpm, controlled by a pwm output (range 1 - 1000). Let's say it rotates at 20 rpm when pwm is halfway (500).
I need to control the PWM to keep the motor rotating at a set speed.
How should I setup the PID?
Please tell me where I'm wrong (assuming the motor rotates at 18 rpm instead of 20):
error = setpoint - current_value = 20 - 18 = 2
Only by considering the proportinal part, for sake of simplicity, in this case the output should be:
out = Kp * error = Kp * 2
in order to even move the motor, I should use a Kp of about 250... In my understanding the K values should be very little ones..