Cheetsheet
Enabling Klipper & FluiddPI on SK-Tank


Last update: 2021 Dec 21th

The CPU of RaspberryPi 4B is much powerful than the micro processor on a 3D printer control board, therefore some sophisticated algorithms which improves print quality & nice graphic user interface can be run on a RPi. The main processor on the control board can even be replaced & emulated by a RPi, so you can use some lower-end control boards instead.


Either Fluidd, Mainsail or OctoPrint can be the web user interface to control the underlying Klipper firmware. Here we're using Fluidd as an example.


This cheatsheet only shows step-by-step instructions. Please refer to the original online document Klipper and Fluidd for the details.


Settings for PID tunes, pressure advance, input shaper, auto bed tramming (Z tilt adjustment) have been added but disabled or not tuned for your printer in the SK-Tank printer.cfg file. After Fluidd setup is completed, you can follow Klipper document and start tuning these features.


Please note in the steps below, actions are done in either [Desktop] or [RPi]. Don't be confused.


Fluidd web interface for Klipper

Table of Contents

Preparation

Basic

  • A RaspberryPi 4B or 3+, with USB cable and power adapter.

  • A 16GB+ micro SD card.


Enable input shaper to cancel ringing

  • An accelerometer module ADXL345. Since it's cheap enough, some more spares would be nice.

  • A printed Volcano mount for this specific ADXL345 module shown in the picture . STL here.

  • Six 15cm wires with DuPont female-female connectors. Some more spares would be nice.

Manual connector crimping might bring an invalid device ID error. The shorter wires the better to prevent any possible EMF interference. If you have a spare RPi, just solder the wires as shown in the picture.

Steps about enabling input shaper are not mentioned in this manual. Please refer to Measuring Resonances and Resonance Compensation in Klipper doc.

The basic concept is, when the nozzle is cold, you attach the ADXL345 sensor as close to the nozzle as possible and command Klipper to measure the parameters the input shaper needs. In this case we attach the ADXL345 to the heater block, but somewhere else at the extruder carriage also works. Once measured the ADXL345 can be removed and disconnected. While the firmware reboots it reads parameters for input shaper and compensates each movement.

The listed Volcano mount is designed specifically for this ADXL345 module.


[Desktop] Backup all your settings

Klipper uses extended G-codes and command templates which will be new to non-software background users. You'll have to spend some time digesting the online document.

It would be best to backup all your slicer settings, old firmware config files, etc. before migration. ๐Ÿ™‚








[Desktop] Make a FluiddPi flash card

FluiddPi is a pre-build RPi image with Fuidd frontend web interface and Klipper firmware.

Download Raspberry Pi Imager and latest version of FluiddPi image

Open the image in Raspberry Pi Imager and write the image to a micro SD card.


[Desktop] Enter WiFi SSID and password

Enter your WIFI SSID and password to the fluiddpi-wpa-supplicant.txt file so once the RPi boots it can connect to your local wireless network.

[Desktop] Connect to the RPi with ssh

Open a command line window in your desktop and enter the command:

ssh pi@fluiddpi.local

After entering the default password "raspberry" you should be able to login as user pi to the RPi.


[RPi] Configure your RPi

Run raspi-config as the root user:

sudo raspi-config


Choose these menu items in the config utility:

  • Update (update raspi-config to the latest version)

  • System --> Password (change password for the user pi)

  • Localisation --> Locale

  • Localisation --> Timezone

  • Interface --> Enable SPI (enable SPI for accelerometer ADXL345 and input shaper)


Exam

Make sure the SPI interface is enabled!

Run raspi-config as the root user


[RPi] Configure Klipper and build

cd ~/klipper (change to klipper directory)

make menuconfig (choose target control board)


In the menu choose STM32 for Mellow FLY CDY and BigTreeTech SKR Pro control board.

Micro-conftroller Architecture --> STM32

Processor model --> STM32F407 (This depends. Please check the model number printed on the main chip)


make all (build)

cd out/ (change to out sub-directory)

ls -al (list files)


The firmware binary file klipper.bin should be there.

[Desktop] Copy and flash firmware

1. Copy the klipper.bin file on RPi to the directory your_path on your desktop:

scp pi@fluiddpi.local:klipper/out/klipper.bin your_path/


2. Rename it to firmware.bin and copy it to the micro SD card.


3. Insert the micro SD card to your control board. Your board will recognize the specific name firmware.bin and flash it.


4. Read the micro SD card in your desktop. If the firmware.bin has been renamed to firmware.CUR, it means the firmware has been flashed.

[RPi] Again, configure Klipper and build

Ignore this step if you don't have an accelerator module yet.

This time we configure RPi as a secondary control board so Klipper can use the GPIO pins to control the accelerator module ADXL345.


cd ~/klipper (change to klipper directory)

make menuconfig (choose target control board)


In the menu choose Linux process.

Micro-conftroller Architecture --> Linux


make all (build)

make flash (install the binary to file system)

cd /tmp (change to /tmp directory)

ls -al (list files)


Two files klipper_host_mcu and printer should be there.

[RPi] Get USB ID

Connect the control board to RPi with a USB cable.


cd /dev/serial/by-id/ (change to the USB ID directory)

ls -al (list files)


A long string ID usb-Klipper_xxxxx_xxxx-xxx should show up after USB cable inserted. Copy this ID.


[Desktop] Download printer.cfg

  1. Download the printer.cfg for SK-Tank.

  2. Edit and paste the USD ID to the [mcu] sction in printer.cfg.

  3. Open a command line window in your desktop and input the command as below:

scp your_path/printer.cfg pi@fluiddpi.local:klipper_config/

It means to copy the printer.cfg in your_path to the klipper_config directory in the device located at local network address fluiddpi.local as user pi.


If you don't have an accelerator module and haven't configure RPi as a secondary control board yet in the previous step, comment [mcu rpi], [adxl345], [resonance_tester] sections out to disable input shaper related functions.


Later if you want to modify values in the printer.cfg, you can either

  1. Do the same as above, edit it in your desktop and copy it to the RPi.

  2. Edit it in the Fluidd web interface. (Easiest!)

  3. Edit it in the Linux command line interface.


Paste the USD ID to the [mcu] sction in printer.cfg.


Open a command line console in your desktop and copy the file to the remote RPi.


Comment these lines out to disable input shaper related functions if you don't have an accelerator module and haven't configure RPi as a secondary control board yet.

[RPi] Restart Klipper

Restart Klipper firmware so the new printer.cfg takes effect. Klipper is run as a Linux service.

sudo service klipper stop

sudo service klipper start


[Desktop] Connect to Fluidd

Open a browser and enter the URL http://fluiddpi.local/. Make a bookmark ๐Ÿ˜‰

Give a cool name to your SK-Tank.

If Fluidd says the printer is shutdown even when your printer is turn on, re-connect the USB cable.

Open a browser and enter the URL http://fluiddpi.local/. Make a bookmark ๐Ÿ˜‰


Give a cool name to your SK-Tank.


If Fluidd says the printer is shutdown even when your printer is turn on, re-connect the USB cable.

[Desktop] Start & End G-code in Slicer

Use a simple keyword START_PRINT as the start G-code, and END_PRINT as the end G-code. These keywords are macro names and will be replaced as the instructions defined in your printer.cfg.

Just customize the macros to your needs.

Use a simple keyword START_PRINT as the start G-code, and END_PRINT as the end G-code


Location of printer.cfg in Fluidd


The START_PRINT macro in printer.cfg


The VFA issue

VFA (vertical fine artifacts) is known to be a problem of imperfect matching between TMC drivers and steppers.

Klipper provides some low-level accesses directly to the registries in the IC chips via driver_xxx settings. Altering these timing values changes the shape of waveforms generated by TMC drivers and thus smooth the final prints.

Check this page for the TMC timing values sample to minimize VFA.

Before TMC tuning


After TMC tuning
(Image courtesy: SK-Tank owner Jeffery Kilgore)

Some new concepts in Klipper

Klipper uses extended G-codes and command templates which will be new to non-software background users. You'll have to spend some time digesting the online document.

Enjoy 3D printing ๐Ÿ™‚