How to determine the gcode offsets in X and Y for the Z probe and/or toolheads with Klipper.

This is done with the help of a cheap, in 2024 14 Euro, USB Digital Microscope from Aliexpress, and Klipper with some simple macros. In this case toolhead T0 is the reference because the Z probe is attached to it. The other toolhead offsets are calculated using T0 as a reference.
Due to the manual focus of the microscope all Z-offsets should be set to a fixed value, if possible at 0.

First some pre conditions:
  1. The disclaimer has been read.
  2. The toolhead move distance steps in X and Y are available in steps of 0.1, 0.01 and 0.001 .
  3. The digital microscope:
         - It has a stable pedestal,
         - It is available as webcam within Klipper,
         - It has the crosshair enabled in any color or size.
  4. The gcode offsets of all toolheads are set to 0.0 in the configuration file "SET_GCODE_OFFSET X=0 Y=0".
  5. The toolhead with attached Z probe is loaded and used as the reference for the other toolhead offsets.
  6. All axes are homed.
  7. Adjust the toolhead/build plate Z height so the microscope, with pedestal, fits under it with a small gap. Position the microscope on the build plate so that the nozzle is close to, or in, the crosshair.

Z Probe XY offset:
    If needed change the microscope's crosshair size to fit the nozzle or Z probe.

  1. Using the Toolhead move distance buttons, accurately move the nozzle into the center of the crosshair, then push "SET REFERENCE POINT".
  2. Move the toolhead, with the distance buttons, to any position in X and Y and then push "GOTO REFERENCE POINT". The nozzle should return exactly to the crosshair center. If it does not match exactly then probably the pedestal has moved.
  3. Using the move distance buttons, accurately move the probe into the center of the crosshair then push "CALCULATE OFFSET".
  4. Verify the calculated offset is correct by pushing "GOTO REFERENCE POINT" and then "GOTO OFFSET". If adjustments are needed repeat one of the previous 2 steps.
  5. Add or verify the offsets to the Z probe's configuration file. This may require the axes to be homed again so remove the microscope !!

Toolhead XY offset:
    If needed change the microscope's crosshair size to fit the nozzle opening

  1. With the move distance buttons, accurately move the nozzle of the toolhead T0 into the center of the crosshair then push "SET REFERENCE POINT".
  2. Move the toolhead T0, with move distance buttons, to any position in X and Y and then push "GOTO REFERENCE POINT".
    The nozzle should return exactly to the crosshair center. If it does not match exactly then probably the pedestal has moved.
  3. Switch from toolhead T0 to T1.
  4. With the move distance buttons, accurately move the nozzle of toolhead T1 into the center of the crosshair then push "CALCULATE OFFSET".
  5. Verify the calculated offset for toolhead T1 by:
    - switch to toolhead T0 and push "GOTO REFERENCE POINT".
    - switch to toolhead T1 and push "GOTO OFFSET".
  6. If the Z probe is attached to toolhead T0 make sure its loaded because after the next step the axes have to be homed.
  7. Change the T1 gcode offsets in its configuration file, "SET_GCODE_OFFSET X=0 Y=0", to the calculated values.
  8. Remove the microscope from the build plate and home all axes.

Verify configured Toolhead XY offset:
    If needed change the microscope's crosshair size to fit the nozzle opening.

  1. Remove the microscope from the build plate and home all axes.
  2. Adjust the toolhead or build plate Z height and position the microscope on the build plate so that the nozzle is in the crosshair.
  3. With the Toolhead move distance buttons accurately move the nozzle of the toolhead T0 into the center of the crosshair then push "SET REFERENCE POINT".
  4. Switch from toolhead T0 to T1 and push "GOTO REFERENCE POINT".
  5. Switch from toolhead T1 to T0 and push "GOTO REFERENCE POINT".

If needed repeat "Toolhead XY offset".


All macros in a zip file

Notes:

Back