From e8218a65415b794bedbdfc27a1fef1486bca07d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Boisselier?= Date: Wed, 30 Aug 2023 21:57:27 +0000 Subject: [PATCH 1/5] improved homing Zlogic for V0.2 style printers --- macros/base/homing/homing_override.cfg | 17 +++++++++++++---- macros/helpers/prime_line.cfg | 4 +++- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/macros/base/homing/homing_override.cfg b/macros/base/homing/homing_override.cfg index 4b8c76fa2..3171a585c 100644 --- a/macros/base/homing/homing_override.cfg +++ b/macros/base/homing/homing_override.cfg @@ -5,7 +5,7 @@ gcode: {% set verbose = printer["gcode_macro _USER_VARIABLES"].verbose %} {% set kinematics = printer["configfile"].config["printer"]["kinematics"] %} {% set probe_type_enabled = printer["gcode_macro _USER_VARIABLES"].probe_type_enabled %} - {% set homing_zhop = printer["gcode_macro _USER_VARIABLES"].homing_zhop|float %} + {% set homing_zhop = printer["gcode_macro _USER_VARIABLES"].homing_zhop|float|abs %} {% set homing_travel_speed = printer["gcode_macro _USER_VARIABLES"].homing_travel_speed * 60 %} {% set homing_travel_accel = printer["gcode_macro _USER_VARIABLES"].homing_travel_accel %} {% set sensorless_homing_enabled = printer["gcode_macro _USER_VARIABLES"].sensorless_homing_enabled %} @@ -86,9 +86,15 @@ gcode: {% if ('z' in printer.toolhead.homed_axes) %} {% if (printer.toolhead.position.z < homing_zhop) %} {% if verbose %} - { action_respond_info("Z too low, performing ZHOP") } + { action_respond_info("Z too low, performing ZHOP to rehome Z") } {% endif %} + G91 G0 Z{homing_zhop} F{z_drop_speed} + G90 + {% else %} + {% if verbose %} + { action_respond_info("Z already safe, no ZHOP needed to rehome Z") } + {% endif %} {% endif %} {% elif ('xy' in printer.toolhead.homed_axes) %} {% if verbose %} @@ -348,6 +354,8 @@ gcode: [gcode_macro _GOTO_Z_PROBE] description: Move to z probe avoiding the probe dock gcode: + {% set verbose = printer["gcode_macro _USER_VARIABLES"].verbose %} + # If the auto z calibration plugin is enabled, then we use the z endstop coordinates set in its config section [z_calibration] # Else we fall back on the variable_zendstop_position set in the variables.cfg file {% set zcalib_plugin_enabled = printer["gcode_macro _USER_VARIABLES"].zcalib_plugin_enabled %} @@ -386,9 +394,10 @@ gcode: {% if avoid_dock == true %} - # avoid Y + {% if verbose %} + { action_respond_info("Avoiding probe dock to home Z...") } + {% endif %} G0 Y{probe_dock_location_y - probe_dock_margin_y} F{homing_travel_speed} - #go z endstop X G0 X{z_endstop_x} F{homing_travel_speed} {% endif %} diff --git a/macros/helpers/prime_line.cfg b/macros/helpers/prime_line.cfg index 9815179da..84e800d8c 100644 --- a/macros/helpers/prime_line.cfg +++ b/macros/helpers/prime_line.cfg @@ -71,7 +71,9 @@ gcode: G91 M83 - G1 Z5 F{Sz} + {% if (printer.toolhead.position.z < 5) %} + G1 Z5 F{Sz} + {% endif %} # Starting position G90 From 615c2f775ddb2e410e4cc0b4dd8e569b1bd656d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Boisselier?= Date: Sun, 3 Sep 2023 17:11:20 +0000 Subject: [PATCH 2/5] fixed the check probe macro to effectively query the last action --- macros/base/probing/dockable_probe.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/macros/base/probing/dockable_probe.cfg b/macros/base/probing/dockable_probe.cfg index 5a9c68103..d3739b7e7 100644 --- a/macros/base/probing/dockable_probe.cfg +++ b/macros/base/probing/dockable_probe.cfg @@ -298,7 +298,7 @@ gcode: variable_probe_state: 0 gcode: Query_Probe - _SET_PROBE_STATE action={ ACTION } + _SET_PROBE_STATE action={ params.ACTION } # due to how templates are evaluated, we have query endstops in one From 88f8612d2d7a5819ab9c8411be300934be4377cd Mon Sep 17 00:00:00 2001 From: NanoMetere Date: Sun, 10 Sep 2023 23:52:23 +0900 Subject: [PATCH 3/5] Update BTT_Octopus_Max.cfg (#291) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit typo: add a missing comma Co-authored-by: Félix Boisselier --- config/mcu_definitions/main/BTT_Octopus_Max.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/mcu_definitions/main/BTT_Octopus_Max.cfg b/config/mcu_definitions/main/BTT_Octopus_Max.cfg index 71a7b2d1e..f27dc5ca0 100644 --- a/config/mcu_definitions/main/BTT_Octopus_Max.cfg +++ b/config/mcu_definitions/main/BTT_Octopus_Max.cfg @@ -32,7 +32,7 @@ aliases: MCU_NEOPIXEL2=PE9 , MCU_PS_ON=PF13 , MCU_POWER_DET=PF12 , - MCU_FWS0=PC0 , MCU_FWS1=PF10 + MCU_FWS0=PC0 , MCU_FWS1=PF10 , # EXP1 header EXP1_1=PG2 , EXP1_2=PD15 , From b24e44add7491a72e95c190809732f9387dc5f81 Mon Sep 17 00:00:00 2001 From: Paulo Pacheco Date: Sun, 10 Sep 2023 12:03:26 -0300 Subject: [PATCH 4/5] feat: add TMC5160 driver to X/Y (#289) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Félix Boisselier --- config/hardware/axis/X/TMC/TMC5160.cfg | 15 +++++++++++++++ config/hardware/axis/Y/TMC/TMC5160.cfg | 15 +++++++++++++++ config/mcu_definitions/main/BTT_Octopus_Max.cfg | 4 +++- user_templates/mcu.cfg | 2 ++ .../mcu_defaults/main/BTT_Octopus_Max.cfg | 4 ++++ 5 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 config/hardware/axis/X/TMC/TMC5160.cfg create mode 100644 config/hardware/axis/Y/TMC/TMC5160.cfg diff --git a/config/hardware/axis/X/TMC/TMC5160.cfg b/config/hardware/axis/X/TMC/TMC5160.cfg new file mode 100644 index 000000000..98bb51a57 --- /dev/null +++ b/config/hardware/axis/X/TMC/TMC5160.cfg @@ -0,0 +1,15 @@ +# X TMC5160 definition + +[gcode_macro _USER_VARIABLES] +variable_x_driver: "tmc5160" +gcode: + +[tmc5160 stepper_x] +cs_pin: X_TMCUART +spi_software_sclk_pin: DRIVER_SPI_SCK +spi_software_mosi_pin: DRIVER_SPI_MOSI +spi_software_miso_pin: DRIVER_SPI_MISO +interpolate: True +run_current: 0.8 +sense_resistor: 0.110 +stealthchop_threshold: 0 diff --git a/config/hardware/axis/Y/TMC/TMC5160.cfg b/config/hardware/axis/Y/TMC/TMC5160.cfg new file mode 100644 index 000000000..90598c190 --- /dev/null +++ b/config/hardware/axis/Y/TMC/TMC5160.cfg @@ -0,0 +1,15 @@ +# Y TMC5160 definition + +[gcode_macro _USER_VARIABLES] +variable_y_driver: "tmc5160" +gcode: + +[tmc5160 stepper_y] +cs_pin: Y_TMCUART +spi_software_sclk_pin: DRIVER_SPI_SCK +spi_software_mosi_pin: DRIVER_SPI_MOSI +spi_software_miso_pin: DRIVER_SPI_MISO +interpolate: True +run_current: 0.8 +sense_resistor: 0.110 +stealthchop_threshold: 0 diff --git a/config/mcu_definitions/main/BTT_Octopus_Max.cfg b/config/mcu_definitions/main/BTT_Octopus_Max.cfg index f27dc5ca0..b7ba20521 100644 --- a/config/mcu_definitions/main/BTT_Octopus_Max.cfg +++ b/config/mcu_definitions/main/BTT_Octopus_Max.cfg @@ -32,7 +32,9 @@ aliases: MCU_NEOPIXEL2=PE9 , MCU_PS_ON=PF13 , MCU_POWER_DET=PF12 , - MCU_FWS0=PC0 , MCU_FWS1=PF10 , + MCU_FWS0=PC0 , MCU_FWS1=PF10 , + + MCU_SPI4_MOSI=PE14 , MCU_SPI4_MISO=PE13 , MCU_SPI4_SCK=PE12 , # EXP1 header EXP1_1=PG2 , EXP1_2=PD15 , diff --git a/user_templates/mcu.cfg b/user_templates/mcu.cfg index 3c6065eb6..94aa22eb9 100644 --- a/user_templates/mcu.cfg +++ b/user_templates/mcu.cfg @@ -23,10 +23,12 @@ # [include config/hardware/axis/X/TMC/TMC2209.cfg] # [include config/hardware/axis/X/TMC/TMC2209_V0specific.cfg] # Should only be used for early LDO V0 kits to mitigate the known VFAs issue # [include config/hardware/axis/X/TMC/TMC2240.cfg] +# [include config/hardware/axis/X/TMC/TMC5160.cfg] ### 2. Y Drivers ------------------------------------------------------------------------- # [include config/hardware/axis/Y/TMC/TMC2209.cfg] # [include config/hardware/axis/Y/TMC/TMC2209_V0specific.cfg] # Should only be used for early LDO V0 kits to mitigate the known VFAs issue # [include config/hardware/axis/Y/TMC/TMC2240.cfg] +# [include config/hardware/axis/Y/TMC/TMC5160.cfg] ### 3. Z Drivers ------------------------------------------------------------------------- # [include config/hardware/axis/Z/TMC/TMC2209_1-Motor.cfg] # [include config/hardware/axis/Z/TMC/TMC2209_3-Motors.cfg] diff --git a/user_templates/mcu_defaults/main/BTT_Octopus_Max.cfg b/user_templates/mcu_defaults/main/BTT_Octopus_Max.cfg index 2c890d285..05052f08c 100644 --- a/user_templates/mcu_defaults/main/BTT_Octopus_Max.cfg +++ b/user_templates/mcu_defaults/main/BTT_Octopus_Max.cfg @@ -26,6 +26,10 @@ aliases: E_STEP=MCU_MOTOR6_STEP , E_DIR=MCU_MOTOR6_DIR , E_ENABLE=MCU_MOTOR6_ENABLE , E_TMCUART=MCU_MOTOR6_UART , + DRIVER_SPI_MOSI=MCU_SPI4_MOSI , # Used in case of SPI drivers such as TMC2240 or TMC5160 + DRIVER_SPI_MISO=MCU_SPI4_MISO , # Used in case of SPI drivers such as TMC2240 or TMC5160 + DRIVER_SPI_SCK=MCU_SPI4_SCK , # Used in case of SPI drivers such as TMC2240 or TMC5160 + X_STOP=MCU_STOP0 , Y_STOP=MCU_STOP1 , Z_STOP=MCU_STOP2 , PROBE_INPUT=MCU_STOP7 , RUNOUT_SENSOR=MCU_FWS0 , From 82e951b66d56de67c4643707c907ef6ebb8aefd6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Boisselier?= Date: Tue, 12 Sep 2023 10:22:38 +0200 Subject: [PATCH 5/5] added SKR3 support (#292) Co-authored-by: Benoitone <63300355+Benoitone@users.noreply.github.com> Co-authored-by: Benoitone --- config/mcu_definitions/main/BTT_SKR_3.cfg | 59 +++++++++++++++++++ .../mcu_defaults/main/BTT_Manta_M8P_v1.0.cfg | 1 + .../mcu_defaults/main/BTT_Manta_M8P_v1.1.cfg | 1 + .../mcu_defaults/main/BTT_Octopus_Max.cfg | 1 + .../mcu_defaults/main/BTT_SKR_3.cfg | 32 ++++++++++ .../mcu_defaults/main/BTT_SKR_Pico_v1.0.cfg | 4 +- 6 files changed, 96 insertions(+), 2 deletions(-) create mode 100644 config/mcu_definitions/main/BTT_SKR_3.cfg create mode 100644 user_templates/mcu_defaults/main/BTT_SKR_3.cfg diff --git a/config/mcu_definitions/main/BTT_SKR_3.cfg b/config/mcu_definitions/main/BTT_SKR_3.cfg new file mode 100644 index 000000000..e36ee96a9 --- /dev/null +++ b/config/mcu_definitions/main/BTT_SKR_3.cfg @@ -0,0 +1,59 @@ +[board_pins mcu_manufacturer] +aliases: + MCU_XM_STEP=PD4 , MCU_XM_DIR=PD3 , MCU_XM_ENABLE=PD6 , MCU_XM_UART=PD5 , + MCU_YM_STEP=PA15 , MCU_YM_DIR=PA8 , MCU_YM_ENABLE=PD1 , MCU_YM_UART=PD0 , + MCU_ZM_STEP=PE2 , MCU_ZM_DIR=PE3 , MCU_ZM_ENABLE=PE0 , MCU_ZM_UART=PE1 , + MCU_E0M_STEP=PD15 , MCU_E0M_DIR=PD14 , MCU_E0M_ENABLE=PC7 , MCU_E0M_UART=PC6 , + MCU_E1M_STEP=PD11 , MCU_E1M_DIR=PD10 , MCU_E1M_ENABLE=PD13 , MCU_E1M_UART=PD12 , + + MCU_MOTSPI_MISO=PE15 , MCU_MOTSPI_MOSI=PE13 , MCU_MOTSPI_SCK=PE14 , + + MCU_XSTOP=PC1 , MCU_YSTOP=PC3 , MCU_ZSTOP=PC0 , + MCU_E0DET=PC2 , MCU_E1DET=PA0 , MCU_PWRDET=PC15 , + + MCU_HE0=PB3 , MCU_HE1=PB4 , + MCU_BED=PD7 , + + MCU_PSON=PE4 , + + MCU_TB=PA1 , MCU_TH0=PA2 , MCU_TH1=PA3 , + + MCU_FAN0=PB7 , MCU_FAN1=PB6 , MCU_FAN2=PB5 , + + MCU_RGB=PE6 , + + MCU_SERVOS=PE5 , MCU_PROBE=PC13 , + + # EXP1 header + EXP1_1=PC5 , EXP1_2=PB0 , + EXP1_3=PB1 , EXP1_4=PE8 , + EXP1_5=PE9 , EXP1_6=PE10 , # Key in the socket on this side + EXP1_7=PE11 , EXP1_8=PE12 , + EXP1_9= , EXP1_10=<5V> , + + # EXP2 header + EXP2_1=PA6 , EXP2_2=PA5 , + EXP2_3=PE7 , EXP2_4=PA4 , + EXP2_5=PB2 , EXP2_6=PA7 , # Key in the socket on this side + EXP2_7=PC4 , EXP2_8= , + EXP2_9= , EXP2_10= , + + # TFT header + MCU_TFT_1=<5V> , + MCU_TFT_2= , + MCU_TFT_3=PA9 , + MCU_TFT_4=PA10 , + MCU_TFT_5= , + + # Mini-SD + MCU_MINISD_DATA1=PC9 , MCU_MINISD_DATA0=PC8 , MCU_MINISD_CLK=PC12 , MCU_MINISD_CMD=PD2 , MCU_MINISD_DATA3=PC11 , MCU_MINISD_DATA2=PC10 , + + # WIFI + MCU_WIFI_GND= , MCU_WIFI_VCC=<3.3V> , + MCU_WIFI_IO15=PB12 , MCU_WIFI_IO13=PB15 , + MCU_WIFI_IO2= , MCU_WIFI_IO12=PB14 , + MCU_WIFI_IO0=PB10 , MCU_WIFI_IO14=PB13 , + MCU_WIFI_IO4=PB11 , MCU_WIFI_IO16= , + MCU_WIFI_IO5= , MCU_WIFI_EN= , + MCU_WIFI_RXD=PD8 , MCU_WIFI_ADC= , + MCU_WIFI_TXD=PD9 , MCU_WIFI_RST=PC14 , diff --git a/user_templates/mcu_defaults/main/BTT_Manta_M8P_v1.0.cfg b/user_templates/mcu_defaults/main/BTT_Manta_M8P_v1.0.cfg index 618cae430..f239f292b 100644 --- a/user_templates/mcu_defaults/main/BTT_Manta_M8P_v1.0.cfg +++ b/user_templates/mcu_defaults/main/BTT_Manta_M8P_v1.0.cfg @@ -51,3 +51,4 @@ aliases: LIGHT_NEOPIXEL=MCU_RGB2 , SERVO_PIN=MCU_PROBE1 , + diff --git a/user_templates/mcu_defaults/main/BTT_Manta_M8P_v1.1.cfg b/user_templates/mcu_defaults/main/BTT_Manta_M8P_v1.1.cfg index 9030e9b78..17aa4c3a1 100644 --- a/user_templates/mcu_defaults/main/BTT_Manta_M8P_v1.1.cfg +++ b/user_templates/mcu_defaults/main/BTT_Manta_M8P_v1.1.cfg @@ -51,3 +51,4 @@ aliases: LIGHT_NEOPIXEL=MCU_RGB2 , SERVO_PIN=MCU_PROBE1 , + diff --git a/user_templates/mcu_defaults/main/BTT_Octopus_Max.cfg b/user_templates/mcu_defaults/main/BTT_Octopus_Max.cfg index 05052f08c..719bc5c09 100644 --- a/user_templates/mcu_defaults/main/BTT_Octopus_Max.cfg +++ b/user_templates/mcu_defaults/main/BTT_Octopus_Max.cfg @@ -49,3 +49,4 @@ aliases: STATUS_NEOPIXEL=MCU_NEOPIXEL , SERVO_PIN=MCU_SERVOS , + diff --git a/user_templates/mcu_defaults/main/BTT_SKR_3.cfg b/user_templates/mcu_defaults/main/BTT_SKR_3.cfg new file mode 100644 index 000000000..1215052dd --- /dev/null +++ b/user_templates/mcu_defaults/main/BTT_SKR_3.cfg @@ -0,0 +1,32 @@ +#-------------------------------------# +#### BTT SKR3 definition #### +#-------------------------------------# + +[mcu] +##-------------------------------------------------------------------- +serial: /dev/serial/by-id/change-me-to-the-correct-mcu-path +# canbus_uuid: change-me-to-the-correct-canbus-id +##-------------------------------------------------------------------- + +[include config/mcu_definitions/main/BTT_SKR_3.cfg] # Do not remove this line +[board_pins SKR_3_mcu] +mcu: mcu +aliases: + X_STEP=MCU_XM_STEP , X_DIR=MCU_XM_DIR , X_ENABLE=MCU_XM_ENABLE , X_TMCUART=MCU_XM_UART , + Y_STEP=MCU_YM_STEP , Y_DIR=MCU_YM_DIR , Y_ENABLE=MCU_YM_ENABLE , Y_TMCUART=MCU_YM_UART , + Z_STEP=MCU_ZM_STEP , Z_DIR=MCU_ZM_DIR , Z_ENABLE=MCU_ZM_ENABLE , Z_TMCUART=MCU_ZM_UART , + E_STEP=MCU_E0M_STEP , E_DIR=MCU_E0M_DIR , E_ENABLE=MCU_E0M_ENABLE , E_TMCUART=MCU_E0M_UART , + + X_STOP=MCU_XSTOP , Y_STOP=MCU_YSTOP , Z_STOP=MCU_ZSTOP , + RUNOUT_SENSOR=MCU_E0DET , + PROBE_INPUT=MCU_PROBE , + SERVO_PIN=MCU_SERVOS , + + E_HEATER=MCU_HE0 , E_TEMPERATURE=MCU_TH0 , + BED_HEATER=MCU_BED , BED_TEMPERATURE=MCU_TH1 , + + PART_FAN=MCU_FAN0 , E_FAN=MCU_FAN1 , CONTROLLER_FAN=MCU_FAN2 , + + STATUS_NEOPIXEL=MCU_RGB , + # LIGHT_NEOPIXEL=MCU_RGB , + 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 80ed358a1..abe07163e 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 @@ -30,7 +30,7 @@ aliases: CONTROLLER_FAN=MCU_FAN3 , STATUS_NEOPIXEL=MCU_RGB , - + [tmc2209 stepper_x] uart_pin: TMCUART tx_pin: TMCTX @@ -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 +# comment this section if you are using a toolhead with own mcu OR if you use an MMU with Happy_Hare V2 [tmc2209 extruder] uart_pin: TMCUART tx_pin: TMCTX