Z LEVEL COMPENSATION

Z level compensation is a bed levelling/distortion correction function typically used in 3D printing or engraving. It uses a HAL user space component which utilizes the external offsets feature of LinuxCNC. The loadusr command in the handler_postgui file specifies an interpolation type, which must be one of nearest, linear or cubic. If none is specified or if an invalid word is specified, the default will set to nearest.

When Z LEVEL COMP is enabled:

The probe_points.txt file can be updated at any time while compensation is disabled. When next enabled, the file will be reread and the compensation map is recalculated.

The necessary HAL connections are as follows:

net xpos-cmd         compensate.x-pos <= axis.x.pos-cmd
net ypos-cmd         compensate.x-pos <= axis.y.pos-cmd
net zpos-cmd         compensate.x-pos <= halui.axis.z.pos-relative
net compensate-on    compensate.enable-in <= qtdragon.comp-on<
net eoffset-clr2     compensate.clear  => or2_1.in1
net comp-count       compensate.counts => qtdragon.comp-count
net map-ready        compensate.map-ready => qtdragon.map-ready
setp compensate.fade-height 0.0
setp axis.z.eoffset-enable True

Creating a Map File

Load Map

A previously saved probe results file can be retrieved and used as the compensation map. The source file is chosen from a popup file dialog and then copied to the CONFIG folder with the name probe_points.txt. In order not to accumulate probe results files in the CONFIG folder, it is recommended to move them elsewhere, such as the nc_files folder.

Interpolation Method

The following diagrams show the effect of the different interpolation methods when an L shaped piece of 6 mm metal was probed.

comp method nearest
Compensation Map with Nearest Interpolation
comp method linear
Compensation Map with Linear Interpolation
comp method cubic
Compensation Map with Cubic Interpolation