Blockquote
===== Config file =====
[virtual_sdcard]
path = /home/pi/printer_data/gcodes
[pause_resume]
recover_velocity = 50.0
[display_status]
[gcode_macro CANCEL_PRINT]
description = Cancel the actual running print
rename_existing = CANCEL_PRINT_BASE
gcode =
TURN_OFF_HEATERS
CLEAR_PAUSE
G91 ; Set coordinates to relative
G1 F1800 E-3 ; Retract filament 3 mm to prevent oozing
G1 F3000 Z20 ; raise head
G90 ; Set coordinates to absolute
G1 X10 Y200 F5000.0 ; Move to start position
M106 S0
M84
BED_MESH_PROFILE REMOVE=default
FIRMWARE_RESTART
[gcode_macro PAUSE]
description = Pause the actual running print
rename_existing = PAUSE_BASE
variable_extrude = 1.0
gcode =
{% set x = params.X|default(10) %}
{% set y = params.Y|default(10) %}
{% set z = params.Z|default(10)|float %}
{% set e = params.E|default(1) %}
{% set max_z = printer.toolhead.axis_maximum.z|float %}
{% set act_z = printer.toolhead.position.z|float %}
{% set lift_z = z|abs %}
{% if act_z < (max_z - lift_z) %}
{% set z_safe = lift_z %}
{% else %}
{% set z_safe = max_z - act_z %}
{% endif %}
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}
G90
G1 X{x} Y{y} F6000
{% else %}
{action_respond_info(“Printer not homed”)}
{% endif %}
[gcode_macro RESUME]
description = Resume the actual running print
rename_existing = RESUME_BASE
gcode =
{% set e = params.E|default(1) %}
{% if ‘VELOCITY’ in params|upper %}
{% set get_params = (‘VELOCITY=’ + params.VELOCITY) %}
{%else %}
{% set get_params = “” %}
{% endif %}
G91
{% if printer.extruder.can_extrude|lower == ‘true’ %}
G1 E{e} F2100
{% else %}
{action_respond_info(“Extruder not hot enough”)}
{% endif %}
RESUME_BASE {get_params}
[printer]
kinematics = corexy
max_velocity = 300
max_accel = 3000
max_z_velocity = 25
max_z_accel = 30
[mcu]
serial = /dev/serial/by-id/usb-Klipper_stm32f103xe_33FFD8055641343421832043-if00
[stepper_x]
step_pin = PB13
dir_pin = !PB12
enable_pin = !PB14
microsteps = 16
rotation_distance = 40
endstop_pin = ^PC0
position_endstop = 0
position_max = 340
homing_speed = 50
homing_retract_dist = 10
second_homing_speed = 10.0
[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 = 300
homing_retract_dist = 10
homing_speed = 50
second_homing_speed = 10
[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_max = 400
[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 = !PD2
microsteps = 16
rotation_distance = 33.520
nozzle_diameter = 0.400
filament_diameter = 1.750
heater_pin = PC8
sensor_type = ATC Semitec 104GT-2
sensor_pin = PA0
control = pid
pid_kp = 21.527
pid_ki = 1.063
pid_kd = 108.982
min_temp = 0
max_temp = 250
max_extrude_only_distance = 300
[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 = EPCOS 100K B57560G104F
sensor_pin = PC3
control = pid
pid_kp = 54.027
pid_ki = 0.770
pid_kd = 948.182
min_temp = 0
max_temp = 130
[heater_fan heatbreak_cooling_fan]
pin = PC7
[skew_correction]
[bed_mesh]
speed = 170
horizontal_move_z = 5
mesh_min = 60, 60
mesh_max = 300, 300
probe_count = 5, 5
algorithm = bicubic
fade_start = 1
fade_end = 10
fade_target = 0
[gcode_macro _bot_data]
variable_lapse_video_size = 0
variable_lapse_filename = ‘None’
variable_lapse_path = ‘None’
gcode =
M118 Setting bot lapse variables
[gcode_macro M600]
gcode =
PAUSE
[gcode_macro RESTARTPRINTER]
gcode =
FIRMWARE_RESTART
[gcode_macro BED_MESH_CALIBRATE]
rename_existing = BED_MESH_CALIBRATE_BASE
gcode =
G28
{% set mesh_delta = 25 %} ;; distance between points
{% set x_mesh_max = 7 %} ;; max points on x-axis
{% set y_mesh_max = 7 %} ;; max points on y-axis
{% set mesh_area_offset = 0 %};; the clearance between print area and probe area
{% set parameter_AREA_START = “0,0” %} ;; gcode parameter to be defined by slicer
{% set parameter_AREA_END = “0,0” %} ;; gcode parameter to be defined by slicer
{% if params.AREA_START and params.AREA_END %}
;; get [bltouch] config parameters
{% set BLTouchConfig = printer[“configfile”].config[“bltouch”] %}
{% set probe_samples = BLTouchConfig.samples|int %}
{% set probe_samples_tolerance_retries = BLTouchConfig.samples_tolerance_retries|int %}
{% set probe_samples_tolerance = BLTouchConfig.samples_tolerance|float %}
{% set probe_sample_retract_dist = BLTouchConfig.sample_retract_dist|float %}
{% set probe_samples_result = samples_result %}
;; get [bed_mesh] config parameters
{% set bedMeshConfig = printer[“configfile”].config[“bed_mesh”] %}
{% set mesh_algorithm = bedMeshConfig.algorithm %}
{% 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 meshPointX = bedMeshConfig.probe_count.split(“,”)[0]|int %}
{% set meshPointY = bedMeshConfig.probe_count.split(“,”)[1]|int %}
{% set meshMaxPointX = meshPointX %}
{% set meshMaxPointY = meshPointY %}
;; get print area min/max from slicer gcode
{% 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 %}
;; check if print area min/max from slicer gcode is compatable with [bed_mesh] min/max
{% if (area_min_x < area_max_x) and (area_min_y < area_max_y) %}
;; set probing area
{% 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 probe counts
{% if (area_max_x - area_min_x) / 3 < mesh_delta %}
{% set meshPointX = 3 %}
{% elif (area_max_x - area_min_x) / 5 < mesh_delta %}
{% set meshPointX = 5 %}
{% elif (area_max_x - area_min_x) / 7 < mesh_delta %}
{% set meshPointX = 7 %}
{% elif (area_max_x - area_min_x) / 9 < mesh_delta %}
{% set meshPointX = 9 %}
{% elif (area_max_x - area_min_x) / 11 < mesh_delta %}
{% set meshPointX = 11 %}
{% endif %}
{% if (area_max_y - area_min_y) / 3 < mesh_delta %}
{% set meshPointY = 3 %}
{% elif (area_max_y - area_min_y) / 5 < mesh_delta %}
{% set meshPointY = 5 %}
{% elif (area_max_y - area_min_y) / 7 < mesh_delta %}
{% set meshPointY = 7 %}
{% elif (area_max_y - area_min_y) / 9 < mesh_delta %}
{% set meshPointY = 9 %}
{% elif (area_max_y - area_min_y) / 11 < mesh_delta %}
{% set meshPointY = 11 %}
{% endif %}
;; check probe count vs max
{% if meshPointX > x_mesh_max %}
{% set meshPointX = x_mesh_max %}
{% endif %}
{% if meshPointY > y_mesh_max %}
{% set meshPointY = y_mesh_max %}
{% endif %}
;; check for 7x3 or 3x7 mesh
{% if meshPointX > 5 %}
{% if meshPointY == 3 %}
{% set meshPointY = 5 %}
{% endif %}
{% endif %}
{% if meshPointY > 5 %}
{% if meshPointX == 3 %}
{% set meshPointX = 5 %}
{% endif %}
{% endif %}
;; set new reference index point
{% set referenceIndex = (meshPointX * meshPointY / 2 - 1 )|round(0)|int %}
;; send bed mesh parameters
M117 Mesh {meshPointX}x{meshPointY}
M118 Mesh {meshPointX}x{meshPointY}
M118 PROBE samples={probe_samples} sample_retract_dist={probe_sample_retract_dist} samples_tolerance={probe_samples_tolerance} samples_tolerance_retries={probe_samples_tolerance_retries} samples_result={probe_samples_result}
M118 BED_MESH_CALIBRATE_BASE mesh_min={area_min_x},{area_min_y} mesh_max={area_max_x},{area_max_y} probe_count={meshPointX},{meshPointY} relative_reference_index={referenceIndex} algorithm={mesh_algorithm}
PROBE samples={probe_samples} sample_retract_dist={probe_sample_retract_dist} samples_tolerance={probe_samples_tolerance} samples_tolerance_retries={probe_samples_tolerance_retries} samples_result={probe_samples_result}
BED_MESH_CALIBRATE_BASE mesh_min={area_min_x},{area_min_y} mesh_max={area_max_x},{area_max_y} probe_count={meshPointX},{meshPointY} relative_reference_index={referenceIndex} algorithm={mesh_algorithm}
{% else %}
BED_MESH_CALIBRATE_BASE
{% endif %}
{% else %}
BED_MESH_CALIBRATE_BASE
{% endif %}
[gcode_macro LOAD_FILAMENT]
gcode =
SAVE_GCODE_STATE NAME=LOAD_FILAMENT
M83
G92 E0.0
G1 E20 F100
G92 E0.0
RESTORE_GCODE_STATE NAME=LOAD_FILAMENT MOVE=1
[gcode_macro UNLOAD_FILAMENT]
gcode =
SAVE_GCODE_STATE NAME=UNLOAD_FILAMENT
G1 E0.5 F1000
G1 E-0.5 F1000
G1 E1.0 F1000
G1 E-1.0 F1000
G1 E1.5 F1000
G1 E-1.5 F1000
G1 E2.0 F1000
G1 E-100 F3000
G92 E0.0
RESTORE_GCODE_STATE NAME=UNLOAD_FILAMENT MOVE=1
[gcode_macro ALL_HOME]
gcode =
G28
[gcode_macro START_PRINT]
gcode =
{% set bed_temp = params.BED_TEMP|default(40)|int %}
{% set extruder_temp = params.EXTRUDER_TEMP|default(200)|int %}
M117 Waiting on bed
M190 S{bed_temp}
M104 S160
M117 Homing
G28
BED_MESH_PROFILE LOAD=default
G1 Z10.0 F3000
G92 E0
M117 Waiting on nozzle
M104 S{extruder_temp}
G1 Z2.0 F3000
G1 X0.1 Y20 Z2.0 F5000.0
M109 S{extruder_temp}
M117 Purging
G1 X0.1 Y20 Z0.3 F5000.0
G1 X0.1 Y150.0 Z0.3 F1500.0 E15
G1 X0.4 Y150.0 Z0.3 F5000.0
G1 X0.4 Y20 Z0.3 F1500.0 E30
G92 E0
G1 Z5.0 F3000
M117 Printing
[gcode_macro END_PRINT]
gcode =
G91
G1 E-2 F2700
G1 E-2 Z0.2 F2400
G1 X5 Y5 F3000
M140 S0
M104 S0
M106 S0
G1 Z10 F3000
G90
G1 X0 Y235
M84 X Y E
BED_MESH_CLEAR
SET_GCODE_OFFSET Z=0
M117 Print complete
[fan]
pin = PC6
[bltouch]
sensor_pin = ^PC14
control_pin = PA1
pin_move_time = 0.675
stow_on_each_sample = True
probe_with_touch_mode = True
pin_up_touch_mode_reports_triggered = False
x_offset = -44.
y_offset = -10.0
z_offset = 2.04
speed = 10
lift_speed = 20
samples = 2
sample_retract_dist = 5
samples_tolerance_retries = 3
[safe_z_home]
home_xy_position = 165, 165
speed = 50
z_hop = 10
z_hop_speed = 5
[bed_screws]
screw1 = 5,5
screw2 = 165,5
screw3 = 325,5
screw4 = 5,325
screw5 = 165,325
screw6 = 325,325
[screws_tilt_adjust]
screw1 = 60, 30
screw1_name = front left screw
screw2 = 203, 30
screw2_name = front middle screw
screw3 = 335, 30
screw3_name = front right screw
screw4 = 60, 315
screw4_name = rear left screw
screw5 = 203, 315
screw5_name = rear middle screw
screw6 = 335, 315
screw6_name = rear right screw
horizontal_move_z = 20.
speed = 150.
screw_thread = CW-M3
[board_pins]
aliases =
EXP1_1=PB5, EXP1_3=PA9, EXP1_5=PA10, EXP1_7=PB8, EXP1_9=,
EXP1_2=PA15, EXP1_4=, EXP1_6=PB9, EXP1_8=PB15, EXP1_10=<5V>
Loaded MCU ‘mcu’ 105 commands (v0.11.0-110-gaca0c71a / gcc: (15:7-2018-q2-6) 7.3.1 20180622 (release) [ARM/embedded-7-branch revision 261907] binutils: (2.31.1-11+rpi1+11) 2.31.1)
MCU ‘mcu’ config: BUS_PINS_i2c1=PB6,PB7 BUS_PINS_i2c2=PB10,PB11 BUS_PINS_i2c1a=PB8,PB9 BUS_PINS_spi3=PB4,PB5,PB3 INITIAL_PINS=!PA14 STEPPER_BOTH_EDGE=1 ADC_MAX=4095 PWM_MAX=255 CLOCK_FREQ=72000000 BUS_PINS_spi1=PA6,PA7,PA5 RESERVE_PINS_USB=PA11,PA12 MCU=stm32f103xe STATS_SUMSQ_BASE=256 BUS_PINS_spi1a=PB4,PB5,PB3 BUS_PINS_spi2=PB14,PB15,PB13
Configured MCU ‘mcu’ (1024 moves)
Args: [‘/home/pi/klipper/klippy/klippy.py’, ‘/home/pi/klipper_config/printer.cfg’, ‘-l’, ‘/home/pi/klipper_logs/klippy.log’, ‘-a’, ‘/tmp/klippy_uds’]
Git version: ‘v0.11.0-121-ga5fb2076’
CPU: 4 core ARMv7 Processor rev 4 (v7l)
Python: ‘2.7.16 (default, Oct 10 2019, 22:02:15) \n[GCC 8.3.0]’
webhooks client 1966805520: {‘program’: ‘Moonraker’, ‘version’: ‘v0.8.0-18-gfd5ea0c’}
# This file contains common pin mappings for the BIGTREETECH SKR mini
# E3 v2.0. To use this config, the firmware should be compiled for the
# STM32F103 with a "28KiB bootloader" and USB communication. Also,
# select "Enable extra low-level configuration options" and configure
# "GPIO pins to set at micro-controller startup" to "!PA14".
# The "make flash" command does not work on the SKR mini E3. Instead,
# after running "make", copy the generated "out/klipper.bin" file to a
# file named "firmware.bin" on an SD card and then restart the SKR
# mini E3 with that SD card.
# See docs/Config_Reference.md for a description of parameters.
[include mainsail.cfg]
[virtual_sdcard]
path: /home/pi/printer_data/gcodes
[printer]
kinematics: corexy
max_velocity: 300
max_accel: 3000
max_z_velocity: 25
max_z_accel: 30
[pause_resume]
[display_status]
[pause_resume]
recover_velocity: 50.0
[mcu]
serial: /dev/serial/by-id/usb-Klipper_stm32f103xe_33FFD8055641343421832043-if00
[stepper_x]
step_pin: PB13
dir_pin: !PB12
enable_pin: !PB14
microsteps: 16
rotation_distance: 40
endstop_pin: ^PC0
position_endstop: 0
position_max: 320
homing_speed: 50
homing_retract_dist: 10
second_homing_speed: 10.0
[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: 300
homing_retract_dist: 10
homing_speed: 50
second_homing_speed: 10
[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
#position_endstop: 0.0
endstop_pin: probe:z_virtual_endstop
position_max: 400
#postion_min: -5
[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: !PD2
microsteps: 16
rotation_distance: 33.520
nozzle_diameter: 0.400
filament_diameter: 1.750
heater_pin: PC8
sensor_type: ATC Semitec 104GT-2
sensor_pin: PA0
control: pid
pid_Kp: 21.527
pid_Ki: 1.063
pid_Kd: 108.982
min_temp: 0
max_temp: 250
max_extrude_only_distance: 300
[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: EPCOS 100K B57560G104F
sensor_pin: PC3
control: pid
pid_Kp: 54.027
pid_Ki: 0.770
pid_Kd: 948.182
min_temp: 0
max_temp: 130
[heater_fan heatbreak_cooling_fan]
pin: PC7
[bed_mesh]
speed: 170
horizontal_move_z: 5
mesh_min: 60, 60
mesh_max: 300, 300
probe_count: 5, 5
algorithm: bicubic
fade_start: 1
fade_end: 10
fade_target: 0
[fan]
pin: PC6
[bltouch]
sensor_pin: ^PC14
control_pin: PA1
pin_move_time: 0.675
stow_on_each_sample: True
probe_with_touch_mode: True
pin_up_touch_mode_reports_triggered: False
x_offset: -44.
y_offset: -10.0
z_offset: 2.04
speed: 10
lift_speed: 20
samples: 2
sample_retract_dist:5
samples_tolerance_retries: 3
[safe_z_home]
home_xy_position: 165, 165
speed: 50
z_hop: 10
z_hop_speed: 5
[bed_screws]
screw1: 5,5
screw2: 165,5
screw3: 325,5
screw4: 5,325
screw5: 165,315
screw6: 325,315
[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=PB15, EXP1_10=<5V>