I think +-1 pulse is a bit optimistic. The PID controller uses the position error to adjust position. The output to the motor is the error multiplied with P. If the error is just 1 then P have to be large to get a current to the motor that will actually move it (and the axis). But then the output will "go through the roof" if the error is larger, and the machine becomes unstable. Think of it as the steering of a gokart having a high P, while a van with too low air pressure in the tires have a low P. So the P should not be too high, or you'll just weave about.
But, then we will have a residual error of some counts that will not be eliminated because the force is not high enough. Enter the I factor. If a small error persists over time I will increase the output to the motor and thus try to get "exactly there". But it will take some time (relatively speaking). So increasing the I factor will improve the final position. Still there must be an error for I to add it up. It's like after rounding a corner with your gocart you will not immediately go in a straight line, but your heading will very soon be fine as you correct it.
The D factor acts as the damper and can be used to bring down the overshoot and hunting back and forth until finding the correct position. It has the same purpose as the dampers on your car. If they are not working, your car will keep on going up and down after hitting a pothole or a bump.
So to make it easy, just set all of them P I and D to a high number?
Sorry, if it was only that easy. That's why you need to tune these numbers on your machine with your motors and your drives. And you'll never get to zero error because the measured error is the basis upon which all this works.
Now you see why some servos have a high number of pulses (or other discrete steps) per revolution (up to 128000). Because then the measured error is quite large even for a small error on the motor (and machine).
So based on this, the error is a result of several factors where the ability to tune in on the best P I and D is important. And the resolution of the encoders is one factor that sets the limit where it can be said no additional tuning will improve it. |