Files
KlipperConfig/printer.cfg

422 lines
9.3 KiB
INI

[include fluidd.cfg]
[virtual_sdcard]
path: /home/dan/printer_data/gcodes
on_error_gcode: CANCEL_PRINT
[stepper_x]
step_pin: PB13
dir_pin: !PB12
enable_pin: !PB14
microsteps: 16
rotation_distance: 40
endstop_pin: ^PC0
position_endstop: 0
position_max: 235
homing_speed: 50
[tmc2209 stepper_x]
uart_pin: PC11
tx_pin: PC10
uart_address: 0
run_current: 0.580
stealthchop_threshold: 999999
[stepper_y]
step_pin: PB10
dir_pin: !PB2
enable_pin: !PB11
microsteps: 16
rotation_distance: 40
endstop_pin: ^PC1
position_endstop: 0
position_max: 235
homing_speed: 50
[tmc2209 stepper_y]
uart_pin: PC11
tx_pin: PC10
uart_address: 2
run_current: 0.580
stealthchop_threshold: 999999
[stepper_z]
step_pin: PB0
dir_pin: PC5
enable_pin: !PB1
microsteps: 16
rotation_distance: 8
endstop_pin: probe:z_virtual_endstop
#position_endstop: 0.0
position_max: 250
position_min: -3
[tmc2209 stepper_z]
uart_pin: PC11
tx_pin: PC10
uart_address: 1
run_current: 0.580
stealthchop_threshold: 999999
[extruder]
step_pin: PB3
dir_pin: !PB4
enable_pin: !PD1
microsteps: 16
rotation_distance: 22.625
nozzle_diameter: 0.400
filament_diameter: 1.750
heater_pin: PC8
sensor_type: EPCOS 100K B57560G104F
sensor_pin: PA0
#control: pid
# tuned for stock hardware with 200 degree Celsius target
#pid_Kp: 21.527
#pid_Ki: 1.063
#pid_Kd: 108.982
min_temp: 0
max_temp: 250
max_extrude_cross_section: 50
max_extrude_only_distance: 100
#pressure_advance = 0.76
[tmc2209 extruder]
uart_pin: PC11
tx_pin: PC10
uart_address: 3
run_current: 0.650
stealthchop_threshold: 999999
[heater_bed]
heater_pin: PC9
sensor_type: ATC Semitec 104GT-2
sensor_pin: PC4
control: pid
pid_Kp: 54.027
pid_Ki: 0.770
pid_Kd: 948.182
min_temp: 0
max_temp: 130
[heater_fan nozzle_cooling_fan]
pin: PC7
[heater_fan controller_fan]
pin: PB15
[fan]
pin: PC6
[mcu]
serial: /dev/serial/by-id/usb-Klipper_stm32g0b1xx_3E0031001850344D30363620-if00
[printer]
kinematics: cartesian
max_velocity: 300
max_accel: 3000
max_z_velocity: 5
max_z_accel: 100
[board_pins]
aliases:
# EXP1 header
EXP1_1=PB5, EXP1_3=PA9, EXP1_5=PA10, EXP1_7=PB8, EXP1_9=<GND>,
EXP1_2=PA15, EXP1_4=<RST>, EXP1_6=PB9, EXP1_8=PD6, EXP1_10=<5V>
[display]
lcd_type: st7920
cs_pin: EXP1_7
sclk_pin: EXP1_6
sid_pin: EXP1_8
encoder_pins: ^EXP1_5, ^EXP1_3
click_pin: ^!EXP1_2
#[output_pin beeper]
#pin: EXP1_1
[output_pin BEEPER_pin]
pin: EXP1_1
pwm: True
value: 0
shutdown_value: 0
cycle_time: 0.001
scale: 1
[gcode_macro M300]
gcode:
# # Use a default 1kHz tone if S is omitted.
{% set S = params.S|default(1000)|int %}
# Use a 10ms duration is P is omitted.
{% set P = params.P|default(100)|int %}
SET_PIN PIN=BEEPER_pin VALUE=0.5 CYCLE_TIME={ 1.0/S if S > 0 else 1 }
G4 P{P}
SET_PIN PIN=BEEPER_pin VALUE=0
[display_status]
[pause_resume]
[bltouch]
sensor_pin: PC14
control_pin: PA1
#x_offset: -40.0
#y_offset: -8.0
#z_offset: 1.5
x_offset: -47.2
y_offset: -7.5
speed: 5.0
samples: 1
sample_retract_dist: 8.0
[bed_mesh]
speed: 100
horizontal_move_z: 5
mesh_min: 42,10
mesh_max: 180, 210
probe_count: 3,3
[homing_override]
set_position_z:0
gcode:
G1 Z10 F600
G28 X Y
G1 X166 Y120 F6000
G28 Z
# The print bed can move so far to the front, that the nozzle can reach the
# plastic cover of the print bed heater cable (only when the bed is moved by
# hand). By homing the Y axis before the X axis, it is ensured the nozzle will
# not melt through the plastic part.
# BEWARE: You will lose the ability to home axes individually. The printer will
# always home all axes for every G28 command.
#[homing_override]
#gcode:
# G28 Y0
# G28 X0
# G28 Z0
[gcode_macro PAUSE]
description: Pause the actual running print
rename_existing: PAUSE_BASE
# change this if you need more or less extrusion
variable_extrude: 1.0
gcode:
##### read E from pause macro #####
{% set E = printer["gcode_macro PAUSE"].extrude|float %}
##### set park positon for x and y #####
# default is your max posion from your printer.cfg
{% set x_park = printer.toolhead.axis_maximum.x|float - 5.0 %}
{% set y_park = printer.toolhead.axis_maximum.y|float - 5.0 %}
##### calculate save lift 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 %}
##### end of definitions #####
PAUSE_BASE
G91
{% if printer.extruder.can_extrude|lower == 'true' %}
G1 E-{E} F2100
{% else %}
{action_respond_info("Extruder not hot enough")}
{% endif %}
{% if "xyz" in printer.toolhead.homed_axes %}
G1 Z{z_safe} F900
G90
G1 X{x_park} Y{y_park} F6000
{% else %}
{action_respond_info("Printer not homed")}
{% endif %}
[gcode_macro RESUME]
description: Resume the actual running print
rename_existing: RESUME_BASE
gcode:
##### read E from pause macro #####
{% set E = printer["gcode_macro PAUSE"].extrude|float %}
#### get VELOCITY parameter if specified ####
{% if 'VELOCITY' in params|upper %}
{% set get_params = ('VELOCITY=' + params.VELOCITY) %}
{%else %}
{% set get_params = "" %}
{% endif %}
##### end of definitions #####
{% if printer.extruder.can_extrude|lower == 'true' %}
G91
G1 E{E} F2100
{% else %}
{action_respond_info("Extruder not hot enough")}
{% endif %}
RESUME_BASE {get_params}
[gcode_macro CANCEL_PRINT]
description: Cancel the actual running print
rename_existing: CANCEL_PRINT_BASE
gcode:
TURN_OFF_HEATERS
CANCEL_PRINT_BASE
[gcode_macro LEVEL_BED]
gcode:
M104 S200 ; set extruder temp
M140 S60 ; set bed temp
G28
M190 S60 ; wait for bed temp
M109 S200 ; wait for extruder temp
BED_MESH_CALIBRATE
BED_MESH_PROFILE SAVE=ender3
SAVE_CONFIG
m117 Bed Leveled
[gcode_macro g29]
gcode:
BED_MESH_CALIBRATE
# BED_MESH_PROFILE LOAD=ender3
[gcode_macro MQTT_START]
gcode:
{action_call_remote_method("publish_mqtt_topic",
topic="alert",
payload="Print is starting",
qos=1,
retain=False,
use_prefix=True)}
[gcode_macro MQTT_COMPLETE]
gcode:
{action_call_remote_method("publish_mqtt_topic",
topic="alert",
payload="Print is complete",
qos=1,
retain=False,
use_prefix=True)}
[gcode_macro START_PRINT]
gcode:
;MQTT_START
M117 Heating...;
#;M221 S{if layer_height<0.075}100{else}95{endif} ; Set flow
M104 S{ params.TOOL_TEMP } ; set extruder temp
M140 S{ params.BED_TEMP } ; set bed temp
#G1 Z20 ; this is a good start heating position
M84 ; disable motors
M190 S{ params.BED_TEMP } ; wait for bed temp
M109 S{ params.TOOL_TEMP } ; wait for extruder temp
; Start of print
G21; metric values
G90 ; absolute positioning
M82; set extruder to absolute mode
G28;
G29;
; Prepare nozzle
G92 E0 ; Set extrusion distance to 0
G92 E0 ; Set extrusion distance to 0
G1 F1800 E3;
G92 E0 ; Set extrusion distance to 0
G90;
; You may want to adjust the X and Y here so the nozzle is really above the bed!
G1 X5.0 Y5.0 F7200 ; Move to a position in the left front of the bed
G1 Z0.6; Move nozzle above 0.6 mm of the bed
G91 ; Use relative mode
; Make some jerky zick-zack move at the beginning
; This is supposed to get rid of residue at the nozzle
G1 X1.0 Y5.0 Z-0.1 E-1.0 F7000 ; X6 Y10 Z0.1, retract a tiny bit / 120mm/s
G1 X1.0 Y-5.0 Z0.1 E10.0 F7000 ; X7 Y5 Z0.2 extrude a tiny bit
G1 X2.0 Y5.0 Z-0.1 F7200 ; X9 Y10 Z0.1
G1 X2.0 Y-5.0 Z0.1 F7200 ; X11 Y5 Z0.2
G1 X2.0 Y5.0 F7200 ; X13 Y10
G1 X2.0 Y-5.0 F7200 ; X15 Y5
; now print a line of filament to prepare extrusion
G1 Y50 E20 F1000 ; prints a line in the front
G1 Y50 E30 F1000 ; prints a line in the front
; Done with the dancing :)
G92 E0 ; Set extrusion distance to 0
G90 ; switch back to absolute mode
; unsquish it a little bit more
SET_GCODE_OFFSET Z_ADJUST=.15
M117 Printing...
; Start of actual GCode for the print
[gcode_macro END_PRINT]
gcode:
G4 ; wait
M221 S100
M106 S0 ; turn off cooling fan
M104 S0 ; turn off extruder
M140 S0 ; turn off bed
G91;
G1 F1800 E-3;
G90;
#{if layer_z < max_print_height}G1 Z{z_offset+min(layer_z+30, max_print_height)}{endif} ; Move print head up
G1 Z{printer.toolhead.position.z + 10} F600;
;G28 X0 ; home x and y axis
g1 x10;
G1 Y180; Remove Print Position
M84 ; disable motors
S2600 P100;
m300;
m300;
MQTT_COMPLETE
#*# <---------------------- SAVE_CONFIG ---------------------->
#*# DO NOT EDIT THIS BLOCK OR BELOW. The contents are auto-generated.
#*#
#*# [bed_mesh default]
#*# version = 1
#*# points =
#*# 0.130000, 0.215000, 0.302500
#*# -0.132500, 0.007500, 0.202500
#*# -0.217500, -0.045000, 0.152500
#*# tension = 0.2
#*# min_x = 42.0
#*# algo = lagrange
#*# y_count = 3
#*# mesh_y_pps = 2
#*# min_y = 10.0
#*# x_count = 3
#*# max_y = 210.0
#*# mesh_x_pps = 2
#*# max_x = 180.0
#*#
#*# [bed_mesh ender3]
#*# version = 1
#*# points =
#*# 0.167500, 0.120000, 0.097500
#*# 0.010000, -0.002500, -0.062500
#*# -0.232500, -0.222500, -0.325000
#*# tension = 0.2
#*# min_x = 42.0
#*# algo = lagrange
#*# y_count = 3
#*# mesh_y_pps = 2
#*# min_y = 10.0
#*# x_count = 3
#*# max_y = 210.0
#*# mesh_x_pps = 2
#*# max_x = 180.0
#*#
#*# [extruder]
#*# control = pid
#*# pid_kp = 24.253
#*# pid_ki = 1.263
#*# pid_kd = 116.413
#*#
#*# [bltouch]
#*# z_offset = 0.500