Skip to content

Commit

Permalink
final rename of the repository
Browse files Browse the repository at this point in the history
  • Loading branch information
Frix-x committed Mar 28, 2023
1 parent 96c84a9 commit cf09b01
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 25 deletions.
16 changes: 10 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
# Generic Klipper configuration
# Klippain

This generic Klipper configuration is designed for CoreXY printers. I use it on my Voron V2.4 (V2.1237), my Voron Trident, my custom TriZero, and my heavily modified Prusa i3 MK3s. Other printer owners (on Voron, VZbot, Ender5, ...) have also reported no issues using it.
> Klippain - the pain-free recipe for (french)bread and butter Klipper configuration!
This is a WIP: the files are frequently updated with new features that I create, but also with merged PRs from users. **Always** look, think, understand, and adjust to your own. But that should work in most cases. You can reach me in the Voron Discord: I'm **Frix_x#0161**.
Klippain is a generic and modular Klipper configuration for CoreXY 3D printers. I use it on my Voron V2.4 (V2.1237), my Voron Trident, my custom TriZero, and my heavily modified Prusa i3 MK3s. Other CoreXY printer owners (Voron, VZbot, Ender5, ...) have also reported no issues using it.

The files are frequently updated with new features that I create, but also with merged PRs from users. **Always** look, think, understand, and adjust to your own. But that should work in most cases. You can reach me in the Voron Discord: I'm **Frix_x#0161**.

Yes, "pain" \pɛ̃\ is the french word for bread: there is no pain in pain, only joy. Thanks to the french channel "honhonhonbaguette-FR" on the Voron Discord for this joke and name suggestion!


## Features

This configuration is designed to be generic: you can use it on a wide variety of machines by simply selecting and enabling the hardware and software options that you need.
Klippain is designed to be generic: you can use it on a wide variety of machines by simply selecting and enabling the hardware and software options that you need.

The **adaptive bed mesh** functionality I wrote some time ago, the **custom calibration macros** for pressure advance & flow, the **automated input shaper workflows**, and the **vibrations measurement** macros and scripts are among the custom features available out of the box.

Expand All @@ -16,11 +20,11 @@ Here is a [list with the details and usage instruction for all the features](./d

## Installation

Installing this configuration should not be too complicated if you are already familiar with the Klipper ecosystem. Make sure you already have Klipper, Moonraker, and a WebUI is installed on your printer. You can use [KIAUH](https://github.com/th33xitus/kiauh) if you don't.
Installing Klippain should not be too complicated if you are already familiar with the Klipper ecosystem. Make sure you already have Klipper, Moonraker, and a WebUI is installed on your printer. You can use [KIAUH](https://github.com/th33xitus/kiauh) if you don't.

Then, to run the installation script, connect to your printer using SSH and type the following command:
```
wget -O - https://raw.githubusercontent.com/Frix-x/klipper-voron-V2/main/install.sh | bash
wget -O - https://raw.githubusercontent.com/Frix-x/klippain/main/install.sh | bash
```

This script will backup your old configuration, download this GitHub repository into your RaspberryPi home directory and setup the entire environment in `~/printer_data/config`. You'll also be asked if you want to select and install some MCU board_pins templates. This is recommended as it will allow a very fast filling of your `mcu.cfg` user file, but you can always do it manually afterwards if you prefer.
Expand Down
12 changes: 9 additions & 3 deletions docs/overrides.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,21 @@ It allow me to set default values for each configuration section that you can in

Using this mechanism, you will be able to tweak the machine dimensions, limits, currents, and everything else in all these configuration sections. You can also use the overrides to invert motor directions, or even add/replace a macro, etc... This is a very powerful feature!

> **NOTA** : Klipper does not allow `[board_pins]` sections to contain pin modifiers such as `!`, `^` and `~`. Moreover, when configuring multiple MCUs at the same time, all the aliases used in the hardware sections must be prefixed with the MCU name. This is a current limitation of Klipper and is why you will also need to use the overrides.cfg file to add them.
> **Note**
> Klipper does not allow `[board_pins]` sections to contain pin modifiers such as `!`, `^` and `~`. Moreover, when configuring multiple MCUs at the same time, all the aliases used in the hardware sections must be prefixed with the MCU name. This is a current limitation of Klipper and is why you will also need to use the overrides.cfg file to add them.

## Common overrides

Since my defaults are designed to be as generic as possible, you will not need to add as many overrides. However, there are still some common things you should take a look at. For example, **pay special attention to the axis limits** in the `[stepper_...]` sections. Also check the thermistor types in `[extruder]` and `[heated_bed]`, the plate size and probe points in `[bed_mesh]`, the corner positions in `[quad_gantry_level]` or `[z_tilt]`, ...
Since my defaults are designed to be as generic as possible, you will not need to add as many overrides. However, there are still some common things you should take a look at. For example, **pay special attention to the axis limits** in the `[stepper_...]` sections, run current, etc... Also check the thermistor types in `[extruder]` and `[heated_bed]`, ... If you are using a multi-MCU configuration, you will also need to override any section where there are pins connected to the secondary board to explicitly add it. Finally, you will need to use overrides if you want to change direction of motors or adding a pull-up/down (using `!`, `^` and `~`).

In addition, if you want to add a new macro or even replace an existing one to adapt it to your use case, you can always do it the same way!


## How to write an override

First rule: put any changes in your own `overrides.cfg` user file and **never modify my config directly** as your changes will be deleted when the repo is updated!
>**Warning**
> put any changes in your own `overrides.cfg` user file and **never modify my config directly** as your changes will be deleted when the repo is updated!
Let's say you want to change the motor current for the X axis. You'll need to override the `[tmc2209 stepper_x]` section because that's where this current is defined.
To do this, simply add this to your `overrides.cfg` file:
Expand Down
5 changes: 3 additions & 2 deletions docs/pinout.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ In Klipper, once a `[board_pins]` is defined, the aliases are used in all sectio

## Configuring your mcu.cfg file

This generic configuration is designed using a two-level [board_pins] model:
Klippain is designed using a two-level [board_pins] model:
1. First level: Some rules and pin naming conventions (let's call them "Frix-x names") were defined and used in all config files. Then a set of [user board_pins templates](./../user_templates/mcu_defaults/) were created for the most common MCUs of the market. This is basically what you need to put in your `mcu.cfg` file.
2. Second level: Since it's always a pain to retrieve the pin names from the boards manufacturer's documentation like `PA12` or `gpio23` (let's call them "controller names"), I added a second layer of [board_pins] to link some "easy to retrieve names" (ie. what's printed on the MCU boards around the ports and easy to read with "MCU_" as a prefix) to these "controller names". This second layer of board_pins is located [in this folder](./../config/mcu_definitions/) and is not intended to be modified.

Expand All @@ -16,7 +16,8 @@ Frix-x names -> Manufacturer (PCB print) names > controller names

So in order to populate your own `mcu.cfg` file, just copy one of the [user template](./../user_templates/mcu_defaults/) into it. Then feel free to change the wiring to your liking. For example, if you have wired your part fan to port `FAN3` instead of `FAN0`, just change the definition to `PART_FAN=MCU_FAN3` and that's it!

> **NOTA** : Klipper does not allow `[board_pins]` sections to contain pin modifiers such as `!`, `^` and `~`. Moreover, when configuring multiple MCUs at the same time, all the aliases used in the hardware sections must be prefixed with the MCU name. This is a current limitation of Klipper and is why you need to use the overrides.cfg file to add them.
> **Info**
> Klipper does not allow `[board_pins]` sections to contain pin modifiers such as `!`, `^` and `~`. Moreover, when configuring multiple MCUs at the same time, all the aliases used in the hardware sections must be prefixed with the MCU name. This is a current limitation of Klipper and is why you need to use the overrides.cfg file to add them.

## Using a new MCU
Expand Down
28 changes: 14 additions & 14 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
# Where the user Klipper config is located (ie. the one used by Klipper to work)
USER_CONFIG_PATH="$(realpath -e ${HOME}/printer_data/config)"
# Where to clone Frix-x repository config files (read-only and keep untouched)
FRIX_CONFIG_PATH="${HOME}/frix-x_config"
FRIX_CONFIG_PATH="${HOME}/klippain_config"
# Path used to store backups when updating (backups are automatically dated when saved inside)
BACKUP_PATH="${HOME}/frix-x_config_backups"
BACKUP_PATH="${HOME}/klippain_config_backups"


set -eu
Expand Down Expand Up @@ -44,16 +44,16 @@ function check_download {
frixreponame="$(basename ${FRIX_CONFIG_PATH})"

if [ ! -d "${FRIX_CONFIG_PATH}" ]; then
echo "[DOWNLOAD] Downloading Frix-x configuration folder..."
if git -C $frixtemppath clone https://github.com/Frix-x/klipper-voron-V2.git $frixreponame; then
echo "[DOWNLOAD] Downloading Klippain repository..."
if git -C $frixtemppath clone https://github.com/Frix-x/klippain.git $frixreponame; then
chmod +x ${FRIX_CONFIG_PATH}/install.sh
printf "[DOWNLOAD] Download complete!\n\n"
else
echo "[ERROR] Download of Frix-x configuration git repository failed!"
echo "[ERROR] Download of Klippain git repository failed!"
exit -1
fi
else
printf "[DOWNLOAD] Frix-x git repository folder already found locally. Continuing...\n\n"
printf "[DOWNLOAD] Klippain repository already found locally. Continuing...\n\n"
fi
}

Expand All @@ -63,7 +63,7 @@ function backup_config {
mkdir -p ${BACKUP_DIR}

if [ -f "${USER_CONFIG_PATH}/.VERSION" ]; then
echo "[BACKUP] Frix-x configuration already in use: only a backup of the custom user cfg files is needed"
echo "[BACKUP] Klippain already in use: only a backup of the custom user cfg files is needed"
find ${USER_CONFIG_PATH} -type f -regex '.*\.\(cfg\|conf\|VERSION\)' | xargs mv -t ${BACKUP_DIR}/ 2>/dev/null
else
echo "[BACKUP] New installation detected: a full backup of the user config folder is needed"
Expand All @@ -76,7 +76,7 @@ function backup_config {

# Step 4: Put the new configuration files in place to be ready to start
function install_config {
echo "[INSTALL] Installation of the last Frix-x Klipper configuration files"
echo "[INSTALL] Installation of the last Klippain config files"
mkdir -p ${USER_CONFIG_PATH}

# Symlink Frix-x config folders (read-only git repository) to the user's config directory
Expand Down Expand Up @@ -142,7 +142,7 @@ function install_mcu_templates {
fi

# Next see if the user use a toolhead board
read < /dev/tty -rp "[CONFIG] Do you have a toolhead MCU and wants to install a template? (y/N) " install_toolhead_template
read < /dev/tty -rp "[CONFIG] Do you have a toolhead MCU and want to install a template? (y/N) " install_toolhead_template
if [[ -z "$install_toolhead_template" ]]; then
install_toolhead_template="n"
fi
Expand Down Expand Up @@ -172,7 +172,7 @@ function install_mcu_templates {
fi

# Finally see if the user use an ERCF board
read < /dev/tty -rp "[CONFIG] Do you have an ERCF MCU and wants to install a template? (y/N) " install_ercf_template
read < /dev/tty -rp "[CONFIG] Do you have an ERCF MCU and want to install a template? (y/N) " install_ercf_template
if [[ -z "$install_ercf_template" ]]; then
install_ercf_template="n"
fi
Expand Down Expand Up @@ -211,9 +211,9 @@ function restart_klipper {

BACKUP_DIR="${BACKUP_PATH}/config_$(date +'%Y%m%d%H%M%S')"

printf "\n=======================================\n"
echo "Frix-x configuration install and update"
printf "=======================================\n\n"
printf "\n======================================\n"
echo "- Klippain install and update script -"
printf "======================================\n\n"

# Run steps
preflight_checks
Expand All @@ -222,4 +222,4 @@ backup_config
install_config
restart_klipper

echo "[POST-INSTALL] Everything is ok, Frix-x config installed and up to date!"
echo "[POST-INSTALL] Everything is ok, Klippain installed and up to date!"

0 comments on commit cf09b01

Please sign in to comment.