Skip to content

Commit

Permalink
Merge pull request #293 from Frix-x/develop
Browse files Browse the repository at this point in the history
v4.1.1
  • Loading branch information
Frix-x authored Sep 12, 2023
2 parents 2133a2d + aea8cf6 commit 0122cd3
Show file tree
Hide file tree
Showing 13 changed files with 152 additions and 9 deletions.
15 changes: 15 additions & 0 deletions config/hardware/axis/X/TMC/TMC5160.cfg
Original file line number Diff line number Diff line change
@@ -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
15 changes: 15 additions & 0 deletions config/hardware/axis/Y/TMC/TMC5160.cfg
Original file line number Diff line number Diff line change
@@ -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
4 changes: 3 additions & 1 deletion config/mcu_definitions/main/BTT_Octopus_Max.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -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 ,
Expand Down
59 changes: 59 additions & 0 deletions config/mcu_definitions/main/BTT_SKR_3.cfg
Original file line number Diff line number Diff line change
@@ -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=<GND> , 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=<RST> ,
EXP2_9=<GND> , EXP2_10=<NC> ,

# TFT header
MCU_TFT_1=<5V> ,
MCU_TFT_2=<GND> ,
MCU_TFT_3=PA9 ,
MCU_TFT_4=PA10 ,
MCU_TFT_5=<RST> ,

# 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=<GND> , MCU_WIFI_VCC=<3.3V> ,
MCU_WIFI_IO15=PB12 , MCU_WIFI_IO13=PB15 ,
MCU_WIFI_IO2=<NC> , MCU_WIFI_IO12=PB14 ,
MCU_WIFI_IO0=PB10 , MCU_WIFI_IO14=PB13 ,
MCU_WIFI_IO4=PB11 , MCU_WIFI_IO16=<NC> ,
MCU_WIFI_IO5=<NC> , MCU_WIFI_EN=<NC> ,
MCU_WIFI_RXD=PD8 , MCU_WIFI_ADC=<NC> ,
MCU_WIFI_TXD=PD9 , MCU_WIFI_RST=PC14 ,
17 changes: 13 additions & 4 deletions macros/base/homing/homing_override.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -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 %}
Expand Down Expand Up @@ -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 %}
Expand Down Expand Up @@ -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 %}
Expand Down Expand Up @@ -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 %}

Expand Down
2 changes: 1 addition & 1 deletion macros/base/probing/dockable_probe.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion macros/helpers/prime_line.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions user_templates/mcu.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
1 change: 1 addition & 0 deletions user_templates/mcu_defaults/main/BTT_Manta_M8P_v1.0.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,4 @@ aliases:
LIGHT_NEOPIXEL=MCU_RGB2 ,

SERVO_PIN=MCU_PROBE1 ,

1 change: 1 addition & 0 deletions user_templates/mcu_defaults/main/BTT_Manta_M8P_v1.1.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,4 @@ aliases:
LIGHT_NEOPIXEL=MCU_RGB2 ,

SERVO_PIN=MCU_PROBE1 ,

5 changes: 5 additions & 0 deletions user_templates/mcu_defaults/main/BTT_Octopus_Max.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -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 ,
Expand All @@ -45,3 +49,4 @@ aliases:
STATUS_NEOPIXEL=MCU_NEOPIXEL ,

SERVO_PIN=MCU_SERVOS ,

32 changes: 32 additions & 0 deletions user_templates/mcu_defaults/main/BTT_SKR_3.cfg
Original file line number Diff line number Diff line change
@@ -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 ,

4 changes: 2 additions & 2 deletions user_templates/mcu_defaults/main/BTT_SKR_Pico_v1.0.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ aliases:
CONTROLLER_FAN=MCU_FAN3 ,

STATUS_NEOPIXEL=MCU_RGB ,

[tmc2209 stepper_x]
uart_pin: TMCUART
tx_pin: TMCTX
Expand All @@ -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
Expand Down

0 comments on commit 0122cd3

Please sign in to comment.