Sunday, 22 March 2009

Amazingly easy CNC touch off

Very often I need to measure the length of a tool in the spindle or the hight of a piece of stock. With a feeler gauge or similar this takes ages.

How can you do it quickly precisely and easily?

As far as I know this is the simplest thing that that works: an electronic touchplate. If the tool tip is at IO signal ground, it is easy to detect when it touches a conductive plate, but attaching a pull up resistor to the plate and detecting its logic level.

Many spindles have grounded collets anyway, most CNC controllers have signal ground and mains ground at the same voltage, and tungsten carbide is conductive, even if it is coated with TiAlN, so the first part is usually automatic. If your controller has a small signal ground (0V) that is isolated from mains ground, or your spindle electrically isolates its collet, YMMV.

My spindle is not grounded at all (single phase mains and neutral, double isolated, plastic case, no ground), but it does have a metal collar for clamping it to the Z table. This collar is electrically connected to the collet, so I added a connection between the ground for the Z servo encoder and the Z table.

Connecting the touchplate was pretty easy too. My controller is not electrically isolated: it uses direct connections from the PC parallel port. I connected a 10k pull up resistor between the 5V supply from the PC and pin 15. Then I soldered a long wire between pin 15 and a blank PCB, which is 1.58 +-0.02mm thick.

I used the EMC Halscope to observe parport.0.pin-15-in. This does indeed go false when I touch the reference panel to the tool, and is true otherwise.



I can now run this program to set the z=0 level to the surface that the touchplate (the blank PCB) is resting on:


(restore offsets)
G92.3
(make this Z=20)
G92 z20
(probe down for a maximum of 10mm or until contact is made, at 50mm/min)
F50
G38.2 z0
(assume that we made contact, and set z=0 to be the surface that the touch off contact was resting on)
G92 z1.58
(back off so that we can get the plate out)
G0 z10

(end, which clears all the offsets)
M2

No comments: