Home Documentation
Documentation
Article Index
Documentation
G-codes samples: Surface Measure
G-codes samples: Tool Length Measure
G-codes samples: Homing
G-codes samples: Helical interpolation
Polar coordinates G16 G15
Plane selection G17 G18 G19
G68 G69 Coordinate system rotation
G65 Simple macro call
All Pages

G-code programming samples.

Surface Measure procedure

Surface Measure procedure is implemented via macros layer with used-defined miscellaneous function M120 (can be redefined flexible).
Surface measuring is available from DNC program by using M120 code as well as from GUI by pressing Surface-Measure-on-screen button-

surface measure on-screen button

The button is connected to the same M120 miscellaneous function through configuration file cnc-config.xml

Listing for Surface Measure function-

 

(Surface measure)                                                                                       
(Tool is situated somewhere above the surface sensor)                                                   
(Surface Sensor Width is placed into Parameter #5490)                                                   
                                                                                                        
G28.2 Z0.                     (save current z position into Register1.Z (value with Z doesn't matter))        
G53 G38.2 Z-10.         (move down to z=-10., stop while sensor is pressed)                             
                                       (destination position should be lower than surface sensor)                      
G10 L70 P1 Z#5490  (set current work position as Z=0 (with offset depends on tool sensor width))   
G28.5 Z0.                     (return back to saved Z position in Register1.Z (value with Z doesn't matter))  

 

After running this procedure tool will be in the same position (machine position) as before start, but work coordinates (work position)
will be updated, so Z=0 on a blank surface.