This commit is contained in:
Frederik Hertzum 2025-01-27 19:48:50 +01:00
parent 02e3c1af5c
commit dedcecd944
28 changed files with 423 additions and 241 deletions

3
.gitignore vendored
View File

@ -1 +1,4 @@
ShakeTune_results
KlipperScreen.conf

View File

@ -25,14 +25,6 @@ cors_domains =
channel = dev
refresh_interval = 168
[update_manager Klipper-Adaptive-Meshing-Purging]
type = git_repo
channel = dev
path = ~/Klipper-Adaptive-Meshing-Purging
origin = https://github.com/kyleisah/Klipper-Adaptive-Meshing-Purging.git
managed_services = klipper
primary_branch = main
[update_manager mainsail-config]
type = git_repo
primary_branch = master

View File

@ -9,5 +9,12 @@
#~# [main]
#~# screen_blanking = 300
#~# show_heater_power = True
#~# move_speed_xy = 491
#~# move_speed_z = 300
#~# print_sort_dir = date_desc
#~# print_view = list
#~#
#~# [graph Printer]
#~# temperature_sensor mcu = False
#~# heater_bed = False
#~#

0
hardware/fly-sht36.cfg Normal file
View File

View File

@ -0,0 +1,13 @@
[temperature_sensor frame-front-right]
sensor_type: Generic 3950
sensor_pin: PC5
min_temp: 0
max_temp: 100
gcode_id: Frame front right
[temperature_sensor frame-rear-left]
sensor_type: Generic 3950
sensor_pin: PC4
min_temp: 0
max_temp: 100
gcode_id: Frame rear right

View File

@ -1,4 +1,5 @@
[include mcu.cfg]
[include steppers.cfg]
[include manta.cfg]
[include nitehawk.cfg]
#[include nitehawk.cfg]
[include frame-thermistors.cfg]

View File

@ -1,7 +1,7 @@
[temperature_sensor MCU]
sensor_type: temperature_mcu
[temperature_sensor SoC]
[temperature_sensor CB2]
sensor_type: temperature_host
[temperature_sensor chamber]
@ -10,7 +10,6 @@ sensor_pin: PB0
min_temp: 0
max_temp: 100
gcode_id: chamber
pullup_resistor: 4700
#####################################################################
# Bed Heater
@ -51,7 +50,7 @@ max_delta: 5
sensor_type: temperature_host
min_temp: 15
max_temp: 80
target_temp: 50
target_temp: 35
max_power: 0.5
shutdown_speed: 0
@ -66,11 +65,6 @@ hardware_pwm: false
[idle_timeout]
timeout: 1800
[safe_z_home]
home_xy_position:175,175
speed:600
z_hop:10
[quad_gantry_level]
## Gantry Corners for 350mm Build
## Uncomment for 350mm build
@ -82,8 +76,8 @@ points:
50,275
300,275
300,25
speed: 100
horizontal_move_z: 5
speed: 500
horizontal_move_z: 12
retries: 5
retry_tolerance: 0.025
max_adjust: 10

View File

@ -40,13 +40,14 @@ min_temp: 0
max_temp: 450
microsteps: 16
control: pid
pid_kp: 12.655
pid_ki: 0.524
pid_kd: 76.404
rotation_distance: 5.7
pid_kp: 19.512
pid_ki: 0.798
pid_kd: 119.265
rotation_distance: 5.53014
filament_diameter: 1.75
nozzle_diameter: 0.4
max_extrude_cross_section: 5
max_extrude_only_distance: 101
[tmc2209 extruder]
sense_resistor: 0.100
@ -76,7 +77,7 @@ pin: nhk:gpio5
## Probe Port
[probe]
pin: nhk:gpio10
z_offset: -0.9
z_offset: -1
#####################################################################
# Lights

View File

@ -1,3 +1,26 @@
[motor_constants 17hs19-2004s-ab]
# Coil resistance, Ohms
resistance: 1.30
# Coil inductance, Henries
inductance: 0.0027
# Holding torque, Nm
holding_torque: 0.67
# Nominal rated current, Amps
max_current: 2.00
# Steps per revolution (1.8deg motors use 200, 0.9deg motors use 400)
steps_per_revolution: 200
[motor_constants 17hs19-2004s-c]
# Coil resistance, Ohms
resistance: 1.30
# Coil inductance, Henries
inductance: 0.003
# Holding torque, Nm
holding_torque: 0.59
# Nominal rated current, Amps
max_current: 2.00
# Steps per revolution (1.8deg motors use 200, 0.9deg motors use 400)
steps_per_revolution: 200
#####################################################################
# X/Y Stepper Settings
@ -15,18 +38,28 @@ endstop_pin: tmc2209_stepper_x:virtual_endstop
position_min: 0
position_endstop: 350
position_max: 350
homing_speed: 25 #Max 100
homing_speed: 150 #Max 100
homing_retract_dist: 5
homing_positive_dir: true
#[autotune_tmc stepper_x]
#motor: 17hs19-2004s-ab
[temperature_sensor stepper_x]
sensor_type: Generic 3950
sensor_pin: PA7
min_temp: 0
max_temp: 100
gcode_id: X Stepper
## Make sure to update below for your relevant driver (2208 or 2209)
[tmc2209 stepper_x]
uart_pin: PC13
interpolate: True
run_current: 0.8
interpolate: false
run_current: 1
sense_resistor: 0.110
stealthchop_threshold: 0
driver_SGTHRS: 70
driver_SGTHRS: 60
diag_pin: PF4
## Y Stepper on Motor2 (A Motor)
@ -41,17 +74,18 @@ full_steps_per_rotation:200 #set to 400 for 0.9 degree stepper
position_min: 0
position_endstop: 350
position_max: 350
##--------------------------------------------------------------------
homing_speed: 25 #Max 100
homing_speed: 150 #Max 100
homing_retract_dist: 5
homing_positive_dir: true
#[autotune_tmc stepper_y]
#motor: 17hs19-2004s-ab
## Make sure to update below for your relevant driver (2208 or 2209)
[tmc2209 stepper_y]
uart_pin: PE3
interpolate: True
run_current: 0.8
interpolate: false
run_current: 1
sense_resistor: 0.110
stealthchop_threshold: 0
diag_pin: PF3
@ -70,11 +104,14 @@ rotation_distance: 40
gear_ratio: 80:16
microsteps: 16
endstop_pin: probe:z_virtual_endstop
position_max: 340
#endstop_pin: ^PF5
position_max: 310
position_min: -5
homing_speed: 8
second_homing_speed: 3
homing_retract_dist: 3
#position_endstop: 0
## Make sure to update below for your relevant driver (2208 or 2209)
[tmc2209 stepper_z]
@ -84,6 +121,10 @@ run_current: 0.8
sense_resistor: 0.110
stealthchop_threshold: 0
#[autotune_tmc stepper_z]
#motor: 17hs19-2004s-c
## Z1 Stepper - Rear Left on Motor5
[stepper_z1]
step_pin: PG13
@ -101,6 +142,9 @@ run_current: 0.8
sense_resistor: 0.110
stealthchop_threshold: 0
#[autotune_tmc stepper_z1]
#motor: 17hs19-2004s-c
## Z2 Stepper - Rear Right on Motor6
[stepper_z2]
step_pin: PG9
@ -118,6 +162,9 @@ run_current: 0.8
sense_resistor: 0.110
stealthchop_threshold: 0
#[autotune_tmc stepper_z2]
#motor: 17hs19-2004s-c
## Z3 Stepper - Front Right on Motor7
[stepper_z3]
step_pin: PD4
@ -134,3 +181,6 @@ interpolate: true
run_current: 0.8
sense_resistor: 0.110
stealthchop_threshold: 0
#[autotune_tmc stepper_z3]
#motor: 17hs19-2004s-c

View File

@ -1,6 +1,5 @@
[include test-speed.cfg]
[include buzz.cfg]
[include sensorless-homing.cfg]
[include print-start.cfg]
[include print-end.cfg]
# [include sb-leds.cfg]
[include g32.cfg]

View File

@ -1,24 +1,26 @@
[gcode_macro PRINT_END]
# Use PRINT_END for the slicer ending script - please customise for your slicer of choice
gcode:
SAVE_GCODE_STATE NAME=STATE_PRINT_END
SAVE_GCODE_STATE NAME=STATE_PRINT_END
SET_FAN_SPEED FAN=exhaust SPEED=1
M400 ; wait for buffer to clear
G92 E0 ; zero the extruder
G1 E-10.0 F3600 ; retract filament
M400 ; wait for buffer to clear
G92 E0 ; zero the extruder
G1 E-10.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 Z5 F3000 ; move nozzle up 5mm
G90 ; absolute positioning
G0 X175 Y350 F3600 ; park nozzle at rear
BED_MESH_CLEAR
G91 ; relative positioning
G0 Z1.00 X20.0 Y20.0 F20000 ; move nozzle to remove stringing
TURN_OFF_HEATERS
M107 ; turn off fan
G1 Z5 F3000 ; move nozzle up 5mm
G90 ; absolute positioning
G0 X175 Y350 F3600 ; park nozzle at rear
BED_MESH_CLEAR
# The purpose of the SAVE_GCODE_STATE/RESTORE_GCODE_STATE
# command pair is to restore the printer's coordinate system
# and speed settings since the commands above change them.
# However, to prevent any accidental, unintentional toolhead
# moves when restoring the state, explicitly set MOVE=0.
SET_SKEW CLEAR=1
RESTORE_GCODE_STATE NAME=STATE_PRINT_END MOVE=0
# The purpose of the SAVE_GCODE_STATE/RESTORE_GCODE_STATE
# command pair is to restore the printer's coordinate system
# and speed settings since the commands above change them.
# However, to prevent any accidental, unintentional toolhead
# moves when restoring the state, explicitly set MOVE=0.
RESTORE_GCODE_STATE NAME=STATE_PRINT_END MOVE=0

View File

@ -10,6 +10,8 @@
[gcode_macro PRINT_START]
gcode:
SET_SKEW CLEAR=1
SET_FAN_SPEED FAN=exhaust SPEED=0
# This part fetches data from your slicer. Such as bed temp, extruder temp, chamber temp and size of your printer.
{% set target_bed = params.BED|int %}
{% set target_extruder = params.EXTRUDER|int %}
@ -89,3 +91,4 @@ gcode:
G91 # Incremental positioning
G1 X100 E20 F1000 # Purge line
G90 # Absolut position
SKEW_PROFILE LOAD=basic

View File

@ -1,9 +1,11 @@
[gcode_macro _HOME_X]
gcode:
SAVE_GCODE_STATE NAME=HOMING_X
# 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 HOME_CURRENT = 0.8 %}
SET_TMC_CURRENT STEPPER=stepper_x CURRENT={HOME_CURRENT}
SET_TMC_CURRENT STEPPER=stepper_y CURRENT={HOME_CURRENT}
@ -18,13 +20,15 @@ gcode:
# Set current during print
SET_TMC_CURRENT STEPPER=stepper_x CURRENT={RUN_CURRENT_X}
SET_TMC_CURRENT STEPPER=stepper_y CURRENT={RUN_CURRENT_Y}
RESTORE_GCODE_STATE NAME=HOMING_X
[gcode_macro _HOME_Y]
gcode:
SAVE_GCODE_STATE NAME=HOMING_Y
# 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 HOME_CURRENT = 0.8 %}
SET_TMC_CURRENT STEPPER=stepper_x CURRENT={HOME_CURRENT}
SET_TMC_CURRENT STEPPER=stepper_y CURRENT={HOME_CURRENT}
@ -39,3 +43,4 @@ gcode:
# Set current during print
SET_TMC_CURRENT STEPPER=stepper_x CURRENT={RUN_CURRENT_X}
SET_TMC_CURRENT STEPPER=stepper_y CURRENT={RUN_CURRENT_Y}
RESTORE_GCODE_STATE NAME=HOMING_Y

124
macros/test-speed.cfg Normal file
View File

@ -0,0 +1,124 @@
[gcode_macro TEST_SPEED]
# Home, get position, throw around toolhead, home again.
# If MCU stepper positions (first line in GET_POSITION) are greater than a full step different (your number of microsteps), then skipping occured.
# We only measure to a full step to accomodate for endstop variance.
# Example: TEST_SPEED SPEED=300 ACCEL=5000 ITERATIONS=10
description: Test for max speed and acceleration parameters for the printer. Procedure: Home -> ReadPositionFromMCU -> MovesToolhead@Vel&Accel -> Home -> ReadPositionfromMCU
gcode:
# Speed
{% set speed = params.SPEED|default(printer.configfile.settings.printer.max_velocity)|int %}
# Iterations
{% set iterations = params.ITERATIONS|default(5)|int %}
# Acceleration
{% set accel = params.ACCEL|default(printer.configfile.settings.printer.max_accel)|int %}
# Minimum Cruise Ratio
{% set min_cruise_ratio = params.MIN_CRUISE_RATIO|default(0.5)|float %}
# Bounding inset for large pattern (helps prevent slamming the toolhead into the sides after small skips, and helps to account for machines with imperfectly set dimensions)
{% set bound = params.BOUND|default(20)|int %}
# Size for small pattern box
{% set smallpatternsize = SMALLPATTERNSIZE|default(20)|int %}
# Large pattern
# Max positions, inset by BOUND
{% set x_min = printer.toolhead.axis_minimum.x + bound %}
{% set x_max = printer.toolhead.axis_maximum.x - bound %}
{% set y_min = printer.toolhead.axis_minimum.y + bound %}
{% set y_max = printer.toolhead.axis_maximum.y - bound %}
# Small pattern at center
# Find X/Y center point
{% set x_center = (printer.toolhead.axis_minimum.x|float + printer.toolhead.axis_maximum.x|float ) / 2 %}
{% set y_center = (printer.toolhead.axis_minimum.y|float + printer.toolhead.axis_maximum.y|float ) / 2 %}
# Set small pattern box around center point
{% set x_center_min = x_center - (smallpatternsize/2) %}
{% set x_center_max = x_center + (smallpatternsize/2) %}
{% set y_center_min = y_center - (smallpatternsize/2) %}
{% set y_center_max = y_center + (smallpatternsize/2) %}
# Save current gcode state (absolute/relative, etc)
SAVE_GCODE_STATE NAME=TEST_SPEED
# Output parameters to g-code terminal
{ action_respond_info("TEST_SPEED: starting %d iterations at speed %d, accel %d" % (iterations, speed, accel)) }
# Home and get position for comparison later:
M400 # Finish moves - https://github.com/AndrewEllis93/Print-Tuning-Guide/issues/66
G28
# QGL if not already QGLd (only if QGL section exists in config)
{% if printer.configfile.settings.quad_gantry_level %}
{% if printer.quad_gantry_level.applied == False %}
QUAD_GANTRY_LEVEL
G28 Z
{% endif %}
{% endif %}
# Move 50mm away from max position and home again (to help with hall effect endstop accuracy - https://github.com/AndrewEllis93/Print-Tuning-Guide/issues/24)
G90
G1 X{printer.toolhead.axis_maximum.x-50} Y{printer.toolhead.axis_maximum.y-50} F{30*60}
M400 # Finish moves - https://github.com/AndrewEllis93/Print-Tuning-Guide/issues/66
G28 X Y
G0 X{printer.toolhead.axis_maximum.x-1} Y{printer.toolhead.axis_maximum.y-1} F{30*60}
G4 P1000
GET_POSITION
# Go to starting position
G0 X{x_min} Y{y_min} Z{bound + 10} F{speed*60}
# Set new limits
{% if printer.configfile.settings.printer.minimum_cruise_ratio is defined %}
SET_VELOCITY_LIMIT VELOCITY={speed} ACCEL={accel} MINIMUM_CRUISE_RATIO={min_cruise_ratio}
{% else %}
SET_VELOCITY_LIMIT VELOCITY={speed} ACCEL={accel} ACCEL_TO_DECEL={accel / 2}
{% endif %}
{% for i in range(iterations) %}
# Large pattern diagonals
G0 X{x_min} Y{y_min} F{speed*60}
G0 X{x_max} Y{y_max} F{speed*60}
G0 X{x_min} Y{y_min} F{speed*60}
G0 X{x_max} Y{y_min} F{speed*60}
G0 X{x_min} Y{y_max} F{speed*60}
G0 X{x_max} Y{y_min} F{speed*60}
# Large pattern box
G0 X{x_min} Y{y_min} F{speed*60}
G0 X{x_min} Y{y_max} F{speed*60}
G0 X{x_max} Y{y_max} F{speed*60}
G0 X{x_max} Y{y_min} F{speed*60}
# Small pattern diagonals
G0 X{x_center_min} Y{y_center_min} F{speed*60}
G0 X{x_center_max} Y{y_center_max} F{speed*60}
G0 X{x_center_min} Y{y_center_min} F{speed*60}
G0 X{x_center_max} Y{y_center_min} F{speed*60}
G0 X{x_center_min} Y{y_center_max} F{speed*60}
G0 X{x_center_max} Y{y_center_min} F{speed*60}
# Small pattern box
G0 X{x_center_min} Y{y_center_min} F{speed*60}
G0 X{x_center_min} Y{y_center_max} F{speed*60}
G0 X{x_center_max} Y{y_center_max} F{speed*60}
G0 X{x_center_max} Y{y_center_min} F{speed*60}
{% endfor %}
# Restore max speed/accel/accel_to_decel to their configured values
{% if printer.configfile.settings.printer.minimum_cruise_ratio is defined %}
SET_VELOCITY_LIMIT VELOCITY={printer.configfile.settings.printer.max_velocity} ACCEL={printer.configfile.settings.printer.max_accel} MINIMUM_CRUISE_RATIO={printer.configfile.settings.printer.minimum_cruise_ratio}
{% else %}
SET_VELOCITY_LIMIT VELOCITY={printer.configfile.settings.printer.max_velocity} ACCEL={printer.configfile.settings.printer.max_accel} ACCEL_TO_DECEL={printer.configfile.settings.printer.max_accel_to_decel}
{% endif %}
# Re-home and get position again for comparison:
M400 # Finish moves - https://github.com/AndrewEllis93/Print-Tuning-Guide/issues/66
G28 # This is a full G28 to fix an issue with CoreXZ - https://github.com/AndrewEllis93/Print-Tuning-Guide/issues/12
# Go to XY home positions (in case your homing override leaves it elsewhere)
G90
G0 X{printer.toolhead.axis_maximum.x-1} Y{printer.toolhead.axis_maximum.y-1} F{30*60}
G4 P1000
GET_POSITION
# Restore previous gcode state (absolute/relative, etc)
RESTORE_GCODE_STATE NAME=TEST_SPEED

3
materials/frem3d-asa.cfg Normal file
View File

@ -0,0 +1,3 @@
[material frem3d_asa]
pressure_advance: 0.056
flow_rate: 1.0

2
misc/arcs.cfg Normal file
View File

@ -0,0 +1,2 @@
[gcode_arcs]
resolution: 0.3

View File

@ -1,8 +1,8 @@
[bed_mesh]
speed: 300
speed: 600
horizontal_move_z: 2
mesh_min: 20,20
mesh_max: 320,320
probe_count: 5,5
mesh_max: 330,330
probe_count: 7,7
algorithm: bicubic
adaptive_margin: 5

2
misc/forced-move.cfg Normal file
View File

@ -0,0 +1,2 @@
[force_move]
enabled: True

21
misc/homing-override.cfg Normal file
View File

@ -0,0 +1,21 @@
[homing_override]
axes: xyz
set_position_z: 0
gcode:
G0 Z5
{% set home_all = 'X' not in params and 'Y' not in params and 'Z' not in params %}
{% if home_all or 'X' in params %}
_HOME_X
{% endif %}
{% if home_all or 'Y' in params %}
_HOME_Y
{% endif %}
{% if home_all or 'Z' in params %}
G0 X175 Y175 F18000
G28 Z
G1 Z10
{% endif %}

View File

@ -1,4 +1,8 @@
[input_shaper]
shaper_freq_x: 63.6
shaper_freq_y: 67.4
shaper_type: zv
shaper_freq_x: 58.6
shaper_type_x: mzv
damping_ratio_x: 0.073
shaper_freq_y: 65.4
shaper_type_y: 2hump_ei
damping_ratio_y: 0.051

View File

@ -2,3 +2,6 @@
[include input-shaper.cfg]
[include shake-n-tune.cfg]
[include firmware-retraction.cfg]
[include homing-override.cfg]
[include arcs.cfg]
[include skew.cfg]

1
misc/skew.cfg Normal file
View File

@ -0,0 +1 @@
[skew_correction]

27
misc/tmc-autotune.cfg Normal file
View File

@ -0,0 +1,27 @@
[motor_constants 17hS19-2004s-ab]
resistance: 1.30
# Coil inductance, Henries
inductance: 0.0027
# Holding torque, Nm
holding_torque: 0.67
# Nominal rated current, Amps
max_current: 2.00
# Steps per revolution (1.8deg motors use 200, 0.9deg motors use 400)
steps_per_revolution: 200
[autotune_tmc stepper_x]
motor: ldo-42sth48-2004mah
[autotune_tmc stepper_y]
motor: ldo-42sth48-2004mah
[autotune_tmc stepper_z]
motor: ldo-42sth48-2004ac
[autotune_tmc stepper_z1]
motor: ldo-42sth48-2004ac
[autotune_tmc stepper_z2]
motor: ldo-42sth48-2004ac
[autotune_tmc stepper_z3]
motor: ldo-42sth48-2004ac
[autotune_tmc extruder]
motor: ldo-36sth20-1004ahg

View File

@ -5,6 +5,7 @@ klippy_uds_address: /home/biqu/printer_data/comms/klippy.sock
[file_manager]
enable_object_processing: True
default_metadata_parser_timeout: 30 ; ref. happy hare
[authorization]
trusted_clients:
@ -30,14 +31,16 @@ cors_domains:
[update_manager]
channel: dev
refresh_interval: 168
enable_auto_refresh: False
[update_manager Klipper-Adaptive-Meshing-Purging]
[update_manager klipper_tmc_autotune]
type: git_repo
channel: dev
path: ~/Klipper-Adaptive-Meshing-Purging
origin: https://github.com/kyleisah/Klipper-Adaptive-Meshing-Purging.git
path: ~/klipper_tmc_autotune
#origin: https://github.com/andrewmcgr/klipper_tmc_autotune.git
managed_services: klipper
primary_branch: main
install_script: install.sh
[update_manager mainsail-config]
type: git_repo

View File

@ -1,166 +0,0 @@
[gcode_macro BED_MESH_CALIBRATE]
# print surface bed mesh calibrate
# Works with Klicky Probe on Voron
# November 24, 2021
# Steve Turgeon
rename_existing: _BED_MESH_CALIBRATE
variable_buffer: 20
; Do not change any of the existing values below.
variable_last_area_start_x: -1 ; Do not change
variable_last_area_start_y: -1 ; Do not change
variable_last_area_end_x: -1 ; Do not change
variable_last_area_end_y: -1 ; Do not change
gcode:
{% if params.FORCE_NEW_MESH != null %}
{ action_respond_info("Force New Mesh: %s" % (params.FORCE_NEW_MESH)) }
{% endif %}
{% if printer["bed_mesh"].profile_name == '' %}
{ action_respond_info("No existing bed mesh found.") }
{% set last_area_end_x=-1 %}
{% endif %}
{% if printer.toolhead.homed_axes != "xyz" %}
G28
{% endif %}
{% set klicky_available = printer['gcode_macro _Probe_Variables'] != null %}
{% set euclid_available = printer['gcode_macro EuclidProbe'] != null %}; Requires v5 macros https://github.com/nionio6915/Euclid_Probe/blob/main/Firmware_Examples/Klipper/00-euclid_exampleV5.cfg
{% if params.PRINT_MIN %}
{ action_respond_info("print_min: %s" % params.PRINT_MIN) }
{ action_respond_info("print_max: %s" % params.PRINT_MAX) }
{% set blTouchConfig = printer['configfile'].config["bltouch"] %}
{% if blTouchConfig %}
{% set OffsetX = blTouchConfig.x_offset|default(0)|float %}
{% set OffsetY = blTouchConfig.y_offset|default(0)|float %}
{% endif %}
{% set probeConfig = printer['configfile'].config["probe"] %}
{% if probeConfig %}
{% set OffsetX = probeConfig.x_offset|default(0)|float %}
{% set OffsetY = probeConfig.y_offset|default(0)|float %}
{% endif %}
{% set print_min_x = params.PRINT_MIN.split(",")[0]|float %}
{% set print_min_y = params.PRINT_MIN.split(",")[1]|float %}
{% set print_max_x = params.PRINT_MAX.split(",")[0]|float %}
{% set print_max_y = params.PRINT_MAX.split(",")[1]|float %}
{% if last_area_start_x > 0 %}
{ action_respond_info("last_bed_mesh: %s,%s %s,%s" % (last_area_start_x, last_area_start_y, last_area_end_x, last_area_end_y)) }
{% endif %}
{% if (params.FORCE_NEW_MESH != null) or (print_min_x < last_area_start_x) or (print_max_x > last_area_end_x) or (print_min_y < last_area_start_y) or (print_max_y > last_area_end_y) %}
{% if klicky_available %}
_CheckProbe action=query
Attach_Probe
{% elif euclid_available %}
DEPLOY_PROBE
{% endif %}
{% if (print_min_x < print_max_x) and (print_min_y < print_max_y) %}
# Get bed_mesh config (probe count, mesh_min and mesh_max for x and y
{% set bedMeshConfig = printer['configfile'].config["bed_mesh"] %}
{% set minimum_probe_count = 3 %}
{% if bedMeshConfig.algorithm == "bicubic" %}
{% set minimum_probe_count = 5 %}
{% endif %}
{% set probe_count = bedMeshConfig.probe_count.split(",") %}
{% set probe_count_x = probe_count[0]|int %}
{% if probe_count.__len__() > 1 %}
{% set probe_count_y = probe_count[1]|int %}
{% else %}
{% set probe_count_y = probe_count_x|int %}
{% endif %}
{% set relative_reference_index = bedMeshConfig.relative_reference_index %}
{% set mesh_min_x = bedMeshConfig.mesh_min.split(",")[0]|float %}
{% set mesh_min_y = bedMeshConfig.mesh_min.split(",")[1]|float %}
{% set mesh_max_x = bedMeshConfig.mesh_max.split(",")[0]|float %}
{% set mesh_max_y = bedMeshConfig.mesh_max.split(",")[1]|float %}
# If print area X is smaller than 50% of the bed size, change to to 3 probe counts for X instead of the default
{% if print_max_x - print_min_x < (mesh_max_x - mesh_min_x) * 0.50 %}
{% set probe_count_x = minimum_probe_count %}
{% endif %}
# If print area Y is smaller than 50% of the bed size, change to to 3 probe counts for Y instead of the default
{% if print_max_y - print_min_y < (mesh_max_y - mesh_min_y) * 0.50 %}
{% set probe_count_y = minimum_probe_count %}
{% endif %}
{% if print_min_x - buffer >= mesh_min_x %}
{% set mesh_min_x = print_min_x - buffer %}
{% endif %}
{% if print_min_y - buffer >= mesh_min_y %}
{% set mesh_min_y = print_min_y - buffer %}
{% endif %}
{% if print_max_x + buffer <= mesh_max_x %}
{% set mesh_max_x = print_max_x + buffer %}
{% endif %}
{% if print_max_y + buffer <= mesh_max_y %}
{% set mesh_max_y = print_max_y + buffer %}
{% endif %}
{ action_respond_info("mesh_min: %s,%s" % (mesh_min_x, mesh_min_y)) }
{ action_respond_info("mesh_max: %s,%s" % (mesh_max_x, mesh_max_y)) }
{ action_respond_info("probe_count: %s,%s" % (probe_count_x,probe_count_y)) }
; Set variables so they're available outside of macro
SET_GCODE_VARIABLE MACRO=BED_MESH_CALIBRATE VARIABLE=last_area_start_x VALUE={print_min_x}
SET_GCODE_VARIABLE MACRO=BED_MESH_CALIBRATE VARIABLE=last_area_start_y VALUE={print_min_y}
SET_GCODE_VARIABLE MACRO=BED_MESH_CALIBRATE VARIABLE=last_area_end_x VALUE={print_max_x}
SET_GCODE_VARIABLE MACRO=BED_MESH_CALIBRATE VARIABLE=last_area_end_y VALUE={print_max_y}
{% if printer["gcode_macro status_meshing"] != null %}
status_meshing
{% endif %}
{% if relative_reference_index == 0 or relative_reference_index == null %}
_BED_MESH_CALIBRATE mesh_min={mesh_min_x},{mesh_min_y} mesh_max={mesh_max_x},{mesh_max_y} probe_count={probe_count_x},{probe_count_y}
{% else %}
{% set relative_reference_index = ((probe_count_x * probe_count_y - 1) / 2)|int %}
{ action_respond_info("relative_reference_index: %s" % relative_reference_index) }
_BED_MESH_CALIBRATE mesh_min={mesh_min_x},{mesh_min_y} mesh_max={mesh_max_x},{mesh_max_y} probe_count={probe_count_x},{probe_count_y} relative_reference_index={relative_reference_index}
{% endif %}
{% else %}
{% if printer["gcode_macro status_meshing"] != null %}
status_meshing
{% endif %}
_BED_MESH_CALIBRATE
{% endif %}
{% if klicky_available %}
Dock_Probe
{% elif euclid_available %}
STOW_PROBE
{% endif %}
{% else %}
{ action_respond_info("No need to recreate Bed Mesh since it's same as current mesh or smaller") }
{% endif %}
{% else %}
{% if klicky_available %}
_CheckProbe action=query
Attach_Probe
{% elif euclid_available %}
STOW_PROBE
{% endif %}
{% if printer["gcode_macro status_meshing"] != null %}
status_meshing
{% endif %}
_BED_MESH_CALIBRATE
{% if klicky_available %}
Dock_Probe
{% endif %}
{% if euclid_available %}
STOW_PROBE
{% endif %}
{% endif %}
{% if printer["gcode_macro status_ready"] != null %}
status_ready
{% endif %}

View File

@ -1,17 +1,17 @@
#[include print_area_bed_mesh.cfg]
[include mainsail.cfg]
[include hardware/hardware.cfg]
[include toolhead/toolhead.cfg]
[include misc/misc.cfg]
[include macros/macros.cfg]
[include config/config.cfg]
[printer]
max_velocity: 300
max_accel: 6000
max_velocity: 500
max_accel: 9000
kinematics: corexy
max_z_velocity: 15 #Max 15 for 12V TMC Drivers, can increase for 24V
max_z_accel: 350
max_z_velocity: 300 #Max 15 for 12V TMC Drivers, can increase for 24V
max_z_accel: 1000
square_corner_velocity: 5.0
[exclude_object]

87
toolhead/t0.cfg Normal file
View File

@ -0,0 +1,87 @@
# This file contains common pin mappings for the BIGTREETECH t0
# Canbus board. To use this config, the firmware should be compiled for the
# STM32G0B1 with "8 MHz crystal" and "USB (on PA11/PA12)" or "CAN bus (on PB0/PB1)".
# The "EBB Can" micro-controller will be used to control the components on the nozzle.
# See docs/Config_Reference.md for a description of parameters.
[mcu t0]
canbus_uuid: 336f4a59eb4e
[temperature_sensor t0]
sensor_type: temperature_mcu
sensor_mcu: t0
max_temp: 100
[adxl345]
cs_pin: t0: PB12
spi_software_sclk_pin: t0: PB10
spi_software_mosi_pin: t0: PB11
spi_software_miso_pin: t0: PB2
axes_map: x,y,z
[resonance_tester]
accel_chip: adxl345
probe_points:
175, 175, 20
[extruder]
step_pin: t0: PD0
dir_pin: t0: PD1
enable_pin: !t0: PD2
heater_pin: t0: PB13
sensor_type: Generic 3950
sensor_pin: t0: PA3
min_temp: 0
max_temp: 450
microsteps: 16
control: pid
pid_kp: 19.512
pid_ki: 0.798
pid_kd: 119.265
rotation_distance: 5.53014
filament_diameter: 1.75
nozzle_diameter: 0.4
max_extrude_cross_section: 5
max_extrude_only_distance: 101
pressure_advance: 0.052
# sensor_type:MAX31865
# sensor_pin: t0: PA4
# spi_bus: spi1
# rtd_nominal_r: 100
# rtd_reference_r: 430
# rtd_num_of_wires: 2
# Probe
#####################################################################
## Probe Port
[probe]
pin: t0:PB6
z_offset: -1.1
[tmc2209 extruder]
uart_pin: t0: PA15
run_current: 0.650
stealthchop_threshold: 999999
[fan]
pin: t0: PA0
[heater_fan hotend_fan]
pin: t0: PA1
heater: extruder
heater_temp: 50.0
#[neopixel hotend_rgb]
#pin: t0:PD3
#[bltouch]
#sensor_pin: ^t0:PB8
#control_pin: t0:PB9
#[filament_switch_sensor switch_sensor]
#switch_pin: t0:PB4
#[filament_motion_sensor motion_sensor]
#switch_pin: ^t0:PB3

1
toolhead/toolhead.cfg Normal file
View File

@ -0,0 +1 @@
[include t0.cfg]