Monday, May 30, 2022

CNC Probe for Mach3

I'm putting the finishing touches on a 3-pin style probe for my little CNC mill and figured I'd share what worked. The 3-pin switch is amazingly sensitive - closer than I can measure in my shop. I've already used it on one project so far, and after years of manual edge finding and fighting with flipped parts, it's pretty awesome. This page does a much better job than I can do to explain how it works: https://www.silvercnc.com/touch-probe/  A bunch of folks have made these, and you can even buy a pretty decent looking version on Aliexpress for under $70US. (V5 Touch Probe)



The goal was to keep it as short as possible in the vertical axis and to be able to use it on both CNC and manual machines. In order to use it on the manual mill, I needed some visual feedback (also helpful on the CNC), so I added red and green LEDs to indicate the state of the switch.

 

Mechanical:

The switch mechanism consists 3 radially spaced horizontal pins resting on 6 steel balls. The balls are soldered to a copper circuit board that's been machined to isolate the balls in pairs. A stylus on the bottom of the mandrel is used for probing and when it touches a surface in any plane, one of the pins will lift off the ball, breaking a circuit. This creates a very sensitive electrical switch. 

Centering and calibration are managed by a steel hub with a press-fit 1/4" shank to mount in the machine spindle, a V-groove, and a top lip. That inserts into an outer aluminum ring with set screws that engage the V-groove and lock it in place. There is about .030" clearance on the ring/hub interface to allow for centering.

3 long bolts run from the bottom acetal plate into the top aluminum ring, capturing an outer aluminum housing.

The stylus is a turned steel part with a 3/16" ball bearing soldered to the bottom end with 3mm threads on the top to attach to the mandrel.

Since none of my machines are particularly accurate, the probe is calibrated for the CNC mill, which is where I'll use it most. In order to maintain rotational orientation, it's mounted in an R8 tool holder that always goes back in the spindle in the same orientation. That way, I can calibrate it to about +-.001" on the CNC mill. I care a lot less about accuracy on the CNC router, so any runout will be close enough. On the manual mill, I can rotate the probe to take multiple readings and get an average. (there's about .002" difference in runout between the two milling machines - I suspect it's mostly in the old worn-out manual mill.)




 






Electrical:

The electronics consist of an inverting circuit that lights the red LED when the switch is open and green when closed. A transistor acts as a switch for the probe circuit, driven by the 3-pin switch. 

 My two CNC controllers use different voltage for the probe signals. The router uses a Gekko G540 which outputs 12V at about 7ma. The mill uses an old Probotix breakout that outputs about 4.3V at 2.5ma. I was a little worried about getting them both to work on the same wiring, but they seem happy. On both machines, I pulled 5V power from the internal power supply so there's a single connector. I used DB9 connectors on the controller box with just 3 pins active.

The connector on the probe itself uses mini-USB with Vin, ground and Data+. (But, it's NOT USB protocol, just the wiring.)

For use on the manual mill, a 5V wall wart with a 10K resistor on the probe circuit (without it, the transistor gets hot, smells bad then stops working...), and just use the lights to tell when the switch is triggered.


Mach3 code - (be sure to test and use at your own risk)

Here's the code I use for probing the ID of a circle:


If GetOemLed (825) <> 0 Then 'Check to see if the probe is already grounded or faulty
Code "(Probe plate is grounded, check connection and try again)"
Else
FeedCurrent = GetOemDRO(818) 'Get the current settings
XCurrent = GetDro(0)
YCurrent = GetDro(1)

Code "G4 P1" 'Pause 1 second to give time to position probe plate
Code "F4" 'slow feed rate to 4 ipm 100mm

Rem Probe Left

XNew = Xcurrent - 3 'probe 3 inches to left 75mm
Code "G31 X" &XNew
While IsMoving() 'wait for the move to finish
Wend
XPos1 = GetVar(2000) 'get the probe touch location

Code "G0 X" &XCurrent 'rapid move back to start point

Rem Probe Right

XNew = XCurrent + 3 'probe 3 inches to right 75mm
Code "G31 X" &XNew
While IsMoving()
Wend
XPos2 = GetVar(2000)

XCenter = (XPos1 + XPos2) / 2 'center is midway between XPos1 and XPos2
Code "G0 X" &XCenter 'rapid move to the x center location

Rem Probe up

YNew = YCurrent + 3
Code "G31 Y" &YNew
While IsMoving()
Wend
YPos1 = GetVar(2001)

Code "G0 Y" &YCurrent

Rem Probe down

YNew = YCurrent - 3
Code "G31 Y" &YNew
While IsMoving()
Wend
YPos2 = GetVar(2001)

YCenter = (YPos1 + YPos2) / 2


Rem move To the center

Code "G0 Y" &YCenter
While IsMoving ()
Wend

Code "F" &FeedCurrent 'restore starting feed rate

DoOEMButton ( 1008 )
DoOEMButton ( 1009 )

End If

 

And this probes the upper left-hand corner of a rectangle. 

If GetOemLed (825) <> 0 Then 'Check to see if the probe is already grounded or faulty
Code "(Probe plate is grounded, check connection and try again)"
Else
FeedCurrent = GetOemDRO(818) 'Get the current settings
XCurrent = GetDro(0)
YCurrent = GetDro(1)
ZCurrent = GetDro(2)

probedia = .1875
ProbeOffset = .375

fff = machmsg("Is the probe diameter " &Str(probedia) & "?", "Probe Diameter", 4)
If fff = 7 Then
    probedia = question("Enter Current Probe Diameter")
    machmsg("Updated probe diameter is: " &Str(probedia), "Probe Diameter", 0)
End If

BackOff = .05


Code "G4 P1" 'Pause 1 second to give time to position probe plate
Code "F4" 'slow feed rate to 4 ipm 100mm


YNew = YCurrent - 2
Code "G31 Y" &YNew
While IsMoving()
Wend
YPos2 = GetVar(2001)

Code "G0 Y" &YPos2 + BackOff
While IsMoving()
Wend

Code "G0 Z" &Zcurrent + ProbeOffset
While IsMoving()
Wend

Code "G0 X" &Xcurrent - .6
While IsMoving()
Wend

Code "G0 Y" &YPos2 - ProbeOffset
While IsMoving()
Wend


Code "G0 Z" &ZCurrent
While IsMoving()
Wend

XNew = XCurrent + 2 'probe 2 inches to right
Code "G31 X" &XNew
While IsMoving()
Wend
XPos2 = GetVar(2000)

Code "G0 Z" &ZCurrent + ProbeOffset
While IsMoving()
Wend
Code "G0 X" &XPos2 - probedia/2
While IsMoving()
Wend
Code "G0 Y" &YPos2 + probedia/2
While IsMoving()
Wend

Code "F" &FeedCurrent 'restore starting feed rate

DoOEMButton ( 1008 )

DoOEMButton ( 1009 )

End If
             






Monday, August 27, 2018

Summer project - new mill




I picked up this little knee mill last spring, and have spent the summer rebuilding it. As near as I can determine, it's a 1984 Enco 6x26 vertical knee mill, made in Taiwan. The overhaul  consisted of a full disassembly, replacing every bearing, many of the bolts and nuts, turning a 6" riser block to raise the head and installing an Arduino-based TouchDRO digital readout. It weighs about 600lbs (I brought it home in my Subaru!) and has a 1.5hp reversible motor that'll run at 120 or 240. (That's true 1.5hp, it pulls 18 amps on 120V.) There's still some work to do, but it's operational now. It's a great match in size and functionality for my 9" South Bend lathe. More to come...

Sunday, November 20, 2016

Cherry tables

A couple of cherry side tables.

Finished tables

Specs:
Overall height: 28"
Top: 18" x 18"
Apron width: 14"
Apron height: 4"
Legs: 1.25" taper to .75"

The legs are mortised with 3/8" tenons and pinned with 1/4" dowels. 3/4" thick top, edged glued from 3 boards, hand planed and scraped flat. The bottom side of the top has 1/4" deep, by 2" long bevel, leaving a 1/2" thick edge. Finish is a seal coat of thinned shellac topped with  multiple coats of danish oil. The top surface was wet-sanded with 320 grit and oil to fill grain pores.

Some photos:

Pile of shavings from power and hand planing lumber
Many shavings


Clamped table bases



table bases showing dowels pinning mortises
Pinned mortises

Assembled bases and one table top


Attaching the table top
Attaching the top


















Saturday, February 13, 2016

Lathe DRO Installation




Finally decided to add a DRO to the old South Bend Lathe. When looking for info on how to add digital scales to a '40s era lathe, I didn't find much, so I thought I'd share what I came up with. The inexpensive digital scales I chose are not terribly accurate, but they're good enough for the majority of the work I do. 

The X axis was fairly straightforward: there's room on the back of the lathe to hang the scale. The Y axis was more challenging: tight clearances on the carriage led to mounting the crossfeed scale behind the carriage. Fortunately, on this SB with the rear-mounted countershaft/motor assembly there was room behind the lathe. 

Cheap but decent digital scales


Aluminum angle bolted to the tapped holes for the taper
attachment I don't own.



1/8" aluminum  extension bolted to the crossfeed carriage. The side
of the crossfeed casting was milled flat and holes were tapped
in the cast iron.

X axis hanger clamped to the rear ways.

X axis scale attached to y axis aluminum angle

Sunday, June 21, 2015

New CNC

A new CNC has been taking shape in my shop over the last several months. It's a major rebuild of my previous router-lathe that adds another axis of movement and a lot more capability. I kept quiet about it until it was actually running because the design is a little unusual and I wasn't entirely sure if it was going to work -- I wanted to avoid having to say "that new machine I'm building? umm, never mind...".

It's still under construction, but far enough along that I can use it to make parts for itself.

Configured for flat work

Configured for 4th axis (lathe)
It's basically a standard 3-axis router built around an old 11" x 36" wood lathe. It has two configurations: a 3 axis router, or remove the table to access the lathe for 4th axis work. As with previous projects, most of the design work was done in Sketchup before and during construction.

Configured for rotary work on the lathe
With the table installed for flat work.


Here are the first cuts:

 




Rotary axis test.


The rotary axis (lathe) drive. 16:1 ratio -- kevlar belts.


Detail of the bearings on the gantry sides

Fabricated lathe bed and side rails


Sunday, August 17, 2014

New Bowls


Some hand-turned and CNC machined bowls.

Redwood burl. About 11"

12" cherry dyed black

5.5" mystery wood, dyed green



5.5" mystery wood, dyed black


Walnut spiral. 6.5", CNC


5" walnut, CNC


10" red cherry

Wednesday, September 18, 2013

Wind wave sculpture

I'm working with friend on a wind-powered kinetic sculpture. This is a half-scale model out of wood to verify the mechanics.



And here's a road test with the sail attached. I'm calling out engine RPM to estimate speed because the speedometer is not very accurate at low speeds. 1900 rpm equals somewhere between 9 & 10 mph.





This test provided great information about how it behaves in the wind. We're going to try less offset on the crankarm and reduce the amount of travel in the rods. Oh, and make it stronger, too.