Lathe / OpenDRO : Know where to go
Introduction - The problem so far
The carriage handle on my lathe does not have a graduated dial, and with the amount of backlash between the handle and the rack, I would not be able to trust it anyway. Some closed loop measuring would be nice!
A solution
HAFCO sell some inexpensive but good quality glass scales. A glass scale is a piece of glass mounted in a case and is etched at regular but tiny intervals. A reader carriage rides along the scales and detects the etch marks and sends signals to a reader which says how far the carriage has moved.
I don’t like the feel of the membrane buttons, and they generally turn quite ratty after grease / oil covered fingers have pushed them a few times. Then cleaning solvents remove the front membrane layer, and the whole thing goes downhill from there. I had been recommended TouchDRO, but I don’t like touchscreens with dirty fingers either. I know a bit about programming and I know a bit about electronics, and quadrature signalling is not rocket science.
OpenDRO
I started writing OpenDRO, targetting the
Arduino Uno to get me 3 or 4 axes. Using the standard CNC axis terminology, the
carriage feed will be the Z
axis (as it moves to/from the spindle), and
employing the standard “left hand rule”, X
is the cross slide feed. A
tachometer would be trivial to add, and I figure I have some spare scales that
could be connected to the tailstock that were originally going to be for the
quill of the milling machine, so I can have a W
axis (W
is akin to the
knee, it’s an extension of the Z
axis).
As there is a potential for many pulses to come in per second, particularly
with a tachometer / rotary encoder on the spindle, and also the scales firing
once per 2.5 um
, some fast algorithms are needed. Typical quadrature
libraries are pretty slow and rely on polling in loop()
to read values and
update a counter, usually in some bloated OO way because that’s how Arduino
libraries tend to go these days. I remembered that a friend from my ham radio
days, Ben Buxton, had done a talk at our club about
how to do rotary encoders properly,
and left a write up online along with some reference code which I adapted a
little for linear encoders, and IIRC, I added an index line which is used by
some DROs for resetting the count in case a step is missed.
The Build
Attach the scales to a test board, add two buttons, units (for toggling metric
and inferial) and a zero button so that I can set an arbitrary datum, and the
circuit was ready for testing. A little bit of wiring problems, and inverting
the direction, and I had a single axis DRO ready, which read to 2.5um
about
as reliably as I can discern with my gauge blocks.
TODO
list
I will add photos soon.