A project has:
A stepper motor with 200 steps per revolution.
A Gecko 203V Drive, that microsteps at a resolution of 10.
This drive has an adjustable current limit, which acts as an electronic shear pin.
If the torque required to move the load is more than the drive is adjusted to provide, the drive will stall until the load is lowered.
A quadrature encoder with 1024 pulses per revolution.
The motor, encoder, and drive are existing, and can not be modified or changed.
To make one complete revolution of the motor shaft and encoder, the drive must receive 2,000 pulses.
Each step pulse moves the motor shaft .18 degrees.
Each encoder pulse detects .3515625 degrees of shaft movement.
I am able to issue a step command, and check encoder position for a Clockwise Move, No Move, or Counter Clockwise Move well before the time required to issue the next step command.
A step pulse is issued every .0002 seconds. (5,000 steps per second)
Solving for an encoder position change requires 45 clock cycles at 80_000_000 clock speed
or .000000563 seconds to solve.
This relationship allows plenty of thinking time between issuing a pulse, and detecting that it was not consummated.
Since there is not an exact 1 to 1, 1 to 2, or 1 to 3 relationship between the two movements, how do I detect a situation where a step pulse was issued, and the motor failed to move?
A second requirement is that a missed step is corrected, so at the end of the move, the shaft ends up in the correct position.