We have created our own "custom" firmware for the Voron 2.4 FYSETC build, as we usually do. We opted to keep it in line with our RatRig as much as possible to use the same feature sets and allow us to be able to send prints to the Voron that are nearly the same slicer setup as our V-Core. This firmware is tested and working, although you will need some macros as well. We will post the macros to the website, and our new github page which will manage all of our configurations for different printers.
We have began eliminating all Ender 3 & Ender 5 from our print farm, and upgrading to Voron and V-Cores as of 2023! It will be harder to maintain our Creality firmware although we may keep 1 of each kind just to help you guys out!
Below is the new printer.cfg for the FYSETC 2.2 on VORON 2.4; make sure to get the needed MACROS as well!
FYI: The voron project below is only supporting with FYSETC Spider v2.2 and we have not received other vendor's items to conform our firmware to them also. FYSETC is the sponsor of this build, and the board is great if setup properly. Our firmware has been tested and proven to work great with sensorless, and bed mesh. We will upgrade to Klicky probe later to try that method as well; this was to keep a print farm stable and using same type of setup.
UPDATED 2.7.2023 with 64 microsteps and higher performance settings. MUST have controller fans for this setup!
# This file contains common pin mappings for the Fysetc Spider board.
# To use this config, the firmware should be compiled for the STM32F446.
# When calling "menuconfig", enable "extra low-level configuration setup"
# and select the "12MHz crystal" as clock reference
# For flashing, write the compiled klipper.bin to memory location 0x08000000
# Print3D.world Voron 2.4 R1 FYSETC Spider v2.2 Firmware
# Features and Options we use are listed below. We had issues with flashing firmware with this board, ended up replacing the bootloader manually with the newer version from
# FYSETC, and then manually flashing the firmware without replacing the bootloader (starting at 0x08000000). Find detailed instructions at https://print3d.world
# Voron 2.4 R1 Options, Features
# Sensorless Homing X & Y
# Probe works for Z Endstop, Bed Mesh, and Quad Gantry Leveling in this configuration
# Using macros from our RatRig V-Core Klipper which are much more "Refined and Proven" from several years of use
#
# See docs/Config_Reference.md for a description of parameters.
## Voron Design VORON2 250/300/350mm Spider TMC2209 UART config
## THINGS TO CHANGE/CHECK:
## Spider version Please search this file for "SpiderVersion" and uncomment the appropriate line for each
## MCU paths [mcu] section
## Thermistor types [extruder] and [heater_bed] sections - See 'sensor types' list at end of file
## Homing end position [gcode_macro G32] section
## Use PROBE_CALIBRATE for Z Offset instead of normal voron setup, this config does not use Klicky or the Endstop switch.
## Probe points [quad_gantry_level] section
## Min & Max gantry corner postions [quad_gantry_level] section
## PID tune [extruder] and [heater_bed] sections
## Fine tune E steps [extruder] section
## Sensorless Homing "Trigger" sensorless-homing.cfg file
[include mainsail.cfg]
[include sensorless.cfg]
[include macros.cfg]
[include drivers/2209/24v-1.1a-*.cfg]
[include drivers/speed-limits-basic.cfg]
[include drivers/tmc2209-performance.cfg]
[respond]
[skew_correction]
[mcu]
## Uncomment below if you're using the Raspberry uart0 to communicate with Spider
restart_method: command
## You need to select 'Communication interface' to USB in 'make menuconfig'
## when you compile Klipper for Spider
## Obtain definition by "ls -l /dev/serial/by-id/" then unplug to verify
##--------------------------------------------------------------------
#serial: /dev/serial/by-id/usb-Klipper_stm32f446xx_230032000851363131363530-if00
## If you want to use the Raspberry uart0 to communicate with Spider,
## you need to select 'Communication interface' to 'Serial (on USART1 PA10/PA9)'
## in 'make menuconfig' when you compile klipper and set the serial as below
##--------------------------------------------------------------------
serial: /dev/ttyAMA0
##--------------------------------------------------------------------
[virtual_sdcard]
path: ~/printer_data/gcodes
[display_status]
[printer]
kinematics: corexy
max_velocity: 1000
max_accel: 6000 #Max 4000
max_z_velocity: 30 #Max 15 for 12V TMC Drivers, can increase for 24V
max_z_accel: 1000
square_corner_velocity: 5.0
#####################################################################
# X/Y Stepper Settings
#####################################################################
[stepper_x]
## Connected to X-MOT (B Motor)
step_pin: PE11
dir_pin: PE10
enable_pin: !PE9
rotation_distance: 40
microsteps: 64
full_steps_per_rotation:200 #set to 400 for 0.9 degree stepper
#endstop_pin: ^PB14
endstop_pin: tmc2209_stepper_x:virtual_endstop
#position_min: 0
##--------------------------------------------------------------------
## Uncomment below for 250mm build
#position_endstop: 250
#position_max: 250
## Uncomment for 300mm build
#position_endstop: 300
#position_max: 300
## Uncomment for 350mm build
#position_endstop: 350
position_max: 350
##--------------------------------------------------------------------
homing_speed: 50 #Max 100
homing_retract_dist: 0
homing_positive_dir: false
## Make sure to update below for your relevant driver (2208 or 2209)
[tmc2209 stepper_x]
uart_pin: PE7
interpolate: False
run_current: 1.0
hold_current: 0.7
sense_resistor: 0.110
stealthchop_threshold: 0
diag_pin: PB14
## Make sure to update below for your relevant driver (5160)
#[tmc5160 stepper_x]
## Soft SPI
#spi_software_mosi_pin: PE14
#spi_software_miso_pin: PE13
#spi_software_sclk_pin: PE12
#cs_pin: PE7
#interpolate: True
#diag1_pin: PB14
#run_current: 0.800
#hold_current: 0.500
##stealthchop_threshold: 0
[stepper_y]
## Connected to Y-MOT (A Motor)
step_pin: PD8
dir_pin: PB12
enable_pin: !PD9
rotation_distance: 40
microsteps: 64
full_steps_per_rotation:200 #set to 400 for 0.9 degree stepper
#endstop_pin: ^PB13
endstop_pin: tmc2209_stepper_y:virtual_endstop
#position_min: 0
##--------------------------------------------------------------------
## Uncomment for 250mm build
#position_endstop: 250
#position_max: 250
## Uncomment for 300mm build
#position_endstop: 300
#position_max: 300
## Uncomment for 350mm build
#position_endstop: 350
position_max: 350
##--------------------------------------------------------------------
homing_speed: 50 #Max 100
homing_retract_dist: 0
homing_positive_dir: false
## Make sure to update below for your relevant driver (2208 or 2209)
[tmc2209 stepper_y]
uart_pin: PE15
interpolate: False
run_current: 1.0
hold_current: 0.7
sense_resistor: 0.110
stealthchop_threshold: 0
diag_pin: PB13
## Make sure to update below for your relevant driver (5160)
#[tmc5160 stepper_y]
## Soft SPI
#spi_software_mosi_pin: PE14
#spi_software_miso_pin: PE13
#spi_software_sclk_pin: PE12
#cs_pin: PE15
##diag1_pin: PB13
#interpolate: True
#run_current: 0.8
#hold_current: 0.7
##stealthchop_threshold: 0
#####################################################################
# Z Stepper Settings
#####################################################################
## In Z-MOT Position
## Z0 Stepper - Front Left
[stepper_z]
step_pin: PD14
dir_pin: PD13
enable_pin: !PD15
rotation_distance: 40
gear_ratio: 80:16
microsteps: 64
## In Z- Position
#endstop_pin: ^PA0
endstop_pin: probe:z_virtual_endstop
## Z-position of nozzle (in mm) to z-endstop trigger point relative to print surface (Z0)
## (+) value = endstop above Z0, (-) value = endstop below
## Increasing position_endstop brings nozzle closer to the bed
## After you run Z_ENDSTOP_CALIBRATE, position_endstop will be stored at the very end of your config
#position_endstop: -0.5
position_min: -6
##--------------------------------------------------------------------
## Uncomment below for 250mm build
#position_max: 240
## Uncomment below for 300mm build
#position_max: 290
## Uncomment below for 350mm build
position_max: 340
##--------------------------------------------------------------------
#position_min: -5
homing_speed: 8
#second_homing_speed: 3
homing_retract_dist: 0
[bed_mesh]
horizontal_move_z: 5
mesh_min: 20,20
mesh_max:365,360
probe_count: 7,7
fade_start: 1.0
fade_end: 10.0
mesh_pps: 2,2
algorithm: bicubic
bicubic_tension: .2
## Make sure to update below for your relevant driver (2208 or 2209)
[tmc2209 stepper_z]
uart_pin: PD10
interpolate: True
run_current: 1.1
#hold_current: 0.4
sense_resistor: 0.110
stealthchop_threshold: 999999
## In E1-MOT Position
## Z1 Stepper - Rear Left
[stepper_z1]
step_pin: PE6
dir_pin: !PC13
enable_pin: !PE5
rotation_distance: 40
gear_ratio: 80:16
microsteps: 64
## Make sure to update below for your relevant driver (2208 or 2209)
[tmc2209 stepper_z1]
uart_pin: PC14
interpolate: True
run_current: 1.1
#hold_current: 0.4
sense_resistor: 0.110
stealthchop_threshold: 999999
## In E2-MOT Position
## Z2 Stepper - Rear Right
[stepper_z2]
step_pin: PE2
dir_pin: PE4
enable_pin: !PE3
rotation_distance: 40
gear_ratio: 80:16
microsteps: 64
## Make sure to update below for your relevant driver (2208 or 2209)
[tmc2209 stepper_z2]
uart_pin: PC15
interpolate: true
run_current: 1.1
#hold_current: 0.4
sense_resistor: 0.110
stealthchop_threshold: 999999
## In E3-MOT Position
## Z3 Stepper - Front Right
[stepper_z3]
step_pin: PD12
dir_pin: !PC4
enable_pin: !PE8
rotation_distance: 40
gear_ratio: 80:16
microsteps: 64
[tmc2209 stepper_z3]
uart_pin: PA15
interpolate: true
run_current: 1.1
hold_current: 0.4
sense_resistor: 0.110
#stealthchop_threshold: 0
stealthchop_threshold: 999999
#####################################################################
# Extruder
#####################################################################
## In E0-MOT Position
[extruder]
step_pin: PD5
dir_pin: PD6
enable_pin: !PD4
max_extrude_only_distance: 130
## Update value below when you perform extruder calibration
## If you ask for 100mm of filament, but in reality it is 98mm:
## rotation_distance = <previous_rotation_distance> * <actual_extrude_distance> / 100
## 22.6789511 is a good starting point
rotation_distance: 22.6789511 #Bondtech 5mm Drive Gears
## Update Gear Ratio depending on your Extruder Type
## Use 50:17 for Afterburner/Clockwork (BMG Gear Ratio)
## Use 80:20 for M4, M3.1
gear_ratio: 50:17 #BMG Gear Ratio
microsteps: 64
full_steps_per_rotation: 200 #200 for 1.8 degree, 400 for 0.9 degree
nozzle_diameter: 0.400
filament_diameter: 1.75
## In E0 OUT Position
heater_pin: PB15
## Validate the following thermistor type to make sure it is correct
sensor_type: Generic 3950#ATC Semitec 104GT-2
sensor_pin: PC0 # TE0 Position
min_temp: 10
max_temp: 300
max_power: 1.0
min_extrude_temp: 170
#control = pid
#pid_kp = 26.213
#pid_ki = 1.304
#pid_kd = 131.721
## Try to keep pressure_advance below 1.0
pressure_advance: 0.05
## Default is 0.040, leave stock
pressure_advance_smooth_time: 0.040
## In E0-MOT Position
## Make sure to update below for your relevant driver (2208 or 2209)
[tmc2209 extruder]
uart_pin: PD7
interpolate: false
run_current: 0.5
#hold_current: 0.2
sense_resistor: 0.110
stealthchop_threshold: 0
#####################################################################
# Bed Heater
#####################################################################
[heater_bed]
## SSR Pin - In BED OUT position
heater_pin: PB4
sensor_type: Generic 3950 # NTC 100K MGB18-104F39050L32
## Uncomment below for SpiderVersion 1.x
#sensor_pin: PC3 # TB Position
## Uncomment below for SpiderVersion 2.2
sensor_pin: PB0 # TB Position
## Adjust Max Power so your heater doesn't warp your bed
max_power: 1
min_temp: 0
max_temp: 130
control: pid
pid_kp: 51.757
pid_Ki: 2.465
pid_kd: 271.726
#####################################################################
# Probe
#####################################################################
[probe]
## Inductive Probe - If you use this section , please comment the [bltouch] section
## This probe is not used for Z height, only Quad Gantry Leveling
## In Z+ position
## If your probe is NC instead of NO, add change pin to ^PA3
pin: ^!PA3
x_offset: 0
y_offset: 25.0
#z_offset: 0
speed: 10.0
samples: 3
samples_result: median
sample_retract_dist: 3.0
samples_tolerance: 0.006
samples_tolerance_retries: 3
#####################################################################
# Bltouch
#####################################################################
#[bltouch]
## Bltouch - If you use this section , please comment the [probe] section
## More infomation at : https://www.klipper3d.org/BLTouch.html
## This bltouch is not used for Z height, only Quad Gantry Leveling
## In Z+ Position
#sensor_pin: PA0
## In Y+ Position
#control_pin: PA2
#x_offset: 0
#y_offset: 25.0
#z_offset: 0
#speed: 10.0
#samples: 3
#samples_result: median
#sample_retract_dist: 3.0
#samples_tolerance: 0.006
#samples_tolerance_retries: 3
#####################################################################
# Fan Control
#####################################################################
[heater_fan hotend_fan]
## Hotend Fan - FAN0 Connector
## Uncomment below for SpiderVersion 1.x
#pin: PB0
## Uncomment below for SpiderVersion 2.2
pin: PA13
max_power: 1.0
kick_start_time: 0.5
heater: extruder
heater_temp: 50.0
## If you are experiencing back flow, you can reduce fan_speed
#fan_speed: 1.0
[fan]
## Print Cooling Fan - FAN1 Connector
## Uncomment below for SpiderVersion 1.x
#pin: PB1
## Uncomment below for SpiderVersion 2.2
pin: PA14
max_power: 1.0
kick_start_time: 0.5
## Depending on your fan, you may need to increase this value
## if your fan will not start. Can change cycle_time (increase)
## if your fan is not able to slow down effectively
#off_below: 0.10
#[heater_fan controller_fan] #We wired our controller fans to 24V block, using this for 24v White LED as caselight
## Controller fan - FAN2 Connector
#pin: PB2
#kick_start_time: 0.5
#heater: heater_bed
#heater_temp: 45.0
[heater_fan exhaust_fan]
## Exhaust fan - Moved to PB2
pin: PB2
max_power: 1.0
shutdown_speed: 0.0
kick_start_time: 5.0
heater: heater_bed
heater_temp: 60
fan_speed: 1.0
#[controller_fan nevermore]
# Nevermore - In E1 OUT Position
#pin: PB2
#kick_start_time: 0.500
#fan_speed: 0.5
#####################################################################
# Thermal
#####################################################################
[temperature_sensor raspberry_pi]
sensor_type: temperature_host
max_temp: 100
[temperature_sensor mcu_temp]
sensor_type: temperature_mcu
max_temp: 100
[idle_timeout]
gcode:
{% if printer.webhooks.state|lower == 'ready' %}
{% if printer.pause_resume.is_paused|lower == 'false' %}
M117 Idle timeout reached
TURN_OFF_HEATERS
M84
{% endif %}
{% endif %}
# 2 hour timeout
timeout: 7200
#####################################################################
# LED Control
#####################################################################
#[output_pin caselight ]
## Chamber Lighting - In 5V-RGB Position
#pin: PD3
#pwm: true
#shutdown_value: 0
#value:100
#cycle_time: 0.01
[output_pin caselight]
pin: PB3
pwm: true
shutdown_value: 0
cycle_time: 0.0002
[gcode_macro LED_ON]
gcode:
SET_PIN PIN=caselight VALUE=1
[gcode_macro LED_PCT_IDLE]
gcode:
SET_PIN PIN=caselight VALUE=0.06
[gcode_macro LED_PCT_PRINT]
gcode:
SET_PIN PIN=caselight VALUE=0.4
[gcode_macro LED_OFF]
gcode:
SET_PIN PIN=caselight VALUE=0
#####################################################################
# Homing and Gantry Adjustment Routines
#####################################################################
[idle_timeout]
timeout: 1800
#[safe_z_home]
## XY Location of the Z Endstop Switch
## Update -100,-100 to the XY coordinates of your endstop pin
## (such as 157,305) after going through Z Endstop Pin
## Location Definition step.
#home_xy_position:-100,-100
#speed:100
#z_hop:10
[quad_gantry_level]
## Use QUAD_GANTRY_LEVEL to level a gantry.
## Min & Max gantry corners - measure from nozzle at MIN (0,0) and
## MAX (250, 250), (300,300), or (350,350) depending on your printer size
## to respective belt positions
#--------------------------------------------------------------------
## Gantry Corners for 250mm Build
## Uncomment for 250mm build
#gantry_corners:
# -60,-10
# 310, 320
## Probe points
#points:
# 50,25
# 50,175
# 200,175
# 200,25
## Gantry Corners for 300mm Build
## Uncomment for 300mm build
#gantry_corners:
# -60,-10
# 360,370
## Probe points
#points:
# 50,25
# 50,225
# 250,225
# 250,25
## Gantry Corners for 350mm Build
## Uncomment for 350mm build
gantry_corners:
-60,-10
410,420
## Probe points
points:
50,25
50,275
300,275
300,25
#--------------------------------------------------------------------
speed: 100
horizontal_move_z: 10
retries: 5
retry_tolerance: 0.0075
max_adjust: 10
######################################################################
# Macro Settings
######################################################################
[gcode_macro RatOS]
# Use absolute extrusion mode
# Set to True to use relative extrusion mode
variable_relative_extrusion: False
# Wait for extruder to reach 150 so an inductive probe (if present) is at a predictable temp.
# Also allows the bed heat to spread a little, and softens any plastic that might be stuck to the nozzle.
# Set to False to disable
variable_preheat_extruder: True
# Calibrate the bed mesh in the START_PRINT macro.
# Set to false to skip BED_MESH_CALIBRATE, it will still load the BED_MESH
# with the name "ratos", be sure to save your bed_mesh profile with that name.
# or override the _START_PRINT_BED_MESH macro to implement your own mesh handling logic.
variable_calibrate_bed_mesh: True
# Print a prime line at the end of the START_PRINT macro
# set to False to disable nozzle_priming.
variable_nozzle_priming: "primeline"
# Park in the back when waiting for the extruder to heat up
# set to "front" to park in the front, or "center" to park in the center.
variable_start_print_park_in: "center"
# Height to park it when waiting for extruder to heat.
variable_start_print_park_z_height: 50
# Skew profile to load before starting the print
# uncomment this to use your calibrated skew correction profile.
#variable_skew_profile: "my_skew_profile"
# Park in the back after the print has ended or was cancelled.
# set to "front" to park in the front, or "center" to park in the center.
variable_end_print_park_in: "back"
# Park in the back when the print is paused.
# set to "front" to park in the front, or "center" to park in the center.
variable_pause_print_park_in: "back"
# Set the speed for travel moves in RatOS Macros in mm/s.
variable_macro_travel_speed: 300
#####################################################################
# Displays
#####################################################################
#--------------------------------------------------------------------
[display]
# mini12864 LCD Display
lcd_type: uc1701
cs_pin: PC11
a0_pin: PD2
rst_pin: PC10
encoder_pins: ^PC6,^PC7
click_pin: ^!PA8
contrast: 63
#spi_bus: spi1
spi_software_mosi_pin: PA7
spi_software_miso_pin: PA6
spi_software_sclk_pin: PA5
[neopixel fysetc_mini12864]
# To control Neopixel RGB in mini12864 display
pin: PC12
chain_count: 3
initial_RED: 0.1
initial_GREEN: 0.5
initial_BLUE: 0.0
color_order: RGB
# Set RGB values on boot up for each Neopixel.
# Index 1 = display, Index 2 and 3 = Knob
[delayed_gcode setdisplayneopixel]
initial_duration: 1
gcode:
SET_LED LED=fysetc_mini12864 RED=1 GREEN=1 BLUE=1 INDEX=1 TRANSMIT=0
SET_LED LED=fysetc_mini12864 RED=1 GREEN=0 BLUE=0 INDEX=2 TRANSMIT=0
SET_LED LED=fysetc_mini12864 RED=1 GREEN=0 BLUE=0 INDEX=3
#--------------------------------------------------------------------
#####################################################################
# Macros
#####################################################################
[gcode_macro G32]
gcode:
BED_MESH_CLEAR
G28
QUAD_GANTRY_LEVEL
G28
## Uncomment for for your size printer:
#--------------------------------------------------------------------
## Uncomment for 250mm build
#G0 X125 Y125 Z30 F3600
## Uncomment for 300 build
#G0 X150 Y150 Z30 F3600
## Uncomment for 350mm build
G0 X175 Y175 Z30 F3600
#--------------------------------------------------------------------
[gcode_macro PRINT_START]
# Use PRINT_START for the slicer starting script - please customise for your slicer of choice
gcode:
G32 ; home all axes
G1 Z20 F3000 ; move nozzle away from bed
[gcode_macro PRINT_END]
# Use PRINT_END for the slicer ending script - please customise for your slicer of choice
gcode:
M400 ; wait for buffer to clear
G92 E0 ; zero the extruder
G1 E-1.0 F3600 ; retract filament
G91 ; relative positioning
G0 Z1.00 X20.0 Y20.0 F20000 ; move nozzle to remove stringing
TURN_OFF_HEATERS
M107 ; turn off fan
G1 Z2 F3000 ; move nozzle up 2mm
G90 ; absolute positioning
G0 X125 Y250 F3600 ; park nozzle at rear
BED_MESH_CLEAR
## Thermistor Types
## "EPCOS 100K B57560G104F"
## "ATC Semitec 104GT-2"
## "NTC 100K beta 3950"
## "Honeywell 100K 135-104LAG-J01"
## "NTC 100K MGB18-104F39050L32" (Keenovo Heater Pad)
## "AD595"
## "PT100 INA826"
#*# <---------------------- SAVE_CONFIG ---------------------->
#*# DO NOT EDIT THIS BLOCK OR BELOW. The contents are auto-generated.
#*#
#*# [probe]
#*# z_offset = 4.360
#*#
#*# [extruder]
#*# control = pid
#*# pid_kp = 27.522
#*# pid_ki = 1.853
#*# pid_kd = 102.177
Business IT Solutions - https://bizhostnc.com
Plastic Process Engineering
Here is our macros.cfg; it was copied from our V-Core 3 and modified to fit the Voron. I will be making changes as I test the files, and eventually will remove the RatRig related stuff. Look out for updates as we continue to modify and improve this Voron 2.4
# WARNING: DO NOT EDIT THIS FILE # To override settings from this file, you can copy and paste the relevant # sections into your printer.cfg and change it there. ##### # CONFIGURATION VARIABLES ##### [gcode_macro ZUP] gcode: SET_GCODE_OFFSET Z_ADJUST=0.01 MOVE=1 [gcode_macro ZDOWN] gcode: SET_GCODE_OFFSET Z_ADJUST=-0.01 MOVE=1 [gcode_macro MAYBE_HOME] description: Only home unhomed axis variable_is_kinematic_position_overriden: False gcode: {% if printer["gcode_macro MAYBE_HOME"].is_kinematic_position_overriden|lower == 'true' %} RESPOND MSG="SET_CENTER_KINEMATIC_POSITION has been abused. Homing all axes. Please refrain from using SET_CENTER_KINEMATIC_POSITION outside of debugging purposes." G28 SET_GCODE_VARIABLE MACRO=MAYBE_HOME VARIABLE=is_kinematic_position_overriden VALUE=False {% else %} {% set axes = '' %} {% set isHomed = true %} {% set axesToHome = '' %} {% if params.X is defined %} {% set axes = axes ~ 'X ' %} {% if 'x' not in printer.toolhead.homed_axes %} {% set isHomed = false %} {% set axesToHome = axesToHome ~ 'X ' %} {% endif %} {% endif %} {% if params.Y is defined %} {% set axes = axes ~ 'Y ' %} {% if 'y' not in printer.toolhead.homed_axes %} {% set isHomed = false %} {% set axesToHome = axesToHome ~ 'Y ' %} {% endif %} {% endif %} {% if params.Z is defined %} {% set axes = axes ~ 'Z ' %} {% if 'z' not in printer.toolhead.homed_axes %} {% set isHomed = false %} {% set axesToHome = axesToHome ~ 'Z ' %} {% endif %} {% endif %} {% if params.X is not defined and params.Y is not defined and params.Z is not defined %} {% set axes = '' %} {% if 'x' not in printer.toolhead.homed_axes %} {% set isHomed = false %} {% set axesToHome = axesToHome ~ 'X ' %} {% endif %} {% if 'y' not in printer.toolhead.homed_axes %} {% set isHomed = false %} {% set axesToHome = axesToHome ~ 'Y ' %} {% endif %} {% if 'z' not in printer.toolhead.homed_axes %} {% set isHomed = false %} {% set axesToHome = axesToHome ~ 'Z ' %} {% endif %} {% endif %} {% if isHomed is false %} M117 Homing {axesToHome} RESPOND MSG="Homing {axesToHome}" G28 {axesToHome} {% else %} RESPOND MSG="All requested axes already homed, skipping.." {% endif %} {% endif %} [gcode_macro START_PRINT2] gcode: {% set BED_TEMP = params.BED_TEMP|default(60)|float %} {% set EXTRUDER_TEMP = params.EXTRUDER_TEMP|default(240)|float %} # Start bed heating M140 S{BED_TEMP} # Use absolute coordinates G90 # Reset the G-Code Z offset (adjust Z offset if needed) #SET_GCODE_OFFSET Z=0.0 # Home the printer G28 #M109 S{EXTRUDER_TEMP} ;wait for nozzle to reach temperature # QGL QUAD_GANTRY_LEVEL # Bed Mesh BED_MESH_CALIBRATE # Calibrate Z-Offset #Move to middle of bed G0 X150 Y150 Z10 # Move the nozzle near the bed G1 Z5 F3000 # Move the nozzle very close to the bed #G1 Z0.15 F300 # Wait for bed to reach temperature M190 S{BED_TEMP} # Set and wait for nozzle to reach temperature M109 S{EXTRUDER_TEMP} [gcode_macro ECHO_RATOS_VARS] description: Echo RatOS variables to the console. gcode: {% for var, value in printer["gcode_macro RatOS"].items() %} {action_respond_info(var ~ ": " ~ value)} {% endfor %} [gcode_macro RatOS] description: RatOS variable storage macro, will echo variables to the console when run. # Configuration Defaults # This is only here to make the config backwards compatible. # Configuration should exclusively happen in printer.cfg. variable_relative_extrusion: False variable_preheat_extruder: True variable_calibrate_bed_mesh: True variable_nozzle_priming: "primeblob" variable_start_print_park_in: "back" variable_start_print_park_z_height: 50 variable_end_print_park_in: "back" variable_pause_print_park_in: "back" variable_macro_travel_speed: 150 gcode: ECHO_RATOS_VARS ##### # GENERAL MACROS ##### [gcode_macro MAYBE_HOME] description: Only home unhomed axis variable_is_kinematic_position_overriden: False gcode: {% if printer["gcode_macro MAYBE_HOME"].is_kinematic_position_overriden|lower == 'true' %} RESPOND MSG="SET_CENTER_KINEMATIC_POSITION has been abused. Homing all axes. Please refrain from using SET_CENTER_KINEMATIC_POSITION outside of debugging purposes." G28 SET_GCODE_VARIABLE MACRO=MAYBE_HOME VARIABLE=is_kinematic_position_overriden VALUE=False {% else %} {% set axes = '' %} {% set isHomed = true %} {% set axesToHome = '' %} {% if params.X is defined %} {% set axes = axes ~ 'X ' %} {% if 'x' not in printer.toolhead.homed_axes %} {% set isHomed = false %} {% set axesToHome = axesToHome ~ 'X ' %} {% endif %} {% endif %} {% if params.Y is defined %} {% set axes = axes ~ 'Y ' %} {% if 'y' not in printer.toolhead.homed_axes %} {% set isHomed = false %} {% set axesToHome = axesToHome ~ 'Y ' %} {% endif %} {% endif %} {% if params.Z is defined %} {% set axes = axes ~ 'Z ' %} {% if 'z' not in printer.toolhead.homed_axes %} {% set isHomed = false %} {% set axesToHome = axesToHome ~ 'Z ' %} {% endif %} {% endif %} {% if params.X is not defined and params.Y is not defined and params.Z is not defined %} {% set axes = '' %} {% if 'x' not in printer.toolhead.homed_axes %} {% set isHomed = false %} {% set axesToHome = axesToHome ~ 'X ' %} {% endif %} {% if 'y' not in printer.toolhead.homed_axes %} {% set isHomed = false %} {% set axesToHome = axesToHome ~ 'Y ' %} {% endif %} {% if 'z' not in printer.toolhead.homed_axes %} {% set isHomed = false %} {% set axesToHome = axesToHome ~ 'Z ' %} {% endif %} {% endif %} {% if isHomed is false %} M117 Homing {axesToHome} RESPOND MSG="Homing {axesToHome}" G28 {axesToHome} {% else %} RESPOND MSG="All requested axes already homed, skipping.." {% endif %} {% endif %} [gcode_macro PAUSE] description: Pauses the printer rename_existing: PAUSE_BASE variable_extrude: 1.5 gcode: SAVE_GCODE_STATE NAME=PAUSE_state # Define park positions {% set E = printer["gcode_macro PAUSE"].extrude|float %} {% set speed = printer["gcode_macro RatOS"].macro_travel_speed|float * 60 %} # Calculate safe Z position {% set max_z = printer.toolhead.axis_maximum.z|float %} {% set act_z = printer.toolhead.position.z|float %} {% if act_z < (max_z - 2.0) %} {% set z_safe = 2.0 %} {% else %} {% set z_safe = max_z - act_z %} {% endif %} PAUSE_BASE G91 # Retract {% if printer.extruder.can_extrude|lower == 'true' %} G1 E-{E} F2100 {% else %} {action_respond_info("Extruder not hot enough")} {% endif %} # Move to park position {% if "xyz" in printer.toolhead.homed_axes %} G1 Z{z_safe} F900 _PARK LOCATION={printer["gcode_macro RatOS"].pause_print_park_in} X={printer["gcode_macro RatOS"].pause_print_park_x} {% else %} {action_respond_info("Printer not homed")} {% endif %} [gcode_macro RESUME] description: Resumes the print if the printer is paused. rename_existing: RESUME_BASE gcode: {% set E = printer["gcode_macro PAUSE"].extrude|float %} # Prime {% if printer.extruder.can_extrude|lower == 'true' %} G91 G1 E{E} F2100 G90 {% else %} {action_respond_info("Extruder not hot enough")} {% endif %} RESTORE_GCODE_STATE NAME=PAUSE_state MOVE=1 RESUME_BASE [gcode_macro CANCEL_PRINT] description: Cancels the printer rename_existing: CANCEL_PRINT_BASE gcode: END_PRINT TURN_OFF_HEATERS CLEAR_PAUSE #SDCARD_RESET_FILE CANCEL_PRINT_BASE [gcode_macro PRIME_LINE] description: Prints a primeline, used internally, if configured, as part of the START_PRINT macro. gcode: SAVE_GCODE_STATE NAME=prime_line_state {% set speed = printer["gcode_macro RatOS"].macro_travel_speed|float * 60 %} # Absolute positioning G90 # Absolute extrusion M82 M117 Priming nozzle with prime line.. RESPOND MSG="Priming nozzle with prime line.." # Lift 5 mm G1 Z5 F3000 # Move to prime area G1 X{printer.toolhead.axis_minimum.x + 5} Y{printer.toolhead.axis_minimum.y + 10} F{speed} # Get ready to prime G1 Z0.3 F3000 # Reset extrusion distance G92 E0 # Prime nozzle G1 Y{printer.toolhead.axis_minimum.y + 80} E16 F1200 # Wipe G1 Y{printer.toolhead.axis_minimum.y + 100} F{speed} RESTORE_GCODE_STATE NAME=prime_line_state [gcode_macro PRIME_BLOB] description: Prints a primeblob, used internally, if configured, as part of the START_PRINT macro. Slower than PRIME_LINE but much more effective. gcode: SAVE_GCODE_STATE NAME=prime_blob_state M117 Priming nozzle with prime blob.. RESPOND MSG="Priming nozzle with prime blob.." {% set speed = printer["gcode_macro RatOS"].macro_travel_speed|float * 60 %} # Absolute positioning G90 # Relative extrusion M83 # Lift 5 mm G1 Z5 F3000 # move to blob position G1 X{printer.toolhead.axis_minimum.x + 5} Y{printer.toolhead.axis_minimum.y + 10} Z0.5 F{speed} # Extrude a blob G1 F60 E20 # 40% fan M106 S102 # Move the extruder up by 5mm while extruding, breaks away from blob G1 Z5 F100 E5 # Move to wipe position, but keep extruding so the wipe is attached to blob G1 F200 Y{printer.toolhead.axis_minimum.y + 25} E1 # Go down diagonally while extruding # Broken down in z moves under 2mm as a workaround for a tuning tower test. # The tuning tower command thinks a new print has been started when z moves over 2mm and aborts. G1 F200 Y{printer.toolhead.axis_minimum.y + 30} Z3.8 E0.5 G1 F200 Y{printer.toolhead.axis_minimum.y + 35} Z2.6 E0.5 G1 F200 Y{printer.toolhead.axis_minimum.y + 40} Z1.4 E0.5 G1 F200 Y{printer.toolhead.axis_minimum.y + 45} Z0.2 E0.5 # 0% fan M106 S0 # small wipe line G1 F200 Y{printer.toolhead.axis_minimum.y +50} Z0.2 E0.6 # Break away wipe G1 F{speed} Y{printer.toolhead.axis_minimum.y + 100} RESTORE_GCODE_STATE NAME=prime_blob_state [gcode_macro _PARK] gcode: {% set speed = printer["gcode_macro RatOS"].macro_travel_speed|float * 60 %} # Get X position {% if params.X != '' %} {% if params.X|float >= printer.toolhead.axis_minimum.x + 5 and params.X|float <= printer.toolhead.axis_maximum.x - 5 %} {% set safe_x = params.X|float %} {% else %} {action_respond_info('The requested X co-ordinate is outside the defined axis bounds - using defaults')} {% set safe_x = printer.toolhead.axis_maximum.x / 2 %} {% endif %} {% else %} {% set safe_x = printer.toolhead.axis_maximum.x / 2 %} {% endif %} # Get Y position {% if params.LOCATION|default('back')|lower == 'back' %} {% set y = printer.toolhead.axis_maximum.y - 5 %} {% elif params.LOCATION|lower == 'front' %} {% set y = printer.toolhead.axis_minimum.y + 5 %} {% elif params.LOCATION|lower == 'center' %} {% set y = printer.toolhead.axis_maximum.y / 2 %} {% endif %} # Absolute positioning G90 # Park G0 X{safe_x} Y{y} F{speed} ##### # COLOR CHANGE ##### [gcode_macro M600] description: Executes a color change by pausing the printer an unloading the filament. gcode: PAUSE UNLOAD_FILAMENT M117 Please load new filament and resume RESPOND MSG="Please load new filament and resume" ##### # FILAMENT MANAGEMENT ##### [gcode_macro UNLOAD_FILAMENT] description: Unloads the filament. Note: be careful with PETG, make sure you inspect the tip of your filament before reloading to avoid jams. gcode: SAVE_GCODE_STATE NAME=unload_state G91 {% if params.TEMP is defined or printer.extruder.can_extrude|lower == 'false' %} M117 Heating... # Heat up hotend to provided temp or 220 as default as that should work OK with most filaments. M104 S{params.TEMP|default(220, true)} TEMPERATURE_WAIT SENSOR=extruder MINIMUM={params.TEMP|default(220, true)} {% endif %} M117 Unloading filament... # Extract filament to cold end area G0 E-5 F3600 # Wait for three seconds G4 P3000 # Push back the filament to smash any stringing G0 E5 F3600 # Extract back fast in to the cold zone G0 E-15 F3600 # Continue extraction slowly, allow the filament time to cool solid before it reaches the gears G0 E-130 F300 M117 Filament unloaded! RESPOND MSG="Filament unloaded! Please inspect the tip of the filament before reloading." RESTORE_GCODE_STATE NAME=unload_state [gcode_macro LOAD_FILAMENT] description: Loads new filament. Note: be careful with PETG, make sure you inspect the tip of your filament before loading to avoid jams. gcode: SAVE_GCODE_STATE NAME=load_state G91 # Heat up hotend to provided temp or 220 as default as that should work OK with most filaments. {% if params.TEMP is defined or printer.extruder.can_extrude|lower == 'false' %} M117 Heating... M104 S{params.TEMP|default(220, true)} TEMPERATURE_WAIT SENSOR=extruder MINIMUM={params.TEMP|default(220, true)} {% endif %} M117 Loading filament... # Load the filament into the hotend area. G0 E100 F600 # Wait a secod G4 P1000 # Purge G0 E40 F100 # Wait for purge to complete M400e M117 Filament loaded! RESPOND MSG="Filament loaded!" RESTORE_GCODE_STATE NAME=load_state [gcode_macro SET_CENTER_KINEMATIC_POSITION] description: FOR DEBUGGING PURPOSES ONLY. Sets the internal printer kinematic state to the center of all axes regardless of actual physical position. gcode: RESPOND MSG="WARNING: ONLY USE SET_CENTER_KINEMATIC_POSITION FOR DEBUGGING PURPOSES. YOU'RE OVERRIDING THE INTERNAL POSITIONING STATE OF THE PRINTER. PROCEED WITH CAUTION AND DO A PROPER G28 WHEN DONE." SET_GCODE_VARIABLE MACRO=MAYBE_HOME VARIABLE=is_kinematic_position_overriden VALUE=True SET_KINEMATIC_POSITION X={printer.toolhead.axis_maximum.x / 2} Y={printer.toolhead.axis_maximum.y / 2} Z={printer.toolhead.axis_maximum.z / 2} ##### # START PRINT MACROS # Call this from your slicer (custom g-code). # Read more here: https://rat-rig.github.io/V-CoreOS/#/slicers ##### [gcode_macro START_PRINT] description: Start print procedure, use this in your Slicer. gcode: CLEAR_PAUSE SAVE_GCODE_STATE NAME=start_print_state # Metric values G21 # Absolute positioning G90 # Set extruder to absolute mode M82 # Turn on the light #LED_PCT_PRINT # Home if needed MAYBE_HOME M117 Heating bed... RESPOND MSG="Heating bed..." # Wait for bed to heat up M190 S{params.BED_TEMP|default(printer.heater_bed.target, true) } # Run the customizable "AFTER_HEATING_BED" macro. _START_PRINT_AFTER_HEATING_BED QUAD_GANTRY_LEVEL # Run the customizable "BED_MESH" macro #_START_PRINT_BED_MESH # Run the bed mesh printarea macro BED_MESH_CALIBRATE AREA_START={params.AREA_START|default("0,0")} AREA_END={params.AREA_END|default("0,0")} # Start heating extruder M104 S{params.EXTRUDER_TEMP|default(printer.extruder.target, true) } # Run the customizable "PARK" macro _START_PRINT_PARK # Wait for extruder to heat up M117 Heating Extruder... RESPOND MSG="Heating Extruder..." M109 S{params.EXTRUDER_TEMP|default(printer.extruder.target, true) } # Run the customizable "AFTER_HEATING_EXTRUDER" macro. _START_PRINT_AFTER_HEATING_EXTRUDER M117 Printing... RESPOND MSG="Printing..." RESTORE_GCODE_STATE NAME=start_print_state # Set extrusion mode based on user configuration {% if printer["gcode_macro RatOS"].relative_extrusion|lower == 'true' %} M83 {% else %} M82 {% endif %} G92 E0 ##### # START PRINT MACRO HOOKS # You can copy these to printer.cfg and modify them to your liking, or just use them as is. #### [gcode_macro _START_PRINT_AFTER_HEATING_BED] gcode: {% if printer["gcode_macro RatOS"].preheat_extruder|lower == 'true' %} M117 Pre-heating extruder... RESPOND MSG="Pre-heating extruder..." # Wait for extruder to reach 150 so an inductive probe (if present) is at a predictable temp. # Also allows the bed heat to spread a little, and softens any plastic that might be stuck to the nozzle. M104 S150 TEMPERATURE_WAIT SENSOR=extruder MINIMUM=150 {% endif %} [gcode_macro _START_PRINT_BED_MESH] gcode: {% if printer["gcode_macro RatOS"].calibrate_bed_mesh|lower == 'true' %} BED_MESH_CALIBRATE PROFILE=ratos {% endif %} BED_MESH_PROFILE LOAD=ratos [gcode_macro _START_PRINT_PARK] gcode: {% set z = printer["gcode_macro RatOS"].start_print_park_z_height|float %} _PARK LOCATION={printer["gcode_macro RatOS"].start_print_park_in} X={printer["gcode_macro RatOS"].start_print_park_x} G0 Z{z} F6000 [gcode_macro _START_PRINT_AFTER_HEATING_EXTRUDER] gcode: {% if printer["gcode_macro RatOS"].nozzle_priming|lower == 'primeline' %} PRIME_LINE {% endif %} {% if printer["gcode_macro RatOS"].nozzle_priming|lower == 'primeblob' %} PRIME_BLOB {% endif %} {% if printer["gcode_macro RatOS"].skew_profile is defined %} SKEW_PROFILE LOAD={printer["gcode_macro RatOS"].skew_profile} {% endif %} ##### # END PRINT MACROS # Call this from your slicer (custom g-code). # Read more here: https://rat-rig.github.io/V-CoreOS/#/slicers ##### [gcode_macro _START_PRINT_AFTER_HEATING_BED] gcode: {% if printer["gcode_macro RatOS"].preheat_extruder|lower == 'true' %} M117 Pre-heating extruder... # Wait for extruder to reach 150 so an inductive probe (if present) is at a predictable temp. # Also allows the bed heat to spread a little, and softens any plastic that might be stuck to the nozzle. M104 S150 TEMPERATURE_WAIT SENSOR=extruder MINIMUM=150 {% endif %} M117 Adjusting for tilt... # Adjust bed tilt QUAD_GANTRY_LEVEL M117 Rehoming after tilt adjustment... # Home again as Z will have changed after tilt adjustment and bed heating. G28 Z # The end_print macro is also called from CANCEL_PRINT. [gcode_macro END_PRINT] description: End print procedure, use this in your Slicer. gcode: SAVE_GCODE_STATE NAME=end_print_state _END_PRINT_BEFORE_HEATERS_OFF TURN_OFF_HEATERS _END_PRINT_AFTER_HEATERS_OFF _END_PRINT_PARK # Clear skew profile if any was loaded. {% if printer["gcode_macro RatOS"].skew_profile is defined %} SET_SKEW CLEAR=1 {% endif %} # Steppers off M84 # Part cooling fan off M107 M117 Done :) RESPOND MSG="Done :)" RESTORE_GCODE_STATE NAME=end_print_state LED_OFF ##### # END PRINT MACRO HOOKS # You can copy these to printer.cfg and modify them to your liking, or just use them as is. #### [gcode_macro _END_PRINT_BEFORE_HEATERS_OFF] gcode: RESPOND MSG="Cleaning up..." [gcode_macro BED_MESH_CALIBRATE] rename_existing: BED_MESH_CALIBRATE_BASE ; gcode parameters variable_parameter_AREA_START : 0,0 variable_parameter_AREA_END : 0,0 ; the clearance between print area and probe area variable_mesh_area_offset : 5.0 ; number of sample per probe point variable_probe_samples : 2 ; minimum probe count variable_min_probe_count : 3 ; scale up the probe count, should be 1.0 ~ < variable_max_probe_count/variable_min_probe_count variable_probe_count_scale_factor : 1.0 ; enable preference index variable_enable_reference_index : False gcode: {% if params.AREA_START and params.AREA_END %} {% set bedMeshConfig = printer["configfile"].config["bed_mesh"] %} {% set safe_min_x = bedMeshConfig.mesh_min.split(",")[0]|float %} {% set safe_min_y = bedMeshConfig.mesh_min.split(",")[1]|float %} {% set safe_max_x = bedMeshConfig.mesh_max.split(",")[0]|float %} {% set safe_max_y = bedMeshConfig.mesh_max.split(",")[1]|float %} {% set area_min_x = params.AREA_START.split(",")[0]|float %} {% set area_min_y = params.AREA_START.split(",")[1]|float %} {% set area_max_x = params.AREA_END.split(",")[0]|float %} {% set area_max_y = params.AREA_END.split(",")[1]|float %} {% if bedMeshConfig.probe_count.split(",")|length == 2 %} {% set meshPointX = bedMeshConfig.probe_count.split(",")[0]|int %} {% set meshPointY = bedMeshConfig.probe_count.split(",")[1]|int %} {% else %} {% set meshPointX = bedMeshConfig.probe_count.split(",")[0]|int %} {% set meshPointY = bedMeshConfig.probe_count.split(",")[0]|int %} {% endif %} {% set meshMaxPointX = meshPointX %} {% set meshMaxPointY = meshPointY %} {% if (area_min_x < area_max_x) and (area_min_y < area_max_y) %} {% if area_min_x - mesh_area_offset >= safe_min_x %} {% set area_min_x = area_min_x - mesh_area_offset %} {% else %} {% set area_min_x = safe_min_x %} {% endif %} {% if area_min_y - mesh_area_offset >= safe_min_y %} {% set area_min_y = area_min_y - mesh_area_offset %} {% else %} {% set area_min_y = safe_min_y %} {% endif %} {% if area_max_x + mesh_area_offset <= safe_max_x %} {% set area_max_x = area_max_x + mesh_area_offset %} {% else %} {% set area_max_x = safe_max_x %} {% endif %} {% if area_max_y + mesh_area_offset <= safe_max_y %} {% set area_max_y = area_max_y + mesh_area_offset %} {% else %} {% set area_max_y = safe_max_y %} {% endif %} {% set meshPointX = (meshPointX * (area_max_x - area_min_x) / (safe_max_x - safe_min_x) * probe_count_scale_factor)|round(0)|int %} {% if meshPointX < min_probe_count %} {% set meshPointX = min_probe_count %} {% endif %} {% if meshPointX > meshMaxPointX %} {% set meshPointX = meshMaxPointX %} {% endif %} {% set meshPointY = (meshPointY * (area_max_y -area_min_y ) / (safe_max_y - safe_min_y) * probe_count_scale_factor )|round(0)|int %} {% if meshPointY < min_probe_count %} {% set meshPointY = min_probe_count %} {% endif %} {% if meshPointY > meshMaxPointY %} {% set meshPointY = meshMaxPointY %} {% endif %} {% set algorithm = "lagrange" %} {% if "algorithm" in bedMeshConfig and meshPointX >=4 and meshPointY >=4 %} {% set algorithm = bedMeshConfig.algorithm %} {% endif %} {% if enable_reference_index %} {% set referenceIndex = (meshPointX * meshPointY / 2 - 1 )|round(0)|int %} BED_MESH_CALIBRATE_BASE mesh_min={area_min_x},{area_min_y} mesh_max={area_max_x},{area_max_y} probe_count={meshPointX},{meshPointY} samples={probe_samples|int} algorithm={algorithm} relative_reference_index={referenceIndex} {% else %} BED_MESH_CALIBRATE_BASE mesh_min={area_min_x},{area_min_y} mesh_max={area_max_x},{area_max_y} probe_count={meshPointX},{meshPointY} samples={probe_samples|int} algorithm={algorithm} {% endif %} {% else %} BED_MESH_CALIBRATE_BASE {% endif %} {% else %} BED_MESH_CALIBRATE_BASE {% endif %} [gcode_macro _END_PRINT_AFTER_HEATERS_OFF] gcode: # Calculate safe Z position {% set max_z = printer.toolhead.axis_maximum.z|float %} {% set act_z = printer.toolhead.position.z|float %} {% if act_z < (max_z - 2.0) %} {% set z_safe = 2.0 %} {% else %} {% set z_safe = max_z - act_z %} {% endif %} # Relative positioning G91 # Retract the filament a bit before lifting the nozzle. G1 E-2 F3600 # Move to safe Z position G0 Z{z_safe} F3600 # Retract filament even more G1 E-2 F3600 [gcode_macro _END_PRINT_PARK] gcode: _PARK LOCATION={printer["gcode_macro RatOS"].end_print_park_in} X={printer["gcode_macro RatOS"].end_print_park_x}
Business IT Solutions - https://bizhostnc.com
Plastic Process Engineering
The final piece of the sensorless homing configuration is the file below; it will be named sensorless.cfg
[stepper_x] endstop_pin: tmc2209_stepper_x:virtual_endstop position_min: -12 position_endstop: -12 [stepper_y] endstop_pin: tmc2209_stepper_y:virtual_endstop position_min: -12 position_endstop: -5 [tmc2209 stepper_x] diag_pin: x_diag_pin driver_SGTHRS: 55 # Stall guard threshold, this is your X sensitivity, to adjust, copy this section and override it in printer.cfg. [tmc2209 stepper_y] diag_pin: y_diag_pin driver_SGTHRS: 55 # Stall guard threshold, this is your Y sensitivity, to adjust, copy this section and override it in printer.cfg. [gcode_macro _HOME_X] gcode: # Always use consistent run_current on A/B steppers during sensorless homing {% set RUN_CURRENT_X = printer.configfile.settings['tmc2209 stepper_x'].run_current|float %} {% set RUN_CURRENT_Y = printer.configfile.settings['tmc2209 stepper_y'].run_current|float %} {% set HOME_CURRENT = 0.7 %} SET_TMC_CURRENT STEPPER=stepper_x CURRENT={HOME_CURRENT} SET_TMC_CURRENT STEPPER=stepper_y CURRENT={HOME_CURRENT} # Home G28 X # Move away G91 G1 X-10 F1200 # Wait just a second… (give StallGuard registers time to clear) G4 P1000 # Set current during print SET_TMC_CURRENT STEPPER=stepper_x CURRENT={RUN_CURRENT_X} SET_TMC_CURRENT STEPPER=stepper_y CURRENT={RUN_CURRENT_Y} [gcode_macro _HOME_Y] gcode: # Set current for sensorless homing {% set RUN_CURRENT_X = printer.configfile.settings['tmc2209 stepper_x'].run_current|float %} {% set RUN_CURRENT_Y = printer.configfile.settings['tmc2209 stepper_y'].run_current|float %} {% set HOME_CURRENT = 0.7 %} SET_TMC_CURRENT STEPPER=stepper_x CURRENT={HOME_CURRENT} SET_TMC_CURRENT STEPPER=stepper_y CURRENT={HOME_CURRENT} # Home G28 Y # Move away G91 G1 Y-10 F1200 # Wait just a second… (give StallGuard registers time to clear) G4 P1000 # Set current during print SET_TMC_CURRENT STEPPER=stepper_x CURRENT={RUN_CURRENT_X} SET_TMC_CURRENT STEPPER=stepper_y CURRENT={RUN_CURRENT_Y} [homing_override] set_position_z: 5 gcode: M400 # Wait for moves to finish G90 # Absolute positioning G0 Z10 F600 # Hop Z-Axis M204 S1000 # Set homing acceleration (important!) # Home Y SET_TMC_CURRENT STEPPER=stepper_x CURRENT=0.7 HOLDCURRENT=0.7 SET_TMC_CURRENT STEPPER=stepper_y CURRENT=0.7 HOLDCURRENT=0.7 G28 Y G0 Y{printer.toolhead.axis_maximum.y / 2} F9000 # Home X SET_TMC_CURRENT STEPPER=stepper_x CURRENT=0.7 HOLDCURRENT=0.7 SET_TMC_CURRENT STEPPER=stepper_y CURRENT=0.7 HOLDCURRENT=0.7 G28 X G0 X{printer.toolhead.axis_maximum.x / 2} F3000 # Restore current SET_TMC_CURRENT STEPPER=stepper_x CURRENT={printer.configfile.config["tmc2209 stepper_x"].run_current} HOLDCURRENT={printer.configfile.config["tmc2209 stepper_x"].hold_current} SET_TMC_CURRENT STEPPER=stepper_y CURRENT={printer.configfile.config["tmc2209 stepper_y"].run_current} HOLDCURRENT={printer.configfile.config["tmc2209 stepper_y"].hold_current} G0 X{printer.toolhead.axis_maximum.x / 2} Y{printer.toolhead.axis_maximum.y / 2} F3000 # Rehome Z G28 Z # Safe Z G0 Z10 F600
Business IT Solutions - https://bizhostnc.com
Plastic Process Engineering