control the motor rotation and listen on the ‘stepper motor driver’ interface pins hooked up to the motion controller upstream. The Arduino source for this can be found on the project GitHub.
The testing-contraption to the left is a NEMA 17 stepper motor attached to an encoder ... step/direction interface and even an enable pin, those few additional features actually make it a sweet ...