BLV 3D打印机Klipper配置参考

记录一下我的BLV mgn Cube 3D打印机升级Klipper的配置,功能包括:

  1. 树莓派3B作为主控
  2. BIGTREETECH SKR V1.3主板
  3. bltouch自动调平
  4. 断料检测
  5. 倾斜校正 
  6. 多Z轴高度校准
  7. 热床mesh校准
  8. 延时摄影(此文未添加)
# This file contains common pin mappings for the BIGTREETECH SKR V1.3

# board. To use this config, the firmware should be compiled for the

# LPC1768.



#bltouch配置

[bltouch]

sensor_pin:^P1.25              # 信号接口  #^P1.25 for Z-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_button Broken_Material]

pin:!P1.28                      # 限位开关接口  P1.28 for X-max

press_gcode:

release_gcode:

    PAUSE



    




[gcode_macro PRINT_START]# 将 PRINT_START 设置为开始打印时的宏,自定义打印前的动作

gcode:

  

  SET_SKEW CLEAR=1

  SET_SKEW XY=140.6,141.2,99.6  #XY倾斜校正

  SET_HEATER_TEMPERATURE HEATER=extruder TARGET=210

  SET_HEATER_TEMPERATURE HEATER=heater_bed TARGET=60

  G28                       # 归位所有轴

  G92 E0                    # 将挤出机归零

  BED_MESH_CLEAR            # 卸载网床

#  G1 X10 F4000              # X回零点

  G1 E10 F1000              # 吐出10mm丝

  ;G1 Y10.0 F5000 ;intro line

  ;G92 E0 ;zero the extruded length again

  BED_MESH_PROFILE LOAD=default    # 加载网床

  hyperlapse CYCLE=30 ACTION=START #启动延时拍照,间隔30s




[gcode_macro PRINT_END]# 将 PRINT_END 设置为打印结束时的宏,自定义打印完成之后动作

gcode:

  M400                      # 等待缓冲区清除

  G1  E-10 F2000            # 回抽10mm

  G92 E0                    # 将挤出机归零

  M104 S0                   #turn off temperature

  M140 S0                   #turn off bed

  G28 X0                    #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]



  • 1
    点赞
  • 30
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值