The output of my stepper motor feeds into a gearbox which I’ve been told has a ratio of approximatly 64:1. During the research of this project I came across a discussion about why the gear ratios were not exact nice even values. The reason for this is so that you don’t get wear on one spot of the gear wheel so you might get a 23 tooth wheel paired with a 24 tooth wheel. Or a multi-stage gearbox ratio that turns out as something like 63.5:1. I’ll use the opto sensor to check the ratio of the gearbox and the steps per revolution.
Because the output of my stepper is driven by a gearbox it is not possible to know where the hands are pointing for a known input signal. For this reason I decided to implement a homing sensor. The idea is that after the system boots, the motors turn a plastic disk until the a stripe on the disk breaks the light beam. Once you know where the motors are you can count steps to keep track of the motor position. Roy Fisher from Proto-Pic recently did the same for his railway turntable project.
I found an example for wiring an opto sensor needing just a couple of resistors and sourced a slotted opto sensor from CPC. I tested the opto sensor using the wikispaces example code and it work as expected.
To attach the disks to the gears I made a small bush from some aluminium, it just so happens that this was cast in a flowerpot furnace back in 2009. The hole in the middle needed to be 6.4mm to match the outer diameter of the gear hubs. I did not have a drill that size so I centre drilled, drilled 5mm and then drilled 6mm, finally I used a very small tool to bore the inside to size. The bush was turned down to 8mm and a matching 8mm hole was drilled in the plastic sheet (pringles tops, eaten over Christmas). Finally the overall diameter was approx 15mm left from origional stock size.
I also tried out a parting off tool that I’d bought at a model engineering fair back in 2011 and that worked well. I made sure that the stick out of the blade was small and that I supported the workpiece with a centre.
I test fitted the gears and disks.
Finally, using the AccelStepper library I wrote a simple test to “home” the stepper motor on a stripe on the disk. I did find that this library like the Arduino library has swapped wiring e.g. 1,3,2,4 and the symptoms of this is that the motor initially only ran in one direction. Code for the homing tests can be found on github. https://github.com/Workshopshed/StepperMotors
The next thing to do is to use the opto sensor to check how many steps this motor has and see if I can determine the gear ratios.