- 树莓派3B作为主控
- BIGTREETECHSKRV1.3主板
- bltouch自动调平
- 断料检测
- 倾斜校正
- 多Z轴高度校准
- 热床mesh校准
- 延迟摄影(本文未添加)
#ThisfilecontainscommonpinmappingsfortheBIGTREETECHSKRV1.3 #board.Tousethisconfig,thefirmwareshouldbecompiledforthe #LPC1768. #bltouch配置 [bltouch] sensor_pin:^P1.25#信号接口#^P1.25forZ-min control_pin:P2.0 x_offset:28.5#X传感器相对于喷嘴的偏移 y_offset:5.0#Y传感器相对于喷嘴的偏移 z_offset:1.35#Z传感器相对于喷嘴的偏移值越大,喷嘴离平台越近 speed:10.0#调平速度 samples:1#采样次数 samples_result:median#值法(默认)median-中位数) sample_retract_dist:3.0#调整回缩距离 samples_tolerance:0.5#采样公差(注意采样次数增加可能是因为值太小) samples_tolerance_retries:3#超公差重试次数 #断料检测,检测到断料直接暂停 [gcode_buttonBroken_Material] pin:!P1.28#限位开关接口P1.28forX-max press_gcode: release_gcode: PAUSE [gcode_macroPRINT_START]#将PRINT_START设置为开始打印时的宏,定制打印前的动作 gcode: SET_SKEWCLEAR=1 SET_SKEWXY=140.6,141.2,99.6#XY倾斜校正 SET_HEATER_TEMPERATUREHEATER=extruderTARGET=210 SET_HEATER_TEMPERATUREHEATER=heater_bedTARGET=60 G28#归位所有轴 G92E0#将挤出机归零 BED_MESH_CLEAR#卸载网床 #G1X10F4000#X回零点 G1E10F1000#吐出10mm丝 ;G1Y10.0F5000;introline ;G92E0;zerotheextrudedlengthagain BED_MESH_PROFILELOAD=default#加载网床 hyperlapseCYCLE=30ACTION=START#启动延时拍照,间隔30s [gcode_macroPRINT_END]#将PRINT_END设置为打印结束时的宏,自定义打印完成后的动作 gcode: M400#等待缓冲区清除 G1E-10F2000#回抽10mm G92E0#将挤出机归零 M104S0#turnofftemperature M140S0#turnoffbed G28X0&bsp; #home X axis
#M84 #disable motors
BED_MESH_CLEAR
SET_SKEW CLEAR=1 #卸载倾斜校正
hyperlapse CYCLE=30 ACTION=STOP #停止延时拍照,间隔30s
TIMELAPSE_RENDER #合成视频
CANCEL_PRINT_BASE
# SDCARD_RESET_FILE
#####################################################################
# 打印机配置corexy
#####################################################################
[printer]
kinematics: corexy # 打印机类型:corexy
max_velocity: 200 # 最大速度(最大 300)
max_accel: 2000 # 最大加速度(最大 4000)
max_accel_to_decel: 2000 # 最大加速至减速(最大 4000)
max_z_velocity: 6 # Z轴最大速度
max_z_accel: 60 # Z轴最大加速度
square_corner_velocity: 5.0 # 方形拐角速度
########################################
# SKR V1.3主板
########################################
[mcu]
serial: /dev/serial/by-id/usb-Klipper_lpc1768_13A00004619C2DAE14A51953871E00F5-if00
#辅助mcu 树莓派自己
[mcu auxboard]
serial: /tmp/klipper_host_mcu
#####################################################################
# X轴步进电机
#####################################################################
[stepper_x]
step_pin: P2.2 # X轴电机脉冲引脚
dir_pin: P2.6 # 方向设置
enable_pin: !P2.1 # 使能引脚
microsteps: 32 # 细分
rotation_distance: 32 # 主动轮周长mm (2GT-20T为 40mm 16T为 32mm)
full_steps_per_rotation: 200 # 单圈脉冲数-对于0.9度步进设置为400
endstop_pin: ^!P1.29 # 限位开关接口 P1.28 for X-max
position_endstop: -22 # 机械限位最大行程
position_max: 320 # 软限位最大行程
position_min: -22 # 软限位最小行程
homing_speed: 100 # 复位速度-最大 100
#--------------------------------------------------------------------
[tmc2208 stepper_x]
uart_pin: P1.17 # 驱动通信端口
interpolate: True # 微步插值256
run_current: 1.200 # 运行电流A
hold_current: 0.800 # 保持电流A
#stealthchop_threshold: 999999 # 静音阀值
#####################################################################
# Y 轴步进电机
#####################################################################
[stepper_y]
step_pin: P0.19 # Y轴电机脉冲引脚
dir_pin: P0.20 # 方向设置
enable_pin: !P2.8 # 使能引脚
microsteps: 32 # 细分
rotation_distance: 32 # 主动轮周长mm (2GT-20T为 40mm 16T为 32mm)
full_steps_per_rotation: 200 # 单圈脉冲数-对于0.9度步进设置为400
endstop_pin: ^!P1.27 # 限位开关接口 P1.26 for Y-max
position_endstop: -3 # 械限位最大行程 改为右前方限位 -5
position_max: 320 # 软限位最大行程
position_min: -20 # 软限位最小行程
homing_speed: 100 # 复位速度-最大 100
#--------------------------------------------------------------------
[tmc2208 stepper_y]
uart_pin: P1.15 # 驱动通信端口
interpolate: True # 微步插值256
run_current: 1.200 # 运行电流A
hold_current: 0.800 # 保持电流A
#stealthchop_threshold: 999999 # 静音阀值
#####################################################################
# Z轴步进电机
#####################################################################
[stepper_z]
step_pin: P0.1 # Z轴电机脉冲引脚
dir_pin: !P0.0 # 方向设置
enable_pin: !P0.10 # 使能引脚
microsteps: 32 # 细分
rotation_distance: 2 # 导程mm
endstop_pin:probe:z_virtual_endstop # 限位开关接口
#endstop_pin: P1.25 # P1.25 for Z-min
#position_endstop: 0 #自动调平需要注释掉
position_min: -5 # 软限位最小行程
position_max: 400 # 软限位最大行程
homing_speed: 5.0 # 复位速度-最大 20
second_homing_speed: 2.0 # 二次复位速度-最大 10
homing_retract_dist: 3.0 # 后撤距离
#--------------------------------------------------------------------
[tmc2208 stepper_z]
uart_pin: P1.1 # 驱动通信端口
interpolate: True # 微步插值256
run_current: 0.70 # 运行电流A
hold_current: 0.450 # 保持电流A
stealthchop_threshold: 999999 # 静音阀值
[stepper_z1]
step_pin: P0.22 # Z1轴电机脉冲引脚
dir_pin: !P2.11 # 方向设置
enable_pin: !P0.21 # 使能引脚
microsteps: 32 # 细分
rotation_distance: 2 # 导程mm
#--------------------------------------------------------------------
[tmc2208 stepper_z1]
uart_pin: P1.10 # 驱动通信端口
interpolate: True # 微步插值256
run_current: 0.70 # 运行电流A
hold_current: 0.450 # 保持电流A
stealthchop_threshold: 999999 # 静音阀值
#####################################################################
# 挤出机配置
#####################################################################
[extruder]
step_pin: P2.13 # E0电机脉冲引脚
dir_pin: !P0.11 # 方向设置
enable_pin: !P2.12 # 使能引脚
microsteps: 16 # 细分
rotation_distance: 23.15 # 步进值 Bondtech 5mm Drive Gears
gear_ratio: 50:17 # 传动比 (M4 为 80:20 , BMG 为 50:17)
full_steps_per_rotation: 200 # 单圈脉冲数 (200 为 1.8 度, 400 为 0.9 度)
nozzle_diameter: 0.400 #喷嘴直径
filament_diameter: 1.75 #耗材直径
heater_pin: P2.7 # 加热棒引脚
sensor_type: EPCOS 100K B57560G104F #传感器型号 (NTC 100K beta 3950,ATC Semitec 104GT-2)
sensor_pin: P0.24 # 传感器接口
control: pid
pid_kp = 11.700
pid_ki = 0.600
pid_kd = 57.036
min_temp: 0 # 最小温度
max_temp: 260 # 最大温度
pressure_advance:0.058 # 压力推进补偿pressure advance=0+11.6*0.005
#--------------------------------------------------------------------
[tmc2208 extruder]
uart_pin: P1.8 # 驱动通信端口
interpolate: True # 微步插值256
run_current: 0.800 # 运行电流A
hold_current: 0.500 # 保持电流A
stealthchop_threshold: 999999 # 静音阀值
[verify_heater extruder]
max_error: 120
# The maximum "cumulative temperature error" before raising an
# error. Smaller values result in stricter checking and larger
# values allow for more time before an error is reported.
# Specifically, the temperature is inspected once a second and if it
# is close to the target temperature then an internal "error
# counter" is reset; otherwise, if the temperature is below the
# target range then the counter is increased by the amount the
# reported temperature differs from that range. Should the counter
# exceed this "max_error" then an error is raised. The default is
# 120.
check_gain_time:20
# This controls heater verification during initial heating. Smaller
# values result in stricter checking and larger values allow for
# more time before an error is reported. Specifically, during
# initial heating, as long as the heater increases in temperature
# within this time frame (specified in seconds) then the internal
# "error counter" is reset. The default is 20 seconds for extruders
# and 60 seconds for heater_bed.
hysteresis: 50
# The maximum temperature difference (in Celsius) to a target
# temperature that is considered in range of the target. This
# controls the max_error range check. It is rare to customize this
# value. The default is 5.
heating_gain: 2
# The minimum temperature (in Celsius) that the heater must increase
# by during the check_gain_time check. It is rare to customize this
# value. The default is 2.
#####################################################################
# 热床配置
#####################################################################
[heater_bed]
heater_pin: P2.5 # 热床接口
sensor_type: ATC Semitec 104GT-2 # 热床传感器类型
sensor_pin: P0.23 # 热床传感器接口
min_temp: 0 # 最小温度(注意:测量温度超过设定值会触发紧急停止)
max_temp: 110 # 最大温度(注意:测量温度超过设定值会触发紧急停止)
# 热床温度PID校准命令: "PID_CALIBRATE HEATER=heater_bed TARGET=60"
#####################################################################
# 热床网格校准
#####################################################################
[bed_mesh]
speed:100 # 校准速度
horizontal_move_z:5 # Z轴运动速度
mesh_min:10,10 # 最小校准点坐标x,y
mesh_max:300,300 # 最大校准点坐标x,y
probe_count: 5,5 # 采样点数(5X5为25点)
mesh_pps:2,2 # 补充采样点数
algorithm: bicubic # 算法模型
bicubic_tension: 0.2 # 算法插值不要动
relative_reference_index: 13 # 第多少个点作为±0.00 (最好将点位设置在热床中间或者较平处)(解决热床校准之后在空中的问题)
#####################################################################
# Z轴归位坐标
#####################################################################
[safe_z_home]
home_xy_position: 150,150 # Z轴归位位置定义(重要!!!自行进行调整)
speed: 100 # 归位速度
z_hop: 10 # 归位之后抬升高度
z_hop_speed: 5 # 抬升速度
#####################################################################
# 多轴Z高度校准
#####################################################################
[z_tilt]
z_positions:
-63,160
356,160
points:
260,160
-20,160
speed: 150
horizontal_move_z:10
#####################################################################
# 风扇配置
#####################################################################
[fan]
pin: P2.3 # 信号接口
[temperature_sensor raspberry_pi]
sensor_type: temperature_host
min_temp: 10
max_temp: 100
#[temperature_sensor mcu_temp]
#sensor_type: temperature_mcu
#min_temp: 10
#max_temp: 100
#####################################################################
# 倾斜校正
#####################################################################
[skew_correction] #校正框架组装的倾斜
#Length AC = 140.6 #测试件 AC对焦长度mm
#Length BD = 141.2 #测试件 BD对焦长度mm
#Length AD = 99.5 #测试件 AD边长度mm
[virtual_sdcard]
path: ~/gcode_files
[display_status]
[pause_resume]
#[mcu rpi]
#serial: /tmp/klipper_host_mcu
#[adxl345]
#cs_pin: rpi:None
#[resonance_tester]
#accel_chip: adxl345
#probe_points:
# 150,150,20 # 这个地方建议配置成热床的中间
#####################################################################
# 自定义gcode宏
#####################################################################
[gcode_arcs]#允许圆弧插补
resolution: 1.0 #启用圆弧插补G2,G3
[gcode_macro Z_TILT]
gcode:
BED_MESH_CLEAR
G28
SET_HEATER_TEMPERATURE HEATER=heater_bed TARGET=60
SET_HEATER_TEMPERATURE HEATER=extruder TARGET=200
Z_TILT_ADJUST
G28
BED_MESH_CALIBRATE
SAVE_CONFIG
[gcode_macro BLTOUCH_RESET]
gcode:
BLTOUCH_DEBUG COMMAND=reset
# [gcode_macro clean_nozzle]
# gcode:
# {% set wipe_count = 8 %}
# SAVE_GCODE_STATE NAME=clean_nozzle_state
# G90
# G0 Z15 F300
# {% for wipe in range(wipe_count) %}
# {% for coordinate in [(275,4),(235,4)] %}
# G0 X{coordinate[0]} Y{coordinate[1] + 0.25 * wipe} Z9.7 F12000
# {% endfor %}
# {% endfor %}
# RESTORE_GCODE_STATE NAME=clean_nozzle_state
[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:
G92 E0 # 将挤出机归零
G1 E-10 F2000 # 回抽10mm
#TURN_OFF_HEATERS
CANCEL_PRINT_BASE
M84
hyperlapse CYCLE=30 ACTION=stop
SDCARD_RESET_FILE
[include timelapse.cfg]