diff --git a/README.md b/README.md index 078af819e..7f3da803b 100644 --- a/README.md +++ b/README.md @@ -1,57 +1,57 @@ -# Klippain - -> Klippain - The pain-free recipe for (french)bread and butter Klipper configuration! - -Klippain is a generic, modular, and highly customizable Klipper configuration for 3D printers. Designed for use on various machines such as Cartesian, CoreXY and CoreXZ, it has been reported working correctly on Voron V2.4, Voron Trident, Voron V0, Voron SwitchWire, TriZero, VZbot, Ender5, Ender3, Prusas, etc... - -![Klippain](./docs/klippain.png) - -Klippain is regularly updated with new features and merged PRs from users. You can reach me on the Voron Discord as **Frix_x#0161**. - -Fun fact: "pain" \pɛ̃\ is the French word for bread, so there's no pain in this pain—only joy! Thanks to the French channel "honhonhonbaguette-FR" on the Voron Discord for the joke and name suggestion! - - -## Features - -Klippain is designed for versatility. By selecting and enabling the desired hardware and software options, it can be used on a wide range of machines. - -Custom features available out of the box include **adaptive bed mesh**, **custom printer calibration macros**, **automated input shaper workflows**, and **vibration measurement** macros and scripts, ... Refer to the [features documentation](./docs/features.md) for a detailed list and usage instructions. - - -## Installation - -To install Klippain, first ensure you have already Klipper, Moonraker, and a WebUI installed on your printer. If not, use [KIAUH](https://github.com/th33xitus/kiauh). - -Then, run the installation script using the following command over SSH. This script will backup your old configuration, download this GitHub repository to your RaspberryPi home directory, and set up Klippain in `~/printer_data/config`. You will also be prompted to select and install MCU board_pins templates. This is recommended for faster `mcu.cfg` setup, but you can do it manually later if you prefer. - -```bash -wget -O - https://raw.githubusercontent.com/Frix-x/klippain/main/install.sh | bash -``` - -Finally, Klippain requires a few simple steps to configure and customize it for your printer: please follow the [configuration guide](./docs/configuration.md). - - > **Warning** - > - > General rule to keep the auto-update feature working: **never modify Klippain files directly**, but instead add overrides as per the documentation! To proceed, you can modify all the pre-installed templates in your config root folder (`printer.cfg`, `mcu.cfg`, `variables.cfg` and `overrides.cfg`) as they will be preserved on update. - - -## Removing Klippain - -In case Klippain doesn't suit your needs or if you installed it by mistake, you can easily remove Klippain and revert to your previous configuration by using the automated uninstall script. During the uninstallation process, the script will remove all specific Klippain files and configurations. Additionally, you will be given an option to restore your previously backed-up configuration, allowing your printer to return to its last working state (from before Klippain was installed). - -To run the uninstall script, execute the following command over SSH: - -```bash -wget -O - https://raw.githubusercontent.com/Frix-x/klippain/main/uninstall.sh | bash -``` - - > **Note** - > - > All backups are preserved during the uninstallation process. So, you can easily revert back at any time if you wish to :stuck_out_tongue_winking_eye: - - -## Support the Project - -I strive to accommodate user requests that align with this configuration's design. Feel free to open an issue or a PR for specific hardware device support or new features. - -Alternatively, consider buying me a coffee or contributing to new hardware purchases to support my work! +# Klippain + +> Klippain - The pain-free recipe for (french)bread and butter Klipper configuration! + +Klippain is a generic, modular, and highly customizable Klipper configuration for 3D printers. Designed for use on various machines such as Cartesian, CoreXY and CoreXZ, it has been reported working correctly on Voron V2.4, Voron Trident, Voron V0, Voron SwitchWire, TriZero, VZbot, Ender5, Ender3, Prusas, etc... + +![Klippain](./docs/klippain.png) + +Klippain is regularly updated with new features and merged PRs from users. You can reach me on the Voron Discord as **Frix_x#0161**. + +Fun fact: "pain" \pɛ̃\ is the French word for bread, so there's no pain in this pain—only joy! Thanks to the French channel "honhonhonbaguette-FR" on the Voron Discord for the joke and name suggestion! + + +## Features + +Klippain is designed for versatility. By selecting and enabling the desired hardware and software options, it can be used on a wide range of machines. + +Custom features available out of the box include a full featured set of standard macros, **adaptive bed mesh**, **custom printer calibrations**, **automated input shaper workflows**, and **vibration measurement** macros and scripts, ... Refer to the [features documentation](./docs/features.md) for a detailed list and usage instructions. + + +## Installation + +To install Klippain, first ensure you have already Klipper, Moonraker, and a WebUI installed on your printer. If not, you can use [KIAUH](https://github.com/th33xitus/kiauh). + +Then, run the installation script using the following command over SSH. This script will backup your old configuration, download this GitHub repository to your RaspberryPi home directory, and set up Klippain in `~/printer_data/config`. You will also be prompted to select and install MCU board_pins templates. This is recommended for faster `mcu.cfg` setup, but you can do it manually later if you prefer. + +```bash +wget -O - https://raw.githubusercontent.com/Frix-x/klippain/main/install.sh | bash +``` + +Finally, Klippain requires a few simple steps to configure and customize it for your printer: please follow the [configuration guide](./docs/configuration.md). + + > **Warning**: + > + > General rule to keep the auto-update feature working: **never modify Klippain files directly**, but instead add overrides as per [the documentation](./docs/overrides.md)! To proceed, you can modify all the pre-installed templates in your config root folder (`printer.cfg`, `mcu.cfg`, `variables.cfg` and `overrides.cfg`) as they will be preserved on update. + + +## Removing Klippain + +In case Klippain doesn't suit your needs or if you installed it by mistake, you can easily remove Klippain and revert to your previous configuration by using the automated uninstall script. During the uninstallation process, the script will remove all specific Klippain files and configurations. Additionally, you will be given an option to restore your previously backed-up configuration, allowing your printer to return to its last working state (from before Klippain was installed). + +To run the uninstall script, execute the following command over SSH: + +```bash +wget -O - https://raw.githubusercontent.com/Frix-x/klippain/main/uninstall.sh | bash +``` + + > **Note**: + > + > All backups are preserved during the uninstallation process. So, you can easily revert back at any time if you wish to :stuck_out_tongue_winking_eye: + + +## Support the Project + +I strive to accommodate user requests that align with this configuration's design. Feel free to open an issue or a PR for specific hardware device support or new features. + +Alternatively, consider buying me a coffee or contributing to new hardware purchases to support my work! diff --git a/config/hardware/ercf.cfg b/config/hardware/ercf.cfg index 7cf97e801..3a478857a 100644 --- a/config/hardware/ercf.cfg +++ b/config/hardware/ercf.cfg @@ -1,26 +1,10 @@ +## DEPRECATED! +## Please use the mmu.cfg file instead + + ## Enraged Rabbit Carrot Feeder config file ## Designed to be used with Ercf Software V3 "Happy Hare" (HH) by moggieuk: https://github.com/moggieuk/ERCF-Software-V3 [gcode_macro _USER_VARIABLES] variable_klippain_ercf_enabled: True gcode: - -[extruder] -max_extrude_only_distance: 200 -max_extrude_cross_section: 50.0 - -# Custom macro to raise an error during the START_PRINT and stop it in case of an ERCF error -[gcode_macro _ERCF_ERROR_CHECK] -gcode: - {% set verbose = printer["gcode_macro _USER_VARIABLES"].verbose %} - {% set INITIAL_TOOL = printer["gcode_macro START_PRINT"].initial_tool %} - - {% if printer.ercf.enabled %} - {% if printer.ercf.tool|int != INITIAL_TOOL or printer.ercf.filament != "Loaded" %} - {action_raise_error("ERCF error while loading filament! Please check and restart the print")} - {% else %} - {% if verbose %} - RESPOND MSG="T{INITIAL_TOOL} ready" - {% endif %} - {% endif %} - {% endif %} diff --git a/config/hardware/lights/config_colors.cfg b/config/hardware/lights/config_colors.cfg new file mode 100644 index 000000000..681fcb60c --- /dev/null +++ b/config/hardware/lights/config_colors.cfg @@ -0,0 +1,56 @@ +## This file contain the color definitions used for the different LED states +# You can override it if needed to define your own colors. These defaults +# should be a good starting point + +[gcode_macro _LEDS_COLORS_DEFINITION] +variable_colors: { + 'logo': { + 'busy': {'r': 0.4, 'g': 0.0, 'b': 0.0, 'w': 0.0}, + 'cleaning': {'r': 0.0, 'g': 0.02, 'b': 0.5, 'w': 0.0}, + 'calibrating_z': {'r': 0.8, 'g': 0., 'b': 0.35, 'w': 0.0}, + 'heating': {'r': 0.3, 'g': 0.18, 'b': 0.0, 'w': 0.0}, + 'homing': {'r': 0.0, 'g': 0.6, 'b': 0.2, 'w': 0.0}, + 'leveling': {'r': 0.5, 'g': 0.1, 'b': 0.4, 'w': 0.0}, + 'meshing': {'r': 0.2, 'g': 1.0, 'b': 0.0, 'w': 0.0}, + 'on': {'r': 0.8, 'g': 0.8, 'b': 0.8, 'w':1.0}, + 'off': {'r': 0.0, 'g': 0.0, 'b': 0.0, 'w': 0.0}, + 'printing': {'r': 1.0, 'g': 0.0, 'b': 0.0, 'w': 0.0}, + 'done_printing': {'r': 0.0, 'g': 1.0, 'b': 0.0, 'w': 0.0}, + 'standby': {'r': 0.01, 'g': 0.01, 'b': 0.01, 'w': 0.1}, + 'error': {'r': 0.6, 'g': 0.0, 'b': 0.0, 'w':0.0}, + }, + 'nozzle': { + 'heating': {'r': 0.8, 'g': 0.35, 'b': 0.0, 'w':0.0}, + 'off': {'r': 0.0, 'g': 0.0, 'b': 0.0, 'w': 0.0}, + 'on': {'r': 0.8, 'g': 0.8, 'b': 0.8, 'w':1.0}, + 'standby': {'r': 0.6, 'g': 0.0, 'b': 0.0, 'w':0.0}, + 'done_printing': {'r': 1.0, 'g': 1.0, 'b': 0.0, 'w': 1.0}, + 'error': {'r': 0.6, 'g': 0.0, 'b': 0.0, 'w':0.0}, + }, + 'caselight': { + 'busy': {'r': 0.4, 'g': 0.0, 'b': 0.0, 'w': 0.0}, + 'cleaning': {'r': 0.0, 'g': 0.02, 'b': 0.5, 'w': 0.0}, + 'calibrating_z': {'r': 0.8, 'g': 0., 'b': 0.35, 'w': 0.0}, + 'heating': {'r': 0.3, 'g': 0.18, 'b': 0.0, 'w': 0.0}, + 'homing': {'r': 0.0, 'g': 0.6, 'b': 0.2, 'w': 0.0}, + 'leveling': {'r': 0.5, 'g': 0.1, 'b': 0.4, 'w': 0.0}, + 'meshing': {'r': 0.2, 'g': 1.0, 'b': 0.0, 'w': 0.0}, + 'on': {'r': 0.8, 'g': 0.8, 'b': 0.8, 'w':1.0}, + 'off': {'r': 0.0, 'g': 0.0, 'b': 0.0, 'w': 0.0}, + 'printing': {'r': 1.0, 'g': 0.0, 'b': 0.0, 'w': 0.0}, + 'done_printing': {'r': 0.0, 'g': 1.0, 'b': 0.0, 'w': 0.0}, + 'standby': {'r': 0.01, 'g': 0.01, 'b': 0.01, 'w': 0.1}, + 'error': {'r': 0.6, 'g': 0.0, 'b': 0.0, 'w':0.0}, + }, + 'minidisplay': { + 'on': {'r': 0.0, 'g': 0.2, 'b': 0.4, 'w':1.0}, + 'off': {'r': 0.0, 'g': 0.0, 'b': 0.0, 'w': 0.0}, + 'error': {'r': 0.4, 'g': 0.0, 'b': 0.0, 'w':0.0}, + }, + 'thermal': { + 'hot': {'r': 1.0, 'g': 0.0, 'b': 0.0, 'w': 0.0}, + 'cold': {'r': 0.3, 'g': 0.0, 'b': 0.3, 'w': 0.0} + } + } + +gcode: diff --git a/config/hardware/lights/fcob_white.cfg b/config/hardware/lights/fcob_white.cfg index 4ff581fc1..8c18f06dc 100644 --- a/config/hardware/lights/fcob_white.cfg +++ b/config/hardware/lights/fcob_white.cfg @@ -1,4 +1,5 @@ # White lights using 24V (example: white fcob) + [gcode_macro _USER_VARIABLES] variable_light_enabled: True variable_light_pin_name: "caselight" diff --git a/config/hardware/lights/neopixel_caselight.cfg b/config/hardware/lights/neopixel_caselight.cfg index 1f9884e5b..5894e325d 100644 --- a/config/hardware/lights/neopixel_caselight.cfg +++ b/config/hardware/lights/neopixel_caselight.cfg @@ -1,4 +1,5 @@ # Neopixel leds used as general printer lights + [gcode_macro _USER_VARIABLES] variable_status_leds_caselight_enabled = True variable_status_leds_caselight_led_name: "caselight" @@ -6,6 +7,7 @@ gcode: # Also include directly the leds control macros from here [include ../../../macros/hardware_functions/status_leds.cfg] +[include config_colors.cfg] [neopixel caselight] diff --git a/config/hardware/lights/neopixel_caselight_effects.cfg b/config/hardware/lights/neopixel_caselight_effects.cfg new file mode 100644 index 000000000..6d593d236 --- /dev/null +++ b/config/hardware/lights/neopixel_caselight_effects.cfg @@ -0,0 +1,185 @@ +# Neopixel leds used as general printer lights +# using LED_effects + +[gcode_macro _USER_VARIABLES] +variable_status_leds_caselight_enabled = True +variable_status_leds_caselight_led_name: "caselight_effects" +gcode: + +# Also include directly the leds control macros from here +[include ../../../macros/hardware_functions/status_leds.cfg] +[include config_colors.cfg] + + +[neopixel caselight] +pin: LIGHT_NEOPIXEL +# The pin connected to the neopixel. This parameter must be +# provided. +chain_count: 31 +# The number of Neopixel chips that are "daisy chained" to the +# provided pin. The default is 1 (which indicates only a single +# Neopixel is connected to the pin). +color_order: GRB +# Set the pixel order required by the LED hardware (using a string +# containing the letters R, G, B, W with W optional). The default is +# GRB. +initial_RED: 0.0 +initial_GREEN: 0.0 +initial_BLUE: 0.0 +#initial_WHITE: 0.0 +# Sets the initial LED color of the Neopixel. Each value should be +# between 0.0 and 1.0. The WHITE option is only available on RGBW +# LEDs. The default for each color is 0.# + + +######################################################### +# Define led effects for the different printer states +######################################################### +## Ready State +[led_effect cl_standby] +leds: + neopixel:caselight +autostart: false +frame_rate: 24 +layers: + breathing 20.00 1 add (1.00,1.00,1.00) + static 0 0 top (0.07,0.37,0.57) + +## Busy State +[led_effect cl_busy] +leds: + neopixel:caselight +autostart: false +frame_rate: 24 +layers: + breathing 10 1 add (1.00,1.00,1.00) + static 0 0 top (1.00,0,0) + +## Heating State +[led_effect cl_heating] +leds: + neopixel:caselight +autostart: false +frame_rate: 24 +layers: + breathing 10 1 top (1.00,0.00,0.00) + +## Leveling State +[led_effect cl_leveling] +leds: + neopixel:caselight +autostart: false +frame_rate: 24 +layers: + breathing 10 1 add (1.00,1.00,1.00) + static 0 0 top (0.5,0.1,0.4) + +## Homing State +[led_effect cl_homing] +leds: + neopixel:caselight +autostart: false +frame_rate: 24 +layers: + breathing 10 1 add (1.00,1.00,1.00) + static 0 0 top (0.0, 0.6, 0.2) + +## Cleaning State +[led_effect cl_cleaning] +leds: + neopixel:caselight +autostart: false +frame_rate: 24 +layers: + breathing 10 1 add (1.00,1.00,1.00) + static 0 0 top (0.0, 0.02, 0.5) + +## Meshing State +[led_effect cl_meshing] +leds: + neopixel:caselight +autostart: false +frame_rate: 24 +layers: + breathing 10 1 add (1.00,1.00,1.00) + static 0 0 top (0.2, 1.0, 0.0) + +## Calibrating Z State +[led_effect cl_calibrating_z] +leds: + neopixel:caselight +autostart: false +frame_rate: 24 +layers: + breathing 10 1 add (1.00,1.00,1.00) + static 0 0 top (0.0, 0.0, 0.35) + +## Printing State +[led_effect cl_printing] +leds: + neopixel:caselight +autostart: false +frame_rate: 24 +layers: + breathing 120 1 add (1.00,1.00,1.00) + static 0 0 top (0.0, 0.0, 0.3), (0.0, 0.3, 0.0), (0.3, 0.0, 0.0) + +## Printing Done State +[led_effect cl_done_printing] +leds: + neopixel:caselight +autostart: false +frame_rate: 24 +layers: + strobe 0.20 0.60 subtract (1.00,0.00,1.00) + static 1.00 1.00 top (1.00,1.00,1.00) + +## Error State +[led_effect cl_error] +leds: + neopixel:caselight +autostart: false +frame_rate: 24 +layers: + strobe 1 1.5 add (1.0, 1.0, 1.0) + breathing 2 0 difference (0.95, 0.0, 0.0) + static 1 0 top (1.0, 0.0, 0.0) + +## On State +[led_effect cl_on] +leds: + neopixel:caselight +autostart: false +frame_rate: 24 +layers: + static 0 0 top (1.0, 1.0, 1.0) + +## Off State +[led_effect cl_off] +leds: + neopixel:caselight (1) +autostart: false +frame_rate: 24 +layers: + static 0 0 top (0.0, 0.0, 0.0) + +## Printer startup effect +[led_effect cl_startup] +leds: + neopixel:caselight +autostart: true +frame_rate: 24 +layers: + gradient 0.3 1 add (1.0, 0.0, 0.0),(0.0, 1.0, 0.0),(0.0, 0.0, 1.0) + +## Critical error effect +[led_effect critical_error] +leds: + neopixel:caselight +layers: + strobe 1 1.5 add (1.0, 1.0, 1.0) + breathing 2 0 difference (0.95, 0.0, 0.0) + static 1 0 top (1.0, 0.0, 0.0) +autostart: false +frame_rate: 24 +run_on_error: true diff --git a/config/hardware/lights/status_leds.cfg b/config/hardware/lights/status_leds.cfg index 09cf248f1..7494e7864 100644 --- a/config/hardware/lights/status_leds.cfg +++ b/config/hardware/lights/status_leds.cfg @@ -1,4 +1,5 @@ # Neopixel leds used on the toolhead (stealthburner style) + [gcode_macro _USER_VARIABLES] variable_status_leds_enabled: True variable_status_leds_logo_led_name: "status_leds" @@ -9,6 +10,7 @@ gcode: # Also include directly the leds control macros from here [include ../../../macros/hardware_functions/status_leds.cfg] +[include config_colors.cfg] [neopixel status_leds] diff --git a/config/hardware/lights/status_leds_effects.cfg b/config/hardware/lights/status_leds_effects.cfg new file mode 100644 index 000000000..8cf00f0e1 --- /dev/null +++ b/config/hardware/lights/status_leds_effects.cfg @@ -0,0 +1,230 @@ +# Neopixel leds used on the toolhead (stealthburner style) +# using LED_effects + +[gcode_macro _USER_VARIABLES] +variable_status_leds_enabled: True +variable_status_leds_logo_led_name: "status_leds_effects" +variable_status_leds_logo_idx: '1' +variable_status_leds_nozzle_led_name: "status_leds_effects" +variable_status_leds_nozzle_idx: '2,3' +gcode: + +# Also include directly the leds control macros from here +[include ../../../macros/hardware_functions/status_leds.cfg] +[include config_colors.cfg] + + +[neopixel status_leds] +pin: STATUS_NEOPIXEL +# The pin connected to the neopixel. This parameter must be provided. +chain_count: 3 +# The number of Neopixel chips that are "daisy chained" to the +# provided pin. The default is 1 (which indicates only a single +# Neopixel is connected to the pin). +color_order: GRBW +# Set the pixel order required by the LED hardware. Options are GRB, +# RGB, GRBW, or RGBW. The default is GRB. +initial_RED: 0.0 +initial_GREEN: 0.0 +initial_BLUE: 0.0 +initial_WHITE: 0.0 +# Sets the initial LED color of the Neopixel. Each value should be +# between 0.0 and 1.0. The WHITE option is only available on RGBW +# LEDs. The default for each color is 0.# + +######################################################### +# Define led effects for the different printer states +######################################################### +## Ready State +[led_effect sb_logo_standby] +leds: + neopixel:status_leds (1) +autostart: false +frame_rate: 24 +layers: + breathing 20 1 top (0.0, 0.0, 1.0) + +[led_effect sb_nozzle_standby] +leds: + neopixel:status_leds (2,3) +autostart: false +frame_rate: 24 +layers: + breathing 20 1 top (0.0, 0.0, 1.0) + +## Busy State +[led_effect sb_logo_busy] +leds: + neopixel:status_leds (1) +autostart: false +frame_rate: 24 +layers: + breathing 3 1 top (1,0,0) + +## Heating State +[led_effect sb_logo_heating] +leds: + neopixel:status_leds (1) +autostart: false +frame_rate: 24 +layers: + breathing 3 1 top (1,0,0) + +[led_effect sb_nozzle_heating] +leds: + neopixel:status_leds (2,3) +autostart: false +frame_rate: 24 +layers: + breathing 3 1 top (1.0, 0.18, 0.0, 0.0) + +## Leveling State +[led_effect sb_logo_leveling] +leds: + neopixel:status_leds (1) +autostart: false +frame_rate: 24 +layers: + breathing 3 1 top (0.5, 0.1, 0.4) + +## Homing State +[led_effect sb_logo_homing] +leds: + neopixel:status_leds (1) +autostart: false +frame_rate: 24 +layers: + breathing 3 1 top (0.0, 0.6, 0.2) + +## Cleaning State +[led_effect sb_logo_cleaning] +leds: + neopixel:status_leds (1) +autostart: false +frame_rate: 24 +layers: + breathing 3 1 top (0.0, 0.02, 0.5) + +## Meshing State +[led_effect sb_logo_meshing] +leds: + neopixel:status_leds (1) +autostart: false +frame_rate: 24 +layers: + breathing 3 1 top (0.2, 1.0, 0.0) + +## Calibrating Z State +[led_effect sb_logo_calibrating_z] +leds: + neopixel:status_leds (1) +autostart: false +frame_rate: 24 +layers: + breathing 3 1 top (0.0, 0.0, 0.35) + +## Printing State +[led_effect sb_logo_printing] +leds: + neopixel:status_leds (1) +autostart: false +frame_rate: 24 +layers: + gradient 0.3 1 add (0.3, 0.0, 0.0),(0.3, 0.3, 0.0),(0.3, 0.1, 0.0) + +## Printing Done State +[led_effect sb_logo_done_printing] +leds: + neopixel:status_leds (1) +autostart: false +frame_rate: 24 +layers: + strobe 0.2 0.6 add (1.00,1.00,1.00) + breathing 10.00 0.00 subtract (0.0,0.40,0.0) + static 0.00 1.00 top (0.0,1.0,0.0) + +[led_effect sb_nozzle_done_printing] +leds: + neopixel:status_leds (2,3) +autostart: false +frame_rate: 24 +layers: + strobe 0.2 0.6 add (1.00,1.00,1.00) + breathing 10.00 0.00 subtract (0.0,0.40,0.0) + static 0.00 1.00 top (0.0,1.0,0.0) + +## Error State +[led_effect sb_logo_error] +leds: + neopixel:status_leds (1) +autostart: false +frame_rate: 24 +layers: + strobe 1 1.5 add (1.0, 1.0, 1.0) + breathing 2 0 difference (0.95, 0.0, 0.0) + static 1 0 top (1.0, 0.0, 0.0) + +[led_effect sb_nozzle_error] +leds: + neopixel:status_leds (2,3) +autostart: false +frame_rate: 24 +layers: + strobe 1 1.5 add (1.0, 1.0, 1.0) + breathing 2 0 difference (0.95, 0.0, 0.0) + static 1 0 top (1.0, 0.0, 0.0) + +## On State +[led_effect sb_logo_on] +leds: + neopixel:status_leds (1) +autostart: false +frame_rate: 24 +layers: + static 0 0 top (1.0, 1.0, 1.0) + +[led_effect sb_nozzle_on] +leds: + neopixel:status_leds (2,3) +autostart: false +frame_rate: 24 +layers: + static 0 0 top (1.0, 1.0, 1.0) + +## Off State +[led_effect sb_logo_off] +leds: + neopixel:status_leds (1) +autostart: false +frame_rate: 24 +layers: + static 0 0 top (0.0, 0.0, 0.0) + +[led_effect sb_nozzle_off] +leds: + neopixel:status_leds (2,3) +autostart: false +frame_rate: 24 +layers: + static 0 0 top (0.0, 0.0, 0.0) + +## Printer startup effect +[led_effect startup] +leds: + neopixel:status_leds +autostart: true +frame_rate: 24 +layers: + gradient 0.3 1 add (1.0, 0.0, 0.0),(0.0, 1.0, 0.0),(0.0, 0.0, 1.0) + + ## Critical error effect +[led_effect critical_error] +leds: + neopixel:status_leds +layers: + strobe 1 1.5 add (1.0, 1.0, 1.0) + breathing 2 0 difference (0.95, 0.0, 0.0) + static 1 0 top (1.0, 0.0, 0.0) +autostart: false +frame_rate: 24 +run_on_error: true diff --git a/config/hardware/lights/status_leds_rainbow_barf.cfg b/config/hardware/lights/status_leds_rainbow_barf.cfg new file mode 100644 index 000000000..2463794ce --- /dev/null +++ b/config/hardware/lights/status_leds_rainbow_barf.cfg @@ -0,0 +1,33 @@ +# Neopixel leds used on the toolhead (stealthburner style) +# in a rainbow barf pattern PCB + +[gcode_macro _USER_VARIABLES] +variable_status_leds_enabled: True +variable_status_leds_logo_led_name: "status_leds" +variable_status_leds_logo_idx: '1,2,3,4,5,6,7,8' +variable_status_leds_nozzle_led_name: "status_leds" +variable_status_leds_nozzle_idx: '9,10' +gcode: + +# Also include directly the leds control macros from here +[include ../../../macros/hardware_functions/status_leds.cfg] +[include config_colors.cfg] + + +[neopixel status_leds] +pin: STATUS_NEOPIXEL +# The pin connected to the neopixel. This parameter must be provided. +chain_count: 10 +# The number of Neopixel chips that are "daisy chained" to the +# provided pin. The default is 1 (which indicates only a single +# Neopixel is connected to the pin). +color_order: GRB, GRB, GRB, GRB, GRB, GRB, GRB, GRB, GRBW, GRBW +# Set the pixel order required by the LED hardware. Options are GRB, +# RGB, GRBW, or RGBW. The default is GRB. +initial_RED: 0.0 +initial_GREEN: 0.0 +initial_BLUE: 0.0 +initial_WHITE: 0.0 +# Sets the initial LED color of the Neopixel. Each value should be +# between 0.0 and 1.0. The WHITE option is only available on RGBW +# LEDs. The default for each color is 0.# diff --git a/config/hardware/lights/status_leds_rainbow_barf_effects.cfg b/config/hardware/lights/status_leds_rainbow_barf_effects.cfg new file mode 100644 index 000000000..9221b5080 --- /dev/null +++ b/config/hardware/lights/status_leds_rainbow_barf_effects.cfg @@ -0,0 +1,230 @@ +# Neopixel leds used on the toolhead (stealthburner style) +# in a rainbow barf pattern PCB using LED_effects + +[gcode_macro _USER_VARIABLES] +variable_status_leds_enabled: True +variable_status_leds_logo_led_name: "status_leds_effects" +variable_status_leds_logo_idx: '1,2,3,4,5,6,7,8' +variable_status_leds_nozzle_led_name: "status_leds_effects" +variable_status_leds_nozzle_idx: '9,10' +gcode: + +# Also include directly the leds control macros from here +[include ../../../macros/hardware_functions/status_leds.cfg] +[include config_colors.cfg] + + +[neopixel status_leds] +pin: STATUS_NEOPIXEL +# The pin connected to the neopixel. This parameter must be provided. +chain_count: 10 +# The number of Neopixel chips that are "daisy chained" to the +# provided pin. The default is 1 (which indicates only a single +# Neopixel is connected to the pin). +color_order: GRB, GRB, GRB, GRB, GRB, GRB, GRB, GRB, GRBW, GRBW +# Set the pixel order required by the LED hardware. Options are GRB, +# RGB, GRBW, or RGBW. The default is GRB. +initial_RED: 0.0 +initial_GREEN: 0.0 +initial_BLUE: 0.0 +initial_WHITE: 0.0 +# Sets the initial LED color of the Neopixel. Each value should be +# between 0.0 and 1.0. The WHITE option is only available on RGBW +# LEDs. The default for each color is 0.# + +######################################################### +# Define led effects for the different printer states +######################################################### +## Ready State +[led_effect sb_logo_standby] +leds: + neopixel:status_leds (1-8) +autostart: false +frame_rate: 24 +layers: + breathing 20 1 top (0.0, 0.0, 1.0) + +[led_effect sb_nozzle_standby] +leds: + neopixel:status_leds (9-10) +autostart: false +frame_rate: 24 +layers: + breathing 20 1 top (0.0, 0.0, 1.0) + +## Busy State +[led_effect sb_logo_busy] +leds: + neopixel:status_leds (1-8) +autostart: false +frame_rate: 24 +layers: + breathing 3 1 top (1,0,0) + +## Heating State +[led_effect sb_logo_heating] +leds: + neopixel:status_leds (1-8) +autostart: false +frame_rate: 24 +layers: + breathing 3 1 top (1,0,0) + +[led_effect sb_nozzle_heating] +leds: + neopixel:status_leds (9-10) +autostart: false +frame_rate: 24 +layers: + breathing 3 1 top (1.0, 0.18, 0.0, 0.0) + +## Leveling State +[led_effect sb_logo_leveling] +leds: + neopixel:status_leds (1-8) +autostart: false +frame_rate: 24 +layers: + breathing 3 1 top (0.5, 0.1, 0.4) + +## Homing State +[led_effect sb_logo_homing] +leds: + neopixel:status_leds (1-8) +autostart: false +frame_rate: 24 +layers: + breathing 3 1 top (0.0, 0.6, 0.2) + +## Cleaning State +[led_effect sb_logo_cleaning] +leds: + neopixel:status_leds (1-8) +autostart: false +frame_rate: 24 +layers: + breathing 3 1 top (0.0, 0.02, 0.5) + +## Meshing State +[led_effect sb_logo_meshing] +leds: + neopixel:status_leds (1-8) +autostart: false +frame_rate: 24 +layers: + breathing 3 1 top (0.2, 1.0, 0.0) + +## Calibrating Z State +[led_effect sb_logo_calibrating_z] +leds: + neopixel:status_leds (1-8) +autostart: false +frame_rate: 24 +layers: + breathing 3 1 top (0.0, 0.0, 0.35) + +## Printing State +[led_effect sb_logo_printing] +leds: + neopixel:status_leds (1-8) +autostart: false +frame_rate: 24 +layers: + gradient 0.3 1 add (0.3, 0.0, 0.0),(0.3, 0.3, 0.0),(0.3, 0.1, 0.0) + +## Printing Done State +[led_effect sb_logo_done_printing] +leds: + neopixel:status_leds (1-8) +autostart: false +frame_rate: 24 +layers: + strobe 0.2 0.6 add (1.00,1.00,1.00) + breathing 10.00 0.00 subtract (0.0,0.40,0.0) + static 0.00 1.00 top (0.0,1.0,0.0) + +[led_effect sb_nozzle_done_printing] +leds: + neopixel:status_leds (9-10) +autostart: false +frame_rate: 24 +layers: + strobe 0.2 0.6 add (1.00,1.00,1.00) + breathing 10.00 0.00 subtract (0.0,0.40,0.0) + static 0.00 1.00 top (0.0,1.0,0.0) + +## Error State +[led_effect sb_logo_error] +leds: + neopixel:status_leds (1-8) +autostart: false +frame_rate: 24 +layers: + strobe 1 1.5 add (1.0, 1.0, 1.0) + breathing 2 0 difference (0.95, 0.0, 0.0) + static 1 0 top (1.0, 0.0, 0.0) + +[led_effect sb_nozzle_error] +leds: + neopixel:status_leds (9-10) +autostart: false +frame_rate: 24 +layers: + strobe 1 1.5 add (1.0, 1.0, 1.0) + breathing 2 0 difference (0.95, 0.0, 0.0) + static 1 0 top (1.0, 0.0, 0.0) + +## On State +[led_effect sb_logo_on] +leds: + neopixel:status_leds (1-8) +autostart: false +frame_rate: 24 +layers: + static 0 0 top (1.0, 1.0, 1.0) + +[led_effect sb_nozzle_on] +leds: + neopixel:status_leds (9-10) +autostart: false +frame_rate: 24 +layers: + static 0 0 top (1.0, 1.0, 1.0) + +## Off State +[led_effect sb_logo_off] +leds: + neopixel:status_leds (1-8) +autostart: false +frame_rate: 24 +layers: + static 0 0 top (0.0, 0.0, 0.0) + +[led_effect sb_nozzle_off] +leds: + neopixel:status_leds (9-10) +autostart: false +frame_rate: 24 +layers: + static 0 0 top (0.0, 0.0, 0.0) + +## Printer startup effect +[led_effect startup] +leds: + neopixel:status_leds +autostart: true +frame_rate: 24 +layers: + gradient 0.3 1 add (1.0, 0.0, 0.0),(0.0, 1.0, 0.0),(0.0, 0.0, 1.0) + +## Critical error effect +[led_effect critical_error] +leds: + neopixel:status_leds +layers: + strobe 1 1.5 add (1.0, 1.0, 1.0) + breathing 2 0 difference (0.95, 0.0, 0.0) + static 1 0 top (1.0, 0.0, 0.0) +autostart: false +frame_rate: 24 +run_on_error: true diff --git a/config/hardware/mmu.cfg b/config/hardware/mmu.cfg new file mode 100644 index 000000000..1df0ad5f7 --- /dev/null +++ b/config/hardware/mmu.cfg @@ -0,0 +1,15 @@ +## MMU config file +## Designed to be used with the "HappyHare" (HH) software backend by moggieuk: https://github.com/moggieuk/Happy-Hare + +[gcode_macro _USER_VARIABLES] +variable_klippain_mmu_enabled: True +gcode: + +[extruder] +max_extrude_only_distance: 200 +max_extrude_cross_section: 50.0 + + +# Also include directly the MMU macros and config from here +[include ../../mmu/base/mmu_*.cfg] +[include ../../macros/hardware_functions/mmu.cfg] diff --git a/config/machine.cfg b/config/machine.cfg index dbe821047..06e87e844 100644 --- a/config/machine.cfg +++ b/config/machine.cfg @@ -1,17 +1,13 @@ [virtual_sdcard] path: ~/printer_data/gcodes on_error_gcode: - {% set probe_type_enabled = printer["gcode_macro _USER_VARIABLES"].probe_type_enabled %} - {% if printer["gcode_macro _USER_VARIABLES"].status_leds_enabled %} STATUS_LEDS COLOR="ERROR" {% endif %} - - {% if probe_type_enabled == "dockable" %} + {% if printer["gcode_macro _USER_VARIABLES"].probe_type_enabled == "dockable" %} _PROBE_ON_ERROR_ACTION {% endif %} - -[exclude_object] + CANCEL_PRINT [idle_timeout] timeout: 1800 @@ -19,11 +15,16 @@ gcode: RESPOND MSG="Idle timeout reached" TURN_OFF_HEATERS M84 + {% if printer["gcode_macro _USER_VARIABLES"].light_enabled %} + LIGHT_OFF + {% endif %} + {% if printer["gcode_macro _USER_VARIABLES"].status_leds_enabled %} + STATUS_LEDS COLOR="OFF" + {% endif %} [pause_resume] - [display_status] - +[exclude_object] [respond] [force_move] diff --git a/config/mcu_definitions/ercf/BTT_MMB_CAN_v1.0.cfg b/config/mcu_definitions/ercf/BTT_MMB_CAN_v1.0.cfg deleted file mode 100644 index 0051ce533..000000000 --- a/config/mcu_definitions/ercf/BTT_MMB_CAN_v1.0.cfg +++ /dev/null @@ -1,29 +0,0 @@ -[board_pins ercf_manufacturer] -mcu: ercf -aliases: - MCU_MOTOR1_STEP=PB15 , MCU_MOTOR1_DIR=PB14 , MCU_MOTOR1_EN=PA8 , MCU_GEAR_MOTOR1_CS=PA10 , - MCU_MOTOR2_STEP=PD2 , MCU_MOTOR2_DIR=PB13 , MCU_MOTOR2_EN=PD1 , MCU_GEAR_MOTOR2_CS=PC7 , - MCU_MOTOR3_STEP=PD0 , MCU_MOTOR3_DIR=PD3 , MCU_MOTOR3_EN=PA15 , MCU_GEAR_MOTOR3_CS=PC6 , - MCU_MOTOR4_STEP=PB6 , MCU_MOTOR4_DIR=PB7 , MCU_MOTOR4_EN=PB5 , MCU_GEAR_MOTOR4_CS=PA9 , - MCU_SCK=PA5 , MCU_MISO=PA6 , MCU_SPI0_MOSI=PA7 , - MCU_MOTOR3_DIAG=PB9 - - # MMB STP definition - MCU_STP1=PA3 , # a.u.a. MOTOR1_DIAG - MCU_STP2=PA4 , # a.u.a. MOTOR2_DIAG - MCU_STP3=PB8 , # a.u.a. MOTOR4_DIAG - MCU_STP4=PB7 , - MCU_STP5=PC15 , - MCU_STP6=PC13 , - MCU_STP7=PC14 , - MCU_STP8=PB12 , - MCU_STP9=PB11 , - MCU_STP10=PB10 , - MCU_STP11=PB2 , - - MCU_MOT=PA0 , - MCU_SENSOR=PA1 , - MCU_RGB=PA2 , - - MCU_I2C_SDA=PB4 , - MCU_I2C_SCL=PB3 , diff --git a/config/mcu_definitions/ercf/Tircown_ERCF_easy_brd.cfg b/config/mcu_definitions/ercf/Tircown_ERCF_easy_brd.cfg deleted file mode 100644 index 0b7d46229..000000000 --- a/config/mcu_definitions/ercf/Tircown_ERCF_easy_brd.cfg +++ /dev/null @@ -1,12 +0,0 @@ -[board_pins ercf_manufacturer] -mcu: ercf -aliases: - MCU_GEAR_STEP=PA4 , MCU_GEAR_DIR=PA10 , MCU_GEAR_ENABLE=PA2 , - MCU_SELECTOR_STEP=PA9 , MCU_SELECTOR_DIR=PB8 , MCU_SELECTOR_ENABLE=PA11 , MCU_SELECTOR_DIAG=PA7, - MCU_TMCUART=PA8 , - - MCU_GEAR_STOP=PB9 , MCU_SELECTOR_STOP=PB9 , - - MCU_SERVO=PA5, - - MCU_ENCODER=PA6, diff --git a/config/mcu_definitions/main/BTT_SKR_Pro_V1.2.cfg b/config/mcu_definitions/main/BTT_SKR_Pro_V1.2.cfg new file mode 100644 index 000000000..b1576cec2 --- /dev/null +++ b/config/mcu_definitions/main/BTT_SKR_Pro_V1.2.cfg @@ -0,0 +1,52 @@ +[board_pins mcu_manufacturer] +aliases: + MCU_XM_STEP=PE9 , MCU_XM_DIR=PF1 , MCU_XM_ENABLE=PF2 , MCU_XM_TMCUART=PC13 , MCU_XM_TMCTX=PE4 , + MCU_YM_STEP=PE11 , MCU_YM_DIR=PE8 , MCU_YM_ENABLE=PD7 , MCU_YM_TMCUART=PE3 , MCU_YM_TMCTX=PE2 , + MCU_ZM_STEP=PE13 , MCU_ZM_DIR=PC2 , MCU_ZM_ENABLE=PC0 , MCU_ZM_TMCUART=PE1 , MCU_ZM_TMCTX=PE0 , + MCU_E0M_STEP=PE14 , MCU_E0M_DIR=PA0 , MCU_E0M_ENABLE=PC3 , MCU_E0M_TMCUART=PD4 , MCU_E0M_TMCTX=PD2 , + MCU_EM1_STEP=PD15 , MCU_EM1_DIR=PE7, MCU_EM1_ENABLE=PA3 , MCU_EM1_TMCUART=PD1 , MCU_EM1_TMCTX=PD0 , + MCU_EM2_STEP=PD13 , MCU_EM2_DIR=PG9, MCU_EM2_ENABLE=PF0 , MCU_EM2_TMCUART=PD6 , MCU_EM2_TMCTX=PD5 , + + + MCU_XSTOP=PB10 , MCU_YSTOP=PE12 , MCU_ZSTOP=PG8 , + MCU_E0STOP=PE15 , MCU_E1STOP=PE10 , MCU_E2STOP=PG5 , + + MCU_HEAT0=PB1 , MCU_HEAT1=PD14 , MCU_HEAT2=PB0 , + MCU_BED=PD12 , + + MCU_T0=PF3 , MCU_T1=PF4 , MCU_T2=PF5 , MCU_T3=PF6 , + + MCU_FAN0=PC8 , MCU_FAN1=PE5 , MCU_FAN2=PE6 , + + # Z-Probe Header + MCU_SERVOS=PA1 , MCU_PROBE=PA2 , + + # EXP1 header + EXP1_1=PG4 , EXP1_2=PA8 , + EXP1_3=PD11 , EXP1_4=PD10 , + EXP1_5=PG2 , EXP1_6=PG3 , # Key in the socket on other side + EXP1_7=PG6 , EXP1_8=PG7 , + EXP1_9= , EXP1_10=<5V> , + + # EXP2 header + EXP2_1=PB14 , EXP2_2=PB13 , + EXP2_3=PG10 , EXP2_4=PB12 , + EXP2_5=PF11 , EXP2_6=PB15 , # Key in the socket on other side + EXP2_7=PF12 , EXP2_8= , + EXP2_9= , EXP2_10=PF13 , + + # SPI header + MCU_SPI_MOSI=PC12 , MCU_SPI_MISO=PC11 , MCU_SPI_SCK=PC10 , MCU_SPI_CS=PA15 , + + # UART header + MCU_UART_RX3=PD9 , MCU_UART_TX3=PD8 , + + # I2C header + MCU_I2C_SDA=PB7 , MCU_I2C_SCL=PB6 , + + # I/O header + MCU_IO0=PD0 , MCU_IO1=PD2 , MCU_IO2=PD3 , MCU_IO3=PD4 , MCU_IO4=PD5 , + + # WIFI header (#_# = ROW_COL) + MCU_WIFI_1_2=PG0 , MCU_WIFI_1_3=PG1 , MCU_WIFI_1_4=PC7, + MCU_WIFI_2_1=PC6 , MCU_WIFI_2_2=PF14 , MCU_WIFI_2_3=PF15 \ No newline at end of file diff --git a/config/mcu_definitions/mmu/BTT_MMB_CAN_v1.0.cfg b/config/mcu_definitions/mmu/BTT_MMB_CAN_v1.0.cfg new file mode 100644 index 000000000..8cab0186d --- /dev/null +++ b/config/mcu_definitions/mmu/BTT_MMB_CAN_v1.0.cfg @@ -0,0 +1,23 @@ +[board_pins mmu_manufacturer] +mcu: mmu +aliases: + MCU_M1_STEP=PB15 , MCU_M1_DIR=PB14 , MCU_M1_EN=PA8 , MCU_M1_UART=PA10 , # MCU_M1_DIAG=PA3 , + MCU_M2_STEP=PD2 , MCU_M2_DIR=PB13 , MCU_M2_EN=PD1 , MCU_M2_UART=PC7 , # MCU_M2_DIAG=PA4 , + MCU_M3_STEP=PD0 , MCU_M3_DIR=PD3 , MCU_M3_EN=PA15 , MCU_M3_UART=PC6 , MCU_M3_DIAG=PB9 , + MCU_M4_STEP=PB6 , MCU_M4_DIR=PB7 , MCU_M4_EN=PB5 , MCU_M4_UART=PA9 , # MCU_M4_DIAG=PB8 , + + MCU_MISO=PA6 , MCU_SCK=PA5 , MCU_MOSI=PA7 , + + MCU_STP1=PA3 , MCU_STP2=PA4 , MCU_STP3=PB8 , # Shared with Steppers Diag pins 1-2-4 so it's better to use STP 4-11 for others servos/sensors + MCU_STP4=PB7 , MCU_STP5=PC15 , MCU_STP6=PC13 , MCU_STP7=PC14 , MCU_STP8=PB12 , MCU_STP9=PB11 , MCU_STP10=PB10 , MCU_STP11=PB2 , + + + MCU_MOT=PA0 , + MCU_SENSOR=PA1 , + MCU_RGB=PA2 , + + ## I2C header + MCU_I2C_SDA=PB4 , MCU_I2C_SCL=PB3 , + + ## SWD header + MCU_SWD_PA14=PA14 , MCU_SWD_PA13=PA13 , diff --git a/config/mcu_definitions/mmu/BTT_SKR_Pico_v1.0.cfg b/config/mcu_definitions/mmu/BTT_SKR_Pico_v1.0.cfg new file mode 100644 index 000000000..113022ac9 --- /dev/null +++ b/config/mcu_definitions/mmu/BTT_SKR_Pico_v1.0.cfg @@ -0,0 +1,25 @@ +[board_pins mmu_manufacturer] +mcu: mmu +aliases: + MCU_X_STEP=gpio11 , MCU_X_DIR=gpio10 , MCU_X_EN=gpio12 , + MCU_Y_STEP=gpio6 , MCU_Y_DIR=gpio5 , MCU_Y_EN=gpio7 , + MCU_Z_STEP=gpio19 , MCU_Z_DIR=gpio28 , MCU_Z_EN=gpio2 , + MCU_E0_STEP=gpio14 , MCU_E0_DIR=gpio13 , MCU_E0_EN=gpio15 , + MCU_TMCUART=gpio9 , MCU_TMCTX=gpio8 , + + MCU_X-STOP=gpio4 , MCU_Y-STOP=gpio3 , MCU_Z-STOP=gpio25 , + MCU_E0-STOP=gpio16 , + + MCU_HE=gpio23 , + MCU_HB=gpio21 , + + MCU_TH0=gpio27 , + MCU_THB=gpio26 , + + MCU_FAN1=gpio17 , MCU_FAN2=gpio18 , MCU_FAN3=gpio20 , + + MCU_SERVOS=gpio29 , + + MCU_PROBE=gpio22 , + + MCU_RGB=gpio24 , diff --git a/config/mcu_definitions/ercf/Fysetc_ERCF_ERB.cfg b/config/mcu_definitions/mmu/Fysetc_ERCF_ERB.cfg similarity index 90% rename from config/mcu_definitions/ercf/Fysetc_ERCF_ERB.cfg rename to config/mcu_definitions/mmu/Fysetc_ERCF_ERB.cfg index 410032d1d..c19425156 100644 --- a/config/mcu_definitions/ercf/Fysetc_ERCF_ERB.cfg +++ b/config/mcu_definitions/mmu/Fysetc_ERCF_ERB.cfg @@ -1,10 +1,9 @@ -[board_pins ercf_manufacturer] -mcu: ercf +[board_pins mmu_manufacturer] +mcu: mmu aliases: MCU_GEAR_MOTOR_STEP=gpio10 , MCU_GEAR_MOTOR_DIR=gpio9 , MCU_GEAR_MOTOR_EN=gpio8 , MCU_GEAR_MOTOR_UART=gpio20 , - MCU_SELECTOR_MOTOR_STEP=gpio16 , MCU_SELECTOR_MOTOR_DIR=gpio15 , MCU_SELECTOR_MOTOR_EN=gpio14 , MCU_SELECTOR_MOTOR_UART=gpio17 , - MCU_GEAR_MOTOR_DIAG=gpio13 , + MCU_SELECTOR_MOTOR_STEP=gpio16 , MCU_SELECTOR_MOTOR_DIR=gpio15 , MCU_SELECTOR_MOTOR_EN=gpio14 , MCU_SELECTOR_MOTOR_UART=gpio17 , MCU_SELECTOR_MOTOR_DIAG=gpio19 , MCU_HALL_SENSOR=gpio25 , @@ -19,4 +18,4 @@ aliases: MCU_I2C1_SDA=gpio6 , MCU_I2C1_SCL=gpio7 , MCU_ADC0=gpio26 , MCU_ADC1=gpio27 , MCU_ADC2=gpio28 , MCU_ADC3=gpio29 , - GND= , 5V=<5V> , + GND= , 5V=<5V> , diff --git a/config/mcu_definitions/ercf/Mellow_fly_ERCF.cfg b/config/mcu_definitions/mmu/Mellow_fly_ERCF.cfg similarity index 58% rename from config/mcu_definitions/ercf/Mellow_fly_ERCF.cfg rename to config/mcu_definitions/mmu/Mellow_fly_ERCF.cfg index d5494105d..858160cb0 100644 --- a/config/mcu_definitions/ercf/Mellow_fly_ERCF.cfg +++ b/config/mcu_definitions/mmu/Mellow_fly_ERCF.cfg @@ -1,5 +1,5 @@ -[board_pins ercf_manufacturer] -mcu: ercf +[board_pins mmu_manufacturer] +mcu: mmu aliases: MCU_GEAR_STEP=gpio7 , MCU_GEAR_DIR=gpio8 , MCU_GEAR_EN=gpio6 , MCU_GEAR_UART=gpio9 , MCU_GEAR_DIAG=gpio23 , @@ -13,10 +13,10 @@ aliases: MCU_MISO=gpio16 , MCU_MOSI=gpio18 , MCU_SCK=gpio19 , - GND= , GND= , - 3.3V=<3.3V> , 3.3V=<3.3V> , - MCU_P26=gpio26 , MCU_P10=gpio10 , - MCU_P27=gpio27 , MCU_P11=gpio11 , - MCU_P28=gpio28 , MCU_P12=gpio12 , - MCU_P29=gpio29 , MCU_P24=gpio24 , - MCU_P25=gpio25 , MCU_P13=gpio13 , + GND= , GND= , + 3.3V=<3.3V> , 3.3V=<3.3V> , + MCU_IO26=gpio26 , MCU_IO10=gpio10 , + MCU_IO27=gpio27 , MCU_IO11=gpio11 , + MCU_IO28=gpio28 , MCU_IO12=gpio12 , + MCU_IO29=gpio29 , MCU_IO24=gpio24 , + MCU_IO25=gpio25 , MCU_IO13=gpio13 , diff --git a/config/mcu_definitions/mmu/Tircown_ERCF_easy_brd.cfg b/config/mcu_definitions/mmu/Tircown_ERCF_easy_brd.cfg new file mode 100644 index 000000000..08cbb16cd --- /dev/null +++ b/config/mcu_definitions/mmu/Tircown_ERCF_easy_brd.cfg @@ -0,0 +1,12 @@ +[board_pins mmu_manufacturer] +mcu: mmu +aliases: + MCU_GEAR_STEP=PA4 , MCU_GEAR_DIR=PA10 , MCU_GEAR_ENABLE=PA2 , + MCU_SELECTOR_STEP=PA9 , MCU_SELECTOR_DIR=PB8 , MCU_SELECTOR_ENABLE=PA11 , MCU_SELECTOR_DIAG=PA7, + MCU_TMCUART=PA8 , + + MCU_SELECTOR_STOP=PB9 , + + MCU_SERVO=PA5, + + MCU_ENCODER=PA6, diff --git a/config/software/spoolman.cfg b/config/software/spoolman.cfg new file mode 100644 index 000000000..387550718 --- /dev/null +++ b/config/software/spoolman.cfg @@ -0,0 +1,6 @@ +[gcode_macro _USER_VARIABLES] +variable_spoolman_enabled: True +gcode: + +# Automatically include the spoolman macros +[include ../../macros/helpers/spoolman.cfg] diff --git a/docs/configuration.md b/docs/configuration.md index 181fce681..82886ba82 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -2,10 +2,9 @@ Klippain requires a few simple steps to configure and customize it for your printer: please follow the following documentation step by step in order to get your printer running. - > **Warning** + > **Warning**: > - > General rule to keep the auto-update feature working: **never modify Klippain files directly**, but instead add overrides as per the following documentation. To proceed, you can modify all the pre-installed templates in your config root folder (`printer.cfg`, `mcu.cfg`, `variables.cfg` and `overrides.cfg`) as they will be preserved on update. - + > General rule to keep the auto-update feature working: **never modify Klippain files directly**, but instead add overrides as per the following documentation. To proceed, you can modify all the pre-installed templates in your config root folder (`printer.cfg`, `mcu.cfg`, `variables.cfg` and `overrides.cfg` and, if applicable, the MMU configs files in the `mmu` directory created when you install Happy-Hare) as they will be preserved on update. ## 1. MCU Settings @@ -13,42 +12,51 @@ Before configuring Klippain, you will need to configure your MCUs and wiring. If Don't forget to fill in the serial_port or can_uuid of your MCUs. Refer to the [official Klipper documentation](https://www.klipper3d.org/FAQ.html#wheres-my-serial-port) for help. - ## 2. Printer Settings, Overrides, and Variables Don't overlook, this section is the most important. Now that your MCU is configured, you will need to follow some additionnal steps to configure Klippain: + 1. In `printer.cfg`, uncomment lines corresponding to your printer hardware or software components to enable them (e.g., extruder type, XY motors, Z motors, QGL vs Z_TILT, etc.). 1. Then, edit `overrides.cfg` according to the [overrides documentation and examples](./overrides.md). Use overrides to tweak machine dimensions, invert motor directions, change axis limits, currents, sensors type, or anything you feel the need to change. 1. Once Klipper boots successfully, adjust the `variables.cfg` file to match your machine's configuration. This file provides additional customization for macro behavior (coordinates, enabling/disabling software features, etc.). > **Note**: > - > If you plan to use an ERCF, Klippain is only compatible with the [Happy Hare](https://github.com/moggieuk/ERCF-Software-V3) software backend. - > Enable the ERCF lines in Klippain's `printer.cfg` and then install Happy Hare directly by following its official documention. **When the Happy Hare installer ask if you want to include all the ERCF files into your printer.cfg: answer no** as everything is already included in Klippain! - + > If you want to use an MMU/ERCF with Klippain, you need to install the [HappyHare](https://github.com/moggieuk/Happy-Hare) backend. Also, have a look at the Klippain [MMU documentation](./docs/mmu.md) for more specific details about its configuration. ## 3. Initial startup of the machine Before your first print, **carefully check all features to prevent issues on your machine!** Begin with the [config checks section from the official Klipper documentation](https://www.klipper3d.org/Config_checks.html). -Next, ensure the mechanical probe (if used) can be attached/detached, verify that QGL/Z_TILT works, and confirm correct coordinates for all components (purge bucket, physical Z endstop, etc.). Check your first layer calibration (and the `switch_offset` parameter of the automatic Z calibration plugin, if used), etc. +Next, ensure the mechanical probe (if used) can be attached/detached, verify that QGL/Z_TILT works, and confirm correct coordinates for all components (purge bucket, physical Z endstop, etc.). Check your first layer calibration (and the `switch_offset` parameter of the automatic Z calibration plugin, if used), etc... -Then, add this custom print start G-code to your slicer (example for SuperSlicer): -``` -START_PRINT EXTRUDER_TEMP={first_layer_temperature[initial_extruder] + extruder_temperature_offset[initial_extruder]} BED_TEMP=[first_layer_bed_temperature] MATERIAL=[filament_type] SIZE={first_layer_print_min[0]}_{first_layer_print_min[1]}_{first_layer_print_max[0]}_{first_layer_print_max[1]} INITIAL_TOOL={initial_extruder} -``` +## 4. Slicer configuration + +Klippain will work out of the box with most slicers on the market and your profiles should be almost ready to go. You will just need to set some custom start print and end print gcodes to give Klippain the correct info. -There is also a couple of other optionnal parameters that are supported in Klippain (they need to be added on the same one line following the other parameters): - - `CHAMBER=[chamber_temperature]` to be able to specify a target heatsoak temperature for the START_PRINT sequence - - `TOTAL_LAYER=[total_layer_count]` to be able to set the PRINT_STATS_INFOS in Klipper. If using this, you will need to add on your slicer custom layer change gcode the appropriate `SET_PRINT_STATS_INFO CURRENT_LAYER={layer_num}` +### Custom print start Gcode -Finally, add custom print end G-code to your slicer: +| Slicer | Custom start print gcode | +|:-------|:-------------------------| +|[SuperSlicer](https://github.com/supermerill/SuperSlicer)|`START_PRINT EXTRUDER_TEMP={first_layer_temperature[initial_extruder] + extruder_temperature_offset[initial_extruder]} BED_TEMP=[first_layer_bed_temperature] MATERIAL=[filament_type] SIZE={first_layer_print_min[0]}_{first_layer_print_min[1]}_{first_layer_print_max[0]}_{first_layer_print_max[1]} INITIAL_TOOL={initial_extruder}`| +|[OrcaSlicer](https://github.com/SoftFever/OrcaSlicer)|`START_PRINT EXTRUDER_TEMP=[nozzle_temperature_initial_layer] BED_TEMP=[bed_temperature_initial_layer_single] MATERIAL=[filament_type] SIZE={first_layer_print_min[0]}_{first_layer_print_min[1]}_{first_layer_print_max[0]}_{first_layer_print_max[1]} INITIAL_TOOL=[initial_tool]`| +|[PrusaSlicer](https://github.com/prusa3d/PrusaSlicer)|`START_PRINT EXTRUDER_TEMP={first_layer_temperature[initial_extruder]} BED_TEMP=[first_layer_bed_temperature] MATERIAL=[filament_type] SIZE={first_layer_print_min[0]}_{first_layer_print_min[1]}_{first_layer_print_max[0]}_{first_layer_print_max[1]} INITIAL_TOOL={initial_extruder}`| + +In addition, there are a few other optional parameters that are supported in Klippain (they must be added on the same line after the first parameters): + - `CHAMBER=[chamber_temperature]` *(for SuperSlicer and OrcaSlicer)* or `CHAMBER=[idle_temperature]` *(for PrusaSlicer)* to set a target heatsoak temperature during the START_PRINT sequence. + - `TOTAL_LAYER=[total_layer_count]` to be able to set the PRINT_STATS_INFOS in Klipper. If you use this, you will also need to add the corresponding `SET_PRINT_STATS_INFO CURRENT_LAYER={layer_num}` to your slicer custom layer change gcode. + - `TOOLS_USED=!referenced_tools!` *(only for MMU users)* is highly recommended to check only the used tools with the HappyHare [Moonraker gcode preprocessor](https://github.com/moggieuk/Happy-Hare/blob/main/doc/gcode_preprocessing.md). + - `CHECK_GATES=0` or `1` *(only for MMU users)* that will override the corresponding variable defined in Klippain `variables.cfg` for this specific print. + - `SYNC_MMU_EXTRUDER=1` *(only for MMU users)* if you want to stay with the default `sync_to_extruder: 0` value of HappyHare (defined in `mmu/mmu_parameters.cfg`), but still want to use the sync for a specific print. + + +### Custom print start Gcode + +All slicers will be happy with a simple: ``` END_PRINT ``` - > **Note** for ERCF users: - > - > By default, Klippain unloads the filament at the end of the print, but you can change the default behavior by modifying the variable `variable_ercf_unload_on_end_print` in your `variables.cfg` file. - > You can also specify the wanted behavior directly in your slicer end print custom gcode by using `END_PRINT ERCF_UNLOAD_AT_END=0`. - +In addition, there are a few other optional parameters that are supported in Klippain (they must be added on the same line after the first parameters): + - `FILTER_TIME=600` that will override the corresponding variable defined in Klippain `variables.cfg` for this specific print. Time is expressed in seconds. + - `MMU_UNLOAD_AT_END=0` or `1` *(only for MMU users)* that will override the corresponding variable defined in Klippain `variables.cfg`. diff --git a/docs/features/adaptive_bed_mesh.md b/docs/features/adaptive_bed_mesh.md index 699defa7e..5ceae934c 100644 --- a/docs/features/adaptive_bed_mesh.md +++ b/docs/features/adaptive_bed_mesh.md @@ -50,7 +50,7 @@ If you want to install it to your own custom config, here is the way to go: PRINT_START [all your own things...] SIZE=%MINX%_%MINY%_%MAXX%_%MAXY% ``` -> Please note that using the `[exclude_object]` tags (method 1) is a little bit less precise than using the original "SIZE" parameter (method 2) as the `[exclude_object]` tags are using the full parts sizes (not only the first layer). So if you do a part with large overhangs, it will do a large mesh using the tags but will only mesh the base of the part with the SIZE parameter. Also, if you add a skirt around the parts or use a purge tower (like ERCF users), there is no tags associated to this and the mesh can be a little bit smaller and lead to bad adhesion of these objects. So my advice is: use the [exclude_object] tags method for a new installation as it's much more easier to install. But if you are updating from an older version of the macro or use an ERCF, use the SIZE parameter! +> Please note that using the `[exclude_object]` tags (method 1) is a little bit less precise than using the original "SIZE" parameter (method 2) as the `[exclude_object]` tags are using the full parts sizes (not only the first layer). So if you do a part with large overhangs, it will do a large mesh using the tags but will only mesh the base of the part with the SIZE parameter. Also, if you add a skirt around the parts or use a purge tower (like MMU/ERCF users), there is no tags associated to this and the mesh can be a little bit smaller and lead to bad adhesion of these objects. So my advice is: use the [exclude_object] tags method for a new installation as it's much more easier to install. But if you are updating from an older version of the macro or use an MMU, use the SIZE parameter! 3. In klipper, if it's not already the case, add and configure a `[bed_mesh]` for your machine. This will be the base on which my macro compute the new adaptive bed mesh. Keep in mind that you can (and should) push the precision a little bit further: do not hesistate to go with a mesh of 9x9 (or even more) as with my adaptive bed mesh, not all the points will be probed for smaller parts. diff --git a/docs/images/mmu/HHv2_error_tmc.png b/docs/images/mmu/HHv2_error_tmc.png new file mode 100644 index 000000000..d0ec224cf Binary files /dev/null and b/docs/images/mmu/HHv2_error_tmc.png differ diff --git a/docs/images/mmu/HHv2_mcu_tmc.png b/docs/images/mmu/HHv2_mcu_tmc.png new file mode 100644 index 000000000..d28611758 Binary files /dev/null and b/docs/images/mmu/HHv2_mcu_tmc.png differ diff --git a/docs/images/mmu/HHv2emptygate.png b/docs/images/mmu/HHv2emptygate.png new file mode 100644 index 000000000..67f1374a1 Binary files /dev/null and b/docs/images/mmu/HHv2emptygate.png differ diff --git a/docs/mmu.md b/docs/mmu.md new file mode 100644 index 000000000..53f57c112 --- /dev/null +++ b/docs/mmu.md @@ -0,0 +1,104 @@ +# MMU Configuration in Klippain + +Klippain is fully compatible with Multi-Material Units (MMU) and leverages the [HappyHare](https://github.com/moggieuk/Happy-Hare) software backend for an easy and effective use of them. + +This documentation outlines the procedures for setting up and operate an MMU within Klippain. It includes instructions on proper usage and troubleshooting common issues. + + +## Installing HappyHare + + > **Note**: + > + > If you were using the previous ERCF-Software-V3, move your old `ercf_***.cfg` files in a safe place for future reference and then uninstall it completely by running `~/ERCF-Software-V3/install.sh -u && rm -rf ~/ERCF-Software-V3`. + +Follow these steps to install the latest HappyHare: + +```bash +cd ~ +git clone https://github.com/moggieuk/Happy-Hare.git +cd Happy-Hare +./install.sh -i +``` + +Klippain requires a few simple steps to configure and customize it for your printer, if you haven't already followed the [configuration guide](./configuration.md), please do so first. + +Finally, enable Klippain's MMU feature by uncommenting the corresponding line in your `printer.cfg`. Don't forget to have a look at the HappyHare config files in the `mmu` folder at the root of your config. + + +## Configuration Tips + +HappyHare is a software with a lot of features and you should first have a look at how it works and its concepts [here](https://github.com/moggieuk/Happy-Hare?tab=readme-ov-file#---readme-table-of-contents) and its documentation section [here](https://github.com/moggieuk/Happy-Hare/tree/main/doc). On top of this, Klippain define a couple of things a bit differently to allow more flexibility and a better integration with it. + +### Check gates on START_PRINT + +If you want to check the gates at the start of a print to avoid an error when using a gate that was previously marked as empty, it is recommended to set `variable_mmu_check_gates_on_start_print: True` in your Klippain `variables.cfg`. + + > **Note**: + > + > Be sure to also include `TOOLS_USED=!referenced_tools!` in your slicer custom start print gcode in order to allow the [HappyHare Moonraker gcode preprocessor](https://github.com/moggieuk/Happy-Hare/blob/main/doc/gcode_preprocessing.md) to work correctly and and to ensure that all tools are checked. + +### Early check errors during START_PRINT + +In Klippain, you have two options to control how and when MMU errors are detected during the start of a print: + + 1. **Managed by Klippain**: This allows the system to check for errors during the sequence and, if errors are detected, to stop the sequence immediately so that you can troubleshoot the MMU. However, you'll need to restart the print after the MMU problems are fixed. + To enable this mode, set `variable_mmu_check_gates_on_start_print: True` in your Klippain `variables.cfg`. Note that when this is set, the original `print_start_detection` parameter of HH will have no effect, as Klippain will take over the management of MMU state changes. + + 1. **Managed by HappyHare**: This allows HappyHare to automatically detect the start and end of a print. However, if an MMU error occurs, the system will only pause at the very end of the START_PRINT sequence, meaning you'll have to wait until then to fix any MMU problems. However, once the problem is resolved, you can resume printing, provided you have been able to manually purge, clean, and prepare the nozzle for printing. + To enable this mode, set `variable_mmu_check_gates_on_start_print: False` in your Klippain `variables.cfg` to allow HappyHare to take care of this and set its `print_start_detection` parameter to your liking. + +Using these parameters, you can choose to detect errors early and stop printing immediately for faster troubleshooting, or you can stick with the default mode, which stops printing at the end of the START_PRINT sequence for error handling. The choice depends entirely on your preferences and how you want to handle MMU errors during printing. + +### Difference between GATE and TOOL + + - **GATE** refers to the physical MMU slot + - **TOOL** refers to the virtual tool (or filament) used in software. The one you can call using the `Tx` command. + +By default, as you can see with the `MMU_REMAP_TTG` command in HappyHare, GATE and TOOL are mapped equivalently one by one. But you can use the same command to change this mapping like this: `MMU_REMAP_TTG TOOL=x GATE=y`. + +This feature is particularly useful if you have already sliced a project with certain tools defined in the slicer and want to reprint it after moving the filament spools to different gates, or with different filament colors without having to reorganize the spool positions or reslice your project. For more information, please look at the official HappyHare [Tool-to-Gate (TTG) mapping documentation](https://github.com/moggieuk/Happy-Hare?tab=readme-ov-file#3-tool-to-gate-ttg-mapping). + +### Using Bypass + +If you want to print without using the MMU features, you can use the MMU bypass mode. Here is how to use it: + 1. Home the MMU by running `MMU_HOME FORCE_UNLOAD=1`. + 1. Select the bypass mode with `MMU_SELECT_BYPASS`. + 1. Finally, manually insert the filament into the bowden tube up to the extruder gears and load the filament with the `MMU_LOAD` command or start the print (the `START_PRINT` sequence will automatically try to load the filament into the toolhead). + +At the end of the print, you can use the `MMU_EJECT` command (if `variable_mmu_unload_on_end_print` is set to False in Klippain `variables.cfg`, otherwise it is ejected automatically) to unload the filament from the extruder and then manually pull it out of the bowden tube. + +### Spoolman support with MMU + +HappyHare can natively handle spool changes in Spoolman. This requires some configuration in the `mmu/mmu_parameters.cfg` file: + 1. Set `enable_spoolman:1` to enable spoolman support in HH. + 1. Then configure the spool IDs using the `gate_spool_id:` variable. + +You can also use the `MMU_GATE_MAP GATE=n SPOOLID=id` macro at runtime to change the spool ID associated with a gate. + + > **Note**: + > + > If you set the `INITIAL_TOOL` parameter in your slicer custom start gcode, Klippain will use it to select and activate the correct spool from Spoolman for the print. + + +## MMU error messages in Klippain + +### Variable check error + +``` +MMU support is enabled in Klippain, but some variables are missing from your variables.cfg. Please update your template or refer to the corresponding documentation: https://github.com/Frix-x/klippain/blob/main/docs/mmu.md +``` + +If you have the previous message in the console when Klippain is starting, you will want to update your Klippain `variables.cfg` template file or check that the MMU variables are set correctly in it: + - `variable_mmu_force_homing_in_start_print`: True or False + - `variable_mmu_unload_on_cancel_print`: True or False + - `variable_mmu_unload_on_end_print`: True or False + - `variable_mmu_check_gates_on_start_print`: True or False + - `variable_mmu_check_errors_on_start_print`: True or False + +### Empty gate error + +![](./images/mmu/HHv2emptygate.png) + +If you encounter an error despite the gate being loaded correctly, it's often because the gate was previously marked as empty and hasn't had its status updated. To resolve this during a print, for instance, you can use the command `MMU_GATE_MAP GATE=n AVAILABLE=1`. + +It's a best practice to verify the state of each gate after changing filaments. Use the `MMU_GATE_MAP` command to ensure your setup is accurate. Additionally, the `MMU_CHECK_GATE` command allows you to update the status for all MMU gates. If you need to update specific gates or tools, you can use commands like `MMU_CHECK_GATE TOOLS=0,2,5` to check and update tools 0, 2, and 5, or `MMU_CHECK_GATE GATES=0,2,5` for gates 0, 2, and 5, respectively. diff --git a/docs/pinout.md b/docs/pinout.md index 21b79a5b1..2501a75b6 100644 --- a/docs/pinout.md +++ b/docs/pinout.md @@ -2,24 +2,25 @@ In Klipper, once a `[board_pins]` is defined, the aliases are used in all sections to make them more readable ([official board_pins Klipper documentation](https://www.klipper3d.org/Config_Reference.html#board_pins)). I use this mechanism extensively on a two-level model to add genericity and simplify the MCU configuration for everyone. - ## Configuring your mcu.cfg file 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. To summarize, we have two board_pins used for each MCU. One user board_pins and one manufacturer board_pins. They link the following: + ``` 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! - > **Info** + > **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 If you want to use a new MCU that is not yet supported in my config, you just have to define a new [board_pins] in your `mcu.cfg` file and use the same convention. Also feel free to also add a manufacturer board_pins to my config and submit a PR: I'll be happy to merge it and extend MCU support for new boards :) @@ -27,46 +28,57 @@ If you want to use a new MCU that is not yet supported in my config, you just ha Here is a list of all the "Frix-x names" available to use in your own board_pins: #### Steppers + - `[EXYZ1-3]_STEP`: drivers step pins - `[EXYZ1-3]_DIR`: drivers dir pins - `[EXYZ1-3]_ENABLE`: drivers enable pins - `[EXYZ1-3]_TMCUART`: drivers UART pins - - Beside standard axis there is also the support for the `GEAR_...` and `SELECTOR_...` drivers used in the ERCF + - `DRIVER_SPI_MOSI`, `DRIVER_SPI_MISO`, `DRIVER_SPI_SCK`: used in case of SPI drivers + - Beside standard axis there is also the support for the `MMU_GEAR_...` and `MMU_SEL_...` drivers used in the MMU/ERCF/TRADRACK #### Endstops & Probe + - `[XYZ]_STOP`: classic axis endstops pins - - `PROBE_INPUT`: classical probe like Klicky, Omron, Pinda, TAP, etc... + - `PROBE_INPUT`: classical probe input like Klicky, Omron, Pinda, TAP, etc... + - `MMU_SEL_ENDSTOP`: for the MMU/ERCF physical selector endstop + +#### Heaters -#### Heaters - `E_HEATER`: hotend heater cartridge - `BED_HEATER`: bed heating pad (or bed SSR) #### Temperature sensors + - `E_TEMPERATURE`: hotend temperature sensor - `BED_TEMPERATURE`: bed temperature sensor - - `CHAMBER_TEMPERATURE`: chamber temperature sensor + - `CHAMBER_TEMPERATURE`: chamber temperature sensor (used to heatsoak the chamber during the START_PRINT sequence) - `ELECTRICAL_CABINET_TEMPERATURE`: electrical cabinet temperature sensor (not really used in the config, but if present, this sensor is added to the Mainsail / Fluidd web interface as an additional info) #### Fans + - `E_FAN`: hotend fan. This fan should stay at 100% whenever the hotend is hot, so a PWM capable pin is not mandatory - - `PART_FAN`: part fan used during the print. This pin should be a PWM capable pin to allow power modulation - - `EXHAUST_FAN`: for an exhaust filter (such as the Voron basic exhaust). This pin should be a PWM capable pin to allow power modulation - - `FILTER_FAN`: for a filter (such as a Nevermore filter). This pin should be a PWM capable pin to allow power modulation + - `PART_FAN`: part fan used during the print. This pin should be a PWM capable pin to allow modulation of the fan speed + - `EXHAUST_FAN`: for an exhaust filter (such as the Voron basic exhaust). This pin should be a PWM capable pin to allow modulation of the fan speed + - `FILTER_FAN`: for a filter (such as a Nevermore filter). This pin should be a PWM capable pin to allow modulation of the fan speed - `CONTROLLER_FAN`: to cool down your MCUs or electronic bay - `HOST_CONTROLLER_FAN`: to cool down your Pi (or equivalent Klipper host controller) #### Lights + - `LIGHT_OUTPUT`: simple chamber lights (such as 24v leds or 24v fcob light bars) - - `LIGHT_NEOPIXEL` : neopixel chamber lights - - `STATUS_NEOPIXEL` : toolhead neopixel lights (such as the one used on the Voron StealthBurner toolhead) + - `LIGHT_NEOPIXEL` : neopixels chamber lights + - `STATUS_NEOPIXEL` : toolhead/machine status led neopixels (such as the one used on the Voron StealthBurner toolhead) + - `MMU_NEOPIXEL`: for the specific MMU/ERCF neopixel leds #### Other I/Os - - `RUNOUT_SENSOR`: filament motion sensor - - `ERCF_ENCODER`: filament motion sensor used in the ERCF carriage - - `TOOLHEAD_SENSOR`: toolhead filament sensor used for the ERCF - - `SERVO_PIN`: for a mechanical and movable probe dock or brush (such as the ones that are commonly found on the Voron V0 mods) - - `ERCF_SERVO`: for a the ERCF servo + - `RUNOUT_SENSOR`: filament runout sensor (currently only one motion or switch sensor is supported in Klippain) + - `MMU_ENCODER`: filament motion sensor used in the MMU/ERCF carriage + - `TOOLHEAD_SENSOR`: optional toolhead filament sensor used for the MMU/ERCF/TRADRACK + - `SERVO_PIN`: for a mechanical and movable probe dock or brush (such as the ones that are commonly found on the Voron V0 mods) + - `MMU_SERVO`: for the MMU servo + - `MMU_GATE_SENSOR`: for the MMU/TRADRACK gate sensor + - `MMU_PRE_GATE_[0-11]`: for the MMU/ERCT sensors ## External references @@ -78,4 +90,4 @@ For more information on the boards and pinouts, please see directly the manufact - [Fly SHT](https://mellow.klipper.cn/#/board/fly_sht36_42/) - [BTT EBB](https://github.com/bigtreetech/EBB) - [BTT SKR Mini E3](https://github.com/bigtreetech/BIGTREETECH-SKR-mini-E3) - - [Fysetc S6](https://github.com/FYSETC/FYSETC-S6) \ No newline at end of file + - [Fysetc S6](https://github.com/FYSETC/FYSETC-S6) diff --git a/install.sh b/install.sh index 46a3ceb0c..a551732ad 100755 --- a/install.sh +++ b/install.sh @@ -26,6 +26,8 @@ FRIX_CONFIG_PATH="${HOME}/klippain_config" BACKUP_PATH="${HOME}/klippain_config_backups" # Where the Klipper folder is located (ie. the internal Klipper firmware machinery) KLIPPER_PATH="${HOME}/klipper" +# Branch from Frix-x/klippain repo to use during install (default: main) +FRIX_BRANCH="main" set -eu @@ -73,10 +75,11 @@ function check_download { local frixtemppath frixreponame frixtemppath="$(dirname ${FRIX_CONFIG_PATH})" frixreponame="$(basename ${FRIX_CONFIG_PATH})" + frixbranchname="${FRIX_BRANCH}" if [ ! -d "${FRIX_CONFIG_PATH}" ]; then echo "[DOWNLOAD] Downloading Klippain repository..." - if git -C $frixtemppath clone https://github.com/Frix-x/klippain.git $frixreponame; then + if git -C $frixtemppath clone -b $frixbranchname https://github.com/Frix-x/klippain.git $frixreponame; then chmod +x ${FRIX_CONFIG_PATH}/install.sh printf "[DOWNLOAD] Download complete!\n\n" else @@ -141,7 +144,7 @@ function install_config { # Helper function to ask and install the MCU templates if needed function install_mcu_templates { - local install_template file_list main_template install_toolhead_template toolhead_template install_ercf_template + local install_template file_list main_template install_toolhead_template toolhead_template install_mmu_template read < /dev/tty -rp "[CONFIG] Would you like to select and install MCU wiring templates files? (Y/n) " install_template if [[ -z "$install_template" ]]; then @@ -204,33 +207,33 @@ function install_mcu_templates { fi fi - # Finally see if the user use an ERCF board - 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" + # Finally see if the user use an MMU/ERCF board + read < /dev/tty -rp "[CONFIG] Do you have an MMU/ERCF MCU and want to install a template? (y/N) " install_mmu_template + if [[ -z "$install_mmu_template" ]]; then + install_mmu_template="n" fi - install_ercf_template="${install_ercf_template,,}" + install_mmu_template="${install_mmu_template,,}" - # Check if the user wants to install an ERCF MCU template - if [[ "$install_ercf_template" =~ ^(yes|y)$ ]]; then + # Check if the user wants to install an MMU/ERCF MCU template + if [[ "$install_mmu_template" =~ ^(yes|y)$ ]]; then file_list=() while IFS= read -r -d '' file; do file_list+=("$file") - done < <(find "${FRIX_CONFIG_PATH}/user_templates/mcu_defaults/ercf" -maxdepth 1 -type f -print0) - echo "[CONFIG] Please select your ERCF MCU in the following list:" + done < <(find "${FRIX_CONFIG_PATH}/user_templates/mcu_defaults/mmu" -maxdepth 1 -type f -print0) + echo "[CONFIG] Please select your MMU/ERCF MCU in the following list:" for i in "${!file_list[@]}"; do echo " $((i+1))) $(basename "${file_list[i]}")" done - read < /dev/tty -p "[CONFIG] Template to install (or 0 to skip): " ercf_template - if [[ "$ercf_template" -gt 0 ]]; then + read < /dev/tty -p "[CONFIG] Template to install (or 0 to skip): " mmu_template + if [[ "$mmu_template" -gt 0 ]]; then # If the user selected a file, copy its content into the mcu.cfg file - filename=$(basename "${file_list[$((ercf_template-1))]}") - cat "${FRIX_CONFIG_PATH}/user_templates/mcu_defaults/ercf/$filename" >> ${USER_CONFIG_PATH}/mcu.cfg + filename=$(basename "${file_list[$((mmu_template-1))]}") + cat "${FRIX_CONFIG_PATH}/user_templates/mcu_defaults/mmu/$filename" >> ${USER_CONFIG_PATH}/mcu.cfg echo "[CONFIG] Template '$filename' inserted into your mcu.cfg user file" - printf "[CONFIG] You must install ERCF Happy Hare from https://github.com/moggieuk/ERCF-Software-V3 to use ERCF with Klippain\n\n" + printf "[CONFIG] Note: keep in mind that you have to install the HappyHare backend manually to use an MMU/ERCF with Klippain. See the Klippain documentation for more information!\n\n" else - printf "[CONFIG] No ERCF template selected. Skip and continuing...\n\n" + printf "[CONFIG] No MMU/ERCF template selected. Skip and continuing...\n\n" fi fi } diff --git a/macros/base/cancel_print.cfg b/macros/base/cancel_print.cfg index 6f62b8717..9bc7d521a 100644 --- a/macros/base/cancel_print.cfg +++ b/macros/base/cancel_print.cfg @@ -5,8 +5,8 @@ gcode: {% set turn_off_heaters_in_end_print = printer["gcode_macro _USER_VARIABLES"].turn_off_heaters_in_end_print %} {% set safe_extruder_temp = printer["gcode_macro _USER_VARIABLES"].safe_extruder_temp|float %} {% set light_intensity_end_print = printer["gcode_macro _USER_VARIABLES"].light_intensity_end_print %} - {% set klippain_ercf_enabled = printer["gcode_macro _USER_VARIABLES"].klippain_ercf_enabled %} - {% set ercf_unload_on_cancel_print = printer["gcode_macro _USER_VARIABLES"].ercf_unload_on_cancel_print %} + {% set klippain_mmu_enabled = printer["gcode_macro _USER_VARIABLES"].klippain_mmu_enabled %} + {% set mmu_unload_on_cancel_print = printer["gcode_macro _USER_VARIABLES"].mmu_unload_on_cancel_print %} {% set filter_enabled = printer["gcode_macro _USER_VARIABLES"].filter_enabled %} {% set light_enabled = printer["gcode_macro _USER_VARIABLES"].light_enabled %} {% set status_leds_enabled = printer["gcode_macro _USER_VARIABLES"].status_leds_enabled %} @@ -16,13 +16,13 @@ gcode: PARK - {% if klippain_ercf_enabled and ercf_unload_on_cancel_print %} - {% if printer.ercf.enabled %} - # unload filament and park into ercf - ERCF_EJECT + {% if klippain_mmu_enabled and mmu_unload_on_cancel_print %} + {% if printer.mmu.enabled and printer.mmu.tool|int != -2 %} + # Unload filament and park the MMU + MMU_EJECT {% endif %} {% else %} - # pull back the filament a little bit + # Pull back the filament a little bit G92 E0 G1 E-10 F2100 {% endif %} @@ -61,6 +61,12 @@ gcode: STATUS_LEDS COLOR="OFF" {% endif %} + {% if klippain_mmu_enabled %} + {% if printer.mmu.enabled and printer.mmu.print_start_detection|int == 0 %} + _MMU_PRINT_END STATE=cancelled + {% endif %} + {% endif %} + # If a filament sensor is connected, re-enable it in case it was disabled during printing {% if filament_sensor_enabled %} SET_FILAMENT_SENSOR SENSOR="runout_sensor" ENABLE=1 diff --git a/macros/base/end_print.cfg b/macros/base/end_print.cfg index 45241d99b..dd7d5cce2 100644 --- a/macros/base/end_print.cfg +++ b/macros/base/end_print.cfg @@ -5,8 +5,8 @@ gcode: {% set turn_off_heaters_in_end_print = printer["gcode_macro _USER_VARIABLES"].turn_off_heaters_in_end_print %} {% set safe_extruder_temp = printer["gcode_macro _USER_VARIABLES"].safe_extruder_temp|float %} {% set light_intensity_end_print = printer["gcode_macro _USER_VARIABLES"].light_intensity_end_print %} - {% set klippain_ercf_enabled = printer["gcode_macro _USER_VARIABLES"].klippain_ercf_enabled %} - {% set ercf_unload = params.ERCF_UNLOAD_AT_END|default(printer["gcode_macro _USER_VARIABLES"].ercf_unload_on_end_print)|int %} + {% set klippain_mmu_enabled = printer["gcode_macro _USER_VARIABLES"].klippain_mmu_enabled %} + {% set mmu_unload = params.MMU_UNLOAD_AT_END|default(printer["gcode_macro _USER_VARIABLES"].mmu_unload_on_end_print)|int %} {% set filter_enabled = printer["gcode_macro _USER_VARIABLES"].filter_enabled %} {% set light_enabled = printer["gcode_macro _USER_VARIABLES"].light_enabled %} {% set status_leds_enabled = printer["gcode_macro _USER_VARIABLES"].status_leds_enabled %} @@ -16,10 +16,10 @@ gcode: PARK - {% if klippain_ercf_enabled and ercf_unload %} - {% if printer.ercf.enabled %} - # unload filament and park into ercf - ERCF_EJECT + {% if klippain_mmu_enabled %} + {% if printer.mmu.enabled and mmu_unload %} + # unload filament and park into MMU. Or just unload filament out of extruder if using bypass. + MMU_EJECT {% endif %} {% else %} # pull back the filament a little bit @@ -59,7 +59,13 @@ gcode: LIGHT_ON S={light_intensity_end_print} {% endif %} {% if status_leds_enabled %} - STATUS_LEDS COLOR="OFF" + STATUS_LEDS COLOR="DONE_PRINTING" + {% endif %} + + {% if klippain_mmu_enabled %} + {% if printer.mmu.enabled and printer.mmu.print_start_detection|int == 0 %} + _MMU_PRINT_END + {% endif %} {% endif %} # If a filament sensor is connected, re-enable it in case it was disabled during printing diff --git a/macros/base/homing/homing_conditional.cfg b/macros/base/homing/homing_conditional.cfg index b3498a7a7..37ff1eeaa 100644 --- a/macros/base/homing/homing_conditional.cfg +++ b/macros/base/homing/homing_conditional.cfg @@ -8,9 +8,7 @@ gcode: STATUS_LEDS COLOR="HOMING" {% endif %} G28 + {% if status_leds_enabled %} + STATUS_LEDS COLOR="READY" + {% endif %} {% endif %} - - {% if status_leds_enabled %} - STATUS_LEDS COLOR="READY" - {% endif %} - \ No newline at end of file diff --git a/macros/base/homing/tilting.cfg b/macros/base/homing/tilting.cfg index 50fe6457a..9a5e2b108 100644 --- a/macros/base/homing/tilting.cfg +++ b/macros/base/homing/tilting.cfg @@ -4,7 +4,6 @@ gcode: {% set FORCE_OPERATION = params.FORCE|default('true') %} {% set conf_QGL = printer["gcode_macro _USER_VARIABLES"].qgl_enabled %} {% set conf_ztilt = printer["gcode_macro _USER_VARIABLES"].ztilt_enabled %} - {% set status_leds_enabled = printer["gcode_macro _USER_VARIABLES"].status_leds_enabled %} {% set probe_type_enabled = printer["gcode_macro _USER_VARIABLES"].probe_type_enabled %} {% set verbose = printer["gcode_macro _USER_VARIABLES"].verbose %} @@ -12,10 +11,6 @@ gcode: SET_GCODE_VARIABLE MACRO=_PROBE_ON_ERROR_ACTION VARIABLE=probing VALUE=True {% endif %} - {% if status_leds_enabled %} - STATUS_LEDS COLOR="LEVELING" - {% endif %} - {% if conf_QGL %} {% if printer.quad_gantry_level.applied|lower == 'false' or FORCE_OPERATION|lower == 'true' %} {% if verbose %} @@ -39,7 +34,3 @@ gcode: {% if probe_type_enabled == "dockable" %} SET_GCODE_VARIABLE MACRO=_PROBE_ON_ERROR_ACTION VARIABLE=probing VALUE=False {% endif %} - - {% if status_leds_enabled %} - STATUS_LEDS COLOR="READY" - {% endif %} diff --git a/macros/base/park.cfg b/macros/base/park.cfg index 6e70e1d34..0c1196925 100644 --- a/macros/base/park.cfg +++ b/macros/base/park.cfg @@ -1,14 +1,16 @@ [gcode_macro PARK] description: Park the toolhead at the back and retract some filament if the nozzle is hot gcode: - {% set E = params.E|default(1.7)|float %} + {% set verbose = printer["gcode_macro _USER_VARIABLES"].verbose %} + {% set E = params.E|default(1.7)|float|abs %} + {% set MATERIAL = printer['gcode_macro START_PRINT'].material %} {% set Px, Py = printer["gcode_macro _USER_VARIABLES"].park_position_xy|map('float') %} - {% set Px = params.X|default(Px)|float %} {% set Py = params.Y|default(Py)|float %} {% set park_lift_z = printer["gcode_macro _USER_VARIABLES"].park_lift_z %} + {% set Z_HOP = params.Z_HOP|default(park_lift_z)|float %} {% set firmware_retraction_enabled = printer["gcode_macro _USER_VARIABLES"].firmware_retraction_enabled %} {% set St = printer["gcode_macro _USER_VARIABLES"].travel_speed * 60 %} @@ -17,16 +19,35 @@ gcode: {% set max_z = printer.toolhead.axis_maximum.z|float %} {% set act_z = printer.toolhead.position.z|float %} - {% set z_safe = act_z + park_lift_z %} + {% set z_safe = act_z + Z_HOP %} {% if z_safe > max_z %} {% set z_safe = max_z %} {% endif %} - # retract filament before move up toolhead - {% if printer.extruder.temperature > 185 and firmware_retraction_enabled %} - G10 + {% if printer.toolhead.homed_axes != "xyz" %} + RESPOND MSG="Cannot park because XYZ not homed" + {% else %} # retract filament before move up toolhead + {% if printer.extruder.can_extrude %} + {% if firmware_retraction_enabled %} # use firmware_retraction parameter for retract (in case firmware retraction is selected in printer.cfg) + {% if verbose %} + RESPOND MSG="Firmware retraction enabled, Extruder retraction = {printer.firmware_retraction.retract_length}" + {% endif %} + G10 + {% else %} # otherwise: + {% if MATERIAL != "XXX" %} # use material parameter if available for retract, otherwise use default value + {% set material = printer["gcode_macro _USER_VARIABLES"].material_parameters[MATERIAL] %} + {% set E = material.retract_length %} + {% endif %} + {% if verbose %} + RESPOND MSG="Firmware retraction disabled, Extruder retraction = {E}" + {% endif %} + G92 E0 + G1 E-{E} F2100 + {% endif %} + {% else %} + RESPOND MSG="no extruder retraction because extruder temperature ({printer.extruder.temperature}) is lower than min_extrude_temp ({printer.configfile.config.extruder.min_extrude_temp})" + {% endif %} + G90 + G1 Z{z_safe} F{Sz} + G0 X{Px} Y{Py} F{St} {% endif %} - G90 - G1 Z{z_safe} F{Sz} - - G0 X{Px} Y{Py} F{St} diff --git a/macros/base/pause_resume.cfg b/macros/base/pause_resume.cfg index 5a1eecfb3..54b2af0bf 100644 --- a/macros/base/pause_resume.cfg +++ b/macros/base/pause_resume.cfg @@ -24,11 +24,20 @@ gcode: {% set St = printer["gcode_macro _USER_VARIABLES"].travel_speed %} {% set light_enabled = printer["gcode_macro _USER_VARIABLES"].light_enabled %} {% set light_intensity_printing = printer["gcode_macro _USER_VARIABLES"].light_intensity_printing %} + {% set klippain_mmu_enabled = printer["gcode_macro _USER_VARIABLES"].klippain_mmu_enabled %} {% if not printer.pause_resume.is_paused %} - RESPOND MSG="Print is not paused. Resume ignored" + RESPOND MSG="Print is not paused. Resume ignored" {% else %} - RESTORE_GCODE_STATE NAME=PAUSE_state MOVE=1 MOVE_SPEED={St} + {% if klippain_mmu_enabled %} + {% if printer.mmu.enabled and printer.mmu.is_locked %} + RESTORE_GCODE_STATE NAME=PAUSE_state MOVE=0 + {% else %} + RESTORE_GCODE_STATE NAME=PAUSE_state MOVE=1 MOVE_SPEED={St} + {% endif %} + {% else %} + RESTORE_GCODE_STATE NAME=PAUSE_state MOVE=1 MOVE_SPEED={St} + {% endif %} {% if light_enabled %} LIGHT_ON S={light_intensity_printing} {% endif %} diff --git a/macros/base/probing/overrides/qgl.cfg b/macros/base/probing/overrides/qgl.cfg index a788d0584..6b5d6b953 100644 --- a/macros/base/probing/overrides/qgl.cfg +++ b/macros/base/probing/overrides/qgl.cfg @@ -8,12 +8,18 @@ rename_existing: _BASE_QUAD_GANTRY_LEVEL description: Conform a moving, twistable gantry to the shape of a stationary bed with klicky automount gcode: {% set tilting_travel_accel = printer["gcode_macro _USER_VARIABLES"].tilting_travel_accel %} + {% set status_leds_enabled = printer["gcode_macro _USER_VARIABLES"].status_leds_enabled %} {% set verbose = printer["gcode_macro _USER_VARIABLES"].verbose %} {% if verbose %} { action_respond_info("Quad gantry leveling") } {% endif %} + _CG28 + + {% if status_leds_enabled %} + STATUS_LEDS COLOR="LEVELING" + {% endif %} ACTIVATE_PROBE @@ -28,3 +34,7 @@ gcode: SET_VELOCITY_LIMIT ACCEL={saved_accel} ACCEL_TO_DECEL={saved_decel} DEACTIVATE_PROBE + + {% if status_leds_enabled %} + STATUS_LEDS COLOR="READY" + {% endif %} diff --git a/macros/base/probing/overrides/z_tilt.cfg b/macros/base/probing/overrides/z_tilt.cfg index 54ae64e6d..548b40ce3 100644 --- a/macros/base/probing/overrides/z_tilt.cfg +++ b/macros/base/probing/overrides/z_tilt.cfg @@ -8,13 +8,20 @@ rename_existing: _BASE_Z_TILT_ADJUST description: Conform a moving bed to the shape of a stationary gantry with dockable probe automount gcode: {% set tilting_travel_accel = printer["gcode_macro _USER_VARIABLES"].tilting_travel_accel %} + {% set status_leds_enabled = printer["gcode_macro _USER_VARIABLES"].status_leds_enabled %} {% set verbose = printer["gcode_macro _USER_VARIABLES"].verbose %} + {% if verbose %} { action_respond_info("Z tilt adjust") } {% endif %} + _CG28 + {% if status_leds_enabled %} + STATUS_LEDS COLOR="LEVELING" + {% endif %} + ACTIVATE_PROBE # Set the tilting acceleration prior to any movement @@ -28,3 +35,7 @@ gcode: SET_VELOCITY_LIMIT ACCEL={saved_accel} ACCEL_TO_DECEL={saved_decel} DEACTIVATE_PROBE + + {% if status_leds_enabled %} + STATUS_LEDS COLOR="READY" + {% endif %} diff --git a/macros/base/start_print.cfg b/macros/base/start_print.cfg index 401eb1eb0..5ba892879 100644 --- a/macros/base/start_print.cfg +++ b/macros/base/start_print.cfg @@ -7,6 +7,9 @@ variable_soak: 0 variable_chamber_temp: 0 variable_chamber_maxtime: 0 variable_initial_tool: 0 +variable_check_gates: 0 +variable_tools_used: "" +variable_sync_mmu_extruder: 0 variable_material: "XXX" variable_fl_size: "0_0_0_0" variable_bed_mesh_profile: "" @@ -19,9 +22,12 @@ gcode: {% set SOAK = params.SOAK|default(printer["gcode_macro _USER_VARIABLES"].print_default_soak)|int %} # Heatsoak time of the bed in minutes {% set CHAMBER_TEMP = params.CHAMBER|default(printer["gcode_macro _USER_VARIABLES"].print_default_chamber_temp)|int %} # Chamber temperature setpoint {% set CHAMBER_MAXTIME = params.CHAMBER_MAXTIME|default(printer["gcode_macro _USER_VARIABLES"].print_default_chamber_max_heating_time)|int %} # Chamber heatsoak timeout in minutes - {% set INITIAL_TOOL = params.INITIAL_TOOL|default(0)|int %} # Initial tool (for the ERCF initialization) + {% set INITIAL_TOOL = params.INITIAL_TOOL|default(0)|int %} # Initial tool (for the MMU/ERCF initialization) {% set MATERIAL = params.MATERIAL|default(printer["gcode_macro _USER_VARIABLES"].print_default_material)|string %} # Material type set in the slicer {% set FL_SIZE = params.SIZE|default("0_0_0_0")|string %} # Get bounding box of the first layer for the adaptive bed mesh + {% set CHECK_GATES = params.CHECK_GATES|default(printer['gcode_macro _USER_VARIABLES'].mmu_check_gates_on_start_print)|int %} # Check if MMU gates are availables + {% set TOOLS_USED = params.TOOLS_USED|default("")|string %} # Check if MMU gates (used in gcode file) are availables + {% set SYNC_MMU_EXTRUDER = params.SYNC_MMU_EXTRUDER|default(0)|int %} # set MMU gear motor and extruder synchronization during print TODO {% set BED_MESH_PROFILE = params.MESH|default("")|string %} # Bed mesh profile to load # Set the variables to be used in all the modules based on the slicer parameters @@ -31,6 +37,9 @@ gcode: SET_GCODE_VARIABLE MACRO=START_PRINT VARIABLE=chamber_temp VALUE={CHAMBER_TEMP} SET_GCODE_VARIABLE MACRO=START_PRINT VARIABLE=chamber_maxtime VALUE={CHAMBER_MAXTIME} SET_GCODE_VARIABLE MACRO=START_PRINT VARIABLE=initial_tool VALUE={INITIAL_TOOL} + SET_GCODE_VARIABLE MACRO=START_PRINT VARIABLE=check_gates VALUE={CHECK_GATES} + SET_GCODE_VARIABLE MACRO=START_PRINT VARIABLE=tools_used VALUE='"{TOOLS_USED}"' + SET_GCODE_VARIABLE MACRO=START_PRINT VARIABLE=sync_mmu_extruder VALUE={SYNC_MMU_EXTRUDER} SET_GCODE_VARIABLE MACRO=START_PRINT VARIABLE=material VALUE='"{MATERIAL}"' SET_GCODE_VARIABLE MACRO=START_PRINT VARIABLE=fl_size VALUE='"{FL_SIZE}"' SET_GCODE_VARIABLE MACRO=START_PRINT VARIABLE=bed_mesh_profile VALUE='"{BED_MESH_PROFILE}"' @@ -47,8 +56,8 @@ gcode: {% set light_intensity_printing = printer["gcode_macro _USER_VARIABLES"].light_intensity_printing %} {% set status_leds_enabled = printer["gcode_macro _USER_VARIABLES"].status_leds_enabled %} {% set force_homing_in_start_print = printer["gcode_macro _USER_VARIABLES"].force_homing_in_start_print %} - {% set klippain_ercf_enabled = printer["gcode_macro _USER_VARIABLES"].klippain_ercf_enabled %} - {% set ercf_reset_stats_on_start_print = printer["gcode_macro _USER_VARIABLES"].ercf_reset_stats_on_start_print %} + {% set klippain_mmu_enabled = printer["gcode_macro _USER_VARIABLES"].klippain_mmu_enabled %} + {% set mmu_force_homing_in_start_print = printer["gcode_macro _USER_VARIABLES"].mmu_force_homing_in_start_print %} {% set bed_mesh_enabled = printer["gcode_macro _USER_VARIABLES"].bed_mesh_enabled %} {% set firmware_retraction_enabled = printer["gcode_macro _USER_VARIABLES"].firmware_retraction_enabled %} {% set filter_enabled = printer["gcode_macro _USER_VARIABLES"].filter_enabled %} @@ -88,14 +97,6 @@ gcode: STOP_FILTER {% endif %} - {% if klippain_ercf_enabled %} - {% if printer.ercf.enabled %} - {% if ercf_reset_stats_on_start_print %} - ERCF_RESET_STATS - {% endif %} - {% endif %} - {% endif %} - SET_GCODE_OFFSET Z=0 M221 S100 M220 S100 @@ -115,6 +116,11 @@ gcode: _CG28 {% endif %} + # If an MMU is enabled, initialize it for the print + {% if klippain_mmu_enabled %} + _KLIPPAIN_MMU_INIT + {% endif %} + # Here is the core of the START_PRINT were we get the startprint_actions variable # to do the procedure in the correct order for the configured probe (or user custom override) {% set sp_actions = printer["gcode_macro _USER_VARIABLES"].startprint_actions %} @@ -173,6 +179,12 @@ gcode: LIGHT_ON S={light_intensity_printing} {% endif %} + {% if klippain_mmu_enabled %} + {% if printer.mmu.enabled and printer.mmu.print_start_detection|int == 0 %} + _MMU_PRINT_START + {% endif %} + {% endif %} + {% if verbose %} RESPOND MSG="Start printing !" {% endif %} @@ -287,7 +299,7 @@ gcode: {% set verbose = printer["gcode_macro _USER_VARIABLES"].verbose %} {% set status_leds_enabled = printer["gcode_macro _USER_VARIABLES"].status_leds_enabled %} - {% set klippain_ercf_enabled = printer["gcode_macro _USER_VARIABLES"].klippain_ercf_enabled %} + {% set klippain_mmu_enabled = printer["gcode_macro _USER_VARIABLES"].klippain_mmu_enabled %} {% set purge_and_brush_enabled = printer["gcode_macro _USER_VARIABLES"].purge_and_brush_enabled %} {% set purgeclean_servo_enabled = printer["gcode_macro _USER_VARIABLES"].purgeclean_servo_enabled %} @@ -312,12 +324,9 @@ gcode: M109 S{EXTRUDER_TEMP} - # Load intial tool in the ERCF if needed - {% if klippain_ercf_enabled %} - {% if printer.ercf.enabled %} - ERCF_CHANGE_TOOL STANDALONE=1 TOOL={INITIAL_TOOL} - _ERCF_ERROR_CHECK - {% endif %} + # Load intial tool into MMU (if needed) + {% if klippain_mmu_enabled %} + _KLIPPAIN_MMU_LOAD_INITIAL_TOOL {% endif %} {% if purgeclean_servo_enabled %} @@ -387,9 +396,6 @@ gcode: {% if bed_mesh_enabled %} {% if BED_MESH_PROFILE == "" %} - {% if status_leds_enabled %} - STATUS_LEDS COLOR="MESHING" - {% endif %} {% if verbose %} RESPOND MSG="Bed mesh measurement..." {% endif %} @@ -453,3 +459,4 @@ gcode: # [gcode_macro _MODULE_CUSTOM3] # gcode: # ## Your custom code here + diff --git a/macros/calibration/calibrate.cfg b/macros/calibration/calibrate.cfg index 715d33562..8efac3d8d 100644 --- a/macros/calibration/calibrate.cfg +++ b/macros/calibration/calibrate.cfg @@ -8,16 +8,24 @@ gcode: {% set BED_TEMP = params.BED_TEMP|default(printer["gcode_macro _USER_VARIABLES"].print_default_bed_temp)|float %} {% set EXTRUDER_TEMP = params.EXTRUDER_TEMP|default(printer["gcode_macro _USER_VARIABLES"].print_default_extruder_temp)|float %} {% set MATERIAL = params.MATERIAL|default("ABS")|string %} + {% set TOOL = params.TOOL|default(0)| int %} # optional: used only in case of an MMU {% set center_x = printer.toolhead.axis_maximum.x|float / 2 %} {% set center_y = printer.toolhead.axis_maximum.y|float / 2 %} + {% set klippain_mmu_enabled = printer["gcode_macro _USER_VARIABLES"].klippain_mmu_enabled %} + {% if klippain_mmu_enabled %} + {% if printer.mmu.enabled and printer.mmu.filament == "Loaded" %} + {% set TOOL = printer.mmu.tool|int %} # use the current loaded tool + {% endif %} + {% endif %} + {% if TYPE=="flow" %} # No bed mesh needed for this one as it's a small center print so we compute the size manually (default flow size is 40mm) {% set computed_size = (center_x - 20)|string + '_' + (center_y - 20)|string + '_' + (center_x + 20)|string + '_' + (center_y + 20)|string %} # Call the standard START_PRINT with almost no soaking time and no chamber temp requirement (we want to go fast!) - START_PRINT EXTRUDER_TEMP={EXTRUDER_TEMP} BED_TEMP={BED_TEMP} MATERIAL={MATERIAL} SOAK=1 SIZE={computed_size} + START_PRINT EXTRUDER_TEMP={EXTRUDER_TEMP} BED_TEMP={BED_TEMP} MATERIAL={MATERIAL} SOAK=1 SIZE={computed_size} INITIAL_TOOL={TOOL} TOOLS_USED={TOOL} FLOW_MULTIPLIER_CALIBRATION EXTRUSION_WIDTH=0.471 END_PRINT FILTER_TIME=0 @@ -26,7 +34,7 @@ gcode: {% set computed_size = (center_x - 60)|string + '_' + (center_y - 60)|string + '_' + (center_x + 60)|string + '_' + (center_y + 60)|string %} # Call the standard START_PRINT with almost no soaking time and no chamber temp requirement (we want to go fast!) - START_PRINT EXTRUDER_TEMP={EXTRUDER_TEMP} BED_TEMP={BED_TEMP} MATERIAL={MATERIAL} SOAK=1 SIZE={computed_size} + START_PRINT EXTRUDER_TEMP={EXTRUDER_TEMP} BED_TEMP={BED_TEMP} MATERIAL={MATERIAL} SOAK=1 SIZE={computed_size} INITIAL_TOOL={TOOL} TOOLS_USED={TOOL} PRESSURE_ADVANCE_CALIBRATION END_PRINT FILTER_TIME=0 diff --git a/macros/hardware_functions/mmu.cfg b/macros/hardware_functions/mmu.cfg new file mode 100644 index 000000000..161db484f --- /dev/null +++ b/macros/hardware_functions/mmu.cfg @@ -0,0 +1,249 @@ +## Custom MMU Macros used in Klippain +## Automatically included when an MMU is defined in printer.cfg + +[gcode_macro _KLIPPAIN_MMU_INIT] +description: Internal macro to initialize the MMU during the START_PRINT sequence +gcode: + {% set verbose = printer["gcode_macro _USER_VARIABLES"].verbose %} + {% set mmu_force_homing_in_start_print = printer["gcode_macro _USER_VARIABLES"].mmu_force_homing_in_start_print %} + + {% set INITIAL_TOOL = printer["gcode_macro START_PRINT"].initial_tool %} + {% set CHECK_GATES = printer["gcode_macro START_PRINT"].check_gates %} + {% set TOOLS_USED = printer["gcode_macro START_PRINT"].tools_used %} + {% set SYNC_MMU_EXTRUDER = printer["gcode_macro START_PRINT"].sync_mmu_extruder %} + + {% if printer.mmu.enabled %} + # Manually changing the MMU state to start print (see https://github.com/Frix-x/klippain/blob/main/docs/mmu.md#early-check-errors-during-start_print) + {% if printer.mmu.print_start_detection|int == 0 %} + _MMU_PRINT_START + {% endif %} + + # Park the toolhead to get on a safe place (without retracting the filament) + PARK E=0 + + # If the MMU is not in bypass mode + {% if printer.mmu.tool|int != -2 %} + # Home the MMU if necessary and pre select the initial tool + {% if mmu_force_homing_in_start_print or printer.mmu.is_homed == 0 %} + MMU_HOME TOOL={INITIAL_TOOL} FORCE_UNLOAD=1 + {% endif %} + + # If we need to check the gates (specified by the slicer or the Klippain variable) + {% if CHECK_GATES %} + {% if TOOLS_USED != "!referenced_tools!" %} + + # If we are in the case of a multi-filament print + {% if TOOLS_USED and printer.mmu.tool|string != TOOLS_USED %} + {% if verbose %} + RESPOND PREFIX='MMU info:' MSG=" You are planning a multi-filament print. The tool(s): {TOOLS_USED} will be checked to limit the risk of errors." + {% endif %} + + # First eject in case a bad tool is already loaded, then check the gates and select the initial tool + MMU_EJECT + MMU_CHECK_GATE TOOLS={TOOLS_USED} + MMU_SELECT TOOL={INITIAL_TOOL} + + # Else if the TOOL_USED parameter is not valid... We can still start the print but only check the initial tool + {% elif printer.mmu.tool|int != INITIAL_TOOL or (printer.mmu.tool|int == INITIAL_TOOL and printer.mmu.filament != "Loaded") %} + {% if verbose %} + {% if printer.mmu.tool|int != INITIAL_TOOL %} + RESPOND PREFIX='Config info:' MSG=" Only T{INITIAL_TOOL} will be checked! You should consider using TOOLS_USED=!referenced_tools! in the custom start gcode of your slicer" + {% elif printer.mmu.tool|int == INITIAL_TOOL and printer.mmu.filament != "Loaded" %} + RESPOND PREFIX='Config info:' MSG=" T{INITIAL_TOOL} is selected but the filament is not loaded. In order to avoid a possible error if the initial tool is marked as empty in HappyHare, it will be checked!" + {% endif %} + {% endif %} + + # First eject in case a bad tool is already loaded, then check the initial tool gate + MMU_EJECT + MMU_CHECK_GATE TOOLS={INITIAL_TOOL} + {% endif %} + + # Else if there was an error in the Moonraker gcode preprocessor (TOOL_USED is still equal to "!referenced_tools!") + {% else %} + {% if verbose %} + RESPOND PREFIX='MMU info:' MSG=" TOOLS_USED={TOOLS_USED} is likely not valid. Please check your slicer custom start gcode and verify that the HappyHare Moonraker gcode preprocessor is working! There will be no check on the gates and they will all be marked as available to avoid an error" + {% endif %} + + # Reset the state status (Available or Empty) for all the MMU gates to avoid an error + {% set gate_str = printer.mmu.ttg_map|join(',') %} + MMU_GATE_MAP GATES={gate_str} AVAILABLE=-1 + {% endif %} + + # Else if no check of the gates is wanted (specified by the slicer or the Klippain variable) + {% else %} + {% if verbose %} + RESPOND PREFIX='Config info:' MSG=" No gate check requested by the user. You should consider variable_mmu_check_gates_on_start_print: True in your Klippain variables.cfg or use the MMU_CHECK_GATES=1 parameter in your slicer custom start gcode" + {% endif %} + {% if printer.mmu.tool|int != INITIAL_TOOL %} + MMU_HOME FORCE_UNLOAD=1 TOOL={INITIAL_TOOL} + {% endif %} + {% endif %} + + # First instance of the MMU error check (if enabled...) to stop the START_PRINT sequence earlier + {% if printer['gcode_macro _USER_VARIABLES'].mmu_check_errors_on_start_print and printer.mmu.print_start_detection|int == 0 %} + _MMU_ERROR_CHECK1 + {% endif %} + + # Else if the MMU is in bypass mode, we just check for an error + {% else %} + # First instance of the MMU error check (if enabled...) while in bypass mode to stop the START_PRINT sequence earlier + {% if printer['gcode_macro _USER_VARIABLES'].mmu_check_errors_on_start_print and printer.mmu.print_start_detection|int == 0 %} + _MMU_ERROR_CHECK1 + {% endif %} + {% endif %} + + # Set the sync_to_extruder mode of HH if wanted by the user for the print (set from the slicer custom start gcode) + {% if printer.configfile.config.mmu.sync_to_extruder == 0 and printer.mmu.tool|int != -2 %} + {% if SYNC_MMU_EXTRUDER == 1 %} + {% if verbose %} + RESPOND MSG="MMU gear motor will be synchronized with the extruder during the print" + {% endif %} + MMU_TEST_CONFIG sync_to_extruder=1 + {% endif %} + + # Force disable the sync_to_extruder mode of HH if the MMU is set in bypass mode + {% elif (printer.configfile.config.mmu.sync_to_extruder == 1 or SYNC_MMU_EXTRUDER == 1) and printer.mmu.tool|int == -2 %} + {% if verbose %} + RESPOND MSG="MMU bypass mode is used so its gear motor cannot be synchronized with the extruder during the print" + {% endif %} + MMU_TEST_CONFIG sync_to_extruder=0 + {% endif %} + + # Preload the MMU gates if the filament is not already loaded and the MMU is set in normal mode + {% if printer.mmu.tool|int != -2 %} + {% if printer.mmu.filament != "Loaded" %} + {% if printer.mmu.tool|int != INITIAL_TOOL %} + MMU_SELECT TOOL={INITIAL_TOOL} + MMU_PRELOAD + {% endif %} + {% else %} + {% if printer.mmu.tool|int != INITIAL_TOOL %} + MMU_EJECT + MMU_SELECT TOOL={INITIAL_TOOL} + MMU_PRELOAD + {% endif %} + {% endif %} + {% endif %} + + # Manually reset the MMU state to the initial state (see https://github.com/Frix-x/klippain/blob/main/docs/mmu.md#early-check-errors-during-start_print) + {% if printer.mmu.print_start_detection|int == 0 %} + _MMU_PRINT_END STATE=standby + {% endif %} + {% endif %} + + +[gcode_macro _KLIPPAIN_MMU_LOAD_INITIAL_TOOL] +description: Internal macro to load the initial filament during the START_PRINT sequence +gcode: + {% set INITIAL_TOOL = printer["gcode_macro START_PRINT"].initial_tool %} + + {% if printer.mmu.enabled %} + # Manually changing the MMU state to start print (see https://github.com/Frix-x/klippain/blob/main/docs/mmu.md#early-check-errors-during-start_print) + {% if printer.mmu.print_start_detection|int == 0 %} + _MMU_PRINT_START + {% endif %} + + # If the MMU is not in bypass mode, we load the initial tool if not already loaded + {% if printer.mmu.tool|int != -2 %} + MMU_CHANGE_TOOL TOOL={INITIAL_TOOL} STANDALONE=1 + + # Else if in bypass mode, then manually load the filament (that was manually inserted) to the nozzle + {% else %} + MMU_LOAD + {% endif %} + + # Second instance of the MMU error check (if enabled...) to stop the START_PRINT sequence earlier + {% if printer['gcode_macro _USER_VARIABLES'].mmu_check_errors_on_start_print and printer.mmu.print_start_detection|int == 0 %} + _MMU_ERROR_CHECK2 + {% endif %} + # And manually reset the MMU state to the initial state (see https://github.com/Frix-x/klippain/blob/main/docs/mmu.md#early-check-errors-during-start_print) + {% if printer.mmu.print_start_detection|int == 0 %} + _MMU_PRINT_END STATE=standby + {% endif %} + {% endif %} + + +[gcode_macro _KLIPPAIN_MMU_SET_CLOGDETECTION] +description: Internal macro to automatically disable or re-enable MMU clog detection as needed +gcode: + {% set clog_detection = params.STATE|int %} + {% set verbose = printer["gcode_macro _USER_VARIABLES"].verbose %} + + {% if printer.mmu.enabled %} + {% if printer.mmu.clog_detection > 0 and printer.configfile.config.mmu.sync_to_extruder == 0 %} + {% if clog_detection == 0 %} + MMU_TEST_CONFIG enable_clog_detection={clog_detection} + {% if verbose %} + RESPOND MSG="MMU clog detection automatically disabled" + {% endif %} + {% elif clog_detection > 0 %} + MMU_TEST_CONFIG enable_clog_detection={clog_detection} + {% if verbose %} + RESPOND MSG="MMU clog detection automatically re-enabled" + {% endif %} + {% endif %} + {% endif %} + {% endif %} + + +# Custom macros to check for an error on the MMU and stop the START_PRINT sequence earlier +# (see https://github.com/Frix-x/klippain/blob/main/docs/mmu.md#early-check-errors-during-start_print) +[gcode_macro _MMU_ERROR_CHECK1] +description: Internal macro to check for an error on the MMU and stop the START_PRINT sequence earlier +gcode: + {% set verbose = printer["gcode_macro _USER_VARIABLES"].verbose %} + + {% if printer.mmu.print_state|string == "pause_locked" or printer.mmu.is_locked %} + {action_raise_error("MMU is locked! Please check your MMU and use the RESUME command to unlock it. Then restart the print")} + {% endif %} + + {% if verbose %} + {% if printer.mmu.tool|int == -1 %} + RESPOND PREFIX='MMU gate:' MSG=" no tool selected!" + {% elif printer.mmu.tool|int == -2 %} + RESPOND PREFIX='MMU gate:' MSG=" bypass mode selected" + {% elif printer.mmu.filament == "Loaded" %} + RESPOND PREFIX='MMU gate:' MSG=" T{printer.mmu.tool} already loaded" + {% else %} + RESPOND PREFIX='MMU tool:' MSG=" T{printer.mmu.tool} preloaded" + {% endif %} + {% endif %} + +[gcode_macro _MMU_ERROR_CHECK2] +description: Internal macro to check for an error on the MMU and stop the START_PRINT sequence earlier +gcode: + {% set verbose = printer["gcode_macro _USER_VARIABLES"].verbose %} + {% set INITIAL_TOOL = printer["gcode_macro START_PRINT"].initial_tool %} + + {% if printer.mmu.print_state|string == "pause_locked" or printer.mmu.is_locked %} + {action_raise_error("MMU is locked! Please check your MMU and use the RESUME command to unlock it. Then restart the print")} + {% elif printer.mmu.filament != "Loaded" %} + {action_raise_error("Filament is not loaded! Please check your MMU and then restart the print")} + {% elif printer.mmu.tool|int != -2 and printer.mmu.tool|int != INITIAL_TOOL %} + {action_raise_error("Initial tool ({INITIAL_TOOL}) and MMU tool ({printer.mmu.tool}) are different! Please check your MMU and then restart the print")} + {% endif %} + + {% if verbose %} + {% if printer.mmu.tool|int == -1 %} + RESPOND PREFIX='mmu gate:' MSG=" something get wrong, no active tool!" + {% elif printer.mmu.tool|int == -2 %} + RESPOND PREFIX='mmu gate:' MSG=" bypass mode selected and filament loaded" + {% else %} + RESPOND PREFIX='mmu tool:' MSG=" T{printer.mmu.tool} ready" + {% endif %} + {% endif %} + +# This is just a debug macro that just print a couple of variables related to the MMU and HappyHare +[gcode_macro _MMU_CHECK_STATE] +description: Display some MMU parameters to debug it +gcode: + RESPOND PREFIX= MSG=" Klippain with Happy_Hare_V2.x support in main branch" + RESPOND PREFIX= MSG=" mmu.print_state : {printer.mmu.print_state}" + RESPOND PREFIX= MSG=" mmu.is_locked : {printer.mmu.is_locked}" + RESPOND PREFIX= MSG=" mmu.tool : {printer.mmu.tool}" + RESPOND PREFIX= MSG=" mmu.print_start_detection : {printer.mmu.print_start_detection}" + RESPOND PREFIX= MSG=" mmu.clog_detection : {printer.mmu.clog_detection}" + RESPOND PREFIX= MSG=" mmu.filament : {printer.mmu.filament}" + RESPOND PREFIX= MSG=" mmu.filament_pos : {printer.mmu.filament_pos}" + RESPOND PREFIX= MSG=" mmu.selector_touch_enable : {printer.configfile.config.mmu.selector_touch_enable}" + RESPOND PREFIX= MSG=" mmu.sync_drive : {printer.mmu.sync_drive}" diff --git a/macros/hardware_functions/status_leds.cfg b/macros/hardware_functions/status_leds.cfg index 5642f91c0..0e170653c 100644 --- a/macros/hardware_functions/status_leds.cfg +++ b/macros/hardware_functions/status_leds.cfg @@ -2,7 +2,7 @@ # src : https://github.com/VoronDesign/Voron-Stealthburner/blob/main/Firmware/stealthburner_leds.cfg # Contributed by Voron discord users wile.e, Tetsunosuke, and etherwalker -# Heavily modified by Frix-x to be more adapted for the generic config goal +# Heavily modified by Frix-x to be more adapted for the generic config goal of Klippain # The following status macro is available: @@ -33,7 +33,7 @@ gcode: gcode: {% set leds_name = params.LEDS %} {% set color_name = params.COLOR %} - {% set color = printer["gcode_macro _USER_VARIABLES"].status_leds_colors[leds_name][color_name] %} + {% set color = printer["gcode_macro _LEDS_COLORS_DEFINITION"].colors[leds_name][color_name] %} {% set led = printer["gcode_macro _USER_VARIABLES"]["status_leds_" + leds_name + "_led_name"] %} {% set idx = printer["gcode_macro _USER_VARIABLES"]["status_leds_" + leds_name + "_idx"] %} {% set transmit = params.TRANSMIT|default(1) %} @@ -46,7 +46,7 @@ gcode: {% set leds_name = params.LEDS %} {% set color_name = params.COLOR %} {% set led = printer["gcode_macro _USER_VARIABLES"]["status_leds_" + leds_name + "_led_name"] %} - {% set color = printer["gcode_macro _USER_VARIABLES"].status_leds_colors[leds_name][color_name] %} + {% set color = printer["gcode_macro _LEDS_COLORS_DEFINITION"].colors[leds_name][color_name] %} {% set transmit = params.TRANSMIT|default(1) %} SET_LED LED={led} RED={color.r} GREEN={color.g} BLUE={color.b} WHITE={color.w} TRANSMIT={transmit} @@ -155,10 +155,16 @@ gcode: 'caselight': 'printing', 'minidisplay': 'on' }, - 'off': { - 'logo': 'off', - 'nozzle': 'off', - 'caselight': 'off', + 'printing': { + 'logo': 'printing', + 'nozzle': 'on', + 'caselight': 'printing', + 'minidisplay': 'on' + }, + 'done_printing': { + 'logo': 'done_printing', + 'nozzle': 'done_printing', + 'caselight': 'done_printing', 'minidisplay': 'off' }, 'on': { @@ -167,12 +173,18 @@ gcode: 'caselight': 'on', 'minidisplay': 'on' }, + 'off': { + 'logo': 'off', + 'nozzle': 'off', + 'caselight': 'off', + 'minidisplay': 'off' + }, 'error': { 'logo': 'error', 'nozzle': 'error', 'caselight': 'error', 'minidisplay': 'error' - } + } } %} {% if not (color in status_color) %} @@ -180,12 +192,21 @@ gcode: {% endif %} {% if printer["gcode_macro _USER_VARIABLES"].status_leds_enabled %} - _SET_LEDS_BY_NAME LEDS="logo" COLOR={status_color[color].logo} TRANSMIT={logo_transmit} - _SET_LEDS_BY_NAME LEDS="nozzle" COLOR={status_color[color].nozzle} TRANSMIT=1 + {% if printer["gcode_macro _USER_VARIABLES"].status_leds_logo_led_name == "status_leds"%} + _SET_LEDS_BY_NAME LEDS="logo" COLOR={status_color[color].logo} TRANSMIT={logo_transmit} + _SET_LEDS_BY_NAME LEDS="nozzle" COLOR={status_color[color].nozzle} TRANSMIT=1 + {% elif printer["gcode_macro _USER_VARIABLES"].status_leds_logo_led_name == "status_leds_effects"%} + SET_LED_EFFECT EFFECT={"sb_logo_" + status_color[color].logo} REPLACE=1 FADETIME=0.5 + SET_LED_EFFECT EFFECT={"sb_nozzle_" + status_color[color].nozzle} REPLACE=1 FADETIME=0.5 + {% endif %} {% endif %} - {% if printer["gcode_macro _USER_VARIABLES"].status_leds_caselight_enabled %} - _SET_ALLLEDS_BY_NAME LEDS="caselight" COLOR={status_color[color].caselight} TRANSMIT=1 + {% if printer["gcode_macro _USER_VARIABLES"].status_leds_caselight_enabled%} + {% if printer["gcode_macro _USER_VARIABLES"].status_leds_caselight_led_name == "caselight"%} + _SET_ALLLEDS_BY_NAME LEDS="caselight" COLOR={status_color[color].caselight} TRANSMIT=1 + {% elif printer["gcode_macro _USER_VARIABLES"].status_leds_caselight_led_name == "caselight_effects"%} + SET_LED_EFFECT EFFECT={"cl_" + status_color[color].caselight} REPLACE=1 FADETIME=0.5 + {% endif %} {% endif %} {% if printer["gcode_macro _USER_VARIABLES"].status_leds_minidisplay_enabled %} diff --git a/macros/helpers/filament_swap.cfg b/macros/helpers/filament_swap.cfg index 4c258ede2..2ee6ce78c 100644 --- a/macros/helpers/filament_swap.cfg +++ b/macros/helpers/filament_swap.cfg @@ -2,11 +2,12 @@ description: Do a PAUSE, park the toolhead over the purge bucket and unload the filament gcode: {% set TEMP = params.TEMP|default(printer["gcode_macro _USER_VARIABLES"].print_default_extruder_temp)|float %} + {% set DISTANCE = params.DISTANCE|default(105)|float %} SAVE_GCODE_STATE NAME=CHANGE_FILAMENT_state PAUSE _CONDITIONAL_MOVE_TO_PURGE_BUCKET Z_DROP=0 - UNLOAD_FILAMENT + UNLOAD_FILAMENT TEMP={TEMP} DISTANCE={DISTANCE} RESTORE_GCODE_STATE NAME=CHANGE_FILAMENT_state @@ -18,8 +19,8 @@ gcode: {% set verbose = printer["gcode_macro _USER_VARIABLES"].verbose %} {% set filament_sensor_enabled = printer["gcode_macro _USER_VARIABLES"].filament_sensor_enabled %} + {% set klippain_mmu_enabled = printer["gcode_macro _USER_VARIABLES"].klippain_mmu_enabled %} {% set re_enable_filament_sensor = 0 %} - {% set klippain_ercf_enabled = printer["gcode_macro _USER_VARIABLES"].klippain_ercf_enabled %} {% if filament_sensor_enabled %} {% if (printer['filament_motion_sensor runout_sensor'] is defined and printer['filament_motion_sensor runout_sensor'].enabled) or (printer['filament_switch_sensor runout_sensor'] is defined and printer['filament_switch_sensor runout_sensor'].enabled) %} @@ -31,15 +32,8 @@ gcode: {% endif %} {% endif %} - {% if klippain_ercf_enabled %} - {% if printer.ercf.enabled %} - {% if printer.ercf.clog_detection > 0 %} - ERCF_TEST_CONFIG enable_clog_detection=0 - {% if verbose %} - RESPOND MSG="ERCF clog detection deactivated to unload filament" - {% endif %} - {% endif %} - {% endif %} + {% if klippain_mmu_enabled %} + _KLIPPAIN_MMU_SET_CLOGDETECTION STATE=0 {% endif %} SAVE_GCODE_STATE NAME=UNLOAD_FILAMENT_state @@ -63,15 +57,8 @@ gcode: {% endif %} {% endif %} - {% if klippain_ercf_enabled %} - {% if printer.ercf.enabled %} - {% if printer.ercf.clog_detection > 0 %} - ERCF_TEST_CONFIG enable_clog_detection={printer.ercf.clog_detection} - {% if verbose %} - RESPOND MSG="Filament unloaded, ERCF clog detection reactivated" - {% endif %} - {% endif %} - {% endif %} + {% if klippain_mmu_enabled %} + _KLIPPAIN_MMU_SET_CLOGDETECTION STATE={printer.mmu.clog_detection} {% endif %} @@ -83,7 +70,7 @@ gcode: {% set verbose = printer["gcode_macro _USER_VARIABLES"].verbose %} {% set filament_sensor_enabled = printer["gcode_macro _USER_VARIABLES"].filament_sensor_enabled %} - {% set klippain_ercf_enabled = printer["gcode_macro _USER_VARIABLES"].klippain_ercf_enabled %} + {% set klippain_mmu_enabled = printer["gcode_macro _USER_VARIABLES"].klippain_mmu_enabled %} {% set re_enable_filament_sensor = 0 %} {% if filament_sensor_enabled %} @@ -96,15 +83,8 @@ gcode: {% endif %} {% endif %} - {% if klippain_ercf_enabled %} - {% if printer.ercf.enabled %} - {% if printer.ercf.clog_detection > 0 %} - ERCF_TEST_CONFIG enable_clog_detection=0 - {% if verbose %} - RESPOND MSG="ERCF clog detection deactivated to load filament" - {% endif %} - {% endif %} - {% endif %} + {% if klippain_mmu_enabled %} + _KLIPPAIN_MMU_SET_CLOGDETECTION STATE=0 {% endif %} SAVE_GCODE_STATE NAME=LOAD_FILAMENT_state @@ -127,15 +107,8 @@ gcode: {% endif %} {% endif %} - {% if klippain_ercf_enabled %} - {% if printer.ercf.enabled %} - {% if printer.ercf.clog_detection > 0 %} - ERCF_TEST_CONFIG enable_clog_detection={printer.ercf.clog_detection} - {% if verbose %} - RESPOND MSG="Filament loaded, ERCF clog detection reactivated" - {% endif %} - {% endif %} - {% endif %} + {% if klippain_mmu_enabled %} + _KLIPPAIN_MMU_SET_CLOGDETECTION STATE={printer.mmu.clog_detection} {% endif %} @@ -146,7 +119,7 @@ gcode: {% set verbose = printer["gcode_macro _USER_VARIABLES"].verbose %} {% set filament_sensor_enabled = printer["gcode_macro _USER_VARIABLES"].filament_sensor_enabled %} - {% set klippain_ercf_enabled = printer["gcode_macro _USER_VARIABLES"].klippain_ercf_enabled %} + {% set klippain_mmu_enabled = printer["gcode_macro _USER_VARIABLES"].klippain_mmu_enabled %} {% set re_enable_filament_sensor = 0 %} {% if filament_sensor_enabled %} @@ -159,15 +132,8 @@ gcode: {% endif %} {% endif %} - {% if klippain_ercf_enabled %} - {% if printer.ercf.enabled %} - {% if printer.ercf.clog_detection > 0 %} - ERCF_TEST_CONFIG enable_clog_detection=0 - {% if verbose %} - RESPOND MSG="ERCF clog detection deactivated for filament tip shaping" - {% endif %} - {% endif %} - {% endif %} + {% if klippain_mmu_enabled %} + _KLIPPAIN_MMU_SET_CLOGDETECTION STATE=0 {% endif %} SAVE_GCODE_STATE NAME=TIP_SHAPING_state @@ -191,7 +157,7 @@ gcode: # Flushing Klipper's buffer to ensure the tip shaping sequence is done before continuing M400 - + RESTORE_GCODE_STATE NAME=TIP_SHAPING_state {% if filament_sensor_enabled and re_enable_filament_sensor %} @@ -201,13 +167,6 @@ gcode: {% endif %} {% endif %} - {% if klippain_ercf_enabled %} - {% if printer.ercf.enabled %} - {% if printer.ercf.clog_detection > 0 %} - ERCF_TEST_CONFIG enable_clog_detection={printer.ercf.clog_detection} - {% if verbose %} - RESPOND MSG="Filament tip shaping done, ERCF clog detection reactivated" - {% endif %} - {% endif %} - {% endif %} + {% if klippain_mmu_enabled %} + _KLIPPAIN_MMU_SET_CLOGDETECTION STATE={printer.mmu.clog_detection} {% endif %} diff --git a/macros/helpers/prime_line.cfg b/macros/helpers/prime_line.cfg index dfb872384..f10bd3daf 100644 --- a/macros/helpers/prime_line.cfg +++ b/macros/helpers/prime_line.cfg @@ -13,7 +13,7 @@ gcode: {% set Sz = printer["gcode_macro _USER_VARIABLES"].z_drop_speed * 60 %} {% set verbose = printer["gcode_macro _USER_VARIABLES"].verbose %} - {% set klippain_ercf_enabled = printer["gcode_macro _USER_VARIABLES"].klippain_ercf_enabled %} + {% set klippain_mmu_enabled = printer["gcode_macro _USER_VARIABLES"].klippain_mmu_enabled %} {% set filament_sensor_enabled = printer["gcode_macro _USER_VARIABLES"].filament_sensor_enabled %} {% set re_enable_filament_sensor = 0 %} @@ -55,15 +55,8 @@ gcode: # Finally we compute the speed to get the correct flowrate for the prime line {% set speed = (prime_line_flowrate / (line_height * line_width)) * 60 |float %} - {% if klippain_ercf_enabled %} - {% if printer.ercf.enabled %} - {% if printer.ercf.clog_detection > 0 %} - {% if verbose %} - RESPOND MSG="ERCF clog detection deactivated for the prime line" - {% endif %} - ERCF_TEST_CONFIG enable_clog_detection=0 - {% endif %} - {% endif %} + {% if klippain_mmu_enabled %} + _KLIPPAIN_MMU_SET_CLOGDETECTION STATE=0 {% endif %} {% if filament_sensor_enabled %} @@ -107,15 +100,8 @@ gcode: # Flushing Klipper's buffer to ensure the primeline sequence is done before continuing M400 - {% if klippain_ercf_enabled %} - {% if printer.ercf.enabled %} - {% if printer.ercf.clog_detection > 0 %} - {% if verbose %} - RESPOND MSG="ERCF clog detection reactivated after the prime line" - {% endif %} - ERCF_TEST_CONFIG enable_clog_detection={printer.ercf.clog_detection} - {% endif %} - {% endif %} + {% if klippain_mmu_enabled %} + _KLIPPAIN_MMU_SET_CLOGDETECTION STATE={printer.mmu.clog_detection} {% endif %} {% if filament_sensor_enabled and re_enable_filament_sensor %} diff --git a/macros/helpers/spoolman.cfg b/macros/helpers/spoolman.cfg new file mode 100644 index 000000000..827d17bfb --- /dev/null +++ b/macros/helpers/spoolman.cfg @@ -0,0 +1,20 @@ +[gcode_macro SET_ACTIVE_SPOOL] +description: Set Spoolman active spool +gcode: + {% if params.SPOOL_ID %} + {% set spool_id = params.SPOOL_ID|int %} + {action_call_remote_method( + "spoolman_set_active_spool", + spool_id=spool_id + )} + {% else %} + {action_respond_info("Parameter 'SPOOL_ID' is required")} + {% endif %} + +[gcode_macro CLEAR_ACTIVE_SPOOL] +description: Clear Spoolman active spool +gcode: + {action_call_remote_method( + "spoolman_set_active_spool", + spool_id=None + )} diff --git a/macros/miscs/startup.cfg b/macros/miscs/startup.cfg index 2ffd2719d..ab55531a5 100644 --- a/macros/miscs/startup.cfg +++ b/macros/miscs/startup.cfg @@ -30,21 +30,37 @@ gcode: _INIT_TMC2240 {% endif %} - # If ERCF is included in Klippain, we also check that HH is installed + # If an MMU/ERCF is included in Klippain, we also check that the correct HH version is installed + {% set klippain_mmu_enabled = printer["gcode_macro _USER_VARIABLES"].klippain_mmu_enabled %} {% set klippain_ercf_enabled = printer["gcode_macro _USER_VARIABLES"].klippain_ercf_enabled %} - {% if klippain_ercf_enabled %} - _INIT_CHECK_ERCF + {% if klippain_mmu_enabled or klippain_ercf_enabled %} + _INIT_CHECK_MMU {% endif %} # User custom startup process. Define them in your overrides.cfg if needed :) _INIT_USERCUSTOM - RESPOND MSG="Klippain started and ready !" + {% if klippain_mmu_enabled %} + RESPOND MSG="Klippain with MMU support started and ready!" + {% else %} + RESPOND MSG="Klippain started and ready!" + {% endif %} + + +[gcode_macro _INIT_LEDS] +gcode: + {% if printer["gcode_macro _USER_VARIABLES"].status_leds_enabled %} + {% if printer["gcode_macro _USER_VARIABLES"].caselight_on_at_startup|default(False) %} + STATUS_LEDS COLOR="READY" + {% else %} + STATUS_LEDS COLOR="OFF" + {% endif %} + {% endif %} [gcode_macro _INIT_TMC2240] gcode: - # This macro can be copied over to overrides.cfg and will allow the values to defined automatically on klipper startup + # This macro can be copied over to overrides.cfg and will allow the values to be defined automatically on klipper startup # TMC2240 extruder initialization macro to set the driver registers based on Esoterical's github page. These settings are not # universal and not necessary for all SB2240 owners. Adapt them to your needs! # https://github.com/Esoterical/voron_canbus/blob/main/toolhead_flashing/common_hardware/BigTreeTech%20SB2209%20and%20SB2240/SB2240%20Stepper%20Configuration%20and%20Undervoltage.md @@ -125,12 +141,22 @@ gcode: {action_respond_info(parameters.output)} -[gcode_macro _INIT_CHECK_ERCF] +[gcode_macro _INIT_CHECK_MMU] gcode: - {% if printer.ercf is not defined %} - { action_raise_error("ERCF is enabled in Klippain, but Happy Hare, the supported ERCF backend software is not detected. Please install it now from https://github.com/moggieuk/ERCF-Software-V3 !") } + {% if printer.mmu is not defined %} + {% if printer.ercf is not defined %} + { action_raise_error("MMU support is enabled in Klippain, but HappyHare, the supported MMU/ERCF backend software is not detected. See the corresponding documentation: https://github.com/Frix-x/klippain/blob/main/docs/mmu.md") } + {% else %} + { action_raise_error("ERCF support is enabled in Klippain, but the old version of version of HappyHare (ie. ERCF-Software-V3) is installed. Please uninstall it and install the latest HappyHare instead. See the corresponding documentation: https://github.com/Frix-x/klippain/blob/main/docs/mmu.md") } + {% endif %} + {% elif printer['gcode_macro _USER_VARIABLES'].mmu_force_homing_in_start_print is not defined or printer['gcode_macro _USER_VARIABLES'].mmu_unload_on_cancel_print is not defined or printer['gcode_macro _USER_VARIABLES'].mmu_unload_on_end_print is not defined or printer['gcode_macro _USER_VARIABLES'].mmu_check_gates_on_start_print is not defined or printer['gcode_macro _USER_VARIABLES'].mmu_check_errors_on_start_print is not defined %} + { action_raise_error("MMU support is enabled in Klippain, but some variables are missing from your variables.cfg. Please update your template or refer to the corresponding documentation: https://github.com/Frix-x/klippain/blob/main/docs/mmu.md") } + {% elif printer["gcode_macro _USER_VARIABLES"].mmu_check_errors_on_start_print and printer.mmu.print_start_detection|int == 1 %} + RESPOND MSG="The HappyHare function to automatically detect the start and end of a print has been automatically disabled to allow early detection of an error during the Klippain START_PRINT sequence. This allow a more efficient debugging of the MMU. Refer to the Klippain MMU documentation" + MMU_TEST_CONFIG print_start_detection=0 # Override this value to disable the HappyHare auto detection of start and end of print in order to call _MMU_PRINT_START and _MMU_PRINT_END manually {% endif %} + [gcode_macro _INIT_USERCUSTOM] gcode: # ---- CUSTOM Macro section diff --git a/moonraker/base.conf b/moonraker/base.conf index b6140e15d..e6ac5a6bb 100644 --- a/moonraker/base.conf +++ b/moonraker/base.conf @@ -43,12 +43,3 @@ origin: https://github.com/Frix-x/klippain.git primary_branch: main managed_services: moonraker klipper install_script: install.sh - -[update_manager Klippain-ShakeTune] -type: git_repo -path: ~/klippain_shaketune -channel: beta -origin: https://github.com/Frix-x/klippain-shaketune.git -primary_branch: main -managed_services: klipper -install_script: install.sh diff --git a/moonraker/led_effect.conf b/moonraker/led_effect.conf new file mode 100644 index 000000000..8868bb4a3 --- /dev/null +++ b/moonraker/led_effect.conf @@ -0,0 +1,5 @@ +[update_manager led_effect] +type: git_repo +path: ~/klipper-led_effect +origin: https://github.com/julianschill/klipper-led_effect.git +is_system_service: False diff --git a/moonraker/spoolman.conf b/moonraker/spoolman.conf new file mode 100644 index 000000000..f2e90e9a6 --- /dev/null +++ b/moonraker/spoolman.conf @@ -0,0 +1,6 @@ +[spoolman] +server: http://localhost:7912 +# URL to the Spoolman instance. This parameter must be provided. +sync_rate: 5 +# The interval, in seconds, between sync requests with the +# Spoolman server. The default is 5. diff --git a/moonraker/tmc_autotune.conf b/moonraker/tmc_autotune.conf new file mode 100644 index 000000000..c26fe334d --- /dev/null +++ b/moonraker/tmc_autotune.conf @@ -0,0 +1,8 @@ +[update_manager klipper_tmc_autotune] +type: git_repo +channel: dev +path: ~/klipper_tmc_autotune +origin: https://github.com/andrewmcgr/klipper_tmc_autotune.git +managed_services: klipper +primary_branch: main +install_script: install.sh diff --git a/user_templates/mcu.cfg b/user_templates/mcu.cfg index 94aa22eb9..c69d4b8c4 100644 --- a/user_templates/mcu.cfg +++ b/user_templates/mcu.cfg @@ -44,4 +44,3 @@ # [include config/hardware/extruder/TMC/TMC2209.cfg] # [include config/hardware/extruder/TMC/TMC2240.cfg] # ---------------------------------------------------------------------------------------- - diff --git a/user_templates/mcu_defaults/ercf/BTT_MMB_CAN_v1.0.cfg b/user_templates/mcu_defaults/ercf/BTT_MMB_CAN_v1.0.cfg deleted file mode 100644 index 5e665890b..000000000 --- a/user_templates/mcu_defaults/ercf/BTT_MMB_CAN_v1.0.cfg +++ /dev/null @@ -1,31 +0,0 @@ - -#---------------------------------------------# -#### BTT MMB CAN 1.0 MCU definition ########### -#---------------------------------------------# - -[mcu ercf] -##-------------------------------------------------------------------- -serial: /dev/serial/by-id/change-me-to-the-correct-mcu-path -# canbus_uuid: change-me-to-the-correct-canbus-id -##-------------------------------------------------------------------- - -# If you want to override the wiring of the BTT MMB CAN, keep in mind that this -# board is defined using the "ercf" name. So you should use "pin: ercf:PIN_NAME" -# in your own overrides.cfg files. - -[include config/mcu_definitions/ercf/BTT_MMB_CAN_v1.0.cfg] # Do not remove this line -[board_pins mcu_ercf] -mcu: ercf -aliases: - GEAR_STEP=MCU_MOTOR1_STEP , GEAR_DIR=MCU_MOTOR1_DIR , GEAR_ENABLE=MCU_MOTOR1_EN , GEAR_TMCUART=MCU_MOTOR1_CS , - SELECTOR_STEP=MCU_MOTOR2_STEP , SELECTOR_DIR=MCU_MOTOR2_DIR , SELECTOR_ENABLE=MCU_MOTOR2_EN , SELECTOR_TMCUART=MCU_MOTOR2_CS , - SELECTOR_DIAG=MCU_STP2 , - - GEAR_STOP=MCU_ENDSTOP , SELECTOR_STOP=MCU_ENDSTOP , - - TOOLHEAD_SENSOR=MCU_STP1 , # double used with MOTOR1_DIAG, so might collide - ERCF_SERVO=MCU_MOT , - ERCF_ENCODER=MCU_SENSOR , - ERCF_NEOPIXEL=MCU_RGB , - - diff --git a/user_templates/mcu_defaults/ercf/Fysetc_ERCF_ERB.cfg b/user_templates/mcu_defaults/ercf/Fysetc_ERCF_ERB.cfg deleted file mode 100644 index 2489a0207..000000000 --- a/user_templates/mcu_defaults/ercf/Fysetc_ERCF_ERB.cfg +++ /dev/null @@ -1,37 +0,0 @@ - -#---------------------------------------------# -#### Fysetc ERCF ERB MCU definition ########### -#---------------------------------------------# - -[mcu ercf] -##-------------------------------------------------------------------- -serial: /dev/serial/by-id/change-me-to-the-correct-mcu-path -##-------------------------------------------------------------------- - -# If you want to override the wiring of the Fystec ERCF ERB, keep in mind that this -# board is defined using the "ercf" name. So you should use "pin: ercf:PIN_NAME" -# in your own overrides.cfg files. - -[include config/mcu_definitions/ercf/Fysetc_ERCF_ERB.cfg] # Do not remove this line -[board_pins mcu_ercf] -mcu: ercf -aliases: - GEAR_STEP=MCU_GEAR_MOTOR_STEP , GEAR_DIR=MCU_GEAR_MOTOR_DIR , GEAR_ENABLE=MCU_GEAR_MOTOR_EN , GEAR_TMCUART=MCU_GEAR_MOTOR_UART , - SELECTOR_STEP=MCU_SELECTOR_MOTOR_STEP , SELECTOR_DIR=MCU_SELECTOR_MOTOR_DIR , SELECTOR_ENABLE=MCU_SELECTOR_MOTOR_EN , SELECTOR_TMCUART=MCU_SELECTOR_MOTOR_UART , - SELECTOR_DIAG=MCU_SELECTOR_MOTOR_DIAG , - - GEAR_STOP=MCU_ENDSTOP , SELECTOR_STOP=MCU_ENDSTOP , - - TOOLHEAD_SENSOR=MCU_HALL_SENSOR , - ERCF_SERVO=MCU_SERVO , - ERCF_ENCODER=MCU_ENCODER , - ERCF_NEOPIXEL=MCU_RGB , - - EXTRA_PINS1=MCU_UART0_TX , EXTRA_PINS2=MCU_UART0_RX , - EXTRA_PINS3=MCU_SPI0_SCK , EXTRA_PINS4=MCU_SPI0_MISO , - EXTRA_PINS5=MCU_SPI0_MOSI , EXTRA_PINS6=MCU_SPI0_CS , - EXTRA_PINS7=MCU_I2C1_SDA , EXTRA_PINS8=MCU_I2C1_SCL , - EXTRA_PINS9=MCU_ADC0 , EXTRA_PINS10=MCU_ADC1 , - EXTRA_PINS11=MCU_ADC2 , EXTRA_PINS12=MCU_ADC3 , - EXTRA_PINS13= , EXTRA_PINS14=<5V> , - diff --git a/user_templates/mcu_defaults/ercf/Mellow_fly_ERCF.cfg b/user_templates/mcu_defaults/ercf/Mellow_fly_ERCF.cfg deleted file mode 100644 index 7a33e9ef2..000000000 --- a/user_templates/mcu_defaults/ercf/Mellow_fly_ERCF.cfg +++ /dev/null @@ -1,38 +0,0 @@ - -#---------------------------------------------# -#### Mellow Fly ERCF MCU definition ########### -#---------------------------------------------# - -[mcu ercf] -##-------------------------------------------------------------------- -serial: /dev/serial/by-id/change-me-to-the-correct-mcu-path -##-------------------------------------------------------------------- - -# If you want to override the wiring of the Mellow Fly ERCF board, keep in mind that this -# board is defined using the "ercf" name. So you should use "pin: ercf:PIN_NAME" -# in your own overrides.cfg files. - -[include config/mcu_definitions/ercf/Mellow_fly_ERCF.cfg] # Do not remove this line -[board_pins mcu_ercf] -mcu: ercf -aliases: - GEAR_STEP=MCU_GEAR_STEP , GEAR_DIR=MCU_GEAR_DIR , GEAR_ENABLE=MCU_GEAR_EN , GEAR_TMCUART=MCU_GEAR_UART , - SELECTOR_STEP=MCU_SELECTOR_STEP , SELECTOR_DIR=MCU_SELECTOR_DIR , SELECTOR_ENABLE=MCU_SELECTOR_EN , SELECTOR_TMCUART=MCU_SELECTOR_UART , - SELECTOR_DIAG=MCU_SELECTOR_DIAG , - - GEAR_STOP=MCU_ENDSTOP , SELECTOR_STOP=MCU_ENDSTOP , - - SPI_SCLK=MCU_SCK , SPI_MOSI=MCU_MOSI , SPI_MISO=MCU_MISO , - - TOOLHEAD_SENSOR=MCU_EXTRA , - ERCF_SERVO=MCU_SERVO , - ERCF_ENCODER=MCU_ENCODER , - - EXTRA_PINS1= , EXTRA_PINS2= , - EXTRA_PINS3=<3.3V> , EXTRA_PINS4=<3.3V> , - EXTRA_PINS5=MCU_P26 , EXTRA_PINS6=MCU_P10 , - EXTRA_PINS7=MCU_P27 , EXTRA_PINS8=MCU_P11 , - EXTRA_PINS9=MCU_P28 , EXTRA_PINS10=MCU_P12 , - EXTRA_PINS11=MCU_P29 , EXTRA_PINS12=MCU_P24 , - EXTRA_PINS13=MCU_P25 , EXTRA_PINS14=MCU_P13 , - diff --git a/user_templates/mcu_defaults/ercf/Tircown_ERCF_easy_brd.cfg b/user_templates/mcu_defaults/ercf/Tircown_ERCF_easy_brd.cfg deleted file mode 100644 index 843d925ee..000000000 --- a/user_templates/mcu_defaults/ercf/Tircown_ERCF_easy_brd.cfg +++ /dev/null @@ -1,28 +0,0 @@ - -#--------------------------------------------------# -#### Tircown ERCF easybrd MCU definition ########### -#--------------------------------------------------# - -[mcu ercf] -##-------------------------------------------------------------------- -serial: /dev/serial/by-id/change-me-to-the-correct-mcu-path -##-------------------------------------------------------------------- - -# If you want to override the wiring of the ERCF easy brd, keep in mind that this -# board is defined using the "ercf" name. So you should use "pin: ercf:PIN_NAME" -# in your own overrides.cfg files. - -[include config/mcu_definitions/ercf/Tircown_ERCF_easy_brd.cfg] # Do not remove this line -[board_pins mcu_ercf] -mcu: ercf -aliases: - GEAR_STEP=MCU_GEAR_STEP , GEAR_DIR=MCU_GEAR_DIR , GEAR_ENABLE=MCU_GEAR_ENABLE , GEAR_TMCUART=MCU_TMCUART , - SELECTOR_STEP=MCU_SELECTOR_STEP , SELECTOR_DIR=MCU_SELECTOR_DIR , SELECTOR_ENABLE=MCU_SELECTOR_ENABLE , SELECTOR_TMCUART=MCU_TMCUART , - SELECTOR_DIAG=MCU_SELECTOR_DIAG , - - GEAR_STOP=MCU_GEAR_STOP , SELECTOR_STOP=MCU_SELECTOR_STOP , - - ERCF_SERVO=MCU_SERVO , - - ERCF_ENCODER=MCU_ENCODER , - diff --git a/user_templates/mcu_defaults/main/BTT_Manta_M8P_v2.0.cfg b/user_templates/mcu_defaults/main/BTT_Manta_M8P_v2.0.cfg index 5386782fd..8f5851bfc 100644 --- a/user_templates/mcu_defaults/main/BTT_Manta_M8P_v2.0.cfg +++ b/user_templates/mcu_defaults/main/BTT_Manta_M8P_v2.0.cfg @@ -51,3 +51,4 @@ aliases: LIGHT_NEOPIXEL=MCU_M5_STOP , SERVO_PIN=MCU_PROBE1 , + diff --git a/user_templates/mcu_defaults/main/BTT_SKR_Mini_E3_v2.cfg b/user_templates/mcu_defaults/main/BTT_SKR_Mini_E3_v2.cfg index 19c2844c1..2ca40ae42 100644 --- a/user_templates/mcu_defaults/main/BTT_SKR_Mini_E3_v2.cfg +++ b/user_templates/mcu_defaults/main/BTT_SKR_Mini_E3_v2.cfg @@ -48,7 +48,7 @@ uart_pin: TMCUART tx_pin: TMCTX uart_address: 1 -# comment this section if you are using a toolhead with own mcu +# Comment this section if you are using a toolhead with its own MCU [tmc2209 extruder] uart_pin: TMCUART tx_pin: TMCTX diff --git a/user_templates/mcu_defaults/main/BTT_SKR_Mini_E3_v3.cfg b/user_templates/mcu_defaults/main/BTT_SKR_Mini_E3_v3.cfg index f03eed60f..39ca708cf 100644 --- a/user_templates/mcu_defaults/main/BTT_SKR_Mini_E3_v3.cfg +++ b/user_templates/mcu_defaults/main/BTT_SKR_Mini_E3_v3.cfg @@ -48,7 +48,7 @@ uart_pin: TMCUART tx_pin: TMCTX uart_address: 1 -# comment this section if you are using a toolhead with own mcu +# Comment this section if you are using a toolhead with its own MCU [tmc2209 extruder] uart_pin: TMCUART tx_pin: TMCTX diff --git a/user_templates/mcu_defaults/main/BTT_SKR_Pico_v1.0.cfg b/user_templates/mcu_defaults/main/BTT_SKR_Pico_v1.0.cfg index ceeaba930..684cf6e1f 100644 --- a/user_templates/mcu_defaults/main/BTT_SKR_Pico_v1.0.cfg +++ b/user_templates/mcu_defaults/main/BTT_SKR_Pico_v1.0.cfg @@ -46,7 +46,7 @@ uart_pin: TMCUART tx_pin: TMCTX uart_address: 1 -# comment this section if you are using a toolhead with own mcu OR if you use an MMU with Happy_Hare V2 +# Comment this section if you are using a toolhead with its own MCU [tmc2209 extruder] uart_pin: TMCUART tx_pin: TMCTX diff --git a/user_templates/mcu_defaults/main/BTT_SKR_Pro_V1.2.cfg b/user_templates/mcu_defaults/main/BTT_SKR_Pro_V1.2.cfg new file mode 100644 index 000000000..3fa28618d --- /dev/null +++ b/user_templates/mcu_defaults/main/BTT_SKR_Pro_V1.2.cfg @@ -0,0 +1,31 @@ +#----------------------------------------# +#### BTT SKR Pro v1.2 definition ######## +#----------------------------------------# + +[mcu] +##------------------------------------------------------------------------------- +serial: /dev/serial/by-id/change-me-to-the-correct-mcu-path +##------------------------------------------------------------------------------- + +[include config/mcu_definitions/main/BTT_SKR_Pro_V1.2.cfg] # Do not remove this line +[board_pins xyze_SKR_mcu] +mcu: mcu +aliases: + X_STEP=MCU_XM_STEP , X_DIR=MCU_XM_DIR , X_ENABLE=MCU_XM_ENABLE , X_TMCUART=MCU_XM_TMCUART , + Y_STEP=MCU_YM_STEP , Y_DIR=MCU_YM_DIR , Y_ENABLE=MCU_YM_ENABLE , Y_TMCUART=MCU_YM_TMCUART , + Z_STEP=MCU_ZM_STEP , Z_DIR=MCU_ZM_DIR , Z_ENABLE=MCU_ZM_ENABLE , Z_TMCUART=MCU_ZM_TMCUART , + + E_STEP=MCU_E0M_STEP , E_DIR=MCU_E0M_DIR , E_ENABLE=MCU_E0M_ENABLE , E_TMCUART=MCU_E0M_TMCUART , + + TOOLHEAD_SENSOR=MCU_E0STOP , SERVO_PIN=MCU_PROBE , + + X_STOP=MCU_XSTOP , Y_STOP=MCU_YSTOP , Z_STOP=MCU_E1STOP , PROBE_INPUT=MCU_ZSTOP , + + E_HEATER=MCU_HEAT0 , E_TEMPERATURE=MCU_T0 , + BED_HEATER=MCU_BED , BED_TEMPERATURE=MCU_T1 , + + PART_FAN=MCU_FAN1 , E_FAN=MCU_FAN0 , + + LIGHT_NEOPIXEL=MCU_SERVOS , + STATUS_NEOPIXEL=MCU_IO2 + diff --git a/user_templates/mcu_defaults/main/Double_BTT_SKR_v1.4.cfg b/user_templates/mcu_defaults/main/Double_BTT_SKR_v1.4.cfg index 2c2f4ed0c..0c7c97bd3 100644 --- a/user_templates/mcu_defaults/main/Double_BTT_SKR_v1.4.cfg +++ b/user_templates/mcu_defaults/main/Double_BTT_SKR_v1.4.cfg @@ -26,15 +26,15 @@ aliases: E_STEP=MCU_E0M_STEP , E_DIR=MCU_E0M_DIR , E_ENABLE=MCU_E0M_ENABLE , E_TMCUART=MCU_E0M_UART , - GEAR_STEP=MCU_ZM_STEP , GEAR_DIR=MCU_ZM_DIR , GEAR_ENABLE=MCU_ZM_ENABLE , GEAR_TMCUART=MCU_ZM_UART , - SELECTOR_STEP=MCU_E1M_STEP , SELECTOR_DIR=MCU_E1M_DIR , SELECTOR_ENABLE=MCU_E1M_ENABLE , SELECTOR_TMCUART=MCU_E1M_UART , - SELECTOR_DIAG=MCU_ZSTOP , + MMU_GEAR_STEP=MCU_ZM_STEP , MMU_GEAR_DIR=MCU_ZM_DIR , MMU_GEAR_ENABLE=MCU_ZM_ENABLE , MMU_GEAR_UART=MCU_ZM_UART , + SELECTOR_STEP=MCU_E1M_STEP , MMU_SEL_DIR=MCU_E1M_DIR , MMU_SEL_ENABLE=MCU_E1M_ENABLE , MMU_SEL_UART=MCU_E1M_UART , + MMU_SEL_DIAG=MCU_ZSTOP , - GEAR_STOP=MCU_E1DET , SELECTOR_STOP=MCU_E1DET , + MMU_GEAR_ENDSTOP=MCU_E1DET , MMU_SEL_ENDSTOP=MCU_E1DET , - ERCF_SERVO=MCU_E0DET , - ERCF_ENCODER=MCU_PWRDET , - TOOLHEAD_SENSOR=MCU_ZSTOP , + MMU_SERVO=MCU_E0DET , + MMU_ENCODER=MCU_PWRDET , + TOOLHEAD_SENSORR=MCU_ZSTOP , X_STOP=MCU_XSTOP , Y_STOP=MCU_YSTOP , diff --git a/user_templates/mcu_defaults/main/Fysetc_Catalyst_v1.x.cfg b/user_templates/mcu_defaults/main/Fysetc_Catalyst_v1.x.cfg index 3af3f85d4..8e5e621ad 100644 --- a/user_templates/mcu_defaults/main/Fysetc_Catalyst_v1.x.cfg +++ b/user_templates/mcu_defaults/main/Fysetc_Catalyst_v1.x.cfg @@ -34,4 +34,4 @@ aliases: CONTROLLER_FAN=MCU_FAN2 , LIGHT_NEOPIXEL=MCU_NEOPIXEL , - \ No newline at end of file + diff --git a/user_templates/mcu_defaults/main/Fysetc_S6_v2.x.cfg b/user_templates/mcu_defaults/main/Fysetc_S6_v2.x.cfg index 896290525..3ed3e9fe5 100644 --- a/user_templates/mcu_defaults/main/Fysetc_S6_v2.x.cfg +++ b/user_templates/mcu_defaults/main/Fysetc_S6_v2.x.cfg @@ -47,3 +47,4 @@ aliases: LIGHT_OUTPUT=MCU_E1_OUT , #LIGHT_NEOPIXEL= , # You can use MCU_X_MAX if you bridge the pads to have 5V on this pin STATUS_NEOPIXEL=MCU_RGB_B , + diff --git a/user_templates/mcu_defaults/main/Fysetc_Spider_v1.x.cfg b/user_templates/mcu_defaults/main/Fysetc_Spider_v1.x.cfg index 84d632764..4b974fd28 100644 --- a/user_templates/mcu_defaults/main/Fysetc_Spider_v1.x.cfg +++ b/user_templates/mcu_defaults/main/Fysetc_Spider_v1.x.cfg @@ -33,6 +33,7 @@ aliases: X_STOP=MCU_X_MAX , Y_STOP=MCU_Y_MAX , Z_STOP=MCU_Z_MIN , PROBE_INPUT=MCU_Z_MAX , RUNOUT_SENSOR=MCU_Y_MIN , # If using sensorless homing: you will need to move the runout sensor on another pin + SERVO_PIN=MCU_X_MIN , # If using sensorless homing: you will need to move the servo on another pin E_HEATER=MCU_E0_OUT , E_TEMPERATURE=MCU_TE0 , BED_HEATER=MCU_BED_OUT , BED_TEMPERATURE=MCU_TB , diff --git a/user_templates/mcu_defaults/main/Fysetc_Spider_v2.x.cfg b/user_templates/mcu_defaults/main/Fysetc_Spider_v2.x.cfg index 2c5e4a7e6..bf61860f7 100644 --- a/user_templates/mcu_defaults/main/Fysetc_Spider_v2.x.cfg +++ b/user_templates/mcu_defaults/main/Fysetc_Spider_v2.x.cfg @@ -33,6 +33,7 @@ aliases: X_STOP=MCU_X_MAX , Y_STOP=MCU_Y_MAX , Z_STOP=MCU_Z_MIN , PROBE_INPUT=MCU_Z_MAX , RUNOUT_SENSOR=MCU_Y_MIN , # If using sensorless homing: you will need to move the runout sensor on another pin + SERVO_PIN=MCU_X_MIN , # If using sensorless homing: you will need to move the servo on another pin E_HEATER=MCU_E0_OUT , E_TEMPERATURE=MCU_TE0 , BED_HEATER=MCU_BED_OUT , BED_TEMPERATURE=MCU_TB , diff --git a/user_templates/mcu_defaults/main/LDO_Leviathan_v1.2.cfg b/user_templates/mcu_defaults/main/LDO_Leviathan_v1.2.cfg index f5d5f6c58..62ddb37b2 100644 --- a/user_templates/mcu_defaults/main/LDO_Leviathan_v1.2.cfg +++ b/user_templates/mcu_defaults/main/LDO_Leviathan_v1.2.cfg @@ -45,3 +45,4 @@ aliases: LIGHT_OUTPUT=MCU_LED , STATUS_NEOPIXEL=MCU_NEOPIXEL, + diff --git a/user_templates/mcu_defaults/main/MY-OWN-CUSTOM-TEMPLATE.cfg b/user_templates/mcu_defaults/main/MY-OWN-CUSTOM-TEMPLATE.cfg index f75465e9a..40b1f8f95 100644 --- a/user_templates/mcu_defaults/main/MY-OWN-CUSTOM-TEMPLATE.cfg +++ b/user_templates/mcu_defaults/main/MY-OWN-CUSTOM-TEMPLATE.cfg @@ -51,3 +51,4 @@ aliases: STATUS_NEOPIXEL= , SERVO_PIN= , + diff --git a/user_templates/mcu_defaults/mmu/BTT_MMB_CAN_v1.0.cfg b/user_templates/mcu_defaults/mmu/BTT_MMB_CAN_v1.0.cfg new file mode 100644 index 000000000..12a00f67b --- /dev/null +++ b/user_templates/mcu_defaults/mmu/BTT_MMB_CAN_v1.0.cfg @@ -0,0 +1,53 @@ + +#-----------------------------------------------# +#### BTT MMB CAN board MCU definition ########### +#-----------------------------------------------# + +[mcu mmu] +##-------------------------------------------------------------------- +serial: /dev/serial/by-id/change-me-to-the-correct-mcu-path +# canbus_uuid: change-me-to-the-correct-canbus-id +##-------------------------------------------------------------------- + +# If you want to override the wiring of the BTT MMB CAN board, keep in mind that this +# board is defined using the "mmu" name. So you should use "pin: mmu:PIN_NAME" +# in your own overrides.cfg files. + +[include config/mcu_definitions/mmu/BTT_MMB_CAN_v1.0.cfg] # Do not remove this line +[board_pins mmu_mcu] +mcu: mmu +aliases: + MMU_GEAR_STEP=MCU_M1_STEP , MMU_GEAR_DIR=MCU_M1_DIR , MMU_GEAR_ENABLE=MCU_M1_EN , MMU_GEAR_UART=MCU_M1_UART , + MMU_SEL_STEP=MCU_M2_STEP , MMU_SEL_DIR=MCU_M2_DIR , MMU_SEL_ENABLE=MCU_M2_EN , MMU_SEL_UART=MCU_M2_UART , + + MMU_GEAR_DIAG=MCU_STP1 , # Shared with MCU_STP1 + MMU_SEL_DIAG=MCU_STP2 , # Shared with MCU_STP2 + + MMU_SEL_ENDSTOP=MCU_STP11 , + + MMU_SERVO=MCU_MOT , + MMU_ENCODER=MCU_SENSOR , + MMU_NEOPIXEL=MCU_RGB , + # MMU_GATE_SENSOR=MCU_STP1 , # (if not GEAR DIAG!) + + MMU_PRE_GATE_0=MCU_STP3 , + MMU_PRE_GATE_1=MCU_STP4 , + MMU_PRE_GATE_2=MCU_STP5 , + MMU_PRE_GATE_3=MCU_STP6 , + MMU_PRE_GATE_4=MCU_STP7 , + MMU_PRE_GATE_5=MCU_STP8 , + MMU_PRE_GATE_6=MCU_STP9 , + MMU_PRE_GATE_7=MCU_STP10 , + # MMU_PRE_GATE_8="" , + # MMU_PRE_GATE_9="" , + # MMU_PRE_GATE_10="" , + # MMU_PRE_GATE_11="" , + + SPI_SCLK=MCU_SCK , SPI_MOSI=MCU_MOSI , SPI_MISO=MCU_MISO , + + ## I2C header + I2C_SDA=MCU_I2C_SDA , I2C_SCL=MCU_I2C_SCL , I2C_GND= , I2C_5V=<5V> , + + ## SWD header + SWD_Reset= , SWD_PA14=MCU_SWD_PA14 , SWD_GND= , SWD_PA13=MCU_SWD_PA13 , SWD_3.3V=<3.3V> , + diff --git a/user_templates/mcu_defaults/mmu/BTT_SKR_Pico_v1.0.cfg b/user_templates/mcu_defaults/mmu/BTT_SKR_Pico_v1.0.cfg new file mode 100644 index 000000000..a77860f0d --- /dev/null +++ b/user_templates/mcu_defaults/mmu/BTT_SKR_Pico_v1.0.cfg @@ -0,0 +1,27 @@ + +#----------------------------------------# +#### BTT SKR Pico v1.0 mmu definition ######## +#----------------------------------------# + +[include config/mcu_definitions/mmu/BTT_SKR_Pico_v1.0.cfg] # Do not remove this line +[board_pins mmu_mcu] +mcu: mmu +aliases: + MMU_GEAR_STEP=MCU_Y_STEP , MMU_GEAR_DIR=MCU_Y_DIR , MMU_GEAR_ENABLE=MCU_Y_EN , MMU_GEAR_UART=MCU_TMCUART , + MMU_SEL_STEP=MCU_X_STEP , MMU_SEL_DIR=MCU_X_DIR , MMU_SEL_ENABLE=MCU_X_EN , MMU_SEL_UART=MCU_TMCUART , + + MMU_GEAR_ENDSTOP=MCU_Z-STOP , MMU_SEL_ENDSTOP=MCU_Y-STOP , + + MMU_SERVO=MCU_SERVOS , + MMU_ENCODER=MCU_X-STOP , + MMU_NEOPIXEL=MCU_RGB , + MMU_GATE_SENSOR=MCU_E0-STOP , + + EXTRA_PINS1=MCU_UART0_TX , EXTRA_PINS2=MCU_UART0_RX , + EXTRA_PINS3=MCU_SPI0_SCK , EXTRA_PINS4=MCU_SPI0_MISO , + EXTRA_PINS5=MCU_SPI0_MOSI , EXTRA_PINS6=MCU_SPI0_CS , + EXTRA_PINS7=MCU_I2C1_SDA , EXTRA_PINS8=MCU_I2C1_SCL , + EXTRA_PINS9=MCU_ADC0 , EXTRA_PINS10=MCU_ADC1 , + EXTRA_PINS11=MCU_ADC2 , EXTRA_PINS12=MCU_ADC3 , + EXTRA_PINS13= , EXTRA_PINS14=<5V> , + diff --git a/user_templates/mcu_defaults/mmu/Fysetc_ERCF_ERB.cfg b/user_templates/mcu_defaults/mmu/Fysetc_ERCF_ERB.cfg new file mode 100644 index 000000000..e9465512c --- /dev/null +++ b/user_templates/mcu_defaults/mmu/Fysetc_ERCF_ERB.cfg @@ -0,0 +1,37 @@ + +#---------------------------------------------# +#### Mellow Fly ERCF MCU definition ########### +#---------------------------------------------# + +[mcu mmu] +##-------------------------------------------------------------------- +serial: /dev/serial/by-id/change-me-to-the-correct-mcu-path +# canbus_uuid: change-me-to-the-correct-canbus-id +##-------------------------------------------------------------------- + +# If you want to override the wiring of the Mellow Fly ERCF board, keep in mind that this +# board is defined using the "mmu" name. So you should use "pin: mmu:PIN_NAME" +# in your own overrides.cfg files. + +[include config/mcu_definitions/mmu/Mellow_fly_ERCF.cfg] # Do not remove this line +[board_pins mmu_mcu] +mcu: mmu +aliases: + MMU_GEAR_STEP=MCU_GEAR_STEP , MMU_GEAR_DIR=MCU_GEAR_DIR , MMU_GEAR_ENABLE=MCU_GEAR_EN , MMU_GEAR_UART=MCU_GEAR_UART , + MMU_GEAR_DIAG=MCU_GEAR_DIAG , + MMU_SEL_STEP=MCU_SELECTOR_STEP , MMU_SEL_DIR=MCU_SELECTOR_DIR , MMU_SEL_ENABLE=MCU_SELECTOR_EN , MMU_SEL_UART=MCU_SELECTOR_UART , + MMU_SEL_DIAG=MCU_SELECTOR_DIAG , + + MMU_SEL_ENDSTOP=MCU_ENDSTOP , + MMU_SERVO=MCU_SERVO , + MMU_ENCODER=MCU_ENCODER , + MMU_GATE_SENSOR=MCU_EXTRA , + + SPI_SCLK=MCU_SCK , SPI_MOSI=MCU_MOSI , SPI_MISO=MCU_MISO , + + MMU_PRE_GATE_0=MCU_IO26 , MMU_PRE_GATE_1=MCU_IO10 , + MMU_PRE_GATE_2=MCU_IO27 , MMU_PRE_GATE_3=MCU_IO11 , + MMU_PRE_GATE_4=MCU_IO28 , MMU_PRE_GATE_5=MCU_IO12 , + MMU_PRE_GATE_6=MCU_IO29 , MMU_PRE_GATE_7=MCU_IO24 , + MMU_PRE_GATE_8=MCU_IO25 , MMU_PRE_GATE_9=MCU_IO13 , + diff --git a/user_templates/mcu_defaults/mmu/Mellow_fly_ERCF.cfg b/user_templates/mcu_defaults/mmu/Mellow_fly_ERCF.cfg new file mode 100644 index 000000000..172b7c06f --- /dev/null +++ b/user_templates/mcu_defaults/mmu/Mellow_fly_ERCF.cfg @@ -0,0 +1,37 @@ + +#---------------------------------------------# +#### Mellow Fly ERCF MCU definition ########### +#---------------------------------------------# + +[mcu mmu] +##-------------------------------------------------------------------- +serial: /dev/serial/by-id/change-me-to-the-correct-mcu-path +# canbus_uuid: change-me-to-the-correct-canbus-id +##-------------------------------------------------------------------- + +# If you want to override the wiring of the Mellow Fly ERCF board, keep in mind that this +# board is defined using the "mmu" name. So you should use "pin: mmu:PIN_NAME" +# in your own overrides.cfg files. + +[include config/mcu_definitions/mmu/Mellow_fly_ERCF.cfg] # Do not remove this line +[board_pins mmu_mcu] +mcu: mmu +aliases: + MMU_GEAR_STEP=MCU_GEAR_STEP , MMU_GEAR_DIR=MCU_GEAR_DIR , MMU_GEAR_ENABLE=MCU_GEAR_EN , MMU_GEAR_UART=MCU_GEAR_UART , + MMU_GEAR_DIAG=MCU_GEAR_DIAG , + MMU_SEL_STEP=MCU_SELECTOR_STEP , MMU_SEL_DIR=MCU_SELECTOR_DIR , MMU_SEL_ENABLE=MCU_SELECTOR_EN , MMU_SEL_UART=MCU_SELECTOR_UART , + MMU_SEL_DIAG=MCU_SELECTOR_DIAG , + + MMU_SEL_ENDSTOP=MCU_ENDSTOP , + MMU_SERVO=MCU_SERVO , + MMU_ENCODER=MCU_ENCODER , + MMU_GATE_SENSOR=MCU_EXTRA , + + SPI_SCLK=MCU_SCK , SPI_MOSI=MCU_MOSI , SPI_MISO=MCU_MISO , + + MMU_PRE_GATE_0=MCU_IO10 , MMU_PRE_GATE_1=MCU_IO26 , + MMU_PRE_GATE_2=MCU_IO11 , MMU_PRE_GATE_3=MCU_IO27 , + MMU_PRE_GATE_4=MCU_IO12 , MMU_PRE_GATE_5=MCU_IO28 , + MMU_PRE_GATE_6=MCU_IO24 , MMU_PRE_GATE_7=MCU_IO29 , + MMU_PRE_GATE_8=MCU_IO13 , MMU_PRE_GATE_9=MCU_IO25 , + diff --git a/user_templates/mcu_defaults/mmu/Tircown_ERCF_easy_brd.cfg b/user_templates/mcu_defaults/mmu/Tircown_ERCF_easy_brd.cfg new file mode 100644 index 000000000..861f0336a --- /dev/null +++ b/user_templates/mcu_defaults/mmu/Tircown_ERCF_easy_brd.cfg @@ -0,0 +1,29 @@ + +#--------------------------------------------------# +#### Tircown ERCF easybrd MCU definition ########### +#--------------------------------------------------# + +[mcu mmu] +##-------------------------------------------------------------------- +serial: /dev/serial/by-id/change-me-to-the-correct-mcu-path +##-------------------------------------------------------------------- + +# If you want to override the wiring of the ERCF easy brd, keep in mind that this +# board is defined using the "mmu" name. So you should use "pin: mmu:PIN_NAME" +# in your own overrides.cfg files. + +[include config/mcu_definitions/mmu/Tircown_ERCF_easy_brd.cfg] # Do not remove this line +[board_pins mmu_mcu] +mcu: mmu +aliases: + MMU_GEAR_STEP=MCU_GEAR_STEP , MMU_GEAR_DIR=MCU_GEAR_DIR , MMU_GEAR_ENABLE=MCU_GEAR_ENABLE , + MMU_SEL_STEP=MCU_SELECTOR_STEP , MMU_SEL_DIR=MCU_SELECTOR_DIR , MMU_SEL_ENABLE=MCU_SELECTOR_ENABLE , + + MMU_GEAR_UART=MCU_TMCUART , # used for [tmc2209 stepper_mmu_gear] AND [tmc2209 stepper_mmu_selector] uart_pin in Happy_Hare + MMU_SEL_DIAG=MCU_SELECTOR_DIAG , + + MMU_SEL_ENDSTOP=MCU_SELECTOR_STOP , + MMU_SERVO=MCU_SERVO , + MMU_ENCODER=MCU_ENCODER , # (if not GATE_SENSOR!) + # MMU_GATE_SENSOR=MCU_ENCODER , # (if not ENCODER!) + diff --git a/user_templates/mcu_defaults/toolhead/BTT_SB2240_v1.0.cfg b/user_templates/mcu_defaults/toolhead/BTT_SB2240_v1.0.cfg index 672961559..37985e486 100644 --- a/user_templates/mcu_defaults/toolhead/BTT_SB2240_v1.0.cfg +++ b/user_templates/mcu_defaults/toolhead/BTT_SB2240_v1.0.cfg @@ -65,7 +65,7 @@ pin: toolhead:E_FAN [neopixel status_leds] pin: toolhead:STATUS_NEOPIXEL -# Since ADXL shares pins with the SPI interface of the TMC, it must be set up here, since different pin aliases must not resolve to the same pin +# Don't be surprised with the name of the pin. This is because the SPI bus is shared between motors and ADXL on this CANBoard. [tmc2240 extruder] cs_pin: toolhead:MCU_MOTOR_SPI_NSS spi_software_sclk_pin: toolhead:ADXL_SCLK diff --git a/user_templates/mcu_defaults/toolhead/Mellow_SB2040_Pro.cfg b/user_templates/mcu_defaults/toolhead/Mellow_SB2040_Pro.cfg index 9dd48ab1f..3f7e35c6d 100644 --- a/user_templates/mcu_defaults/toolhead/Mellow_SB2040_Pro.cfg +++ b/user_templates/mcu_defaults/toolhead/Mellow_SB2040_Pro.cfg @@ -18,9 +18,10 @@ mcu: toolhead aliases: E_STEP=MCU_EMOT_STEP , E_DIR=MCU_EMOT_DIR , E_ENABLE=MCU_EMOT_EN , E_TMCUART=MCU_EMOT_CS , - X_STOP=MCU_ENDSTOP , - PROBE_INPUT=MCU_HV_ENDSTOP , + X_STOP=MCU_ENDSTOP , + PROBE_INPUT=MCU_HV_ENDSTOP , TOOLHEAD_SENSOR=MCU_5V_ENDSTOP , + EXTRUDER_SENSOR=MCU_FAN2 , E_HEATER=MCU_HEAT , E_TEMPERATURE=MCU_TEMP , CHAMBER_TEMPERATURE=MCU_ONBOARD_NTCK100K , diff --git a/user_templates/mcu_defaults/toolhead/Mellow_SB2040_v1.cfg b/user_templates/mcu_defaults/toolhead/Mellow_SB2040_v1.cfg index a5b92ea37..4021b4d75 100644 --- a/user_templates/mcu_defaults/toolhead/Mellow_SB2040_v1.cfg +++ b/user_templates/mcu_defaults/toolhead/Mellow_SB2040_v1.cfg @@ -18,9 +18,10 @@ mcu: toolhead aliases: E_STEP=MCU_EMOT_STEP , E_DIR=MCU_EMOT_DIR , E_ENABLE=MCU_EMOT_EN , E_TMCUART=MCU_EMOT_UART , - X_STOP=MCU_ENDSTOP , - PROBE_INPUT=MCU_HV_ENDSTOP , + X_STOP=MCU_ENDSTOP , + PROBE_INPUT=MCU_HV_ENDSTOP , TOOLHEAD_SENSOR=MCU_5V_ENDSTOP , + EXTRUDER_SENSOR=MCU_FAN2 , E_HEATER=MCU_HEAT , E_TEMPERATURE=MCU_TEMP , CHAMBER_TEMPERATURE=MCU_ONBOARD_NTCK100K , diff --git a/user_templates/mcu_defaults/toolhead/Mellow_SB2040_v2.cfg b/user_templates/mcu_defaults/toolhead/Mellow_SB2040_v2.cfg index 4717038a0..265086e82 100644 --- a/user_templates/mcu_defaults/toolhead/Mellow_SB2040_v2.cfg +++ b/user_templates/mcu_defaults/toolhead/Mellow_SB2040_v2.cfg @@ -18,9 +18,10 @@ mcu: toolhead aliases: E_STEP=MCU_EMOT_STEP , E_DIR=MCU_EMOT_DIR , E_ENABLE=MCU_EMOT_EN , E_TMCUART=MCU_EMOT_UART , - X_STOP=MCU_ENDSTOP , - PROBE_INPUT=MCU_HV_ENDSTOP , + X_STOP=MCU_ENDSTOP , + PROBE_INPUT=MCU_HV_ENDSTOP , TOOLHEAD_SENSOR=MCU_5V_ENDSTOP , + EXTRUDER_SENSOR=MCU_FAN2 , E_HEATER=MCU_HEAT , E_TEMPERATURE=MCU_TEMP , CHAMBER_TEMPERATURE=MCU_ONBOARD_NTCK100K , diff --git a/user_templates/moonraker.conf b/user_templates/moonraker.conf index b86bd6202..bd96e978c 100644 --- a/user_templates/moonraker.conf +++ b/user_templates/moonraker.conf @@ -31,6 +31,21 @@ # [include moonraker/z_calibration.conf] # ----------------------------------------------------------------- +##### Spoolman plugin update management and server config --------- +# [include moonraker/spoolman.conf] +## If you want to change the default "localhost" IP, uncomment the two lines below to manually specify your Spoolman server IP +# [spoolman] +# server: http://YourSpoolmanIP:7912 +# ----------------------------------------------------------------- + +##### led_effect plugin update management ------------------------ +# [include moonraker/led_effect.conf] +# ----------------------------------------------------------------- + +##### TMC Autotune plugin update management ---------------------- +# [include moonraker/tmc_autotune.conf] +# ----------------------------------------------------------------- + ##### Add your custom moonraker config customizations and overrides below this line... # ------------------------------------------------------------------------------------ diff --git a/user_templates/overrides.cfg b/user_templates/overrides.cfg index 2b540fffe..cfb16a0a2 100644 --- a/user_templates/overrides.cfg +++ b/user_templates/overrides.cfg @@ -14,7 +14,7 @@ #> Main control MCUs are called "mcu" (and "secondary" when using a double MCU configuration) #> Toolhead CANboard MCUs are called "toolhead" -#> ERCF MCUs are called "ercf" +#> MMU/ERCF MCUs are called "mmu" # ------------------------------------------------------------------------------------------ diff --git a/user_templates/printer.cfg b/user_templates/printer.cfg index 9e3208a04..2551bdbb7 100644 --- a/user_templates/printer.cfg +++ b/user_templates/printer.cfg @@ -158,7 +158,13 @@ ### -------------------------------------------------------------------------------------- # [include config/hardware/lights/fcob_white.cfg] # [include config/hardware/lights/neopixel_caselight.cfg] -# [include config/hardware/lights/status_leds.cfg] +# [include config/hardware/lights/status_leds.cfg] # Standard StealthBurner style LEDs +# [include config/hardware/lights/status_leds_rainbow_barf.cfg] # Rainbow Barf StealthBurner style LEDs + +# The following files are to be used with the LED effect plugin: https://github.com/julianschill/klipper-led_effect +# [include config/hardware/lights/neopixel_caselight_effects.cfg] +# [include config/hardware/lights/status_leds_effects.cfg] # Standard StealthBurner style LEDs +# [include config/hardware/lights/status_leds_rainbow_barf_effects.cfg] # Rainbow Barf StealthBurner style LEDs # ---------------------------------------------------------------------------------------- @@ -193,16 +199,12 @@ # ---------------------------------------------------------------------------------------- -# ------------------------------------------------------------------------------ ERCF ----> Select either all lines or none +# --------------------------------------------------------------------------- MMU/ERCF ----> You can select multiple lines ### -------------------------------------------------------------------------------------- -### Klippain is designed to be used with the ERCF Happy Hare software: https://github.com/moggieuk/ERCF-Software-V3 -### Please run its own install script to get Happy Hare ready to be used -### Then, include all of the following files that are created during the installation of Happy Hare to enable ERCF in Klippain -# [include ercf_hardware.cfg] -# [include ercf_parameters.cfg] -# [include ercf_software.cfg] -# [include ercf_menu.cfg] # Optional: use it if you also have a Mini12864 display to add the ERCF menu entries -# [include config/hardware/ercf.cfg] +### Klippain is designed to be used with the MMU/ERCF HappyHare software backend: https://github.com/moggieuk/Happy-Hare +### Please refer to the corresponding Klippain documentation: https://github.com/Frix-x/klippain/blob/main/docs/mmu.md +# [include config/hardware/mmu.cfg] +# [include mmu/optional/mmu_menu.cfg] # Optional: use it if you also have a Mini12864 display and want to add the MMU/ERCF menu entries # ---------------------------------------------------------------------------------------- @@ -276,6 +278,13 @@ # ---------------------------------------------------------------------------------------- +# -------------------------------------------------------------------------- SPOOLMAN ---- +### -------------------------------------------------------------------------------------- +### You must have the Spoolman plugin installed... from here: https://github.com/Donkie/Spoolman +# [include config/software/spoolman.cfg] +# ---------------------------------------------------------------------------------------- + + ################################### ### DO NOT EDIT BELOW THIS LINE ### diff --git a/user_templates/save_variables.cfg b/user_templates/save_variables.cfg index 21009a950..133b160ad 100644 --- a/user_templates/save_variables.cfg +++ b/user_templates/save_variables.cfg @@ -1,15 +1,2 @@ [Variables] -ercf_calib_0 = 1.0 -ercf_calib_1 = 1.0 -ercf_calib_2 = 1.0 -ercf_calib_3 = 1.0 -ercf_calib_4 = 1.0 -ercf_calib_5 = 1.0 -ercf_calib_6 = 1.0 -ercf_calib_7 = 1.0 -ercf_calib_8 = 1.0 -ercf_calib_9 = 1.0 -ercf_calib_10 = 1.0 -ercf_calib_11 = 1.0 -ercf_calib_ref = 500.0 -ercf_calib_clog_length = 8.0 +mmu_calibration_0 = 1.0 diff --git a/user_templates/variables.cfg b/user_templates/variables.cfg index c9c67dc09..a2bced1e3 100644 --- a/user_templates/variables.cfg +++ b/user_templates/variables.cfg @@ -187,13 +187,15 @@ variable_material_parameters: { ################################################ -## ERCF specific variables +## MMU/ERCF specific variables ################################################ -## This section is only considered if an ERCF is installed and configured +## This section is only considered if an MMU/ERCF is installed and configured -variable_ercf_unload_on_cancel_print: False -variable_ercf_unload_on_end_print: True -variable_ercf_reset_stats_on_start_print: False +variable_mmu_force_homing_in_start_print: False +variable_mmu_unload_on_cancel_print: False +variable_mmu_unload_on_end_print: True +variable_mmu_check_gates_on_start_print: False # True is recommended but you must have TOOLS_USED=!referenced_tools! in your slicer START_PRINT parameters. Otherwise it will only check the INITIAL TOOL... +variable_mmu_check_errors_on_start_print: False # Set to True if you want an early check of MMU errors during the START_PRINT sequence. ################################################ ## Filter specific variables @@ -223,73 +225,26 @@ variable_purge_ooze_time: 10 # Time (in seconds) to wait after the purge to let variable_purgeclean_servo_angle_retracted: 0 variable_purgeclean_servo_angle_deployed: 90 - ## White light parameters (if installed in the machine) variable_light_intensity_start_print: 100 variable_light_intensity_printing: 30 variable_light_intensity_end_print: 0 +## Caselight LEDs ON at startup (caselight need to be installed in the machine) +variable_caselight_on_at_startup: False ## Patch the M190/M109 commands to avoid some wait time while the temperature ## settle on very low thermal latency devices (such as the BambuLabs hotend) variable_fix_heaters_temperature_settle: False - ## Resonnance testing position (if an accelerometer is installed in the machine) ## If test point is let to -1,-1, it default to the center of the bed at 50mm high variable_resonnance_test_point_xy: -1, -1 variable_resonnance_test_z_clearance: 50 -## SteathBurner minidisplay and case leds colors (if installed in the machine) -variable_status_leds_colors: { - 'logo': { - 'busy': {'r': 0.4, 'g': 0.0, 'b': 0.0, 'w': 0.0}, - 'cleaning': {'r': 0.0, 'g': 0.02, 'b': 0.5, 'w': 0.0}, - 'calibrating_z': {'r': 0.8, 'g': 0., 'b': 0.35, 'w': 0.0}, - 'heating': {'r': 0.3, 'g': 0.18, 'b': 0.0, 'w': 0.0}, - 'homing': {'r': 0.0, 'g': 0.6, 'b': 0.2, 'w': 0.0}, - 'leveling': {'r': 0.5, 'g': 0.1, 'b': 0.4, 'w': 0.0}, - 'meshing': {'r': 0.2, 'g': 1.0, 'b': 0.0, 'w': 0.0}, - 'on': {'r': 0.8, 'g': 0.8, 'b': 0.8, 'w':1.0}, - 'off': {'r': 0.0, 'g': 0.0, 'b': 0.0, 'w': 0.0}, - 'printing': {'r': 1.0, 'g': 0.0, 'b': 0.0, 'w': 0.0}, - 'standby': {'r': 0.01, 'g': 0.01, 'b': 0.01, 'w': 0.1}, - 'error': {'r': 0.6, 'g': 0.0, 'b': 0.0, 'w':0.0}, - }, - 'nozzle': { - 'heating': {'r': 0.8, 'g': 0.35, 'b': 0.0, 'w':0.0}, - 'off': {'r': 0.0, 'g': 0.0, 'b': 0.0, 'w': 0.0}, - 'on': {'r': 0.8, 'g': 0.8, 'b': 0.8, 'w':1.0}, - 'standby': {'r': 0.6, 'g': 0.0, 'b': 0.0, 'w':0.0}, - 'error': {'r': 0.6, 'g': 0.0, 'b': 0.0, 'w':0.0}, - }, - 'caselight': { - 'busy': {'r': 0.4, 'g': 0.0, 'b': 0.0, 'w': 0.0}, - 'cleaning': {'r': 0.0, 'g': 0.02, 'b': 0.5, 'w': 0.0}, - 'calibrating_z': {'r': 0.8, 'g': 0., 'b': 0.35, 'w': 0.0}, - 'heating': {'r': 0.3, 'g': 0.18, 'b': 0.0, 'w': 0.0}, - 'homing': {'r': 0.0, 'g': 0.6, 'b': 0.2, 'w': 0.0}, - 'leveling': {'r': 0.5, 'g': 0.1, 'b': 0.4, 'w': 0.0}, - 'meshing': {'r': 0.2, 'g': 1.0, 'b': 0.0, 'w': 0.0}, - 'on': {'r': 0.8, 'g': 0.8, 'b': 0.8, 'w':1.0}, - 'off': {'r': 0.0, 'g': 0.0, 'b': 0.0, 'w': 0.0}, - 'printing': {'r': 1.0, 'g': 0.0, 'b': 0.0, 'w': 0.0}, - 'standby': {'r': 0.01, 'g': 0.01, 'b': 0.01, 'w': 0.1}, - 'error': {'r': 0.6, 'g': 0.0, 'b': 0.0, 'w':0.0}, - }, - 'minidisplay': { - 'on': {'r': 0.0, 'g': 0.2, 'b': 0.4, 'w':1.0}, - 'off': {'r': 0.0, 'g': 0.0, 'b': 0.0, 'w': 0.0}, - 'error': {'r': 0.4, 'g': 0.0, 'b': 0.0, 'w':0.0}, - }, - 'thermal': { - 'hot': {'r': 1.0, 'g': 0.0, 'b': 0.0, 'w': 0.0}, - 'cold': {'r': 0.3, 'g': 0.0, 'b': 0.3, 'w': 0.0} - } - } - - +## ----------------------------------------------------------------------------------- +## ----------------------------------------------------------------------------------- ## Do not remove the next lines gcode: