diff --git a/config/hardware/lights/config_colors.cfg b/config/hardware/lights/config_colors.cfg index 14a646bc7..681fcb60c 100644 --- a/config/hardware/lights/config_colors.cfg +++ b/config/hardware/lights/config_colors.cfg @@ -46,7 +46,6 @@ variable_colors: { '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}, - 'shutdown': {'r': 0.0, 'g': 0.0, 'b': 0.0, 'w': 0.0}, }, 'thermal': { 'hot': {'r': 1.0, 'g': 0.0, 'b': 0.0, 'w': 0.0}, diff --git a/config/hardware/lights/neopixel_caselight_effects.cfg b/config/hardware/lights/neopixel_caselight_effects.cfg index 748e20814..6d593d236 100644 --- a/config/hardware/lights/neopixel_caselight_effects.cfg +++ b/config/hardware/lights/neopixel_caselight_effects.cfg @@ -3,8 +3,7 @@ [gcode_macro _USER_VARIABLES] variable_status_leds_caselight_enabled = True -variable_status_leds_effects_enabled = True -variable_status_leds_caselight_led_name: "caselight" +variable_status_leds_caselight_led_name: "caselight_effects" gcode: # Also include directly the leds control macros from here diff --git a/config/hardware/lights/status_leds_effects.cfg b/config/hardware/lights/status_leds_effects.cfg index f14cbe7bf..8cf00f0e1 100644 --- a/config/hardware/lights/status_leds_effects.cfg +++ b/config/hardware/lights/status_leds_effects.cfg @@ -3,10 +3,9 @@ [gcode_macro _USER_VARIABLES] variable_status_leds_enabled: True -variable_status_leds_effects_enabled: True -variable_status_leds_logo_led_name: "status_leds" +variable_status_leds_logo_led_name: "status_leds_effects" variable_status_leds_logo_idx: '1' -variable_status_leds_nozzle_led_name: "status_leds" +variable_status_leds_nozzle_led_name: "status_leds_effects" variable_status_leds_nozzle_idx: '2,3' gcode: diff --git a/config/hardware/lights/status_leds_rainbow_barf.cfg b/config/hardware/lights/status_leds_rainbow_barf.cfg index 828037ee6..2463794ce 100644 --- a/config/hardware/lights/status_leds_rainbow_barf.cfg +++ b/config/hardware/lights/status_leds_rainbow_barf.cfg @@ -3,7 +3,6 @@ [gcode_macro _USER_VARIABLES] variable_status_leds_enabled: True -variable_status_leds_effects_enabled: False 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" diff --git a/config/hardware/lights/status_leds_rainbow_barf_effects.cfg b/config/hardware/lights/status_leds_rainbow_barf_effects.cfg index 14c7e6e9f..9221b5080 100644 --- a/config/hardware/lights/status_leds_rainbow_barf_effects.cfg +++ b/config/hardware/lights/status_leds_rainbow_barf_effects.cfg @@ -3,10 +3,9 @@ [gcode_macro _USER_VARIABLES] variable_status_leds_enabled: True -variable_status_leds_effects_enabled: True -variable_status_leds_logo_led_name: "status_leds" +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" +variable_status_leds_nozzle_led_name: "status_leds_effects" variable_status_leds_nozzle_idx: '9,10' gcode: diff --git a/config/hardware/mmu.cfg b/config/hardware/mmu.cfg index ab9ca8228..1df0ad5f7 100644 --- a/config/hardware/mmu.cfg +++ b/config/hardware/mmu.cfg @@ -11,4 +11,5 @@ 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 0023b0844..06e87e844 100644 --- a/config/machine.cfg +++ b/config/machine.cfg @@ -1,25 +1,30 @@ [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 +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/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/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/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/park.cfg b/macros/base/park.cfg index c34e559d2..0c1196925 100644 --- a/macros/base/park.cfg +++ b/macros/base/park.cfg @@ -6,7 +6,6 @@ gcode: {% 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 %} diff --git a/macros/hardware_functions/status_leds.cfg b/macros/hardware_functions/status_leds.cfg index a2acdd0c4..0e170653c 100644 --- a/macros/hardware_functions/status_leds.cfg +++ b/macros/hardware_functions/status_leds.cfg @@ -22,10 +22,6 @@ gcode: {% set led = params.LED|string %} {% set idx = (params.IDX|string).split(',') %} {% set transmit_last = params.TRANSMIT|default(1) %} - - {% if printer["gcode_macro _USER_VARIABLES"].status_leds_effects_enabled %} - STOP_LED_EFFECTS LEDS="neopixel:"{led}" ("{params.IDX}")" - {% endif %} {% for led_index in idx %} {% set transmit=transmit_last if loop.last else 0 %} @@ -188,13 +184,7 @@ gcode: 'nozzle': 'error', 'caselight': 'error', 'minidisplay': 'error' - }, - 'shutdown': { - 'logo': 'off', - 'nozzle': 'off', - 'caselight': 'off', - 'minidisplay': 'shutdown' - } + } } %} {% if not (color in status_color) %} @@ -202,27 +192,23 @@ gcode: {% endif %} {% if printer["gcode_macro _USER_VARIABLES"].status_leds_enabled %} - {% if printer["gcode_macro _USER_VARIABLES"].status_leds_effects_enabled == False %} + {% 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 - {% else %} + {% 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%} - {% if printer["gcode_macro _USER_VARIABLES"].status_leds_effects_enabled == False %} + {% 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 - {% else %} + {% 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 %} - {% if printer["gcode_macro _USER_VARIABLES"].status_leds_minidisplay_knob_only %} - _SET_LEDS_BY_NAME LEDS="minidisplay" COLOR={status_color[color].minidisplay} TRANSMIT=1 - {% else %} - _SET_ALLLEDS_BY_NAME LEDS="minidisplay" COLOR={status_color[color].minidisplay} TRANSMIT=1 - {% endif %} + _SET_ALLLEDS_BY_NAME LEDS="minidisplay" COLOR={status_color[color].minidisplay} TRANSMIT=1 {% endif %} 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/miscs/startup.cfg b/macros/miscs/startup.cfg index 7e5806c60..ab55531a5 100644 --- a/macros/miscs/startup.cfg +++ b/macros/miscs/startup.cfg @@ -2,18 +2,13 @@ # and inits process used in Klippain [delayed_gcode KLIPPAIN_STARTUP] -initial_duration: 0.0001 +initial_duration: 1 gcode: _KLIPPAIN_STARTUP [gcode_macro _KLIPPAIN_STARTUP] gcode: - ## Set boot logo - {% if printer["gcode_macro _USER_VARIABLES"].minidisplay_bootlogo_enabled %} - _INIT_BOOT_LOGO - {% endif %} - # Print system information using the system_info.py script to log them in the klippy.log RUN_SHELL_COMMAND CMD=system_info @@ -42,9 +37,6 @@ gcode: _INIT_CHECK_MMU {% endif %} - ## Set the startup status LED - _INIT_LEDS - # User custom startup process. Define them in your overrides.cfg if needed :) _INIT_USERCUSTOM @@ -57,7 +49,7 @@ gcode: [gcode_macro _INIT_LEDS] gcode: - {% if printer["gcode_macro _USER_VARIABLES"].status_leds_enabled or printer["gcode_macro _USER_VARIABLES"].status_leds_caselight_enabled %} + {% 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 %} @@ -112,8 +104,6 @@ gcode: {% if zcalib_plugin_enabled %} {% if probe_type_enabled == "vorontap" %} { action_raise_error("Voron TAP Probe and Z calibration plugin cannot be used at the same time in Klippain!") } - {% elif probe_type_enabled == "bltouch" %} - { action_raise_error("BLTouch Probe and Z calibration plugin cannot be used at the same time in Klippain!") } {% elif probe_type_enabled == "inductive" %} { action_raise_error("Inductive probe and Z calibration plugin cannot be used at the same time in Klippain!") } {% elif probe_type_enabled == "dockable_virtual" or probe_type_enabled == "inductive_virtual" %} 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/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/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_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/printer.cfg b/user_templates/printer.cfg index 8d123aff8..cf6dd6abf 100644 --- a/user_templates/printer.cfg +++ b/user_templates/printer.cfg @@ -156,7 +156,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 # ---------------------------------------------------------------------------------------- @@ -189,16 +195,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 # ---------------------------------------------------------------------------------------- @@ -272,6 +274,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 ###