Skip to main content

First Layer AI Slicer Configuration for Layer Scan (For Klipper Users)


Slicer configuration is only required for Klipper. If you are running OctoPrint, you do not need to make any slicer changes.

Celestrius will watch your print during the first layer to make sure nothing fishy like poor adhesion, under/over extrusion, blobbing and other issues are present. After the first layer is completed, the print will be paused and a first layer scan will be completed. After the first layer scan is completed, you will get an email with a report card on your first layer.

In order to make this work, Celestrius needs to be able to know when the first layer is printing and when it finishes. To make this happen, you'll need to adjust your slicer settings to include a macro written to help conduct the first layer scan.

Configure Layer Scanning:

In addition to colllecting images while the first layer prints, you can use a layer scan macro to have Obico's first layer Ai scan the print after the first layer finishes to get a better analysis of the first layer as a whole.

Follow these steps to configure your setup for first layer scanning:

Update the Obico Plugin to version 1.5.2-5.

First, update the Obico plugin to the latest version. When you update the moonraker-obico plugin, we will automatically make two adjustments to your klipper setup:

  1. Add moonraker_obico_macros.cfg to your Config Files. This file contains the layer scan macro.
  2. Add [include moonraker_obico_macros.cfg] to your printer.cfg file.

Choose your slicer below and make the changes detailed in the section for your slicer

Slicer Configuration

We already added some custom g-code to the slicer to get the layer information to be passed from the slicer. Now, we will add one more line to the "Before Layer Change" section of the slicer.

  1. Open PrusaSlicer

  2. Go to the Print Settings tab.

  3. Click Custom G-Code

  4. Add the following line to the "Before layer Change" section: _OBICO_LAYER_CHANGE CURRENT_LAYER={layer_num + 1} MINX=[first_layer_print_min_0] MINY=[first_layer_print_min_1] MAXX=[first_layer_print_max_0] MAXY=[first_layer_print_max_1]

Layer scanning is currently not supported for Cura. It may be added in the future.

Layer Scanning Configuration Options

The following options are available to be configured in the Celestrius Alpha Enrollment page.:

  1. Enable or Disable: Enable or disable the first layer scan by clicking the checkbox (Scanning is enabled by default). If you turn off scanning, first layer AI will still work, but it may be more accurate with scanning enabled.
  2. Retraction Value: This is the amount that your filament will retract after the first layer finishes printing. This helps prevent filanent ooze during the scan. The default is 6.5mm.
  3. Scan Height: The Z-height that the scan will run at. The default value is 4mm. If your camera is out of focus while doing the first layer scan, adjust the height so your camera is in focus.

Configuring Retraction value

When your first layer finishes, Obico will pause the print and retract the value that is set. This will ensure that the filament is not leaking out of the nozzle as the first layer is scanned. Depending on your setup, you may find that the default value is not sufficient.

If the filament is leaking out of your nozzle during the scan, increase the value so the filament will retract more before the scan starts.

If you run into any issues with your nozzle clogging after the first layer is scanned, reduce the retraction value so that the filament is pulled back a shorter distance.

Configuring Scan Height

The first layer scan will happen at Z=4mm by default, but if this height doesn't produce a clear focused image, you can adjust the scan height so the images are more in focus. To find the optimal scan height, do the following:

  1. Print this stl file. It is a simple box of 1 layer tall (0.2mm layer height). Leave the model on the build plate when it is finished printing.
  2. Move the Z-axis to Z=4mm.
  3. Move your print head to the center of the build plate.
  4. move the Z-height up or down until you achieve the best focus. The printed model should be as clearly in focus as possible.

In the example below, you can see that the z-height of 4mm is clearly more focused than 2mm. At 2mm, the space in between the nozzle and the camera is more out of focus, while it is more focused at 4mm.

Z-height = 2mm

Z-height = 4mm