TouchDRO with Sherline Lathe and Mill

While software is my business's bread and butter, I sometimes am called upon to do mechanical prototyping. And my table top Sherline lathe and mill are indispensable. I bought the "ultimate machine" shop package about a year ago and after machining just a few pieces, I was tired of counting (or miscounting) the number of turns of the hand wheels to measure distance. DRO here I come. Sherline's own DRO solution is certainly an option. And so were several other mini-mill and lathe hacks. Neither, however, suited my aesthetic. So I set out to adapt Yuriy Krushelnytskiy’s TouchDRO project to my Sherline tools. Many different options were explored along the way, but the resulting design had these key features:

  • uses CUI's AMT102 rotary encoder ($23 each)
  • requires only adaptation of existing parts, easily modifiable by purchasing a new set of bushings ($30) and handwheels ($45)
  • inexpensive electronic components @ ~$10 including a tachometer
  • custom designed printed circuit board eliminates the need for lots of wiring
  • based on the teensyduino ($9) but compatible with any arduino-based microcontroller
  • the TouchDRO project's app is compatible with any Android device with bluetooth

Total cost, including an unbranded 7" android tablet from ebay: $250.


And includes all of TouchDRO's features:

  • Bluetooth connectivity support
  • Display for up to four axes
  • Support for metric an imperial units (mm and inch)
  • Support for standard DRO functions:
    • Tool Offset
    • Preset Dimension
    • “1/2” Function
    • Hole Circle (Arch)
    • Hole Grid
    • Point memory only limited by internal storage capacity of device
    • Multiple workspaces
    • Worskpace preview

Implementation details can be found here:

tags:  |   |   | 

Sherline, TouchDRO : electronics

Not a lot of complexity in designing the electronic interface. The Teensyduino (LC) is small and low-cost ($9) and with the open-source quadrature encoding libraries, reading values from the AMT-102s was trivial. Sending the data to the TouchDRO was accomplished with a serial bluetooth module (HC-05) and the format is a simple text format of current values. No calculations are needed as the app takes care of translating the encoder output into distances. The tachometer was equally as simple with an infrared sensor module and the frequency measuring library.

Snippet of code for the teensyduino microcontroller:

 // read the current position of the encoders
   long _positionX =;
   long _positionY =;
   long _positionZ =;

  // if any of the positions have changed or periodic interupt triggered
  if( (_positionX != positionX) ||
  (_positionY != positionY) ||
  (_positionZ != positionZ) ||
    keepAlive.check() == 1) {

    // set new values to current values
    positionX = _positionX;
    positionY = _positionY;
    positionZ = _positionZ;

    // send current position to TouchDRO app via bluetooth serial interface
    Serial1.print(F("x")); Serial1.print((long)positionX); Serial1.print(F(";"));
    Serial1.print(F("y")); Serial1.print((long)positionY); Serial1.print(F(";"));
    Serial1.print(F("z")); Serial1.print((long)positionZ); Serial1.print(F(";"));

    // send current tach reading to TouchDRO app via bluetooth serial interface
    Serial1.print(F("t")); Serial1.print((long)frequency); Serial1.print(F(";"));

    // reset the periodic interupt


The schematic for the encoder interface:

touchdro board schematic v1

For proof-of-concept and testing, I pulled all the items together on a breadboard.


The original idea was to solder the components on a protoboard but it turned out to be easier to create a custom PCB. The free version of eagle was more than powerful to do the routing and communal PCB manufacturing at OSHPark made the price reasonable ( ~2.5"x2.25" board @ $5 a square inch for three copies).

touch dro board v1

I've made the code and eagle files available on github.

After about 2 weeks, I received this slick looking board:


Populated with the same components from the breadboard:


And a 3D-printed enclosure:



Step 1 Buy components. Parts can be ordered from websites like adafruit or sparkfun (or their UK, Australian, etc equivalents). If you don't mind waiting a little longer for shipping, some of the components can be ordered directly from the asian manufacturers via ebay for about 50% less.

Step 2 Get the board. There are several manufacturers that will do small runs for reasonable prices such as OSHPark. Some accept the Eagle CAD board files directly or it's easy to generate the necessary gerber files using the freeware version of Eagle CAD.

Step 3 Order the enclosure. I used shapeways to print the bottom and top of the enclosure. If you have your own 3D printer, the Solidwork CAD and STL files are included. Making your own is also an option as a project box can work too.

Step 4 Solder components. To keep the assembly simple, the PCB is designed with through-hole components. Any standard soldering iron with a small tip can be used. The board has labels that match the schematic component values (see picture above or the Eagle CAD schematic). The arduino-compatible Teensyduino and the HC05 bluetooth module need header pins, everything else is direct connection to the board. Note: since the PCB has its own power supply, you'll need to modify the teensyduino to separate the usb power from external source using option #1 before you solder it to the board..

Step 5 Upload arduino sketch. Setup files for PlatformIO is included in the github repository; this will install the necessary libraries, compile and upload the interface sketch to the Teensyduino. Alternatively, you can use the standard Arduino IDE with the teensyduino software add-on.

Step 6 Mount the encoders. If you're using a Sherline lathe and/or mill, the instructions can be found here. Otherwise, the AMT-102 datasheet has the mounting information for these to be adapted to other machines.

Step 7 Connect encoders. The PCB's bill of materials includes the connectors for the AMT-102 encoders as well as the board-compatible connectors. Or you can skip the board-side connectors since the PCB through-holes are big enough to solder 28-AWG wire directly.

Step 8 Power up! Any 5-12V DC power supply can be used with the PCB's 5.5mm x 2.1mm barrel jack. Pair your tablet installed with TouchDRO to the HC-05 and configure it with a CPI of 163840 (set at the default 4096 resolution).

tags:  |   |   | 

Sherline, TouchDRO : mechanical

After researching encoders, I decided on the AMT-102 from CUI. I've been impressed with its performance and its price tag; cheaper than other rotary encoders and cost competitive with slide-based digital scales.

With no part of the lead screw easily exposed, mounting the AMT-102 required some modification of each axis but no machining of any new fixtures or adapters. It's just adaptation of the existing parts. Since I was using my machines to make the modifications, I picked up an extra set of bushings for about $35 from Sherline. Each needed two, #4-40 holes drilled and tapped, equally spaced from the bushing's center. Some of the bushings, specifically the ones on the x and y axes of the mill and the cross slide, are made of steel that required cobalt tooling. With the backing mounted, the other side of the encoder snaps in place.


Note: I modified this configuration slightly and I would now recommend mounting the encoders at 45° or even parallel to the axis so that there is more clearance for and less strain on the cable.

Second step was modifying the hand wheels so that they engaged the encoders spline directly without using any of the adapters. While it is likely possible to disassemble the zero-set hand wheels that came with my machines, it was easier to buy a new set. Often there are people selling theirs on ebay after they've upgraded to the zero-set or an upgrad to CNC. It turned out to be easier to order directly form Sherline as you can buy the wheels without the handles (34010, 42040 and 42080). If you have hand wheels with handles, they are press fit into wheel and I used my drill press and a old drill bit, i was able to push out the pin from the reverse side without too much trouble.

hand wheel 3d rendering

With the handles out, I reversed the jaws on my chuck and reduced the diameter of the handwheel's throat to 0.47" (or just under). Moved the chuck from lathe directly on to the vertically mounted rotary table. The encoder's spline width is within a couple thousands wider than a 3/32" end mill. Wasn't comfortable taking the entire depth of each groove on the spline in one pass, so I cycled three revolutions on the rotary table, stopping every 45° to create the matching grooves (there are 8 teeth on the spline).

Milling the splines:


Hand wheel with reduced diameter and then after the spline had been cut:

Hand wheel after being turned on the lathe. And then after the splines were cut.

The hand wheel's splines mated to the encoder:


The final step was to add handles back to the wheels. Press fitting the original handle back into the wheel was doable, but I opted to create a threaded replacement spindle and handle. And instead of reusing the existing, I drilled and tapped a new hole. This also allowed me to have a single design for both small and large hand wheels. Tapping turned out to be a little tricky due to the thinness of the wheel; there wasn't enough depth to keep the tap perpendicular to the wheel. It required a T-handled tap holder and a center point inserted into the mill headstock to keep everything aligned.



Mounting of the tachometer with a #4-40 screw and a inkject printed disc with line (adhered with some rubber cement):


tags:  |   |   |