Robert R. Fenichel

Lathe timing light

   Whenever a lathe workpiece is not circularly symmetric, progress can be visually assessed only when the lathe is stopped.  An industrial strobe light might be used to provide a frozen view, but these instruments are a bit pricey, and they would require continual adjustment to match the varying speed of the lathe.

 my first approach

  The SC4 lathe is already monitoring its own revolutions — if it were not, it couldn't maintain its tachometer readings.  Somewhere there had to be an encoder providing one pulse (or a small constant number of pulses) per revolution.  I found these pulses, and I designed and implemented electronics to interpret them, providing a once-per-revolution light to function like the timing lights used by automobile mechanics.  As it turns out (spoiler alert), the quality of the lathe's signals is not good, and my current approach to the timing light (see below) is entirely independent of the lathe's electronics.  Also, those electronics are not tolerant of misconnection; I was lucky, but a friend managed to wreak destruction in the course of installing a copy of the circuit first described here.  

   When the back panel of the lathe is opened, one sees a daughter board whose center is an 8 MHz Atmel Mega8.  Nearby, the ground and +5 V supplies of the lathe are easily accessible.  The Mega8 is probably responsible for preparing the segments of the LCD tachometer display, but I couldn't find anything resembling an encoder stream entering the Mega8.  Upstream, there is a nice square wave, with a frequency of 7 pulses per revolution, across the pins identified as Y and K in this image:

ZGF_20.jpg (97975 bytes)

daughter board, oriented as it is in the lathe

   Probably the encoder signal is inductively generated, and in any event neither Y nor K has any relation to the power-supply voltages of the lathe's electronics.  The Y-K square wave is a fragile, high-impedance signal, and it must be handled gently.  The first portion of my circuitry is standard instrumentation-amplifier stuff (see the first sheet of the schematic).   In this captured screen (taken, like those below, with the lathe turning at about 100 RPM),

the two traces look similar, but the upper one is the raw Y-K encoder signal (between points A and B on the schematic), while the lower one is the more robust signal at point C, taken with respect to my circuit's ground.  The waveform here is still a bit noisy, and it benefits from passage through a Schmitt trigger to provide the “normalized pulse” at D, shown here:

   The pulses shown in this tracing come at 360°/7 (~ 51°) intervals during each revolution.  To capture just one of these seven views of the rotating workpiece, the normalized pulse clocks a counter that rolls over after every seventh pulse.  One of the seven outputs of the counter (the "chosen pulse" at E) is then selected by a manual SP7T switch.  In this captured screen,

the upper trace shows the pulse train at D, with the trace triggered by the rise of the pulse passed when the counter is 0.  The lower trace is the chosen pulse (E), with the SP7T switch set so that the chosen pulse is pulse #2 of each heptad.

   The duration of the chosen pulse is a function of the revolution time of the lathe.  The LED flash duration should be synchronized with the chosen pulse, but of independently-set duration.  In this captured screen,

the upper trace shows the chosen pulse E.  The lower trace is taken at F, after a differentiator circuit has turned the chosen pulse into a short negative pulse (the "differentiated pulse").  Then the circuit uses a 555 one-shot to generate the adjustable- width flash-control pulse (G).   A chosen pulse and the corresponding flash-control pulse are shown in the next captured screen.

   Flashes of sufficient brightness and brevity place heavy demands on the power and regulation of their power supply.  The SC4's +5V power supply can accept some extra load with no appreciable reduction in output [I have not tested mine extensively, but an added load of 232 mA caused its output voltage to drop only from 5.04 V to 4.96 V], but its regulation is not adequate to accept abrupt loading with the current drain imposed by ultra-bright LEDs.  Sparing the SC4 supply, the flash-control pulse switches externally-supplied power to the array of LEDs.

   On a printed-circuit board from OSH Park, my circuit looked like this [You might wonder why the LM324 chip is socketed.  The first LM324 I soldered into the board turned out to be defective, and I worried that I might have purchased a bad batch of them]:

Once the board was assembled, it took little time to attach the connecting wires to the lathe

attach the PCB and the rotary switch to the lathe panel, and finally connect the whole thing together

     ZGG_07.jpg (291911 bytes) 

   For the time being, I have attached the LED cluster (in the schematics, called the “handpiece”) to a spare magnetic base

   The (poorly-made) video shows the light in action.  The lathe is running at 1260 RPM, and from 0:03 through 0:12 we see a grossly asymmetric piece of scrap in the chuck, appearing to rotate once every 3 or 4 seconds.  After a blank section, from 0:23 to 0:32 the timing light is not used, and the details of the spinning workpiece can no longer be seen.  At the very end of the video, the lathe is stopped, and the odd-shaped workpiece can be examined as the chuck is rotated by hand.

   Why is the strobe effect imperfect?  That is, why do workpieces seen in the strobe's light appear to be rotating at all?  The apparent rotation is seen at every spindle speed from 100 RPM to 2000 RPM, and in both forward and reverse.  At every setting, the apparent rotation speed is about 1/75 of the speed indicated on the lathe’s tachometer.

   To explore this, I determined the true rotation speed of the lathe, using a photointerruptor and a slotted disc (made from an old mini-CD) mounted on an improvised mandrel.

ZGF_19.jpg (103604 bytes)

   This investigation showed that the lathe's true rotation speed varies substantially from the speed indicated on its tachometer, even at high spindle speeds where one might have expected angular momentum to have a stabilizing effect.  During a few minutes of observation, I got these results:

RPM per tachometer

100 300 900 1800
expected revolutions/s 1.67 5.00 15.00 30.00
a = observed revolutions/s 1.74-1.76 4.94-5.12 14.56-15.24 29.96-30.08
expected Y-K frequency (Hz) 11.67 35.00 105.00 210.00
b = observed Y-K frequency (Hz) 11.11-12.9 35.09-35.71 102.6-106.7 205.1-210.5
(7 × a)  ÷  b (should be 1.000) 0.983-1.036 1.000-1.026 0.982-1.007 1.007-1.011

   My current belief is that the lathe's pulse-generating mechanism was implemented to be only as good as it needs to be to produce the smoothed results shown on the tachometer.  Mechanical jitter (demonstrated with the photointerruptor) then leads to some extra pulses, but more dropped ones, and the overall result is the imperfect strobe function documented above.

my current approach

   The photointerruptor results were so attractive that they suggested a radically different approach to this project.  Inside the headstock of the lathe, the 32-tooth Spindle Gear (Sieg part #174) rotates on the spindle.  Mounted on a simple fixture, a photointerruptor 

ZGG_16.jpg (439854 bytes)

generates 32 reliable pulses per revolution.  The wiring for the photointerruptor exits into the threading-gear compartment

ZGG_19.jpg (861068 bytes)

and can be used to control the strobing LEDs.

  The simplest way to use the photointerruptor signal is to let a nanocomputer do the work.  With the photointerruptor signal connected to an interrupt line, a simple Arduino program (revised 2014-08-18) can do all the heavy lifting, reading potentiometers to determine the phase and duration of the flashes, and controlling the LEDs through a Tip120, as in the earlier circuit.  This scheme works well, but the use of a computer (even an Arduino) seemed like overkill.  I have implemented a new circuit to utilize the pulses from the photointerruptor.  

   Some of the new circuit is unchanged from the earlier one, but much is new.  The photointerruptor pulses need no special handling, so they go straight to a counter that separates out 8 pulses per revolution, and the big rotary switch passes, as before, a chosen pulse to determine which of the views (now at 45° intervals) will be illuminated by the light.  

   Flashes should vary in duration, depending on the rotational speed of the lathe.  Longer flashes give more light, but shorter flashes are necessary to freeze the action when the spindle is rotating rapidly.  The rise of the chosen pulse sets a D flip-flop (U403 on the schematic), and the LEDs are illuminated as long as the flip-flop is set.   A large capacitor (C401 on the schematic) is continuously charged (to a voltage V1) through a 1K resistor, but it is discharged through a variable smaller resistance R1 (resistors R405 and R406 on the schematic) while the flip-flop is set.  In the meantime, the new circuit has used an LM339 to generate a voltage V2 that increases with increasing spindle speed.  Using an LM311, the declining voltage on C401 is compared to V2.  When the capacitor voltage is less than V2, the flip-flop is reset, and the LEDs are turned off.

   The dynamics of the new circuit can be seen on this screen:

The yellow traces ("32P") show the pulse train from the photointerruptor, while the cyan traces ("8P") show the chosen pulses.  The magenta traces ("C401") follow the voltage across C401, and the blue traces ("flsh") follow the state of the flip-flop.

   Trimpots in the new circuit determine the values of V1 and R1.   When V2 was 2.16 V at 2030 RPM, the following results were obtained from a breadboard implementation:


100 RPM, flash duration with varying R1 2030 RPM, flash duration with varying R1
minimum maximum minimum maximum
2.15 V 5 ms 75 ms 60 µs 3 ms
2.20 V 5 ms 94 ms 150 µs 7 ms
2.55 V 8 ms 126 ms 575 µs 12 ms

PCBs for the new circuit were produced from these Gerbers,  and the installed PCB is seen in these pictures:

ZGP_10.jpg (1502791 bytes)    ZGP_11.jpg (2174392 bytes)

RPM per lathe tachometer voltage at "V/RPM" testpoint
0      1.671
100      1.649-1.724
2030      2.111-2.114

   With the 15-turn potentiometer adjusted to set the voltage at the "cap load" testpoint to 2.15, an asymmetric workpiece was mounted in the chuck.  This movie shows it by room light, first rotated by hand and then at 2000 RPM.  This movie shows it as seen by (mainly) the light of the timing light, turning at 2000 RPM as the SP8T switch is turned to provide different views.


Page revised: 05/05/2015 18:55