Kobra2+Klipper




I continue to torture my Kobra2 :)

Today we will START installing and configuring the Clipper.


!!! IMPORTANT !!! The config for the printer IS NOT FEATURING NOZZLE OFFSET - it is in the process and will be added later.

!!! IMPORTANT !!! Everything you do - you do at your own peril and risk. I am not responsible for any burnt printers, gray hair, sleepless nights, divorced spouses, and so on.

!!! IMPORTANT !!! The stock screen will not work!

Well, everything important has been said - let's get started.


What you need:

1. Anycubic Kobra2 printer (unexpected, right?)

2. A single board computer capable of running Klipper. I will be using a Raspberry Pi 3 since I have one. You also need a microSD memory card for this computer. If your single board computer uses eMMC as a drive, then this manual does not cover this feature.

3. High-quality power supply for a single board computer. In my case - 5V 2-3A, otherwise there may be serious issues with stability.

A small note. There is a DC-DC converter on the Kobra2 board and, perhaps, it will be possible to use it in the future.

4. Wi-Fi with a known password. Preferably yours, not your neighbor's. You will need to download about 1.2GB of data.

5. Computer. I will be using Win10, but macOS and Linux are also available.



So.

First we need to install Klipper on our Raspberry.

To do this, go to https://www.raspberrypi.com/software/ and download the Raspberry Pi Imager. When launched, we will see the following screen:



Here we need to select and configure our future operating system. Click "Choose OS" -> "Other specific purpose OS" -> "3D Printing" -> "Mainsail OS" -> and select 32 or 64 bits. 32bit OS recommended.

A big plus of this OS is that all the software is already installed and can work "out of the box"


Next, take the SD card that you will use with your single board computer and insert it into the computer. You can use the card reader that came with the printer. I did exactly that.

Click "Choose Storage" and select your SD card.


Next, we need to make some settings for the installed OS. To do this, click on the gear icon and get into Advanced Options. Here you need to check "Enable SSH" -> Use Password authentication.


If you leave "Set username and password" unchecked, the system will use the default username/password - pi/raspberry. If you want to use your username and password, be sure to remember / save them! You can reset them, but it's easier to reinstall the entire system IMHO.


The next important step is to set up your wireless network. To do this, check the "Configure wireless Lan" item. Enter your Wi-Fi network in the SSID field.



A little hint for Windows users. If you do not remember what network you have and what password it has, but this data is stored on your computer, then do this.

- Type and search [Command Prompt] in the Windows search bar, then click [Open]





- Type a command 

Netsh wlan show profiles

This command will show how the Wi-Fi networks stored on your computer are called in the system. Choose the one that suits you



Type a command

Netsh wlan show profile name="WiFi_Profile_Here" key=clear 

In my case, in the previous step my network is named Aeronet so the command would be [Netsh wlan show profile name="Aeronet" key=clear]. In the Key Content field, our key :)


That's all, we have prepared for the installation of the Klipper, feel free to press the Write button and wait for the process to complete.

After that, we insert the SD card into our Raspberry Pi, connect the power and after 10 minutes in the browser open the address http://mainsailos.local/

Don't  be scared with of errors - it's OK as Klipper can't find any connected printers.

Open the bottom tab Machine in the left menu and see what our IP address of our device is. In my case it is 192.168.100.20



Next, we need to install Klipper on our printer. It is desirable that you have a basic knowledge of Linux-like systems. If they are not there, then it's okay, you just have to repeat my actions exactly.


To continue, we need to connect to our Raspberry Pi with command-line interface. To do this, we will use the SSH protocol and the Putty SSH client. You can of course use any other client of your choice (hello TeraTerm). In the future, we will need to download the file from our RaspberryPi, so we will need a client for this action too :) WinSCP is my choice.


Open Putty and type in the address we found above



If you did not change the login and password for connection at the stage of configuring the OS image for a single-board computer, then login will be pi, and the password will be raspberry. I changed, and therefore mine login name will be "aleks".


It's a good practice to update all pre-installed software. Type the command 

sudo apt-get update

sudo means that the command will be executed as the super user; apt-get is a package installer for some Linux systems; update is an option that forces apt-get to update its records of available software packages.



The next command will update the already installed software packages. 

sudo apt-get upgrade


Disclaimer. The processor memory contains two programs. The first one is called bootloader. It boots first and checks if there is firmware on the SD card. If the firmware is found, the main program is updated. If there is no firmware, then the main program continues to load. The firmware that are available from the manufacturer are the main program.


 Next is very important. If the printer firmware is configured incorrectly, there is a chance to overwrite the bootloader and then firmware updates via the SD card will become impossible. Anycubic does not provide a bootloader for their printers. Since the board uses a CLONE STM32 processor, searching for and flashing the bootloader can be an overwhelming task! The main program is written to the processor's memory starting at a specific address. Memory BEFORE this address is reserved for the bootloader. In our printer, the space allocated for the bootloader is slightly larger than usual, and since the Kobra2 is a new printer, Klipper does not yet have the correct settings. We have to fix this.

In the terminal window, enter the 

ls

command.



then 

cd klipper

and

nano src/hc32f460/Kconfig 

The nano editor opens and the Kconfig file opens. We go down to the BOOTLOADER section


  

We need to add after the line

prompt "Application Address" 
following lines:

config HC32F460_FLASH_APPLICATION_ADDRESS_0x010000
bool "0x010000"


and after the line

config FLASH_APPLICATION_ADDRESS
hex
following line:

default 0x010000 if HC32F460_FLASH_APPLICATION_ADDRESS_0x010000


Press Ctrl-O (save file) and Ctrl-X (exit)

We can start compiling the firmware for our printer. To do this, run the command

make menuconfig

Using the up and down arrows, select Microcontroller architecture -> Huada Semiconductor HC32F460. Select by pressing Enter. Next Communication Interface -> Serial (PA15 & PA09). Next - Application Address -> 0X010000. This is what we added in the previous step. Leave Clock Speed at 168MHz. Press Q and confirm the save. We execute the command 

make

This command will compile the program for our printer.


The next step is to download the resulting firmware and install it on the printer.

In order to download the firmware, we need a program like WinSCP, which I mentioned earlier.

We launch the program and connect to our RaspberryPi using the same login and password that we used to connect via SSH.


Go to the klipper/out folder and copy the klipper.bin file to your computer.




Rename the file to firmware.bin and update the printer in the same way as updating the official firmware.


It's time to connect the printer and load the configuration. We connect the printer with a regular USB-A-C wire to any of the RaspberryPi USB ports.

Open the Klipper web interface again and restart the Clipper.




The clipper should detect our printer and the error should change - the clipper should complain that the configuration file is missing. Let's fix this. You can download the configuration file for the printer below printer.cfg


Open the Machine tab and select "Upload file" and the configuration file you downloaded above.



Restart Klipper again, but this time you can select "Firmware restart"


That's all! Your printer is set up and ready to print, all that's left to do is Bed Leveling and setting Nozzle Offset. As I said at the beginning of the article, there is NO automatic adjustment of Nozzle Offset in my config YET. As soon as it appears, I will post an updated config file.

Комментарии

Популярные сообщения из этого блога

Heatbed insulation