And therein lies the Devil!
There are two typical ways to cope with this dilemma.
To make the error as small as possible you would want to increase the number of stepper pulses per blank revolution. This either by increasing the gear ratios considerably, or by increasing the stepper controller microstepping count. The latter with the disadvantage that the stepper torque diminishes considerably when microstepping. Already at 1600 microsteps the torque is well down from full step mode, so lost steps become an issue.
Increasing the gear ratios is better, as torque is multiplied, so maybe a balance between increased microstep count and greater gear ratios.
I understand from your setup you are not doing continuous rotation hobbing, ie, the blank just indexes from position to position and halts each time, so stepper max RPM is not an issue.
However, with microstepping, and esp when increasing the microstep count, you may need to apply an acceleration profile to the command index so as to not loose steps due to poor motor torque.
The 'normal' or better approach to the integer issue is to 'spread' or interpolate the error evenly over the full index profile – crudely put, for your example above:
For 127 teeth, cut 2 teeth at 1512 pulses, then 1 tooth at 1510 pulses, and repeat – this gives 84 teeth @ 1512 pulses interspersed with 42 teeth at 1510 pulses, with a last tooth cut at 1512 pulses. The error per tooth will then be between 0.8 and 1.2 stepper pulses, spread over a 1:2 ratio.
Again, this is a crude representation of a typical DDA algorithm – Google the DDA and you should get a good understanding of its application.
In essence – View the stepper motor individual steps as a staircase, starting graphically at x=0, y=0.
The X axis represents 0 to 192,000 steps ( the steps required for a full blank revolution).
The Y axis represents actual steps given to the stepper, ie, an increment in Y is a step pulse, no increment, the stepper stays where it was. The DDA generates outputs which then give the step or no-step command.
If you zoom in on the slope of the line in this mental graph, you will see steps, like a staircase – however, you will see anomalies in the step shape – some risers will be more than one step tall, and some treads will be more than one tread long. This pattern repeats at regular intervals, spread evenly over the full 192,000 steps.
You may need to massage it a little for your specifics, but it works well. Basically it is simple linear interpolation, and is used in many applications, a useful one being an Electronic Leadscrew for lathes. It is also used in the CNC world – to move the tool to a specific place at constant velocity in both x and y axes – but I digress..
If you hack it, spread the error over the full blank, not over a few teeth at one end – else the gear will impose the same error on the driven leadscrew on your lathe, and on any thread you cut with it – a cyclic wobble..
So, if the need is to cut a small handful of gears, hack it, but if the need is one of challenge , DDA it!
Joe
Edited By Joseph Noci 1 on 26/10/2018 08:39:05