Skip to content

Automatic probing

svenhb edited this page Aug 7, 2016 · 6 revisions

###GRBL supports probing (check linuxcnc.org for further information).

###Problem If the probing-switch is triggered, GRBL throws a position message and stops movement, but the final stop position is not the position where the switch was triggered because of movement during deceleration of the CNC.

###Solution A solution is to store the position thrown with the position message internally in the controlling software. Following variables are available:
gcodeVariable.Add("PRBX", 0.0); // Probing coordinates
gcodeVariable.Add("PRBY", 0.0);
gcodeVariable.Add("PRBZ", 0.0);
gcodeVariable.Add("PRDX", 0.0); // Probing delta coordinates
gcodeVariable.Add("PRDY", 0.0); // delta = actual - last
gcodeVariable.Add("PRDZ", 0.0);

Each variable will be replaced by it's stored value if found in the GCode.
E.g. write Z@PRBZ to set the Z value to the last Z-position thrown with the probing message.

My GCode for tool length compensation:
(Move to stationary length sensor at machine coordinates (HOMING NEEDED!))
(Move down 50, stop when switch triggers, set new z-coordinate)
G90 G0 (absolute distance mode, rapid move)
G53 Z-8 (move in machine coordinates to save height)
G53 X-146.6 Y-74 (move in machine coordinates to stationary switch/tool length sensor)
G91 G1 F500 (relative distance mode, feed mode)
G38.3 Z-50 (probe toward tool length sensor, stop on contact)
**G43.1 Z@PRBZ** (Offset Tool)
G53 G0 Z-8 (move in machine coordinates to save height)
G53 Y-85
G90 G1 F2000