Rick G wrote:Could the same logic be applied to a servo driven spindle?
Not the exact same logic, no. However something very similar could be done with two separate PID controllers, one based on the encoder position output and the other on the velocity output.
You would switch the PWMgen input between the two PID outputs according to the operating mode. You would need to do something with the f-error limits too. (short circuit the feedback loop in the inactive mode, possibly)