After introducing some useful plugins at the beginning, we will now focus on further optimizing the 3D printer. To do this, the Klipper software is installed on the Raspberry Pi in addition to the Octoprint server, which not only improves print quality but also allows for more customization.
With this software, the 3D printer’s internal electronics are no longer a weak point and are ultimately comparable to those of many modern printers.
1 print head
The X-Carriage print head from ML3DPrinting, which is available on Thingiverse , offers several advantages over the classic metal print head. This new print head not only provides better cooling but also includes an optional mounting option for a drag chain and the 3D Touch. Furthermore, it is printed on a 3D printer, making it inexpensive to produce, and is also slightly lighter than the original metal version, which allows for faster acceleration and puts less strain on the motors and timing belts.
The model is available in two versions: the 3D-printed components can be connected using either standard hex nuts or fusion threads. Since the screw assortment already includes matching nuts, the fusion threads are not necessary.
The following assortments are recommended for this purpose:
Screw set (M3)
The " Various Parts " folder contains adapters for the drag chain and a fan mount for standard 40x40 fans as a replacement for the vertical fan. This allows standard Noctua fans can be used to enable virtually silent printing.
The drag chain offers the advantage that the cables are routed without stress and cannot be kinked too sharply, thus preventing damage to them.
Of course, you can print the drag chain yourself be printed , but since 3D printing involves tolerances, we recommend the purchased version (10x20 mm).
In the There are two different versions of the CarrierPlate and CoverPlate files. Select the appropriate file based on your extruder version.
Assembly:
Allow about an hour for assembly, as this requires disassembling the entire print head and the X-axis guide rails.

Figure 1: New print head
The 3D printer has been further enhanced with an improved BL-Touch mounting, optimized cooling, and an attractive design.
Additionally, retrofitting a drag chain can be a useful upgrade. This solution, well-known in industrial applications, protects the control cables and prevents unnecessary strain.
2 Firmware
Inside the 3D printer is a mainboard that controls the motors, heating elements, and sensors according to the G-code, via USB or SD card. Many older 3D printers feature an ATmega 2560 microcontroller on this board (e.g., the Trigorilla board). This 8-bit processor is not particularly powerful, but it must calculate the new positions from the G-code data. The open-source software Marlin is commonly used for these calculations; however, due to the limited performance of the mainboard processor, the printer’s capabilities in terms of speed and accuracy are restricted.
This is where the Klipper software comes in. It consists of two processors: one acts as an " application processor," which calculates the printer's movements, and a microcontroller—in our case, the ATmega on the mainboard—which controls the hardware according to the commands.
Since a Raspberry Pi is already connected to the 3D printer as an OctoPrint server, the Klipper software can simply be installed on it.
Installing Klipper firmware:
Open the browser interface as usual using the Raspberry Pi’s IP address and, if necessary, perform the appropriate Octoprint updates in the settings. The Octoprint firmware must be at least version v0.17.0.
Now connect to the Raspberry Pi via SSH using appropriate software; on Windows, we recommend PuTTY, and on Linux, this can be done directly via the terminal.
Use the IP address of the Octoprint server as the username pi and the password raspberry, unless you changed it during the Raspberry Pi image installation process.
In Linux, enter the following line in the terminal:
sudo ssh pi@192.168.xxx.xxx
First, update the PI package sources using `
`sudo apt-get update
sudo apt-get upgrade
followed by the installation of the version control software git using the following command:
sudo apt install git
Finally, the software must be cloned from GitHub and installed. To do this, run the following three commands.
cd ~
git clone https://github.com/Klipper3d/klipper
./klipper/scripts/install-octopi.sh
New microcontroller firmware:
Now that the Klipper firmware has been successfully installed alongside Octoprint, all that remains is to flash the microcontroller on the mainboard.
Execute the following commands via the SSH terminal:
cd ~/klipper/
make menuconfig
Select the correct processor for the 3D printer's mainboard (Anycubic i3 Mega: AtMega 2560) and confirm your selection by pressing Q on the keyboard.
Compile the microcontroller firmware using the command
make
Next, determine the name of the serial port using
ls /dev/serial/by-id/*
Copy the command's output and run the following lines in the terminal, substituting the specific port name:
sudo service klipper stop
make flash FLASH_DEVICE=#Portname#
sudo service klipper start
Klipper Configuration
To change the settings of the 3D printer, a setup file is required in the directory of the Klipper host (Raspberry Pi).
There are several ready-made configuration files for the most common 3D printers in the project directory.
This file can be copied to the directory using the following command
cp ~/klipper/config/printer-anycubic-i3-mega-2017.cfg ~/printer.cfg
This is only the basic configuration. Since the printer was already upgraded in Part 3 with new stepper motor drivers and in Part 6 with a 3D Touch, this file must be adjusted accordingly.
One option is the built-in Linux text editor nano, but since this always requires an SSH connection, this method is relatively cumbersome.
The Octoklipper plugin, which can be installed via the plugin manager in Octoprint, offers an intuitive solution. This plugin not only provides an editor for the config file but also additional useful control and debugging functions.
More information about this plugin

Figure 2: Configuration file editor of the Octo Klipper plugin
Connect 3D Printer
Re-flashing the microcontroller firmware may have changed the serial port name.
By
ls /dev/serial/by-id/*
you can determine the name that you need to enter in the configuration file under [mcu] serial:.
Next, you must establish a serial connection between the Klipper firmware and the microcontroller. In the Octoprint web interface, open the settings and, under Printer > Serial Connection, enter the following lines in the “Additional serial ports” field:
~/printer_data/comms/klippy.serial
/tmp/printer
Then select /tmp/printer as the serial port.
Next, check the connection to the 3D printer by performing a status query via the OctoKlipper plugin.
If you encounter MCU connection issues, execute the following commands via the SSH terminal:
sudo usermod -a -G dialout pi
sudo reboot
Conclusion
In this blog post, the Klipper software was installed in addition to Octoprint. However, this is just one way to configure the Raspberry Pi; alternatively, a Klipper dashboard such as Fluid can be used to upload G-code files to the server and control the basic functions. These alternatives, however, do not offer the wide variety of plugins available in Octoprint.
The next section covers configuring the 3DTouch and preparing for the first print.
Have fun building it :)






