Computer Indexing and Wheel Cutting
(using a StepperBee+ )
Submitted by Rex S., Sydney, Australia
Introduction
About four years ago I wrote an article in the Horological Journal
on the use of a computer and a stepper motor to drive an indexing head
for the cutting of clock wheels. This enabled the cutting of any number
of teeth up to 800, including prime numbers, simply by keying in the
desired number and pressing a switch after each tooth was cut – no more
division plates or complex indexing set-ups, which virtually eliminated
human errors. I provided the program free of charge to any interested
clock makers. Since then more than sixty of the devices have been
constructed around the world, and the program has received considerable
acclaim. During these four years, a number of refinements and expansions
have been added and the original program currently stands at Version
3.1.
A major expansion was added a few years back, which used a second
stepper motor to drive the cross slide on the milling machine so that it
would traverse back and forth in step with the indexing head, thus
completely automating the wheel cutting process. This effectively
produced a CNC wheel cutting engine. CNC meaning Computer Numerical
Control. Set it going and have your lunch while a wheel is cut! The
diagram below
shows the general arrangement as adapted for the USB version of the
program.
The left hand side of this diagram represents the
simple indexer, and such a typical arrangement, shown on the right,
is built around a rotary table mounted at 90º. This installation was built
by Mr. Ernest Hills near London. The indexer is activated by clicking a
button on the screen, pressing the space bar on the keyboard or using an
optional remote press-button switch. The right hand side of the diagram
above is
the additional stepper motor for the automatic cross slide control. This
will be discussed later.
Minimum Computer Requirements for the USB Version
The new USB version has been developed to run on a minimal Widows
XP configuration, and will run on Win 2000 Pro, but has not been tested
on any other systems. I expect it will run on later systems, but will
not run on Win 98. Note that this program requires a PC and will not run
on an Apple
Simple Indexer: Interfacing the computer to the Stepper Motor
The original implementation of this project utilized the parallel
printer port for sending the signals from the computer to a special
circuit board, known as a K179, which then controlled the pulses going
to the coils in the stepper motors. And therein lay a looming problem.
While the original design was intended to run on “an old computer” with
a parallel printer port, the parallel port is a dying technology and is
already dead on all laptops. The Universal Serial Bus (USB) has replaced
both the old serial port and the parallel port. So the demand for a USB
driven program has been steadily growing, especially from those who wish
to use a laptop in the workshop to save space. I should also note that
the “USB to parallel” adapters on the market will NOT work with the old
program.
Having sunk literally months of time into developing the original
program years ago, I was very reluctant to take on such a significant
conversion project. The USB technology is totally different to the much
older parallel port. Suffice to say it has now happened, and I am quite
enthusiastic about the outcome. The downside is that the old electronic
circuit board originally specified, is quite incompatible with USB
technology and a new circuit board had to be found. I settled on the
Stepper Bee board from PC Control Ltd. in the UK, which was relatively
easy to weave into my program and it will drive two steppers
independently.
The Stepper Bee Circuit Board
The stepper Bee comes in two flavours – the straight stepper Bee,
capable of running two steppers that draw no more than .5 amps each, and
the Stepper Bee+ which is capable of running two 7 amp steppers. The two
units are program compatible. If you are building the full two stepper
version then you only need one stepper bee+ as it will drive both
steppers . In the original HJ article on Computer Indexing, I went into
considerable detail on stepper motors in general, and where to find low
cost secondhand or free steppers. The ideal is a 5 volt type 23 stepper
(2.3 inches in diameter) with 1.8º steps. This will draw about 1.2 amps,
which is considerably more than .5 amps, so I recommend the Stepper Bee
+, to be clearly on the safe side.
The wiring of this new circuit, shown below, is only slightly different to the original, and much simpler than the twin stepper installation if you built the complete wheel cutting system.
The TL2 side of the stepper bee is used to drive the indexing via stepper motor 1, while the TL1 side drives the cross slide stepper. So if you are only interested in indexing, then the top part of the circuit is all that needs to be built. Note that there is a TS terminal on each side of the circuit board. This is for Transient Suppression and MUST be used if you were using the stepper bee and not the bigger plus version. It suppresses induced voltage spikes. This is one area where the two variants of stepper bee differ. If used, it must be wired to the +5 volts on both sides of the board, but I have not used it on my stepper bee+.
Power Supply and Computer
The electronics on the stepper bee circuit board is actually powered
internally by the 5 volts available through the USB port itself, but the
stepper motors require a much larger independent power supply. My
particular stepper motors are rated at 5.2 volts so I needed a power
supply with a 5 volt, high current capability. I recommend an old PC
power supply for this. These are readily available from old dead desktop
PCs, and they are very good for this task. However some may have a
little quirk, and the fan may not turn on initially. If so, the 5 volt
rail (red) requires a load to make the whole unit switch on. A resistor
must be connected between one of the RED wires and a BLACK wire of any
pair. A small resistor of 57ohm and 1 watt will work with very old units
such as the one I use, but later units require a lower resistance which
may be as low as a 10 ohm 10 watt wire wound resistor. Try a higher
value first, but do calculate the wattage required. This should be
mounted outside the case, but ideally in the air flow of the fan since
it gets quite warm. If the power supply will still not switch on, which
is quite possible, then it may need the POWER ON signal to be activated
to tell it to start. This is easy, just find the only green wire in the
bundle coming out and connect it to any black wire. I hate to connect
any two wires like this in a dead short, so a 220 ohm resistor was used
to make the connection. It then should start when switched on at the
power point.
Warning: Never SWITCH ON these power suppliers with the COVER REMOVED!
There are highly lethal voltages inside, much higher than mains voltage!
Better not to remove the cover at all. Any redundant leads can be wound
up and tucked out of the way, or cut off and sealed with heat shrink
tubing. I housed the whole works inside an old slim line desktop
computer case mounted on a plywood plate.
Fit a USB cable from any USB port on your computer to the unit and plug it straight into the stepper bee. You will need a cable of about 2 meters with a male type A plug at one end and a male type B plug at the other. If you are planning to use other than Win XP, then I suggest you download the program and test it on your system before you sink too much time and cost into the project.
Connecting the Stepper Motor
A typical type 23 unipolar motor is shown on the right. It has a
frightening array of six short wires, but inside these are connected to
four coils, so they are often referred to as four phase steppers. The
six wires are connected according to the diagram below. You will need to connect
extensions to these wires to reach from your machine table to the box of
electronics. Electronic “shrink” tubing is ideal for insulating
connected wires when joining up circuits such as this. Always solder the
joints.
Make a drawing and carefully keep track of wire colours. In operation,
each coil is pulsed in sequence to make the spindle rotate, and it is
the stepper bee circuit board that sorts all this out. The program
simply tells the stepper bee to rotate the motor so many steps in a
given direction with an interval between steps of so many milliseconds.
But which wire is which? Here a multimeter is useful. Draw up a table
with the six wires listed, then measure the resistance between every
pair and write it down. You will find that some pairs measure say 4 ohm,
others are double that, and some are open circuit. So then you can
quickly deduce the wires that go to the ends of the coils, and the wires
which connect to the junctions of two coils. If you reverse the A and /A
connections in the diagram, the motor will simply run in the reverse
direction.
Press Button Switch
This external switch is used to activate the indexer remotely so that
the computer may be placed at some distance from the machine tool. It
should be a “normally off” momentary contact switch which clearly
toggles from on to off when pressed and released. I used a micro switch
which has a very definite On then Off. It is wired from the +5v supply
to the switch then back to pin 1 on the Digital Input pins. Pin 2 is
wired to one of the Gnd connectors. It is also necessary that Pin 1 is
always definitely turned Off except when the switch is pressed. Pulled
Low as they say in electronics jargon, so insert a 2200 Ω resistor
across the plug (2K2 Ω) from pin 1 to pin 2. This will force the Input
Pin 1 to be Off except when the switch is closed. It is also wise to
force all the other input pins to Off by connecting them to Gnd by
fitting jumpers between the pins. You will need a tiny plug as used in
many internal electronic circuit connections to plug into the stepper
bee input pins.
In the photo above, the tiny plug has the red wire (5v) and brown wire (Gnd) going to it with the blue 2K2 resistor connected between them. If you are using 12 volt steppers, then take a 5 volt lead from the power supply unit which is red, and a black for the Gnd for the switch. Do not feed 12 volts into the Input pin. If you are knowledgeable in electronics, then you might use a zener diode to limit 12 volts back to 5 volts. The extra coloured wires above are the remnants of the old parallel port implementation since I can run either design.
Testing your Initial Circuit
Once you have connected the USB cable to the stepper bee and have your
stepper motor all connected up, you are ready for a test run. Test the
circuit with the AutoStep program which is provided on the CD that came
with the stepper bee. Note that the TL2 set of connections on the
stepper bee board drive stepper motor 1, which drives the indexing
stepper. If the motor rotates as expected, good, but if the motor just
buzzes there is a wiring problem. If so, do not be alarmed, switch off
and carefully check the wiring connections. With six wires from the
typical unipolar stepper motor it is easy to make a mistake. I chose the
“Full Step” mode for maximum torque.
Computer Indexing Program
When you first run the program, it will start with an initialization
panel where you enter data about your indexing unit. Click Add New
Indexing Configuration, and enter data into the four green boxes,
pressing Enter between each value. This includes a name, the worm
reduction ratio of your dividing head or rotary table, and the toothed
belt ratio if you are using this form of drive between the stepper and
the dividing head. If you have a direct drive between the stepper motor
and the worm, then just enter a 1 for the belt ratio. Key in the values,
one by one, and press Enter after each. If you are only doing simple
indexing, then enter a 0 for the question on cross slide lead screw
pitch.
The 0 indicates that you do not have a cross slide
drive. Then click OK to save the data for that device. If the data
contains any errors, such as an alphabetic character when a numeric is
expected, you will be alerted. A second device may be added by clicking
Add New again. You can then enter multiple indexing devices, but
initially you will probably only have one. Then you click Finish, and
this data is saved on disk for next time, so you only need to enter it
once. The program has an extensive Help file, so you should click Help,
and read it right through. If you used fictitious test data initially
for dry running, and want to start again, then you can start with a
clean slate by deleting two files from your C:\CNC folder. The data
about your indexers is held in an array file called
C:\CNC\CNCSpeedArray.txt and the current indexer in use is held in a
file called C:\CNC\CNCSpeedB.txt. Deleting both of these files from your
computer will cause the program to start again from scratch next time it
is run, but all memory of previously entered definitions will be lost.
When running the program with your stepper connected, the stepper speed
is controlled by a slider, so you should experiment to find a good fast
“sweet speed”. If you try for too fast, the stepper may not be able to
keep up with the pulse rate and it will make a growling sound so back
off a notch or two. Better to err slightly on a slower speed. When you
click Exit this speed is saved for next time. My current setting shows 2
in the box labeled ms/pulse. This is about 150 RPM stepper speed.
Cutting your First Wheel
At this stage you are ready to do a trial cut. You will notice in screen
image below, that the wheel blank and tooth depth are shown
These are based on the Thornton data sheets. The technique is to cut a tooth gash, then use the Single button to index to the next position, cut another gash and examine the tooth crest, increasing the depth of successive cuts until a sharp crest is reached. Mark that tooth with a spirit pen. Then, by using the external press button switch, the Enter key or Space Bar, proceed to cut a full circle of teeth until you reach the marked tooth. If the dividing head is rotating in the wrong direction to get a good view of the work, there is a direction button to set the direction of rotation, but set this during preliminary experiments. The setting is remembered for next time. If you are concerned about backlash, put a cord around the dividing spindle with a weight to take up the backlash. Ensure that the weight is wound up. As always make sure the cutter is set to exactly centre height.
If you only wish to build the simple indexer, the circuit testing is now complete. Fit the stepper bee circuit card and the power supply etc into a suitable box, and if you intend to use different indexing devices, then wire in a connecting plug so that the different indexers may be easily plugged and unplugged. I suggest you fit a fuse and a power-on light to this box. Do not leave the unit switched on when not in use since the stepper coils may be energized to lock it in the stopped position, and they will be unnecessarily heated. When the program is closed with the Exit button, internal power is turned off. Please note that you are able to use both the old program and the new USB version. They are not mutually exclusive.
Building the Full CNC Wheel Cutting System
The first part of this article focused on using the computer, a USB
port, a stepper motor and a dividing head to provide unlimited indexing
capability activated by a press button switch. Now we will look at
expanding the system to drive the cross slide back and forth in
synchronization with the indexing head to provide a fully automated CNC
wheel cutting engine. The program already has this expanded
functionality built in so you will not need a further download. However
the program may still be used for simple indexing with the press button
switch. It is just one program which is capable of performing all
functions.
To build this expanded project you will require a
second stepper motor to drive the lead screw of the cross slide via a
toothed belt reduction. The stepper should be of a similar type to that
specified for the indexing head, namely a type 23 unipolar of about 5
volts with 1.8˚ per step. The program provides the following functions:
§ Enter the details of the dividing head and lead screw pitch – only
done once.
§ Four modes of operation as mentioned earlier.
§ An on screen button for Single cycling to establish the correct tooth
depth.
§ An on screen button to Auto cut the full number of teeth in automatic
mode.
§ Two additional speed sliders to adjust the forward cutting speed and
the return travel speed.
§ Support for the press button switch as in the original program if not
doing automatic cutting.
Depending upon your machine configuration, the attachment of the stepper
to the lead screw will take different forms. If you have a small
vertical mill, then the cross slide table may be driven by toothed belt
reduction. Another option is to have a supplementary cross slide mounted
on the table of a larger milling machine. The dividing head is then
attached to this slide.
Yet another approach is to make a dedicated Wheel Cutting Engine from
spare machine parts as shown on the right. This unit was
constructed by Mr. Bob Bosman, a member of the Sydney Clockmakers
Society. It utilizes a spare Hercus lathe cross slide (similar to a
South Bend). A vertical slide with a self contained milling spindle is
mounted on it, and the 60:1 stepper driven indexing head, mounted on a
bridge structure. The stepper drive to the lead screw is clearly shown.
The vertical slide provides for depth of cut, but the centering of the
cutter on the wheel centre line is dependent on the mounting of the
milling spindle and the cutter holder. Another important consideration is the value of the
reduction ratio for the toothed belt drive to the lead screw. This will
influence the cutting feed rate depending on the stepper speed and the
pitch of the lead screw used. In the example shown on the right, the lead
screw pitch was 0.1” and the belt reduction chosen by the constructor
was 5:1. With a maximum stepper speed of about 150 RPM, this gave return
speeds which were rather too slow. A 3:1 reduction ratio may have been a
better choice, but slide stiffness and torque are a consideration. Some
experimentation is required with a hand turned feed rate and a stop
watch, or if you are good at counting seconds, this will probably
suffice. From this an appropriate toothed belt reduction can be chosen.
In true CNC systems, feed rate is usually expressed in mm/min, but in
our case two additional speed sliders are provided, one for forward
cutting speed and the other for return speed. Once set, these speed
settings are remembered for next time and there may be no need to change
them. If you want to cut pinions in steel at a slower feed rate, then
the Multi-Indexer capability now incorporated in the program may be
used. This would enable you to define two virtual wheel cutting engines
with different feed rates, one for steel and one for brass. Remember to
always use “up milling” and not “climb milling” on steel.
Wiring the Combined Unit
The wiring diagram was shown earlier and uses the
other half of the Stepper Bee+ to drive the lead-screw stepper. The
program sorts out which commands to send to each stepper motor. The USB
connection handles the signals for both steppers.
The Stepper Bee+ board itself does not produce much heat. The original five amp fuse should be replaced with an eight amp fuse to cope with the extra load. Remember, even if a stepper is stationary, the coils are energized to lock it, so both steppers are effectively drawing current at the same time. That is why the unit should be turned off when not in use. However the stepper motors are turned off at the end of cutting a wheel when you Exit the program.
Testing the Circuit
As with the original Indexing drive, use the AutoStep test program
to test run the cross slide stepper. It is motor No. 2 in our
configuration. But run it only in short bursts or you will exceed the
travel on the slide! You can use the Direction button to reverse the
direction since I have not specified safety limit switches in the
circuit, so be careful. In normal use the travel distance to perform a
tooth cut, say 15 mm, will be quite short in relation to a typical
travel of the slide, and since the program generates just the right
number of steps there should not be a problem with travel. But do
arrange for your cutting to be performed in the centre of your available
travel.
Using the program
If you started with simple indexing and no cross slide drive, then you
will need to define another indexing device, so click the yellow button
“Change Indexer”. This will enable you to add a new configuration. Here
you will also include a value for the cross slide lead screw which is
the pitch for one turn of the stepper motor, such as .667 for a lead
screw with a 2 mm pitch driven by a 3:1 reduction toothed belt. The
equation is Pitch = LS pitch / toothed belt reduction. As before, this
is only entered once, since the data is stored in a file for future use.
A maximum of six different indexing devices may be included.
When cutting teeth, enter a slide travel distance that is long enough to cut the tooth and return with safe clearance for the indexing, say 12mm plus double blank thickness, but not too long as it wastes time. Position the slide at the start point just clear of the wheel. The indexing is not started until the slide is fully returned to the start point. The purist will say that the cutter should be withdrawn from the tooth when returning, but this adds considerable complexity and no harm seems to be done by bringing the cutter back at full depth through the gap where it takes a very slight climb milling cut.
Pinion Cutting
While the original program was designed for clock wheels, a pinion
option has been added for clock pinions. Multiple passes may be used
until full depth is reached. However you should set the feed rate to a
much slower value than for cutting brass. A neat solution is to define
two or more “virtual” CNC Wheel Cutters called say Brass Wheel and Steel
Pinion, and use the multiple indexing list to call the appropriate
configuration.
More on Stepper Motor Speed
Speed sliders have been used in the program to control motor speed.
In actual fact the subroutine which activates the stepper motors
requires that the interval between steps be given in milliseconds as an
integer number. So when you move the speed sliders they are effectively
"notched" in millisecond intervals. The sequence is reversed such that
for a faster speed, a shorter interval is calculated. You are therefore
constrained to certain speeds, but the notches are sufficiently close
that a suitable speed can be found. When the settings are saved on disk
in the CNCSpeedB.txt file, the first parameter is the interval in
milliseconds that has been read from the speed slider for the Indexer
stepper. In my settings, this turns out to be 2 for a 2 millisecond
interval between steps, which is roughly equivalent to 150 RPM. So if I
try for a higher speed, which would be a 1 ms interval, I am really
asking the stepper to run twice as fast, so no wonder it growls. I
should add here, that the stepper bee technology has no facility to
control the acceleration of the stepper motor. It must jump to full
speed in one step. However for our application here, this is not a real
disadvantage as long as you set it for a "smooth running speed". I have
added boxes showing the milliseconds per step. I suggest you use either
3 or perhaps 2 as the fastest speed.
Forcing Resistors
In the circuit presented here, the steppers are driven from the 5
volt rail of the PC power supply unit. In the original circuit back in
2007, I used 12 volts on the same stepper motors but with hefty “forcing
resistors” of 5.6 ohm and 10 watts in series with each of the pairs of
coils of each motor. This gave a larger initial current surge and
therefore more torque. But I now think that most users will find that
torque is quite adequate on the straight 5 volts, but keep this in mind
if you need an increase in torque.
Conclusion
The CNC Wheel Cutter add-on to the original Indexer will give you your
first contact with fully automatic CNC machining. It is fun to build and
see it working, and makes a great demonstration of computer control, and
it takes full advantage of the stepper bee+. It is quite novel to cut
another wheel while you are having lunch! It may also whet your appetite
to get into full scale CNC, but that is another story altogether which
has been addressed before in other popular magazines for workshop
enthusiasts such as the Model Engineers Workshop. It is also extensively
covered on the Internet. Developing a program such as this for a wide
spectrum of users, with different levels of skills creates it own set of
difficulties. I am indebted to Derek Lynas for his substantial
assistance in field testing the program through a considerable number of
iterations to make the program as user friendly as possible, as well as
identifying the inevitable programming problems.
My final arrangement is shown in
above. The circuitry and power
supply are housed in an old desk top computer case, with my old lap top
computer sitting comfortably on the top.
If you have a rotary table, it may occur to you that we can now cut very
clean arcs and very straight lines if the rotary table is used on the
flat and a small cutter running at high speed as a router. So this
arrangement could be the basis for crossing out – the bane of the
clockmakers existence. It would not be a fully automatic system since we
have no way of lifting and lowering the cutter, or moving to the other
side of the spoke. But I think it could be done with only two cutter
withdrawals per spoke and one slide movement per wheel to go to the
other side of the spoke. The rest being performed by a suitable program
that also informs the operator when to execute these manoeuvres. But
that too is another story! Any experienced programmers out there who
would like to try their hand?
PC Control Ltd: All articles are publish as submitted in good faith but we do not accept any responsibility for the authenticity or content of these articles. Any article breaching copyright will be removed from this website as soon as we are made aware.
Featured
Items