From 34bc870dd270a8e4c0da141faf782f79a54e1bde Mon Sep 17 00:00:00 2001 From: ksummers92 <66363414+ksummers92@users.noreply.github.com> Date: Sat, 22 Jun 2024 10:17:22 -0500 Subject: [PATCH] Attempt to merge main in HH (#12) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Update install.sh * Added Fysetc Cheetah V2 to mcu_definitions * Change moonraker Klippain update manager * Create SKR Pico+Cheetah mcu_definitions * Added picobilicial mcu_definitions * Upstream main (#9) * Further parameterize nozzle brush variables * Update brush_center_offset.md * Fix default brush size * Added default values to nozzle_cleaning.cfg * Update Shake&Tune path This is due to a change in Shake&Tune v3.0.0 * fixed max_z bug in PARK macro * Update BTT_SKR_2.cfg to fix EXP1_4 typo (#578) * Nozzle cleaning parameters update (#569) * add built in adxl sensor from nitehawk sb board (#602) * add: mcu Fystec Cheetah v3 (#604) --------- Co-authored-by: Félix Boisselier Co-authored-by: tsk-2222 <111063724+tsk-2222@users.noreply.github.com> Co-authored-by: dev-aphex Co-authored-by: Minims --------- Co-authored-by: Félix Boisselier Co-authored-by: tsk-2222 <111063724+tsk-2222@users.noreply.github.com> Co-authored-by: dev-aphex Co-authored-by: Minims --- .../accelerometers/adxl345_nitehawk_sb.cfg | 8 ++ config/mcu_definitions/main/BTT_SKR_2.cfg | 2 +- .../main/Fysetc_Cheetah_V2.cfg | 47 +++++++++++ .../main/Fysetc_Cheetah_v3.x.cfg | 51 ++++++++++++ .../main/SKR_Pico+Fysetc_Cheetah_v2.cfg | 81 +++++++++++++++++++ .../toolhead/LDO_Picobilical.cfg | 14 ++++ docs/brush_center_offset.md | 24 ++++++ macros/base/park.cfg | 2 +- macros/helpers/nozzle_cleaning.cfg | 8 +- .../mcu_defaults/main/Fysetc_Cheetah_v3.x.cfg | 55 +++++++++++++ user_templates/printer.cfg | 1 + 11 files changed, 287 insertions(+), 6 deletions(-) create mode 100644 config/hardware/accelerometers/adxl345_nitehawk_sb.cfg create mode 100644 config/mcu_definitions/main/Fysetc_Cheetah_V2.cfg create mode 100644 config/mcu_definitions/main/Fysetc_Cheetah_v3.x.cfg create mode 100644 config/mcu_definitions/main/SKR_Pico+Fysetc_Cheetah_v2.cfg create mode 100644 config/mcu_definitions/toolhead/LDO_Picobilical.cfg create mode 100644 docs/brush_center_offset.md create mode 100644 user_templates/mcu_defaults/main/Fysetc_Cheetah_v3.x.cfg diff --git a/config/hardware/accelerometers/adxl345_nitehawk_sb.cfg b/config/hardware/accelerometers/adxl345_nitehawk_sb.cfg new file mode 100644 index 000000000..d2840dbec --- /dev/null +++ b/config/hardware/accelerometers/adxl345_nitehawk_sb.cfg @@ -0,0 +1,8 @@ +[include generics/adxl345_software_spi.cfg] + +# As it's a toolhead ADXL, we add some default pins overrides from here +[adxl345] +cs_pin: toolhead:MCU_ADXL_CS +spi_software_sclk_pin: toolhead:MCU_ADXL_SCK +spi_software_mosi_pin: toolhead:MCU_ADXL_MOSI +spi_software_miso_pin: toolhead:MCU_ADXL_MISO diff --git a/config/mcu_definitions/main/BTT_SKR_2.cfg b/config/mcu_definitions/main/BTT_SKR_2.cfg index 838159102..a943a5069 100644 --- a/config/mcu_definitions/main/BTT_SKR_2.cfg +++ b/config/mcu_definitions/main/BTT_SKR_2.cfg @@ -41,7 +41,7 @@ aliases: # EXP1 header EXP1_1=PC5 , EXP1_2=PB0 , - EXP1_3=PB1 , EXP1_4=PB9 , + EXP1_3=PB1 , EXP1_4=PE9 , EXP1_5=PE10 , EXP1_6=PE11 , # Key in the socket on this side EXP1_7=PE12 , EXP1_8=PE13 , EXP1_9= , EXP1_10=<5V> , diff --git a/config/mcu_definitions/main/Fysetc_Cheetah_V2.cfg b/config/mcu_definitions/main/Fysetc_Cheetah_V2.cfg new file mode 100644 index 000000000..e77940f12 --- /dev/null +++ b/config/mcu_definitions/main/Fysetc_Cheetah_V2.cfg @@ -0,0 +1,47 @@ +[board_pins mcu_manufacturer] +aliases: + MCU_XM_STEP=PC0 , MCU_XM_DIR=PC1 , MCU_XM_ENABLE=PA8 , MCU_XM_UART=0 , + MCU_YM_STEP=PC14 , MCU_YM_DIR=PC13 , MCU_YM_ENABLE=PC15 , MCU_YM_UART=2 , + MCU_ZM_STEP=PB9 , MCU_ZM_DIR=PB8 , MCU_ZM_ENABLE=PC2 , MCU_ZM_UART=1 , + MCU_EM_STEP=PB2 , MCU_EM_DIR=PA15 , MCU_EM_ENABLE=PD2 , MCU_EM_UART=3 , + MCU_TMCUART=PA3 , MCU_TMCTX=PA2 , + + MCU_XSTOP=PB4 , MCU_YSTOP=PC8 , MCU_ZSTOP=PB1 , + MCU_E0STOP=PB5 , + + MCU_HE0=PC6 , + MCU_BED=PC7 , + + MCU_TH0=PC4 , + MCU_THB=PC5 , + + MCU_FAN0=PA14 , MCU_FAN1=PA13 , MCU_FAN2=PA1 , + + # Z-Probe Header + MCU_PROBE=PA0 , + + # Neopixel1 Header + MCU_NEOPIXEL=PB0 , + + # EXP1 header + EXP1_1=<5V>, EXP1_2=, + EXP1_3=, EXP1_4=PC3, + EXP1_5=PA7, EXP1_6=PC11, # NOTCH ON OPPOSITE SIDE + EXP1_7=PA4, EXP1_8=PC10, + EXP1_9=PA5, EXP1_10=PA6, + # Pins EXP1_4, EXP1_8, EXP1_6 are also MISO, MOSI, SCK of bus "spi2" + + # EXP2 header + EXP2_1=<5V>, EXP2_2=, + EXP2_3=PB7, EXP2_4=PB6, + EXP2_5=PB14, EXP2_6=PB13, # NOTCH ON OPPOSITE SIDE + EXP2_7=PB12, EXP2_8=PB15, + EXP2_9=PC12, EXP2_10=PC9, + + # EXP3 header - NOTCH ON THIS SIDE + EXP3_9=, EXP3_7=PB12, EXP3_5=PC11, EXP3_3=PC10, EXP3_1=PC9, + EXP3_10=<5V>, EXP3_8=PB15, EXP3_6=PB13, EXP3_4=PB14, EXP3_2=PC12, + + # EXP4 header + EXP4_1=<5V>, EXP4_2=, EXP4_3=, EXP4_4=, + EXP4_5=<3.3V>, EXP4_6=, EXP4_7=, EXP4_8= \ No newline at end of file diff --git a/config/mcu_definitions/main/Fysetc_Cheetah_v3.x.cfg b/config/mcu_definitions/main/Fysetc_Cheetah_v3.x.cfg new file mode 100644 index 000000000..97ad9cf16 --- /dev/null +++ b/config/mcu_definitions/main/Fysetc_Cheetah_v3.x.cfg @@ -0,0 +1,51 @@ +[board_pins mcu_manufacturer] +aliases: + MCU_XM_STEP=PC0 , MCU_XM_DIR=PC1 , MCU_XM_ENABLE=PC3 , + MCU_YM_STEP=PC14 , MCU_YM_DIR=PC13 , MCU_YM_ENABLE=PC15 , + MCU_ZM_STEP=PB4 , MCU_ZM_DIR=PB5 , MCU_ZM_ENABLE=PC2 , + MCU_EM_STEP=PB2 , MCU_EM_DIR=PA15 , MCU_EM_ENABLE=PD2 , + MCU_TMCUART=PB3 , MCU_TMCTX=PA2 , + + MCU_XSTOP=PA2 , MCU_YSTOP=PA3 , MCU_ZSTOP=PC4 , + MCU_E0STOP=PA1 , + + MCU_HE0=PC7 , + MCU_BED=PC8 , + + MCU_TH0=PC5 , + MCU_THB=PB0 , + MCU_TH2=PB1 , + + MCU_FAN0=PA14 , MCU_FAN1=PA13 , MCU_FAN2=PA8 , + + # Z-Probe Header + MCU_SERVOS=PA0, MCU_PROBE=PC4 , + + # PI Header + MCU_Pi_PWR_UART_TX1=PA9 , + MCU_Pi_PWR_UART_RX1=PA10 , + + # ?? Header + MCU_P2_DP=PA11 , + MCU_P2_DM=PA12 , + + # EXP1 header + EXP1_1= , EXP1_2=<5V> , + EXP1_3=PB7 , EXP1_4=PB6 , + EXP1_5=PB14 , EXP1_6=PB13 , # Slot in the socket on this side + EXP1_7=PB12 , EXP1_8=PB15 , + EXP1_9=PC6 , EXP1_10=PB10 , + + # EXP2 header + EXP2_1= , EXP2_2=<5V> , + EXP2_3= , EXP2_4=PC12 , + EXP2_5=PA7 , EXP2_6=PC11 , # Slot in the socket on this side + EXP2_7=PA4 , EXP2_8=PC10 , + EXP2_9=PA5 ,EXP2_10=PA6 , + + # EXP3 header + EXP3_1=PB10 , EXP3_2=PC6 , + EXP3_3=PC10 , EXP3_4=PB14 , + EXP3_5=PC11 , EXP3_6=PB13 , # Slot in the socket on this side + EXP3_7=PB12 , EXP3_8=PB15 , + EXP3_9= , EXP3_10=<5V> \ No newline at end of file diff --git a/config/mcu_definitions/main/SKR_Pico+Fysetc_Cheetah_v2.cfg b/config/mcu_definitions/main/SKR_Pico+Fysetc_Cheetah_v2.cfg new file mode 100644 index 000000000..217226417 --- /dev/null +++ b/config/mcu_definitions/main/SKR_Pico+Fysetc_Cheetah_v2.cfg @@ -0,0 +1,81 @@ +################################################### +# First board_pins definition is for the SKR Pico # +################################################### + +[board_pins mcu_manufacturer] +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 , + +############################################################## +# Second board_pins definition is for secondary Cheetah mcu # +############################################################## + +[board_pins secondary_manufacturer] +mcu: secondary +aliases: + MCU_XM_STEP=PC0 , MCU_XM_DIR=PC1 , MCU_XM_ENABLE=PA8 , MCU_XM_UART=0 , + MCU_YM_STEP=PC14 , MCU_YM_DIR=PC13 , MCU_YM_ENABLE=PC15 , MCU_YM_UART=2 , + MCU_ZM_STEP=PB9 , MCU_ZM_DIR=PB8 , MCU_ZM_ENABLE=PC2 , MCU_ZM_UART=1 , + MCU_EM_STEP=PB2 , MCU_EM_DIR=PA15 , MCU_EM_ENABLE=PD2 , MCU_EM_UART=3 , + MCU_TMCUART=PA3 , MCU_TMCTX=PA2 , + + MCU_XSTOP=PB4 , MCU_YSTOP=PC8 , MCU_ZSTOP=PB1 , + MCU_E0STOP=PB5 , + + MCU_HE0=PC6 , + MCU_BED=PC7 , + + MCU_TH0=PC4 , + MCU_THB=PC5 , + + MCU_FAN0=PA14 , MCU_FAN1=PA13 , MCU_FAN2=PA1 , + + # Z-Probe Header + MCU_PROBE=PA0 , + + # Neopixel1 Header + MCU_NEOPIXEL=PB0 , + + # EXP1 header + EXP1_1=<5V>, EXP1_2=, + EXP1_3=, EXP1_4=PC3, + EXP1_5=PA7, EXP1_6=PC11, # NOTCH ON OPPOSITE SIDE + EXP1_7=PA4, EXP1_8=PC10, + EXP1_9=PA5, EXP1_10=PA6, + # Pins EXP1_4, EXP1_8, EXP1_6 are also MISO, MOSI, SCK of bus "spi2" + + # EXP2 header + EXP2_1=<5V>, EXP2_2=, + EXP2_3=PB7, EXP2_4=PB6, + EXP2_5=PB14, EXP2_6=PB13, # NOTCH ON OPPOSITE SIDE + EXP2_7=PB12, EXP2_8=PB15, + EXP2_9=PC12, EXP2_10=PC9, + + # EXP3 header - NOTCH ON THIS SIDE + EXP3_9=, EXP3_7=PB12, EXP3_5=PC11, EXP3_3=PC10, EXP3_1=PC9, + EXP3_10=<5V>, EXP3_8=PB15, EXP3_6=PB13, EXP3_4=PB14, EXP3_2=PC12, + + # EXP4 header + EXP4_1=<5V>, EXP4_2=, EXP4_3=, EXP4_4=, + EXP4_5=<3.3V>, EXP4_6=, EXP4_7=, EXP4_8= \ No newline at end of file diff --git a/config/mcu_definitions/toolhead/LDO_Picobilical.cfg b/config/mcu_definitions/toolhead/LDO_Picobilical.cfg new file mode 100644 index 000000000..bad924a9c --- /dev/null +++ b/config/mcu_definitions/toolhead/LDO_Picobilical.cfg @@ -0,0 +1,14 @@ +[board_pins toolhead_manufacturer] +mcu: toolhead +aliases: + MCU_HE0=gpio4 , MCU_TH0=gpio29 , + + MCU_PART_FAN=gpio2 , MCU_HE_FAN=gpio3 , + + MCU_NEOPIXEL1=gpio1 , MCU_NEOPIXEL2=gpio7 , + + MCU_BUZZER=gpio5 , MCU_CHAMBER_TEMP=gpio28 , + + MCU_FIL_DET=gpio6 , MCU_FIL_RUNOUT=gpio18 , + + MCU_XSTOP=gpio0 \ No newline at end of file diff --git a/docs/brush_center_offset.md b/docs/brush_center_offset.md new file mode 100644 index 000000000..5e425bd75 --- /dev/null +++ b/docs/brush_center_offset.md @@ -0,0 +1,24 @@ +The purpose of this document is to explain the purpose of the brush center offset variable in variables.cfg. + +The brush center offset takes the brush center and moves it in the direction of the brush normal by the specified amount. +This is useful for avoiding brush strokes that would cause the toolhead to crash into something or otherwise cause undesired affects. +One example (and the impetus for this feature) is the case in which one has a brush and a gantry-mounted depressor for a filament cutter on the same side of the gantry. If nozzle cleaning is perform with filament loaded and the brush strokes occur in the same space as the depressor, then the filament cutter is actuated (repeatedly) which results in unnecessary wear and unwanted filament cutting. +One could simply move the center of the brush away from the depressor, but this would cause the nozzle to leave the brush and be wasted motion. + +How it works: +The brush center should be set as normal in the variables.cfg file. The brush center offset should be set to a value (in mm) that will prevent the toolhead from crashing into anything. +The brush size is provided to accomodate different brush sizes and is used to calculate the brush stroke distance. + +For example, if the variable_brush_xyz is set to (40, 250, 2) and the variable_brush_center_offset is set to 10, then the new brush center will be (50, 250, 2). +This will create the following brush action: + + |-----------------------------|---------------|--------------| + left center center + offset right + ^ nozzle starts here + ---------------> first brush stroke direction {(brush size/2) - brush center offset} + <-------------------------------------------- n brush stroke direction {(brush size/2)} + --------------------------------------------> n+1 brush stroke direction {(brush size/2)} + +If variable_brush_center_offset is set to -10, then the new brush center will be (30, 250, 2) and the nozzle will start to the left of the center and do the mirror of the above brush action. + +Therefore, this allows the nozzle brushing action to occur entirely with the brush with no wasted motion or unwanted interactions with other components. diff --git a/macros/base/park.cfg b/macros/base/park.cfg index 504676e34..395812b5d 100644 --- a/macros/base/park.cfg +++ b/macros/base/park.cfg @@ -15,7 +15,7 @@ gcode: {% set St = printer["gcode_macro _USER_VARIABLES"].travel_speed * 60 %} {% set Sz = printer["gcode_macro _USER_VARIABLES"].z_drop_speed * 60 %} - {% set max_z = printer.toolhead.axis_maximum.z|float %} + {% set max_z = printer.toolhead.axis_maximum.z - printer.gcode_move.homing_origin.z |float %} {% set act_z = printer.toolhead.position.z|float %} {% set z_safe = act_z + Z_HOP %} diff --git a/macros/helpers/nozzle_cleaning.cfg b/macros/helpers/nozzle_cleaning.cfg index ad3e68b19..118dab703 100644 --- a/macros/helpers/nozzle_cleaning.cfg +++ b/macros/helpers/nozzle_cleaning.cfg @@ -6,9 +6,9 @@ gcode: {% set status_leds_enabled = printer["gcode_macro _USER_VARIABLES"].status_leds_enabled %} {% set brush_clean_accel = printer["gcode_macro _USER_VARIABLES"].brush_clean_accel %} {% set brush_over_y_axis = printer["gcode_macro _USER_VARIABLES"].brush_over_y_axis %} - {% set brush_offset = printer["gcode_macro _USER_VARIABLES"].brush_center_offset %} - {% set brush_size = printer["gcode_macro _USER_VARIABLES"].brush_width_x %} - {% set brushes = printer["gcode_macro _USER_VARIABLES"].brushes|int %} + {% set brush_offset = printer["gcode_macro _USER_VARIABLES"].brush_center_offset|default(0)|float %} + {% set brush_size = printer["gcode_macro _USER_VARIABLES"].brush_width_x|default(40)|float %} + {% set brushes = printer["gcode_macro _USER_VARIABLES"].brushes|default(6)|int %} {% set verbose = printer["gcode_macro _USER_VARIABLES"].verbose %} {% if purge_and_brush_enabled %} @@ -172,4 +172,4 @@ gcode: {% endif %} RESTORE_GCODE_STATE NAME=CONDITIONAL_MOVE_TO_PURGE_BUCKET_STATE - {% endif %} + {% endif %} \ No newline at end of file diff --git a/user_templates/mcu_defaults/main/Fysetc_Cheetah_v3.x.cfg b/user_templates/mcu_defaults/main/Fysetc_Cheetah_v3.x.cfg new file mode 100644 index 000000000..8942d8e74 --- /dev/null +++ b/user_templates/mcu_defaults/main/Fysetc_Cheetah_v3.x.cfg @@ -0,0 +1,55 @@ + +#------------------------------------# +#### Fystec Cheetah V3 definition #### +#------------------------------------# + +# https://github.com/FYSETC/Cheetah_V3.0 +[mcu] +##-------------------------------------------------------------------- +serial: /dev/serial/by-id/change-me-to-the-correct-mcu-path +##-------------------------------------------------------------------- + +[include config/mcu_definitions/main/Fysetc_Cheetah_v3.x.cfg] # Do not remove this line +[board_pins Cheetah_v3_mcu] +mcu: mcu +restart_method: command +aliases: + X_STEP=MCU_XM_STEP , X_DIR=MCU_XM_DIR , X_ENABLE=MCU_XM_ENABLE , + Y_STEP=MCU_YM_STEP , Y_DIR=MCU_YM_DIR , Y_ENABLE=MCU_YM_ENABLE , + Z_STEP=MCU_ZM_STEP , Z_DIR=MCU_ZM_DIR , Z_ENABLE=MCU_ZM_ENABLE , + E_STEP=MCU_EM_STEP , E_DIR=MCU_EM_DIR , E_ENABLE=MCU_EM_ENABLE , + + TMCUART=MCU_TMCUART , TMCTX=MCU_TMCTX , + + X_STOP=MCU_XSTOP , Y_STOP=MCU_YSTOP , Z_STOP=MCU_ZSTOP , + RUNOUT_SENSOR=MCU_E0STOP , + PROBE_INPUT=MCU_PROBE , + SERVO_PIN=MCU_SERVOS , + + E_HEATER=MCU_HE0 , E_TEMPERATURE=MCU_TH0 , + BED_HEATER=MCU_BED , BED_TEMPERATURE=MCU_THB , + + PART_FAN=MCU_FAN0 , E_FAN=MCU_FAN1 , CONTROLLER_FAN=MCU_FAN2 , + + +[tmc2209 stepper_x] +uart_pin: TMCUART +#tx_pin: TMCTX +uart_address: 0 + +[tmc2209 stepper_y] +uart_pin: TMCUART +#tx_pin: TMCTX +uart_address: 1 + +[tmc2209 stepper_z] +uart_pin: TMCUART +#tx_pin: TMCTX +uart_address: 2 + +# Comment this section if you are using a toolhead with its own MCU +[tmc2209 extruder] +uart_pin: TMCUART +#tx_pin: TMCTX +uart_address: 3 + diff --git a/user_templates/printer.cfg b/user_templates/printer.cfg index 9db3d1afe..4f93ead2c 100644 --- a/user_templates/printer.cfg +++ b/user_templates/printer.cfg @@ -198,6 +198,7 @@ # [include config/hardware/accelerometers/adxl345_sht.cfg] # For ADXL plugged in Mellow SHT36 or SHT42 boards # [include config/hardware/accelerometers/adxl345_BTT_SB22xx.cfg] # For ADXL plugged in BTT SB2209 or SB2240 boards # [include config/hardware/accelerometers/adxl345_Fysetc_SB_Can_TH.cfg] # For ADXL plugged in Fysetc SB Can TH boards +# [include config/hardware/accelerometers/adxl345_nitehawk_sb.cfg] # For built in ADXL sensor on the Nitehawk SB board # [include config/hardware/accelerometers/lis2dw_usb_rp2040_spi1.cfg] # For BTT S2DW V1.0, ...