Quote Originally Posted by Voicecoil View Post
I would guess that the loop moves the motor to within at the minimum +/-1 increment of the encoder resolution (e.g. on the usual closed loop steppers +/-1/1000 revolution). There will have to be a bit of hysteresis (i.e. a window of accuracy) otherwise if you tried to take it to a certain position it would tend to hunt back and forth 1 encoder step.
It's a fair bit more complicated than just that and can't really compare Closed-loop stepper system to real Servo drives as they simple in comparison.

Like Moray says Full closed-loop servo system is a lot of black magic and I while I personally understand PID and what all it's terms mean and handle in the system. I tried to keep my explanation simple and kept it mostly just to position but the reality is that it's a bit more complicated than just position when getting a Servo driven machine running nice.
So when I said don't understand how Step n Dir Closed-loop is done what I probably should have said was don't understand how the PID for Step n Dir output is handled by the Controller.

Regards the hunting back n forth then that's exactly what does happen. The Closed-loop system is constantly making corrections to maintain position, Torque or speed and this is where the black magic and mathematics come into play. It's also why setting a Servo machine up to be accurate with smooth movement, fast accelerations and directional changes with quick settle times can be a challenge. Because changing any one of the PID settings in either drive or controller can affect the others and how the system works. Real hair pulling stuff.!!

That said Modern Servo drives are getting much better and come with built-in tuning aids to help tune motor to drive. The Old AC and DC Amplifiers like what's on some of my machines are what real nightmares are made from. They are also very unforgiving and blow up for Fun which is an area where modern servo drives are much much more forgiving.