Qt_Dragon

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 is assumed to be cubic.

When Z LEVEL COMP is enabled, the compensation component reads a probe data file, which must be called probe_points.txt. The file can be modified or updated at any time while compensation is disabled. When next enabled, the file will be reread and the compensation map is recalculated.

The probe data file is generated by a probing program which itself is generated by an external python program called gcode_ripper.py, which should be located in the configuration directory.

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

Workflow

There should now be a file in the nc_files folder called {something}-probe-only.ngc. Set the file filter to G-Code Files, navigate to the nc_files directory and load this file.

Without changing the offsets, run this program. Make sure the probe tool is installed. When complete, there will be a file in the config directory called probe_points.txt

Z level compensation is now enabled. Load the gcode file that needs to be levelled. The amount of offset is shown in the Z AXIS EOFFSET label.