小黑屋|Klipper玩客 ( 桂ICP备13004039号-7 )

GMT+8, 2024-11-22 03:00

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

klipper M600 换料优化

280
0
0
0
铜牌杰瑞 LV8
正文
发布时间:2024-06-27
原生换料有两个缺陷,一个是没法擦料,一个是超时时间过短。


大家可以试试这个,新建一个xxx.cfg引入或者直接插入macros.cfg都可以。

  1. [idle_timeout]
  2. timeout: 3600
  3. gcode:
  4.   {% if printer.pause_resume.is_paused %}
  5.   set_heater_temperature heater=extruder target=0
  6.   {% else %}  
  7.     TURN_OFF_HEATERS
  8.     set_stepper_enable stepper=stepper_y enable=0
  9.     set_stepper_enable stepper=stepper_x enable=0
  10.     set_stepper_enable stepper=stepper_z enable=0
  11.   {% endif %}
复制代码


  1. [respond]

  2. [gcode_macro PURGE_XY]

  3. gcode:
  4.     #take parameters change defaults to home somewhere else
  5.     {% set PURGE_XY_XPOS = params.PURGE_XY_XPOS|default(-5)|float %}
  6.     {% set PURGE_XY_YPOS = params.PURGE_XY_YPOS|default(-5)|float %}

  7.     #save Gcode settings
  8.     SAVE_GCODE_STATE NAME=PURGE_XY_state
  9.    
  10.     #move to purge position
  11.     G90
  12.     G1 X {PURGE_XY_XPOS} Y {PURGE_XY_YPOS}

  13.     #restore Gcode settings
  14.     RESTORE_GCODE_STATE NAME=PURGE_XY_state



  15. [gcode_macro PURGE_POS]
  16. gcode:
  17.     #take parameters change defaults to home somewhere else and change z raise distance
  18.     {% set PURGE_POS_XPOS = params.PURGE_POS_XPOS|default(-5)|float %}
  19.     {% set PURGE_POS_YPOS = params.PURGE_POS_YPOS|default(-5)|float %}
  20.     {% set PURGE_POS_ZOFFSET = params.PURGE_POS_ZOFFSET|default(10)|float %}

  21.     #save Gcode settings
  22.     SAVE_GCODE_STATE NAME=PURGE_POS_SAVE

  23.     #raise Z axis
  24.     g91
  25.     G1 Z {PURGE_POS_ZOFFSET}

  26.     #move to purge position
  27.     PURGE_XY PURGE_XY_XPOS=PURGE_POS_XPOS PURGE_XY_YPOS=PURGE_POS_YPOS
  28.     G1 X{PURGE_POS_XPOS} Y{PURGE_POS_YPOS}
  29.     #restore Gcode Settings
  30.     RESTORE_GCODE_STATE NAME=PURGE_POS_SAVE



  31. [gcode_macro M600]
  32. gcode:
  33.     #take parameters change defaults to home somewhere else, change z raise distance, and purge amount
  34.    
  35.     {% set Color_XPOS = params.Color_XPOS|default(-5)|float %}
  36.     {% set Color_YPOS = params.Color_YPOS|default(-5)|float %}
  37.     {% set Color_ZOFFSET = params.Color_ZOFFSET|default(10)|float %}
  38.     {% set Color_Purge_Amount = params.Color_Purge_Amount|default(50)|float %}
  39.     {% set Color_Retract_Amount = params.Color_Retract_Amount|default(50)|float %}
  40.    
  41.     #save Gcode Settings
  42.     SAVE_GCODE_STATE NAME=Coloring_state
  43.    
  44.     #disable filament sensors, if you have them uncomment these 2 lines
  45.     SET_FILAMENT_SENSOR SENSOR=encoder_sensor ENABLE=0
  46.     SET_FILAMENT_SENSOR SENSOR=switch_sensor ENABLE=0
  47.    
  48.     {% set Z = 10 %}
  49.     PAUSE
  50.    
  51.     #retract a bit, and raise nozzle
  52.     G91
  53.     G1 E-.8 F2700
  54.     G1 Z{Z}
  55.    
  56.     #go to purge position
  57.     G90
  58.     PURGE_POS
  59.    
  60.     #retract 50mm, to help in color change
  61.     G91
  62.     G1 E -{Color_Retract_Amount} F1000
  63.    
  64.     #start purge prompt
  65.     Purge_buttons
  66.    
  67.    
  68. [gcode_macro Purge_Filament]
  69. gcode:
  70.     {% set Purge_Amount = params.Purge_Amount|default(50)|float %}
  71.     #save Gcode settings
  72.     SAVE_GCODE_STATE NAME=PURGE_STATE
  73.    
  74.     #purge 50mm
  75.     G91
  76.     G1 E50 F300
  77.    
  78.     #restore Gcode settings
  79.     RESTORE_GCODE_STATE NAME=PURGE_STATE
  80.    
  81.     #bring back purge buttons
  82.     Purge_buttons


  83. [gcode_macro Purge_Buttons]
  84. gcode:
  85.     {% set Button_Purge_Amount = params.Button_Purge_Amount|default(50)|float %}
  86.     #save Gcode Settings
  87.     SAVE_GCODE_STATE NAME=PURGE_BUTTONS_STATE
  88.    
  89.     #Prompt for "purge more", "continue", and "heat nozzle"   
  90.     RESPOND TYPE=command MSG="action:prompt_begin PURGE MORE?"
  91.     RESPOND TYPE=command MSG="action:prompt_text would you like to purge more?"
  92.     RESPOND TYPE=command MSG="action:prompt_button_group_start"
  93.     RESPOND TYPE=command MSG="action:prompt_button purge|Purge_filament Purge_Amount=Button_Purge_Amount|warning"
  94.     RESPOND TYPE=command MSG="action:prompt_button resume|end_color_change|info"
  95.     RESPOND TYPE=command MSG="action:prompt_button reheat Nozzle|m104 S220|error"
  96.     RESPOND TYPE=command MSG="action:prompt_button_group_end"
  97.     RESPOND TYPE=command MSG="action:prompt_show"

  98.     #restore Gcode Settings
  99.     RESTORE_GCODE_STATE NAME=PURGE_BUTTONS_STATE
  100.    
  101. [gcode_macro end_color_change]
  102. gcode:
  103.     #end prompt
  104.     RESPOND type="command" msg="action:prompt_end"

  105.     #enable filament sensors, if you have them uncomment these 2 lines
  106.     SET_FILAMENT_SENSOR SENSOR=encoder_sensor ENABLE=1
  107.     SET_FILAMENT_SENSOR SENSOR=switch_sensor ENABLE=1

  108.     #restore Gcode Settings
  109.     RESTORE_GCODE_STATE NAME=Coloring_state

  110.     #resume print
  111.     RESUME
  112.    

  113.    
  114. #[gcode_macro M600]
  115. #gcode:
  116.    # {% set X = params.X|default(-5)|float %}
  117.    # {% set Y = params.Y|default(-5)|float %}
  118.   #  {% set Z = params.Z|default(10)|float %}
  119.   #  SAVE_GCODE_STATE NAME=M600_state
  120. #   PAUSE
  121.     #G91
  122.   #  G1 E-.8 F2700
  123.   #  G1 Z{Z}
  124.   #  G90
  125. #   G1 X{X} Y{Y} F3000
  126. #   G91
  127. #    G1 E-50 F1000
  128.    # RESTORE_GCODE_STATE NAME=M600_state
复制代码




回复

 
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

快速回复 返回顶部 返回列表