This is the multi-page printable view of this section. Click here to print.

Return to the regular view of this page.

Klipper Calibration

Minimal 3DP Klipper Calibration and Optimization Website - A Work in Progress

Launched - 2024-04-12

This section is my attempt to to create a Klipper Calibration website. It is based on my Klipper Calibration Spreadsheet

1 - Rotational Distance

Calculate your Rotational Distance for Klipper

Rotational Distance

From the Klipper Documents

On an extruder, the rotation_distance is the amount of distance the filament travels for one full rotation of the stepper motor. The best way to get an accurate value for this setting is to use a “measure and trim” procedure.

First start with an initial guess for the rotation distance. This may be obtained from steps_per_mm or by inspecting the hardware.

Then use the following procedure to “measure and trim”:

  1. Make sure the extruder has filament in it, the hotend is heated to an appropriate temperature, and the printer is ready to extrude.
  2. Use a marker to place a mark on the filament around 70mm from the intake of the extruder body. Then use a digital calipers to measure the actual distance of that mark as precisely as one can. Note this as <initial_mark_distance>.
  3. Extrude 50mm of filament with the following command sequence: G91 followed by G1 E50 F60. Note 50mm as <requested_extrude_distance>. Wait for the extruder to finish the move (it will take about 50 seconds). It is important to use the slow extrusion rate for this test as a faster rate can cause high pressure in the extruder which will skew the results. (Do not use the “extrude button” on graphical front-ends for this test as they extrude at a fast rate.)
  4. Use the digital calipers to measure the new distance between the extruder body and the mark on the filament. Note this as <subsequent_mark_distance>. Then calculate: actual_extrude_distance = <initial_mark_distance> - <subsequent_mark_distance>
  5. Calculate rotation_distance as: rotation_distance = <previous_rotation_distance> * <actual_extrude_distance> / <requested_extrude_distance> Round the new rotation_distance to three decimal places.

Console Commands

G91
G1 E50 F60

Rotational Distance Calculator

Edit Printer.cfg

The value calculated should be pasted into your printer.cfg file under “Extruder”.

[extruder]
step_pin: PD15
dir_pin: PD14
enable_pin: !PC7
microsteps: 16
rotation_distance: <PASTE HERE>
nozzle_diameter: 0.400
filament_diameter: 1.750
heater_pin: PB3
sensor_type: EPCOS 100K B57560G104F
sensor_pin: PA2
#control: pid
#pid_Kp: 22.2
#pid_Ki: 1.08
#pid_Kd: 114
min_temp: 0
max_temp: 250
max_extrude_cross_section: 4

** Video Coming Soon **

2 - Flow Calibration

Calibrate the Flow of your Extruder in your Slicer

Flow Calibration

From 3D Print Beginner

The flow rate calibration is done in order to fine tune the amount of plastic extruded by the printer. Also known as Extrusion Multiplier, by calibrating the flow rate you can fix issues caused by under-extrusion or over-extrusion. Besides this, flow rate calibration can also improve retraction values a bit and help with bulging corners and layer seam. If the extruder steps are properly calibrated, the flow rate value should be really close to a single digit value (1.00).

Flow Rate Calibration – Improve Print Accuracy

Slicer Settings

Slicer Settings
Layer Height 0.2
Paerimeters 2
Line Width 0.5
Print Thin Walls Off
Top Layer 0
Bottom Layer 1
Infill 0%

Cube STL File: Flow Cube

  1. Print Cube with Settings Above
  2. Measure the top of all 4 sides and place values below
  3. Update Flow in Slicer with “FLOW” Value

Flow Calibration Calculator

Update Your Slicer

3 - Run Current for TMC2208/2209

Calculate your Run Current for your Steppers

Run Current

From the Voron Docs

Calculating Currents - To calculate the maximum Klipper current settings for a given stepper, follow this process: Look up the specifications for the stepper motor and locate the peak current limits of the motor. Multiply the peak current by 0.707 to determine the maximum current in RMS. This is the maximum run current.

Calculating Driver Current Settings

Steps

The maximum Klipper RUN current settings can be calculated via the following steps:

  1. Use the peak current limit from the stepper specifications sheet for the stepper motor.
  2. Multiply the peak current by 0.707 to determine the max run current in RMS.
  3. Round down to the nearest .1
  4. Verify settings for each motor.

** maximum capacity of the 2209 driver is 1.2 Amps. **

Run Current Calculator

Edit Printer.cfg

Edit the run current for each motor (x, y, z).


[tmc2209 stepper_x]
uart_pin: PE0
run_current: <RUN CURRENT>
diag_pin:

4 - Pressure Advance

Calculate the ideal Pressure Advance

Pressure Advance

From the Klipper Documents

Pressure advance does two useful things - it reduces ooze during non-extrude moves and it reduces blobbing during cornering. This guide uses the second feature (reducing blobbing during cornering) as a mechanism for tuning.

Klipper Documents

Slicer Settings

Paramenter Value
Nozzle Diameter 0.4
Layer Height 0.3
Infill 0

Test Model: Square Tower

Console Commands

  1. Setup
SET_VELOCITY_LIMIT SQUARE_CORNER_VELOCITY=1 ACCEL=500
  1. Select command based on drive:

Direct Drive:

TUNING_TOWER COMMAND=SET_PRESSURE_ADVANCE PARAMETER=ADVANCE START=0 FACTOR=.005

Bowden Tube:

TUNING_TOWER COMMAND=SET_PRESSURE_ADVANCE PARAMETER=ADVANCE START=0 FACTOR=.020

Pressure Advance Calculator

Edit Your Slicer or Printer.cfg

5 - Input Shaping

Setup and Calculate Input Shaping Values

Input Shaping

From the Klipper Documents

“Klipper Input Shaping improves print quality by exorcising the ghosts caused by vibrations and resonances. Read on to learn all about it!”

Klipper: Input Shaping – Simply Explained

Basic tuning requires measuring the ringing frequencies of the printer by printing a test model.

According to the Klipper docs, slice the ringing test model, which can be found in docs/prints/ringing_tower.stl, in the slicer:

  • Use a layer height is 0.2 or 0.25 mm.
  • Both the infill and top layers can be set to 0.
  • Use eithet 1-2 perimeters, or vase mode with 1-2 mm base.
  • Use a high speed that is around 80-100 mm/sec, for external perimeters.
  • aThe minimum layer time is at most 3 seconds.
  • Turn off any “dynamic acceleration control” controls in the slicer.
  • Do not turn the model. It has X and Y marks at the back of the model. Note the unusual location of the marks vs. the axes of the printer - it is not a mistake. The marks can be used later in the tuning process as a reference, because they show which axis the measurements correspond to.

Steps

Parameter Value Notes
Layer Height 0.2 or .25
Paerimeters 1 0r 2 0r Vase Mode
Line Width 0.5
Print Speed 100 0r 80
Top Layer 0
Bottom Layer 5
Infill 0%
  1. If square_corner_velocity parameter was changed, revert it back to 5.0.
  2. Klipper Console Command:
SET_VELOCITY_LIMIT ACCEL_TO_DECEL=7000
  1. Klipper Console Command:
SET_PRESSURE_ADVANCE ADVANCE=0
  1. Klipper Console Command:
SET_INPUT_SHAPER SHAPER_FREQ_X=0 SHAPER_FREQ_Y=0
  1. Klipper Console Command:
TUNING_TOWER COMMAND=SET_VELOCITY_LIMIT PARAMETER=ACCEL START=1500 STEP_DELTA=500 STEP_HEIGHT=5
  1. Print with Settings Above
  2. Count the “rings” on X and Y sides of ringing tower
  3. Measure the distance between Rings

Input Shaping Calculator

Edit Printer.cfg

Add Below to Printer.cfg with above X and Y Frequencies

[input_shaper]
shaper_freq_x: <X Frequency>  # frequency for the X mark of the test model
shaper_freq_y: <Y Frequency>  # frequency for the Y mark of the test model

Then Run the following Steps in the Klipper Console:

  1. Klipper Console Command:
RESTART
  1. Klipper Console Command:
SET_VELOCITY_LIMIT ACCEL_TO_DECEL=7000
  1. Klipper Console Command:
SET_PRESSURE_ADVANCE ADVANCE=0
  1. Klipper Console Command:
SET_INPUT_SHAPER SHAPER_TYPE=MZV
  1. Klipper Console Command:
TUNING_TOWER COMMAND=SET_VELOCITY_LIMIT PARAMETER=ACCEL START=1500 STEP_DELTA=500 STEP_HEIGHT=5
  1. Print the Model as above

If you see no rings add the following to the [input_shaper] section

[input_shaper]
shaper_freq_x: <X Frequency>  # frequency for the X mark of the test model
shaper_freq_y: <Y Frequency>  # frequency for the Y mark of the test model
shaper_type: mzv

** Video Coming Soon **

6 - Setting X and Y Offsets

Calculate and Setup the X and Y Offsets

Setting X and Y Offsets

From the Klipper Documents

Steps

X and Y Offsets Calculator

Edit Printer.cfg

** Video Coming Soon **

7 - Max Volumentric Speed

Calculate and Set Max Volumentric Speed (in Orca Slicer)

Setting Max Volumentric Speed

From Orca Slicer

This is a test designed to calibrate the maximum volumetric speed of the specific filament. The generic or 3rd party filament types may not have the correct volumetric flow rate set in the filament. This test will help you to find the maximum volumetric speed of the filament.

Max Volumetric speed

Steps

  1. Open Orca Slicer
  2. Go to “Calibration” -> “More…” -> “Max Flowrate
  3. Fill out “Max volumetric speed test” dialog
  4. Print model
  5. Measure with Calipers to spot on model before the print starts to fail
  6. Paste Max Flow Value into Orca Slicer Filament Section

Max Volumentric Speed Calculator

Update your Slicer

Update Orca Slicer

Update Prusa Slicer

Update Cura

8 - Lead Screw Rotation Distance

Calculate Lead Screw Rotation Distance

Setting Lead Screw Rotation Distance

From the Klipper Documents

The rotational axes with a lead screw can be easily calculated with the following formula:

rotation_distance = <screw_pitch> * <number_of_separate_threads>

Steps

Pitch # of Threads
Variables 2 4 T8x8
2 2 T8x4
2 1 T8x2

Lead Screw Rotation Distance Calculator

9 - PID Tuning in Klipper

Running PID Tuning in Klipper

TL;DR

Extruder

PID_CALIBRATE HEATER=extruder TARGET=205

Bed

PID_CALIBRATE HEATER=heater_bed TARGET=65

PID Tuning in Klipper

PID tuning is essential for maintaining consistent temperatures in your 3D printer’s hot end and heat bed, leading to better print quality. Here’s a breakdown of PID tuning in Klipper:

What is PID Tuning?

PID stands for Proportional-Integral-Derivative. It’s a method that helps the printer controller adjust heating power based on the difference between the desired temperature (setpoint) and the actual temperature reading from the sensor. By fine-tuning these adjustments, the printer maintains a stable temperature with minimal fluctuations.

PID Tuning Process in Klipper

Klipper offers a straightforward approach to PID tuning using extended G-codes. Here’s a step-by-step process:

PID Tuning the Extruder

  1. Access your Klipper interface: Open your Klipper instance through the web interface (Fluidd, Mainsail, etc.).

  2. Initiate PID calibration: In the console, enter the following command, replacing “extruder” with the actual name of your extruder if it’s different:

PID_CALIBRATE HEATER=extruder TARGET=205

For me, 205 typically works the best for PLA.

  1. Use the following command to save the PID values into your Printer.cfg:
SAVE_CONFIG

PID Tuning the Heated Bed

  1. Access your Klipper interface: Open your Klipper instance through the web interface (Fluidd, Mainsail, etc.).

  2. Initiate PID calibration: In the console, enter the following command:

PID_CALIBRATE HEATER=heater_bed TARGET=65

I usually go with the bed at 65 for PLA.

  1. Use the following command to save the PID values into your Printer.cfg:
SAVE_CONFIG

Explanation:

  • PID_CALIBRATE HEATER is the extended G-code for starting PID calibration.
  • extruder specifies that you’re tuning the extruder heater (replace with “heater_bed” for the heated bed).
  • TARGET=200 sets the desired temperature for calibration (you can adjust this value).

The PID calibration cycle: Klipper will now run the extruder or bed through heat up, cool down, and heat up again cycles. This collects data to calculate optimal PID values.

Obtaining results: After the cycle, Klipper might display the calculated PID values in the console. You can also find them in the “klippy.log” file.

Saving the new PID values:

  • Automatic saving: If configured correctly, sending the SAVE_CONFIG command might automatically save the new PID values in your “printer.cfg” file.
  • Manual saving: If automatic saving isn’t working, locate the pid_Kp line (for extruder or heater_bed) in “printer.cfg”, replace the values with the calculated ones, save the file, and restart Klipper.

Additional Tips:

  1. Ensure proper configuration before running PID tuning Klipper Documentation: Configuration Checks: https://www.klipper3d.org/Config_Reference.html
  2. Consider consulting your printer’s documentation or online resources for specific recommendations on target temperatures.

By following these steps, you can effectively PID tune your Klipper setup and achieve better temperature control for your 3D prints.

References

10 - Testing a Bltouch, CRTouch, ora clone in Klipper

Testing a BLTOUCH or a clone in Klipper

Testing a BLTouch with Klipper involves several steps to ensure that the probe is functioning correctly. Here’s a simplified process:

  1. Initial Setup: Make sure the BLTouch is correctly mounted and the pin is about 2 mm above the nozzle when retracted (1).

  2. Self-Test: Power on the printer; the BLTouch should perform a self-test, moving the pin up and down. After this, the pin should retract, and the red LED should light up (1).

  3. Control Pin Test:

    • Send BLTOUCH_DEBUG COMMAND=pin_down in the printer terminal to move the pin down.

      BLTOUCH_DEBUG COMMAND=pin_down
      
    • Verify that the red LED turns off.

    • Send BLTOUCH_DEBUG COMMAND=pin_up to retract the pin and ensure the red LED turns on (1).

      BLTOUCH_DEBUG COMMAND=pin_up
      
  4. Sensor Pin Test:

    • With the pin down, send BLTOUCH_DEBUG COMMAND=touch_mode, then QUERY_PROBE and check for “probe: open”.

      BLTOUCH_DEBUG COMMAND=touch_mode
      

      &

      QUERY_PROBE
      
    • Gently push the pin up with your finger, send QUERY_PROBE again, and look for “probe: TRIGGERED”.

    QUERY_PROBE

    
    - If the responses are incorrect, check your wiring and configuration (1).
    
  5. Probing Test: Move the print head away from the bed and repeat the control and sensor pin tests to confirm the probe’s response when not near the bed surface (1).

Remember to handle the BLTouch probe gently and avoid touching the pin with your fingers, as it’s sensitive to grease and pressure. If you encounter any issues during these tests, it’s usually a sign to double-check your wiring and configuration settings¹. Always refer to the official Klipper documentation for detailed instructions and troubleshooting tips. Happy printing!

References: (1) BL-Touch - Klipper documentation. (2) Klipper & BLTouch: How to Make Them Work Together | All3DP. (3) Testing the BLTouch - MatterHackers Knowledge Base (4) klipper/docs/BLTouch.md at master · Klipper3d/klipper · GitHub