Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [INFO] 2024-10-12 04:17:46,365 [root] [statistics:generate_stats:68] Stats 48750.5: gcodein=0 mcu: mcu_awake=0.001 mcu_task_avg=0.000005 mcu_task_stddev=0.000004 bytes_write=20600005 bytes_read=6739119 bytes_retransmit=129 bytes_invalid=8 send_seq=405045 receive_seq=405045 retransmit_seq=352811 srtt=0.001 rttvar=0.000 rto=0.025 ready_bytes=11 stalled_bytes=0 freq=119996793 nozzle_mcu: mcu_awake=0.000 mcu_task_avg=0.000004 mcu_task_stddev=0.000003 bytes_write=3518325 bytes_read=2795807 bytes_retransmit=35622 bytes_invalid=0 send_seq=96321 receive_seq=96321 retransmit_seq=58974 srtt=0.001 rttvar=0.000 rto=0.025 ready_bytes=0 stalled_bytes=0 freq=119999390 adj=120002583 leveling_mcu: mcu_awake=0.000 mcu_task_avg=0.000003 mcu_task_stddev=0.000002 bytes_write=214319 bytes_read=741845 bytes_retransmit=105 bytes_invalid=0 send_seq=35056 receive_seq=35056 retransmit_seq=1437 srtt=0.001 rttvar=0.000 rto=0.025 ready_bytes=0 stalled_bytes=0 freq=119999696 adj=120002893 rpi: mcu_awake=0.000 mcu_task_avg=0.000008 mcu_task_stddev=0.000008 bytes_write=221204 bytes_read=650829 bytes_retransmit=27 bytes_invalid=0 send_seq=35690 receive_seq=35690 retransmit_seq=2567 srtt=0.000 rttvar=0.000 rto=0.025 ready_bytes=0 stalled_bytes=0 freq=49999049 adj=50000364 heater_bed: target=55 temp=23.0 pwm=1.000 sysload=0.34 cputime=2369.552 memavail=125572 print_time=3993.901 buffer_time=0.000 print_stall=0 extruder: target=220 temp=24.6 pwm=1.000
- [INFO] 2024-10-12 04:17:47,089 [root] [mcu:_restart_via_command:940] Attempting MCU 'mcu' reset command
- [INFO] 2024-10-12 04:17:47,112 [root] [mcu:_restart_via_command:940] Attempting MCU 'nozzle_mcu' reset command
- [INFO] 2024-10-12 04:17:47,129 [root] [mcu:_restart_via_command:940] Attempting MCU 'leveling_mcu' reset command
- [INFO] 2024-10-12 04:17:47,150 [root] [mcu:_restart_via_command:933] Attempting MCU 'rpi' config_reset command
- [INFO] 2024-10-12 04:17:47,153 [root] [serialhdl:handle_output:308] mcu 'rpi': #output: allocMax=4096 usedMax=0
- [ERROR] 2024-10-12 04:17:47,188 [root] [__init__:logging_callback:259] b'Got EOF when reading from device'
- [INFO] 2024-10-12 04:17:47,199 [root] [webhooks:set_client_info:202] webhooks client 1976471312: Disconnected
- [INFO] 2024-10-12 04:17:47,200 [root] [webhooks:set_client_info:202] webhooks client 1965832944: Disconnected
- [INFO] 2024-10-12 04:18:00,237 [root] [klippy:main:414] Starting Klippy...
- [INFO] 2024-10-12 04:18:00,239 [root] [klippy:main:423] Args: ['/usr/share/klipper/klippy/klippy.py', '/usr/data/printer_data/config/printer.cfg', '-l', '/usr/data/printer_data/logs/klippy.log', '-a', '/tmp/klippy_uds']
- Git version: '09faed31-dirty'
- CPU: 2 core ?
- Python: '3.8.2 (default, May 15 2024, 15:39:50) \n[GCC 7.2.0]'
- [INFO] 2024-10-12 04:18:01,441 [root] [klippy:run:265] Start printer at Sat Oct 12 04:18:01 2024 (1728724681.4 48765.6)
- [INFO] 2024-10-12 04:18:01,443 [root] [reactor:_dispatch_loop:340] _dispatch_loop current nice = 0
- [INFO] 2024-10-12 04:18:01,444 [root] [reactor:_dispatch_loop:342] _dispatch_loop new nice = -10
- [INFO] 2024-10-12 04:18:02,102 [root] [klippy:set_rollover_info:293] ===== Config file =====
- [virtual_pins]
- [force_move]
- enable_force_move = true
- [gcode_macro xyz_ready]
- variable_x_ready = 0
- variable_y_ready = 0
- variable_z_ready = 0
- variable_xy_moved = 0
- variable_z_moved = 0
- variable_safe_z = 3
- gcode =
- [gcode_macro _IF_HOME_Z]
- gcode =
- {% if printer['gcode_macro xyz_ready'].z_ready|int == 1 %}
- {% if printer.toolhead.position.z|int < 5 %}
- {% set z_park = 5.0 - printer.toolhead.position.z|int %}
- G91
- G1 z{z_park} F600
- G90
- {% endif %}
- {% else %}
- {% if printer['gcode_macro xyz_ready'].z_moved|int == 0 %}
- {% if printer.print_stats.power_loss == 1 %}
- {% else %}
- {% endif %}
- SET_GCODE_VARIABLE MACRO=xyz_ready VARIABLE=z_moved VALUE=1
- {% endif %}
- {% endif %}
- [gcode_macro _IF_MOVE_XY]
- gcode =
- _IF_HOME_Z
- {% if printer['gcode_macro xyz_ready'].xy_moved|int == 0 %}
- SET_GCODE_VARIABLE MACRO=xyz_ready VARIABLE=xy_moved VALUE=1
- {% endif %}
- [gcode_macro _HOME_X]
- gcode =
- _IF_MOVE_XY
- {% if printer['gcode_macro xyz_ready'].x_ready|int == 1 %}
- {% if (printer.toolhead.position.x)|int < 10 %}
- G91
- G1 x10 F3600
- G90
- G4 P2000
- {% endif %}
- {% endif %}
- G28 X
- G91
- G1 x10 F3600
- M400
- G90
- G4 P500
- SET_GCODE_VARIABLE MACRO=xyz_ready VARIABLE=x_ready VALUE=1
- [gcode_macro _HOME_Y]
- gcode =
- {% if printer['gcode_macro xyz_ready'].y_ready|int == 1 %}
- {% if (printer.toolhead.position.y)|int < 10 %}
- G91
- G1 y10 F3600
- G90
- G4 P2000
- {% endif %}
- {% endif %}
- SOFTY_G28
- SET_GCODE_VARIABLE MACRO=xyz_ready VARIABLE=y_ready VALUE=1
- [gcode_macro _HOME_Z]
- gcode =
- {% if printer['gcode_macro xyz_ready'].y_ready|int == 1 %}
- {% if printer['gcode_macro xyz_ready'].x_ready|int == 1 %}
- _IF_HOME_Z
- {% endif %}
- {% endif %}
- {% set POSITION_X = printer.configfile.settings['stepper_x'].position_max/2 %}
- {% set POSITION_Y = printer.configfile.settings['stepper_y'].position_max/2 %}
- G91
- {% set x_park = POSITION_X - printer.toolhead.position.x|int %}
- {% set y_park = POSITION_Y - printer.toolhead.position.y|int %}
- {action_respond_info("x_park = %s \n" % (x_park))}
- {action_respond_info("y_park = %s \n" % (y_park))}
- G1 x{x_park} y{y_park} F3600
- G90
- M400
- G28 Z
- SET_GCODE_VARIABLE MACRO=xyz_ready VARIABLE=z_ready VALUE=1
- [homing_override]
- axes = xyz
- gcode =
- M220 S100
- SET_VELOCITY_LIMIT ACCEL=5000 ACCEL_TO_DECEL=2500
- BED_MESH_CLEAR
- {% set x_axes = printer.toolhead.homed_axes %}
- {% if x_axes is defined and x_axes[0] is defined %}
- {action_respond_info(
- "x_axes: %s \n"
- % (x_axes))}
- {% else %}
- SET_GCODE_VARIABLE MACRO=xyz_ready VARIABLE=x_ready VALUE=0
- SET_GCODE_VARIABLE MACRO=xyz_ready VARIABLE=y_ready VALUE=0
- SET_GCODE_VARIABLE MACRO=xyz_ready VARIABLE=z_ready VALUE=0
- SET_GCODE_VARIABLE MACRO=xyz_ready VARIABLE=xy_moved VALUE=0
- SET_GCODE_VARIABLE MACRO=xyz_ready VARIABLE=z_moved VALUE=0
- {action_respond_info(
- "x_axes is NULL\n")}
- {% endif %}
- {% if x_axes is defined and x_axes[0] is defined and x_axes[1] is defined %}
- {action_respond_info("x_axes: %s \n"% (x_axes))}
- {% set position_y = printer.toolhead.position.y|int %}
- {% set max_y_position = printer["gcode_macro PRINTER_PARAM"].max_y_position|int %}
- {% if position_y >= max_y_position %}
- G91
- G0 Y-10 F3600
- G90
- {% endif %}
- {% endif %}
- {% set home_all = 'X' not in params and 'Y' not in params %}
- {% if 'Z' in params and 'X' not in params and 'Y' not in params %}
- {% if x_axes[0] is defined and x_axes[1] is defined %}
- {% set home_all = 0 %}
- {% endif %}
- {% endif %}
- {% if home_all or 'X' in params %}
- {% if printer.print_stats.power_loss == 0 %}
- SET_KINEMATIC_POSITION
- G91
- G1 X3 F1200
- M400
- G90
- {% endif %}
- STEPPER_Z_SENEORLESS
- M400
- _HOME_X
- {% if printer.print_stats.power_loss == 0 %}
- SET_KINEMATIC_POSITION
- {% set retract_z = printer.configfile.settings['prtouch_v2'].retract_z_dist %}
- {% set retract_speed = printer.configfile.settings['prtouch_v2'].retract_z_speed %}
- G91
- G1 Z-{retract_z} F{retract_speed}
- M400
- G90
- G4 P500
- {% endif %}
- {% endif %}
- {% if home_all or 'Y' in params %}
- {% if printer.print_stats.power_loss == 1 %}
- SOFT_CHECK_ERROR FLAG=1
- {% endif %}
- _HOME_Y
- SOFT_CHECK_ERROR FLAG=0
- {% endif %}
- {% if home_all or 'Z' in params %}
- _HOME_Z
- BED_MESH_PROFILE LOAD="default"
- {% endif %}
- G4 P500
- [gcode_macro PRINTER_PARAM]
- variable_z_safe_pause = 0.0
- variable_z_safe_g28 = 3.0
- variable_max_x_position = 300.0
- variable_max_y_position = 300.0
- variable_max_z_position = 330.0
- variable_fans = 3
- variable_auto_g29 = 0
- variable_fan0_min = 90
- variable_fan1_min = 50
- variable_fan2_min = 50
- variable_fan2_speed = 0
- variable_hotend_temp = 0
- variable_e_min_current = 0.27
- variable_z_coefficient = 0.9995
- variable_z_pwl_offset = -0.05
- gcode =
- [gcode_macro STRUCTURE_PARAM]
- variable_bed_length = 300.0
- variable_bed_width = 300.0
- variable_bed_hight = 330.0
- gcode =
- [gcode_macro AUTOTUNE_SHAPERS]
- gcode =
- [gcode_macro LOAD_MATERIAL_CLOSE_FAN2]
- variable_fan2_value = 0
- gcode =
- SAVE_GCODE_STATE NAME=myMoveState
- {% if printer['output_pin fan2'].value > 0.0 %}
- SET_GCODE_VARIABLE MACRO=LOAD_MATERIAL_CLOSE_FAN2 VARIABLE=fan2_value VALUE={printer['output_pin fan2'].value}
- M107 P2
- {% endif %}
- RESTORE_E_CURRENT
- [gcode_macro LOAD_MATERIAL_RESTORE_FAN2]
- gcode =
- {% set fan2_value = printer['gcode_macro LOAD_MATERIAL_CLOSE_FAN2'].fan2_value|float %}
- RESTORE_GCODE_STATE NAME=myMoveState
- {% if fan2_value > 0.0 %}
- {% set s_value = (fan2_value * 255 - printer["gcode_macro PRINTER_PARAM"].fan2_min) * 255 / (255 - printer["gcode_macro PRINTER_PARAM"].fan2_min) %}
- M106 P2 S{s_value} G1
- SET_GCODE_VARIABLE MACRO=LOAD_MATERIAL_CLOSE_FAN2 VARIABLE=fan2_value VALUE=0
- {% endif %}
- SET_E_MIN_CURRENT
- [gcode_macro SET_E_MIN_CURRENT]
- gcode =
- {% set e_current = printer['gcode_macro PRINTER_PARAM'].e_min_current %}
- M400
- SET_TMC_CURRENT STEPPER=extruder CURRENT={e_current} HOLDCURRENT={e_current}
- G4 P2000
- [gcode_macro RESTORE_E_CURRENT]
- gcode =
- {% set e_current = printer.configfile.settings['tmc2209 extruder'].run_current %}
- M400
- SET_TMC_CURRENT STEPPER=extruder CURRENT={e_current} HOLDCURRENT={e_current}
- G4 P2000
- [gcode_macro LOAD_MATERIAL]
- gcode =
- LOAD_MATERIAL_CLOSE_FAN2
- M109 S{printer.custom_macro.default_extruder_temp}
- G91
- G1 E160 F180
- LOAD_MATERIAL_RESTORE_FAN2
- [gcode_macro QUIT_MATERIAL]
- gcode =
- SAVE_GCODE_STATE NAME=myMoveState
- RESTORE_E_CURRENT
- M109 S{printer.custom_macro.default_extruder_temp}
- M83
- G1 E100 F300
- G1 E-15 F3000
- G1 E-22.4700 F2400
- G1 E-6.4200 F1200
- G1 E-3.2100 F720
- G1 E5.0000 F356
- G1 E-5.0000 F384
- G1 E5.0000 F412
- G1 E-5.0000 F440
- G1 E5.0000 F467
- G1 E-5.0000 F495
- G1 E5.0000 F523
- G1 E-5.0000 F3000
- G1 E-15 F3000
- SET_E_MIN_CURRENT
- RESTORE_GCODE_STATE NAME=myMoveState
- [gcode_macro Qmode]
- variable_flag = 0
- variable_accel = 0
- variable_accel_to_decel = 0
- variable_velocity = 0
- variable_square_corner_velocity = 0
- variable_pressure_advance = 0.0
- variable_fan0_value = 0.00
- variable_fan1_value = 0.00
- variable_fan2_value = 0.00
- variable_speed_factor = 0
- variable_max_accel = 800
- variable_max_accel_to_decel = 800
- gcode =
- {% set printer_state = printer.print_stats.state %}
- {% if printer['gcode_macro Qmode'].flag|int == 0 %}
- {% if printer_state == "printing" or printer_state == "paused" %}
- SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=accel VALUE={printer.toolhead.max_accel}
- SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=accel_to_decel VALUE={printer.toolhead.max_accel_to_decel}
- SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=velocity VALUE={printer.toolhead.max_velocity}
- SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=square_corner_velocity VALUE={printer.toolhead.square_corner_velocity}
- SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=pressure_advance VALUE={printer.extruder.pressure_advance}
- SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=speed_factor VALUE={printer.gcode_move.speed_factor}
- SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=fan0_value VALUE={printer['output_pin fan0'].value}
- SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=fan1_value VALUE={printer['output_pin fan1'].value}
- SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=fan2_value VALUE={printer['output_pin fan2'].value}
- SET_TMC_FIELD STEPPER=stepper_x FIELD=en_spreadcycle VALUE=0
- SET_TMC_FIELD STEPPER=stepper_y FIELD=en_spreadcycle VALUE=0
- SET_TMC_CURRENT STEPPER=stepper_x CURRENT=0.9
- SET_TMC_CURRENT STEPPER=stepper_y CURRENT=0.9
- G4 P500
- SET_VELOCITY_LIMIT ACCEL=800
- SET_VELOCITY_LIMIT ACCEL_TO_DECEL=800
- SET_VELOCITY_LIMIT VELOCITY=40
- SET_VELOCITY_LIMIT SQUARE_CORNER_VELOCITY=5
- SET_PRESSURE_ADVANCE ADVANCE=0.05
- M220 S40
- {% set tmp = printer['output_pin fan0'].value * 255 %}
- SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=fan0_value VALUE={tmp}
- {% if tmp - printer['gcode_macro PRINTER_PARAM'].fan0_min > (255 - printer['gcode_macro PRINTER_PARAM'].fan0_min) / 2 %}
- {% set tmp = printer['gcode_macro PRINTER_PARAM'].fan0_min + (255 - printer['gcode_macro PRINTER_PARAM'].fan0_min) / 2 %}
- SET_PIN PIN=fan0 VALUE={tmp}
- {% endif %}
- {% set tmp = printer['output_pin fan1'].value * 255 %}
- SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=fan1_value VALUE={printer['output_pin fan1'].value * 255}
- {% if tmp - printer['gcode_macro PRINTER_PARAM'].fan1_min > (255 - printer['gcode_macro PRINTER_PARAM'].fan1_min) / 2 %}
- {% set tmp = printer['gcode_macro PRINTER_PARAM'].fan1_min + (255 - printer['gcode_macro PRINTER_PARAM'].fan1_min) / 2 %}
- SET_PIN PIN=fan1 VALUE={tmp}
- {% endif %}
- {% set tmp = printer['output_pin fan2'].value * 255 %}
- SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=fan2_value VALUE={printer['output_pin fan2'].value * 255}
- {% if tmp - printer['gcode_macro PRINTER_PARAM'].fan2_min > (255 - printer['gcode_macro PRINTER_PARAM'].fan2_min) / 2 %}
- {% set tmp = printer['gcode_macro PRINTER_PARAM'].fan2_min + (255 - printer['gcode_macro PRINTER_PARAM'].fan2_min) / 2 %}
- SET_PIN PIN=fan2 VALUE={tmp}
- {% endif %}
- SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=flag VALUE=1
- SET_QMODE_FLAG FLAG=1
- {% endif %}
- {% endif %}
- [gcode_macro Qmode_exit]
- gcode =
- {% set printer_state = printer.print_stats.state %}
- {% if printer['gcode_macro Qmode'].flag|int == 1 %}
- {% if printer_state == "printing" or printer_state == "paused" %}
- SET_VELOCITY_LIMIT ACCEL={printer['gcode_macro Qmode'].accel}
- SET_VELOCITY_LIMIT ACCEL_TO_DECEL={printer['gcode_macro Qmode'].accel_to_decel}
- SET_VELOCITY_LIMIT VELOCITY={printer['gcode_macro Qmode'].velocity}
- SET_VELOCITY_LIMIT SQUARE_CORNER_VELOCITY={printer['gcode_macro Qmode'].square_corner_velocity}
- SET_PRESSURE_ADVANCE ADVANCE={printer['gcode_macro Qmode'].pressure_advance}
- M220 S{printer['gcode_macro Qmode'].speed_factor * 100}
- {% set X_RUN_CUR = printer.configfile.settings['tmc2209 stepper_x'].run_current %}
- {% set Y_RUN_CUR = printer.configfile.settings['tmc2209 stepper_y'].run_current %}
- SET_TMC_CURRENT STEPPER=stepper_x CURRENT={X_RUN_CUR}
- SET_TMC_CURRENT STEPPER=stepper_y CURRENT={Y_RUN_CUR}
- SET_TMC_FIELD STEPPER=stepper_x FIELD=en_spreadcycle VALUE=1
- SET_TMC_FIELD STEPPER=stepper_y FIELD=en_spreadcycle VALUE=1
- G4 P500
- SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=flag VALUE=0
- SET_QMODE_FLAG FLAG=0
- {% if printer['output_pin fan0'].value != 0 %}
- {action_respond_info("fan0_value = %s" % printer['gcode_macro Qmode'].fan0_value)}
- SET_PIN PIN=fan0 VALUE={printer['gcode_macro Qmode'].fan0_value}
- SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=fan0_value VALUE=0
- {% endif %}
- {% if printer['output_pin fan1'].value != 0 %}
- {action_respond_info("fan1_value = %s" % printer['gcode_macro Qmode'].fan1_value)}
- SET_PIN PIN=fan1 VALUE={printer['gcode_macro Qmode'].fan1_value}
- SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=fan1_value VALUE=0
- {% endif %}
- {% if printer['output_pin fan2'].value != 0 %}
- {action_respond_info("fan2_value = %s" % printer['gcode_macro Qmode'].fan2_value)}
- SET_PIN PIN=fan2 VALUE={printer['gcode_macro Qmode'].fan2_value}
- SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=fan2_value VALUE=0
- {% endif %}
- {% endif %}
- {% endif %}
- [gcode_macro M204]
- rename_existing = M204.1
- gcode =
- {% set get_params = "" %}
- {% set qmode_max_accel = printer['gcode_macro Qmode'].max_accel|string %}
- {% if 'S' in params|upper %}
- {% if printer['gcode_macro Qmode'].flag|int == 1 and params.S|float > qmode_max_accel|float %}
- {% set get_params = (get_params + ' ' + 'S' + qmode_max_accel) %}
- {% else %}
- {% set get_params = (get_params + ' ' + 'S' + params.S) %}
- {% endif %}
- {% endif %}
- {% if 'P' in params|upper %}
- {% if printer['gcode_macro Qmode'].flag|int == 1 and params.P|float > qmode_max_accel|float %}
- {% set get_params = (get_params + ' ' + 'P' + qmode_max_accel) %}
- {% else %}
- {% set get_params = (get_params + ' ' + 'P' + params.P) %}
- {% endif %}
- {% endif %}
- {% if 'T' in params|upper %}
- {% if printer['gcode_macro Qmode'].flag|int == 1 and params.T|float > qmode_max_accel|float %}
- {% set get_params = (get_params + ' ' + 'T' + qmode_max_accel) %}
- {% else %}
- {% set get_params = (get_params + ' ' + 'T' + params.T) %}
- {% endif %}
- {% endif %}
- M204.1 {get_params}
- [gcode_macro M205]
- gcode =
- {% if 'X' in params %}
- SET_VELOCITY_LIMIT SQUARE_CORNER_VELOCITY={params.X}
- {% elif 'Y' in params %}
- SET_VELOCITY_LIMIT SQUARE_CORNER_VELOCITY={params.Y}
- {% endif %}
- [gcode_macro M106]
- variable_user_flag = 0
- gcode =
- {% if (params.U is defined and params.U|int == 1) or (params.U is not defined and printer["gcode_macro M106"].user_flag|int == 0) or (params.G is defined)%}
- {% if (params.U is defined and params.U|int == 1) %}
- SET_GCODE_VARIABLE MACRO=M106 VARIABLE=user_flag VALUE={params.U|int}
- {% endif %}
- {% set fans = printer["gcode_macro PRINTER_PARAM"].fans|int %}
- {% set fan = 0 %}
- {% set value = 0 %}
- {% if params.P is defined %}
- {% set tmp = params.P|int %}
- {% if tmp < fans %}
- {% set fan = tmp %}
- {% endif %}
- {% endif %}
- {% if params.S is defined %}
- {% set tmp = params.S|float %}
- {% else %}
- {% set tmp = 255 %}
- {% endif %}
- {% if tmp > 0 %}
- {% if fan == 0 %}
- {% set value = (255 - printer["gcode_macro PRINTER_PARAM"].fan0_min) / 255 * tmp %}
- {% if printer['gcode_macro Qmode'].flag | int == 1 %}
- SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=fan0_value VALUE={printer["gcode_macro PRINTER_PARAM"].fan0_min + value}
- {% if value > (255 - printer['gcode_macro PRINTER_PARAM'].fan0_min) / 2 %}
- {% set value = printer["gcode_macro PRINTER_PARAM"].fan0_min + (255 - printer['gcode_macro PRINTER_PARAM'].fan0_min) / 2 %}
- {% else %}
- {% set value = printer["gcode_macro PRINTER_PARAM"].fan0_min + value %}
- {% endif %}
- {% else %}
- {% set value = printer["gcode_macro PRINTER_PARAM"].fan0_min + value %}
- {% endif %}
- {% endif %}
- {% if fan == 1 %}
- {% set value = (255 - printer["gcode_macro PRINTER_PARAM"].fan1_min) / 255 * tmp %}
- {% if printer['gcode_macro Qmode'].flag | int == 1 %}
- SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=fan1_value VALUE={printer["gcode_macro PRINTER_PARAM"].fan1_min + value}
- {% if value > (255 - printer['gcode_macro PRINTER_PARAM'].fan1_min) / 2 %}
- {% set value = printer["gcode_macro PRINTER_PARAM"].fan1_min + (255 - printer['gcode_macro PRINTER_PARAM'].fan1_min) / 2 %}
- {% else %}
- {% set value = printer["gcode_macro PRINTER_PARAM"].fan1_min + value %}
- {% endif %}
- {% else %}
- {% set value = printer["gcode_macro PRINTER_PARAM"].fan1_min + value %}
- {% endif %}
- {% endif %}
- {% if fan == 2 %}
- {% set value = (255 - printer["gcode_macro PRINTER_PARAM"].fan2_min) / 255 * tmp %}
- {% if printer['gcode_macro Qmode'].flag | int == 1 %}
- SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=fan2_value VALUE={printer["gcode_macro PRINTER_PARAM"].fan2_min + value}
- {% if value > (255 - printer['gcode_macro PRINTER_PARAM'].fan2_min) / 2 %}
- {% set value = printer["gcode_macro PRINTER_PARAM"].fan2_min + (255 - printer['gcode_macro PRINTER_PARAM'].fan2_min) / 2 %}
- {% else %}
- {% set value = printer["gcode_macro PRINTER_PARAM"].fan2_min + value %}
- {% endif %}
- {% else %}
- {% set value = printer["gcode_macro PRINTER_PARAM"].fan2_min + value %}
- {% endif %}
- {% endif %}
- {% endif %}
- {% if value >= 255 %}
- {% set value = 255 %}
- {% endif %}
- SET_PIN PIN=fan{fan} VALUE={value}
- {% endif %}
- [gcode_macro M107]
- gcode =
- {% set fans = printer["gcode_macro PRINTER_PARAM"].fans|int %}
- {% if params.P is defined %}
- {% if params.P|int < fans %}
- SET_PIN PIN=fan{params.P|int} VALUE=0
- {% else %}
- SET_PIN PIN=fan0 VALUE=0
- {% endif %}
- {% else %}
- SET_PIN PIN=fan0 VALUE=0
- SET_PIN PIN=fan2 VALUE=0
- {% endif %}
- [gcode_macro M900]
- gcode =
- {% if 'K' in params %}
- {% if 'E' in params %}
- SET_PRESSURE_ADVANCE EXTRUDER={params.E} ADVANCE={params.K}
- {% else %}
- SET_PRESSURE_ADVANCE ADVANCE={params.K}
- {% endif %}
- {% endif %}
- [delayed_gcode wait_temp]
- gcode =
- {% set cur_temp = printer.extruder.temperature %}
- {% if cur_temp|int < 40 %}
- WAIT_TEMP_END
- {% else %}
- UPDATE_DELAYED_GCODE ID=wait_temp DURATION=5
- {% endif %}
- [gcode_macro WAIT_TEMP_START]
- gcode =
- UPDATE_DELAYED_GCODE ID=wait_temp DURATION=1
- M106 P2 S127 G1
- [gcode_macro WAIT_TEMP_END]
- gcode =
- UPDATE_DELAYED_GCODE ID=wait_temp DURATION=0
- M106 P0 S0 G1
- M106 P2 S0 G1
- [gcode_macro PRINT_CALIBRATION]
- gcode =
- CX_PRINT_LEVELING_CALIBRATION
- [gcode_macro FIRST_FLOOR_PAUSE_POSITION]
- gcode =
- {% set extruder_temp = printer.custom_macro.g28_ext_temp %}
- M104 S{extruder_temp}
- {% set y_park = 5 %}
- {% set x_park = 5 %}
- G90
- G1 Z2 F600
- G1 X{x_park} Y{y_park} F6000
- G1 Z0.2 F600
- [gcode_macro ACCURATE_G28]
- gcode =
- {% if printer['gcode_macro START_PRINT'].z_sensorless|int == 1 %}
- G4 P1000
- STEPPER_Z_SENEORLESS
- M400
- G4 P500
- SET_KINEMATIC_POSITION
- {% set retract_z = printer.configfile.settings['prtouch_v2'].retract_z_dist %}
- {% set retract_speed = printer.configfile.settings['prtouch_v2'].retract_z_speed %}
- G91
- G1 Z-{retract_z} F{retract_speed}
- M400
- G90
- G4 P1000
- {action_respond_info("STEPPER_Z_SENEORLESS \n")}
- Z_SENSORLESS_CLEAR
- {% endif %}
- ACCURATE_HOME_Z
- [gcode_macro Z_SENSORLESS_SET]
- gcode =
- SET_GCODE_VARIABLE MACRO=START_PRINT VARIABLE=z_sensorless VALUE=1
- {action_respond_info("set z_sensorless")}
- [gcode_macro Z_SENSORLESS_CLEAR]
- gcode =
- SET_GCODE_VARIABLE MACRO=START_PRINT VARIABLE=z_sensorless VALUE=0
- {action_respond_info("clear z_sensorless")}
- [gcode_macro PRINT_PREPARED]
- gcode =
- SET_GCODE_VARIABLE MACRO=START_PRINT VARIABLE=prepare VALUE=1
- {action_respond_info("print prepared")}
- [gcode_macro PRINT_PREPARE_CLEAR]
- gcode =
- SET_GCODE_VARIABLE MACRO=START_PRINT VARIABLE=prepare VALUE=0
- [gcode_macro END_PRINT_POINT_WITHOUT_LIFTING]
- gcode =
- {% if "xyz" in printer.toolhead.homed_axes %}
- {% set E = printer["gcode_macro PAUSE"].extrude|float %}
- G91
- {% if printer.extruder.can_extrude|lower == 'true' %}
- G1 E-1.0 F180
- G1 E-{E} F4000
- {% else %}
- {action_respond_info("Extruder not hot enough")}
- {% endif %}
- G1 Z2.0 F600
- G90
- {% set y_park = printer.toolhead.axis_maximum.y/2 %}
- {% set x_park = printer.toolhead.axis_maximum.x|float - 10.0 %}
- G1 X{x_park} Y{y_park} F12000
- {% else %}
- {action_respond_info("end print xyz_axes is NULL\n")}
- {% endif %}
- [gcode_macro END_PRINT_POINT]
- gcode =
- {% if "xyz" in printer.toolhead.homed_axes %}
- {% set E = printer["gcode_macro PAUSE"].extrude|float %}
- {% set max_z = printer["gcode_macro PRINTER_PARAM"].max_z_position|float %}
- {% set act_z = printer.toolhead.position.z|float %}
- {% set z_safe = 0.0 %}
- {% if act_z < (max_z / 2) %}
- {% set z_safe = (max_z / 2) - act_z %}
- {% elif act_z < max_z %}
- {% set z_safe = 2.0 %}
- {% endif %}
- G91
- {% if printer.extruder.can_extrude|lower == 'true' %}
- G1 E-1.0 F180
- G1 E-{E} F4000
- {% else %}
- {action_respond_info("Extruder not hot enough")}
- {% endif %}
- G1 Z2.0 F1200
- G90
- {% set y_park = printer.toolhead.axis_maximum.y|float - 5.0 %}
- {% set x_park = printer.toolhead.axis_maximum.x|float - 10.0 %}
- {% set x_park = 10.0 %}
- G1 X{x_park} Y{y_park} F6000
- {% if z_safe > 2.0 %}
- G91
- {% set z_safe = z_safe - 2.0 %}
- G1 Z{z_safe} F1200
- G90
- {% endif %}
- {% else %}
- {action_respond_info("end print xyz_axes is NULL\n")}
- {% endif %}
- [gcode_macro END_SELF_TEST_POINT]
- gcode =
- {% if "xyz" in printer.toolhead.homed_axes %}
- {% set E = printer["gcode_macro PAUSE"].extrude|float %}
- {% set max_z = printer["gcode_macro PRINTER_PARAM"].max_z_position|float %}
- {% set act_z = printer.toolhead.position.z|float %}
- {% set z_safe = 0.0 %}
- {% if act_z < (max_z ) %}
- {% set z_safe = (max_z ) - act_z %}
- {% elif act_z < max_z %}
- {% set z_safe = 2.0 %}
- {% endif %}
- G91
- G1 Z2.0 F1200
- G90
- {% if z_safe > 2.0 %}
- G91
- {% set z_safe = z_safe - 2.0 %}
- G1 Z{z_safe} F1200
- G90
- {% endif %}
- {% else %}
- {action_respond_info("end print xyz_axes is NULL\n")}
- {% endif %}
- [gcode_macro END_PRINT]
- gcode =
- SET_GCODE_VARIABLE MACRO=M106 VARIABLE=user_flag VALUE=0
- Qmode_exit
- EXCLUDE_OBJECT_RESET
- PRINT_PREPARE_CLEAR
- M220 S100
- SET_VELOCITY_LIMIT ACCEL=5000 ACCEL_TO_DECEL=2500
- TURN_OFF_HEATERS
- M107 P1
- M107 P2
- END_PRINT_POINT
- WAIT_TEMP_START
- M84
- SET_TEMPERATURE_FAN_TARGET temperature_fan=soc_fan target=45
- [gcode_macro END_SELF_TEST]
- gcode =
- Qmode_exit
- EXCLUDE_OBJECT_RESET
- PRINT_PREPARE_CLEAR
- M220 S100
- SET_VELOCITY_LIMIT ACCEL=5000 ACCEL_TO_DECEL=2500
- TURN_OFF_HEATERS
- M107 P1
- M107 P2
- END_SELF_TEST_POINT
- WAIT_TEMP_START
- M84
- SET_TEMPERATURE_FAN_TARGET temperature_fan=soc_fan target=45
- [gcode_macro FIRST_FLOOR_PAUSE]
- description = Pause the first floor print
- variable_extrude = 2.0
- gcode =
- {% set E = printer["gcode_macro FIRST_FLOOR_PAUSE"].extrude|float %}
- {% set y_park = 5 %}
- {% set x_park = 5 %}
- {% set max_z = printer["gcode_macro PRINTER_PARAM"].max_z_position|float %}
- {% set act_z = printer.toolhead.position.z|float %}
- {% set z_safe = 0.0 %}
- {% if act_z < (max_z - 2.0) %}
- {% set z_safe = 2.0 %}
- {% elif act_z < max_z %}
- {% set z_safe = max_z - act_z %}
- {% endif %}
- SET_GCODE_VARIABLE MACRO=PRINTER_PARAM VARIABLE=z_safe_pause VALUE={z_safe|float}
- PAUSE_BASE
- G91
- {% if "xyz" in printer.toolhead.homed_axes %}
- {% if printer.extruder.can_extrude|lower == 'true' %}
- G1 E-1.0 F180
- G1 E-{E} F4000
- {% else %}
- {action_respond_info("Extruder not hot enough")}
- {% endif %}
- G1 Z{z_safe} F600
- G90
- G1 X{x_park} Y{y_park} F12000
- {% else %}
- {action_respond_info("Printer not homed")}
- {% endif %}
- SET_GCODE_VARIABLE MACRO=PRINTER_PARAM VARIABLE=fan2_speed VALUE={printer['output_pin fan2'].value}
- {% set fspeed = printer['gcode_macro PRINTER_PARAM'].fan2_speed %}
- {action_respond_info("fan2_value = %s \n" % (fspeed))}
- M106 P2 S0 G1
- SET_E_MIN_CURRENT
- [gcode_macro FIRST_FLOOR_RESUME]
- description = Resume the first floor print
- gcode =
- RESTORE_E_CURRENT
- {% if printer['gcode_macro PRINTER_PARAM'].fan2_speed > 0 %}
- {% set s_value = (printer['gcode_macro PRINTER_PARAM'].fan2_speed * 255 - printer['gcode_macro PRINTER_PARAM'].fan2_min) * 255 / (255 - printer['gcode_macro PRINTER_PARAM'].fan2_min)|float %}
- M106 P2 S{s_value} G1
- {% endif %}
- {% set E = printer["gcode_macro FIRST_FLOOR_PAUSE"].extrude|float + 1.0 %}
- {% if 'VELOCITY' in params|upper %}
- {% set get_params = ('VELOCITY=' + params.VELOCITY) %}
- {%else %}
- {% set get_params = "" %}
- {% endif %}
- {% if printer.extruder.can_extrude|lower == 'true' %}
- G91
- G1 E{E} F2100
- {% else %}
- {action_respond_info("Extruder not hot enough")}
- {% endif %}
- M400
- RESUME_BASE {get_params}
- [gcode_macro PAUSE]
- description = Pause the actual running print
- rename_existing = PAUSE_BASE
- variable_extrude = 2.0
- gcode =
- {% set E = printer["gcode_macro PAUSE"].extrude|float %}
- {% set y_park = printer.toolhead.axis_maximum.y/2 %}
- {% set x_park = printer.toolhead.axis_maximum.x|float - 10.0 %}
- {% set max_z = printer["gcode_macro PRINTER_PARAM"].max_z_position|float %}
- {% set act_z = printer.toolhead.position.z|float %}
- {% set z_safe = 0.0 %}
- {% if act_z < 48.0 %}
- {% set z_safe = 50.0 - act_z %}
- {% elif act_z < (max_z - 2.0) %}
- {% set z_safe = 2.0 %}
- {% elif act_z < max_z %}
- {% set z_safe = max_z - act_z %}
- {% endif %}
- {action_respond_info("z_safe = %s"% (z_safe))}
- SET_GCODE_VARIABLE MACRO=PRINTER_PARAM VARIABLE=z_safe_pause VALUE={z_safe|float}
- PAUSE_BASE
- G91
- SET_GCODE_VARIABLE MACRO=PRINTER_PARAM VARIABLE=hotend_temp VALUE={printer.extruder.target}
- M104 S140
- {% if "xyz" in printer.toolhead.homed_axes %}
- {% if printer.extruder.can_extrude|lower == 'true' %}
- G1 E-1.0 F180
- G1 E-{E} F4000
- {% else %}
- {action_respond_info("Extruder not hot enough")}
- {% endif %}
- G1 Z{z_safe} F600
- M400
- G90
- G1 X{x_park} Y{y_park} F12000
- {% else %}
- {action_respond_info("Printer not homed")}
- {% endif %}
- SET_GCODE_VARIABLE MACRO=PRINTER_PARAM VARIABLE=fan2_speed VALUE={printer['output_pin fan2'].value}
- {% set fspeed = printer['gcode_macro PRINTER_PARAM'].fan2_speed %}
- {action_respond_info("fan2_value = %s \n" % (fspeed))}
- M106 P2 S0 G1
- SET_E_MIN_CURRENT
- [gcode_macro INPUTSHAPER]
- gcode =
- SET_FILAMENT_SENSOR SENSOR=filament_sensor ENABLE=0
- SET_TEMPERATURE_FAN_TARGET temperature_fan=soc_fan target=5
- G90
- G28
- {% set POSITION_X = printer.configfile.settings['stepper_x'].position_max/2 %}
- {% set POSITION_Y = printer.configfile.settings['stepper_y'].position_max/2 %}
- G1 X{POSITION_X} Y{POSITION_Y} F6000
- G1 Z20 F1200
- SHAPER_CALIBRATE
- CXSAVE_CONFIG
- SET_TEMPERATURE_FAN_TARGET temperature_fan=soc_fan target=45
- SET_FILAMENT_SENSOR SENSOR=filament_sensor ENABLE=1
- [gcode_macro BEDPID]
- gcode =
- PID_CALIBRATE HEATER=heater_bed TARGET=100
- SAVE_CONFIG
- [gcode_macro TUNOFFINPUTSHAPER]
- gcode =
- SET_INPUT_SHAPER SHAPER_FREQ_X=0 SHAPER_FREQ_Y=0
- [gcode_macro RESUME]
- description = Resume the actual running print
- rename_existing = RESUME_BASE
- gcode =
- RESTORE_E_CURRENT
- {% if printer['gcode_macro PRINTER_PARAM'].hotend_temp|int != 0 %}
- {% if printer['gcode_macro PRINTER_PARAM'].hotend_temp|int > printer.extruder.temperature %}
- M109 S{printer['gcode_macro PRINTER_PARAM'].hotend_temp|int}
- {% else %}
- M104 S{printer['gcode_macro PRINTER_PARAM'].hotend_temp|int}
- {% endif %}
- SET_GCODE_VARIABLE MACRO=PRINTER_PARAM VARIABLE=hotend_temp VALUE=0
- {% endif %}
- {% if printer['gcode_macro PRINTER_PARAM'].fan2_speed > 0 %}
- {% set s_value = (printer['gcode_macro PRINTER_PARAM'].fan2_speed * 255 - printer['gcode_macro PRINTER_PARAM'].fan2_min) * 255 / (255 - printer['gcode_macro PRINTER_PARAM'].fan2_min)|float %}
- M106 P2 S{s_value} G1
- {% endif %}
- {% set z_resume_move = printer['gcode_macro PRINTER_PARAM'].z_safe_pause|int %}
- {% if z_resume_move > 2 %}
- {% set z_resume_move = z_resume_move - 2 %}
- G91
- G1 Z-{z_resume_move} F600
- M400
- {% endif %}
- {action_respond_info("z_resume_move = %s"% (z_resume_move))}
- {% set E = printer["gcode_macro PAUSE"].extrude|float + 1.0 %}
- {% if 'VELOCITY' in params|upper %}
- {% set get_params = ('VELOCITY=' + params.VELOCITY) %}
- {%else %}
- {% set get_params = "" %}
- {% endif %}
- {% if printer.extruder.can_extrude|lower == 'true' %}
- G91
- G1 E{E} F2100
- G90
- {% else %}
- {action_respond_info("Extruder not hot enough")}
- {% endif %}
- M400
- RESUME_BASE {get_params}
- [gcode_macro CANCEL_PRINT]
- description = Cancel the actual running print
- rename_existing = CANCEL_PRINT_BASE
- gcode =
- END_PRINT
- CANCEL_PRINT_BASE
- [gcode_macro G29]
- gcode =
- {% if 'PROBE_COUNT' in params|upper %}
- {% set get_count = ('PROBE_COUNT' + params.PROBE_COUNT) %}
- {%else %}
- {% set get_count = "" %}
- {% endif %}
- {% set bed_temp = printer.custom_macro.default_bed_temp %}
- {% set extruder_temp = printer.custom_macro.g28_ext_temp %}
- {% set nozzle_clear_temp = printer.custom_macro.default_extruder_temp %}
- {% if 'BED_TEMP' in params|upper %}
- {% set bed_temp = params.BED_TEMP %}
- {% endif %}
- {% if 'EXTRUDER_TEMP' in params|upper %}
- {% set nozzle_clear_temp = params.EXTRUDER_TEMP %}
- {% endif %}
- SET_FILAMENT_SENSOR SENSOR=filament_sensor ENABLE=0
- SET_TEMPERATURE_FAN_TARGET temperature_fan=soc_fan target=5
- M109 S140
- G28
- BED_MESH_CLEAR
- NOZZLE_CLEAR HOT_MIN_TEMP={extruder_temp} HOT_MAX_TEMP={nozzle_clear_temp} BED_MAX_TEMP={bed_temp}
- M204 S5000
- SET_VELOCITY_LIMIT ACCEL_TO_DECEL=5000
- BED_MESH_CALIBRATE {get_count}
- BED_MESH_OUTPUT
- {% set y_park = printer.toolhead.axis_maximum.y/2 %}
- {% set x_park = printer.toolhead.axis_maximum.x|float - 10.0 %}
- G1 Z50 F3600
- CXSAVE_CONFIG
- TURN_OFF_HEATERS
- SET_TEMPERATURE_FAN_TARGET temperature_fan=soc_fan target=45
- SET_FILAMENT_SENSOR SENSOR=filament_sensor ENABLE=1
- [fan_feedback]
- fan0_pin = PC6
- print_delay_time = 5
- current_delay_time = 2
- [custom_macro]
- default_bed_temp = 60
- default_extruder_temp = 240
- g28_ext_temp = 140
- [respond]
- [calibrate_shaper_config]
- [gcode_shell_command resonance_graph]
- command = /usr/data/printer_data/config/Helper-Script/improved-shapers/scripts/calibrate_shaper.py
- timeout = 600.0
- verbose = False
- [gcode_shell_command belts_graph]
- command = /usr/data/printer_data/config/Helper-Script/improved-shapers/scripts/graph_belts.py
- timeout = 600.0
- verbose = False
- [gcode_shell_command delete_graph]
- command = sh /usr/data/helper-script/files/improved-shapers/delete_graph.sh
- timeout = 600.0
- verbose = False
- [gcode_shell_command delete_csv]
- command = sh /usr/data/helper-script/files/improved-shapers/delete_csv.sh
- timeout = 600.0
- verbose = False
- [gcode_macro INPUT_SHAPER_CALIBRATION]
- description = Measure X and Y Axis Resonances and Save values
- gcode =
- {% if printer["configfile"].config["temperature_fan soc_fan"] %}
- SET_TEMPERATURE_FAN_TARGET TEMPERATURE_FAN=soc_fan TARGET=30
- {% endif %}
- {% if printer.toolhead.homed_axes != "xyz" %}
- RESPOND TYPE=command MSG="Homing..."
- G28
- {% endif %}
- RESPOND TYPE=command MSG="Measuring X and Y Resonances..."
- SHAPER_CALIBRATE
- M400
- {% if printer["configfile"].config["temperature_fan soc_fan"] %}
- SET_TEMPERATURE_FAN_TARGET TEMPERATURE_FAN=soc_fan TARGET=45
- {% endif %}
- RUN_SHELL_COMMAND CMD=delete_csv
- RESPOND TYPE=command MSG="Input Shaper Calibration complete!"
- SAVE_CONFIG
- [gcode_macro TEST_RESONANCES_GRAPHS]
- description = Test X and Y Axis Resonances and Generate Graphs
- gcode =
- RUN_SHELL_COMMAND CMD=delete_graph
- {% set x_png = params.X_PNG|default("/usr/data/printer_data/config/Helper-Script/improved-shapers/resonances_x.png") %}
- {% set y_png = params.Y_PNG|default("/usr/data/printer_data/config/Helper-Script/improved-shapers/resonances_y.png") %}
- {% if printer["configfile"].config["temperature_fan soc_fan"] %}
- SET_TEMPERATURE_FAN_TARGET TEMPERATURE_FAN=soc_fan TARGET=30
- {% endif %}
- {% if printer.toolhead.homed_axes != "xyz" %}
- RESPOND TYPE=command MSG="Homing..."
- G28
- {% endif %}
- RESPOND TYPE=command MSG="Testing X Resonances..."
- TEST_RESONANCES AXIS=X NAME=x
- M400
- RESPOND TYPE=command MSG="Generating X Graph... This may take some time."
- RUN_SHELL_COMMAND CMD=resonance_graph PARAMS="/tmp/resonances_x_x.csv -o {x_png}"
- RESPOND TYPE=command MSG="X Graph (resonances_x.png) is now available in /Helper-Script/improved-shapers folder."
- RESPOND TYPE=command MSG="Testing Y Resonances..."
- TEST_RESONANCES AXIS=Y NAME=y
- M400
- RESPOND TYPE=command MSG="Generating Y Graph... This may take some time."
- RUN_SHELL_COMMAND CMD=resonance_graph PARAMS="/tmp/resonances_y_y.csv -o {y_png}"
- RESPOND TYPE=command MSG="Y Graph (resonances_y.png) is now available in /Helper-Script/improved-shapers folder."
- {% if printer["configfile"].config["temperature_fan soc_fan"] %}
- SET_TEMPERATURE_FAN_TARGET TEMPERATURE_FAN=soc_fan TARGET=45
- {% endif %}
- RUN_SHELL_COMMAND CMD=delete_csv
- RESPOND TYPE=command MSG="Resonances Test complete!"
- [gcode_macro BELTS_SHAPER_CALIBRATION]
- description = Perform a custom half-axis test to analyze and compare the frequency profiles of individual belts on CoreXY printers
- gcode =
- RUN_SHELL_COMMAND CMD=delete_graph
- {% set min_freq = params.FREQ_START|default(5)|float %}
- {% set max_freq = params.FREQ_END|default(133.33)|float %}
- {% set hz_per_sec = params.HZ_PER_SEC|default(1)|float %}
- {% set png_width = params.PNG_WIDTH|default(8)|float %}
- {% set png_height = params.PNG_HEIGHT|default(4.8)|float %}
- {% set png_out_path = params.PNG_OUT_PATH|default("/usr/data/printer_data/config/Helper-Script/improved-shapers/belts_calibration.png") %}
- {% if printer["configfile"].config["temperature_fan soc_fan"] %}
- SET_TEMPERATURE_FAN_TARGET TEMPERATURE_FAN=soc_fan TARGET=30
- {% endif %}
- {% if printer.toolhead.homed_axes != "xyz" %}
- RESPOND TYPE=command MSG="Homing..."
- G28
- {% endif %}
- TEST_RESONANCES AXIS=1,1 OUTPUT=raw_data NAME=b FREQ_START={min_freq} FREQ_END={max_freq} HZ_PER_SEC={hz_per_sec}
- M400
- TEST_RESONANCES AXIS=1,-1 OUTPUT=raw_data NAME=a FREQ_START={min_freq} FREQ_END={max_freq} HZ_PER_SEC={hz_per_sec}
- M400
- RESPOND TYPE=command MSG="Generating Belts Frequency Profiles Graph... This may take some time."
- RUN_SHELL_COMMAND CMD=belts_graph PARAMS="-w {png_width} -l {png_height} -n -o {png_out_path} -k /usr/share/klipper /tmp/raw_data_axis=1.000,-1.000_a.csv /tmp/raw_data_axis=1.000,1.000_b.csv"
- RESPOND TYPE=command MSG="Graph (belts_calibration.png) is now available in /Helper-Script/improved-shapers folder."
- {% if printer["configfile"].config["temperature_fan soc_fan"] %}
- SET_TEMPERATURE_FAN_TARGET TEMPERATURE_FAN=soc_fan TARGET=45
- {% endif %}
- RUN_SHELL_COMMAND CMD=delete_csv
- RESPOND TYPE=command MSG="Belts Shaper Calibration complete!"
- [gcode_macro EXCITATE_AXIS_AT_FREQ]
- description = Maintain a specified excitation frequency for a period of time to diagnose and locate a vibration source
- gcode =
- {% set frequency = params.FREQUENCY|default(25)|int %}
- {% set time = params.TIME|default(10)|int %}
- {% set axis = params.AXIS|default("x")|string|lower %}
- {% if axis not in ["x", "y", "a", "b"] %}
- { action_raise_error("AXIS selection is invalid. Should be either x, y, a or b!") }
- {% endif %}
- {% if axis == "a" %}
- {% set axis = "1,-1" %}
- {% elif axis == "b" %}
- {% set axis = "1,1" %}
- {% endif %}
- {% if printer.toolhead.homed_axes != "xyz" %}
- RESPOND TYPE=command MSG="Homing..."
- G28
- {% endif %}
- TEST_RESONANCES OUTPUT=raw_data AXIS={axis} FREQ_START={frequency-1} FREQ_END={frequency+1} HZ_PER_SEC={1/(time/3)}
- M400
- [output_pin ADAPTIVE_BED_MESH]
- pin = virtual_pin:ADAPTIVE_BED_MESH_pin
- value = 1
- [output_pin FULL_BED_MESH]
- pin = virtual_pin:FULL_BED_MESH_pin
- value = 0
- [output_pin ADAPTIVE_PURGE_LINE]
- pin = virtual_pin:ADAPTIVE_PURGE_LINE_pin
- value = 1
- [gcode_macro _ADAPTIVE_BED_MESH_ON]
- description = Enable Adaptive Bed Mesh and Disable Full Bed Mesh
- gcode =
- SET_PIN PIN=ADAPTIVE_BED_MESH VALUE=1
- SET_PIN PIN=FULL_BED_MESH VALUE=0
- RESPOND TYPE=command MSG="action:prompt_end"
- [gcode_macro _FULL_BED_MESH_ON]
- description = Disable Adaptive Bed Mesh and Enable Full Bed Mesh
- gcode =
- SET_PIN PIN=ADAPTIVE_BED_MESH VALUE=0
- SET_PIN PIN=FULL_BED_MESH VALUE=1
- RESPOND TYPE=command MSG="action:prompt_end"
- [gcode_macro _BED_MESH_OFF]
- description = Disable Adaptive Bed Mesh and Enable Full Bed Mesh
- gcode =
- SET_PIN PIN=ADAPTIVE_BED_MESH VALUE=0
- SET_PIN PIN=FULL_BED_MESH VALUE=0
- RESPOND TYPE=command MSG="action:prompt_end"
- [gcode_macro _ADAPTIVE_PURGE_LINE_ON]
- description = Enable Adaptive Purge Line
- gcode =
- SET_PIN PIN=ADAPTIVE_PURGE_LINE VALUE=1
- RESPOND TYPE=command MSG="action:prompt_end"
- [gcode_macro _ADAPTIVE_PURGE_LINE_OFF]
- description = Disable Adaptive Purge Line
- gcode =
- SET_PIN PIN=ADAPTIVE_PURGE_LINE VALUE=0
- RESPOND TYPE=command MSG="action:prompt_end"
- [gcode_macro KAMP_BED_MESH_SETTINGS]
- description = Configure Bed Mesh type
- gcode =
- RESPOND TYPE=command MSG="action:prompt_begin Bed Mesh Settings"
- RESPOND TYPE=command MSG="action:prompt_text What type of bed mesh do you want to use when you start printing?"
- RESPOND TYPE=command MSG="action:prompt_button ADAPTIVE BED MESH|_ADAPTIVE_BED_MESH_ON|primary"
- RESPOND TYPE=command MSG="action:prompt_button FULL BED MESH|_FULL_BED_MESH_ON|primary"
- RESPOND TYPE=command MSG="action:prompt_button NONE|_BED_MESH_OFF|primary"
- RESPOND TYPE=command MSG="action:prompt_show"
- [gcode_macro KAMP_PURGE_LINE_SETTINGS]
- description = Configure Purge Line type
- gcode =
- RESPOND TYPE=command MSG="action:prompt_begin Purge Line Settings"
- RESPOND TYPE=command MSG="action:prompt_text What type of purge line do you want to use when you start printing?"
- RESPOND TYPE=command MSG="action:prompt_button ADAPTIVE PURGE LINE|_ADAPTIVE_PURGE_LINE_ON|primary"
- RESPOND TYPE=command MSG="action:prompt_button CLASSIC PURGE LINE|_ADAPTIVE_PURGE_LINE_OFF|primary"
- RESPOND TYPE=command MSG="action:prompt_show"
- [gcode_macro START_PRINT]
- variable_prepare = 0
- variable_z_sensorless = 0
- gcode =
- SET_GCODE_VARIABLE MACRO=M106 VARIABLE=user_flag VALUE=0
- WAIT_TEMP_END
- CLEAR_PAUSE
- SET_TEMPERATURE_FAN_TARGET TEMPERATURE_FAN=soc_fan TARGET=30
- {% set g28_extruder_temp = printer.custom_macro.g28_ext_temp %}
- {% set bed_temp = printer.custom_macro.default_bed_temp %}
- {% set extruder_temp = printer.custom_macro.default_extruder_temp %}
- {% if 'BED_TEMP' in params|upper and (params.BED_TEMP|float) %}
- {% set bed_temp = params.BED_TEMP %}
- {% endif %}
- {% if 'EXTRUDER_TEMP' in params|upper and (params.EXTRUDER_TEMP|float) %}
- {% set extruder_temp = params.EXTRUDER_TEMP %}
- {% endif %}
- {% if printer['gcode_macro START_PRINT'].prepare|int == 0 %}
- {action_respond_info("not prepare.\n")}
- PRINT_PREPARE_CLEAR
- CX_ROUGH_G28 EXTRUDER_TEMP={extruder_temp} BED_TEMP={bed_temp}
- CX_NOZZLE_CLEAR
- Z_SENSORLESS_SET
- ACCURATE_G28
- {% if printer['output_pin ADAPTIVE_BED_MESH'].value == 1 %}
- RESPOND TYPE=command MSG="Starting Adaptative Bed Mesh..."
- BED_MESH_CLEAR
- BED_MESH_CALIBRATE
- BED_MESH_PROFILE SAVE=adaptive
- BED_MESH_PROFILE LOAD=adaptive
- {% else %}
- {% if printer['output_pin FULL_BED_MESH'].value == 0 and (not printer['bed_mesh'].profile_name) %}
- RESPOND TYPE=command MSG="No bed mesh found. Starting Full Bed Mesh..."
- CX_PRINT_LEVELING_CALIBRATION
- {% endif %}
- {% if printer['output_pin FULL_BED_MESH'].value == 1 %}
- RESPOND TYPE=command MSG="Starting Full Bed Mesh..."
- CX_PRINT_LEVELING_CALIBRATION
- {% endif %}
- BED_MESH_PROFILE LOAD=default
- {% endif %}
- {% else %}
- PRINT_PREPARE_CLEAR
- {% endif %}
- {% if printer['output_pin ADAPTIVE_PURGE_LINE'].value == 1 %}
- _SMART_PARK
- M109 S{extruder_temp}
- M190 S{bed_temp}
- RESPOND TYPE=command MSG="Starting Adaptive Purge Line..."
- _LINE_PURGE
- {% else %}
- RESPOND TYPE=command MSG="Starting Classic Purge Line..."
- CX_PRINT_DRAW_ONE_LINE
- {% endif %}
- SET_VELOCITY_LIMIT ACCEL={printer.configfile.settings.printer.max_accel}
- [gcode_macro BED_MESH_CALIBRATE]
- rename_existing = _BED_MESH_CALIBRATE
- gcode =
- {% set all_points = printer.exclude_object.objects | map(attribute='polygon') | sum(start=[]) %}
- {% set bed_mesh_min = printer.configfile.settings.bed_mesh.mesh_min %}
- {% set bed_mesh_max = printer.configfile.settings.bed_mesh.mesh_max %}
- {% set probe_count = printer.configfile.settings.bed_mesh.probe_count %}
- {% set kamp_settings = printer["gcode_macro _KAMP_Settings"] %}
- {% set verbose_enable = kamp_settings.verbose_enable | abs %}
- {% set mesh_margin = kamp_settings.mesh_margin | float %}
- {% set fuzz_amount = kamp_settings.fuzz_amount | float %}
- {% set probe_count = probe_count if probe_count|length > 1 else probe_count * 2 %}
- {% set max_probe_point_distance_x = ( bed_mesh_max[0] - bed_mesh_min[0] ) / (probe_count[0] - 1) %}
- {% set max_probe_point_distance_y = ( bed_mesh_max[1] - bed_mesh_min[1] ) / (probe_count[1] - 1) %}
- {% set x_min = all_points | map(attribute=0) | min | default(bed_mesh_min[0]) %}
- {% set y_min = all_points | map(attribute=1) | min | default(bed_mesh_min[1]) %}
- {% set x_max = all_points | map(attribute=0) | max | default(bed_mesh_max[0]) %}
- {% set y_max = all_points | map(attribute=1) | max | default(bed_mesh_max[1]) %}
- {% set fuzz_range = range((0) | int, (fuzz_amount * 100) | int + 1) %}
- {% set adapted_x_min = x_min - mesh_margin - (fuzz_range | random / 100.0) %}
- {% set adapted_y_min = y_min - mesh_margin - (fuzz_range | random / 100.0) %}
- {% set adapted_x_max = x_max + mesh_margin + (fuzz_range | random / 100.0) %}
- {% set adapted_y_max = y_max + mesh_margin + (fuzz_range | random / 100.0) %}
- {% set adapted_x_min = [adapted_x_min , bed_mesh_min[0]] | max %}
- {% set adapted_y_min = [adapted_y_min , bed_mesh_min[1]] | max %}
- {% set adapted_x_max = [adapted_x_max , bed_mesh_max[0]] | min %}
- {% set adapted_y_max = [adapted_y_max , bed_mesh_max[1]] | min %}
- {% set points_x = (((adapted_x_max - adapted_x_min) / max_probe_point_distance_x) | round(method='ceil') | int) + 1 %}
- {% set points_y = (((adapted_y_max - adapted_y_min) / max_probe_point_distance_y) | round(method='ceil') | int) + 1 %}
- {% if (points_x > points_y) %}
- {% set points_y = points_x %}
- {% endif %}
- {% if (points_x < points_y) %}
- {% set points_x = points_y %}
- {% endif %}
- {% if (([points_x, points_y]|max) > 6) %}
- {% set algorithm = "bicubic" %}
- {% set min_points = 4 %}
- {% else %}
- {% set algorithm = "lagrange" %}
- {% set min_points = 3 %}
- {% endif %}
- {% set points_x = [points_x , min_points]|max %}
- {% set points_y = [points_y , min_points]|max %}
- {% set points_x = [points_x , probe_count[0]]|min %}
- {% set points_y = [points_y , probe_count[1]]|min %}
- {% if verbose_enable == True %}
- {% if printer.exclude_object.objects != [] %}
- RESPOND TYPE=command MSG="Algorithm: {algorithm}"
- RESPOND TYPE=command MSG="Default probe count: {probe_count[0]},{probe_count[1]}"
- RESPOND TYPE=command MSG="Adapted probe count: {points_x},{points_y}"
- RESPOND TYPE=command MSG="Default mesh bounds: {bed_mesh_min[0]},{bed_mesh_min[1]}, {bed_mesh_max[0]},{bed_mesh_max[1]}"
- {% if mesh_margin > 0 %}
- RESPOND TYPE=command MSG="Mesh margin is {mesh_margin}, mesh bounds extended by {mesh_margin}mm."
- {% else %}
- RESPOND TYPE=command MSG="Mesh margin is 0, margin not increased."
- {% endif %}
- {% if fuzz_amount > 0 %}
- RESPOND TYPE=command MSG="Mesh point fuzzing enabled, points fuzzed up to {fuzz_amount}mm"
- {% else %}
- RESPOND TYPE=command MSG="Fuzz amount is 0, mesh points not fuzzed."
- {% endif %}
- RESPOND TYPE=command MSG="Adapted mesh bounds: {adapted_x_min},{adapted_y_min}, {adapted_x_max},{adapted_y_max}"
- RESPOND TYPE=command MSG="KAMP adjustments successful. Happy KAMPing!"
- {% else %}
- RESPOND TYPE=command MSG="No object detected! Make sure you have enabled Exclude Objets setting in your slicer. Using Full Bed Mesh."
- G4 P5000
- {% endif %}
- {% endif %}
- _BED_MESH_CALIBRATE mesh_min={adapted_x_min},{adapted_y_min} mesh_max={adapted_x_max},{adapted_y_max} ALGORITHM={algorithm} PROBE_COUNT={points_x},{points_y}
- [gcode_macro _LINE_PURGE]
- description = A purge macro that adapts to be near your actual printed objects
- gcode =
- {% set travel_speed = (printer.toolhead.max_velocity) * 60 | float %}
- {% set cross_section = printer.configfile.settings.extruder.max_extrude_cross_section | float %}
- {% if printer.firmware_retraction is defined %}
- {% set RETRACT = G10 | string %}
- {% set UNRETRACT = G11 | string %}
- {% else %}
- {% set RETRACT = 'G1 E-0.5 F2400' | string %}
- {% set UNRETRACT = 'G1 E0.5 F2400' | string %}
- {% endif %}
- {% set bed_x_max = printer["gcode_macro PRINTER_PARAM"].max_x_position | float %}
- {% set bed_y_max = printer["gcode_macro PRINTER_PARAM"].max_y_position | float %}
- {% set verbose_enable = printer["gcode_macro _KAMP_Settings"].verbose_enable | abs %}
- {% set purge_height = printer["gcode_macro _KAMP_Settings"].purge_height | float %}
- {% set tip_distance = printer["gcode_macro _KAMP_Settings"].tip_distance | float %}
- {% set purge_margin = printer["gcode_macro _KAMP_Settings"].purge_margin | float %}
- {% set purge_amount = printer["gcode_macro _KAMP_Settings"].purge_amount | float %}
- {% set flow_rate = printer["gcode_macro _KAMP_Settings"].flow_rate | float %}
- {% set rapid_move = 10 %}
- {% set all_points = printer.exclude_object.objects | map(attribute='polygon') | sum(start=[]) %}
- {% set purge_x_min = (all_points | map(attribute=0) | min | default(0)) %}
- {% set purge_x_max = (all_points | map(attribute=0) | max | default(0)) %}
- {% set purge_y_min = (all_points | map(attribute=1) | min | default(0)) %}
- {% set purge_y_max = (all_points | map(attribute=1) | max | default(0)) %}
- {% set detect_object = purge_x_min + purge_x_max + purge_y_min + purge_y_max %}
- {% set purge_x_center = ([((purge_x_max + purge_x_min) / 2) - (purge_amount / 2), 0] | max) %}
- {% set purge_y_center = ([((purge_y_max + purge_y_min) / 2) - (purge_amount / 2), 0] | max) %}
- {% if (purge_x_center + purge_amount + rapid_move) > bed_x_max %}
- {% set purge_x_center = (bed_x_max - (purge_amount + rapid_move)) %}
- {% endif %}
- {% if (purge_y_center + purge_amount + rapid_move) > bed_y_max %}
- {% set purge_y_center = (bed_y_max - (purge_amount + rapid_move)) %}
- {% endif %}
- {% set purge_x_origin_low = (purge_x_min - purge_margin) %}
- {% set purge_x_origin_high = (purge_x_max + purge_margin) %}
- {% set purge_y_origin_low = (purge_y_min - purge_margin) %}
- {% set purge_y_origin_high = (purge_y_max + purge_margin) %}
- {% set purge_move_speed = (flow_rate / 5.0) * 60 | float %}
- {% if cross_section < 5 %}
- RESPOND TYPE=command MSG="[Extruder] max_extrude_cross_section is insufficient for line purge, please set it to 5 or greater. Purge skipped."
- {% else %}
- {% if verbose_enable == True %}
- RESPOND TYPE=command MSG="Moving filament tip {tip_distance}mm"
- {% endif %}
- {% if detect_object == 0 %}
- RESPOND TYPE=command MSG="No object detected! Using classic purge line."
- {% elif purge_y_origin_low > 0 %}
- RESPOND TYPE=command MSG="KAMP line purge starting at {purge_x_center}, {purge_y_origin_low} and purging {purge_amount}mm of filament, requested flow rate is {flow_rate}mm3/s."
- {% elif purge_x_origin_low > 0 %}
- RESPOND TYPE=command MSG="KAMP line purge starting at {purge_x_origin_low}, {purge_y_center} and purging {purge_amount}mm of filament, requested flow rate is {flow_rate}mm3/s."
- {% elif purge_y_origin_high < bed_y_max %}
- RESPOND TYPE=command MSG="KAMP line purge starting at {purge_x_center}, {purge_y_origin_high} and purging {purge_amount}mm of filament, requested flow rate is {flow_rate}mm3/s."
- {% elif purge_x_origin_high < bed_x_max %}
- RESPOND TYPE=command MSG="KAMP line purge starting at {purge_x_origin_high}, {purge_y_center} and purging {purge_amount}mm of filament, requested flow rate is {flow_rate}mm3/s."
- {% else %}
- RESPOND TYPE=command MSG="No space for purge line! Using classic purge line."
- {% endif %}
- SAVE_GCODE_STATE NAME=Prepurge_State
- {% if detect_object == 0 %}
- CX_PRINT_DRAW_ONE_LINE
- {% elif purge_y_origin_low > 0 %}
- G92 E0
- G0 F{travel_speed}
- G90
- G0 X{purge_x_center} Y{purge_y_origin_low}
- G0 Z{purge_height}
- M83
- G1 E{tip_distance} F{purge_move_speed}
- G1 X{purge_x_center + purge_amount} E{purge_amount} F{purge_move_speed}
- {RETRACT}
- G0 X{purge_x_center + purge_amount + rapid_move} F{travel_speed}
- G92 E0
- M82
- G0 Z{purge_height * 2} F{travel_speed}
- {% elif purge_x_origin_low > 0 %}
- G92 E0
- G0 F{travel_speed}
- G90
- G0 X{purge_x_origin_low} Y{purge_y_center}
- G0 Z{purge_height}
- M83
- G1 E{tip_distance} F{purge_move_speed}
- G1 Y{purge_y_center + purge_amount} E{purge_amount} F{purge_move_speed}
- {RETRACT}
- G0 Y{purge_y_center + purge_amount + rapid_move} F{travel_speed}
- G92 E0
- M82
- G0 Z{purge_height * 2} F{travel_speed}
- {% elif purge_y_origin_high < bed_y_max %}
- G92 E0
- G0 F{travel_speed}
- G90
- G0 X{purge_x_center} Y{purge_y_origin_high}
- G0 Z{purge_height}
- M83
- G1 E{tip_distance} F{purge_move_speed}
- G1 X{purge_x_center + purge_amount} E{purge_amount} F{purge_move_speed}
- {RETRACT}
- G0 X{purge_x_center + purge_amount + rapid_move} F{travel_speed}
- G92 E0
- M82
- G0 Z{purge_height * 2} F{travel_speed}
- {% elif purge_x_origin_high < bed_x_max %}
- G92 E0
- G0 F{travel_speed}
- G90
- G0 X{purge_x_origin_high} Y{purge_y_center}
- G0 Z{purge_height}
- M83
- G1 E{tip_distance} F{purge_move_speed}
- G1 Y{purge_y_center + purge_amount} E{purge_amount} F{purge_move_speed}
- {RETRACT}
- G0 Y{purge_y_center + purge_amount + rapid_move} F{travel_speed}
- G92 E0
- M82
- G0 Z{purge_height * 2} F{travel_speed}
- {% else %}
- CX_PRINT_DRAW_ONE_LINE
- {% endif %}
- RESTORE_GCODE_STATE NAME=Prepurge_State
- {% endif %}
- [gcode_macro _SMART_PARK]
- description = Parks your printhead near the print area for pre-print hotend heating.
- gcode =
- {% set kamp_settings = printer["gcode_macro _KAMP_Settings"] %}
- {% set bed_x_max = printer["gcode_macro PRINTER_PARAM"].max_x_position | float %}
- {% set bed_y_max = printer["gcode_macro PRINTER_PARAM"].max_y_position | float %}
- {% set z_height = kamp_settings.smart_park_height | float %}
- {% set purge_margin = kamp_settings.purge_margin | float %}
- {% set purge_amount = kamp_settings.purge_amount | float %}
- {% set verbose_enable = kamp_settings.verbose_enable | abs %}
- {% set center_x = bed_x_max / 2 %}
- {% set center_y = bed_y_max / 2 %}
- {% set axis_minimum_x = printer.toolhead.axis_minimum.x | float %}
- {% set axis_minimum_y = printer.toolhead.axis_minimum.y | float %}
- {% set all_points = printer.exclude_object.objects | map(attribute='polygon') | sum(start=[]) %}
- {% set x_min = (all_points | map(attribute=0) | min | default(0)) %}
- {% set x_max = (all_points | map(attribute=0) | max | default(0)) %}
- {% set y_min = (all_points | map(attribute=1) | min | default(0)) %}
- {% set y_max = (all_points | map(attribute=1) | max | default(0)) %}
- {% set travel_speed = (printer.toolhead.max_velocity) * 60 | float %}
- {% set rapid_move = 10 %}
- {% set park_x_center = ([((x_max + x_min) / 2) - (purge_amount / 2), 0] | max) %}
- {% set park_y_center = ([((y_max + y_min) / 2) - (purge_amount / 2), 0] | max) %}
- {% if (park_x_center + purge_amount + rapid_move) > bed_x_max %}
- {% set park_x_center = (bed_x_max - (purge_amount + rapid_move)) %}
- {% endif %}
- {% if (park_y_center + purge_amount + rapid_move) > bed_y_max %}
- {% set park_y_center = (bed_y_max - (purge_amount + rapid_move)) %}
- {% endif %}
- {% set park_x_origin_low = (x_min - purge_margin) %}
- {% set park_x_origin_high = (x_max + purge_margin) %}
- {% set park_y_origin_low = (y_min - purge_margin) %}
- {% set park_y_origin_high = (y_max + purge_margin) %}
- {% set detect_object = (x_min + x_max + y_min + y_max) %}
- {% if detect_object == 0 %}
- {% set x_min = 10 %}
- {% set y_min = 10 %}
- {% set z_height = 2 %}
- {% elif park_y_origin_low > 0 %}
- {% set x_min = park_x_center %}
- {% set y_min = park_y_origin_low %}
- {% elif park_x_origin_low > 0 %}
- {% set x_min = park_x_origin_low %}
- {% set y_min = park_y_center %}
- {% elif park_y_origin_high < bed_y_max %}
- {% set x_min = park_x_center %}
- {% set y_min = park_y_origin_high %}
- {% elif park_x_origin_high < bed_x_max %}
- {% set x_min = park_x_origin_high %}
- {% set y_min = park_y_center %}
- {% else %}
- {% set x_min = 10 %}
- {% set y_min = 10 %}
- {% set z_height = 2 %}
- {% endif %}
- {% if verbose_enable == True %}
- RESPOND TYPE=command MSG="Smart Park location: {x_min},{y_min}"
- {% endif %}
- SAVE_GCODE_STATE NAME=Presmartpark_State
- G90
- {% if printer.toolhead.position.z < z_height %}
- G0 Z{z_height}
- {% endif %}
- G0 X{x_min} Y{y_min} F{travel_speed}
- G0 Z{z_height}
- RESTORE_GCODE_STATE NAME=Presmartpark_State
- [gcode_macro DEFINE_OBJECT]
- description = Needed macro for Exclude Objects
- gcode =
- EXCLUDE_OBJECT_DEFINE {rawparams}
- [gcode_macro START_CURRENT_OBJECT]
- description = Needed macro for Exclude Objects
- gcode =
- EXCLUDE_OBJECT_START NAME={params.NAME}
- [gcode_macro END_CURRENT_OBJECT]
- description = Needed macro for Exclude Objects
- gcode =
- EXCLUDE_OBJECT_END {% if params.NAME %}NAME={params.NAME}{% endif %}
- [gcode_macro LIST_OBJECTS]
- description = Needed macro for Exclude Objects
- gcode =
- EXCLUDE_OBJECT_DEFINE
- [gcode_macro LIST_EXCLUDED_OBJECTS]
- description = Needed macro for Exclude Objects
- gcode =
- EXCLUDE_OBJECT
- [gcode_macro REMOVE_ALL_EXCLUDED]
- description = Needed macro for Exclude Objects
- gcode =
- EXCLUDE_OBJECT RESET=1
- [gcode_macro _KAMP_Settings]
- description = This macro contains all adjustable settings for KAMP
- variable_verbose_enable = True
- variable_mesh_margin = 0
- variable_fuzz_amount = 0
- variable_purge_height = 0.8
- variable_tip_distance = 0
- variable_purge_margin = 10
- variable_purge_amount = 50
- variable_flow_rate = 12
- variable_smart_park_height = 10
- gcode =
- RESPOND TYPE=command MSG="Running the _KAMP_Settings macro does nothing, it's only used for storing KAMP settings."
- [gcode_shell_command Klipper_Backup]
- command = sh /usr/data/helper-script/files/scripts/useful_macros.sh -backup_klipper
- timeout = 600.0
- verbose = true
- [gcode_shell_command Klipper_Restore]
- command = sh /usr/data/helper-script/files/scripts/useful_macros.sh -restore_klipper
- timeout = 600.0
- verbose = true
- [gcode_shell_command Moonraker_Backup]
- command = sh /usr/data/helper-script/files/scripts/useful_macros.sh -backup_moonraker
- timeout = 600.0
- verbose = true
- [gcode_shell_command Moonraker_Restore]
- command = sh /usr/data/helper-script/files/scripts/useful_macros.sh -restore_moonraker
- timeout = 600.0
- verbose = true
- [gcode_shell_command Reload_Camera]
- command = sh /usr/data/helper-script/files/scripts/useful_macros.sh -reload_camera
- timeout = 600.0
- verbose = true
- [gcode_macro _KLIPPER_BACKUP]
- gcode =
- RUN_SHELL_COMMAND CMD=Klipper_Backup
- RESPOND TYPE=command MSG="action:prompt_end"
- [gcode_macro _KLIPPER_RESTORE]
- gcode =
- RUN_SHELL_COMMAND CMD=Klipper_Restore
- RESPOND TYPE=command MSG="action:prompt_end"
- [gcode_macro _MOONRAKER_BACKUP]
- gcode =
- RUN_SHELL_COMMAND CMD=Moonraker_Backup
- RESPOND TYPE=command MSG="action:prompt_end"
- [gcode_macro _MOONRAKER_RESTORE]
- gcode =
- RUN_SHELL_COMMAND CMD=Moonraker_Restore
- RESPOND TYPE=command MSG="action:prompt_end"
- [gcode_macro KLIPPER_BACKUP_CONFIG]
- description = Backup Klipper configuration files
- gcode =
- RESPOND TYPE=command MSG="action:prompt_begin Backup Klipper configuration files"
- RESPOND TYPE=command MSG="action:prompt_text Do you want to backup Klipper configuration files?"
- RESPOND TYPE=command MSG="action:prompt_footer_button CANCEL|RESPOND TYPE=command MSG="action:prompt_end"|error"
- RESPOND TYPE=command MSG="action:prompt_footer_button BACKUP|_KLIPPER_BACKUP|primary"
- RESPOND TYPE=command MSG="action:prompt_show"
- [gcode_macro KLIPPER_RESTORE_CONFIG]
- description = Restore Klipper configuration files
- gcode =
- RESPOND TYPE=command MSG="action:prompt_begin Restore Klipper configuration files"
- RESPOND TYPE=command MSG="action:prompt_text Do you want to restore Klipper configuration files?"
- RESPOND TYPE=command MSG="action:prompt_footer_button CANCEL|RESPOND TYPE=command MSG="action:prompt_end"|error"
- RESPOND TYPE=command MSG="action:prompt_footer_button RESTORE|_KLIPPER_RESTORE|primary"
- RESPOND TYPE=command MSG="action:prompt_show"
- [gcode_macro MOONRAKER_BACKUP_DATABASE]
- description = Backup Moonraker database
- gcode =
- RESPOND TYPE=command MSG="action:prompt_begin Backup Moonraker database"
- RESPOND TYPE=command MSG="action:prompt_text Do you want to backup Moonraker database?"
- RESPOND TYPE=command MSG="action:prompt_footer_button CANCEL|RESPOND TYPE=command MSG="action:prompt_end"|error"
- RESPOND TYPE=command MSG="action:prompt_footer_button BACKUP|_MOONRAKER_BACKUP|primary"
- RESPOND TYPE=command MSG="action:prompt_show"
- [gcode_macro MOONRAKER_RESTORE_DATABASE]
- description = Restore Moonraker database
- gcode =
- RESPOND TYPE=command MSG="action:prompt_begin Restore Moonraker database"
- RESPOND TYPE=command MSG="action:prompt_text Do you want to restore Moonraker database?"
- RESPOND TYPE=command MSG="action:prompt_footer_button CANCEL|RESPOND TYPE=command MSG="action:prompt_end"|error"
- RESPOND TYPE=command MSG="action:prompt_footer_button RESTORE|_MOONRAKER_RESTORE|primary"
- RESPOND TYPE=command MSG="action:prompt_show"
- [gcode_macro RELOAD_CAMERA]
- description = Reload camera service
- gcode =
- RUN_SHELL_COMMAND CMD=Reload_Camera
- [gcode_macro BED_LEVELING]
- description = Start Bed Leveling
- gcode =
- {% if 'PROBE_COUNT' in params|upper %}
- {% set get_count = ('PROBE_COUNT=' + params.PROBE_COUNT) %}
- {%else %}
- {% set get_count = "" %}
- {% endif %}
- {% set bed_temp = printer.custom_macro.default_bed_temp %}
- {% set extruder_temp = printer.custom_macro.g28_ext_temp %}
- {% set nozzle_clear_temp = printer.custom_macro.default_extruder_temp %}
- {% if 'BED_TEMP' in params|upper %}
- {% set bed_temp = params.BED_TEMP %}
- {% endif %}
- {% if 'EXTRUDER_TEMP' in params|upper %}
- {% set nozzle_clear_temp = params.EXTRUDER_TEMP %}
- {% endif %}
- SET_FILAMENT_SENSOR SENSOR=filament_sensor ENABLE=0
- SET_TEMPERATURE_FAN_TARGET TEMPERATURE_FAN=soc_fan TARGET=30
- M109 S140
- {% if printer.toolhead.homed_axes != "xyz" %}
- G28
- {% endif %}
- BED_MESH_CLEAR
- NOZZLE_CLEAR HOT_MIN_TEMP={hotend_temp} HOT_MAX_TEMP={nozzle_clear_temp} BED_MAX_TEMP={bed_temp}
- M204 S5000
- SET_VELOCITY_LIMIT ACCEL_TO_DECEL=5000
- BED_MESH_CALIBRATE {get_count}
- BED_MESH_OUTPUT
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement