I'm building something with an engine that uses gears to reduce/increse movement. The motor has itself some gears, and it's a stepper motor (it gives discrete steps), now the number of steps per revolution is not integer: $4075.77284...$, and I need to add gears to make it as close as possible to 720 steps, that is: each step must be as close as possible to $0.5º$.
So, this is the purely mathematical problem, the number of steps is given by:
$$n=64\frac{22\cdot 26\cdot 31\cdot 32}{9\cdot 9\cdot 10\cdot11}$$.
I'm going to use two wheels in series, so the problem is finding four integer numbers: $a,b,c,d$, such that:
$$n\frac{ab}{cd}\approx 720$$
Also, those four integers must be in the interval $(8,40)$.
The only thing I could think off was just trying, and found, by fixating $c=d=20$ and then setting $a=8,b=9$, that: $$n\frac{ab}{cd}=733.63911111111110585625$$
This gives a rotation of $0.4907044820099255577617$ degrees per step, with an error with respect to $0.5$ of $0.00929552$. That error is the important thing, and being around a hundredth of a degree per step, it's good enough for me, but I would like to know if there exists any analitical methods to get better solutions. Sadly, I don't have enough knowledge about diophantic equations to be able to do this on my own.
As a last resource, I would program something to test all possible combinations of $a,b,c,d$ in that interval, which is probably what I'm going to do, but if there's a more elegant solution, I'd love to know it.
Thanks anyone.
UPDATE: Ok, I programmed it, and found out that the best solution is: $a=8,b=31,c=36,d=39$, with an error of $0.0000436963449531591053$. Not a nice solution, I expected smaller numbers, but... good enough. Still, and analytical more general solution would be appreciated.