Loaded MCU 'CB1' 112 commands (v0.12.0-132-ge37b007f / gcc: (Debian 10.2.1-6) 10.2.1 20210110 binutils: (GNU Binutils for Debian) 2.35.2) MCU 'CB1' config: ADC_MAX=4095 CLOCK_FREQ=50000000 MCU=linux PCA9685_MAX=4096 PWM_MAX=32768 STATS_SUMSQ_BASE=256 Configured MCU 'CB1' (1024 moves) Loaded MCU 'EBBCan' 108 commands (v0.12.0-132-ge37b007f / gcc: (15:8-2019-q3-1+b1) 8.3.1 20190703 (release) [gcc-8-branch revision 273027] binutils: (2.35.2-2+14+b2) 2.35.2) MCU 'EBBCan' config: ADC_MAX=4095 BUS_PINS_i2c1_PA9_PA10=PA9,PA10 BUS_PINS_i2c1_PB6_PB7=PB6,PB7 BUS_PINS_i2c1_PB8_PB9=PB8,PB9 BUS_PINS_i2c2_PB10_PB11=PB10,PB11 BUS_PINS_i2c2_PB13_PB14=PB13,PB14 BUS_PINS_i2c3_PB3_PB4=PB3,PB4 BUS_PINS_i2c3_PC0_PC1=PC0,PC1 BUS_PINS_spi1=PA6,PA7,PA5 BUS_PINS_spi1a=PB4,PB5,PB3 BUS_PINS_spi2=PB14,PB15,PB13 BUS_PINS_spi2a=PC2,PC3,PB10 BUS_PINS_spi3=PB4,PB5,PB3 CANBUS_FREQUENCY=1000000 CLOCK_FREQ=64000000 MCU=stm32g0b1xx PWM_MAX=255 RECEIVE_WINDOW=192 RESERVE_PINS_CAN=PB0,PB1 RESERVE_PINS_crystal=PF0,PF1 STATS_SUMSQ_BASE=256 STEPPER_BOTH_EDGE=1 Configured MCU 'EBBCan' (1024 moves) ===== Config file ===== [mcu] canbus_uuid = b983bbdcfe30 [mcu EBBCan] canbus_uuid = d8d5848615b3 [mcu CB1] serial = /tmp/klipper_host_mcu [printer] kinematics = corexy max_velocity = 500 max_accel = 10000 max_z_velocity = 50 max_z_accel = 500 [virtual_sdcard] path = /home/biqu/printer_data/gcodes on_error_gcode = CANCEL_PRINT [pause_resume] [display_status] [respond] [gcode_macro CANCEL_PRINT] description = Cancel the actual running print rename_existing = CANCEL_PRINT_BASE gcode = PRINT_END [gcode_macro PAUSE] description = Pause the actual running print rename_existing = PAUSE_BASE gcode = {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %} {% set idle_timeout = client.idle_timeout|default(0) %} {% set temp = printer[printer.toolhead.extruder].target if printer.toolhead.extruder != '' else 0 %} {% set restore = False if printer.toolhead.extruder == '' else True if params.RESTORE|default(1)|int == 1 else False %} SET_GCODE_VARIABLE MACRO=RESUME VARIABLE=last_extruder_temp VALUE="{{'restore': restore, 'temp': temp}}" {% if idle_timeout > 0 %} SET_GCODE_VARIABLE MACRO=RESUME VARIABLE=restore_idle_timeout VALUE={printer.configfile.settings.idle_timeout.timeout} SET_IDLE_TIMEOUT TIMEOUT={idle_timeout} {% endif %} PAUSE_BASE {client.user_pause_macro|default("")} _TOOLHEAD_PARK_PAUSE_CANCEL {rawparams} [gcode_macro RESUME] description = Resume the actual running print rename_existing = RESUME_BASE variable_last_extruder_temp = {'restore': False, 'temp': 0} variable_restore_idle_timeout = 0 variable_idle_state = False gcode = {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %} {% set velocity = printer.configfile.settings.pause_resume.recover_velocity %} {% set sp_move = client.speed_move|default(velocity) %} {% set runout_resume = True if client.runout_sensor|default("") == "" else True if not printer[client.runout_sensor].enabled else printer[client.runout_sensor].filament_detected %} {% set can_extrude = True if printer.toolhead.extruder == '' else printer[printer.toolhead.extruder].can_extrude %} {% set do_resume = False %} {% set prompt_txt = [] %} {% if printer.idle_timeout.state|upper == "IDLE" or idle_state %} SET_GCODE_VARIABLE MACRO=RESUME VARIABLE=idle_state VALUE=False {% if last_extruder_temp.restore %} RESPOND TYPE=echo MSG='{"Restoring \"%s\" temperature to %3.1f\u00B0C, this may take some time" % (printer.toolhead.extruder, last_extruder_temp.temp) }' M109 S{last_extruder_temp.temp} {% set do_resume = True %} {% elif can_extrude %} {% set do_resume = True %} {% else %} RESPOND TYPE=error MSG='{"Resume aborted !!! \"%s\" not hot enough, please heat up again and press RESUME" % printer.toolhead.extruder}' {% set _d = prompt_txt.append("\"%s\" not hot enough, please heat up again and press RESUME" % printer.toolhead.extruder) %} {% endif %} {% elif can_extrude %} {% set do_resume = True %} {% else %} RESPOND TYPE=error MSG='{"Resume aborted !!! \"%s\" not hot enough, please heat up again and press RESUME" % printer.toolhead.extruder}' {% set _d = prompt_txt.append("\"%s\" not hot enough, please heat up again and press RESUME" % printer.toolhead.extruder) %} {% endif %} {% if runout_resume %} {% if do_resume %} {% if restore_idle_timeout > 0 %} SET_IDLE_TIMEOUT TIMEOUT={restore_idle_timeout} {% endif %} {client.user_resume_macro|default("")} _CLIENT_EXTRUDE RESUME_BASE VELOCITY={params.VELOCITY|default(sp_move)} {% endif %} {% else %} RESPOND TYPE=error MSG='{"Resume aborted !!! \"%s\" detects no filament, please load filament and press RESUME" % (client.runout_sensor.split(" "))[1]}' {% set _d = prompt_txt.append("\"%s\" detects no filament, please load filament and press RESUME" % (client.runout_sensor.split(" "))[1]) %} {% endif %} {% if not (runout_resume and do_resume) %} RESPOND TYPE=command MSG="action:prompt_begin RESUME aborted !!!" {% for element in prompt_txt %} RESPOND TYPE=command MSG='{"action:prompt_text %s" % element}' {% endfor %} RESPOND TYPE=command MSG="action:prompt_footer_button Ok|RESPOND TYPE=command MSG=action:prompt_end|info" RESPOND TYPE=command MSG="action:prompt_show" {% endif %} [gcode_macro SET_PAUSE_NEXT_LAYER] description = Enable a pause if the next layer is reached gcode = {% set pause_next_layer = printer['gcode_macro SET_PRINT_STATS_INFO'].pause_next_layer %} {% set ENABLE = params.ENABLE|default(1)|int != 0 %} {% set MACRO = params.MACRO|default(pause_next_layer.call, True) %} SET_GCODE_VARIABLE MACRO=SET_PRINT_STATS_INFO VARIABLE=pause_next_layer VALUE="{{ 'enable': ENABLE, 'call': MACRO }}" [gcode_macro SET_PAUSE_AT_LAYER] description = Enable/disable a pause if a given layer number is reached gcode = {% set pause_at_layer = printer['gcode_macro SET_PRINT_STATS_INFO'].pause_at_layer %} {% set ENABLE = params.ENABLE|int != 0 if params.ENABLE is defined else params.LAYER is defined %} {% set LAYER = params.LAYER|default(pause_at_layer.layer)|int %} {% set MACRO = params.MACRO|default(pause_at_layer.call, True) %} SET_GCODE_VARIABLE MACRO=SET_PRINT_STATS_INFO VARIABLE=pause_at_layer VALUE="{{ 'enable': ENABLE, 'layer': LAYER, 'call': MACRO }}" [gcode_macro SET_PRINT_STATS_INFO] rename_existing = SET_PRINT_STATS_INFO_BASE description = Overwrite, to get pause_next_layer and pause_at_layer feature variable_pause_next_layer = { 'enable': False, 'call': "PAUSE" } variable_pause_at_layer = { 'enable': False, 'layer': 0, 'call': "PAUSE" } gcode = {% if pause_next_layer.enable %} RESPOND TYPE=echo MSG='{"%s, forced by pause_next_layer" % pause_next_layer.call}' {pause_next_layer.call} SET_PAUSE_NEXT_LAYER ENABLE=0 {% elif pause_at_layer.enable and params.CURRENT_LAYER is defined and params.CURRENT_LAYER|int == pause_at_layer.layer %} RESPOND TYPE=echo MSG='{"%s, forced by pause_at_layer [%d]" % (pause_at_layer.call, pause_at_layer.layer)}' {pause_at_layer.call} SET_PAUSE_AT_LAYER ENABLE=0 {% endif %} SET_PRINT_STATS_INFO_BASE {rawparams} [gcode_macro _TOOLHEAD_PARK_PAUSE_CANCEL] description = Helper: park toolhead used in PAUSE and CANCEL_PRINT gcode = {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %} {% set velocity = printer.configfile.settings.pause_resume.recover_velocity %} {% set use_custom = client.use_custom_pos|default(false)|lower == 'true' %} {% set custom_park_x = client.custom_park_x|default(0.0) %} {% set custom_park_y = client.custom_park_y|default(0.0) %} {% set park_dz = client.custom_park_dz|default(2.0)|abs %} {% set sp_hop = client.speed_hop|default(15) * 60 %} {% set sp_move = client.speed_move|default(velocity) * 60 %} {% set origin = printer.gcode_move.homing_origin %} {% set act = printer.gcode_move.gcode_position %} {% set max = printer.toolhead.axis_maximum %} {% set cone = printer.toolhead.cone_start_z|default(max.z) %} {% set round_bed = True if printer.configfile.settings.printer.kinematics is in ['delta','polar','rotary_delta','winch'] else False %} {% set z_min = params.Z_MIN|default(0)|float %} {% set z_park = [[(act.z + park_dz), z_min]|max, (max.z - origin.z)]|min %} {% set x_park = params.X if params.X is defined else custom_park_x if use_custom else 0.0 if round_bed else (max.x - 5.0) %} {% set y_park = params.Y if params.Y is defined else custom_park_y if use_custom else (max.y - 5.0) if round_bed and z_park < cone else 0.0 if round_bed else (max.y - 5.0) %} _CLIENT_RETRACT {% if "xyz" in printer.toolhead.homed_axes %} G90 G1 Z{z_park} F{sp_hop} G1 X{x_park} Y{y_park} F{sp_move} {% if not printer.gcode_move.absolute_coordinates %} G91 {% endif %} {% else %} RESPOND TYPE=echo MSG='Printer not homed' {% endif %} [gcode_macro _CLIENT_EXTRUDE] description = Extrudes, if the extruder is hot enough gcode = {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %} {% set use_fw_retract = (client.use_fw_retract|default(false)|lower == 'true') and (printer.firmware_retraction is defined) %} {% set length = params.LENGTH|default(client.unretract)|default(1.0)|float %} {% set speed = params.SPEED|default(client.speed_unretract)|default(35) %} {% set absolute_extrude = printer.gcode_move.absolute_extrude %} {% if printer.toolhead.extruder != '' %} {% if printer[printer.toolhead.extruder].can_extrude %} {% if use_fw_retract %} {% if length < 0 %} G10 {% else %} G11 {% endif %} {% else %} M83 G1 E{length} F{(speed|float|abs) * 60} {% if absolute_extrude %} M82 {% endif %} {% endif %} {% else %} RESPOND TYPE=echo MSG='{"\"%s\" not hot enough" % printer.toolhead.extruder}' {% endif %} {% endif %} [gcode_macro _CLIENT_RETRACT] description = Retracts, if the extruder is hot enough gcode = {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %} {% set length = params.LENGTH|default(client.retract)|default(1.0)|float %} {% set speed = params.SPEED|default(client.speed_retract)|default(35) %} _CLIENT_EXTRUDE LENGTH=-{length|float|abs} SPEED={speed|float|abs} [gcode_arcs] resolution = 1 [exclude_object] [gcode_macro AXES_MAP_CALIBRATION] gcode = {% set z_height = params.Z_HEIGHT|default(20)|int %} {% set speed = params.SPEED|default(80)|float * 60 %} {% set accel = params.ACCEL|default(1500)|int %} {% set feedrate_travel = params.TRAVEL_SPEED|default(120)|int * 60 %} {% set accel_chip = params.ACCEL_CHIP|default("adxl345") %} {% set mid_x = printer.toolhead.axis_maximum.x|float / 2 %} {% set mid_y = printer.toolhead.axis_maximum.y|float / 2 %} {% set accel = [accel, printer.configfile.settings.printer.max_accel]|min %} {% set old_accel = printer.toolhead.max_accel %} {% set old_cruise_ratio = printer.toolhead.minimum_cruise_ratio %} {% set old_sqv = printer.toolhead.square_corner_velocity %} {% if not 'xyz' in printer.toolhead.homed_axes %} { action_raise_error("Must Home printer first!") } {% endif %} {action_respond_info("")} {action_respond_info("Starting accelerometer axe_map calibration")} {action_respond_info("This operation can not be interrupted by normal means. Hit the \"emergency stop\" button to stop it if needed")} {action_respond_info("")} SAVE_GCODE_STATE NAME=STATE_AXESMAP_CALIBRATION G90 SET_VELOCITY_LIMIT ACCEL={accel} MINIMUM_CRUISE_RATIO=0 SQUARE_CORNER_VELOCITY={[(accel / 1000), 5.0]|max} G1 Z{z_height} F{feedrate_travel / 8} G1 X{mid_x - 15} Y{mid_y - 15} F{feedrate_travel} G4 P500 ACCELEROMETER_MEASURE CHIP={accel_chip} G4 P1000 G1 X{mid_x + 15} F{speed} G4 P1000 G1 Y{mid_y + 15} F{speed} G4 P1000 G1 Z{z_height + 15} F{speed} G4 P1000 ACCELEROMETER_MEASURE CHIP={accel_chip} NAME=axemap RESPOND MSG="Analysis of the movements..." RUN_SHELL_COMMAND CMD=shaketune PARAMS="--type axesmap --accel {accel|int} --chip_name {accel_chip}" SET_VELOCITY_LIMIT ACCEL={old_accel} MINIMUM_CRUISE_RATIO={old_cruise_ratio} SQUARE_CORNER_VELOCITY={old_sqv} RESTORE_GCODE_STATE NAME=STATE_AXESMAP_CALIBRATION [gcode_macro AXES_SHAPER_CALIBRATION] description = Perform standard axis input shaper tests on one or both XY axes to select the best input shaper filter gcode = {% set min_freq = params.FREQ_START|default(5)|float %} {% set max_freq = params.FREQ_END|default(133.3)|float %} {% set hz_per_sec = params.HZ_PER_SEC|default(1)|float %} {% set axis = params.AXIS|default("all")|string|lower %} {% set scv = params.SCV|default(None) %} {% set max_sm = params.MAX_SMOOTHING|default(None) %} {% set keep_results = params.KEEP_N_RESULTS|default(3)|int %} {% set keep_csv = params.KEEP_CSV|default(True) %} {% set X, Y = False, False %} {% if axis == "all" %} {% set X, Y = True, True %} {% elif axis == "x" %} {% set X = True %} {% elif axis == "y" %} {% set Y = True %} {% else %} { action_raise_error("AXIS selection invalid. Should be either all, x or y!") } {% endif %} {% if scv is none %} {% set scv = printer.toolhead.square_corner_velocity %} {% endif %} {% if X %} TEST_RESONANCES AXIS=X OUTPUT=raw_data NAME=x FREQ_START={min_freq} FREQ_END={max_freq} HZ_PER_SEC={hz_per_sec} M400 RESPOND MSG="X axis frequency profile generation..." RESPOND MSG="This may take some time (1-3min)" RUN_SHELL_COMMAND CMD=shaketune PARAMS="--type shaper --scv {scv} {% if max_sm is not none %}--max_smoothing {max_sm}{% endif %} {% if keep_csv %}--keep_csv{% endif %}" {% endif %} {% if Y %} TEST_RESONANCES AXIS=Y OUTPUT=raw_data NAME=y FREQ_START={min_freq} FREQ_END={max_freq} HZ_PER_SEC={hz_per_sec} M400 RESPOND MSG="Y axis frequency profile generation..." RESPOND MSG="This may take some time (1-3min)" RUN_SHELL_COMMAND CMD=shaketune PARAMS="--type shaper --scv {scv} {% if max_sm is not none %}--max_smoothing {max_sm}{% endif %} {% if keep_csv %}--keep_csv{% endif %}" {% endif %} M400 RUN_SHELL_COMMAND CMD=shaketune PARAMS="--type clean --keep_results {keep_results}" [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 = {% 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 keep_results = params.KEEP_N_RESULTS|default(3)|int %} {% set keep_csv = params.KEEP_CSV|default(True) %} 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 MSG="Belts comparative frequency profile generation..." RESPOND MSG="This may take some time (3-5min)" RUN_SHELL_COMMAND CMD=shaketune PARAMS="--type belts {% if keep_csv %}--keep_csv{% endif %}" M400 RUN_SHELL_COMMAND CMD=shaketune PARAMS="--type clean --keep_results {keep_results}" [gcode_macro EXCITATE_AXIS_AT_FREQ] description = Maintain a specified excitation frequency for a period of time to diagnose and locate a source of vibration 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 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 %} TEST_RESONANCES OUTPUT=raw_data AXIS={axis} FREQ_START={frequency-1} FREQ_END={frequency+1} HZ_PER_SEC={1/(time/3)} M400 [gcode_macro VIBRATIONS_CALIBRATION] gcode = {% set size = params.SIZE|default(60)|int %} {% set direction = params.DIRECTION|default('XY') %} {% set z_height = params.Z_HEIGHT|default(20)|int %} {% set min_speed = params.MIN_SPEED|default(20)|float * 60 %} {% set max_speed = params.MAX_SPEED|default(200)|float * 60 %} {% set speed_increment = params.SPEED_INCREMENT|default(2)|float * 60 %} {% set feedrate_travel = params.TRAVEL_SPEED|default(200)|int * 60 %} {% set accel = params.ACCEL|default(3000)|int %} {% set accel_chip = params.ACCEL_CHIP|default("adxl345") %} {% set keep_results = params.KEEP_N_RESULTS|default(3)|int %} {% set keep_csv = params.KEEP_CSV|default(True) %} {% set mid_x = printer.toolhead.axis_maximum.x|float / 2 %} {% set mid_y = printer.toolhead.axis_maximum.y|float / 2 %} {% set nb_samples = ((max_speed - min_speed) / speed_increment + 1) | int %} {% set accel = [accel, printer.configfile.settings.printer.max_accel]|min %} {% set old_accel = printer.toolhead.max_accel %} {% set old_cruise_ratio = printer.toolhead.minimum_cruise_ratio %} {% set old_sqv = printer.toolhead.square_corner_velocity %} {% set direction_factor = { 'XY' : { 'start' : {'x': -0.5, 'y': -0.5 }, 'move_factors' : { '0' : {'x': 0.5, 'y': -0.5, 'z': 0.0 }, '1' : {'x': 0.5, 'y': 0.5, 'z': 0.0 }, '2' : {'x': -0.5, 'y': 0.5, 'z': 0.0 }, '3' : {'x': -0.5, 'y': -0.5, 'z': 0.0 } } }, 'AB' : { 'start' : {'x': 0.0, 'y': 0.0 }, 'move_factors' : { '0' : {'x': 0.5, 'y': -0.5, 'z': 0.0 }, '1' : {'x': -0.5, 'y': 0.5, 'z': 0.0 }, '2' : {'x': 0.0, 'y': 0.0, 'z': 0.0 }, '3' : {'x': 0.5, 'y': 0.5, 'z': 0.0 }, '4' : {'x': -0.5, 'y': -0.5, 'z': 0.0 }, '5' : {'x': 0.0, 'y': 0.0, 'z': 0.0 } } }, 'ABXY' : { 'start' : {'x': -0.5, 'y': 0.5 }, 'move_factors' : { '0' : {'x': -0.5, 'y': -0.5, 'z': 0.0 }, '1' : {'x': 0.5, 'y': -0.5, 'z': 0.0 }, '2' : {'x': -0.5, 'y': 0.5, 'z': 0.0 }, '3' : {'x': 0.5, 'y': 0.5, 'z': 0.0 }, '4' : {'x': -0.5, 'y': -0.5, 'z': 0.0 }, '5' : {'x': -0.5, 'y': 0.5, 'z': 0.0 } } }, 'B' : { 'start' : {'x': 0.5, 'y': 0.5 }, 'move_factors' : { '0' : {'x': -0.5, 'y': -0.5, 'z': 0.0 }, '1' : {'x': 0.5, 'y': 0.5, 'z': 0.0 } } }, 'A' : { 'start' : {'x': -0.5, 'y': 0.5 }, 'move_factors' : { '0' : {'x': 0.5, 'y': -0.5, 'z': 0.0 }, '1' : {'x': -0.5, 'y': 0.5, 'z': 0.0 } } }, 'X' : { 'start' : {'x': -0.5, 'y': 0.0 }, 'move_factors' : { '0' : {'x': 0.5, 'y': 0.0, 'z': 0.0 }, '1' : {'x': -0.5, 'y': 0.0, 'z': 0.0 } } }, 'Y' : { 'start' : {'x': 0.0, 'y': 0.5 }, 'move_factors' : { '0' : {'x': 0.0, 'y': -0.5, 'z': 0.0 }, '1' : {'x': 0.0, 'y': 0.5, 'z': 0.0 } } }, 'Z' : { 'start' : {'x': 0.0, 'y': 0.0 }, 'move_factors' : { '0' : {'x': 0.0, 'y': 0.0, 'z': 1.0 }, '1' : {'x': 0.0, 'y': 0.0, 'z': 0.0 } } }, 'E' : { 'start' : {'x': 0.0, 'y': 0.0 }, 'move_factor' : 0.05 } } %} {% if not 'xyz' in printer.toolhead.homed_axes %} { action_raise_error("Must Home printer first!") } {% endif %} {% if params.SPEED_INCREMENT|default(2)|float * 100 != (params.SPEED_INCREMENT|default(2)|float * 100)|int %} { action_raise_error("Only 2 decimal digits are allowed for SPEED_INCREMENT") } {% endif %} {% if (size / (max_speed / 60)) < 0.25 and direction != 'E' %} { action_raise_error("SIZE is too small for this MAX_SPEED. Increase SIZE or decrease MAX_SPEED!") } {% endif %} {% if not (direction in direction_factor) %} { action_raise_error("DIRECTION is not valid. Only XY, AB, ABXY, A, B, X, Y, Z or E is allowed!") } {% endif %} {action_respond_info("")} {action_respond_info("Starting speed and vibration calibration")} {action_respond_info("This operation can not be interrupted by normal means. Hit the \"emergency stop\" button to stop it if needed")} {action_respond_info("")} SAVE_GCODE_STATE NAME=STATE_VIBRATIONS_CALIBRATION G90 SET_VELOCITY_LIMIT ACCEL={accel} MINIMUM_CRUISE_RATIO=0 SQUARE_CORNER_VELOCITY={[(accel / 1000), 5.0]|max} G1 Z{z_height} F{feedrate_travel / 10} G1 X{mid_x + (size * direction_factor[direction].start.x) } Y{mid_y + (size * direction_factor[direction].start.y)} F{feedrate_travel} {% for curr_sample in range(0, nb_samples) %} {% set curr_speed = min_speed + curr_sample * speed_increment %} RESPOND MSG="{"Current speed: %.2f mm/s" % (curr_speed / 60)|float}" ACCELEROMETER_MEASURE CHIP={accel_chip} {% if direction == 'E' %} G0 E{curr_speed*direction_factor[direction].move_factor} F{curr_speed} {% else %} {% for key, factor in direction_factor[direction].move_factors|dictsort %} G1 X{mid_x + (size * factor.x) } Y{mid_y + (size * factor.y)} Z{z_height + (size * factor.z)} F{curr_speed} {% endfor %} {% endif %} ACCELEROMETER_MEASURE CHIP={accel_chip} NAME=sp{("%.2f" % (curr_speed / 60)|float)|replace('.','_')}n1 G4 P300 M400 {% endfor %} RESPOND MSG="Machine and motors vibration graph generation..." RESPOND MSG="This may take some time (3-5min)" RUN_SHELL_COMMAND CMD=shaketune PARAMS="--type vibrations --axis_name {direction} --accel {accel|int} --chip_name {accel_chip} {% if keep_csv %}--keep_csv{% endif %}" M400 RUN_SHELL_COMMAND CMD=shaketune PARAMS="--type clean --keep_results {keep_results}" SET_VELOCITY_LIMIT ACCEL={old_accel} MINIMUM_CRUISE_RATIO={old_cruise_ratio} SQUARE_CORNER_VELOCITY={old_sqv} RESTORE_GCODE_STATE NAME=STATE_VIBRATIONS_CALIBRATION [gcode_shell_command shaketune] command = ~/printer_data/config/K-ShakeTune/scripts/shaketune.sh timeout = 600.0 verbose = True [stepper_x] step_pin = PE6 dir_pin = !PE5 enable_pin = multi_pin:z_enable microsteps = 16 rotation_distance = 32 endstop_pin = EBBCan: PB6 position_endstop = 0 position_max = 315 homing_speed = 50 [stepper_y] step_pin = PE2 dir_pin = !PE1 enable_pin = !PE4 microsteps = 16 rotation_distance = 32 endstop_pin = ^PF3 position_endstop = 300 position_max = 300 homing_speed = 50 [stepper_z] step_pin = PB8 dir_pin = PB7 enable_pin = !PE0 microsteps = 16 rotation_distance = 32 endstop_pin = probe:z_virtual_endstop position_max = 230 position_min = -5.0 homing_speed = 20 second_homing_speed = 10 homing_retract_dist = 5 [stepper_z1] step_pin = PB4 dir_pin = !PB3 enable_pin = !PB6 microsteps = 16 rotation_distance = 32 [stepper_z2] step_pin = PG13 dir_pin = !PG12 enable_pin = !PG15 microsteps = 16 rotation_distance = 32 [extruder] step_pin = EBBCan: PD0 dir_pin = EBBCan: PD1 enable_pin = !EBBCan: PD2 microsteps = 16 rotation_distance = 3.43 nozzle_diameter = 0.600 filament_diameter = 1.750 heater_pin = EBBCan: PB13 sensor_type = EPCOS 100K B57560G104F sensor_pin = EBBCan: PA3 min_temp = 0 max_temp = 250 max_extrude_cross_section = 250 max_extrude_only_distance = 250 control = pid pid_kp = 16.610 pid_ki = 0.527 pid_kd = 130.805 [tmc5160 stepper_x] cs_pin = PC13 spi_software_mosi_pin = PG6 spi_software_miso_pin = PG7 spi_software_sclk_pin = PG8 run_current = 1.400 [tmc5160 stepper_y] cs_pin = PE3 spi_software_mosi_pin = PG6 spi_software_miso_pin = PG7 spi_software_sclk_pin = PG8 run_current = 1.400 [tmc2209 stepper_z] uart_pin = PB9 run_current = 0.850 stealthchop_threshold = 999999 [tmc2209 stepper_z1] uart_pin = PB5 run_current = 0.850 stealthchop_threshold = 999999 [tmc2209 stepper_z2] uart_pin = PG14 run_current = 0.850 stealthchop_threshold = 999999 [tmc2209 extruder] uart_pin = EBBCan: PA15 run_current = 0.650 [multi_pin z_enable] pins = !PC14, PA5 [heater_bed] heater_pin = PA0 sensor_type = ATC Semitec 104GT-2 sensor_pin = PB1 control = pid pid_kp = 54.027 pid_ki = 0.770 pid_kd = 948.182 min_temp = 0 max_temp = 130 [fan] pin = EBBCan: PA1 [heater_fan hotend_fan] pin = EBBCan: PA0 heater = extruder heater_temp = 50.0 [controller_fan tmc_fan] pin = PF7 stepper = stepper_x [temperature_fan CB1] pin = PF8 sensor_type = temperature_host min_temp = 10 max_temp = 90 control = pid pid_kp = 2 pid_ki = 4 pid_kd = 0.1 [temperature_sensor mcu_temp] sensor_type = temperature_mcu min_temp = 0 max_temp = 100 [temperature_sensor EBB_Temperature] sensor_type = temperature_mcu sensor_mcu = EBBCan [temperature_sensor bed_top] sensor_type = EPCOS 100K B57560G104F sensor_pin = PB0 [bltouch] sensor_pin = ^EBBCan:PB8 control_pin = EBBCan:PB9 stow_on_each_sample = false probe_with_touch_mode = true x_offset = 55 y_offset = 0 speed = 10 lift_speed = 20 samples = 2 samples_tolerance_retries = 4 z_offset = 1.200 [idle_timeout] timeout = 960000 [filament_switch_sensor switch_sensor] switch_pin = ^PF0 pause_on_runout = false runout_gcode = PAUSE [filament_motion_sensor motion_sensor] switch_pin = ^PC15 detection_length = 4 extruder = extruder pause_on_runout = false runout_gcode = PAUSE [neopixel outside] pin = CB1: gpio259 chain_count = 79 color_order = GRB initial_red = 0.5 initial_green = 0.5 initial_blue = 0.5 [neopixel back] pin = PD15 chain_count = 29 color_order = GRB initial_red = 0.5 initial_green = 0.5 initial_blue = 0.5 [z_tilt] z_positions = 0, 25 300, 25 150, 300 points = 0, 20 245, 20 95, 295 speed = 125 horizontal_move_z = 10 retries = 8 retry_tolerance = 0.01 [bed_mesh] speed = 125 horizontal_move_z = 10 mesh_min = 55, 10 mesh_max = 245,290 probe_count = 5, 5 algorithm = bicubic bicubic_tension = 0.2 fade_start = 1 fade_end = 10 fade_target = 0 [safe_z_home] home_xy_position = 100, 150 speed = 150 [input_shaper] shaper_freq_x = 83.8 shaper_type_x = mzv shaper_freq_y = 65.2 shaper_type_y = mzv [adxl345] cs_pin = EBBCan: PB12 spi_software_sclk_pin = EBBCan: PB10 spi_software_mosi_pin = EBBCan: PB11 spi_software_miso_pin = EBBCan: PB2 axes_map = x,y,z [resonance_tester] accel_chip = adxl345 probe_points = 160, 150, 50 [gcode_macro PRINT_START] gcode = {% set BED = params.BED_TEMP|int %} {% set EXTRUDER = params.EXTRUDER_TEMP|int %} M140 S{BED} M104 S{EXTRUDER} G28 Z_TILT_ADJUST BED_MESH_CALIBRATE _ADAPTIVE_PURGE_V1 [gcode_macro Z_TILT_ADJUST] rename_existing = Z_TILT_ADJUST_1 gcode = {% if printer["gcode_macro status_leveling"] != null %} status_leveling {% endif %} Z_TILT_ADJUST_1 { rawparams } {% if printer["gcode_macro status_ready"] != null %} status_ready {% endif %} [gcode_macro BED_MESH_CALIBRATE] rename_existing = _BED_MESH_CALIBRATE variable_buffer = 2 gcode = {% set bedMeshConfig = printer['configfile'].config["bed_mesh"] %} {% set bed_mesh_min = bedMeshConfig.mesh_min %} {% set bed_mesh_max = bedMeshConfig.mesh_max %} {% set all_points = printer.exclude_object.objects | map(attribute='polygon') | sum(start=[]) %} {% 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]) %} {% if printer["bed_mesh"].profile_name == '' %} { action_respond_info("No existing bed mesh found.") } {% set last_area_end_x=-1 %} {% endif %} {% if printer.toolhead.homed_axes != "xyz" %} G28 {% endif %} {% set klicky_available = printer['gcode_macro _Probe_Variables'] != null %} {% set probeConfig = printer['configfile'].config["probe"] %} {% if probeConfig %} {% set OffsetX = probeConfig.x_offset|default(0)|float %} {% set OffsetY = probeConfig.y_offset|default(0)|float %} {% endif %} {% set print_min_x = x_min|float %} {% set print_min_y = y_min|float %} {% set print_max_x = x_max|float %} {% set print_max_y = y_max|float %} {% set mesh_min_x = bed_mesh_min.split(",")[0]|float %} {% set mesh_min_y = bed_mesh_min.split(",")[1]|float %} {% set mesh_max_x = bed_mesh_max.split(",")[0]|float %} {% set mesh_max_y = bed_mesh_max.split(",")[1]|float %} {% if (print_min_x < mesh_min_x) or (print_max_x > mesh_max_x) or (print_min_y < mesh_min_y) or (print_max_y > mesh_max_y) %} {% set print_min_x = mesh_min_x %} {% set print_min_y = mesh_min_y %} {% set print_max_x = mesh_max_x %} {% set print_max_y = mesh_max_y %} {% endif %} {% if klicky_available %} _CheckProbe action=query Attach_Probe {% elif euclid_available %} DEPLOY_PROBE {% endif %} {% if (print_min_x < print_max_x) and (print_min_y < print_max_y) %} {% set minimum_probe_count = 3 %} {% set medium_probe_count = 5 %} {% set probe_count = bedMeshConfig.probe_count.split(",") %} {% set probe_count_x = probe_count[0]|int %} {% if probe_count.__len__() > 1 %} {% set probe_count_y = probe_count[1]|int %} {% else %} {% set probe_count_y = probe_count_x|int %} {% endif %} {% set relative_reference_index = bedMeshConfig.relative_reference_index %} {% if print_max_x - print_min_x < (mesh_max_x - mesh_min_x) * 0.75 %} {% set probe_count_x = medium_probe_count %} {% endif %} {% if print_max_y - print_min_y < (mesh_max_y - mesh_min_y) * 0.75 %} {% set probe_count_y = medium_probe_count %} {% endif %} {% if print_max_x - print_min_x < (mesh_max_x - mesh_min_x) * 0.50 %} {% set probe_count_x = minimum_probe_count %} {% endif %} {% if print_max_y - print_min_y < (mesh_max_y - mesh_min_y) * 0.50 %} {% set probe_count_y = minimum_probe_count %} {% endif %} {% if print_min_x - buffer >= mesh_min_x %} {% set mesh_min_x = print_min_x - buffer %} {% endif %} {% if print_min_y - buffer >= mesh_min_y %} {% set mesh_min_y = print_min_y - buffer %} {% endif %} {% if print_max_x + buffer <= mesh_max_x %} {% set mesh_max_x = print_max_x + buffer %} {% endif %} {% if print_max_y + buffer <= mesh_max_y %} {% set mesh_max_y = print_max_y + buffer %} {% endif %} { action_respond_info("mesh_min: %s,%s" % (mesh_min_x, mesh_min_y)) } { action_respond_info("mesh_max: %s,%s" % (mesh_max_x, mesh_max_y)) } { action_respond_info("probe_count: %s,%s" % (probe_count_x,probe_count_y)) } {% if printer["gcode_macro status_meshing"] != null %} status_meshing {% endif %} {% if relative_reference_index == 0 or relative_reference_index == null %} _BED_MESH_CALIBRATE mesh_min={mesh_min_x},{mesh_min_y} mesh_max={mesh_max_x},{mesh_max_y} probe_count={probe_count_x},{probe_count_y} {% else %} {% set relative_reference_index = ((probe_count_x * probe_count_y - 1) / 2)|int %} { action_respond_info("relative_reference_index: %s" % relative_reference_index) } _BED_MESH_CALIBRATE mesh_min={mesh_min_x},{mesh_min_y} mesh_max={mesh_max_x},{mesh_max_y} probe_count={probe_count_x},{probe_count_y} relative_reference_index={relative_reference_index} {% endif %} {% else %} {% if printer["gcode_macro status_meshing"] != null %} status_meshing {% endif %} _BED_MESH_CALIBRATE {% endif %} {% if klicky_available %} Dock_Probe {% elif euclid_available %} STOW_PROBE {% endif %} {% if printer["gcode_macro status_ready"] != null %} status_ready {% endif %} [gcode_macro _ADAPTIVE_PURGE_V1] description = A purge macro that adapts to be near your actual printed objects variable_adaptive_enable = True variable_z_height = 0.3 variable_tip_distance = 10 variable_purge_amount = 30 variable_flow_rate = 10 variable_x_default = 5 variable_y_default = 5 variable_size = 16 variable_distance_to_object_x = 7 variable_distance_to_object_y = 7 gcode = {% if adaptive_enable == True %} {% set all_points = printer.exclude_object.objects | map(attribute='polygon') | sum(start=[]) %} {% set x_origin = (all_points | map(attribute=0) | min | default(x_default + distance_to_object_x + size)) - distance_to_object_x - size %} {% set y_origin = (all_points | map(attribute=1) | min | default(y_default + distance_to_object_y + size)) - distance_to_object_y - size %} {% set x_origin = ([x_origin, 0] | max) %} {% set y_origin = ([y_origin, 0] | max) %} {% if x_origin < x_default %} set x_origin = x_default | float {% endif %} {% if y_origin < y_default %} set y_origin = y_default | float {% endif %} {% else %} {% set x_origin = x_default | float %} {% set y_origin = y_default | float %} {% endif %} {% set purge_move_speed = 2.31 * size * flow_rate / (purge_amount * 2.405) %} {% set prepurge_speed = flow_rate / 2.405 %} {% set travel_speed = printer.toolhead.max_velocity %} { action_respond_info( "x: " + x_origin|string + " y: " + y_origin|string + " purge_move_speed: " + purge_move_speed|string + " prepurge_speed: " + prepurge_speed|string ) } G92 E0 G90 G0 X{x_origin} Y{y_origin+size/2} F3000 G0 Z{z_height} F1500 G0 F3000 M83 G1 E{tip_distance} F{prepurge_speed*60} G1 F600 G1 X{x_origin+size*0.1976875} Y{y_origin+size*0.0538125} E{purge_amount*0.00362396204033215} G1 X{x_origin+size*0.2070625} Y{y_origin+size*0.056375} E{purge_amount*0.00348517200474496} G1 X{x_origin+size*0.273} Y{y_origin+size*0.0889375} E{purge_amount*0.0253226571767497} G1 X{x_origin+size*0.3568125} Y{y_origin+size*0.125125} E{purge_amount*0.0313760379596679} G1 X{x_origin+size*0.442375} Y{y_origin+size*0.1563125} E{purge_amount*0.0312455516014235} G1 X{x_origin+size*0.5295625} Y{y_origin+size*0.1825} E{purge_amount*0.0311731909845789} G1 X{x_origin+size*0.5311875} Y{y_origin+size*0.1829375} E{purge_amount*0.000575326215895611} G1 X{x_origin+size*0.6196875} Y{y_origin+size*0.2038125} E{purge_amount*0.0311376037959668} G1 X{x_origin+size*0.7093125} Y{y_origin+size*0.219625} E{purge_amount*0.0312253855278766} G1 X{x_origin+size*0.799875} Y{y_origin+size*0.2301875} E{purge_amount*0.0313368920521945} G1 X{x_origin+size*0.8735625} Y{y_origin+size*0.2349375} E{purge_amount*0.0254270462633452} G1 X{x_origin+size*0.8824375} Y{y_origin+size*0.237} E{purge_amount*0.00326809015421115} G1 X{x_origin+size*0.8913125} Y{y_origin+size*0.2390625} E{purge_amount*0.00339739027283511} G1 X{x_origin+size*0.8959375} Y{y_origin+size*0.2481875} E{purge_amount*0.00381494661921708} G1 X{x_origin+size*0.9005} Y{y_origin+size*0.257375} E{purge_amount*0.00366548042704626} G1 X{x_origin+size*0.951125} Y{y_origin+size*0.4463125} E{purge_amount*0.0668623962040332} G1 X{x_origin+size*0.9521875} Y{y_origin+size*0.4540625} E{purge_amount*0.00276156583629893} G1 X{x_origin+size*0.9531875} Y{y_origin+size*0.46175} E{purge_amount*0.00282443653618031} G1 X{x_origin+size*0.9528125} Y{y_origin+size*0.4654375} E{purge_amount*0.00138078291814947} G1 X{x_origin+size*0.9458125} Y{y_origin+size*0.4720625} E{purge_amount*0.00359193357058126} G1 X{x_origin+size*0.9388125} Y{y_origin+size*0.4786875} E{purge_amount*0.00342467378410439} G1 X{x_origin+size*0.9145625} Y{y_origin+size*0.4951875} E{purge_amount*0.00993950177935943} G1 X{x_origin+size*0.8395} Y{y_origin+size*0.547875} E{purge_amount*0.0316453143534994} G1 X{x_origin+size*0.7680625} Y{y_origin+size*0.6045} E{purge_amount*0.0314733096085409} G1 X{x_origin+size*0.700125} Y{y_origin+size*0.665125} E{purge_amount*0.0314483985765125} G1 X{x_origin+size*0.6358125} Y{y_origin+size*0.7295} E{purge_amount*0.0314317912218268} G1 X{x_origin+size*0.5755625} Y{y_origin+size*0.7971875} E{purge_amount*0.0312977461447212} G1 X{x_origin+size*0.5465} Y{y_origin+size*0.8325625} E{purge_amount*0.0155836298932384} G1 X{x_origin+size*0.492125} Y{y_origin+size*0.9056875} E{purge_amount*0.0313190984578885} G1 X{x_origin+size*0.451125} Y{y_origin+size*0.967125} E{purge_amount*0.0254341637010676} G1 X{x_origin+size*0.444625} Y{y_origin+size*0.9739375} E{purge_amount*0.00337959667852906} G1 X{x_origin+size*0.4380625} Y{y_origin+size*0.98075} E{purge_amount*0.00353262158956109} G1 X{x_origin+size*0.428125} Y{y_origin+size*0.98} E{purge_amount*0.00372123368920522} G1 X{x_origin+size*0.41825} Y{y_origin+size*0.97925} E{purge_amount*0.00354211150652432} G1 X{x_origin+size*0.22925} Y{y_origin+size*0.928625} E{purge_amount*0.0668837485172005} G1 X{x_origin+size*0.2204375} Y{y_origin+size*0.924125} E{purge_amount*0.00351601423487545} G1 X{x_origin+size*0.2115625} Y{y_origin+size*0.919625} E{purge_amount*0.00366903914590747} G1 X{x_origin+size*0.2091875} Y{y_origin+size*0.910625} E{purge_amount*0.00343179122182681} G1 X{x_origin+size*0.2068125} Y{y_origin+size*0.9016875} E{purge_amount*0.00329774614472123} G1 X{x_origin+size*0.2020625} Y{y_origin+size*0.82825} E{purge_amount*0.0253404507710558} G1 X{x_origin+size*0.1915} Y{y_origin+size*0.737625} E{purge_amount*0.0313582443653618} G1 X{x_origin+size*0.17575} Y{y_origin+size*0.6479375} E{purge_amount*0.0312431791221827} G1 X{x_origin+size*0.154875} Y{y_origin+size*0.5593125} E{purge_amount*0.0311791221826809} G1 X{x_origin+size*0.1544375} Y{y_origin+size*0.5576875} E{purge_amount*0.000575326215895611} G1 X{x_origin+size*0.12825} Y{y_origin+size*0.470625} E{purge_amount*0.0311328588374852} G1 X{x_origin+size*0.0970625} Y{y_origin+size*0.385125} E{purge_amount*0.0312253855278766} G1 X{x_origin+size*0.061} Y{y_origin+size*0.3014375} E{purge_amount*0.0313190984578885} G1 X{x_origin+size*0.02825} Y{y_origin+size*0.2351875} E{purge_amount*0.0254483985765125} G1 X{x_origin+size*0.025625} Y{y_origin+size*0.226125} E{purge_amount*0.00338671411625148} G1 X{x_origin+size*0.023} Y{y_origin+size*0.2170625} E{purge_amount*0.00352313167259787} G1 X{x_origin+size*0.028625} Y{y_origin+size*0.208875} E{purge_amount*0.00370937129300119} G1 X{x_origin+size*0.03425} Y{y_origin+size*0.200625} E{purge_amount*0.003570581257414} G1 X{x_origin+size*0.1725625} Y{y_origin+size*0.0623125} E{purge_amount*0.0668623962040332} G1 X{x_origin+size*0.1804375} Y{y_origin+size*0.0568125} E{purge_amount*0.00343297746144721} G1 X{x_origin+size*0.18375} Y{y_origin+size*0.0545} E{purge_amount*0.00150652431791222} G92 E0 M82 G0 Z{z_height*2} {% if printer["gcode_macro status_printing"] != null %} status_printing {% endif %} [gcode_macro PRINT_END] gcode = M400 TURN_OFF_HEATERS M106 S0 PARK_CENTER_REAR G0 Z230 F3000 [gcode_macro PARK_CENTER_REAR] gcode = {% if printer["gcode_macro status_busy"] != null %} status_busy {% endif %} {% set th = printer.toolhead %} {% set x_safe = th.position.x + 20 * (1 if th.axis_maximum.x - th.position.x > 20 else -1) %} {% set y_safe = th.position.y + 20 * (1 if th.axis_maximum.y - th.position.y > 20 else -1) %} G0 X{th.axis_maximum.x//2} Y{th.axis_maximum.y - 2} F3600 {% if printer["gcode_macro status_ready"] != null %} status_ready {% endif %} [gcode_macro TEST_SPEED] gcode = G0 Z10 {% set speed = params.SPEED|default(printer.configfile.settings.printer.max_velocity)|int %} {% set iterations = params.ITERATIONS|default(5)|int %} {% set accel = params.ACCEL|default(printer.configfile.settings.printer.max_accel)|int %} {% set bound = params.BOUND|default(20)|int %} {% set smallpatternsize = SMALLPATTERNSIZE|default(20)|int %} {% set x_min = printer.toolhead.axis_minimum.x + bound %} {% set x_max = printer.toolhead.axis_maximum.x - bound %} {% set y_min = printer.toolhead.axis_minimum.y + bound %} {% set y_max = printer.toolhead.axis_maximum.y - bound %} {% set x_center = (printer.toolhead.axis_minimum.x|float + printer.toolhead.axis_maximum.x|float ) / 2 %} {% set y_center = (printer.toolhead.axis_minimum.y|float + printer.toolhead.axis_maximum.y|float ) / 2 %} {% set x_center_min = x_center - (smallpatternsize/2) %} {% set x_center_max = x_center + (smallpatternsize/2) %} {% set y_center_min = y_center - (smallpatternsize/2) %} {% set y_center_max = y_center + (smallpatternsize/2) %} SAVE_GCODE_STATE NAME=TEST_SPEED { action_respond_info("TEST_SPEED: starting %d iterations at speed %d, accel %d" % (iterations, speed, accel)) } M400 G28 {% if printer.configfile.settings.quad_gantry_level %} {% if printer.quad_gantry_level.applied == False %} QUAD_GANTRY_LEVEL G28 Z {% endif %} {% endif %} G90 G1 X{printer.toolhead.axis_maximum.x-50} Y{printer.toolhead.axis_maximum.y-50} F{30*60} M400 G28 X Y G0 X{printer.toolhead.axis_maximum.x-1} Y{printer.toolhead.axis_maximum.y-1} F{30*60} G4 P1000 GET_POSITION G0 X{x_min} Y{y_min} Z{bound + 10} F{speed*60} SET_VELOCITY_LIMIT VELOCITY={speed} ACCEL={accel} ACCEL_TO_DECEL={accel / 2} {% for i in range(iterations) %} G0 X{x_min} Y{y_min} F{speed*60} G0 X{x_max} Y{y_max} F{speed*60} G0 X{x_min} Y{y_min} F{speed*60} G0 X{x_max} Y{y_min} F{speed*60} G0 X{x_min} Y{y_max} F{speed*60} G0 X{x_max} Y{y_min} F{speed*60} G0 X{x_min} Y{y_min} F{speed*60} G0 X{x_min} Y{y_max} F{speed*60} G0 X{x_max} Y{y_max} F{speed*60} G0 X{x_max} Y{y_min} F{speed*60} G0 X{x_center_min} Y{y_center_min} F{speed*60} G0 X{x_center_max} Y{y_center_max} F{speed*60} G0 X{x_center_min} Y{y_center_min} F{speed*60} G0 X{x_center_max} Y{y_center_min} F{speed*60} G0 X{x_center_min} Y{y_center_max} F{speed*60} G0 X{x_center_max} Y{y_center_min} F{speed*60} G0 X{x_center_min} Y{y_center_min} F{speed*60} G0 X{x_center_min} Y{y_center_max} F{speed*60} G0 X{x_center_max} Y{y_center_max} F{speed*60} G0 X{x_center_max} Y{y_center_min} F{speed*60} {% endfor %} SET_VELOCITY_LIMIT VELOCITY={printer.configfile.settings.printer.max_velocity} ACCEL={printer.configfile.settings.printer.max_accel} M400 G28 G90 G0 X{printer.toolhead.axis_maximum.x-1} Y{printer.toolhead.axis_maximum.y-1} F{30*60} G4 P1000 GET_POSITION RESTORE_GCODE_STATE NAME=TEST_SPEED [led_effect progress_bar] leds = neopixel:back autostart = true frame_rate = 24 layers = progress -1 0 add ( 0, 0, 1),( 0, 0.1, 0.6) static 0 0 top ( 0, 0, 0.1) [gcode_macro update_git] gcode = {% set message = params.MESSAGE|default() %} {% if message %} RUN_SHELL_COMMAND CMD=update_git_script_message PARAMS="'{params.MESSAGE}'" {% else %} RUN_SHELL_COMMAND CMD=update_git_script {% endif %} [gcode_shell_command update_git_script] command = bash -c "bash $HOME/klipper-backup/script.sh" timeout = 90.0 verbose = True [gcode_shell_command update_git_script_message] command = bash -c "bash $HOME/klipper-backup/script.sh $0" timeout = 90.0 verbose = True [bed_mesh default] version = 1 points = -0.026610, 0.013390, 0.018390, 0.013390, 0.048390 0.133390, 0.118390, 0.073390, 0.048390, 0.048390 0.298390, 0.243390, 0.198390, 0.153390, 0.123390 0.328390, 0.273390, 0.208390, 0.168390, 0.118390 0.118390, 0.078390, 0.028390, -0.001610, -0.016610 x_count = 5 y_count = 5 mesh_x_pps = 2 mesh_y_pps = 2 algo = bicubic tension = 0.2 min_x = 55.0 max_x = 245.0 min_y = 10.0 max_y = 290.0 ======================= Loaded MCU 'mcu' 108 commands (v0.12.0-132-ge37b007f / gcc: (15:8-2019-q3-1+b1) 8.3.1 20190703 (release) [gcc-8-branch revision 273027] binutils: (2.35.2-2+14+b2) 2.35.2) MCU 'mcu' config: ADC_MAX=4095 BUS_PINS_i2c1_PB6_PB7=PB6,PB7 BUS_PINS_i2c1_PB8_PB9=PB8,PB9 BUS_PINS_i2c2_PB10_PB11=PB10,PB11 BUS_PINS_spi1=PA6,PA7,PA5 BUS_PINS_spi1a=PB4,PB5,PB3 BUS_PINS_spi2=PB14,PB15,PB13 BUS_PINS_spi2a=PC2,PC3,PB10 BUS_PINS_spi3a=PC11,PC12,PC10 BUS_PINS_spi4=PE13,PE14,PE12 BUS_PINS_spi5=PF8,PF9,PF7 BUS_PINS_spi5a=PH7,PF11,PH6 BUS_PINS_spi6=PG12,PG14,PG13 CANBUS_BRIDGE=1 CLOCK_FREQ=400000000 MCU=stm32h723xx PWM_MAX=255 RECEIVE_WINDOW=192 RESERVE_PINS_CAN=PD0,PD1 RESERVE_PINS_USB=PA11,PA12 RESERVE_PINS_crystal=PH0,PH1 STATS_SUMSQ_BASE=256 STEPPER_BOTH_EDGE=1 Configured MCU 'mcu' (1024 moves) Args: ['/home/biqu/klipper/klippy/klippy.py', '/home/biqu/printer_data/config/printer.cfg', '-I', '/home/biqu/printer_data/comms/klippy.serial', '-l', '/home/biqu/printer_data/logs/klippy.log', '-a', '/home/biqu/printer_data/comms/klippy.sock'] Git version: 'v0.12.0-173-g0b329c5d-dirty' Untracked files: klippy/extras/gcode_shell_command.py, klippy/extras/led_effect.py Branch: master Remote: origin Tracked URL: https://github.com/Klipper3d/klipper CPU: 4 core ? Python: '3.9.2 (default, Feb 28 2021, 17:03:44) \n[GCC 10.2.1 20210110]' webhooks client 281473456925952: {'program': 'Moonraker', 'version': 'v0.8.0-331-gc857e1a'} =============== Log rollover at Sat Apr 27 00:33:33 2024 =============== Resetting prediction variance 1543.603: freq=49999893 diff=-45689 stddev=4981.121 Stats 1744.0: gcodein=0 mcu: mcu_awake=0.001 mcu_task_avg=0.000001 mcu_task_stddev=0.000001 bytes_write=14604 bytes_read=289629 bytes_retransmit=0 bytes_invalid=0 send_seq=2040 receive_seq=2040 retransmit_seq=0 srtt=0.000 rttvar=0.000 rto=0.025 ready_bytes=0 upcoming_bytes=0 freq=399997412 EBBCan: mcu_awake=0.002 mcu_task_avg=0.000014 mcu_task_stddev=0.000011 bytes_write=11908 bytes_read=202285 bytes_retransmit=0 bytes_invalid=0 send_seq=1891 receive_seq=1891 retransmit_seq=0 srtt=0.001 rttvar=0.000 rto=0.025 ready_bytes=0 upcoming_bytes=0 freq=64000230 adj=64000645 CB1: mcu_awake=0.001 mcu_task_avg=0.000009 mcu_task_stddev=0.000013 bytes_write=11679 bytes_read=36870 bytes_retransmit=0 bytes_invalid=0 send_seq=1869 receive_seq=1869 retransmit_seq=0 srtt=0.000 rttvar=0.000 rto=0.025 ready_bytes=0 upcoming_bytes=0 freq=49999000 adj=49997679 heater_bed: target=0 temp=22.5 pwm=0.000 mcu_temp: temp=42.8 EBB_Temperature: temp=30.4 bed_top: temp=22.5 sysload=0.22 cputime=184.742 memavail=674852 print_time=1753.159 buffer_time=0.703 print_stall=0 extruder: target=0 temp=22.5 pwm=0.000 Attempting MCU 'EBBCan' reset command Attempting MCU 'CB1' config_reset command b'Got EOF when reading from device' Attempting MCU 'mcu' reset command webhooks client 281473456925952: Disconnected Restarting printer Start printer at Sat Apr 27 00:36:56 2024 (1714178216.2 1745.9) ===== Config file ===== [mcu] canbus_uuid = b983bbdcfe30 [mcu EBBCan] canbus_uuid = d8d5848615b3 [mcu CB1] serial = /tmp/klipper_host_mcu [printer] kinematics = corexy max_velocity = 500 max_accel = 10000 max_z_velocity = 50 max_z_accel = 500 [virtual_sdcard] path = /home/biqu/printer_data/gcodes on_error_gcode = CANCEL_PRINT [pause_resume] [display_status] [respond] [gcode_macro CANCEL_PRINT] description = Cancel the actual running print rename_existing = CANCEL_PRINT_BASE gcode = PRINT_END [gcode_macro PAUSE] description = Pause the actual running print rename_existing = PAUSE_BASE gcode = {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %} {% set idle_timeout = client.idle_timeout|default(0) %} {% set temp = printer[printer.toolhead.extruder].target if printer.toolhead.extruder != '' else 0 %} {% set restore = False if printer.toolhead.extruder == '' else True if params.RESTORE|default(1)|int == 1 else False %} SET_GCODE_VARIABLE MACRO=RESUME VARIABLE=last_extruder_temp VALUE="{{'restore': restore, 'temp': temp}}" {% if idle_timeout > 0 %} SET_GCODE_VARIABLE MACRO=RESUME VARIABLE=restore_idle_timeout VALUE={printer.configfile.settings.idle_timeout.timeout} SET_IDLE_TIMEOUT TIMEOUT={idle_timeout} {% endif %} PAUSE_BASE {client.user_pause_macro|default("")} _TOOLHEAD_PARK_PAUSE_CANCEL {rawparams} [gcode_macro RESUME] description = Resume the actual running print rename_existing = RESUME_BASE variable_last_extruder_temp = {'restore': False, 'temp': 0} variable_restore_idle_timeout = 0 variable_idle_state = False gcode = {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %} {% set velocity = printer.configfile.settings.pause_resume.recover_velocity %} {% set sp_move = client.speed_move|default(velocity) %} {% set runout_resume = True if client.runout_sensor|default("") == "" else True if not printer[client.runout_sensor].enabled else printer[client.runout_sensor].filament_detected %} {% set can_extrude = True if printer.toolhead.extruder == '' else printer[printer.toolhead.extruder].can_extrude %} {% set do_resume = False %} {% set prompt_txt = [] %} {% if printer.idle_timeout.state|upper == "IDLE" or idle_state %} SET_GCODE_VARIABLE MACRO=RESUME VARIABLE=idle_state VALUE=False {% if last_extruder_temp.restore %} RESPOND TYPE=echo MSG='{"Restoring \"%s\" temperature to %3.1f\u00B0C, this may take some time" % (printer.toolhead.extruder, last_extruder_temp.temp) }' M109 S{last_extruder_temp.temp} {% set do_resume = True %} {% elif can_extrude %} {% set do_resume = True %} {% else %} RESPOND TYPE=error MSG='{"Resume aborted !!! \"%s\" not hot enough, please heat up again and press RESUME" % printer.toolhead.extruder}' {% set _d = prompt_txt.append("\"%s\" not hot enough, please heat up again and press RESUME" % printer.toolhead.extruder) %} {% endif %} {% elif can_extrude %} {% set do_resume = True %} {% else %} RESPOND TYPE=error MSG='{"Resume aborted !!! \"%s\" not hot enough, please heat up again and press RESUME" % printer.toolhead.extruder}' {% set _d = prompt_txt.append("\"%s\" not hot enough, please heat up again and press RESUME" % printer.toolhead.extruder) %} {% endif %} {% if runout_resume %} {% if do_resume %} {% if restore_idle_timeout > 0 %} SET_IDLE_TIMEOUT TIMEOUT={restore_idle_timeout} {% endif %} {client.user_resume_macro|default("")} _CLIENT_EXTRUDE RESUME_BASE VELOCITY={params.VELOCITY|default(sp_move)} {% endif %} {% else %} RESPOND TYPE=error MSG='{"Resume aborted !!! \"%s\" detects no filament, please load filament and press RESUME" % (client.runout_sensor.split(" "))[1]}' {% set _d = prompt_txt.append("\"%s\" detects no filament, please load filament and press RESUME" % (client.runout_sensor.split(" "))[1]) %} {% endif %} {% if not (runout_resume and do_resume) %} RESPOND TYPE=command MSG="action:prompt_begin RESUME aborted !!!" {% for element in prompt_txt %} RESPOND TYPE=command MSG='{"action:prompt_text %s" % element}' {% endfor %} RESPOND TYPE=command MSG="action:prompt_footer_button Ok|RESPOND TYPE=command MSG=action:prompt_end|info" RESPOND TYPE=command MSG="action:prompt_show" {% endif %} [gcode_macro SET_PAUSE_NEXT_LAYER] description = Enable a pause if the next layer is reached gcode = {% set pause_next_layer = printer['gcode_macro SET_PRINT_STATS_INFO'].pause_next_layer %} {% set ENABLE = params.ENABLE|default(1)|int != 0 %} {% set MACRO = params.MACRO|default(pause_next_layer.call, True) %} SET_GCODE_VARIABLE MACRO=SET_PRINT_STATS_INFO VARIABLE=pause_next_layer VALUE="{{ 'enable': ENABLE, 'call': MACRO }}" [gcode_macro SET_PAUSE_AT_LAYER] description = Enable/disable a pause if a given layer number is reached gcode = {% set pause_at_layer = printer['gcode_macro SET_PRINT_STATS_INFO'].pause_at_layer %} {% set ENABLE = params.ENABLE|int != 0 if params.ENABLE is defined else params.LAYER is defined %} {% set LAYER = params.LAYER|default(pause_at_layer.layer)|int %} {% set MACRO = params.MACRO|default(pause_at_layer.call, True) %} SET_GCODE_VARIABLE MACRO=SET_PRINT_STATS_INFO VARIABLE=pause_at_layer VALUE="{{ 'enable': ENABLE, 'layer': LAYER, 'call': MACRO }}" [gcode_macro SET_PRINT_STATS_INFO] rename_existing = SET_PRINT_STATS_INFO_BASE description = Overwrite, to get pause_next_layer and pause_at_layer feature variable_pause_next_layer = { 'enable': False, 'call': "PAUSE" } variable_pause_at_layer = { 'enable': False, 'layer': 0, 'call': "PAUSE" } gcode = {% if pause_next_layer.enable %} RESPOND TYPE=echo MSG='{"%s, forced by pause_next_layer" % pause_next_layer.call}' {pause_next_layer.call} SET_PAUSE_NEXT_LAYER ENABLE=0 {% elif pause_at_layer.enable and params.CURRENT_LAYER is defined and params.CURRENT_LAYER|int == pause_at_layer.layer %} RESPOND TYPE=echo MSG='{"%s, forced by pause_at_layer [%d]" % (pause_at_layer.call, pause_at_layer.layer)}' {pause_at_layer.call} SET_PAUSE_AT_LAYER ENABLE=0 {% endif %} SET_PRINT_STATS_INFO_BASE {rawparams} [gcode_macro _TOOLHEAD_PARK_PAUSE_CANCEL] description = Helper: park toolhead used in PAUSE and CANCEL_PRINT gcode = {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %} {% set velocity = printer.configfile.settings.pause_resume.recover_velocity %} {% set use_custom = client.use_custom_pos|default(false)|lower == 'true' %} {% set custom_park_x = client.custom_park_x|default(0.0) %} {% set custom_park_y = client.custom_park_y|default(0.0) %} {% set park_dz = client.custom_park_dz|default(2.0)|abs %} {% set sp_hop = client.speed_hop|default(15) * 60 %} {% set sp_move = client.speed_move|default(velocity) * 60 %} {% set origin = printer.gcode_move.homing_origin %} {% set act = printer.gcode_move.gcode_position %} {% set max = printer.toolhead.axis_maximum %} {% set cone = printer.toolhead.cone_start_z|default(max.z) %} {% set round_bed = True if printer.configfile.settings.printer.kinematics is in ['delta','polar','rotary_delta','winch'] else False %} {% set z_min = params.Z_MIN|default(0)|float %} {% set z_park = [[(act.z + park_dz), z_min]|max, (max.z - origin.z)]|min %} {% set x_park = params.X if params.X is defined else custom_park_x if use_custom else 0.0 if round_bed else (max.x - 5.0) %} {% set y_park = params.Y if params.Y is defined else custom_park_y if use_custom else (max.y - 5.0) if round_bed and z_park < cone else 0.0 if round_bed else (max.y - 5.0) %} _CLIENT_RETRACT {% if "xyz" in printer.toolhead.homed_axes %} G90 G1 Z{z_park} F{sp_hop} G1 X{x_park} Y{y_park} F{sp_move} {% if not printer.gcode_move.absolute_coordinates %} G91 {% endif %} {% else %} RESPOND TYPE=echo MSG='Printer not homed' {% endif %} [gcode_macro _CLIENT_EXTRUDE] description = Extrudes, if the extruder is hot enough gcode = {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %} {% set use_fw_retract = (client.use_fw_retract|default(false)|lower == 'true') and (printer.firmware_retraction is defined) %} {% set length = params.LENGTH|default(client.unretract)|default(1.0)|float %} {% set speed = params.SPEED|default(client.speed_unretract)|default(35) %} {% set absolute_extrude = printer.gcode_move.absolute_extrude %} {% if printer.toolhead.extruder != '' %} {% if printer[printer.toolhead.extruder].can_extrude %} {% if use_fw_retract %} {% if length < 0 %} G10 {% else %} G11 {% endif %} {% else %} M83 G1 E{length} F{(speed|float|abs) * 60} {% if absolute_extrude %} M82 {% endif %} {% endif %} {% else %} RESPOND TYPE=echo MSG='{"\"%s\" not hot enough" % printer.toolhead.extruder}' {% endif %} {% endif %} [gcode_macro _CLIENT_RETRACT] description = Retracts, if the extruder is hot enough gcode = {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %} {% set length = params.LENGTH|default(client.retract)|default(1.0)|float %} {% set speed = params.SPEED|default(client.speed_retract)|default(35) %} _CLIENT_EXTRUDE LENGTH=-{length|float|abs} SPEED={speed|float|abs} [gcode_arcs] resolution = 1 [exclude_object] [gcode_macro AXES_MAP_CALIBRATION] gcode = {% set z_height = params.Z_HEIGHT|default(20)|int %} {% set speed = params.SPEED|default(80)|float * 60 %} {% set accel = params.ACCEL|default(1500)|int %} {% set feedrate_travel = params.TRAVEL_SPEED|default(120)|int * 60 %} {% set accel_chip = params.ACCEL_CHIP|default("adxl345") %} {% set mid_x = printer.toolhead.axis_maximum.x|float / 2 %} {% set mid_y = printer.toolhead.axis_maximum.y|float / 2 %} {% set accel = [accel, printer.configfile.settings.printer.max_accel]|min %} {% set old_accel = printer.toolhead.max_accel %} {% set old_cruise_ratio = printer.toolhead.minimum_cruise_ratio %} {% set old_sqv = printer.toolhead.square_corner_velocity %} {% if not 'xyz' in printer.toolhead.homed_axes %} { action_raise_error("Must Home printer first!") } {% endif %} {action_respond_info("")} {action_respond_info("Starting accelerometer axe_map calibration")} {action_respond_info("This operation can not be interrupted by normal means. Hit the \"emergency stop\" button to stop it if needed")} {action_respond_info("")} SAVE_GCODE_STATE NAME=STATE_AXESMAP_CALIBRATION G90 SET_VELOCITY_LIMIT ACCEL={accel} MINIMUM_CRUISE_RATIO=0 SQUARE_CORNER_VELOCITY={[(accel / 1000), 5.0]|max} G1 Z{z_height} F{feedrate_travel / 8} G1 X{mid_x - 15} Y{mid_y - 15} F{feedrate_travel} G4 P500 ACCELEROMETER_MEASURE CHIP={accel_chip} G4 P1000 G1 X{mid_x + 15} F{speed} G4 P1000 G1 Y{mid_y + 15} F{speed} G4 P1000 G1 Z{z_height + 15} F{speed} G4 P1000 ACCELEROMETER_MEASURE CHIP={accel_chip} NAME=axemap RESPOND MSG="Analysis of the movements..." RUN_SHELL_COMMAND CMD=shaketune PARAMS="--type axesmap --accel {accel|int} --chip_name {accel_chip}" SET_VELOCITY_LIMIT ACCEL={old_accel} MINIMUM_CRUISE_RATIO={old_cruise_ratio} SQUARE_CORNER_VELOCITY={old_sqv} RESTORE_GCODE_STATE NAME=STATE_AXESMAP_CALIBRATION [gcode_macro AXES_SHAPER_CALIBRATION] description = Perform standard axis input shaper tests on one or both XY axes to select the best input shaper filter gcode = {% set min_freq = params.FREQ_START|default(5)|float %} {% set max_freq = params.FREQ_END|default(133.3)|float %} {% set hz_per_sec = params.HZ_PER_SEC|default(1)|float %} {% set axis = params.AXIS|default("all")|string|lower %} {% set scv = params.SCV|default(None) %} {% set max_sm = params.MAX_SMOOTHING|default(None) %} {% set keep_results = params.KEEP_N_RESULTS|default(3)|int %} {% set keep_csv = params.KEEP_CSV|default(True) %} {% set X, Y = False, False %} {% if axis == "all" %} {% set X, Y = True, True %} {% elif axis == "x" %} {% set X = True %} {% elif axis == "y" %} {% set Y = True %} {% else %} { action_raise_error("AXIS selection invalid. Should be either all, x or y!") } {% endif %} {% if scv is none %} {% set scv = printer.toolhead.square_corner_velocity %} {% endif %} {% if X %} TEST_RESONANCES AXIS=X OUTPUT=raw_data NAME=x FREQ_START={min_freq} FREQ_END={max_freq} HZ_PER_SEC={hz_per_sec} M400 RESPOND MSG="X axis frequency profile generation..." RESPOND MSG="This may take some time (1-3min)" RUN_SHELL_COMMAND CMD=shaketune PARAMS="--type shaper --scv {scv} {% if max_sm is not none %}--max_smoothing {max_sm}{% endif %} {% if keep_csv %}--keep_csv{% endif %}" {% endif %} {% if Y %} TEST_RESONANCES AXIS=Y OUTPUT=raw_data NAME=y FREQ_START={min_freq} FREQ_END={max_freq} HZ_PER_SEC={hz_per_sec} M400 RESPOND MSG="Y axis frequency profile generation..." RESPOND MSG="This may take some time (1-3min)" RUN_SHELL_COMMAND CMD=shaketune PARAMS="--type shaper --scv {scv} {% if max_sm is not none %}--max_smoothing {max_sm}{% endif %} {% if keep_csv %}--keep_csv{% endif %}" {% endif %} M400 RUN_SHELL_COMMAND CMD=shaketune PARAMS="--type clean --keep_results {keep_results}" [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 = {% 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 keep_results = params.KEEP_N_RESULTS|default(3)|int %} {% set keep_csv = params.KEEP_CSV|default(True) %} 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 MSG="Belts comparative frequency profile generation..." RESPOND MSG="This may take some time (3-5min)" RUN_SHELL_COMMAND CMD=shaketune PARAMS="--type belts {% if keep_csv %}--keep_csv{% endif %}" M400 RUN_SHELL_COMMAND CMD=shaketune PARAMS="--type clean --keep_results {keep_results}" [gcode_macro EXCITATE_AXIS_AT_FREQ] description = Maintain a specified excitation frequency for a period of time to diagnose and locate a source of vibration 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 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 %} TEST_RESONANCES OUTPUT=raw_data AXIS={axis} FREQ_START={frequency-1} FREQ_END={frequency+1} HZ_PER_SEC={1/(time/3)} M400 [gcode_macro VIBRATIONS_CALIBRATION] gcode = {% set size = params.SIZE|default(60)|int %} {% set direction = params.DIRECTION|default('XY') %} {% set z_height = params.Z_HEIGHT|default(20)|int %} {% set min_speed = params.MIN_SPEED|default(20)|float * 60 %} {% set max_speed = params.MAX_SPEED|default(200)|float * 60 %} {% set speed_increment = params.SPEED_INCREMENT|default(2)|float * 60 %} {% set feedrate_travel = params.TRAVEL_SPEED|default(200)|int * 60 %} {% set accel = params.ACCEL|default(3000)|int %} {% set accel_chip = params.ACCEL_CHIP|default("adxl345") %} {% set keep_results = params.KEEP_N_RESULTS|default(3)|int %} {% set keep_csv = params.KEEP_CSV|default(True) %} {% set mid_x = printer.toolhead.axis_maximum.x|float / 2 %} {% set mid_y = printer.toolhead.axis_maximum.y|float / 2 %} {% set nb_samples = ((max_speed - min_speed) / speed_increment + 1) | int %} {% set accel = [accel, printer.configfile.settings.printer.max_accel]|min %} {% set old_accel = printer.toolhead.max_accel %} {% set old_cruise_ratio = printer.toolhead.minimum_cruise_ratio %} {% set old_sqv = printer.toolhead.square_corner_velocity %} {% set direction_factor = { 'XY' : { 'start' : {'x': -0.5, 'y': -0.5 }, 'move_factors' : { '0' : {'x': 0.5, 'y': -0.5, 'z': 0.0 }, '1' : {'x': 0.5, 'y': 0.5, 'z': 0.0 }, '2' : {'x': -0.5, 'y': 0.5, 'z': 0.0 }, '3' : {'x': -0.5, 'y': -0.5, 'z': 0.0 } } }, 'AB' : { 'start' : {'x': 0.0, 'y': 0.0 }, 'move_factors' : { '0' : {'x': 0.5, 'y': -0.5, 'z': 0.0 }, '1' : {'x': -0.5, 'y': 0.5, 'z': 0.0 }, '2' : {'x': 0.0, 'y': 0.0, 'z': 0.0 }, '3' : {'x': 0.5, 'y': 0.5, 'z': 0.0 }, '4' : {'x': -0.5, 'y': -0.5, 'z': 0.0 }, '5' : {'x': 0.0, 'y': 0.0, 'z': 0.0 } } }, 'ABXY' : { 'start' : {'x': -0.5, 'y': 0.5 }, 'move_factors' : { '0' : {'x': -0.5, 'y': -0.5, 'z': 0.0 }, '1' : {'x': 0.5, 'y': -0.5, 'z': 0.0 }, '2' : {'x': -0.5, 'y': 0.5, 'z': 0.0 }, '3' : {'x': 0.5, 'y': 0.5, 'z': 0.0 }, '4' : {'x': -0.5, 'y': -0.5, 'z': 0.0 }, '5' : {'x': -0.5, 'y': 0.5, 'z': 0.0 } } }, 'B' : { 'start' : {'x': 0.5, 'y': 0.5 }, 'move_factors' : { '0' : {'x': -0.5, 'y': -0.5, 'z': 0.0 }, '1' : {'x': 0.5, 'y': 0.5, 'z': 0.0 } } }, 'A' : { 'start' : {'x': -0.5, 'y': 0.5 }, 'move_factors' : { '0' : {'x': 0.5, 'y': -0.5, 'z': 0.0 }, '1' : {'x': -0.5, 'y': 0.5, 'z': 0.0 } } }, 'X' : { 'start' : {'x': -0.5, 'y': 0.0 }, 'move_factors' : { '0' : {'x': 0.5, 'y': 0.0, 'z': 0.0 }, '1' : {'x': -0.5, 'y': 0.0, 'z': 0.0 } } }, 'Y' : { 'start' : {'x': 0.0, 'y': 0.5 }, 'move_factors' : { '0' : {'x': 0.0, 'y': -0.5, 'z': 0.0 }, '1' : {'x': 0.0, 'y': 0.5, 'z': 0.0 } } }, 'Z' : { 'start' : {'x': 0.0, 'y': 0.0 }, 'move_factors' : { '0' : {'x': 0.0, 'y': 0.0, 'z': 1.0 }, '1' : {'x': 0.0, 'y': 0.0, 'z': 0.0 } } }, 'E' : { 'start' : {'x': 0.0, 'y': 0.0 }, 'move_factor' : 0.05 } } %} {% if not 'xyz' in printer.toolhead.homed_axes %} { action_raise_error("Must Home printer first!") } {% endif %} {% if params.SPEED_INCREMENT|default(2)|float * 100 != (params.SPEED_INCREMENT|default(2)|float * 100)|int %} { action_raise_error("Only 2 decimal digits are allowed for SPEED_INCREMENT") } {% endif %} {% if (size / (max_speed / 60)) < 0.25 and direction != 'E' %} { action_raise_error("SIZE is too small for this MAX_SPEED. Increase SIZE or decrease MAX_SPEED!") } {% endif %} {% if not (direction in direction_factor) %} { action_raise_error("DIRECTION is not valid. Only XY, AB, ABXY, A, B, X, Y, Z or E is allowed!") } {% endif %} {action_respond_info("")} {action_respond_info("Starting speed and vibration calibration")} {action_respond_info("This operation can not be interrupted by normal means. Hit the \"emergency stop\" button to stop it if needed")} {action_respond_info("")} SAVE_GCODE_STATE NAME=STATE_VIBRATIONS_CALIBRATION G90 SET_VELOCITY_LIMIT ACCEL={accel} MINIMUM_CRUISE_RATIO=0 SQUARE_CORNER_VELOCITY={[(accel / 1000), 5.0]|max} G1 Z{z_height} F{feedrate_travel / 10} G1 X{mid_x + (size * direction_factor[direction].start.x) } Y{mid_y + (size * direction_factor[direction].start.y)} F{feedrate_travel} {% for curr_sample in range(0, nb_samples) %} {% set curr_speed = min_speed + curr_sample * speed_increment %} RESPOND MSG="{"Current speed: %.2f mm/s" % (curr_speed / 60)|float}" ACCELEROMETER_MEASURE CHIP={accel_chip} {% if direction == 'E' %} G0 E{curr_speed*direction_factor[direction].move_factor} F{curr_speed} {% else %} {% for key, factor in direction_factor[direction].move_factors|dictsort %} G1 X{mid_x + (size * factor.x) } Y{mid_y + (size * factor.y)} Z{z_height + (size * factor.z)} F{curr_speed} {% endfor %} {% endif %} ACCELEROMETER_MEASURE CHIP={accel_chip} NAME=sp{("%.2f" % (curr_speed / 60)|float)|replace('.','_')}n1 G4 P300 M400 {% endfor %} RESPOND MSG="Machine and motors vibration graph generation..." RESPOND MSG="This may take some time (3-5min)" RUN_SHELL_COMMAND CMD=shaketune PARAMS="--type vibrations --axis_name {direction} --accel {accel|int} --chip_name {accel_chip} {% if keep_csv %}--keep_csv{% endif %}" M400 RUN_SHELL_COMMAND CMD=shaketune PARAMS="--type clean --keep_results {keep_results}" SET_VELOCITY_LIMIT ACCEL={old_accel} MINIMUM_CRUISE_RATIO={old_cruise_ratio} SQUARE_CORNER_VELOCITY={old_sqv} RESTORE_GCODE_STATE NAME=STATE_VIBRATIONS_CALIBRATION [gcode_shell_command shaketune] command = ~/printer_data/config/K-ShakeTune/scripts/shaketune.sh timeout = 600.0 verbose = True [stepper_x] step_pin = PE6 dir_pin = !PE5 enable_pin = multi_pin:z_enable microsteps = 16 rotation_distance = 32 endstop_pin = EBBCan: PB6 position_endstop = 0 position_max = 315 homing_speed = 50 [stepper_y] step_pin = PE2 dir_pin = !PE1 enable_pin = !PE4 microsteps = 16 rotation_distance = 32 endstop_pin = ^PF3 position_endstop = 300 position_max = 300 homing_speed = 50 [stepper_z] step_pin = PB8 dir_pin = PB7 enable_pin = !PE0 microsteps = 16 rotation_distance = 32 endstop_pin = probe:z_virtual_endstop position_max = 230 position_min = -5.0 homing_speed = 20 second_homing_speed = 10 homing_retract_dist = 5 [stepper_z1] step_pin = PB4 dir_pin = !PB3 enable_pin = !PB6 microsteps = 16 rotation_distance = 32 [stepper_z2] step_pin = PG13 dir_pin = !PG12 enable_pin = !PG15 microsteps = 16 rotation_distance = 32 [extruder] step_pin = EBBCan: PD0 dir_pin = EBBCan: PD1 enable_pin = !EBBCan: PD2 microsteps = 16 rotation_distance = 3.43 nozzle_diameter = 0.600 filament_diameter = 1.750 heater_pin = EBBCan: PB13 sensor_type = EPCOS 100K B57560G104F sensor_pin = EBBCan: PA3 min_temp = 0 max_temp = 250 max_extrude_cross_section = 250 max_extrude_only_distance = 250 control = pid pid_kp = 16.610 pid_ki = 0.527 pid_kd = 130.805 [tmc5160 stepper_x] cs_pin = PC13 spi_software_mosi_pin = PG6 spi_software_miso_pin = PG7 spi_software_sclk_pin = PG8 run_current = 1.400 [tmc5160 stepper_y] cs_pin = PE3 spi_software_mosi_pin = PG6 spi_software_miso_pin = PG7 spi_software_sclk_pin = PG8 run_current = 1.400 [tmc2209 stepper_z] uart_pin = PB9 run_current = 0.850 stealthchop_threshold = 999999 [tmc2209 stepper_z1] uart_pin = PB5 run_current = 0.850 stealthchop_threshold = 999999 [tmc2209 stepper_z2] uart_pin = PG14 run_current = 0.850 stealthchop_threshold = 999999 [tmc2209 extruder] uart_pin = EBBCan: PA15 run_current = 0.650 [multi_pin z_enable] pins = !PC14, PA5 [heater_bed] heater_pin = PA0 sensor_type = ATC Semitec 104GT-2 sensor_pin = PB1 control = pid pid_kp = 54.027 pid_ki = 0.770 pid_kd = 948.182 min_temp = 0 max_temp = 130 [fan] pin = EBBCan: PA1 [heater_fan hotend_fan] pin = EBBCan: PA0 heater = extruder heater_temp = 50.0 [controller_fan tmc_fan] pin = PF7 stepper = stepper_x [temperature_fan CB1] pin = PF8 sensor_type = temperature_host min_temp = 10 max_temp = 90 control = pid pid_kp = 2 pid_ki = 4 pid_kd = 0.1 [temperature_sensor mcu_temp] sensor_type = temperature_mcu min_temp = 0 max_temp = 100 [temperature_sensor EBB_Temperature] sensor_type = temperature_mcu sensor_mcu = EBBCan [temperature_sensor bed_top] sensor_type = AHT10 sensor_pin = PB0 i2c_mcu = mcu [bltouch] sensor_pin = ^EBBCan:PB8 control_pin = EBBCan:PB9 stow_on_each_sample = false probe_with_touch_mode = true x_offset = 55 y_offset = 0 speed = 10 lift_speed = 20 samples = 2 samples_tolerance_retries = 4 z_offset = 1.200 [idle_timeout] timeout = 960000 [filament_switch_sensor switch_sensor] switch_pin = ^PF0 pause_on_runout = false runout_gcode = PAUSE [filament_motion_sensor motion_sensor] switch_pin = ^PC15 detection_length = 4 extruder = extruder pause_on_runout = false runout_gcode = PAUSE [neopixel outside] pin = CB1: gpio259 chain_count = 79 color_order = GRB initial_red = 0.5 initial_green = 0.5 initial_blue = 0.5 [neopixel back] pin = PD15 chain_count = 29 color_order = GRB initial_red = 0.5 initial_green = 0.5 initial_blue = 0.5 [z_tilt] z_positions = 0, 25 300, 25 150, 300 points = 0, 20 245, 20 95, 295 speed = 125 horizontal_move_z = 10 retries = 8 retry_tolerance = 0.01 [bed_mesh] speed = 125 horizontal_move_z = 10 mesh_min = 55, 10 mesh_max = 245,290 probe_count = 5, 5 algorithm = bicubic bicubic_tension = 0.2 fade_start = 1 fade_end = 10 fade_target = 0 [safe_z_home] home_xy_position = 100, 150 speed = 150 [input_shaper] shaper_freq_x = 83.8 shaper_type_x = mzv shaper_freq_y = 65.2 shaper_type_y = mzv [adxl345] cs_pin = EBBCan: PB12 spi_software_sclk_pin = EBBCan: PB10 spi_software_mosi_pin = EBBCan: PB11 spi_software_miso_pin = EBBCan: PB2 axes_map = x,y,z [resonance_tester] accel_chip = adxl345 probe_points = 160, 150, 50 [gcode_macro PRINT_START] gcode = {% set BED = params.BED_TEMP|int %} {% set EXTRUDER = params.EXTRUDER_TEMP|int %} M140 S{BED} M104 S{EXTRUDER} G28 Z_TILT_ADJUST BED_MESH_CALIBRATE _ADAPTIVE_PURGE_V1 [gcode_macro Z_TILT_ADJUST] rename_existing = Z_TILT_ADJUST_1 gcode = {% if printer["gcode_macro status_leveling"] != null %} status_leveling {% endif %} Z_TILT_ADJUST_1 { rawparams } {% if printer["gcode_macro status_ready"] != null %} status_ready {% endif %} [gcode_macro BED_MESH_CALIBRATE] rename_existing = _BED_MESH_CALIBRATE variable_buffer = 2 gcode = {% set bedMeshConfig = printer['configfile'].config["bed_mesh"] %} {% set bed_mesh_min = bedMeshConfig.mesh_min %} {% set bed_mesh_max = bedMeshConfig.mesh_max %} {% set all_points = printer.exclude_object.objects | map(attribute='polygon') | sum(start=[]) %} {% 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]) %} {% if printer["bed_mesh"].profile_name == '' %} { action_respond_info("No existing bed mesh found.") } {% set last_area_end_x=-1 %} {% endif %} {% if printer.toolhead.homed_axes != "xyz" %} G28 {% endif %} {% set klicky_available = printer['gcode_macro _Probe_Variables'] != null %} {% set probeConfig = printer['configfile'].config["probe"] %} {% if probeConfig %} {% set OffsetX = probeConfig.x_offset|default(0)|float %} {% set OffsetY = probeConfig.y_offset|default(0)|float %} {% endif %} {% set print_min_x = x_min|float %} {% set print_min_y = y_min|float %} {% set print_max_x = x_max|float %} {% set print_max_y = y_max|float %} {% set mesh_min_x = bed_mesh_min.split(",")[0]|float %} {% set mesh_min_y = bed_mesh_min.split(",")[1]|float %} {% set mesh_max_x = bed_mesh_max.split(",")[0]|float %} {% set mesh_max_y = bed_mesh_max.split(",")[1]|float %} {% if (print_min_x < mesh_min_x) or (print_max_x > mesh_max_x) or (print_min_y < mesh_min_y) or (print_max_y > mesh_max_y) %} {% set print_min_x = mesh_min_x %} {% set print_min_y = mesh_min_y %} {% set print_max_x = mesh_max_x %} {% set print_max_y = mesh_max_y %} {% endif %} {% if klicky_available %} _CheckProbe action=query Attach_Probe {% elif euclid_available %} DEPLOY_PROBE {% endif %} {% if (print_min_x < print_max_x) and (print_min_y < print_max_y) %} {% set minimum_probe_count = 3 %} {% set medium_probe_count = 5 %} {% set probe_count = bedMeshConfig.probe_count.split(",") %} {% set probe_count_x = probe_count[0]|int %} {% if probe_count.__len__() > 1 %} {% set probe_count_y = probe_count[1]|int %} {% else %} {% set probe_count_y = probe_count_x|int %} {% endif %} {% set relative_reference_index = bedMeshConfig.relative_reference_index %} {% if print_max_x - print_min_x < (mesh_max_x - mesh_min_x) * 0.75 %} {% set probe_count_x = medium_probe_count %} {% endif %} {% if print_max_y - print_min_y < (mesh_max_y - mesh_min_y) * 0.75 %} {% set probe_count_y = medium_probe_count %} {% endif %} {% if print_max_x - print_min_x < (mesh_max_x - mesh_min_x) * 0.50 %} {% set probe_count_x = minimum_probe_count %} {% endif %} {% if print_max_y - print_min_y < (mesh_max_y - mesh_min_y) * 0.50 %} {% set probe_count_y = minimum_probe_count %} {% endif %} {% if print_min_x - buffer >= mesh_min_x %} {% set mesh_min_x = print_min_x - buffer %} {% endif %} {% if print_min_y - buffer >= mesh_min_y %} {% set mesh_min_y = print_min_y - buffer %} {% endif %} {% if print_max_x + buffer <= mesh_max_x %} {% set mesh_max_x = print_max_x + buffer %} {% endif %} {% if print_max_y + buffer <= mesh_max_y %} {% set mesh_max_y = print_max_y + buffer %} {% endif %} { action_respond_info("mesh_min: %s,%s" % (mesh_min_x, mesh_min_y)) } { action_respond_info("mesh_max: %s,%s" % (mesh_max_x, mesh_max_y)) } { action_respond_info("probe_count: %s,%s" % (probe_count_x,probe_count_y)) } {% if printer["gcode_macro status_meshing"] != null %} status_meshing {% endif %} {% if relative_reference_index == 0 or relative_reference_index == null %} _BED_MESH_CALIBRATE mesh_min={mesh_min_x},{mesh_min_y} mesh_max={mesh_max_x},{mesh_max_y} probe_count={probe_count_x},{probe_count_y} {% else %} {% set relative_reference_index = ((probe_count_x * probe_count_y - 1) / 2)|int %} { action_respond_info("relative_reference_index: %s" % relative_reference_index) } _BED_MESH_CALIBRATE mesh_min={mesh_min_x},{mesh_min_y} mesh_max={mesh_max_x},{mesh_max_y} probe_count={probe_count_x},{probe_count_y} relative_reference_index={relative_reference_index} {% endif %} {% else %} {% if printer["gcode_macro status_meshing"] != null %} status_meshing {% endif %} _BED_MESH_CALIBRATE {% endif %} {% if klicky_available %} Dock_Probe {% elif euclid_available %} STOW_PROBE {% endif %} {% if printer["gcode_macro status_ready"] != null %} status_ready {% endif %} [gcode_macro _ADAPTIVE_PURGE_V1] description = A purge macro that adapts to be near your actual printed objects variable_adaptive_enable = True variable_z_height = 0.3 variable_tip_distance = 10 variable_purge_amount = 30 variable_flow_rate = 10 variable_x_default = 5 variable_y_default = 5 variable_size = 16 variable_distance_to_object_x = 7 variable_distance_to_object_y = 7 gcode = {% if adaptive_enable == True %} {% set all_points = printer.exclude_object.objects | map(attribute='polygon') | sum(start=[]) %} {% set x_origin = (all_points | map(attribute=0) | min | default(x_default + distance_to_object_x + size)) - distance_to_object_x - size %} {% set y_origin = (all_points | map(attribute=1) | min | default(y_default + distance_to_object_y + size)) - distance_to_object_y - size %} {% set x_origin = ([x_origin, 0] | max) %} {% set y_origin = ([y_origin, 0] | max) %} {% if x_origin < x_default %} set x_origin = x_default | float {% endif %} {% if y_origin < y_default %} set y_origin = y_default | float {% endif %} {% else %} {% set x_origin = x_default | float %} {% set y_origin = y_default | float %} {% endif %} {% set purge_move_speed = 2.31 * size * flow_rate / (purge_amount * 2.405) %} {% set prepurge_speed = flow_rate / 2.405 %} {% set travel_speed = printer.toolhead.max_velocity %} { action_respond_info( "x: " + x_origin|string + " y: " + y_origin|string + " purge_move_speed: " + purge_move_speed|string + " prepurge_speed: " + prepurge_speed|string ) } G92 E0 G90 G0 X{x_origin} Y{y_origin+size/2} F3000 G0 Z{z_height} F1500 G0 F3000 M83 G1 E{tip_distance} F{prepurge_speed*60} G1 F600 G1 X{x_origin+size*0.1976875} Y{y_origin+size*0.0538125} E{purge_amount*0.00362396204033215} G1 X{x_origin+size*0.2070625} Y{y_origin+size*0.056375} E{purge_amount*0.00348517200474496} G1 X{x_origin+size*0.273} Y{y_origin+size*0.0889375} E{purge_amount*0.0253226571767497} G1 X{x_origin+size*0.3568125} Y{y_origin+size*0.125125} E{purge_amount*0.0313760379596679} G1 X{x_origin+size*0.442375} Y{y_origin+size*0.1563125} E{purge_amount*0.0312455516014235} G1 X{x_origin+size*0.5295625} Y{y_origin+size*0.1825} E{purge_amount*0.0311731909845789} G1 X{x_origin+size*0.5311875} Y{y_origin+size*0.1829375} E{purge_amount*0.000575326215895611} G1 X{x_origin+size*0.6196875} Y{y_origin+size*0.2038125} E{purge_amount*0.0311376037959668} G1 X{x_origin+size*0.7093125} Y{y_origin+size*0.219625} E{purge_amount*0.0312253855278766} G1 X{x_origin+size*0.799875} Y{y_origin+size*0.2301875} E{purge_amount*0.0313368920521945} G1 X{x_origin+size*0.8735625} Y{y_origin+size*0.2349375} E{purge_amount*0.0254270462633452} G1 X{x_origin+size*0.8824375} Y{y_origin+size*0.237} E{purge_amount*0.00326809015421115} G1 X{x_origin+size*0.8913125} Y{y_origin+size*0.2390625} E{purge_amount*0.00339739027283511} G1 X{x_origin+size*0.8959375} Y{y_origin+size*0.2481875} E{purge_amount*0.00381494661921708} G1 X{x_origin+size*0.9005} Y{y_origin+size*0.257375} E{purge_amount*0.00366548042704626} G1 X{x_origin+size*0.951125} Y{y_origin+size*0.4463125} E{purge_amount*0.0668623962040332} G1 X{x_origin+size*0.9521875} Y{y_origin+size*0.4540625} E{purge_amount*0.00276156583629893} G1 X{x_origin+size*0.9531875} Y{y_origin+size*0.46175} E{purge_amount*0.00282443653618031} G1 X{x_origin+size*0.9528125} Y{y_origin+size*0.4654375} E{purge_amount*0.00138078291814947} G1 X{x_origin+size*0.9458125} Y{y_origin+size*0.4720625} E{purge_amount*0.00359193357058126} G1 X{x_origin+size*0.9388125} Y{y_origin+size*0.4786875} E{purge_amount*0.00342467378410439} G1 X{x_origin+size*0.9145625} Y{y_origin+size*0.4951875} E{purge_amount*0.00993950177935943} G1 X{x_origin+size*0.8395} Y{y_origin+size*0.547875} E{purge_amount*0.0316453143534994} G1 X{x_origin+size*0.7680625} Y{y_origin+size*0.6045} E{purge_amount*0.0314733096085409} G1 X{x_origin+size*0.700125} Y{y_origin+size*0.665125} E{purge_amount*0.0314483985765125} G1 X{x_origin+size*0.6358125} Y{y_origin+size*0.7295} E{purge_amount*0.0314317912218268} G1 X{x_origin+size*0.5755625} Y{y_origin+size*0.7971875} E{purge_amount*0.0312977461447212} G1 X{x_origin+size*0.5465} Y{y_origin+size*0.8325625} E{purge_amount*0.0155836298932384} G1 X{x_origin+size*0.492125} Y{y_origin+size*0.9056875} E{purge_amount*0.0313190984578885} G1 X{x_origin+size*0.451125} Y{y_origin+size*0.967125} E{purge_amount*0.0254341637010676} G1 X{x_origin+size*0.444625} Y{y_origin+size*0.9739375} E{purge_amount*0.00337959667852906} G1 X{x_origin+size*0.4380625} Y{y_origin+size*0.98075} E{purge_amount*0.00353262158956109} G1 X{x_origin+size*0.428125} Y{y_origin+size*0.98} E{purge_amount*0.00372123368920522} G1 X{x_origin+size*0.41825} Y{y_origin+size*0.97925} E{purge_amount*0.00354211150652432} G1 X{x_origin+size*0.22925} Y{y_origin+size*0.928625} E{purge_amount*0.0668837485172005} G1 X{x_origin+size*0.2204375} Y{y_origin+size*0.924125} E{purge_amount*0.00351601423487545} G1 X{x_origin+size*0.2115625} Y{y_origin+size*0.919625} E{purge_amount*0.00366903914590747} G1 X{x_origin+size*0.2091875} Y{y_origin+size*0.910625} E{purge_amount*0.00343179122182681} G1 X{x_origin+size*0.2068125} Y{y_origin+size*0.9016875} E{purge_amount*0.00329774614472123} G1 X{x_origin+size*0.2020625} Y{y_origin+size*0.82825} E{purge_amount*0.0253404507710558} G1 X{x_origin+size*0.1915} Y{y_origin+size*0.737625} E{purge_amount*0.0313582443653618} G1 X{x_origin+size*0.17575} Y{y_origin+size*0.6479375} E{purge_amount*0.0312431791221827} G1 X{x_origin+size*0.154875} Y{y_origin+size*0.5593125} E{purge_amount*0.0311791221826809} G1 X{x_origin+size*0.1544375} Y{y_origin+size*0.5576875} E{purge_amount*0.000575326215895611} G1 X{x_origin+size*0.12825} Y{y_origin+size*0.470625} E{purge_amount*0.0311328588374852} G1 X{x_origin+size*0.0970625} Y{y_origin+size*0.385125} E{purge_amount*0.0312253855278766} G1 X{x_origin+size*0.061} Y{y_origin+size*0.3014375} E{purge_amount*0.0313190984578885} G1 X{x_origin+size*0.02825} Y{y_origin+size*0.2351875} E{purge_amount*0.0254483985765125} G1 X{x_origin+size*0.025625} Y{y_origin+size*0.226125} E{purge_amount*0.00338671411625148} G1 X{x_origin+size*0.023} Y{y_origin+size*0.2170625} E{purge_amount*0.00352313167259787} G1 X{x_origin+size*0.028625} Y{y_origin+size*0.208875} E{purge_amount*0.00370937129300119} G1 X{x_origin+size*0.03425} Y{y_origin+size*0.200625} E{purge_amount*0.003570581257414} G1 X{x_origin+size*0.1725625} Y{y_origin+size*0.0623125} E{purge_amount*0.0668623962040332} G1 X{x_origin+size*0.1804375} Y{y_origin+size*0.0568125} E{purge_amount*0.00343297746144721} G1 X{x_origin+size*0.18375} Y{y_origin+size*0.0545} E{purge_amount*0.00150652431791222} G92 E0 M82 G0 Z{z_height*2} {% if printer["gcode_macro status_printing"] != null %} status_printing {% endif %} [gcode_macro PRINT_END] gcode = M400 TURN_OFF_HEATERS M106 S0 PARK_CENTER_REAR G0 Z230 F3000 [gcode_macro PARK_CENTER_REAR] gcode = {% if printer["gcode_macro status_busy"] != null %} status_busy {% endif %} {% set th = printer.toolhead %} {% set x_safe = th.position.x + 20 * (1 if th.axis_maximum.x - th.position.x > 20 else -1) %} {% set y_safe = th.position.y + 20 * (1 if th.axis_maximum.y - th.position.y > 20 else -1) %} G0 X{th.axis_maximum.x//2} Y{th.axis_maximum.y - 2} F3600 {% if printer["gcode_macro status_ready"] != null %} status_ready {% endif %} [gcode_macro TEST_SPEED] gcode = G0 Z10 {% set speed = params.SPEED|default(printer.configfile.settings.printer.max_velocity)|int %} {% set iterations = params.ITERATIONS|default(5)|int %} {% set accel = params.ACCEL|default(printer.configfile.settings.printer.max_accel)|int %} {% set bound = params.BOUND|default(20)|int %} {% set smallpatternsize = SMALLPATTERNSIZE|default(20)|int %} {% set x_min = printer.toolhead.axis_minimum.x + bound %} {% set x_max = printer.toolhead.axis_maximum.x - bound %} {% set y_min = printer.toolhead.axis_minimum.y + bound %} {% set y_max = printer.toolhead.axis_maximum.y - bound %} {% set x_center = (printer.toolhead.axis_minimum.x|float + printer.toolhead.axis_maximum.x|float ) / 2 %} {% set y_center = (printer.toolhead.axis_minimum.y|float + printer.toolhead.axis_maximum.y|float ) / 2 %} {% set x_center_min = x_center - (smallpatternsize/2) %} {% set x_center_max = x_center + (smallpatternsize/2) %} {% set y_center_min = y_center - (smallpatternsize/2) %} {% set y_center_max = y_center + (smallpatternsize/2) %} SAVE_GCODE_STATE NAME=TEST_SPEED { action_respond_info("TEST_SPEED: starting %d iterations at speed %d, accel %d" % (iterations, speed, accel)) } M400 G28 {% if printer.configfile.settings.quad_gantry_level %} {% if printer.quad_gantry_level.applied == False %} QUAD_GANTRY_LEVEL G28 Z {% endif %} {% endif %} G90 G1 X{printer.toolhead.axis_maximum.x-50} Y{printer.toolhead.axis_maximum.y-50} F{30*60} M400 G28 X Y G0 X{printer.toolhead.axis_maximum.x-1} Y{printer.toolhead.axis_maximum.y-1} F{30*60} G4 P1000 GET_POSITION G0 X{x_min} Y{y_min} Z{bound + 10} F{speed*60} SET_VELOCITY_LIMIT VELOCITY={speed} ACCEL={accel} ACCEL_TO_DECEL={accel / 2} {% for i in range(iterations) %} G0 X{x_min} Y{y_min} F{speed*60} G0 X{x_max} Y{y_max} F{speed*60} G0 X{x_min} Y{y_min} F{speed*60} G0 X{x_max} Y{y_min} F{speed*60} G0 X{x_min} Y{y_max} F{speed*60} G0 X{x_max} Y{y_min} F{speed*60} G0 X{x_min} Y{y_min} F{speed*60} G0 X{x_min} Y{y_max} F{speed*60} G0 X{x_max} Y{y_max} F{speed*60} G0 X{x_max} Y{y_min} F{speed*60} G0 X{x_center_min} Y{y_center_min} F{speed*60} G0 X{x_center_max} Y{y_center_max} F{speed*60} G0 X{x_center_min} Y{y_center_min} F{speed*60} G0 X{x_center_max} Y{y_center_min} F{speed*60} G0 X{x_center_min} Y{y_center_max} F{speed*60} G0 X{x_center_max} Y{y_center_min} F{speed*60} G0 X{x_center_min} Y{y_center_min} F{speed*60} G0 X{x_center_min} Y{y_center_max} F{speed*60} G0 X{x_center_max} Y{y_center_max} F{speed*60} G0 X{x_center_max} Y{y_center_min} F{speed*60} {% endfor %} SET_VELOCITY_LIMIT VELOCITY={printer.configfile.settings.printer.max_velocity} ACCEL={printer.configfile.settings.printer.max_accel} M400 G28 G90 G0 X{printer.toolhead.axis_maximum.x-1} Y{printer.toolhead.axis_maximum.y-1} F{30*60} G4 P1000 GET_POSITION RESTORE_GCODE_STATE NAME=TEST_SPEED [led_effect progress_bar] leds = neopixel:back autostart = true frame_rate = 24 layers = progress -1 0 add ( 0, 0, 1),( 0, 0.1, 0.6) static 0 0 top ( 0, 0, 0.1) [gcode_macro update_git] gcode = {% set message = params.MESSAGE|default() %} {% if message %} RUN_SHELL_COMMAND CMD=update_git_script_message PARAMS="'{params.MESSAGE}'" {% else %} RUN_SHELL_COMMAND CMD=update_git_script {% endif %} [gcode_shell_command update_git_script] command = bash -c "bash $HOME/klipper-backup/script.sh" timeout = 90.0 verbose = True [gcode_shell_command update_git_script_message] command = bash -c "bash $HOME/klipper-backup/script.sh $0" timeout = 90.0 verbose = True [bed_mesh default] version = 1 points = -0.026610, 0.013390, 0.018390, 0.013390, 0.048390 0.133390, 0.118390, 0.073390, 0.048390, 0.048390 0.298390, 0.243390, 0.198390, 0.153390, 0.123390 0.328390, 0.273390, 0.208390, 0.168390, 0.118390 0.118390, 0.078390, 0.028390, -0.001610, -0.016610 x_count = 5 y_count = 5 mesh_x_pps = 2 mesh_y_pps = 2 algo = bicubic tension = 0.2 min_x = 55.0 max_x = 245.0 min_y = 10.0 max_y = 290.0 ======================= Extruder max_extrude_ratio=103.937922 Config error Traceback (most recent call last): File "/home/biqu/klipper/klippy/klippy.py", line 175, in _connect self._read_config() File "/home/biqu/klipper/klippy/klippy.py", line 145, in _read_config pconfig.check_unused_options(config) File "/home/biqu/klipper/klippy/configfile.py", line 308, in check_unused_options raise error("Option '%s' is not valid in section '%s'" configparser.Error: Option 'sensor_pin' is not valid in section 'temperature_sensor bed_top' webhooks client 281473457321344: New connection webhooks client 281473457321344: Client info {'program': 'Moonraker', 'version': 'v0.8.0-331-gc857e1a'} Unable to issue reset command on MCU 'mcu' Unable to issue reset command on MCU 'EBBCan' Unable to issue reset command on MCU 'CB1' webhooks client 281473457321344: Disconnected Restarting printer Start printer at Sat Apr 27 00:38:18 2024 (1714178298.1 1827.8) ===== Config file ===== [mcu] canbus_uuid = b983bbdcfe30 [mcu EBBCan] canbus_uuid = d8d5848615b3 [mcu CB1] serial = /tmp/klipper_host_mcu [printer] kinematics = corexy max_velocity = 500 max_accel = 10000 max_z_velocity = 50 max_z_accel = 500 [virtual_sdcard] path = /home/biqu/printer_data/gcodes on_error_gcode = CANCEL_PRINT [pause_resume] [display_status] [respond] [gcode_macro CANCEL_PRINT] description = Cancel the actual running print rename_existing = CANCEL_PRINT_BASE gcode = PRINT_END [gcode_macro PAUSE] description = Pause the actual running print rename_existing = PAUSE_BASE gcode = {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %} {% set idle_timeout = client.idle_timeout|default(0) %} {% set temp = printer[printer.toolhead.extruder].target if printer.toolhead.extruder != '' else 0 %} {% set restore = False if printer.toolhead.extruder == '' else True if params.RESTORE|default(1)|int == 1 else False %} SET_GCODE_VARIABLE MACRO=RESUME VARIABLE=last_extruder_temp VALUE="{{'restore': restore, 'temp': temp}}" {% if idle_timeout > 0 %} SET_GCODE_VARIABLE MACRO=RESUME VARIABLE=restore_idle_timeout VALUE={printer.configfile.settings.idle_timeout.timeout} SET_IDLE_TIMEOUT TIMEOUT={idle_timeout} {% endif %} PAUSE_BASE {client.user_pause_macro|default("")} _TOOLHEAD_PARK_PAUSE_CANCEL {rawparams} [gcode_macro RESUME] description = Resume the actual running print rename_existing = RESUME_BASE variable_last_extruder_temp = {'restore': False, 'temp': 0} variable_restore_idle_timeout = 0 variable_idle_state = False gcode = {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %} {% set velocity = printer.configfile.settings.pause_resume.recover_velocity %} {% set sp_move = client.speed_move|default(velocity) %} {% set runout_resume = True if client.runout_sensor|default("") == "" else True if not printer[client.runout_sensor].enabled else printer[client.runout_sensor].filament_detected %} {% set can_extrude = True if printer.toolhead.extruder == '' else printer[printer.toolhead.extruder].can_extrude %} {% set do_resume = False %} {% set prompt_txt = [] %} {% if printer.idle_timeout.state|upper == "IDLE" or idle_state %} SET_GCODE_VARIABLE MACRO=RESUME VARIABLE=idle_state VALUE=False {% if last_extruder_temp.restore %} RESPOND TYPE=echo MSG='{"Restoring \"%s\" temperature to %3.1f\u00B0C, this may take some time" % (printer.toolhead.extruder, last_extruder_temp.temp) }' M109 S{last_extruder_temp.temp} {% set do_resume = True %} {% elif can_extrude %} {% set do_resume = True %} {% else %} RESPOND TYPE=error MSG='{"Resume aborted !!! \"%s\" not hot enough, please heat up again and press RESUME" % printer.toolhead.extruder}' {% set _d = prompt_txt.append("\"%s\" not hot enough, please heat up again and press RESUME" % printer.toolhead.extruder) %} {% endif %} {% elif can_extrude %} {% set do_resume = True %} {% else %} RESPOND TYPE=error MSG='{"Resume aborted !!! \"%s\" not hot enough, please heat up again and press RESUME" % printer.toolhead.extruder}' {% set _d = prompt_txt.append("\"%s\" not hot enough, please heat up again and press RESUME" % printer.toolhead.extruder) %} {% endif %} {% if runout_resume %} {% if do_resume %} {% if restore_idle_timeout > 0 %} SET_IDLE_TIMEOUT TIMEOUT={restore_idle_timeout} {% endif %} {client.user_resume_macro|default("")} _CLIENT_EXTRUDE RESUME_BASE VELOCITY={params.VELOCITY|default(sp_move)} {% endif %} {% else %} RESPOND TYPE=error MSG='{"Resume aborted !!! \"%s\" detects no filament, please load filament and press RESUME" % (client.runout_sensor.split(" "))[1]}' {% set _d = prompt_txt.append("\"%s\" detects no filament, please load filament and press RESUME" % (client.runout_sensor.split(" "))[1]) %} {% endif %} {% if not (runout_resume and do_resume) %} RESPOND TYPE=command MSG="action:prompt_begin RESUME aborted !!!" {% for element in prompt_txt %} RESPOND TYPE=command MSG='{"action:prompt_text %s" % element}' {% endfor %} RESPOND TYPE=command MSG="action:prompt_footer_button Ok|RESPOND TYPE=command MSG=action:prompt_end|info" RESPOND TYPE=command MSG="action:prompt_show" {% endif %} [gcode_macro SET_PAUSE_NEXT_LAYER] description = Enable a pause if the next layer is reached gcode = {% set pause_next_layer = printer['gcode_macro SET_PRINT_STATS_INFO'].pause_next_layer %} {% set ENABLE = params.ENABLE|default(1)|int != 0 %} {% set MACRO = params.MACRO|default(pause_next_layer.call, True) %} SET_GCODE_VARIABLE MACRO=SET_PRINT_STATS_INFO VARIABLE=pause_next_layer VALUE="{{ 'enable': ENABLE, 'call': MACRO }}" [gcode_macro SET_PAUSE_AT_LAYER] description = Enable/disable a pause if a given layer number is reached gcode = {% set pause_at_layer = printer['gcode_macro SET_PRINT_STATS_INFO'].pause_at_layer %} {% set ENABLE = params.ENABLE|int != 0 if params.ENABLE is defined else params.LAYER is defined %} {% set LAYER = params.LAYER|default(pause_at_layer.layer)|int %} {% set MACRO = params.MACRO|default(pause_at_layer.call, True) %} SET_GCODE_VARIABLE MACRO=SET_PRINT_STATS_INFO VARIABLE=pause_at_layer VALUE="{{ 'enable': ENABLE, 'layer': LAYER, 'call': MACRO }}" [gcode_macro SET_PRINT_STATS_INFO] rename_existing = SET_PRINT_STATS_INFO_BASE description = Overwrite, to get pause_next_layer and pause_at_layer feature variable_pause_next_layer = { 'enable': False, 'call': "PAUSE" } variable_pause_at_layer = { 'enable': False, 'layer': 0, 'call': "PAUSE" } gcode = {% if pause_next_layer.enable %} RESPOND TYPE=echo MSG='{"%s, forced by pause_next_layer" % pause_next_layer.call}' {pause_next_layer.call} SET_PAUSE_NEXT_LAYER ENABLE=0 {% elif pause_at_layer.enable and params.CURRENT_LAYER is defined and params.CURRENT_LAYER|int == pause_at_layer.layer %} RESPOND TYPE=echo MSG='{"%s, forced by pause_at_layer [%d]" % (pause_at_layer.call, pause_at_layer.layer)}' {pause_at_layer.call} SET_PAUSE_AT_LAYER ENABLE=0 {% endif %} SET_PRINT_STATS_INFO_BASE {rawparams} [gcode_macro _TOOLHEAD_PARK_PAUSE_CANCEL] description = Helper: park toolhead used in PAUSE and CANCEL_PRINT gcode = {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %} {% set velocity = printer.configfile.settings.pause_resume.recover_velocity %} {% set use_custom = client.use_custom_pos|default(false)|lower == 'true' %} {% set custom_park_x = client.custom_park_x|default(0.0) %} {% set custom_park_y = client.custom_park_y|default(0.0) %} {% set park_dz = client.custom_park_dz|default(2.0)|abs %} {% set sp_hop = client.speed_hop|default(15) * 60 %} {% set sp_move = client.speed_move|default(velocity) * 60 %} {% set origin = printer.gcode_move.homing_origin %} {% set act = printer.gcode_move.gcode_position %} {% set max = printer.toolhead.axis_maximum %} {% set cone = printer.toolhead.cone_start_z|default(max.z) %} {% set round_bed = True if printer.configfile.settings.printer.kinematics is in ['delta','polar','rotary_delta','winch'] else False %} {% set z_min = params.Z_MIN|default(0)|float %} {% set z_park = [[(act.z + park_dz), z_min]|max, (max.z - origin.z)]|min %} {% set x_park = params.X if params.X is defined else custom_park_x if use_custom else 0.0 if round_bed else (max.x - 5.0) %} {% set y_park = params.Y if params.Y is defined else custom_park_y if use_custom else (max.y - 5.0) if round_bed and z_park < cone else 0.0 if round_bed else (max.y - 5.0) %} _CLIENT_RETRACT {% if "xyz" in printer.toolhead.homed_axes %} G90 G1 Z{z_park} F{sp_hop} G1 X{x_park} Y{y_park} F{sp_move} {% if not printer.gcode_move.absolute_coordinates %} G91 {% endif %} {% else %} RESPOND TYPE=echo MSG='Printer not homed' {% endif %} [gcode_macro _CLIENT_EXTRUDE] description = Extrudes, if the extruder is hot enough gcode = {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %} {% set use_fw_retract = (client.use_fw_retract|default(false)|lower == 'true') and (printer.firmware_retraction is defined) %} {% set length = params.LENGTH|default(client.unretract)|default(1.0)|float %} {% set speed = params.SPEED|default(client.speed_unretract)|default(35) %} {% set absolute_extrude = printer.gcode_move.absolute_extrude %} {% if printer.toolhead.extruder != '' %} {% if printer[printer.toolhead.extruder].can_extrude %} {% if use_fw_retract %} {% if length < 0 %} G10 {% else %} G11 {% endif %} {% else %} M83 G1 E{length} F{(speed|float|abs) * 60} {% if absolute_extrude %} M82 {% endif %} {% endif %} {% else %} RESPOND TYPE=echo MSG='{"\"%s\" not hot enough" % printer.toolhead.extruder}' {% endif %} {% endif %} [gcode_macro _CLIENT_RETRACT] description = Retracts, if the extruder is hot enough gcode = {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %} {% set length = params.LENGTH|default(client.retract)|default(1.0)|float %} {% set speed = params.SPEED|default(client.speed_retract)|default(35) %} _CLIENT_EXTRUDE LENGTH=-{length|float|abs} SPEED={speed|float|abs} [gcode_arcs] resolution = 1 [exclude_object] [gcode_macro AXES_MAP_CALIBRATION] gcode = {% set z_height = params.Z_HEIGHT|default(20)|int %} {% set speed = params.SPEED|default(80)|float * 60 %} {% set accel = params.ACCEL|default(1500)|int %} {% set feedrate_travel = params.TRAVEL_SPEED|default(120)|int * 60 %} {% set accel_chip = params.ACCEL_CHIP|default("adxl345") %} {% set mid_x = printer.toolhead.axis_maximum.x|float / 2 %} {% set mid_y = printer.toolhead.axis_maximum.y|float / 2 %} {% set accel = [accel, printer.configfile.settings.printer.max_accel]|min %} {% set old_accel = printer.toolhead.max_accel %} {% set old_cruise_ratio = printer.toolhead.minimum_cruise_ratio %} {% set old_sqv = printer.toolhead.square_corner_velocity %} {% if not 'xyz' in printer.toolhead.homed_axes %} { action_raise_error("Must Home printer first!") } {% endif %} {action_respond_info("")} {action_respond_info("Starting accelerometer axe_map calibration")} {action_respond_info("This operation can not be interrupted by normal means. Hit the \"emergency stop\" button to stop it if needed")} {action_respond_info("")} SAVE_GCODE_STATE NAME=STATE_AXESMAP_CALIBRATION G90 SET_VELOCITY_LIMIT ACCEL={accel} MINIMUM_CRUISE_RATIO=0 SQUARE_CORNER_VELOCITY={[(accel / 1000), 5.0]|max} G1 Z{z_height} F{feedrate_travel / 8} G1 X{mid_x - 15} Y{mid_y - 15} F{feedrate_travel} G4 P500 ACCELEROMETER_MEASURE CHIP={accel_chip} G4 P1000 G1 X{mid_x + 15} F{speed} G4 P1000 G1 Y{mid_y + 15} F{speed} G4 P1000 G1 Z{z_height + 15} F{speed} G4 P1000 ACCELEROMETER_MEASURE CHIP={accel_chip} NAME=axemap RESPOND MSG="Analysis of the movements..." RUN_SHELL_COMMAND CMD=shaketune PARAMS="--type axesmap --accel {accel|int} --chip_name {accel_chip}" SET_VELOCITY_LIMIT ACCEL={old_accel} MINIMUM_CRUISE_RATIO={old_cruise_ratio} SQUARE_CORNER_VELOCITY={old_sqv} RESTORE_GCODE_STATE NAME=STATE_AXESMAP_CALIBRATION [gcode_macro AXES_SHAPER_CALIBRATION] description = Perform standard axis input shaper tests on one or both XY axes to select the best input shaper filter gcode = {% set min_freq = params.FREQ_START|default(5)|float %} {% set max_freq = params.FREQ_END|default(133.3)|float %} {% set hz_per_sec = params.HZ_PER_SEC|default(1)|float %} {% set axis = params.AXIS|default("all")|string|lower %} {% set scv = params.SCV|default(None) %} {% set max_sm = params.MAX_SMOOTHING|default(None) %} {% set keep_results = params.KEEP_N_RESULTS|default(3)|int %} {% set keep_csv = params.KEEP_CSV|default(True) %} {% set X, Y = False, False %} {% if axis == "all" %} {% set X, Y = True, True %} {% elif axis == "x" %} {% set X = True %} {% elif axis == "y" %} {% set Y = True %} {% else %} { action_raise_error("AXIS selection invalid. Should be either all, x or y!") } {% endif %} {% if scv is none %} {% set scv = printer.toolhead.square_corner_velocity %} {% endif %} {% if X %} TEST_RESONANCES AXIS=X OUTPUT=raw_data NAME=x FREQ_START={min_freq} FREQ_END={max_freq} HZ_PER_SEC={hz_per_sec} M400 RESPOND MSG="X axis frequency profile generation..." RESPOND MSG="This may take some time (1-3min)" RUN_SHELL_COMMAND CMD=shaketune PARAMS="--type shaper --scv {scv} {% if max_sm is not none %}--max_smoothing {max_sm}{% endif %} {% if keep_csv %}--keep_csv{% endif %}" {% endif %} {% if Y %} TEST_RESONANCES AXIS=Y OUTPUT=raw_data NAME=y FREQ_START={min_freq} FREQ_END={max_freq} HZ_PER_SEC={hz_per_sec} M400 RESPOND MSG="Y axis frequency profile generation..." RESPOND MSG="This may take some time (1-3min)" RUN_SHELL_COMMAND CMD=shaketune PARAMS="--type shaper --scv {scv} {% if max_sm is not none %}--max_smoothing {max_sm}{% endif %} {% if keep_csv %}--keep_csv{% endif %}" {% endif %} M400 RUN_SHELL_COMMAND CMD=shaketune PARAMS="--type clean --keep_results {keep_results}" [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 = {% 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 keep_results = params.KEEP_N_RESULTS|default(3)|int %} {% set keep_csv = params.KEEP_CSV|default(True) %} 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 MSG="Belts comparative frequency profile generation..." RESPOND MSG="This may take some time (3-5min)" RUN_SHELL_COMMAND CMD=shaketune PARAMS="--type belts {% if keep_csv %}--keep_csv{% endif %}" M400 RUN_SHELL_COMMAND CMD=shaketune PARAMS="--type clean --keep_results {keep_results}" [gcode_macro EXCITATE_AXIS_AT_FREQ] description = Maintain a specified excitation frequency for a period of time to diagnose and locate a source of vibration 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 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 %} TEST_RESONANCES OUTPUT=raw_data AXIS={axis} FREQ_START={frequency-1} FREQ_END={frequency+1} HZ_PER_SEC={1/(time/3)} M400 [gcode_macro VIBRATIONS_CALIBRATION] gcode = {% set size = params.SIZE|default(60)|int %} {% set direction = params.DIRECTION|default('XY') %} {% set z_height = params.Z_HEIGHT|default(20)|int %} {% set min_speed = params.MIN_SPEED|default(20)|float * 60 %} {% set max_speed = params.MAX_SPEED|default(200)|float * 60 %} {% set speed_increment = params.SPEED_INCREMENT|default(2)|float * 60 %} {% set feedrate_travel = params.TRAVEL_SPEED|default(200)|int * 60 %} {% set accel = params.ACCEL|default(3000)|int %} {% set accel_chip = params.ACCEL_CHIP|default("adxl345") %} {% set keep_results = params.KEEP_N_RESULTS|default(3)|int %} {% set keep_csv = params.KEEP_CSV|default(True) %} {% set mid_x = printer.toolhead.axis_maximum.x|float / 2 %} {% set mid_y = printer.toolhead.axis_maximum.y|float / 2 %} {% set nb_samples = ((max_speed - min_speed) / speed_increment + 1) | int %} {% set accel = [accel, printer.configfile.settings.printer.max_accel]|min %} {% set old_accel = printer.toolhead.max_accel %} {% set old_cruise_ratio = printer.toolhead.minimum_cruise_ratio %} {% set old_sqv = printer.toolhead.square_corner_velocity %} {% set direction_factor = { 'XY' : { 'start' : {'x': -0.5, 'y': -0.5 }, 'move_factors' : { '0' : {'x': 0.5, 'y': -0.5, 'z': 0.0 }, '1' : {'x': 0.5, 'y': 0.5, 'z': 0.0 }, '2' : {'x': -0.5, 'y': 0.5, 'z': 0.0 }, '3' : {'x': -0.5, 'y': -0.5, 'z': 0.0 } } }, 'AB' : { 'start' : {'x': 0.0, 'y': 0.0 }, 'move_factors' : { '0' : {'x': 0.5, 'y': -0.5, 'z': 0.0 }, '1' : {'x': -0.5, 'y': 0.5, 'z': 0.0 }, '2' : {'x': 0.0, 'y': 0.0, 'z': 0.0 }, '3' : {'x': 0.5, 'y': 0.5, 'z': 0.0 }, '4' : {'x': -0.5, 'y': -0.5, 'z': 0.0 }, '5' : {'x': 0.0, 'y': 0.0, 'z': 0.0 } } }, 'ABXY' : { 'start' : {'x': -0.5, 'y': 0.5 }, 'move_factors' : { '0' : {'x': -0.5, 'y': -0.5, 'z': 0.0 }, '1' : {'x': 0.5, 'y': -0.5, 'z': 0.0 }, '2' : {'x': -0.5, 'y': 0.5, 'z': 0.0 }, '3' : {'x': 0.5, 'y': 0.5, 'z': 0.0 }, '4' : {'x': -0.5, 'y': -0.5, 'z': 0.0 }, '5' : {'x': -0.5, 'y': 0.5, 'z': 0.0 } } }, 'B' : { 'start' : {'x': 0.5, 'y': 0.5 }, 'move_factors' : { '0' : {'x': -0.5, 'y': -0.5, 'z': 0.0 }, '1' : {'x': 0.5, 'y': 0.5, 'z': 0.0 } } }, 'A' : { 'start' : {'x': -0.5, 'y': 0.5 }, 'move_factors' : { '0' : {'x': 0.5, 'y': -0.5, 'z': 0.0 }, '1' : {'x': -0.5, 'y': 0.5, 'z': 0.0 } } }, 'X' : { 'start' : {'x': -0.5, 'y': 0.0 }, 'move_factors' : { '0' : {'x': 0.5, 'y': 0.0, 'z': 0.0 }, '1' : {'x': -0.5, 'y': 0.0, 'z': 0.0 } } }, 'Y' : { 'start' : {'x': 0.0, 'y': 0.5 }, 'move_factors' : { '0' : {'x': 0.0, 'y': -0.5, 'z': 0.0 }, '1' : {'x': 0.0, 'y': 0.5, 'z': 0.0 } } }, 'Z' : { 'start' : {'x': 0.0, 'y': 0.0 }, 'move_factors' : { '0' : {'x': 0.0, 'y': 0.0, 'z': 1.0 }, '1' : {'x': 0.0, 'y': 0.0, 'z': 0.0 } } }, 'E' : { 'start' : {'x': 0.0, 'y': 0.0 }, 'move_factor' : 0.05 } } %} {% if not 'xyz' in printer.toolhead.homed_axes %} { action_raise_error("Must Home printer first!") } {% endif %} {% if params.SPEED_INCREMENT|default(2)|float * 100 != (params.SPEED_INCREMENT|default(2)|float * 100)|int %} { action_raise_error("Only 2 decimal digits are allowed for SPEED_INCREMENT") } {% endif %} {% if (size / (max_speed / 60)) < 0.25 and direction != 'E' %} { action_raise_error("SIZE is too small for this MAX_SPEED. Increase SIZE or decrease MAX_SPEED!") } {% endif %} {% if not (direction in direction_factor) %} { action_raise_error("DIRECTION is not valid. Only XY, AB, ABXY, A, B, X, Y, Z or E is allowed!") } {% endif %} {action_respond_info("")} {action_respond_info("Starting speed and vibration calibration")} {action_respond_info("This operation can not be interrupted by normal means. Hit the \"emergency stop\" button to stop it if needed")} {action_respond_info("")} SAVE_GCODE_STATE NAME=STATE_VIBRATIONS_CALIBRATION G90 SET_VELOCITY_LIMIT ACCEL={accel} MINIMUM_CRUISE_RATIO=0 SQUARE_CORNER_VELOCITY={[(accel / 1000), 5.0]|max} G1 Z{z_height} F{feedrate_travel / 10} G1 X{mid_x + (size * direction_factor[direction].start.x) } Y{mid_y + (size * direction_factor[direction].start.y)} F{feedrate_travel} {% for curr_sample in range(0, nb_samples) %} {% set curr_speed = min_speed + curr_sample * speed_increment %} RESPOND MSG="{"Current speed: %.2f mm/s" % (curr_speed / 60)|float}" ACCELEROMETER_MEASURE CHIP={accel_chip} {% if direction == 'E' %} G0 E{curr_speed*direction_factor[direction].move_factor} F{curr_speed} {% else %} {% for key, factor in direction_factor[direction].move_factors|dictsort %} G1 X{mid_x + (size * factor.x) } Y{mid_y + (size * factor.y)} Z{z_height + (size * factor.z)} F{curr_speed} {% endfor %} {% endif %} ACCELEROMETER_MEASURE CHIP={accel_chip} NAME=sp{("%.2f" % (curr_speed / 60)|float)|replace('.','_')}n1 G4 P300 M400 {% endfor %} RESPOND MSG="Machine and motors vibration graph generation..." RESPOND MSG="This may take some time (3-5min)" RUN_SHELL_COMMAND CMD=shaketune PARAMS="--type vibrations --axis_name {direction} --accel {accel|int} --chip_name {accel_chip} {% if keep_csv %}--keep_csv{% endif %}" M400 RUN_SHELL_COMMAND CMD=shaketune PARAMS="--type clean --keep_results {keep_results}" SET_VELOCITY_LIMIT ACCEL={old_accel} MINIMUM_CRUISE_RATIO={old_cruise_ratio} SQUARE_CORNER_VELOCITY={old_sqv} RESTORE_GCODE_STATE NAME=STATE_VIBRATIONS_CALIBRATION [gcode_shell_command shaketune] command = ~/printer_data/config/K-ShakeTune/scripts/shaketune.sh timeout = 600.0 verbose = True [stepper_x] step_pin = PE6 dir_pin = !PE5 enable_pin = multi_pin:z_enable microsteps = 16 rotation_distance = 32 endstop_pin = EBBCan: PB6 position_endstop = 0 position_max = 315 homing_speed = 50 [stepper_y] step_pin = PE2 dir_pin = !PE1 enable_pin = !PE4 microsteps = 16 rotation_distance = 32 endstop_pin = ^PF3 position_endstop = 300 position_max = 300 homing_speed = 50 [stepper_z] step_pin = PB8 dir_pin = PB7 enable_pin = !PE0 microsteps = 16 rotation_distance = 32 endstop_pin = probe:z_virtual_endstop position_max = 230 position_min = -5.0 homing_speed = 20 second_homing_speed = 10 homing_retract_dist = 5 [stepper_z1] step_pin = PB4 dir_pin = !PB3 enable_pin = !PB6 microsteps = 16 rotation_distance = 32 [stepper_z2] step_pin = PG13 dir_pin = !PG12 enable_pin = !PG15 microsteps = 16 rotation_distance = 32 [extruder] step_pin = EBBCan: PD0 dir_pin = EBBCan: PD1 enable_pin = !EBBCan: PD2 microsteps = 16 rotation_distance = 3.43 nozzle_diameter = 0.600 filament_diameter = 1.750 heater_pin = EBBCan: PB13 sensor_type = EPCOS 100K B57560G104F sensor_pin = EBBCan: PA3 min_temp = 0 max_temp = 250 max_extrude_cross_section = 250 max_extrude_only_distance = 250 control = pid pid_kp = 16.610 pid_ki = 0.527 pid_kd = 130.805 [tmc5160 stepper_x] cs_pin = PC13 spi_software_mosi_pin = PG6 spi_software_miso_pin = PG7 spi_software_sclk_pin = PG8 run_current = 1.400 [tmc5160 stepper_y] cs_pin = PE3 spi_software_mosi_pin = PG6 spi_software_miso_pin = PG7 spi_software_sclk_pin = PG8 run_current = 1.400 [tmc2209 stepper_z] uart_pin = PB9 run_current = 0.850 stealthchop_threshold = 999999 [tmc2209 stepper_z1] uart_pin = PB5 run_current = 0.850 stealthchop_threshold = 999999 [tmc2209 stepper_z2] uart_pin = PG14 run_current = 0.850 stealthchop_threshold = 999999 [tmc2209 extruder] uart_pin = EBBCan: PA15 run_current = 0.650 [multi_pin z_enable] pins = !PC14, PA5 [heater_bed] heater_pin = PA0 sensor_type = ATC Semitec 104GT-2 sensor_pin = PB1 control = pid pid_kp = 54.027 pid_ki = 0.770 pid_kd = 948.182 min_temp = 0 max_temp = 130 [fan] pin = EBBCan: PA1 [heater_fan hotend_fan] pin = EBBCan: PA0 heater = extruder heater_temp = 50.0 [controller_fan tmc_fan] pin = PF7 stepper = stepper_x [temperature_fan CB1] pin = PF8 sensor_type = temperature_host min_temp = 10 max_temp = 90 control = pid pid_kp = 2 pid_ki = 4 pid_kd = 0.1 [temperature_sensor mcu_temp] sensor_type = temperature_mcu min_temp = 0 max_temp = 100 [temperature_sensor EBB_Temperature] sensor_type = temperature_mcu sensor_mcu = EBBCan [temperature_sensor bed_top] sensor_type = EPCOS 100K B57560G104F sensor_pin = PB0 [temperature_sensor Chamber_Middle] sensor_type = AHT10 i2c_mcu = mcu [bltouch] sensor_pin = ^EBBCan:PB8 control_pin = EBBCan:PB9 stow_on_each_sample = false probe_with_touch_mode = true x_offset = 55 y_offset = 0 speed = 10 lift_speed = 20 samples = 2 samples_tolerance_retries = 4 z_offset = 1.200 [idle_timeout] timeout = 960000 [filament_switch_sensor switch_sensor] switch_pin = ^PF0 pause_on_runout = false runout_gcode = PAUSE [filament_motion_sensor motion_sensor] switch_pin = ^PC15 detection_length = 4 extruder = extruder pause_on_runout = false runout_gcode = PAUSE [neopixel outside] pin = CB1: gpio259 chain_count = 79 color_order = GRB initial_red = 0.5 initial_green = 0.5 initial_blue = 0.5 [neopixel back] pin = PD15 chain_count = 29 color_order = GRB initial_red = 0.5 initial_green = 0.5 initial_blue = 0.5 [z_tilt] z_positions = 0, 25 300, 25 150, 300 points = 0, 20 245, 20 95, 295 speed = 125 horizontal_move_z = 10 retries = 8 retry_tolerance = 0.01 [bed_mesh] speed = 125 horizontal_move_z = 10 mesh_min = 55, 10 mesh_max = 245,290 probe_count = 5, 5 algorithm = bicubic bicubic_tension = 0.2 fade_start = 1 fade_end = 10 fade_target = 0 [safe_z_home] home_xy_position = 100, 150 speed = 150 [input_shaper] shaper_freq_x = 83.8 shaper_type_x = mzv shaper_freq_y = 65.2 shaper_type_y = mzv [adxl345] cs_pin = EBBCan: PB12 spi_software_sclk_pin = EBBCan: PB10 spi_software_mosi_pin = EBBCan: PB11 spi_software_miso_pin = EBBCan: PB2 axes_map = x,y,z [resonance_tester] accel_chip = adxl345 probe_points = 160, 150, 50 [gcode_macro PRINT_START] gcode = {% set BED = params.BED_TEMP|int %} {% set EXTRUDER = params.EXTRUDER_TEMP|int %} M140 S{BED} M104 S{EXTRUDER} G28 Z_TILT_ADJUST BED_MESH_CALIBRATE _ADAPTIVE_PURGE_V1 [gcode_macro Z_TILT_ADJUST] rename_existing = Z_TILT_ADJUST_1 gcode = {% if printer["gcode_macro status_leveling"] != null %} status_leveling {% endif %} Z_TILT_ADJUST_1 { rawparams } {% if printer["gcode_macro status_ready"] != null %} status_ready {% endif %} [gcode_macro BED_MESH_CALIBRATE] rename_existing = _BED_MESH_CALIBRATE variable_buffer = 2 gcode = {% set bedMeshConfig = printer['configfile'].config["bed_mesh"] %} {% set bed_mesh_min = bedMeshConfig.mesh_min %} {% set bed_mesh_max = bedMeshConfig.mesh_max %} {% set all_points = printer.exclude_object.objects | map(attribute='polygon') | sum(start=[]) %} {% 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]) %} {% if printer["bed_mesh"].profile_name == '' %} { action_respond_info("No existing bed mesh found.") } {% set last_area_end_x=-1 %} {% endif %} {% if printer.toolhead.homed_axes != "xyz" %} G28 {% endif %} {% set klicky_available = printer['gcode_macro _Probe_Variables'] != null %} {% set probeConfig = printer['configfile'].config["probe"] %} {% if probeConfig %} {% set OffsetX = probeConfig.x_offset|default(0)|float %} {% set OffsetY = probeConfig.y_offset|default(0)|float %} {% endif %} {% set print_min_x = x_min|float %} {% set print_min_y = y_min|float %} {% set print_max_x = x_max|float %} {% set print_max_y = y_max|float %} {% set mesh_min_x = bed_mesh_min.split(",")[0]|float %} {% set mesh_min_y = bed_mesh_min.split(",")[1]|float %} {% set mesh_max_x = bed_mesh_max.split(",")[0]|float %} {% set mesh_max_y = bed_mesh_max.split(",")[1]|float %} {% if (print_min_x < mesh_min_x) or (print_max_x > mesh_max_x) or (print_min_y < mesh_min_y) or (print_max_y > mesh_max_y) %} {% set print_min_x = mesh_min_x %} {% set print_min_y = mesh_min_y %} {% set print_max_x = mesh_max_x %} {% set print_max_y = mesh_max_y %} {% endif %} {% if klicky_available %} _CheckProbe action=query Attach_Probe {% elif euclid_available %} DEPLOY_PROBE {% endif %} {% if (print_min_x < print_max_x) and (print_min_y < print_max_y) %} {% set minimum_probe_count = 3 %} {% set medium_probe_count = 5 %} {% set probe_count = bedMeshConfig.probe_count.split(",") %} {% set probe_count_x = probe_count[0]|int %} {% if probe_count.__len__() > 1 %} {% set probe_count_y = probe_count[1]|int %} {% else %} {% set probe_count_y = probe_count_x|int %} {% endif %} {% set relative_reference_index = bedMeshConfig.relative_reference_index %} {% if print_max_x - print_min_x < (mesh_max_x - mesh_min_x) * 0.75 %} {% set probe_count_x = medium_probe_count %} {% endif %} {% if print_max_y - print_min_y < (mesh_max_y - mesh_min_y) * 0.75 %} {% set probe_count_y = medium_probe_count %} {% endif %} {% if print_max_x - print_min_x < (mesh_max_x - mesh_min_x) * 0.50 %} {% set probe_count_x = minimum_probe_count %} {% endif %} {% if print_max_y - print_min_y < (mesh_max_y - mesh_min_y) * 0.50 %} {% set probe_count_y = minimum_probe_count %} {% endif %} {% if print_min_x - buffer >= mesh_min_x %} {% set mesh_min_x = print_min_x - buffer %} {% endif %} {% if print_min_y - buffer >= mesh_min_y %} {% set mesh_min_y = print_min_y - buffer %} {% endif %} {% if print_max_x + buffer <= mesh_max_x %} {% set mesh_max_x = print_max_x + buffer %} {% endif %} {% if print_max_y + buffer <= mesh_max_y %} {% set mesh_max_y = print_max_y + buffer %} {% endif %} { action_respond_info("mesh_min: %s,%s" % (mesh_min_x, mesh_min_y)) } { action_respond_info("mesh_max: %s,%s" % (mesh_max_x, mesh_max_y)) } { action_respond_info("probe_count: %s,%s" % (probe_count_x,probe_count_y)) } {% if printer["gcode_macro status_meshing"] != null %} status_meshing {% endif %} {% if relative_reference_index == 0 or relative_reference_index == null %} _BED_MESH_CALIBRATE mesh_min={mesh_min_x},{mesh_min_y} mesh_max={mesh_max_x},{mesh_max_y} probe_count={probe_count_x},{probe_count_y} {% else %} {% set relative_reference_index = ((probe_count_x * probe_count_y - 1) / 2)|int %} { action_respond_info("relative_reference_index: %s" % relative_reference_index) } _BED_MESH_CALIBRATE mesh_min={mesh_min_x},{mesh_min_y} mesh_max={mesh_max_x},{mesh_max_y} probe_count={probe_count_x},{probe_count_y} relative_reference_index={relative_reference_index} {% endif %} {% else %} {% if printer["gcode_macro status_meshing"] != null %} status_meshing {% endif %} _BED_MESH_CALIBRATE {% endif %} {% if klicky_available %} Dock_Probe {% elif euclid_available %} STOW_PROBE {% endif %} {% if printer["gcode_macro status_ready"] != null %} status_ready {% endif %} [gcode_macro _ADAPTIVE_PURGE_V1] description = A purge macro that adapts to be near your actual printed objects variable_adaptive_enable = True variable_z_height = 0.3 variable_tip_distance = 10 variable_purge_amount = 30 variable_flow_rate = 10 variable_x_default = 5 variable_y_default = 5 variable_size = 16 variable_distance_to_object_x = 7 variable_distance_to_object_y = 7 gcode = {% if adaptive_enable == True %} {% set all_points = printer.exclude_object.objects | map(attribute='polygon') | sum(start=[]) %} {% set x_origin = (all_points | map(attribute=0) | min | default(x_default + distance_to_object_x + size)) - distance_to_object_x - size %} {% set y_origin = (all_points | map(attribute=1) | min | default(y_default + distance_to_object_y + size)) - distance_to_object_y - size %} {% set x_origin = ([x_origin, 0] | max) %} {% set y_origin = ([y_origin, 0] | max) %} {% if x_origin < x_default %} set x_origin = x_default | float {% endif %} {% if y_origin < y_default %} set y_origin = y_default | float {% endif %} {% else %} {% set x_origin = x_default | float %} {% set y_origin = y_default | float %} {% endif %} {% set purge_move_speed = 2.31 * size * flow_rate / (purge_amount * 2.405) %} {% set prepurge_speed = flow_rate / 2.405 %} {% set travel_speed = printer.toolhead.max_velocity %} { action_respond_info( "x: " + x_origin|string + " y: " + y_origin|string + " purge_move_speed: " + purge_move_speed|string + " prepurge_speed: " + prepurge_speed|string ) } G92 E0 G90 G0 X{x_origin} Y{y_origin+size/2} F3000 G0 Z{z_height} F1500 G0 F3000 M83 G1 E{tip_distance} F{prepurge_speed*60} G1 F600 G1 X{x_origin+size*0.1976875} Y{y_origin+size*0.0538125} E{purge_amount*0.00362396204033215} G1 X{x_origin+size*0.2070625} Y{y_origin+size*0.056375} E{purge_amount*0.00348517200474496} G1 X{x_origin+size*0.273} Y{y_origin+size*0.0889375} E{purge_amount*0.0253226571767497} G1 X{x_origin+size*0.3568125} Y{y_origin+size*0.125125} E{purge_amount*0.0313760379596679} G1 X{x_origin+size*0.442375} Y{y_origin+size*0.1563125} E{purge_amount*0.0312455516014235} G1 X{x_origin+size*0.5295625} Y{y_origin+size*0.1825} E{purge_amount*0.0311731909845789} G1 X{x_origin+size*0.5311875} Y{y_origin+size*0.1829375} E{purge_amount*0.000575326215895611} G1 X{x_origin+size*0.6196875} Y{y_origin+size*0.2038125} E{purge_amount*0.0311376037959668} G1 X{x_origin+size*0.7093125} Y{y_origin+size*0.219625} E{purge_amount*0.0312253855278766} G1 X{x_origin+size*0.799875} Y{y_origin+size*0.2301875} E{purge_amount*0.0313368920521945} G1 X{x_origin+size*0.8735625} Y{y_origin+size*0.2349375} E{purge_amount*0.0254270462633452} G1 X{x_origin+size*0.8824375} Y{y_origin+size*0.237} E{purge_amount*0.00326809015421115} G1 X{x_origin+size*0.8913125} Y{y_origin+size*0.2390625} E{purge_amount*0.00339739027283511} G1 X{x_origin+size*0.8959375} Y{y_origin+size*0.2481875} E{purge_amount*0.00381494661921708} G1 X{x_origin+size*0.9005} Y{y_origin+size*0.257375} E{purge_amount*0.00366548042704626} G1 X{x_origin+size*0.951125} Y{y_origin+size*0.4463125} E{purge_amount*0.0668623962040332} G1 X{x_origin+size*0.9521875} Y{y_origin+size*0.4540625} E{purge_amount*0.00276156583629893} G1 X{x_origin+size*0.9531875} Y{y_origin+size*0.46175} E{purge_amount*0.00282443653618031} G1 X{x_origin+size*0.9528125} Y{y_origin+size*0.4654375} E{purge_amount*0.00138078291814947} G1 X{x_origin+size*0.9458125} Y{y_origin+size*0.4720625} E{purge_amount*0.00359193357058126} G1 X{x_origin+size*0.9388125} Y{y_origin+size*0.4786875} E{purge_amount*0.00342467378410439} G1 X{x_origin+size*0.9145625} Y{y_origin+size*0.4951875} E{purge_amount*0.00993950177935943} G1 X{x_origin+size*0.8395} Y{y_origin+size*0.547875} E{purge_amount*0.0316453143534994} G1 X{x_origin+size*0.7680625} Y{y_origin+size*0.6045} E{purge_amount*0.0314733096085409} G1 X{x_origin+size*0.700125} Y{y_origin+size*0.665125} E{purge_amount*0.0314483985765125} G1 X{x_origin+size*0.6358125} Y{y_origin+size*0.7295} E{purge_amount*0.0314317912218268} G1 X{x_origin+size*0.5755625} Y{y_origin+size*0.7971875} E{purge_amount*0.0312977461447212} G1 X{x_origin+size*0.5465} Y{y_origin+size*0.8325625} E{purge_amount*0.0155836298932384} G1 X{x_origin+size*0.492125} Y{y_origin+size*0.9056875} E{purge_amount*0.0313190984578885} G1 X{x_origin+size*0.451125} Y{y_origin+size*0.967125} E{purge_amount*0.0254341637010676} G1 X{x_origin+size*0.444625} Y{y_origin+size*0.9739375} E{purge_amount*0.00337959667852906} G1 X{x_origin+size*0.4380625} Y{y_origin+size*0.98075} E{purge_amount*0.00353262158956109} G1 X{x_origin+size*0.428125} Y{y_origin+size*0.98} E{purge_amount*0.00372123368920522} G1 X{x_origin+size*0.41825} Y{y_origin+size*0.97925} E{purge_amount*0.00354211150652432} G1 X{x_origin+size*0.22925} Y{y_origin+size*0.928625} E{purge_amount*0.0668837485172005} G1 X{x_origin+size*0.2204375} Y{y_origin+size*0.924125} E{purge_amount*0.00351601423487545} G1 X{x_origin+size*0.2115625} Y{y_origin+size*0.919625} E{purge_amount*0.00366903914590747} G1 X{x_origin+size*0.2091875} Y{y_origin+size*0.910625} E{purge_amount*0.00343179122182681} G1 X{x_origin+size*0.2068125} Y{y_origin+size*0.9016875} E{purge_amount*0.00329774614472123} G1 X{x_origin+size*0.2020625} Y{y_origin+size*0.82825} E{purge_amount*0.0253404507710558} G1 X{x_origin+size*0.1915} Y{y_origin+size*0.737625} E{purge_amount*0.0313582443653618} G1 X{x_origin+size*0.17575} Y{y_origin+size*0.6479375} E{purge_amount*0.0312431791221827} G1 X{x_origin+size*0.154875} Y{y_origin+size*0.5593125} E{purge_amount*0.0311791221826809} G1 X{x_origin+size*0.1544375} Y{y_origin+size*0.5576875} E{purge_amount*0.000575326215895611} G1 X{x_origin+size*0.12825} Y{y_origin+size*0.470625} E{purge_amount*0.0311328588374852} G1 X{x_origin+size*0.0970625} Y{y_origin+size*0.385125} E{purge_amount*0.0312253855278766} G1 X{x_origin+size*0.061} Y{y_origin+size*0.3014375} E{purge_amount*0.0313190984578885} G1 X{x_origin+size*0.02825} Y{y_origin+size*0.2351875} E{purge_amount*0.0254483985765125} G1 X{x_origin+size*0.025625} Y{y_origin+size*0.226125} E{purge_amount*0.00338671411625148} G1 X{x_origin+size*0.023} Y{y_origin+size*0.2170625} E{purge_amount*0.00352313167259787} G1 X{x_origin+size*0.028625} Y{y_origin+size*0.208875} E{purge_amount*0.00370937129300119} G1 X{x_origin+size*0.03425} Y{y_origin+size*0.200625} E{purge_amount*0.003570581257414} G1 X{x_origin+size*0.1725625} Y{y_origin+size*0.0623125} E{purge_amount*0.0668623962040332} G1 X{x_origin+size*0.1804375} Y{y_origin+size*0.0568125} E{purge_amount*0.00343297746144721} G1 X{x_origin+size*0.18375} Y{y_origin+size*0.0545} E{purge_amount*0.00150652431791222} G92 E0 M82 G0 Z{z_height*2} {% if printer["gcode_macro status_printing"] != null %} status_printing {% endif %} [gcode_macro PRINT_END] gcode = M400 TURN_OFF_HEATERS M106 S0 PARK_CENTER_REAR G0 Z230 F3000 [gcode_macro PARK_CENTER_REAR] gcode = {% if printer["gcode_macro status_busy"] != null %} status_busy {% endif %} {% set th = printer.toolhead %} {% set x_safe = th.position.x + 20 * (1 if th.axis_maximum.x - th.position.x > 20 else -1) %} {% set y_safe = th.position.y + 20 * (1 if th.axis_maximum.y - th.position.y > 20 else -1) %} G0 X{th.axis_maximum.x//2} Y{th.axis_maximum.y - 2} F3600 {% if printer["gcode_macro status_ready"] != null %} status_ready {% endif %} [gcode_macro TEST_SPEED] gcode = G0 Z10 {% set speed = params.SPEED|default(printer.configfile.settings.printer.max_velocity)|int %} {% set iterations = params.ITERATIONS|default(5)|int %} {% set accel = params.ACCEL|default(printer.configfile.settings.printer.max_accel)|int %} {% set bound = params.BOUND|default(20)|int %} {% set smallpatternsize = SMALLPATTERNSIZE|default(20)|int %} {% set x_min = printer.toolhead.axis_minimum.x + bound %} {% set x_max = printer.toolhead.axis_maximum.x - bound %} {% set y_min = printer.toolhead.axis_minimum.y + bound %} {% set y_max = printer.toolhead.axis_maximum.y - bound %} {% set x_center = (printer.toolhead.axis_minimum.x|float + printer.toolhead.axis_maximum.x|float ) / 2 %} {% set y_center = (printer.toolhead.axis_minimum.y|float + printer.toolhead.axis_maximum.y|float ) / 2 %} {% set x_center_min = x_center - (smallpatternsize/2) %} {% set x_center_max = x_center + (smallpatternsize/2) %} {% set y_center_min = y_center - (smallpatternsize/2) %} {% set y_center_max = y_center + (smallpatternsize/2) %} SAVE_GCODE_STATE NAME=TEST_SPEED { action_respond_info("TEST_SPEED: starting %d iterations at speed %d, accel %d" % (iterations, speed, accel)) } M400 G28 {% if printer.configfile.settings.quad_gantry_level %} {% if printer.quad_gantry_level.applied == False %} QUAD_GANTRY_LEVEL G28 Z {% endif %} {% endif %} G90 G1 X{printer.toolhead.axis_maximum.x-50} Y{printer.toolhead.axis_maximum.y-50} F{30*60} M400 G28 X Y G0 X{printer.toolhead.axis_maximum.x-1} Y{printer.toolhead.axis_maximum.y-1} F{30*60} G4 P1000 GET_POSITION G0 X{x_min} Y{y_min} Z{bound + 10} F{speed*60} SET_VELOCITY_LIMIT VELOCITY={speed} ACCEL={accel} ACCEL_TO_DECEL={accel / 2} {% for i in range(iterations) %} G0 X{x_min} Y{y_min} F{speed*60} G0 X{x_max} Y{y_max} F{speed*60} G0 X{x_min} Y{y_min} F{speed*60} G0 X{x_max} Y{y_min} F{speed*60} G0 X{x_min} Y{y_max} F{speed*60} G0 X{x_max} Y{y_min} F{speed*60} G0 X{x_min} Y{y_min} F{speed*60} G0 X{x_min} Y{y_max} F{speed*60} G0 X{x_max} Y{y_max} F{speed*60} G0 X{x_max} Y{y_min} F{speed*60} G0 X{x_center_min} Y{y_center_min} F{speed*60} G0 X{x_center_max} Y{y_center_max} F{speed*60} G0 X{x_center_min} Y{y_center_min} F{speed*60} G0 X{x_center_max} Y{y_center_min} F{speed*60} G0 X{x_center_min} Y{y_center_max} F{speed*60} G0 X{x_center_max} Y{y_center_min} F{speed*60} G0 X{x_center_min} Y{y_center_min} F{speed*60} G0 X{x_center_min} Y{y_center_max} F{speed*60} G0 X{x_center_max} Y{y_center_max} F{speed*60} G0 X{x_center_max} Y{y_center_min} F{speed*60} {% endfor %} SET_VELOCITY_LIMIT VELOCITY={printer.configfile.settings.printer.max_velocity} ACCEL={printer.configfile.settings.printer.max_accel} M400 G28 G90 G0 X{printer.toolhead.axis_maximum.x-1} Y{printer.toolhead.axis_maximum.y-1} F{30*60} G4 P1000 GET_POSITION RESTORE_GCODE_STATE NAME=TEST_SPEED [led_effect progress_bar] leds = neopixel:back autostart = true frame_rate = 24 layers = progress -1 0 add ( 0, 0, 1),( 0, 0.1, 0.6) static 0 0 top ( 0, 0, 0.1) [gcode_macro update_git] gcode = {% set message = params.MESSAGE|default() %} {% if message %} RUN_SHELL_COMMAND CMD=update_git_script_message PARAMS="'{params.MESSAGE}'" {% else %} RUN_SHELL_COMMAND CMD=update_git_script {% endif %} [gcode_shell_command update_git_script] command = bash -c "bash $HOME/klipper-backup/script.sh" timeout = 90.0 verbose = True [gcode_shell_command update_git_script_message] command = bash -c "bash $HOME/klipper-backup/script.sh $0" timeout = 90.0 verbose = True [bed_mesh default] version = 1 points = -0.026610, 0.013390, 0.018390, 0.013390, 0.048390 0.133390, 0.118390, 0.073390, 0.048390, 0.048390 0.298390, 0.243390, 0.198390, 0.153390, 0.123390 0.328390, 0.273390, 0.208390, 0.168390, 0.118390 0.118390, 0.078390, 0.028390, -0.001610, -0.016610 x_count = 5 y_count = 5 mesh_x_pps = 2 mesh_y_pps = 2 algo = bicubic tension = 0.2 min_x = 55.0 max_x = 245.0 min_y = 10.0 max_y = 290.0 ======================= Extruder max_extrude_ratio=103.937922 mcu 'mcu': Starting CAN connect Created a socket webhooks client 281473474698976: New connection webhooks client 281473474698976: Client info {'program': 'Moonraker', 'version': 'v0.8.0-331-gc857e1a'} mcu 'mcu': got {'count': 1510, 'sum': 923103, 'sumsq': 2754516, '#name': 'stats', '#sent_time': 1830.265688122, '#receive_time': 1830.290236622} Loaded MCU 'mcu' 108 commands (v0.12.0-132-ge37b007f / gcc: (15:8-2019-q3-1+b1) 8.3.1 20190703 (release) [gcc-8-branch revision 273027] binutils: (2.35.2-2+14+b2) 2.35.2) MCU 'mcu' config: ADC_MAX=4095 BUS_PINS_i2c1_PB6_PB7=PB6,PB7 BUS_PINS_i2c1_PB8_PB9=PB8,PB9 BUS_PINS_i2c2_PB10_PB11=PB10,PB11 BUS_PINS_spi1=PA6,PA7,PA5 BUS_PINS_spi1a=PB4,PB5,PB3 BUS_PINS_spi2=PB14,PB15,PB13 BUS_PINS_spi2a=PC2,PC3,PB10 BUS_PINS_spi3a=PC11,PC12,PC10 BUS_PINS_spi4=PE13,PE14,PE12 BUS_PINS_spi5=PF8,PF9,PF7 BUS_PINS_spi5a=PH7,PF11,PH6 BUS_PINS_spi6=PG12,PG14,PG13 CANBUS_BRIDGE=1 CLOCK_FREQ=400000000 MCU=stm32h723xx PWM_MAX=255 RECEIVE_WINDOW=192 RESERVE_PINS_CAN=PD0,PD1 RESERVE_PINS_USB=PA11,PA12 RESERVE_PINS_crystal=PH0,PH1 STATS_SUMSQ_BASE=256 STEPPER_BOTH_EDGE=1 mcu 'EBBCan': Starting CAN connect Created a socket Loaded MCU 'EBBCan' 108 commands (v0.12.0-132-ge37b007f / gcc: (15:8-2019-q3-1+b1) 8.3.1 20190703 (release) [gcc-8-branch revision 273027] binutils: (2.35.2-2+14+b2) 2.35.2) MCU 'EBBCan' config: ADC_MAX=4095 BUS_PINS_i2c1_PA9_PA10=PA9,PA10 BUS_PINS_i2c1_PB6_PB7=PB6,PB7 BUS_PINS_i2c1_PB8_PB9=PB8,PB9 BUS_PINS_i2c2_PB10_PB11=PB10,PB11 BUS_PINS_i2c2_PB13_PB14=PB13,PB14 BUS_PINS_i2c3_PB3_PB4=PB3,PB4 BUS_PINS_i2c3_PC0_PC1=PC0,PC1 BUS_PINS_spi1=PA6,PA7,PA5 BUS_PINS_spi1a=PB4,PB5,PB3 BUS_PINS_spi2=PB14,PB15,PB13 BUS_PINS_spi2a=PC2,PC3,PB10 BUS_PINS_spi3=PB4,PB5,PB3 CANBUS_FREQUENCY=1000000 CLOCK_FREQ=64000000 MCU=stm32g0b1xx PWM_MAX=255 RECEIVE_WINDOW=192 RESERVE_PINS_CAN=PB0,PB1 RESERVE_PINS_crystal=PF0,PF1 STATS_SUMSQ_BASE=256 STEPPER_BOTH_EDGE=1 mcu 'CB1': Starting connect Loaded MCU 'CB1' 112 commands (v0.12.0-132-ge37b007f / gcc: (Debian 10.2.1-6) 10.2.1 20210110 binutils: (GNU Binutils for Debian) 2.35.2) MCU 'CB1' config: ADC_MAX=4095 CLOCK_FREQ=50000000 MCU=linux PCA9685_MAX=4096 PWM_MAX=32768 STATS_SUMSQ_BASE=256 mcu_temperature 'mcu' nominal base=-281.244980 slope=1644.578313 mcu_temperature 'EBBCan' nominal base=-275.555556 slope=1317.105263 Config error Traceback (most recent call last): File "/home/biqu/klipper/klippy/klippy.py", line 180, in _connect cb() File "/home/biqu/klipper/klippy/mcu.py", line 746, in _connect self._send_config(None) File "/home/biqu/klipper/klippy/mcu.py", line 685, in _send_config cmdlist[i] = pin_resolver.update_command(cmd) File "/home/biqu/klipper/klippy/pins.py", line 53, in update_command return re_pin.sub(pin_fixup, cmd) File "/home/biqu/klipper/klippy/pins.py", line 50, in pin_fixup raise error("pin %s is reserved for %s" % ( pins.error: pin PB7 is reserved for i2c1_PB6_PB7 Attempting MCU 'EBBCan' reset command Attempting MCU 'CB1' config_reset command b'Got EOF when reading from device' Attempting MCU 'mcu' reset command webhooks client 281473474698976: Disconnected Restarting printer Start printer at Sat Apr 27 00:44:57 2024 (1714178697.4 2227.1) ===== Config file ===== [mcu] canbus_uuid = b983bbdcfe30 [mcu EBBCan] canbus_uuid = d8d5848615b3 [mcu CB1] serial = /tmp/klipper_host_mcu [printer] kinematics = corexy max_velocity = 500 max_accel = 10000 max_z_velocity = 50 max_z_accel = 500 [virtual_sdcard] path = /home/biqu/printer_data/gcodes on_error_gcode = CANCEL_PRINT [pause_resume] [display_status] [respond] [gcode_macro CANCEL_PRINT] description = Cancel the actual running print rename_existing = CANCEL_PRINT_BASE gcode = PRINT_END [gcode_macro PAUSE] description = Pause the actual running print rename_existing = PAUSE_BASE gcode = {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %} {% set idle_timeout = client.idle_timeout|default(0) %} {% set temp = printer[printer.toolhead.extruder].target if printer.toolhead.extruder != '' else 0 %} {% set restore = False if printer.toolhead.extruder == '' else True if params.RESTORE|default(1)|int == 1 else False %} SET_GCODE_VARIABLE MACRO=RESUME VARIABLE=last_extruder_temp VALUE="{{'restore': restore, 'temp': temp}}" {% if idle_timeout > 0 %} SET_GCODE_VARIABLE MACRO=RESUME VARIABLE=restore_idle_timeout VALUE={printer.configfile.settings.idle_timeout.timeout} SET_IDLE_TIMEOUT TIMEOUT={idle_timeout} {% endif %} PAUSE_BASE {client.user_pause_macro|default("")} _TOOLHEAD_PARK_PAUSE_CANCEL {rawparams} [gcode_macro RESUME] description = Resume the actual running print rename_existing = RESUME_BASE variable_last_extruder_temp = {'restore': False, 'temp': 0} variable_restore_idle_timeout = 0 variable_idle_state = False gcode = {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %} {% set velocity = printer.configfile.settings.pause_resume.recover_velocity %} {% set sp_move = client.speed_move|default(velocity) %} {% set runout_resume = True if client.runout_sensor|default("") == "" else True if not printer[client.runout_sensor].enabled else printer[client.runout_sensor].filament_detected %} {% set can_extrude = True if printer.toolhead.extruder == '' else printer[printer.toolhead.extruder].can_extrude %} {% set do_resume = False %} {% set prompt_txt = [] %} {% if printer.idle_timeout.state|upper == "IDLE" or idle_state %} SET_GCODE_VARIABLE MACRO=RESUME VARIABLE=idle_state VALUE=False {% if last_extruder_temp.restore %} RESPOND TYPE=echo MSG='{"Restoring \"%s\" temperature to %3.1f\u00B0C, this may take some time" % (printer.toolhead.extruder, last_extruder_temp.temp) }' M109 S{last_extruder_temp.temp} {% set do_resume = True %} {% elif can_extrude %} {% set do_resume = True %} {% else %} RESPOND TYPE=error MSG='{"Resume aborted !!! \"%s\" not hot enough, please heat up again and press RESUME" % printer.toolhead.extruder}' {% set _d = prompt_txt.append("\"%s\" not hot enough, please heat up again and press RESUME" % printer.toolhead.extruder) %} {% endif %} {% elif can_extrude %} {% set do_resume = True %} {% else %} RESPOND TYPE=error MSG='{"Resume aborted !!! \"%s\" not hot enough, please heat up again and press RESUME" % printer.toolhead.extruder}' {% set _d = prompt_txt.append("\"%s\" not hot enough, please heat up again and press RESUME" % printer.toolhead.extruder) %} {% endif %} {% if runout_resume %} {% if do_resume %} {% if restore_idle_timeout > 0 %} SET_IDLE_TIMEOUT TIMEOUT={restore_idle_timeout} {% endif %} {client.user_resume_macro|default("")} _CLIENT_EXTRUDE RESUME_BASE VELOCITY={params.VELOCITY|default(sp_move)} {% endif %} {% else %} RESPOND TYPE=error MSG='{"Resume aborted !!! \"%s\" detects no filament, please load filament and press RESUME" % (client.runout_sensor.split(" "))[1]}' {% set _d = prompt_txt.append("\"%s\" detects no filament, please load filament and press RESUME" % (client.runout_sensor.split(" "))[1]) %} {% endif %} {% if not (runout_resume and do_resume) %} RESPOND TYPE=command MSG="action:prompt_begin RESUME aborted !!!" {% for element in prompt_txt %} RESPOND TYPE=command MSG='{"action:prompt_text %s" % element}' {% endfor %} RESPOND TYPE=command MSG="action:prompt_footer_button Ok|RESPOND TYPE=command MSG=action:prompt_end|info" RESPOND TYPE=command MSG="action:prompt_show" {% endif %} [gcode_macro SET_PAUSE_NEXT_LAYER] description = Enable a pause if the next layer is reached gcode = {% set pause_next_layer = printer['gcode_macro SET_PRINT_STATS_INFO'].pause_next_layer %} {% set ENABLE = params.ENABLE|default(1)|int != 0 %} {% set MACRO = params.MACRO|default(pause_next_layer.call, True) %} SET_GCODE_VARIABLE MACRO=SET_PRINT_STATS_INFO VARIABLE=pause_next_layer VALUE="{{ 'enable': ENABLE, 'call': MACRO }}" [gcode_macro SET_PAUSE_AT_LAYER] description = Enable/disable a pause if a given layer number is reached gcode = {% set pause_at_layer = printer['gcode_macro SET_PRINT_STATS_INFO'].pause_at_layer %} {% set ENABLE = params.ENABLE|int != 0 if params.ENABLE is defined else params.LAYER is defined %} {% set LAYER = params.LAYER|default(pause_at_layer.layer)|int %} {% set MACRO = params.MACRO|default(pause_at_layer.call, True) %} SET_GCODE_VARIABLE MACRO=SET_PRINT_STATS_INFO VARIABLE=pause_at_layer VALUE="{{ 'enable': ENABLE, 'layer': LAYER, 'call': MACRO }}" [gcode_macro SET_PRINT_STATS_INFO] rename_existing = SET_PRINT_STATS_INFO_BASE description = Overwrite, to get pause_next_layer and pause_at_layer feature variable_pause_next_layer = { 'enable': False, 'call': "PAUSE" } variable_pause_at_layer = { 'enable': False, 'layer': 0, 'call': "PAUSE" } gcode = {% if pause_next_layer.enable %} RESPOND TYPE=echo MSG='{"%s, forced by pause_next_layer" % pause_next_layer.call}' {pause_next_layer.call} SET_PAUSE_NEXT_LAYER ENABLE=0 {% elif pause_at_layer.enable and params.CURRENT_LAYER is defined and params.CURRENT_LAYER|int == pause_at_layer.layer %} RESPOND TYPE=echo MSG='{"%s, forced by pause_at_layer [%d]" % (pause_at_layer.call, pause_at_layer.layer)}' {pause_at_layer.call} SET_PAUSE_AT_LAYER ENABLE=0 {% endif %} SET_PRINT_STATS_INFO_BASE {rawparams} [gcode_macro _TOOLHEAD_PARK_PAUSE_CANCEL] description = Helper: park toolhead used in PAUSE and CANCEL_PRINT gcode = {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %} {% set velocity = printer.configfile.settings.pause_resume.recover_velocity %} {% set use_custom = client.use_custom_pos|default(false)|lower == 'true' %} {% set custom_park_x = client.custom_park_x|default(0.0) %} {% set custom_park_y = client.custom_park_y|default(0.0) %} {% set park_dz = client.custom_park_dz|default(2.0)|abs %} {% set sp_hop = client.speed_hop|default(15) * 60 %} {% set sp_move = client.speed_move|default(velocity) * 60 %} {% set origin = printer.gcode_move.homing_origin %} {% set act = printer.gcode_move.gcode_position %} {% set max = printer.toolhead.axis_maximum %} {% set cone = printer.toolhead.cone_start_z|default(max.z) %} {% set round_bed = True if printer.configfile.settings.printer.kinematics is in ['delta','polar','rotary_delta','winch'] else False %} {% set z_min = params.Z_MIN|default(0)|float %} {% set z_park = [[(act.z + park_dz), z_min]|max, (max.z - origin.z)]|min %} {% set x_park = params.X if params.X is defined else custom_park_x if use_custom else 0.0 if round_bed else (max.x - 5.0) %} {% set y_park = params.Y if params.Y is defined else custom_park_y if use_custom else (max.y - 5.0) if round_bed and z_park < cone else 0.0 if round_bed else (max.y - 5.0) %} _CLIENT_RETRACT {% if "xyz" in printer.toolhead.homed_axes %} G90 G1 Z{z_park} F{sp_hop} G1 X{x_park} Y{y_park} F{sp_move} {% if not printer.gcode_move.absolute_coordinates %} G91 {% endif %} {% else %} RESPOND TYPE=echo MSG='Printer not homed' {% endif %} [gcode_macro _CLIENT_EXTRUDE] description = Extrudes, if the extruder is hot enough gcode = {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %} {% set use_fw_retract = (client.use_fw_retract|default(false)|lower == 'true') and (printer.firmware_retraction is defined) %} {% set length = params.LENGTH|default(client.unretract)|default(1.0)|float %} {% set speed = params.SPEED|default(client.speed_unretract)|default(35) %} {% set absolute_extrude = printer.gcode_move.absolute_extrude %} {% if printer.toolhead.extruder != '' %} {% if printer[printer.toolhead.extruder].can_extrude %} {% if use_fw_retract %} {% if length < 0 %} G10 {% else %} G11 {% endif %} {% else %} M83 G1 E{length} F{(speed|float|abs) * 60} {% if absolute_extrude %} M82 {% endif %} {% endif %} {% else %} RESPOND TYPE=echo MSG='{"\"%s\" not hot enough" % printer.toolhead.extruder}' {% endif %} {% endif %} [gcode_macro _CLIENT_RETRACT] description = Retracts, if the extruder is hot enough gcode = {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %} {% set length = params.LENGTH|default(client.retract)|default(1.0)|float %} {% set speed = params.SPEED|default(client.speed_retract)|default(35) %} _CLIENT_EXTRUDE LENGTH=-{length|float|abs} SPEED={speed|float|abs} [gcode_arcs] resolution = 1 [exclude_object] [gcode_macro AXES_MAP_CALIBRATION] gcode = {% set z_height = params.Z_HEIGHT|default(20)|int %} {% set speed = params.SPEED|default(80)|float * 60 %} {% set accel = params.ACCEL|default(1500)|int %} {% set feedrate_travel = params.TRAVEL_SPEED|default(120)|int * 60 %} {% set accel_chip = params.ACCEL_CHIP|default("adxl345") %} {% set mid_x = printer.toolhead.axis_maximum.x|float / 2 %} {% set mid_y = printer.toolhead.axis_maximum.y|float / 2 %} {% set accel = [accel, printer.configfile.settings.printer.max_accel]|min %} {% set old_accel = printer.toolhead.max_accel %} {% set old_cruise_ratio = printer.toolhead.minimum_cruise_ratio %} {% set old_sqv = printer.toolhead.square_corner_velocity %} {% if not 'xyz' in printer.toolhead.homed_axes %} { action_raise_error("Must Home printer first!") } {% endif %} {action_respond_info("")} {action_respond_info("Starting accelerometer axe_map calibration")} {action_respond_info("This operation can not be interrupted by normal means. Hit the \"emergency stop\" button to stop it if needed")} {action_respond_info("")} SAVE_GCODE_STATE NAME=STATE_AXESMAP_CALIBRATION G90 SET_VELOCITY_LIMIT ACCEL={accel} MINIMUM_CRUISE_RATIO=0 SQUARE_CORNER_VELOCITY={[(accel / 1000), 5.0]|max} G1 Z{z_height} F{feedrate_travel / 8} G1 X{mid_x - 15} Y{mid_y - 15} F{feedrate_travel} G4 P500 ACCELEROMETER_MEASURE CHIP={accel_chip} G4 P1000 G1 X{mid_x + 15} F{speed} G4 P1000 G1 Y{mid_y + 15} F{speed} G4 P1000 G1 Z{z_height + 15} F{speed} G4 P1000 ACCELEROMETER_MEASURE CHIP={accel_chip} NAME=axemap RESPOND MSG="Analysis of the movements..." RUN_SHELL_COMMAND CMD=shaketune PARAMS="--type axesmap --accel {accel|int} --chip_name {accel_chip}" SET_VELOCITY_LIMIT ACCEL={old_accel} MINIMUM_CRUISE_RATIO={old_cruise_ratio} SQUARE_CORNER_VELOCITY={old_sqv} RESTORE_GCODE_STATE NAME=STATE_AXESMAP_CALIBRATION [gcode_macro AXES_SHAPER_CALIBRATION] description = Perform standard axis input shaper tests on one or both XY axes to select the best input shaper filter gcode = {% set min_freq = params.FREQ_START|default(5)|float %} {% set max_freq = params.FREQ_END|default(133.3)|float %} {% set hz_per_sec = params.HZ_PER_SEC|default(1)|float %} {% set axis = params.AXIS|default("all")|string|lower %} {% set scv = params.SCV|default(None) %} {% set max_sm = params.MAX_SMOOTHING|default(None) %} {% set keep_results = params.KEEP_N_RESULTS|default(3)|int %} {% set keep_csv = params.KEEP_CSV|default(True) %} {% set X, Y = False, False %} {% if axis == "all" %} {% set X, Y = True, True %} {% elif axis == "x" %} {% set X = True %} {% elif axis == "y" %} {% set Y = True %} {% else %} { action_raise_error("AXIS selection invalid. Should be either all, x or y!") } {% endif %} {% if scv is none %} {% set scv = printer.toolhead.square_corner_velocity %} {% endif %} {% if X %} TEST_RESONANCES AXIS=X OUTPUT=raw_data NAME=x FREQ_START={min_freq} FREQ_END={max_freq} HZ_PER_SEC={hz_per_sec} M400 RESPOND MSG="X axis frequency profile generation..." RESPOND MSG="This may take some time (1-3min)" RUN_SHELL_COMMAND CMD=shaketune PARAMS="--type shaper --scv {scv} {% if max_sm is not none %}--max_smoothing {max_sm}{% endif %} {% if keep_csv %}--keep_csv{% endif %}" {% endif %} {% if Y %} TEST_RESONANCES AXIS=Y OUTPUT=raw_data NAME=y FREQ_START={min_freq} FREQ_END={max_freq} HZ_PER_SEC={hz_per_sec} M400 RESPOND MSG="Y axis frequency profile generation..." RESPOND MSG="This may take some time (1-3min)" RUN_SHELL_COMMAND CMD=shaketune PARAMS="--type shaper --scv {scv} {% if max_sm is not none %}--max_smoothing {max_sm}{% endif %} {% if keep_csv %}--keep_csv{% endif %}" {% endif %} M400 RUN_SHELL_COMMAND CMD=shaketune PARAMS="--type clean --keep_results {keep_results}" [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 = {% 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 keep_results = params.KEEP_N_RESULTS|default(3)|int %} {% set keep_csv = params.KEEP_CSV|default(True) %} 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 MSG="Belts comparative frequency profile generation..." RESPOND MSG="This may take some time (3-5min)" RUN_SHELL_COMMAND CMD=shaketune PARAMS="--type belts {% if keep_csv %}--keep_csv{% endif %}" M400 RUN_SHELL_COMMAND CMD=shaketune PARAMS="--type clean --keep_results {keep_results}" [gcode_macro EXCITATE_AXIS_AT_FREQ] description = Maintain a specified excitation frequency for a period of time to diagnose and locate a source of vibration 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 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 %} TEST_RESONANCES OUTPUT=raw_data AXIS={axis} FREQ_START={frequency-1} FREQ_END={frequency+1} HZ_PER_SEC={1/(time/3)} M400 [gcode_macro VIBRATIONS_CALIBRATION] gcode = {% set size = params.SIZE|default(60)|int %} {% set direction = params.DIRECTION|default('XY') %} {% set z_height = params.Z_HEIGHT|default(20)|int %} {% set min_speed = params.MIN_SPEED|default(20)|float * 60 %} {% set max_speed = params.MAX_SPEED|default(200)|float * 60 %} {% set speed_increment = params.SPEED_INCREMENT|default(2)|float * 60 %} {% set feedrate_travel = params.TRAVEL_SPEED|default(200)|int * 60 %} {% set accel = params.ACCEL|default(3000)|int %} {% set accel_chip = params.ACCEL_CHIP|default("adxl345") %} {% set keep_results = params.KEEP_N_RESULTS|default(3)|int %} {% set keep_csv = params.KEEP_CSV|default(True) %} {% set mid_x = printer.toolhead.axis_maximum.x|float / 2 %} {% set mid_y = printer.toolhead.axis_maximum.y|float / 2 %} {% set nb_samples = ((max_speed - min_speed) / speed_increment + 1) | int %} {% set accel = [accel, printer.configfile.settings.printer.max_accel]|min %} {% set old_accel = printer.toolhead.max_accel %} {% set old_cruise_ratio = printer.toolhead.minimum_cruise_ratio %} {% set old_sqv = printer.toolhead.square_corner_velocity %} {% set direction_factor = { 'XY' : { 'start' : {'x': -0.5, 'y': -0.5 }, 'move_factors' : { '0' : {'x': 0.5, 'y': -0.5, 'z': 0.0 }, '1' : {'x': 0.5, 'y': 0.5, 'z': 0.0 }, '2' : {'x': -0.5, 'y': 0.5, 'z': 0.0 }, '3' : {'x': -0.5, 'y': -0.5, 'z': 0.0 } } }, 'AB' : { 'start' : {'x': 0.0, 'y': 0.0 }, 'move_factors' : { '0' : {'x': 0.5, 'y': -0.5, 'z': 0.0 }, '1' : {'x': -0.5, 'y': 0.5, 'z': 0.0 }, '2' : {'x': 0.0, 'y': 0.0, 'z': 0.0 }, '3' : {'x': 0.5, 'y': 0.5, 'z': 0.0 }, '4' : {'x': -0.5, 'y': -0.5, 'z': 0.0 }, '5' : {'x': 0.0, 'y': 0.0, 'z': 0.0 } } }, 'ABXY' : { 'start' : {'x': -0.5, 'y': 0.5 }, 'move_factors' : { '0' : {'x': -0.5, 'y': -0.5, 'z': 0.0 }, '1' : {'x': 0.5, 'y': -0.5, 'z': 0.0 }, '2' : {'x': -0.5, 'y': 0.5, 'z': 0.0 }, '3' : {'x': 0.5, 'y': 0.5, 'z': 0.0 }, '4' : {'x': -0.5, 'y': -0.5, 'z': 0.0 }, '5' : {'x': -0.5, 'y': 0.5, 'z': 0.0 } } }, 'B' : { 'start' : {'x': 0.5, 'y': 0.5 }, 'move_factors' : { '0' : {'x': -0.5, 'y': -0.5, 'z': 0.0 }, '1' : {'x': 0.5, 'y': 0.5, 'z': 0.0 } } }, 'A' : { 'start' : {'x': -0.5, 'y': 0.5 }, 'move_factors' : { '0' : {'x': 0.5, 'y': -0.5, 'z': 0.0 }, '1' : {'x': -0.5, 'y': 0.5, 'z': 0.0 } } }, 'X' : { 'start' : {'x': -0.5, 'y': 0.0 }, 'move_factors' : { '0' : {'x': 0.5, 'y': 0.0, 'z': 0.0 }, '1' : {'x': -0.5, 'y': 0.0, 'z': 0.0 } } }, 'Y' : { 'start' : {'x': 0.0, 'y': 0.5 }, 'move_factors' : { '0' : {'x': 0.0, 'y': -0.5, 'z': 0.0 }, '1' : {'x': 0.0, 'y': 0.5, 'z': 0.0 } } }, 'Z' : { 'start' : {'x': 0.0, 'y': 0.0 }, 'move_factors' : { '0' : {'x': 0.0, 'y': 0.0, 'z': 1.0 }, '1' : {'x': 0.0, 'y': 0.0, 'z': 0.0 } } }, 'E' : { 'start' : {'x': 0.0, 'y': 0.0 }, 'move_factor' : 0.05 } } %} {% if not 'xyz' in printer.toolhead.homed_axes %} { action_raise_error("Must Home printer first!") } {% endif %} {% if params.SPEED_INCREMENT|default(2)|float * 100 != (params.SPEED_INCREMENT|default(2)|float * 100)|int %} { action_raise_error("Only 2 decimal digits are allowed for SPEED_INCREMENT") } {% endif %} {% if (size / (max_speed / 60)) < 0.25 and direction != 'E' %} { action_raise_error("SIZE is too small for this MAX_SPEED. Increase SIZE or decrease MAX_SPEED!") } {% endif %} {% if not (direction in direction_factor) %} { action_raise_error("DIRECTION is not valid. Only XY, AB, ABXY, A, B, X, Y, Z or E is allowed!") } {% endif %} {action_respond_info("")} {action_respond_info("Starting speed and vibration calibration")} {action_respond_info("This operation can not be interrupted by normal means. Hit the \"emergency stop\" button to stop it if needed")} {action_respond_info("")} SAVE_GCODE_STATE NAME=STATE_VIBRATIONS_CALIBRATION G90 SET_VELOCITY_LIMIT ACCEL={accel} MINIMUM_CRUISE_RATIO=0 SQUARE_CORNER_VELOCITY={[(accel / 1000), 5.0]|max} G1 Z{z_height} F{feedrate_travel / 10} G1 X{mid_x + (size * direction_factor[direction].start.x) } Y{mid_y + (size * direction_factor[direction].start.y)} F{feedrate_travel} {% for curr_sample in range(0, nb_samples) %} {% set curr_speed = min_speed + curr_sample * speed_increment %} RESPOND MSG="{"Current speed: %.2f mm/s" % (curr_speed / 60)|float}" ACCELEROMETER_MEASURE CHIP={accel_chip} {% if direction == 'E' %} G0 E{curr_speed*direction_factor[direction].move_factor} F{curr_speed} {% else %} {% for key, factor in direction_factor[direction].move_factors|dictsort %} G1 X{mid_x + (size * factor.x) } Y{mid_y + (size * factor.y)} Z{z_height + (size * factor.z)} F{curr_speed} {% endfor %} {% endif %} ACCELEROMETER_MEASURE CHIP={accel_chip} NAME=sp{("%.2f" % (curr_speed / 60)|float)|replace('.','_')}n1 G4 P300 M400 {% endfor %} RESPOND MSG="Machine and motors vibration graph generation..." RESPOND MSG="This may take some time (3-5min)" RUN_SHELL_COMMAND CMD=shaketune PARAMS="--type vibrations --axis_name {direction} --accel {accel|int} --chip_name {accel_chip} {% if keep_csv %}--keep_csv{% endif %}" M400 RUN_SHELL_COMMAND CMD=shaketune PARAMS="--type clean --keep_results {keep_results}" SET_VELOCITY_LIMIT ACCEL={old_accel} MINIMUM_CRUISE_RATIO={old_cruise_ratio} SQUARE_CORNER_VELOCITY={old_sqv} RESTORE_GCODE_STATE NAME=STATE_VIBRATIONS_CALIBRATION [gcode_shell_command shaketune] command = ~/printer_data/config/K-ShakeTune/scripts/shaketune.sh timeout = 600.0 verbose = True [stepper_x] step_pin = PE6 dir_pin = !PE5 enable_pin = multi_pin:z_enable microsteps = 16 rotation_distance = 32 endstop_pin = EBBCan: PB6 position_endstop = 0 position_max = 315 homing_speed = 50 [stepper_y] step_pin = PE2 dir_pin = !PE1 enable_pin = !PE4 microsteps = 16 rotation_distance = 32 endstop_pin = ^PF3 position_endstop = 300 position_max = 300 homing_speed = 50 [stepper_z] step_pin = PB8 dir_pin = PB7 enable_pin = !PE0 microsteps = 16 rotation_distance = 32 endstop_pin = probe:z_virtual_endstop position_max = 230 position_min = -5.0 homing_speed = 20 second_homing_speed = 10 homing_retract_dist = 5 [stepper_z1] step_pin = PB4 dir_pin = !PB3 enable_pin = !PB6 microsteps = 16 rotation_distance = 32 [stepper_z2] step_pin = PG13 dir_pin = !PG12 enable_pin = !PG15 microsteps = 16 rotation_distance = 32 [extruder] step_pin = EBBCan: PD0 dir_pin = EBBCan: PD1 enable_pin = !EBBCan: PD2 microsteps = 16 rotation_distance = 3.43 nozzle_diameter = 0.600 filament_diameter = 1.750 heater_pin = EBBCan: PB13 sensor_type = EPCOS 100K B57560G104F sensor_pin = EBBCan: PA3 min_temp = 0 max_temp = 250 max_extrude_cross_section = 250 max_extrude_only_distance = 250 control = pid pid_kp = 16.610 pid_ki = 0.527 pid_kd = 130.805 [tmc5160 stepper_x] cs_pin = PC13 spi_software_mosi_pin = PG6 spi_software_miso_pin = PG7 spi_software_sclk_pin = PG8 run_current = 1.400 [tmc5160 stepper_y] cs_pin = PE3 spi_software_mosi_pin = PG6 spi_software_miso_pin = PG7 spi_software_sclk_pin = PG8 run_current = 1.400 [tmc2209 stepper_z] uart_pin = PB9 run_current = 0.850 stealthchop_threshold = 999999 [tmc2209 stepper_z1] uart_pin = PB5 run_current = 0.850 stealthchop_threshold = 999999 [tmc2209 stepper_z2] uart_pin = PG14 run_current = 0.850 stealthchop_threshold = 999999 [tmc2209 extruder] uart_pin = EBBCan: PA15 run_current = 0.650 [multi_pin z_enable] pins = !PC14, PA5 [heater_bed] heater_pin = PA0 sensor_type = ATC Semitec 104GT-2 sensor_pin = PB1 control = pid pid_kp = 54.027 pid_ki = 0.770 pid_kd = 948.182 min_temp = 0 max_temp = 130 [fan] pin = EBBCan: PA1 [heater_fan hotend_fan] pin = EBBCan: PA0 heater = extruder heater_temp = 50.0 [controller_fan tmc_fan] pin = PF7 stepper = stepper_x [temperature_fan CB1] pin = PF8 sensor_type = temperature_host min_temp = 10 max_temp = 90 control = pid pid_kp = 2 pid_ki = 4 pid_kd = 0.1 [temperature_sensor mcu_temp] sensor_type = temperature_mcu min_temp = 0 max_temp = 100 [temperature_sensor EBB_Temperature] sensor_type = temperature_mcu sensor_mcu = EBBCan [temperature_sensor bed_top] sensor_type = EPCOS 100K B57560G104F sensor_pin = PB0 [temperature_sensor Chamber_Middle] sensor_type = AHT10 i2c_mcu = mcu i2c_sda = PC9 i2c_scl = PA8 [bltouch] sensor_pin = ^EBBCan:PB8 control_pin = EBBCan:PB9 stow_on_each_sample = false probe_with_touch_mode = true x_offset = 55 y_offset = 0 speed = 10 lift_speed = 20 samples = 2 samples_tolerance_retries = 4 z_offset = 1.200 [idle_timeout] timeout = 960000 [filament_switch_sensor switch_sensor] switch_pin = ^PF0 pause_on_runout = false runout_gcode = PAUSE [filament_motion_sensor motion_sensor] switch_pin = ^PC15 detection_length = 4 extruder = extruder pause_on_runout = false runout_gcode = PAUSE [neopixel outside] pin = CB1: gpio259 chain_count = 79 color_order = GRB initial_red = 0.5 initial_green = 0.5 initial_blue = 0.5 [neopixel back] pin = PD15 chain_count = 29 color_order = GRB initial_red = 0.5 initial_green = 0.5 initial_blue = 0.5 [z_tilt] z_positions = 0, 25 300, 25 150, 300 points = 0, 20 245, 20 95, 295 speed = 125 horizontal_move_z = 10 retries = 8 retry_tolerance = 0.01 [bed_mesh] speed = 125 horizontal_move_z = 10 mesh_min = 55, 10 mesh_max = 245,290 probe_count = 5, 5 algorithm = bicubic bicubic_tension = 0.2 fade_start = 1 fade_end = 10 fade_target = 0 [safe_z_home] home_xy_position = 100, 150 speed = 150 [input_shaper] shaper_freq_x = 83.8 shaper_type_x = mzv shaper_freq_y = 65.2 shaper_type_y = mzv [adxl345] cs_pin = EBBCan: PB12 spi_software_sclk_pin = EBBCan: PB10 spi_software_mosi_pin = EBBCan: PB11 spi_software_miso_pin = EBBCan: PB2 axes_map = x,y,z [resonance_tester] accel_chip = adxl345 probe_points = 160, 150, 50 [gcode_macro PRINT_START] gcode = {% set BED = params.BED_TEMP|int %} {% set EXTRUDER = params.EXTRUDER_TEMP|int %} M140 S{BED} M104 S{EXTRUDER} G28 Z_TILT_ADJUST BED_MESH_CALIBRATE _ADAPTIVE_PURGE_V1 [gcode_macro Z_TILT_ADJUST] rename_existing = Z_TILT_ADJUST_1 gcode = {% if printer["gcode_macro status_leveling"] != null %} status_leveling {% endif %} Z_TILT_ADJUST_1 { rawparams } {% if printer["gcode_macro status_ready"] != null %} status_ready {% endif %} [gcode_macro BED_MESH_CALIBRATE] rename_existing = _BED_MESH_CALIBRATE variable_buffer = 2 gcode = {% set bedMeshConfig = printer['configfile'].config["bed_mesh"] %} {% set bed_mesh_min = bedMeshConfig.mesh_min %} {% set bed_mesh_max = bedMeshConfig.mesh_max %} {% set all_points = printer.exclude_object.objects | map(attribute='polygon') | sum(start=[]) %} {% 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]) %} {% if printer["bed_mesh"].profile_name == '' %} { action_respond_info("No existing bed mesh found.") } {% set last_area_end_x=-1 %} {% endif %} {% if printer.toolhead.homed_axes != "xyz" %} G28 {% endif %} {% set klicky_available = printer['gcode_macro _Probe_Variables'] != null %} {% set probeConfig = printer['configfile'].config["probe"] %} {% if probeConfig %} {% set OffsetX = probeConfig.x_offset|default(0)|float %} {% set OffsetY = probeConfig.y_offset|default(0)|float %} {% endif %} {% set print_min_x = x_min|float %} {% set print_min_y = y_min|float %} {% set print_max_x = x_max|float %} {% set print_max_y = y_max|float %} {% set mesh_min_x = bed_mesh_min.split(",")[0]|float %} {% set mesh_min_y = bed_mesh_min.split(",")[1]|float %} {% set mesh_max_x = bed_mesh_max.split(",")[0]|float %} {% set mesh_max_y = bed_mesh_max.split(",")[1]|float %} {% if (print_min_x < mesh_min_x) or (print_max_x > mesh_max_x) or (print_min_y < mesh_min_y) or (print_max_y > mesh_max_y) %} {% set print_min_x = mesh_min_x %} {% set print_min_y = mesh_min_y %} {% set print_max_x = mesh_max_x %} {% set print_max_y = mesh_max_y %} {% endif %} {% if klicky_available %} _CheckProbe action=query Attach_Probe {% elif euclid_available %} DEPLOY_PROBE {% endif %} {% if (print_min_x < print_max_x) and (print_min_y < print_max_y) %} {% set minimum_probe_count = 3 %} {% set medium_probe_count = 5 %} {% set probe_count = bedMeshConfig.probe_count.split(",") %} {% set probe_count_x = probe_count[0]|int %} {% if probe_count.__len__() > 1 %} {% set probe_count_y = probe_count[1]|int %} {% else %} {% set probe_count_y = probe_count_x|int %} {% endif %} {% set relative_reference_index = bedMeshConfig.relative_reference_index %} {% if print_max_x - print_min_x < (mesh_max_x - mesh_min_x) * 0.75 %} {% set probe_count_x = medium_probe_count %} {% endif %} {% if print_max_y - print_min_y < (mesh_max_y - mesh_min_y) * 0.75 %} {% set probe_count_y = medium_probe_count %} {% endif %} {% if print_max_x - print_min_x < (mesh_max_x - mesh_min_x) * 0.50 %} {% set probe_count_x = minimum_probe_count %} {% endif %} {% if print_max_y - print_min_y < (mesh_max_y - mesh_min_y) * 0.50 %} {% set probe_count_y = minimum_probe_count %} {% endif %} {% if print_min_x - buffer >= mesh_min_x %} {% set mesh_min_x = print_min_x - buffer %} {% endif %} {% if print_min_y - buffer >= mesh_min_y %} {% set mesh_min_y = print_min_y - buffer %} {% endif %} {% if print_max_x + buffer <= mesh_max_x %} {% set mesh_max_x = print_max_x + buffer %} {% endif %} {% if print_max_y + buffer <= mesh_max_y %} {% set mesh_max_y = print_max_y + buffer %} {% endif %} { action_respond_info("mesh_min: %s,%s" % (mesh_min_x, mesh_min_y)) } { action_respond_info("mesh_max: %s,%s" % (mesh_max_x, mesh_max_y)) } { action_respond_info("probe_count: %s,%s" % (probe_count_x,probe_count_y)) } {% if printer["gcode_macro status_meshing"] != null %} status_meshing {% endif %} {% if relative_reference_index == 0 or relative_reference_index == null %} _BED_MESH_CALIBRATE mesh_min={mesh_min_x},{mesh_min_y} mesh_max={mesh_max_x},{mesh_max_y} probe_count={probe_count_x},{probe_count_y} {% else %} {% set relative_reference_index = ((probe_count_x * probe_count_y - 1) / 2)|int %} { action_respond_info("relative_reference_index: %s" % relative_reference_index) } _BED_MESH_CALIBRATE mesh_min={mesh_min_x},{mesh_min_y} mesh_max={mesh_max_x},{mesh_max_y} probe_count={probe_count_x},{probe_count_y} relative_reference_index={relative_reference_index} {% endif %} {% else %} {% if printer["gcode_macro status_meshing"] != null %} status_meshing {% endif %} _BED_MESH_CALIBRATE {% endif %} {% if klicky_available %} Dock_Probe {% elif euclid_available %} STOW_PROBE {% endif %} {% if printer["gcode_macro status_ready"] != null %} status_ready {% endif %} [gcode_macro _ADAPTIVE_PURGE_V1] description = A purge macro that adapts to be near your actual printed objects variable_adaptive_enable = True variable_z_height = 0.3 variable_tip_distance = 10 variable_purge_amount = 30 variable_flow_rate = 10 variable_x_default = 5 variable_y_default = 5 variable_size = 16 variable_distance_to_object_x = 7 variable_distance_to_object_y = 7 gcode = {% if adaptive_enable == True %} {% set all_points = printer.exclude_object.objects | map(attribute='polygon') | sum(start=[]) %} {% set x_origin = (all_points | map(attribute=0) | min | default(x_default + distance_to_object_x + size)) - distance_to_object_x - size %} {% set y_origin = (all_points | map(attribute=1) | min | default(y_default + distance_to_object_y + size)) - distance_to_object_y - size %} {% set x_origin = ([x_origin, 0] | max) %} {% set y_origin = ([y_origin, 0] | max) %} {% if x_origin < x_default %} set x_origin = x_default | float {% endif %} {% if y_origin < y_default %} set y_origin = y_default | float {% endif %} {% else %} {% set x_origin = x_default | float %} {% set y_origin = y_default | float %} {% endif %} {% set purge_move_speed = 2.31 * size * flow_rate / (purge_amount * 2.405) %} {% set prepurge_speed = flow_rate / 2.405 %} {% set travel_speed = printer.toolhead.max_velocity %} { action_respond_info( "x: " + x_origin|string + " y: " + y_origin|string + " purge_move_speed: " + purge_move_speed|string + " prepurge_speed: " + prepurge_speed|string ) } G92 E0 G90 G0 X{x_origin} Y{y_origin+size/2} F3000 G0 Z{z_height} F1500 G0 F3000 M83 G1 E{tip_distance} F{prepurge_speed*60} G1 F600 G1 X{x_origin+size*0.1976875} Y{y_origin+size*0.0538125} E{purge_amount*0.00362396204033215} G1 X{x_origin+size*0.2070625} Y{y_origin+size*0.056375} E{purge_amount*0.00348517200474496} G1 X{x_origin+size*0.273} Y{y_origin+size*0.0889375} E{purge_amount*0.0253226571767497} G1 X{x_origin+size*0.3568125} Y{y_origin+size*0.125125} E{purge_amount*0.0313760379596679} G1 X{x_origin+size*0.442375} Y{y_origin+size*0.1563125} E{purge_amount*0.0312455516014235} G1 X{x_origin+size*0.5295625} Y{y_origin+size*0.1825} E{purge_amount*0.0311731909845789} G1 X{x_origin+size*0.5311875} Y{y_origin+size*0.1829375} E{purge_amount*0.000575326215895611} G1 X{x_origin+size*0.6196875} Y{y_origin+size*0.2038125} E{purge_amount*0.0311376037959668} G1 X{x_origin+size*0.7093125} Y{y_origin+size*0.219625} E{purge_amount*0.0312253855278766} G1 X{x_origin+size*0.799875} Y{y_origin+size*0.2301875} E{purge_amount*0.0313368920521945} G1 X{x_origin+size*0.8735625} Y{y_origin+size*0.2349375} E{purge_amount*0.0254270462633452} G1 X{x_origin+size*0.8824375} Y{y_origin+size*0.237} E{purge_amount*0.00326809015421115} G1 X{x_origin+size*0.8913125} Y{y_origin+size*0.2390625} E{purge_amount*0.00339739027283511} G1 X{x_origin+size*0.8959375} Y{y_origin+size*0.2481875} E{purge_amount*0.00381494661921708} G1 X{x_origin+size*0.9005} Y{y_origin+size*0.257375} E{purge_amount*0.00366548042704626} G1 X{x_origin+size*0.951125} Y{y_origin+size*0.4463125} E{purge_amount*0.0668623962040332} G1 X{x_origin+size*0.9521875} Y{y_origin+size*0.4540625} E{purge_amount*0.00276156583629893} G1 X{x_origin+size*0.9531875} Y{y_origin+size*0.46175} E{purge_amount*0.00282443653618031} G1 X{x_origin+size*0.9528125} Y{y_origin+size*0.4654375} E{purge_amount*0.00138078291814947} G1 X{x_origin+size*0.9458125} Y{y_origin+size*0.4720625} E{purge_amount*0.00359193357058126} G1 X{x_origin+size*0.9388125} Y{y_origin+size*0.4786875} E{purge_amount*0.00342467378410439} G1 X{x_origin+size*0.9145625} Y{y_origin+size*0.4951875} E{purge_amount*0.00993950177935943} G1 X{x_origin+size*0.8395} Y{y_origin+size*0.547875} E{purge_amount*0.0316453143534994} G1 X{x_origin+size*0.7680625} Y{y_origin+size*0.6045} E{purge_amount*0.0314733096085409} G1 X{x_origin+size*0.700125} Y{y_origin+size*0.665125} E{purge_amount*0.0314483985765125} G1 X{x_origin+size*0.6358125} Y{y_origin+size*0.7295} E{purge_amount*0.0314317912218268} G1 X{x_origin+size*0.5755625} Y{y_origin+size*0.7971875} E{purge_amount*0.0312977461447212} G1 X{x_origin+size*0.5465} Y{y_origin+size*0.8325625} E{purge_amount*0.0155836298932384} G1 X{x_origin+size*0.492125} Y{y_origin+size*0.9056875} E{purge_amount*0.0313190984578885} G1 X{x_origin+size*0.451125} Y{y_origin+size*0.967125} E{purge_amount*0.0254341637010676} G1 X{x_origin+size*0.444625} Y{y_origin+size*0.9739375} E{purge_amount*0.00337959667852906} G1 X{x_origin+size*0.4380625} Y{y_origin+size*0.98075} E{purge_amount*0.00353262158956109} G1 X{x_origin+size*0.428125} Y{y_origin+size*0.98} E{purge_amount*0.00372123368920522} G1 X{x_origin+size*0.41825} Y{y_origin+size*0.97925} E{purge_amount*0.00354211150652432} G1 X{x_origin+size*0.22925} Y{y_origin+size*0.928625} E{purge_amount*0.0668837485172005} G1 X{x_origin+size*0.2204375} Y{y_origin+size*0.924125} E{purge_amount*0.00351601423487545} G1 X{x_origin+size*0.2115625} Y{y_origin+size*0.919625} E{purge_amount*0.00366903914590747} G1 X{x_origin+size*0.2091875} Y{y_origin+size*0.910625} E{purge_amount*0.00343179122182681} G1 X{x_origin+size*0.2068125} Y{y_origin+size*0.9016875} E{purge_amount*0.00329774614472123} G1 X{x_origin+size*0.2020625} Y{y_origin+size*0.82825} E{purge_amount*0.0253404507710558} G1 X{x_origin+size*0.1915} Y{y_origin+size*0.737625} E{purge_amount*0.0313582443653618} G1 X{x_origin+size*0.17575} Y{y_origin+size*0.6479375} E{purge_amount*0.0312431791221827} G1 X{x_origin+size*0.154875} Y{y_origin+size*0.5593125} E{purge_amount*0.0311791221826809} G1 X{x_origin+size*0.1544375} Y{y_origin+size*0.5576875} E{purge_amount*0.000575326215895611} G1 X{x_origin+size*0.12825} Y{y_origin+size*0.470625} E{purge_amount*0.0311328588374852} G1 X{x_origin+size*0.0970625} Y{y_origin+size*0.385125} E{purge_amount*0.0312253855278766} G1 X{x_origin+size*0.061} Y{y_origin+size*0.3014375} E{purge_amount*0.0313190984578885} G1 X{x_origin+size*0.02825} Y{y_origin+size*0.2351875} E{purge_amount*0.0254483985765125} G1 X{x_origin+size*0.025625} Y{y_origin+size*0.226125} E{purge_amount*0.00338671411625148} G1 X{x_origin+size*0.023} Y{y_origin+size*0.2170625} E{purge_amount*0.00352313167259787} G1 X{x_origin+size*0.028625} Y{y_origin+size*0.208875} E{purge_amount*0.00370937129300119} G1 X{x_origin+size*0.03425} Y{y_origin+size*0.200625} E{purge_amount*0.003570581257414} G1 X{x_origin+size*0.1725625} Y{y_origin+size*0.0623125} E{purge_amount*0.0668623962040332} G1 X{x_origin+size*0.1804375} Y{y_origin+size*0.0568125} E{purge_amount*0.00343297746144721} G1 X{x_origin+size*0.18375} Y{y_origin+size*0.0545} E{purge_amount*0.00150652431791222} G92 E0 M82 G0 Z{z_height*2} {% if printer["gcode_macro status_printing"] != null %} status_printing {% endif %} [gcode_macro PRINT_END] gcode = M400 TURN_OFF_HEATERS M106 S0 PARK_CENTER_REAR G0 Z230 F3000 [gcode_macro PARK_CENTER_REAR] gcode = {% if printer["gcode_macro status_busy"] != null %} status_busy {% endif %} {% set th = printer.toolhead %} {% set x_safe = th.position.x + 20 * (1 if th.axis_maximum.x - th.position.x > 20 else -1) %} {% set y_safe = th.position.y + 20 * (1 if th.axis_maximum.y - th.position.y > 20 else -1) %} G0 X{th.axis_maximum.x//2} Y{th.axis_maximum.y - 2} F3600 {% if printer["gcode_macro status_ready"] != null %} status_ready {% endif %} [gcode_macro TEST_SPEED] gcode = G0 Z10 {% set speed = params.SPEED|default(printer.configfile.settings.printer.max_velocity)|int %} {% set iterations = params.ITERATIONS|default(5)|int %} {% set accel = params.ACCEL|default(printer.configfile.settings.printer.max_accel)|int %} {% set bound = params.BOUND|default(20)|int %} {% set smallpatternsize = SMALLPATTERNSIZE|default(20)|int %} {% set x_min = printer.toolhead.axis_minimum.x + bound %} {% set x_max = printer.toolhead.axis_maximum.x - bound %} {% set y_min = printer.toolhead.axis_minimum.y + bound %} {% set y_max = printer.toolhead.axis_maximum.y - bound %} {% set x_center = (printer.toolhead.axis_minimum.x|float + printer.toolhead.axis_maximum.x|float ) / 2 %} {% set y_center = (printer.toolhead.axis_minimum.y|float + printer.toolhead.axis_maximum.y|float ) / 2 %} {% set x_center_min = x_center - (smallpatternsize/2) %} {% set x_center_max = x_center + (smallpatternsize/2) %} {% set y_center_min = y_center - (smallpatternsize/2) %} {% set y_center_max = y_center + (smallpatternsize/2) %} SAVE_GCODE_STATE NAME=TEST_SPEED { action_respond_info("TEST_SPEED: starting %d iterations at speed %d, accel %d" % (iterations, speed, accel)) } M400 G28 {% if printer.configfile.settings.quad_gantry_level %} {% if printer.quad_gantry_level.applied == False %} QUAD_GANTRY_LEVEL G28 Z {% endif %} {% endif %} G90 G1 X{printer.toolhead.axis_maximum.x-50} Y{printer.toolhead.axis_maximum.y-50} F{30*60} M400 G28 X Y G0 X{printer.toolhead.axis_maximum.x-1} Y{printer.toolhead.axis_maximum.y-1} F{30*60} G4 P1000 GET_POSITION G0 X{x_min} Y{y_min} Z{bound + 10} F{speed*60} SET_VELOCITY_LIMIT VELOCITY={speed} ACCEL={accel} ACCEL_TO_DECEL={accel / 2} {% for i in range(iterations) %} G0 X{x_min} Y{y_min} F{speed*60} G0 X{x_max} Y{y_max} F{speed*60} G0 X{x_min} Y{y_min} F{speed*60} G0 X{x_max} Y{y_min} F{speed*60} G0 X{x_min} Y{y_max} F{speed*60} G0 X{x_max} Y{y_min} F{speed*60} G0 X{x_min} Y{y_min} F{speed*60} G0 X{x_min} Y{y_max} F{speed*60} G0 X{x_max} Y{y_max} F{speed*60} G0 X{x_max} Y{y_min} F{speed*60} G0 X{x_center_min} Y{y_center_min} F{speed*60} G0 X{x_center_max} Y{y_center_max} F{speed*60} G0 X{x_center_min} Y{y_center_min} F{speed*60} G0 X{x_center_max} Y{y_center_min} F{speed*60} G0 X{x_center_min} Y{y_center_max} F{speed*60} G0 X{x_center_max} Y{y_center_min} F{speed*60} G0 X{x_center_min} Y{y_center_min} F{speed*60} G0 X{x_center_min} Y{y_center_max} F{speed*60} G0 X{x_center_max} Y{y_center_max} F{speed*60} G0 X{x_center_max} Y{y_center_min} F{speed*60} {% endfor %} SET_VELOCITY_LIMIT VELOCITY={printer.configfile.settings.printer.max_velocity} ACCEL={printer.configfile.settings.printer.max_accel} M400 G28 G90 G0 X{printer.toolhead.axis_maximum.x-1} Y{printer.toolhead.axis_maximum.y-1} F{30*60} G4 P1000 GET_POSITION RESTORE_GCODE_STATE NAME=TEST_SPEED [led_effect progress_bar] leds = neopixel:back autostart = true frame_rate = 24 layers = progress -1 0 add ( 0, 0, 1),( 0, 0.1, 0.6) static 0 0 top ( 0, 0, 0.1) [gcode_macro update_git] gcode = {% set message = params.MESSAGE|default() %} {% if message %} RUN_SHELL_COMMAND CMD=update_git_script_message PARAMS="'{params.MESSAGE}'" {% else %} RUN_SHELL_COMMAND CMD=update_git_script {% endif %} [gcode_shell_command update_git_script] command = bash -c "bash $HOME/klipper-backup/script.sh" timeout = 90.0 verbose = True [gcode_shell_command update_git_script_message] command = bash -c "bash $HOME/klipper-backup/script.sh $0" timeout = 90.0 verbose = True [bed_mesh default] version = 1 points = -0.026610, 0.013390, 0.018390, 0.013390, 0.048390 0.133390, 0.118390, 0.073390, 0.048390, 0.048390 0.298390, 0.243390, 0.198390, 0.153390, 0.123390 0.328390, 0.273390, 0.208390, 0.168390, 0.118390 0.118390, 0.078390, 0.028390, -0.001610, -0.016610 x_count = 5 y_count = 5 mesh_x_pps = 2 mesh_y_pps = 2 algo = bicubic tension = 0.2 min_x = 55.0 max_x = 245.0 min_y = 10.0 max_y = 290.0 ======================= Extruder max_extrude_ratio=103.937922 Config error Traceback (most recent call last): File "/home/biqu/klipper/klippy/klippy.py", line 175, in _connect self._read_config() File "/home/biqu/klipper/klippy/klippy.py", line 145, in _read_config pconfig.check_unused_options(config) File "/home/biqu/klipper/klippy/configfile.py", line 308, in check_unused_options raise error("Option '%s' is not valid in section '%s'" configparser.Error: Option 'i2c_sda' is not valid in section 'temperature_sensor chamber_middle' webhooks client 281473468841120: New connection webhooks client 281473468841120: Client info {'program': 'Moonraker', 'version': 'v0.8.0-331-gc857e1a'} Unable to issue reset command on MCU 'mcu' Unable to issue reset command on MCU 'EBBCan' Unable to issue reset command on MCU 'CB1' webhooks client 281473468841120: Disconnected Restarting printer Start printer at Sat Apr 27 00:52:54 2024 (1714179174.5 2704.2) ===== Config file ===== [mcu] canbus_uuid = b983bbdcfe30 [mcu EBBCan] canbus_uuid = d8d5848615b3 [mcu CB1] serial = /tmp/klipper_host_mcu [printer] kinematics = corexy max_velocity = 500 max_accel = 10000 max_z_velocity = 50 max_z_accel = 500 [virtual_sdcard] path = /home/biqu/printer_data/gcodes on_error_gcode = CANCEL_PRINT [pause_resume] [display_status] [respond] [gcode_macro CANCEL_PRINT] description = Cancel the actual running print rename_existing = CANCEL_PRINT_BASE gcode = PRINT_END [gcode_macro PAUSE] description = Pause the actual running print rename_existing = PAUSE_BASE gcode = {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %} {% set idle_timeout = client.idle_timeout|default(0) %} {% set temp = printer[printer.toolhead.extruder].target if printer.toolhead.extruder != '' else 0 %} {% set restore = False if printer.toolhead.extruder == '' else True if params.RESTORE|default(1)|int == 1 else False %} SET_GCODE_VARIABLE MACRO=RESUME VARIABLE=last_extruder_temp VALUE="{{'restore': restore, 'temp': temp}}" {% if idle_timeout > 0 %} SET_GCODE_VARIABLE MACRO=RESUME VARIABLE=restore_idle_timeout VALUE={printer.configfile.settings.idle_timeout.timeout} SET_IDLE_TIMEOUT TIMEOUT={idle_timeout} {% endif %} PAUSE_BASE {client.user_pause_macro|default("")} _TOOLHEAD_PARK_PAUSE_CANCEL {rawparams} [gcode_macro RESUME] description = Resume the actual running print rename_existing = RESUME_BASE variable_last_extruder_temp = {'restore': False, 'temp': 0} variable_restore_idle_timeout = 0 variable_idle_state = False gcode = {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %} {% set velocity = printer.configfile.settings.pause_resume.recover_velocity %} {% set sp_move = client.speed_move|default(velocity) %} {% set runout_resume = True if client.runout_sensor|default("") == "" else True if not printer[client.runout_sensor].enabled else printer[client.runout_sensor].filament_detected %} {% set can_extrude = True if printer.toolhead.extruder == '' else printer[printer.toolhead.extruder].can_extrude %} {% set do_resume = False %} {% set prompt_txt = [] %} {% if printer.idle_timeout.state|upper == "IDLE" or idle_state %} SET_GCODE_VARIABLE MACRO=RESUME VARIABLE=idle_state VALUE=False {% if last_extruder_temp.restore %} RESPOND TYPE=echo MSG='{"Restoring \"%s\" temperature to %3.1f\u00B0C, this may take some time" % (printer.toolhead.extruder, last_extruder_temp.temp) }' M109 S{last_extruder_temp.temp} {% set do_resume = True %} {% elif can_extrude %} {% set do_resume = True %} {% else %} RESPOND TYPE=error MSG='{"Resume aborted !!! \"%s\" not hot enough, please heat up again and press RESUME" % printer.toolhead.extruder}' {% set _d = prompt_txt.append("\"%s\" not hot enough, please heat up again and press RESUME" % printer.toolhead.extruder) %} {% endif %} {% elif can_extrude %} {% set do_resume = True %} {% else %} RESPOND TYPE=error MSG='{"Resume aborted !!! \"%s\" not hot enough, please heat up again and press RESUME" % printer.toolhead.extruder}' {% set _d = prompt_txt.append("\"%s\" not hot enough, please heat up again and press RESUME" % printer.toolhead.extruder) %} {% endif %} {% if runout_resume %} {% if do_resume %} {% if restore_idle_timeout > 0 %} SET_IDLE_TIMEOUT TIMEOUT={restore_idle_timeout} {% endif %} {client.user_resume_macro|default("")} _CLIENT_EXTRUDE RESUME_BASE VELOCITY={params.VELOCITY|default(sp_move)} {% endif %} {% else %} RESPOND TYPE=error MSG='{"Resume aborted !!! \"%s\" detects no filament, please load filament and press RESUME" % (client.runout_sensor.split(" "))[1]}' {% set _d = prompt_txt.append("\"%s\" detects no filament, please load filament and press RESUME" % (client.runout_sensor.split(" "))[1]) %} {% endif %} {% if not (runout_resume and do_resume) %} RESPOND TYPE=command MSG="action:prompt_begin RESUME aborted !!!" {% for element in prompt_txt %} RESPOND TYPE=command MSG='{"action:prompt_text %s" % element}' {% endfor %} RESPOND TYPE=command MSG="action:prompt_footer_button Ok|RESPOND TYPE=command MSG=action:prompt_end|info" RESPOND TYPE=command MSG="action:prompt_show" {% endif %} [gcode_macro SET_PAUSE_NEXT_LAYER] description = Enable a pause if the next layer is reached gcode = {% set pause_next_layer = printer['gcode_macro SET_PRINT_STATS_INFO'].pause_next_layer %} {% set ENABLE = params.ENABLE|default(1)|int != 0 %} {% set MACRO = params.MACRO|default(pause_next_layer.call, True) %} SET_GCODE_VARIABLE MACRO=SET_PRINT_STATS_INFO VARIABLE=pause_next_layer VALUE="{{ 'enable': ENABLE, 'call': MACRO }}" [gcode_macro SET_PAUSE_AT_LAYER] description = Enable/disable a pause if a given layer number is reached gcode = {% set pause_at_layer = printer['gcode_macro SET_PRINT_STATS_INFO'].pause_at_layer %} {% set ENABLE = params.ENABLE|int != 0 if params.ENABLE is defined else params.LAYER is defined %} {% set LAYER = params.LAYER|default(pause_at_layer.layer)|int %} {% set MACRO = params.MACRO|default(pause_at_layer.call, True) %} SET_GCODE_VARIABLE MACRO=SET_PRINT_STATS_INFO VARIABLE=pause_at_layer VALUE="{{ 'enable': ENABLE, 'layer': LAYER, 'call': MACRO }}" [gcode_macro SET_PRINT_STATS_INFO] rename_existing = SET_PRINT_STATS_INFO_BASE description = Overwrite, to get pause_next_layer and pause_at_layer feature variable_pause_next_layer = { 'enable': False, 'call': "PAUSE" } variable_pause_at_layer = { 'enable': False, 'layer': 0, 'call': "PAUSE" } gcode = {% if pause_next_layer.enable %} RESPOND TYPE=echo MSG='{"%s, forced by pause_next_layer" % pause_next_layer.call}' {pause_next_layer.call} SET_PAUSE_NEXT_LAYER ENABLE=0 {% elif pause_at_layer.enable and params.CURRENT_LAYER is defined and params.CURRENT_LAYER|int == pause_at_layer.layer %} RESPOND TYPE=echo MSG='{"%s, forced by pause_at_layer [%d]" % (pause_at_layer.call, pause_at_layer.layer)}' {pause_at_layer.call} SET_PAUSE_AT_LAYER ENABLE=0 {% endif %} SET_PRINT_STATS_INFO_BASE {rawparams} [gcode_macro _TOOLHEAD_PARK_PAUSE_CANCEL] description = Helper: park toolhead used in PAUSE and CANCEL_PRINT gcode = {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %} {% set velocity = printer.configfile.settings.pause_resume.recover_velocity %} {% set use_custom = client.use_custom_pos|default(false)|lower == 'true' %} {% set custom_park_x = client.custom_park_x|default(0.0) %} {% set custom_park_y = client.custom_park_y|default(0.0) %} {% set park_dz = client.custom_park_dz|default(2.0)|abs %} {% set sp_hop = client.speed_hop|default(15) * 60 %} {% set sp_move = client.speed_move|default(velocity) * 60 %} {% set origin = printer.gcode_move.homing_origin %} {% set act = printer.gcode_move.gcode_position %} {% set max = printer.toolhead.axis_maximum %} {% set cone = printer.toolhead.cone_start_z|default(max.z) %} {% set round_bed = True if printer.configfile.settings.printer.kinematics is in ['delta','polar','rotary_delta','winch'] else False %} {% set z_min = params.Z_MIN|default(0)|float %} {% set z_park = [[(act.z + park_dz), z_min]|max, (max.z - origin.z)]|min %} {% set x_park = params.X if params.X is defined else custom_park_x if use_custom else 0.0 if round_bed else (max.x - 5.0) %} {% set y_park = params.Y if params.Y is defined else custom_park_y if use_custom else (max.y - 5.0) if round_bed and z_park < cone else 0.0 if round_bed else (max.y - 5.0) %} _CLIENT_RETRACT {% if "xyz" in printer.toolhead.homed_axes %} G90 G1 Z{z_park} F{sp_hop} G1 X{x_park} Y{y_park} F{sp_move} {% if not printer.gcode_move.absolute_coordinates %} G91 {% endif %} {% else %} RESPOND TYPE=echo MSG='Printer not homed' {% endif %} [gcode_macro _CLIENT_EXTRUDE] description = Extrudes, if the extruder is hot enough gcode = {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %} {% set use_fw_retract = (client.use_fw_retract|default(false)|lower == 'true') and (printer.firmware_retraction is defined) %} {% set length = params.LENGTH|default(client.unretract)|default(1.0)|float %} {% set speed = params.SPEED|default(client.speed_unretract)|default(35) %} {% set absolute_extrude = printer.gcode_move.absolute_extrude %} {% if printer.toolhead.extruder != '' %} {% if printer[printer.toolhead.extruder].can_extrude %} {% if use_fw_retract %} {% if length < 0 %} G10 {% else %} G11 {% endif %} {% else %} M83 G1 E{length} F{(speed|float|abs) * 60} {% if absolute_extrude %} M82 {% endif %} {% endif %} {% else %} RESPOND TYPE=echo MSG='{"\"%s\" not hot enough" % printer.toolhead.extruder}' {% endif %} {% endif %} [gcode_macro _CLIENT_RETRACT] description = Retracts, if the extruder is hot enough gcode = {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %} {% set length = params.LENGTH|default(client.retract)|default(1.0)|float %} {% set speed = params.SPEED|default(client.speed_retract)|default(35) %} _CLIENT_EXTRUDE LENGTH=-{length|float|abs} SPEED={speed|float|abs} [gcode_arcs] resolution = 1 [exclude_object] [gcode_macro AXES_MAP_CALIBRATION] gcode = {% set z_height = params.Z_HEIGHT|default(20)|int %} {% set speed = params.SPEED|default(80)|float * 60 %} {% set accel = params.ACCEL|default(1500)|int %} {% set feedrate_travel = params.TRAVEL_SPEED|default(120)|int * 60 %} {% set accel_chip = params.ACCEL_CHIP|default("adxl345") %} {% set mid_x = printer.toolhead.axis_maximum.x|float / 2 %} {% set mid_y = printer.toolhead.axis_maximum.y|float / 2 %} {% set accel = [accel, printer.configfile.settings.printer.max_accel]|min %} {% set old_accel = printer.toolhead.max_accel %} {% set old_cruise_ratio = printer.toolhead.minimum_cruise_ratio %} {% set old_sqv = printer.toolhead.square_corner_velocity %} {% if not 'xyz' in printer.toolhead.homed_axes %} { action_raise_error("Must Home printer first!") } {% endif %} {action_respond_info("")} {action_respond_info("Starting accelerometer axe_map calibration")} {action_respond_info("This operation can not be interrupted by normal means. Hit the \"emergency stop\" button to stop it if needed")} {action_respond_info("")} SAVE_GCODE_STATE NAME=STATE_AXESMAP_CALIBRATION G90 SET_VELOCITY_LIMIT ACCEL={accel} MINIMUM_CRUISE_RATIO=0 SQUARE_CORNER_VELOCITY={[(accel / 1000), 5.0]|max} G1 Z{z_height} F{feedrate_travel / 8} G1 X{mid_x - 15} Y{mid_y - 15} F{feedrate_travel} G4 P500 ACCELEROMETER_MEASURE CHIP={accel_chip} G4 P1000 G1 X{mid_x + 15} F{speed} G4 P1000 G1 Y{mid_y + 15} F{speed} G4 P1000 G1 Z{z_height + 15} F{speed} G4 P1000 ACCELEROMETER_MEASURE CHIP={accel_chip} NAME=axemap RESPOND MSG="Analysis of the movements..." RUN_SHELL_COMMAND CMD=shaketune PARAMS="--type axesmap --accel {accel|int} --chip_name {accel_chip}" SET_VELOCITY_LIMIT ACCEL={old_accel} MINIMUM_CRUISE_RATIO={old_cruise_ratio} SQUARE_CORNER_VELOCITY={old_sqv} RESTORE_GCODE_STATE NAME=STATE_AXESMAP_CALIBRATION [gcode_macro AXES_SHAPER_CALIBRATION] description = Perform standard axis input shaper tests on one or both XY axes to select the best input shaper filter gcode = {% set min_freq = params.FREQ_START|default(5)|float %} {% set max_freq = params.FREQ_END|default(133.3)|float %} {% set hz_per_sec = params.HZ_PER_SEC|default(1)|float %} {% set axis = params.AXIS|default("all")|string|lower %} {% set scv = params.SCV|default(None) %} {% set max_sm = params.MAX_SMOOTHING|default(None) %} {% set keep_results = params.KEEP_N_RESULTS|default(3)|int %} {% set keep_csv = params.KEEP_CSV|default(True) %} {% set X, Y = False, False %} {% if axis == "all" %} {% set X, Y = True, True %} {% elif axis == "x" %} {% set X = True %} {% elif axis == "y" %} {% set Y = True %} {% else %} { action_raise_error("AXIS selection invalid. Should be either all, x or y!") } {% endif %} {% if scv is none %} {% set scv = printer.toolhead.square_corner_velocity %} {% endif %} {% if X %} TEST_RESONANCES AXIS=X OUTPUT=raw_data NAME=x FREQ_START={min_freq} FREQ_END={max_freq} HZ_PER_SEC={hz_per_sec} M400 RESPOND MSG="X axis frequency profile generation..." RESPOND MSG="This may take some time (1-3min)" RUN_SHELL_COMMAND CMD=shaketune PARAMS="--type shaper --scv {scv} {% if max_sm is not none %}--max_smoothing {max_sm}{% endif %} {% if keep_csv %}--keep_csv{% endif %}" {% endif %} {% if Y %} TEST_RESONANCES AXIS=Y OUTPUT=raw_data NAME=y FREQ_START={min_freq} FREQ_END={max_freq} HZ_PER_SEC={hz_per_sec} M400 RESPOND MSG="Y axis frequency profile generation..." RESPOND MSG="This may take some time (1-3min)" RUN_SHELL_COMMAND CMD=shaketune PARAMS="--type shaper --scv {scv} {% if max_sm is not none %}--max_smoothing {max_sm}{% endif %} {% if keep_csv %}--keep_csv{% endif %}" {% endif %} M400 RUN_SHELL_COMMAND CMD=shaketune PARAMS="--type clean --keep_results {keep_results}" [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 = {% 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 keep_results = params.KEEP_N_RESULTS|default(3)|int %} {% set keep_csv = params.KEEP_CSV|default(True) %} 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 MSG="Belts comparative frequency profile generation..." RESPOND MSG="This may take some time (3-5min)" RUN_SHELL_COMMAND CMD=shaketune PARAMS="--type belts {% if keep_csv %}--keep_csv{% endif %}" M400 RUN_SHELL_COMMAND CMD=shaketune PARAMS="--type clean --keep_results {keep_results}" [gcode_macro EXCITATE_AXIS_AT_FREQ] description = Maintain a specified excitation frequency for a period of time to diagnose and locate a source of vibration 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 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 %} TEST_RESONANCES OUTPUT=raw_data AXIS={axis} FREQ_START={frequency-1} FREQ_END={frequency+1} HZ_PER_SEC={1/(time/3)} M400 [gcode_macro VIBRATIONS_CALIBRATION] gcode = {% set size = params.SIZE|default(60)|int %} {% set direction = params.DIRECTION|default('XY') %} {% set z_height = params.Z_HEIGHT|default(20)|int %} {% set min_speed = params.MIN_SPEED|default(20)|float * 60 %} {% set max_speed = params.MAX_SPEED|default(200)|float * 60 %} {% set speed_increment = params.SPEED_INCREMENT|default(2)|float * 60 %} {% set feedrate_travel = params.TRAVEL_SPEED|default(200)|int * 60 %} {% set accel = params.ACCEL|default(3000)|int %} {% set accel_chip = params.ACCEL_CHIP|default("adxl345") %} {% set keep_results = params.KEEP_N_RESULTS|default(3)|int %} {% set keep_csv = params.KEEP_CSV|default(True) %} {% set mid_x = printer.toolhead.axis_maximum.x|float / 2 %} {% set mid_y = printer.toolhead.axis_maximum.y|float / 2 %} {% set nb_samples = ((max_speed - min_speed) / speed_increment + 1) | int %} {% set accel = [accel, printer.configfile.settings.printer.max_accel]|min %} {% set old_accel = printer.toolhead.max_accel %} {% set old_cruise_ratio = printer.toolhead.minimum_cruise_ratio %} {% set old_sqv = printer.toolhead.square_corner_velocity %} {% set direction_factor = { 'XY' : { 'start' : {'x': -0.5, 'y': -0.5 }, 'move_factors' : { '0' : {'x': 0.5, 'y': -0.5, 'z': 0.0 }, '1' : {'x': 0.5, 'y': 0.5, 'z': 0.0 }, '2' : {'x': -0.5, 'y': 0.5, 'z': 0.0 }, '3' : {'x': -0.5, 'y': -0.5, 'z': 0.0 } } }, 'AB' : { 'start' : {'x': 0.0, 'y': 0.0 }, 'move_factors' : { '0' : {'x': 0.5, 'y': -0.5, 'z': 0.0 }, '1' : {'x': -0.5, 'y': 0.5, 'z': 0.0 }, '2' : {'x': 0.0, 'y': 0.0, 'z': 0.0 }, '3' : {'x': 0.5, 'y': 0.5, 'z': 0.0 }, '4' : {'x': -0.5, 'y': -0.5, 'z': 0.0 }, '5' : {'x': 0.0, 'y': 0.0, 'z': 0.0 } } }, 'ABXY' : { 'start' : {'x': -0.5, 'y': 0.5 }, 'move_factors' : { '0' : {'x': -0.5, 'y': -0.5, 'z': 0.0 }, '1' : {'x': 0.5, 'y': -0.5, 'z': 0.0 }, '2' : {'x': -0.5, 'y': 0.5, 'z': 0.0 }, '3' : {'x': 0.5, 'y': 0.5, 'z': 0.0 }, '4' : {'x': -0.5, 'y': -0.5, 'z': 0.0 }, '5' : {'x': -0.5, 'y': 0.5, 'z': 0.0 } } }, 'B' : { 'start' : {'x': 0.5, 'y': 0.5 }, 'move_factors' : { '0' : {'x': -0.5, 'y': -0.5, 'z': 0.0 }, '1' : {'x': 0.5, 'y': 0.5, 'z': 0.0 } } }, 'A' : { 'start' : {'x': -0.5, 'y': 0.5 }, 'move_factors' : { '0' : {'x': 0.5, 'y': -0.5, 'z': 0.0 }, '1' : {'x': -0.5, 'y': 0.5, 'z': 0.0 } } }, 'X' : { 'start' : {'x': -0.5, 'y': 0.0 }, 'move_factors' : { '0' : {'x': 0.5, 'y': 0.0, 'z': 0.0 }, '1' : {'x': -0.5, 'y': 0.0, 'z': 0.0 } } }, 'Y' : { 'start' : {'x': 0.0, 'y': 0.5 }, 'move_factors' : { '0' : {'x': 0.0, 'y': -0.5, 'z': 0.0 }, '1' : {'x': 0.0, 'y': 0.5, 'z': 0.0 } } }, 'Z' : { 'start' : {'x': 0.0, 'y': 0.0 }, 'move_factors' : { '0' : {'x': 0.0, 'y': 0.0, 'z': 1.0 }, '1' : {'x': 0.0, 'y': 0.0, 'z': 0.0 } } }, 'E' : { 'start' : {'x': 0.0, 'y': 0.0 }, 'move_factor' : 0.05 } } %} {% if not 'xyz' in printer.toolhead.homed_axes %} { action_raise_error("Must Home printer first!") } {% endif %} {% if params.SPEED_INCREMENT|default(2)|float * 100 != (params.SPEED_INCREMENT|default(2)|float * 100)|int %} { action_raise_error("Only 2 decimal digits are allowed for SPEED_INCREMENT") } {% endif %} {% if (size / (max_speed / 60)) < 0.25 and direction != 'E' %} { action_raise_error("SIZE is too small for this MAX_SPEED. Increase SIZE or decrease MAX_SPEED!") } {% endif %} {% if not (direction in direction_factor) %} { action_raise_error("DIRECTION is not valid. Only XY, AB, ABXY, A, B, X, Y, Z or E is allowed!") } {% endif %} {action_respond_info("")} {action_respond_info("Starting speed and vibration calibration")} {action_respond_info("This operation can not be interrupted by normal means. Hit the \"emergency stop\" button to stop it if needed")} {action_respond_info("")} SAVE_GCODE_STATE NAME=STATE_VIBRATIONS_CALIBRATION G90 SET_VELOCITY_LIMIT ACCEL={accel} MINIMUM_CRUISE_RATIO=0 SQUARE_CORNER_VELOCITY={[(accel / 1000), 5.0]|max} G1 Z{z_height} F{feedrate_travel / 10} G1 X{mid_x + (size * direction_factor[direction].start.x) } Y{mid_y + (size * direction_factor[direction].start.y)} F{feedrate_travel} {% for curr_sample in range(0, nb_samples) %} {% set curr_speed = min_speed + curr_sample * speed_increment %} RESPOND MSG="{"Current speed: %.2f mm/s" % (curr_speed / 60)|float}" ACCELEROMETER_MEASURE CHIP={accel_chip} {% if direction == 'E' %} G0 E{curr_speed*direction_factor[direction].move_factor} F{curr_speed} {% else %} {% for key, factor in direction_factor[direction].move_factors|dictsort %} G1 X{mid_x + (size * factor.x) } Y{mid_y + (size * factor.y)} Z{z_height + (size * factor.z)} F{curr_speed} {% endfor %} {% endif %} ACCELEROMETER_MEASURE CHIP={accel_chip} NAME=sp{("%.2f" % (curr_speed / 60)|float)|replace('.','_')}n1 G4 P300 M400 {% endfor %} RESPOND MSG="Machine and motors vibration graph generation..." RESPOND MSG="This may take some time (3-5min)" RUN_SHELL_COMMAND CMD=shaketune PARAMS="--type vibrations --axis_name {direction} --accel {accel|int} --chip_name {accel_chip} {% if keep_csv %}--keep_csv{% endif %}" M400 RUN_SHELL_COMMAND CMD=shaketune PARAMS="--type clean --keep_results {keep_results}" SET_VELOCITY_LIMIT ACCEL={old_accel} MINIMUM_CRUISE_RATIO={old_cruise_ratio} SQUARE_CORNER_VELOCITY={old_sqv} RESTORE_GCODE_STATE NAME=STATE_VIBRATIONS_CALIBRATION [gcode_shell_command shaketune] command = ~/printer_data/config/K-ShakeTune/scripts/shaketune.sh timeout = 600.0 verbose = True [stepper_x] step_pin = PE6 dir_pin = !PE5 enable_pin = multi_pin:z_enable microsteps = 16 rotation_distance = 32 endstop_pin = EBBCan: PB6 position_endstop = 0 position_max = 315 homing_speed = 50 [stepper_y] step_pin = PE2 dir_pin = !PE1 enable_pin = !PE4 microsteps = 16 rotation_distance = 32 endstop_pin = ^PF3 position_endstop = 300 position_max = 300 homing_speed = 50 [stepper_z] step_pin = PB8 dir_pin = PB7 enable_pin = !PE0 microsteps = 16 rotation_distance = 32 endstop_pin = probe:z_virtual_endstop position_max = 230 position_min = -5.0 homing_speed = 20 second_homing_speed = 10 homing_retract_dist = 5 [stepper_z1] step_pin = PB4 dir_pin = !PB3 enable_pin = !PB6 microsteps = 16 rotation_distance = 32 [stepper_z2] step_pin = PG13 dir_pin = !PG12 enable_pin = !PG15 microsteps = 16 rotation_distance = 32 [extruder] step_pin = EBBCan: PD0 dir_pin = EBBCan: PD1 enable_pin = !EBBCan: PD2 microsteps = 16 rotation_distance = 3.43 nozzle_diameter = 0.600 filament_diameter = 1.750 heater_pin = EBBCan: PB13 sensor_type = EPCOS 100K B57560G104F sensor_pin = EBBCan: PA3 min_temp = 0 max_temp = 250 max_extrude_cross_section = 250 max_extrude_only_distance = 250 control = pid pid_kp = 16.610 pid_ki = 0.527 pid_kd = 130.805 [tmc5160 stepper_x] cs_pin = PC13 spi_software_mosi_pin = PG6 spi_software_miso_pin = PG7 spi_software_sclk_pin = PG8 run_current = 1.400 [tmc5160 stepper_y] cs_pin = PE3 spi_software_mosi_pin = PG6 spi_software_miso_pin = PG7 spi_software_sclk_pin = PG8 run_current = 1.400 [tmc2209 stepper_z] uart_pin = PB9 run_current = 0.850 stealthchop_threshold = 999999 [tmc2209 stepper_z1] uart_pin = PB5 run_current = 0.850 stealthchop_threshold = 999999 [tmc2209 stepper_z2] uart_pin = PG14 run_current = 0.850 stealthchop_threshold = 999999 [tmc2209 extruder] uart_pin = EBBCan: PA15 run_current = 0.650 [multi_pin z_enable] pins = !PC14, PA5 [heater_bed] heater_pin = PA0 sensor_type = ATC Semitec 104GT-2 sensor_pin = PB1 control = pid pid_kp = 54.027 pid_ki = 0.770 pid_kd = 948.182 min_temp = 0 max_temp = 130 [fan] pin = EBBCan: PA1 [heater_fan hotend_fan] pin = EBBCan: PA0 heater = extruder heater_temp = 50.0 [controller_fan tmc_fan] pin = PF7 stepper = stepper_x [temperature_fan CB1] pin = PF8 sensor_type = temperature_host min_temp = 10 max_temp = 90 control = pid pid_kp = 2 pid_ki = 4 pid_kd = 0.1 [temperature_sensor mcu_temp] sensor_type = temperature_mcu min_temp = 0 max_temp = 100 [temperature_sensor EBB_Temperature] sensor_type = temperature_mcu sensor_mcu = EBBCan [temperature_sensor bed_top] sensor_type = EPCOS 100K B57560G104F sensor_pin = PB0 [temperature_sensor Chamber_Middle] sensor_type = AHT10 i2c_mcu = mcu i2c_bus = i2c0 [bltouch] sensor_pin = ^EBBCan:PB8 control_pin = EBBCan:PB9 stow_on_each_sample = false probe_with_touch_mode = true x_offset = 55 y_offset = 0 speed = 10 lift_speed = 20 samples = 2 samples_tolerance_retries = 4 z_offset = 1.200 [idle_timeout] timeout = 960000 [filament_switch_sensor switch_sensor] switch_pin = ^PF0 pause_on_runout = false runout_gcode = PAUSE [filament_motion_sensor motion_sensor] switch_pin = ^PC15 detection_length = 4 extruder = extruder pause_on_runout = false runout_gcode = PAUSE [neopixel outside] pin = CB1: gpio259 chain_count = 79 color_order = GRB initial_red = 0.5 initial_green = 0.5 initial_blue = 0.5 [neopixel back] pin = PD15 chain_count = 29 color_order = GRB initial_red = 0.5 initial_green = 0.5 initial_blue = 0.5 [z_tilt] z_positions = 0, 25 300, 25 150, 300 points = 0, 20 245, 20 95, 295 speed = 125 horizontal_move_z = 10 retries = 8 retry_tolerance = 0.01 [bed_mesh] speed = 125 horizontal_move_z = 10 mesh_min = 55, 10 mesh_max = 245,290 probe_count = 5, 5 algorithm = bicubic bicubic_tension = 0.2 fade_start = 1 fade_end = 10 fade_target = 0 [safe_z_home] home_xy_position = 100, 150 speed = 150 [input_shaper] shaper_freq_x = 83.8 shaper_type_x = mzv shaper_freq_y = 65.2 shaper_type_y = mzv [adxl345] cs_pin = EBBCan: PB12 spi_software_sclk_pin = EBBCan: PB10 spi_software_mosi_pin = EBBCan: PB11 spi_software_miso_pin = EBBCan: PB2 axes_map = x,y,z [resonance_tester] accel_chip = adxl345 probe_points = 160, 150, 50 [gcode_macro PRINT_START] gcode = {% set BED = params.BED_TEMP|int %} {% set EXTRUDER = params.EXTRUDER_TEMP|int %} M140 S{BED} M104 S{EXTRUDER} G28 Z_TILT_ADJUST BED_MESH_CALIBRATE _ADAPTIVE_PURGE_V1 [gcode_macro Z_TILT_ADJUST] rename_existing = Z_TILT_ADJUST_1 gcode = {% if printer["gcode_macro status_leveling"] != null %} status_leveling {% endif %} Z_TILT_ADJUST_1 { rawparams } {% if printer["gcode_macro status_ready"] != null %} status_ready {% endif %} [gcode_macro BED_MESH_CALIBRATE] rename_existing = _BED_MESH_CALIBRATE variable_buffer = 2 gcode = {% set bedMeshConfig = printer['configfile'].config["bed_mesh"] %} {% set bed_mesh_min = bedMeshConfig.mesh_min %} {% set bed_mesh_max = bedMeshConfig.mesh_max %} {% set all_points = printer.exclude_object.objects | map(attribute='polygon') | sum(start=[]) %} {% 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]) %} {% if printer["bed_mesh"].profile_name == '' %} { action_respond_info("No existing bed mesh found.") } {% set last_area_end_x=-1 %} {% endif %} {% if printer.toolhead.homed_axes != "xyz" %} G28 {% endif %} {% set klicky_available = printer['gcode_macro _Probe_Variables'] != null %} {% set probeConfig = printer['configfile'].config["probe"] %} {% if probeConfig %} {% set OffsetX = probeConfig.x_offset|default(0)|float %} {% set OffsetY = probeConfig.y_offset|default(0)|float %} {% endif %} {% set print_min_x = x_min|float %} {% set print_min_y = y_min|float %} {% set print_max_x = x_max|float %} {% set print_max_y = y_max|float %} {% set mesh_min_x = bed_mesh_min.split(",")[0]|float %} {% set mesh_min_y = bed_mesh_min.split(",")[1]|float %} {% set mesh_max_x = bed_mesh_max.split(",")[0]|float %} {% set mesh_max_y = bed_mesh_max.split(",")[1]|float %} {% if (print_min_x < mesh_min_x) or (print_max_x > mesh_max_x) or (print_min_y < mesh_min_y) or (print_max_y > mesh_max_y) %} {% set print_min_x = mesh_min_x %} {% set print_min_y = mesh_min_y %} {% set print_max_x = mesh_max_x %} {% set print_max_y = mesh_max_y %} {% endif %} {% if klicky_available %} _CheckProbe action=query Attach_Probe {% elif euclid_available %} DEPLOY_PROBE {% endif %} {% if (print_min_x < print_max_x) and (print_min_y < print_max_y) %} {% set minimum_probe_count = 3 %} {% set medium_probe_count = 5 %} {% set probe_count = bedMeshConfig.probe_count.split(",") %} {% set probe_count_x = probe_count[0]|int %} {% if probe_count.__len__() > 1 %} {% set probe_count_y = probe_count[1]|int %} {% else %} {% set probe_count_y = probe_count_x|int %} {% endif %} {% set relative_reference_index = bedMeshConfig.relative_reference_index %} {% if print_max_x - print_min_x < (mesh_max_x - mesh_min_x) * 0.75 %} {% set probe_count_x = medium_probe_count %} {% endif %} {% if print_max_y - print_min_y < (mesh_max_y - mesh_min_y) * 0.75 %} {% set probe_count_y = medium_probe_count %} {% endif %} {% if print_max_x - print_min_x < (mesh_max_x - mesh_min_x) * 0.50 %} {% set probe_count_x = minimum_probe_count %} {% endif %} {% if print_max_y - print_min_y < (mesh_max_y - mesh_min_y) * 0.50 %} {% set probe_count_y = minimum_probe_count %} {% endif %} {% if print_min_x - buffer >= mesh_min_x %} {% set mesh_min_x = print_min_x - buffer %} {% endif %} {% if print_min_y - buffer >= mesh_min_y %} {% set mesh_min_y = print_min_y - buffer %} {% endif %} {% if print_max_x + buffer <= mesh_max_x %} {% set mesh_max_x = print_max_x + buffer %} {% endif %} {% if print_max_y + buffer <= mesh_max_y %} {% set mesh_max_y = print_max_y + buffer %} {% endif %} { action_respond_info("mesh_min: %s,%s" % (mesh_min_x, mesh_min_y)) } { action_respond_info("mesh_max: %s,%s" % (mesh_max_x, mesh_max_y)) } { action_respond_info("probe_count: %s,%s" % (probe_count_x,probe_count_y)) } {% if printer["gcode_macro status_meshing"] != null %} status_meshing {% endif %} {% if relative_reference_index == 0 or relative_reference_index == null %} _BED_MESH_CALIBRATE mesh_min={mesh_min_x},{mesh_min_y} mesh_max={mesh_max_x},{mesh_max_y} probe_count={probe_count_x},{probe_count_y} {% else %} {% set relative_reference_index = ((probe_count_x * probe_count_y - 1) / 2)|int %} { action_respond_info("relative_reference_index: %s" % relative_reference_index) } _BED_MESH_CALIBRATE mesh_min={mesh_min_x},{mesh_min_y} mesh_max={mesh_max_x},{mesh_max_y} probe_count={probe_count_x},{probe_count_y} relative_reference_index={relative_reference_index} {% endif %} {% else %} {% if printer["gcode_macro status_meshing"] != null %} status_meshing {% endif %} _BED_MESH_CALIBRATE {% endif %} {% if klicky_available %} Dock_Probe {% elif euclid_available %} STOW_PROBE {% endif %} {% if printer["gcode_macro status_ready"] != null %} status_ready {% endif %} [gcode_macro _ADAPTIVE_PURGE_V1] description = A purge macro that adapts to be near your actual printed objects variable_adaptive_enable = True variable_z_height = 0.3 variable_tip_distance = 10 variable_purge_amount = 30 variable_flow_rate = 10 variable_x_default = 5 variable_y_default = 5 variable_size = 16 variable_distance_to_object_x = 7 variable_distance_to_object_y = 7 gcode = {% if adaptive_enable == True %} {% set all_points = printer.exclude_object.objects | map(attribute='polygon') | sum(start=[]) %} {% set x_origin = (all_points | map(attribute=0) | min | default(x_default + distance_to_object_x + size)) - distance_to_object_x - size %} {% set y_origin = (all_points | map(attribute=1) | min | default(y_default + distance_to_object_y + size)) - distance_to_object_y - size %} {% set x_origin = ([x_origin, 0] | max) %} {% set y_origin = ([y_origin, 0] | max) %} {% if x_origin < x_default %} set x_origin = x_default | float {% endif %} {% if y_origin < y_default %} set y_origin = y_default | float {% endif %} {% else %} {% set x_origin = x_default | float %} {% set y_origin = y_default | float %} {% endif %} {% set purge_move_speed = 2.31 * size * flow_rate / (purge_amount * 2.405) %} {% set prepurge_speed = flow_rate / 2.405 %} {% set travel_speed = printer.toolhead.max_velocity %} { action_respond_info( "x: " + x_origin|string + " y: " + y_origin|string + " purge_move_speed: " + purge_move_speed|string + " prepurge_speed: " + prepurge_speed|string ) } G92 E0 G90 G0 X{x_origin} Y{y_origin+size/2} F3000 G0 Z{z_height} F1500 G0 F3000 M83 G1 E{tip_distance} F{prepurge_speed*60} G1 F600 G1 X{x_origin+size*0.1976875} Y{y_origin+size*0.0538125} E{purge_amount*0.00362396204033215} G1 X{x_origin+size*0.2070625} Y{y_origin+size*0.056375} E{purge_amount*0.00348517200474496} G1 X{x_origin+size*0.273} Y{y_origin+size*0.0889375} E{purge_amount*0.0253226571767497} G1 X{x_origin+size*0.3568125} Y{y_origin+size*0.125125} E{purge_amount*0.0313760379596679} G1 X{x_origin+size*0.442375} Y{y_origin+size*0.1563125} E{purge_amount*0.0312455516014235} G1 X{x_origin+size*0.5295625} Y{y_origin+size*0.1825} E{purge_amount*0.0311731909845789} G1 X{x_origin+size*0.5311875} Y{y_origin+size*0.1829375} E{purge_amount*0.000575326215895611} G1 X{x_origin+size*0.6196875} Y{y_origin+size*0.2038125} E{purge_amount*0.0311376037959668} G1 X{x_origin+size*0.7093125} Y{y_origin+size*0.219625} E{purge_amount*0.0312253855278766} G1 X{x_origin+size*0.799875} Y{y_origin+size*0.2301875} E{purge_amount*0.0313368920521945} G1 X{x_origin+size*0.8735625} Y{y_origin+size*0.2349375} E{purge_amount*0.0254270462633452} G1 X{x_origin+size*0.8824375} Y{y_origin+size*0.237} E{purge_amount*0.00326809015421115} G1 X{x_origin+size*0.8913125} Y{y_origin+size*0.2390625} E{purge_amount*0.00339739027283511} G1 X{x_origin+size*0.8959375} Y{y_origin+size*0.2481875} E{purge_amount*0.00381494661921708} G1 X{x_origin+size*0.9005} Y{y_origin+size*0.257375} E{purge_amount*0.00366548042704626} G1 X{x_origin+size*0.951125} Y{y_origin+size*0.4463125} E{purge_amount*0.0668623962040332} G1 X{x_origin+size*0.9521875} Y{y_origin+size*0.4540625} E{purge_amount*0.00276156583629893} G1 X{x_origin+size*0.9531875} Y{y_origin+size*0.46175} E{purge_amount*0.00282443653618031} G1 X{x_origin+size*0.9528125} Y{y_origin+size*0.4654375} E{purge_amount*0.00138078291814947} G1 X{x_origin+size*0.9458125} Y{y_origin+size*0.4720625} E{purge_amount*0.00359193357058126} G1 X{x_origin+size*0.9388125} Y{y_origin+size*0.4786875} E{purge_amount*0.00342467378410439} G1 X{x_origin+size*0.9145625} Y{y_origin+size*0.4951875} E{purge_amount*0.00993950177935943} G1 X{x_origin+size*0.8395} Y{y_origin+size*0.547875} E{purge_amount*0.0316453143534994} G1 X{x_origin+size*0.7680625} Y{y_origin+size*0.6045} E{purge_amount*0.0314733096085409} G1 X{x_origin+size*0.700125} Y{y_origin+size*0.665125} E{purge_amount*0.0314483985765125} G1 X{x_origin+size*0.6358125} Y{y_origin+size*0.7295} E{purge_amount*0.0314317912218268} G1 X{x_origin+size*0.5755625} Y{y_origin+size*0.7971875} E{purge_amount*0.0312977461447212} G1 X{x_origin+size*0.5465} Y{y_origin+size*0.8325625} E{purge_amount*0.0155836298932384} G1 X{x_origin+size*0.492125} Y{y_origin+size*0.9056875} E{purge_amount*0.0313190984578885} G1 X{x_origin+size*0.451125} Y{y_origin+size*0.967125} E{purge_amount*0.0254341637010676} G1 X{x_origin+size*0.444625} Y{y_origin+size*0.9739375} E{purge_amount*0.00337959667852906} G1 X{x_origin+size*0.4380625} Y{y_origin+size*0.98075} E{purge_amount*0.00353262158956109} G1 X{x_origin+size*0.428125} Y{y_origin+size*0.98} E{purge_amount*0.00372123368920522} G1 X{x_origin+size*0.41825} Y{y_origin+size*0.97925} E{purge_amount*0.00354211150652432} G1 X{x_origin+size*0.22925} Y{y_origin+size*0.928625} E{purge_amount*0.0668837485172005} G1 X{x_origin+size*0.2204375} Y{y_origin+size*0.924125} E{purge_amount*0.00351601423487545} G1 X{x_origin+size*0.2115625} Y{y_origin+size*0.919625} E{purge_amount*0.00366903914590747} G1 X{x_origin+size*0.2091875} Y{y_origin+size*0.910625} E{purge_amount*0.00343179122182681} G1 X{x_origin+size*0.2068125} Y{y_origin+size*0.9016875} E{purge_amount*0.00329774614472123} G1 X{x_origin+size*0.2020625} Y{y_origin+size*0.82825} E{purge_amount*0.0253404507710558} G1 X{x_origin+size*0.1915} Y{y_origin+size*0.737625} E{purge_amount*0.0313582443653618} G1 X{x_origin+size*0.17575} Y{y_origin+size*0.6479375} E{purge_amount*0.0312431791221827} G1 X{x_origin+size*0.154875} Y{y_origin+size*0.5593125} E{purge_amount*0.0311791221826809} G1 X{x_origin+size*0.1544375} Y{y_origin+size*0.5576875} E{purge_amount*0.000575326215895611} G1 X{x_origin+size*0.12825} Y{y_origin+size*0.470625} E{purge_amount*0.0311328588374852} G1 X{x_origin+size*0.0970625} Y{y_origin+size*0.385125} E{purge_amount*0.0312253855278766} G1 X{x_origin+size*0.061} Y{y_origin+size*0.3014375} E{purge_amount*0.0313190984578885} G1 X{x_origin+size*0.02825} Y{y_origin+size*0.2351875} E{purge_amount*0.0254483985765125} G1 X{x_origin+size*0.025625} Y{y_origin+size*0.226125} E{purge_amount*0.00338671411625148} G1 X{x_origin+size*0.023} Y{y_origin+size*0.2170625} E{purge_amount*0.00352313167259787} G1 X{x_origin+size*0.028625} Y{y_origin+size*0.208875} E{purge_amount*0.00370937129300119} G1 X{x_origin+size*0.03425} Y{y_origin+size*0.200625} E{purge_amount*0.003570581257414} G1 X{x_origin+size*0.1725625} Y{y_origin+size*0.0623125} E{purge_amount*0.0668623962040332} G1 X{x_origin+size*0.1804375} Y{y_origin+size*0.0568125} E{purge_amount*0.00343297746144721} G1 X{x_origin+size*0.18375} Y{y_origin+size*0.0545} E{purge_amount*0.00150652431791222} G92 E0 M82 G0 Z{z_height*2} {% if printer["gcode_macro status_printing"] != null %} status_printing {% endif %} [gcode_macro PRINT_END] gcode = M400 TURN_OFF_HEATERS M106 S0 PARK_CENTER_REAR G0 Z230 F3000 [gcode_macro PARK_CENTER_REAR] gcode = {% if printer["gcode_macro status_busy"] != null %} status_busy {% endif %} {% set th = printer.toolhead %} {% set x_safe = th.position.x + 20 * (1 if th.axis_maximum.x - th.position.x > 20 else -1) %} {% set y_safe = th.position.y + 20 * (1 if th.axis_maximum.y - th.position.y > 20 else -1) %} G0 X{th.axis_maximum.x//2} Y{th.axis_maximum.y - 2} F3600 {% if printer["gcode_macro status_ready"] != null %} status_ready {% endif %} [gcode_macro TEST_SPEED] gcode = G0 Z10 {% set speed = params.SPEED|default(printer.configfile.settings.printer.max_velocity)|int %} {% set iterations = params.ITERATIONS|default(5)|int %} {% set accel = params.ACCEL|default(printer.configfile.settings.printer.max_accel)|int %} {% set bound = params.BOUND|default(20)|int %} {% set smallpatternsize = SMALLPATTERNSIZE|default(20)|int %} {% set x_min = printer.toolhead.axis_minimum.x + bound %} {% set x_max = printer.toolhead.axis_maximum.x - bound %} {% set y_min = printer.toolhead.axis_minimum.y + bound %} {% set y_max = printer.toolhead.axis_maximum.y - bound %} {% set x_center = (printer.toolhead.axis_minimum.x|float + printer.toolhead.axis_maximum.x|float ) / 2 %} {% set y_center = (printer.toolhead.axis_minimum.y|float + printer.toolhead.axis_maximum.y|float ) / 2 %} {% set x_center_min = x_center - (smallpatternsize/2) %} {% set x_center_max = x_center + (smallpatternsize/2) %} {% set y_center_min = y_center - (smallpatternsize/2) %} {% set y_center_max = y_center + (smallpatternsize/2) %} SAVE_GCODE_STATE NAME=TEST_SPEED { action_respond_info("TEST_SPEED: starting %d iterations at speed %d, accel %d" % (iterations, speed, accel)) } M400 G28 {% if printer.configfile.settings.quad_gantry_level %} {% if printer.quad_gantry_level.applied == False %} QUAD_GANTRY_LEVEL G28 Z {% endif %} {% endif %} G90 G1 X{printer.toolhead.axis_maximum.x-50} Y{printer.toolhead.axis_maximum.y-50} F{30*60} M400 G28 X Y G0 X{printer.toolhead.axis_maximum.x-1} Y{printer.toolhead.axis_maximum.y-1} F{30*60} G4 P1000 GET_POSITION G0 X{x_min} Y{y_min} Z{bound + 10} F{speed*60} SET_VELOCITY_LIMIT VELOCITY={speed} ACCEL={accel} ACCEL_TO_DECEL={accel / 2} {% for i in range(iterations) %} G0 X{x_min} Y{y_min} F{speed*60} G0 X{x_max} Y{y_max} F{speed*60} G0 X{x_min} Y{y_min} F{speed*60} G0 X{x_max} Y{y_min} F{speed*60} G0 X{x_min} Y{y_max} F{speed*60} G0 X{x_max} Y{y_min} F{speed*60} G0 X{x_min} Y{y_min} F{speed*60} G0 X{x_min} Y{y_max} F{speed*60} G0 X{x_max} Y{y_max} F{speed*60} G0 X{x_max} Y{y_min} F{speed*60} G0 X{x_center_min} Y{y_center_min} F{speed*60} G0 X{x_center_max} Y{y_center_max} F{speed*60} G0 X{x_center_min} Y{y_center_min} F{speed*60} G0 X{x_center_max} Y{y_center_min} F{speed*60} G0 X{x_center_min} Y{y_center_max} F{speed*60} G0 X{x_center_max} Y{y_center_min} F{speed*60} G0 X{x_center_min} Y{y_center_min} F{speed*60} G0 X{x_center_min} Y{y_center_max} F{speed*60} G0 X{x_center_max} Y{y_center_max} F{speed*60} G0 X{x_center_max} Y{y_center_min} F{speed*60} {% endfor %} SET_VELOCITY_LIMIT VELOCITY={printer.configfile.settings.printer.max_velocity} ACCEL={printer.configfile.settings.printer.max_accel} M400 G28 G90 G0 X{printer.toolhead.axis_maximum.x-1} Y{printer.toolhead.axis_maximum.y-1} F{30*60} G4 P1000 GET_POSITION RESTORE_GCODE_STATE NAME=TEST_SPEED [led_effect progress_bar] leds = neopixel:back autostart = true frame_rate = 24 layers = progress -1 0 add ( 0, 0, 1),( 0, 0.1, 0.6) static 0 0 top ( 0, 0, 0.1) [gcode_macro update_git] gcode = {% set message = params.MESSAGE|default() %} {% if message %} RUN_SHELL_COMMAND CMD=update_git_script_message PARAMS="'{params.MESSAGE}'" {% else %} RUN_SHELL_COMMAND CMD=update_git_script {% endif %} [gcode_shell_command update_git_script] command = bash -c "bash $HOME/klipper-backup/script.sh" timeout = 90.0 verbose = True [gcode_shell_command update_git_script_message] command = bash -c "bash $HOME/klipper-backup/script.sh $0" timeout = 90.0 verbose = True [bed_mesh default] version = 1 points = -0.026610, 0.013390, 0.018390, 0.013390, 0.048390 0.133390, 0.118390, 0.073390, 0.048390, 0.048390 0.298390, 0.243390, 0.198390, 0.153390, 0.123390 0.328390, 0.273390, 0.208390, 0.168390, 0.118390 0.118390, 0.078390, 0.028390, -0.001610, -0.016610 x_count = 5 y_count = 5 mesh_x_pps = 2 mesh_y_pps = 2 algo = bicubic tension = 0.2 min_x = 55.0 max_x = 245.0 min_y = 10.0 max_y = 290.0 ======================= Extruder max_extrude_ratio=103.937922 mcu 'mcu': Starting CAN connect Created a socket webhooks client 281473466371088: New connection webhooks client 281473466371088: Client info {'program': 'Moonraker', 'version': 'v0.8.0-331-gc857e1a'} Loaded MCU 'mcu' 108 commands (v0.12.0-132-ge37b007f / gcc: (15:8-2019-q3-1+b1) 8.3.1 20190703 (release) [gcc-8-branch revision 273027] binutils: (2.35.2-2+14+b2) 2.35.2) MCU 'mcu' config: ADC_MAX=4095 BUS_PINS_i2c1_PB6_PB7=PB6,PB7 BUS_PINS_i2c1_PB8_PB9=PB8,PB9 BUS_PINS_i2c2_PB10_PB11=PB10,PB11 BUS_PINS_spi1=PA6,PA7,PA5 BUS_PINS_spi1a=PB4,PB5,PB3 BUS_PINS_spi2=PB14,PB15,PB13 BUS_PINS_spi2a=PC2,PC3,PB10 BUS_PINS_spi3a=PC11,PC12,PC10 BUS_PINS_spi4=PE13,PE14,PE12 BUS_PINS_spi5=PF8,PF9,PF7 BUS_PINS_spi5a=PH7,PF11,PH6 BUS_PINS_spi6=PG12,PG14,PG13 CANBUS_BRIDGE=1 CLOCK_FREQ=400000000 MCU=stm32h723xx PWM_MAX=255 RECEIVE_WINDOW=192 RESERVE_PINS_CAN=PD0,PD1 RESERVE_PINS_USB=PA11,PA12 RESERVE_PINS_crystal=PH0,PH1 STATS_SUMSQ_BASE=256 STEPPER_BOTH_EDGE=1 mcu 'EBBCan': Starting CAN connect Created a socket Loaded MCU 'EBBCan' 108 commands (v0.12.0-132-ge37b007f / gcc: (15:8-2019-q3-1+b1) 8.3.1 20190703 (release) [gcc-8-branch revision 273027] binutils: (2.35.2-2+14+b2) 2.35.2) MCU 'EBBCan' config: ADC_MAX=4095 BUS_PINS_i2c1_PA9_PA10=PA9,PA10 BUS_PINS_i2c1_PB6_PB7=PB6,PB7 BUS_PINS_i2c1_PB8_PB9=PB8,PB9 BUS_PINS_i2c2_PB10_PB11=PB10,PB11 BUS_PINS_i2c2_PB13_PB14=PB13,PB14 BUS_PINS_i2c3_PB3_PB4=PB3,PB4 BUS_PINS_i2c3_PC0_PC1=PC0,PC1 BUS_PINS_spi1=PA6,PA7,PA5 BUS_PINS_spi1a=PB4,PB5,PB3 BUS_PINS_spi2=PB14,PB15,PB13 BUS_PINS_spi2a=PC2,PC3,PB10 BUS_PINS_spi3=PB4,PB5,PB3 CANBUS_FREQUENCY=1000000 CLOCK_FREQ=64000000 MCU=stm32g0b1xx PWM_MAX=255 RECEIVE_WINDOW=192 RESERVE_PINS_CAN=PB0,PB1 RESERVE_PINS_crystal=PF0,PF1 STATS_SUMSQ_BASE=256 STEPPER_BOTH_EDGE=1 mcu 'CB1': Starting connect Loaded MCU 'CB1' 112 commands (v0.12.0-132-ge37b007f / gcc: (Debian 10.2.1-6) 10.2.1 20210110 binutils: (GNU Binutils for Debian) 2.35.2) MCU 'CB1' config: ADC_MAX=4095 CLOCK_FREQ=50000000 MCU=linux PCA9685_MAX=4096 PWM_MAX=32768 STATS_SUMSQ_BASE=256 mcu_temperature 'mcu' nominal base=-281.244980 slope=1644.578313 mcu_temperature 'EBBCan' nominal base=-275.555556 slope=1317.105263 Config error Traceback (most recent call last): File "/home/biqu/klipper/klippy/klippy.py", line 180, in _connect cb() File "/home/biqu/klipper/klippy/mcu.py", line 746, in _connect self._send_config(None) File "/home/biqu/klipper/klippy/mcu.py", line 677, in _send_config cb() File "/home/biqu/klipper/klippy/extras/bus.py", line 174, in build_config bus = resolve_bus_name(self.mcu, "i2c_bus", self.bus) File "/home/biqu/klipper/klippy/extras/bus.py", line 25, in resolve_bus_name raise ppins.error("Unknown %s '%s'" % (param, bus)) pins.error: Unknown i2c_bus 'i2c0' Attempting MCU 'EBBCan' reset command Attempting MCU 'CB1' config_reset command b'Got EOF when reading from device' Attempting MCU 'mcu' reset command webhooks client 281473466371088: Disconnected Restarting printer Start printer at Sat Apr 27 00:53:15 2024 (1714179195.4 2725.1) ===== Config file ===== [mcu] canbus_uuid = b983bbdcfe30 [mcu EBBCan] canbus_uuid = d8d5848615b3 [mcu CB1] serial = /tmp/klipper_host_mcu [printer] kinematics = corexy max_velocity = 500 max_accel = 10000 max_z_velocity = 50 max_z_accel = 500 [virtual_sdcard] path = /home/biqu/printer_data/gcodes on_error_gcode = CANCEL_PRINT [pause_resume] [display_status] [respond] [gcode_macro CANCEL_PRINT] description = Cancel the actual running print rename_existing = CANCEL_PRINT_BASE gcode = PRINT_END [gcode_macro PAUSE] description = Pause the actual running print rename_existing = PAUSE_BASE gcode = {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %} {% set idle_timeout = client.idle_timeout|default(0) %} {% set temp = printer[printer.toolhead.extruder].target if printer.toolhead.extruder != '' else 0 %} {% set restore = False if printer.toolhead.extruder == '' else True if params.RESTORE|default(1)|int == 1 else False %} SET_GCODE_VARIABLE MACRO=RESUME VARIABLE=last_extruder_temp VALUE="{{'restore': restore, 'temp': temp}}" {% if idle_timeout > 0 %} SET_GCODE_VARIABLE MACRO=RESUME VARIABLE=restore_idle_timeout VALUE={printer.configfile.settings.idle_timeout.timeout} SET_IDLE_TIMEOUT TIMEOUT={idle_timeout} {% endif %} PAUSE_BASE {client.user_pause_macro|default("")} _TOOLHEAD_PARK_PAUSE_CANCEL {rawparams} [gcode_macro RESUME] description = Resume the actual running print rename_existing = RESUME_BASE variable_last_extruder_temp = {'restore': False, 'temp': 0} variable_restore_idle_timeout = 0 variable_idle_state = False gcode = {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %} {% set velocity = printer.configfile.settings.pause_resume.recover_velocity %} {% set sp_move = client.speed_move|default(velocity) %} {% set runout_resume = True if client.runout_sensor|default("") == "" else True if not printer[client.runout_sensor].enabled else printer[client.runout_sensor].filament_detected %} {% set can_extrude = True if printer.toolhead.extruder == '' else printer[printer.toolhead.extruder].can_extrude %} {% set do_resume = False %} {% set prompt_txt = [] %} {% if printer.idle_timeout.state|upper == "IDLE" or idle_state %} SET_GCODE_VARIABLE MACRO=RESUME VARIABLE=idle_state VALUE=False {% if last_extruder_temp.restore %} RESPOND TYPE=echo MSG='{"Restoring \"%s\" temperature to %3.1f\u00B0C, this may take some time" % (printer.toolhead.extruder, last_extruder_temp.temp) }' M109 S{last_extruder_temp.temp} {% set do_resume = True %} {% elif can_extrude %} {% set do_resume = True %} {% else %} RESPOND TYPE=error MSG='{"Resume aborted !!! \"%s\" not hot enough, please heat up again and press RESUME" % printer.toolhead.extruder}' {% set _d = prompt_txt.append("\"%s\" not hot enough, please heat up again and press RESUME" % printer.toolhead.extruder) %} {% endif %} {% elif can_extrude %} {% set do_resume = True %} {% else %} RESPOND TYPE=error MSG='{"Resume aborted !!! \"%s\" not hot enough, please heat up again and press RESUME" % printer.toolhead.extruder}' {% set _d = prompt_txt.append("\"%s\" not hot enough, please heat up again and press RESUME" % printer.toolhead.extruder) %} {% endif %} {% if runout_resume %} {% if do_resume %} {% if restore_idle_timeout > 0 %} SET_IDLE_TIMEOUT TIMEOUT={restore_idle_timeout} {% endif %} {client.user_resume_macro|default("")} _CLIENT_EXTRUDE RESUME_BASE VELOCITY={params.VELOCITY|default(sp_move)} {% endif %} {% else %} RESPOND TYPE=error MSG='{"Resume aborted !!! \"%s\" detects no filament, please load filament and press RESUME" % (client.runout_sensor.split(" "))[1]}' {% set _d = prompt_txt.append("\"%s\" detects no filament, please load filament and press RESUME" % (client.runout_sensor.split(" "))[1]) %} {% endif %} {% if not (runout_resume and do_resume) %} RESPOND TYPE=command MSG="action:prompt_begin RESUME aborted !!!" {% for element in prompt_txt %} RESPOND TYPE=command MSG='{"action:prompt_text %s" % element}' {% endfor %} RESPOND TYPE=command MSG="action:prompt_footer_button Ok|RESPOND TYPE=command MSG=action:prompt_end|info" RESPOND TYPE=command MSG="action:prompt_show" {% endif %} [gcode_macro SET_PAUSE_NEXT_LAYER] description = Enable a pause if the next layer is reached gcode = {% set pause_next_layer = printer['gcode_macro SET_PRINT_STATS_INFO'].pause_next_layer %} {% set ENABLE = params.ENABLE|default(1)|int != 0 %} {% set MACRO = params.MACRO|default(pause_next_layer.call, True) %} SET_GCODE_VARIABLE MACRO=SET_PRINT_STATS_INFO VARIABLE=pause_next_layer VALUE="{{ 'enable': ENABLE, 'call': MACRO }}" [gcode_macro SET_PAUSE_AT_LAYER] description = Enable/disable a pause if a given layer number is reached gcode = {% set pause_at_layer = printer['gcode_macro SET_PRINT_STATS_INFO'].pause_at_layer %} {% set ENABLE = params.ENABLE|int != 0 if params.ENABLE is defined else params.LAYER is defined %} {% set LAYER = params.LAYER|default(pause_at_layer.layer)|int %} {% set MACRO = params.MACRO|default(pause_at_layer.call, True) %} SET_GCODE_VARIABLE MACRO=SET_PRINT_STATS_INFO VARIABLE=pause_at_layer VALUE="{{ 'enable': ENABLE, 'layer': LAYER, 'call': MACRO }}" [gcode_macro SET_PRINT_STATS_INFO] rename_existing = SET_PRINT_STATS_INFO_BASE description = Overwrite, to get pause_next_layer and pause_at_layer feature variable_pause_next_layer = { 'enable': False, 'call': "PAUSE" } variable_pause_at_layer = { 'enable': False, 'layer': 0, 'call': "PAUSE" } gcode = {% if pause_next_layer.enable %} RESPOND TYPE=echo MSG='{"%s, forced by pause_next_layer" % pause_next_layer.call}' {pause_next_layer.call} SET_PAUSE_NEXT_LAYER ENABLE=0 {% elif pause_at_layer.enable and params.CURRENT_LAYER is defined and params.CURRENT_LAYER|int == pause_at_layer.layer %} RESPOND TYPE=echo MSG='{"%s, forced by pause_at_layer [%d]" % (pause_at_layer.call, pause_at_layer.layer)}' {pause_at_layer.call} SET_PAUSE_AT_LAYER ENABLE=0 {% endif %} SET_PRINT_STATS_INFO_BASE {rawparams} [gcode_macro _TOOLHEAD_PARK_PAUSE_CANCEL] description = Helper: park toolhead used in PAUSE and CANCEL_PRINT gcode = {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %} {% set velocity = printer.configfile.settings.pause_resume.recover_velocity %} {% set use_custom = client.use_custom_pos|default(false)|lower == 'true' %} {% set custom_park_x = client.custom_park_x|default(0.0) %} {% set custom_park_y = client.custom_park_y|default(0.0) %} {% set park_dz = client.custom_park_dz|default(2.0)|abs %} {% set sp_hop = client.speed_hop|default(15) * 60 %} {% set sp_move = client.speed_move|default(velocity) * 60 %} {% set origin = printer.gcode_move.homing_origin %} {% set act = printer.gcode_move.gcode_position %} {% set max = printer.toolhead.axis_maximum %} {% set cone = printer.toolhead.cone_start_z|default(max.z) %} {% set round_bed = True if printer.configfile.settings.printer.kinematics is in ['delta','polar','rotary_delta','winch'] else False %} {% set z_min = params.Z_MIN|default(0)|float %} {% set z_park = [[(act.z + park_dz), z_min]|max, (max.z - origin.z)]|min %} {% set x_park = params.X if params.X is defined else custom_park_x if use_custom else 0.0 if round_bed else (max.x - 5.0) %} {% set y_park = params.Y if params.Y is defined else custom_park_y if use_custom else (max.y - 5.0) if round_bed and z_park < cone else 0.0 if round_bed else (max.y - 5.0) %} _CLIENT_RETRACT {% if "xyz" in printer.toolhead.homed_axes %} G90 G1 Z{z_park} F{sp_hop} G1 X{x_park} Y{y_park} F{sp_move} {% if not printer.gcode_move.absolute_coordinates %} G91 {% endif %} {% else %} RESPOND TYPE=echo MSG='Printer not homed' {% endif %} [gcode_macro _CLIENT_EXTRUDE] description = Extrudes, if the extruder is hot enough gcode = {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %} {% set use_fw_retract = (client.use_fw_retract|default(false)|lower == 'true') and (printer.firmware_retraction is defined) %} {% set length = params.LENGTH|default(client.unretract)|default(1.0)|float %} {% set speed = params.SPEED|default(client.speed_unretract)|default(35) %} {% set absolute_extrude = printer.gcode_move.absolute_extrude %} {% if printer.toolhead.extruder != '' %} {% if printer[printer.toolhead.extruder].can_extrude %} {% if use_fw_retract %} {% if length < 0 %} G10 {% else %} G11 {% endif %} {% else %} M83 G1 E{length} F{(speed|float|abs) * 60} {% if absolute_extrude %} M82 {% endif %} {% endif %} {% else %} RESPOND TYPE=echo MSG='{"\"%s\" not hot enough" % printer.toolhead.extruder}' {% endif %} {% endif %} [gcode_macro _CLIENT_RETRACT] description = Retracts, if the extruder is hot enough gcode = {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %} {% set length = params.LENGTH|default(client.retract)|default(1.0)|float %} {% set speed = params.SPEED|default(client.speed_retract)|default(35) %} _CLIENT_EXTRUDE LENGTH=-{length|float|abs} SPEED={speed|float|abs} [gcode_arcs] resolution = 1 [exclude_object] [gcode_macro AXES_MAP_CALIBRATION] gcode = {% set z_height = params.Z_HEIGHT|default(20)|int %} {% set speed = params.SPEED|default(80)|float * 60 %} {% set accel = params.ACCEL|default(1500)|int %} {% set feedrate_travel = params.TRAVEL_SPEED|default(120)|int * 60 %} {% set accel_chip = params.ACCEL_CHIP|default("adxl345") %} {% set mid_x = printer.toolhead.axis_maximum.x|float / 2 %} {% set mid_y = printer.toolhead.axis_maximum.y|float / 2 %} {% set accel = [accel, printer.configfile.settings.printer.max_accel]|min %} {% set old_accel = printer.toolhead.max_accel %} {% set old_cruise_ratio = printer.toolhead.minimum_cruise_ratio %} {% set old_sqv = printer.toolhead.square_corner_velocity %} {% if not 'xyz' in printer.toolhead.homed_axes %} { action_raise_error("Must Home printer first!") } {% endif %} {action_respond_info("")} {action_respond_info("Starting accelerometer axe_map calibration")} {action_respond_info("This operation can not be interrupted by normal means. Hit the \"emergency stop\" button to stop it if needed")} {action_respond_info("")} SAVE_GCODE_STATE NAME=STATE_AXESMAP_CALIBRATION G90 SET_VELOCITY_LIMIT ACCEL={accel} MINIMUM_CRUISE_RATIO=0 SQUARE_CORNER_VELOCITY={[(accel / 1000), 5.0]|max} G1 Z{z_height} F{feedrate_travel / 8} G1 X{mid_x - 15} Y{mid_y - 15} F{feedrate_travel} G4 P500 ACCELEROMETER_MEASURE CHIP={accel_chip} G4 P1000 G1 X{mid_x + 15} F{speed} G4 P1000 G1 Y{mid_y + 15} F{speed} G4 P1000 G1 Z{z_height + 15} F{speed} G4 P1000 ACCELEROMETER_MEASURE CHIP={accel_chip} NAME=axemap RESPOND MSG="Analysis of the movements..." RUN_SHELL_COMMAND CMD=shaketune PARAMS="--type axesmap --accel {accel|int} --chip_name {accel_chip}" SET_VELOCITY_LIMIT ACCEL={old_accel} MINIMUM_CRUISE_RATIO={old_cruise_ratio} SQUARE_CORNER_VELOCITY={old_sqv} RESTORE_GCODE_STATE NAME=STATE_AXESMAP_CALIBRATION [gcode_macro AXES_SHAPER_CALIBRATION] description = Perform standard axis input shaper tests on one or both XY axes to select the best input shaper filter gcode = {% set min_freq = params.FREQ_START|default(5)|float %} {% set max_freq = params.FREQ_END|default(133.3)|float %} {% set hz_per_sec = params.HZ_PER_SEC|default(1)|float %} {% set axis = params.AXIS|default("all")|string|lower %} {% set scv = params.SCV|default(None) %} {% set max_sm = params.MAX_SMOOTHING|default(None) %} {% set keep_results = params.KEEP_N_RESULTS|default(3)|int %} {% set keep_csv = params.KEEP_CSV|default(True) %} {% set X, Y = False, False %} {% if axis == "all" %} {% set X, Y = True, True %} {% elif axis == "x" %} {% set X = True %} {% elif axis == "y" %} {% set Y = True %} {% else %} { action_raise_error("AXIS selection invalid. Should be either all, x or y!") } {% endif %} {% if scv is none %} {% set scv = printer.toolhead.square_corner_velocity %} {% endif %} {% if X %} TEST_RESONANCES AXIS=X OUTPUT=raw_data NAME=x FREQ_START={min_freq} FREQ_END={max_freq} HZ_PER_SEC={hz_per_sec} M400 RESPOND MSG="X axis frequency profile generation..." RESPOND MSG="This may take some time (1-3min)" RUN_SHELL_COMMAND CMD=shaketune PARAMS="--type shaper --scv {scv} {% if max_sm is not none %}--max_smoothing {max_sm}{% endif %} {% if keep_csv %}--keep_csv{% endif %}" {% endif %} {% if Y %} TEST_RESONANCES AXIS=Y OUTPUT=raw_data NAME=y FREQ_START={min_freq} FREQ_END={max_freq} HZ_PER_SEC={hz_per_sec} M400 RESPOND MSG="Y axis frequency profile generation..." RESPOND MSG="This may take some time (1-3min)" RUN_SHELL_COMMAND CMD=shaketune PARAMS="--type shaper --scv {scv} {% if max_sm is not none %}--max_smoothing {max_sm}{% endif %} {% if keep_csv %}--keep_csv{% endif %}" {% endif %} M400 RUN_SHELL_COMMAND CMD=shaketune PARAMS="--type clean --keep_results {keep_results}" [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 = {% 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 keep_results = params.KEEP_N_RESULTS|default(3)|int %} {% set keep_csv = params.KEEP_CSV|default(True) %} 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 MSG="Belts comparative frequency profile generation..." RESPOND MSG="This may take some time (3-5min)" RUN_SHELL_COMMAND CMD=shaketune PARAMS="--type belts {% if keep_csv %}--keep_csv{% endif %}" M400 RUN_SHELL_COMMAND CMD=shaketune PARAMS="--type clean --keep_results {keep_results}" [gcode_macro EXCITATE_AXIS_AT_FREQ] description = Maintain a specified excitation frequency for a period of time to diagnose and locate a source of vibration 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 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 %} TEST_RESONANCES OUTPUT=raw_data AXIS={axis} FREQ_START={frequency-1} FREQ_END={frequency+1} HZ_PER_SEC={1/(time/3)} M400 [gcode_macro VIBRATIONS_CALIBRATION] gcode = {% set size = params.SIZE|default(60)|int %} {% set direction = params.DIRECTION|default('XY') %} {% set z_height = params.Z_HEIGHT|default(20)|int %} {% set min_speed = params.MIN_SPEED|default(20)|float * 60 %} {% set max_speed = params.MAX_SPEED|default(200)|float * 60 %} {% set speed_increment = params.SPEED_INCREMENT|default(2)|float * 60 %} {% set feedrate_travel = params.TRAVEL_SPEED|default(200)|int * 60 %} {% set accel = params.ACCEL|default(3000)|int %} {% set accel_chip = params.ACCEL_CHIP|default("adxl345") %} {% set keep_results = params.KEEP_N_RESULTS|default(3)|int %} {% set keep_csv = params.KEEP_CSV|default(True) %} {% set mid_x = printer.toolhead.axis_maximum.x|float / 2 %} {% set mid_y = printer.toolhead.axis_maximum.y|float / 2 %} {% set nb_samples = ((max_speed - min_speed) / speed_increment + 1) | int %} {% set accel = [accel, printer.configfile.settings.printer.max_accel]|min %} {% set old_accel = printer.toolhead.max_accel %} {% set old_cruise_ratio = printer.toolhead.minimum_cruise_ratio %} {% set old_sqv = printer.toolhead.square_corner_velocity %} {% set direction_factor = { 'XY' : { 'start' : {'x': -0.5, 'y': -0.5 }, 'move_factors' : { '0' : {'x': 0.5, 'y': -0.5, 'z': 0.0 }, '1' : {'x': 0.5, 'y': 0.5, 'z': 0.0 }, '2' : {'x': -0.5, 'y': 0.5, 'z': 0.0 }, '3' : {'x': -0.5, 'y': -0.5, 'z': 0.0 } } }, 'AB' : { 'start' : {'x': 0.0, 'y': 0.0 }, 'move_factors' : { '0' : {'x': 0.5, 'y': -0.5, 'z': 0.0 }, '1' : {'x': -0.5, 'y': 0.5, 'z': 0.0 }, '2' : {'x': 0.0, 'y': 0.0, 'z': 0.0 }, '3' : {'x': 0.5, 'y': 0.5, 'z': 0.0 }, '4' : {'x': -0.5, 'y': -0.5, 'z': 0.0 }, '5' : {'x': 0.0, 'y': 0.0, 'z': 0.0 } } }, 'ABXY' : { 'start' : {'x': -0.5, 'y': 0.5 }, 'move_factors' : { '0' : {'x': -0.5, 'y': -0.5, 'z': 0.0 }, '1' : {'x': 0.5, 'y': -0.5, 'z': 0.0 }, '2' : {'x': -0.5, 'y': 0.5, 'z': 0.0 }, '3' : {'x': 0.5, 'y': 0.5, 'z': 0.0 }, '4' : {'x': -0.5, 'y': -0.5, 'z': 0.0 }, '5' : {'x': -0.5, 'y': 0.5, 'z': 0.0 } } }, 'B' : { 'start' : {'x': 0.5, 'y': 0.5 }, 'move_factors' : { '0' : {'x': -0.5, 'y': -0.5, 'z': 0.0 }, '1' : {'x': 0.5, 'y': 0.5, 'z': 0.0 } } }, 'A' : { 'start' : {'x': -0.5, 'y': 0.5 }, 'move_factors' : { '0' : {'x': 0.5, 'y': -0.5, 'z': 0.0 }, '1' : {'x': -0.5, 'y': 0.5, 'z': 0.0 } } }, 'X' : { 'start' : {'x': -0.5, 'y': 0.0 }, 'move_factors' : { '0' : {'x': 0.5, 'y': 0.0, 'z': 0.0 }, '1' : {'x': -0.5, 'y': 0.0, 'z': 0.0 } } }, 'Y' : { 'start' : {'x': 0.0, 'y': 0.5 }, 'move_factors' : { '0' : {'x': 0.0, 'y': -0.5, 'z': 0.0 }, '1' : {'x': 0.0, 'y': 0.5, 'z': 0.0 } } }, 'Z' : { 'start' : {'x': 0.0, 'y': 0.0 }, 'move_factors' : { '0' : {'x': 0.0, 'y': 0.0, 'z': 1.0 }, '1' : {'x': 0.0, 'y': 0.0, 'z': 0.0 } } }, 'E' : { 'start' : {'x': 0.0, 'y': 0.0 }, 'move_factor' : 0.05 } } %} {% if not 'xyz' in printer.toolhead.homed_axes %} { action_raise_error("Must Home printer first!") } {% endif %} {% if params.SPEED_INCREMENT|default(2)|float * 100 != (params.SPEED_INCREMENT|default(2)|float * 100)|int %} { action_raise_error("Only 2 decimal digits are allowed for SPEED_INCREMENT") } {% endif %} {% if (size / (max_speed / 60)) < 0.25 and direction != 'E' %} { action_raise_error("SIZE is too small for this MAX_SPEED. Increase SIZE or decrease MAX_SPEED!") } {% endif %} {% if not (direction in direction_factor) %} { action_raise_error("DIRECTION is not valid. Only XY, AB, ABXY, A, B, X, Y, Z or E is allowed!") } {% endif %} {action_respond_info("")} {action_respond_info("Starting speed and vibration calibration")} {action_respond_info("This operation can not be interrupted by normal means. Hit the \"emergency stop\" button to stop it if needed")} {action_respond_info("")} SAVE_GCODE_STATE NAME=STATE_VIBRATIONS_CALIBRATION G90 SET_VELOCITY_LIMIT ACCEL={accel} MINIMUM_CRUISE_RATIO=0 SQUARE_CORNER_VELOCITY={[(accel / 1000), 5.0]|max} G1 Z{z_height} F{feedrate_travel / 10} G1 X{mid_x + (size * direction_factor[direction].start.x) } Y{mid_y + (size * direction_factor[direction].start.y)} F{feedrate_travel} {% for curr_sample in range(0, nb_samples) %} {% set curr_speed = min_speed + curr_sample * speed_increment %} RESPOND MSG="{"Current speed: %.2f mm/s" % (curr_speed / 60)|float}" ACCELEROMETER_MEASURE CHIP={accel_chip} {% if direction == 'E' %} G0 E{curr_speed*direction_factor[direction].move_factor} F{curr_speed} {% else %} {% for key, factor in direction_factor[direction].move_factors|dictsort %} G1 X{mid_x + (size * factor.x) } Y{mid_y + (size * factor.y)} Z{z_height + (size * factor.z)} F{curr_speed} {% endfor %} {% endif %} ACCELEROMETER_MEASURE CHIP={accel_chip} NAME=sp{("%.2f" % (curr_speed / 60)|float)|replace('.','_')}n1 G4 P300 M400 {% endfor %} RESPOND MSG="Machine and motors vibration graph generation..." RESPOND MSG="This may take some time (3-5min)" RUN_SHELL_COMMAND CMD=shaketune PARAMS="--type vibrations --axis_name {direction} --accel {accel|int} --chip_name {accel_chip} {% if keep_csv %}--keep_csv{% endif %}" M400 RUN_SHELL_COMMAND CMD=shaketune PARAMS="--type clean --keep_results {keep_results}" SET_VELOCITY_LIMIT ACCEL={old_accel} MINIMUM_CRUISE_RATIO={old_cruise_ratio} SQUARE_CORNER_VELOCITY={old_sqv} RESTORE_GCODE_STATE NAME=STATE_VIBRATIONS_CALIBRATION [gcode_shell_command shaketune] command = ~/printer_data/config/K-ShakeTune/scripts/shaketune.sh timeout = 600.0 verbose = True [stepper_x] step_pin = PE6 dir_pin = !PE5 enable_pin = multi_pin:z_enable microsteps = 16 rotation_distance = 32 endstop_pin = EBBCan: PB6 position_endstop = 0 position_max = 315 homing_speed = 50 [stepper_y] step_pin = PE2 dir_pin = !PE1 enable_pin = !PE4 microsteps = 16 rotation_distance = 32 endstop_pin = ^PF3 position_endstop = 300 position_max = 300 homing_speed = 50 [stepper_z] step_pin = PB8 dir_pin = PB7 enable_pin = !PE0 microsteps = 16 rotation_distance = 32 endstop_pin = probe:z_virtual_endstop position_max = 230 position_min = -5.0 homing_speed = 20 second_homing_speed = 10 homing_retract_dist = 5 [stepper_z1] step_pin = PB4 dir_pin = !PB3 enable_pin = !PB6 microsteps = 16 rotation_distance = 32 [stepper_z2] step_pin = PG13 dir_pin = !PG12 enable_pin = !PG15 microsteps = 16 rotation_distance = 32 [extruder] step_pin = EBBCan: PD0 dir_pin = EBBCan: PD1 enable_pin = !EBBCan: PD2 microsteps = 16 rotation_distance = 3.43 nozzle_diameter = 0.600 filament_diameter = 1.750 heater_pin = EBBCan: PB13 sensor_type = EPCOS 100K B57560G104F sensor_pin = EBBCan: PA3 min_temp = 0 max_temp = 250 max_extrude_cross_section = 250 max_extrude_only_distance = 250 control = pid pid_kp = 16.610 pid_ki = 0.527 pid_kd = 130.805 [tmc5160 stepper_x] cs_pin = PC13 spi_software_mosi_pin = PG6 spi_software_miso_pin = PG7 spi_software_sclk_pin = PG8 run_current = 1.400 [tmc5160 stepper_y] cs_pin = PE3 spi_software_mosi_pin = PG6 spi_software_miso_pin = PG7 spi_software_sclk_pin = PG8 run_current = 1.400 [tmc2209 stepper_z] uart_pin = PB9 run_current = 0.850 stealthchop_threshold = 999999 [tmc2209 stepper_z1] uart_pin = PB5 run_current = 0.850 stealthchop_threshold = 999999 [tmc2209 stepper_z2] uart_pin = PG14 run_current = 0.850 stealthchop_threshold = 999999 [tmc2209 extruder] uart_pin = EBBCan: PA15 run_current = 0.650 [multi_pin z_enable] pins = !PC14, PA5 [heater_bed] heater_pin = PA0 sensor_type = ATC Semitec 104GT-2 sensor_pin = PB1 control = pid pid_kp = 54.027 pid_ki = 0.770 pid_kd = 948.182 min_temp = 0 max_temp = 130 [fan] pin = EBBCan: PA1 [heater_fan hotend_fan] pin = EBBCan: PA0 heater = extruder heater_temp = 50.0 [controller_fan tmc_fan] pin = PF7 stepper = stepper_x [temperature_fan CB1] pin = PF8 sensor_type = temperature_host min_temp = 10 max_temp = 90 control = pid pid_kp = 2 pid_ki = 4 pid_kd = 0.1 [temperature_sensor mcu_temp] sensor_type = temperature_mcu min_temp = 0 max_temp = 100 [temperature_sensor EBB_Temperature] sensor_type = temperature_mcu sensor_mcu = EBBCan [temperature_sensor bed_top] sensor_type = EPCOS 100K B57560G104F sensor_pin = PB0 [temperature_sensor Chamber_Middle] sensor_type = AHT10 i2c_mcu = mcu i2c_bus = i2c1 [bltouch] sensor_pin = ^EBBCan:PB8 control_pin = EBBCan:PB9 stow_on_each_sample = false probe_with_touch_mode = true x_offset = 55 y_offset = 0 speed = 10 lift_speed = 20 samples = 2 samples_tolerance_retries = 4 z_offset = 1.200 [idle_timeout] timeout = 960000 [filament_switch_sensor switch_sensor] switch_pin = ^PF0 pause_on_runout = false runout_gcode = PAUSE [filament_motion_sensor motion_sensor] switch_pin = ^PC15 detection_length = 4 extruder = extruder pause_on_runout = false runout_gcode = PAUSE [neopixel outside] pin = CB1: gpio259 chain_count = 79 color_order = GRB initial_red = 0.5 initial_green = 0.5 initial_blue = 0.5 [neopixel back] pin = PD15 chain_count = 29 color_order = GRB initial_red = 0.5 initial_green = 0.5 initial_blue = 0.5 [z_tilt] z_positions = 0, 25 300, 25 150, 300 points = 0, 20 245, 20 95, 295 speed = 125 horizontal_move_z = 10 retries = 8 retry_tolerance = 0.01 [bed_mesh] speed = 125 horizontal_move_z = 10 mesh_min = 55, 10 mesh_max = 245,290 probe_count = 5, 5 algorithm = bicubic bicubic_tension = 0.2 fade_start = 1 fade_end = 10 fade_target = 0 [safe_z_home] home_xy_position = 100, 150 speed = 150 [input_shaper] shaper_freq_x = 83.8 shaper_type_x = mzv shaper_freq_y = 65.2 shaper_type_y = mzv [adxl345] cs_pin = EBBCan: PB12 spi_software_sclk_pin = EBBCan: PB10 spi_software_mosi_pin = EBBCan: PB11 spi_software_miso_pin = EBBCan: PB2 axes_map = x,y,z [resonance_tester] accel_chip = adxl345 probe_points = 160, 150, 50 [gcode_macro PRINT_START] gcode = {% set BED = params.BED_TEMP|int %} {% set EXTRUDER = params.EXTRUDER_TEMP|int %} M140 S{BED} M104 S{EXTRUDER} G28 Z_TILT_ADJUST BED_MESH_CALIBRATE _ADAPTIVE_PURGE_V1 [gcode_macro Z_TILT_ADJUST] rename_existing = Z_TILT_ADJUST_1 gcode = {% if printer["gcode_macro status_leveling"] != null %} status_leveling {% endif %} Z_TILT_ADJUST_1 { rawparams } {% if printer["gcode_macro status_ready"] != null %} status_ready {% endif %} [gcode_macro BED_MESH_CALIBRATE] rename_existing = _BED_MESH_CALIBRATE variable_buffer = 2 gcode = {% set bedMeshConfig = printer['configfile'].config["bed_mesh"] %} {% set bed_mesh_min = bedMeshConfig.mesh_min %} {% set bed_mesh_max = bedMeshConfig.mesh_max %} {% set all_points = printer.exclude_object.objects | map(attribute='polygon') | sum(start=[]) %} {% 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]) %} {% if printer["bed_mesh"].profile_name == '' %} { action_respond_info("No existing bed mesh found.") } {% set last_area_end_x=-1 %} {% endif %} {% if printer.toolhead.homed_axes != "xyz" %} G28 {% endif %} {% set klicky_available = printer['gcode_macro _Probe_Variables'] != null %} {% set probeConfig = printer['configfile'].config["probe"] %} {% if probeConfig %} {% set OffsetX = probeConfig.x_offset|default(0)|float %} {% set OffsetY = probeConfig.y_offset|default(0)|float %} {% endif %} {% set print_min_x = x_min|float %} {% set print_min_y = y_min|float %} {% set print_max_x = x_max|float %} {% set print_max_y = y_max|float %} {% set mesh_min_x = bed_mesh_min.split(",")[0]|float %} {% set mesh_min_y = bed_mesh_min.split(",")[1]|float %} {% set mesh_max_x = bed_mesh_max.split(",")[0]|float %} {% set mesh_max_y = bed_mesh_max.split(",")[1]|float %} {% if (print_min_x < mesh_min_x) or (print_max_x > mesh_max_x) or (print_min_y < mesh_min_y) or (print_max_y > mesh_max_y) %} {% set print_min_x = mesh_min_x %} {% set print_min_y = mesh_min_y %} {% set print_max_x = mesh_max_x %} {% set print_max_y = mesh_max_y %} {% endif %} {% if klicky_available %} _CheckProbe action=query Attach_Probe {% elif euclid_available %} DEPLOY_PROBE {% endif %} {% if (print_min_x < print_max_x) and (print_min_y < print_max_y) %} {% set minimum_probe_count = 3 %} {% set medium_probe_count = 5 %} {% set probe_count = bedMeshConfig.probe_count.split(",") %} {% set probe_count_x = probe_count[0]|int %} {% if probe_count.__len__() > 1 %} {% set probe_count_y = probe_count[1]|int %} {% else %} {% set probe_count_y = probe_count_x|int %} {% endif %} {% set relative_reference_index = bedMeshConfig.relative_reference_index %} {% if print_max_x - print_min_x < (mesh_max_x - mesh_min_x) * 0.75 %} {% set probe_count_x = medium_probe_count %} {% endif %} {% if print_max_y - print_min_y < (mesh_max_y - mesh_min_y) * 0.75 %} {% set probe_count_y = medium_probe_count %} {% endif %} {% if print_max_x - print_min_x < (mesh_max_x - mesh_min_x) * 0.50 %} {% set probe_count_x = minimum_probe_count %} {% endif %} {% if print_max_y - print_min_y < (mesh_max_y - mesh_min_y) * 0.50 %} {% set probe_count_y = minimum_probe_count %} {% endif %} {% if print_min_x - buffer >= mesh_min_x %} {% set mesh_min_x = print_min_x - buffer %} {% endif %} {% if print_min_y - buffer >= mesh_min_y %} {% set mesh_min_y = print_min_y - buffer %} {% endif %} {% if print_max_x + buffer <= mesh_max_x %} {% set mesh_max_x = print_max_x + buffer %} {% endif %} {% if print_max_y + buffer <= mesh_max_y %} {% set mesh_max_y = print_max_y + buffer %} {% endif %} { action_respond_info("mesh_min: %s,%s" % (mesh_min_x, mesh_min_y)) } { action_respond_info("mesh_max: %s,%s" % (mesh_max_x, mesh_max_y)) } { action_respond_info("probe_count: %s,%s" % (probe_count_x,probe_count_y)) } {% if printer["gcode_macro status_meshing"] != null %} status_meshing {% endif %} {% if relative_reference_index == 0 or relative_reference_index == null %} _BED_MESH_CALIBRATE mesh_min={mesh_min_x},{mesh_min_y} mesh_max={mesh_max_x},{mesh_max_y} probe_count={probe_count_x},{probe_count_y} {% else %} {% set relative_reference_index = ((probe_count_x * probe_count_y - 1) / 2)|int %} { action_respond_info("relative_reference_index: %s" % relative_reference_index) } _BED_MESH_CALIBRATE mesh_min={mesh_min_x},{mesh_min_y} mesh_max={mesh_max_x},{mesh_max_y} probe_count={probe_count_x},{probe_count_y} relative_reference_index={relative_reference_index} {% endif %} {% else %} {% if printer["gcode_macro status_meshing"] != null %} status_meshing {% endif %} _BED_MESH_CALIBRATE {% endif %} {% if klicky_available %} Dock_Probe {% elif euclid_available %} STOW_PROBE {% endif %} {% if printer["gcode_macro status_ready"] != null %} status_ready {% endif %} [gcode_macro _ADAPTIVE_PURGE_V1] description = A purge macro that adapts to be near your actual printed objects variable_adaptive_enable = True variable_z_height = 0.3 variable_tip_distance = 10 variable_purge_amount = 30 variable_flow_rate = 10 variable_x_default = 5 variable_y_default = 5 variable_size = 16 variable_distance_to_object_x = 7 variable_distance_to_object_y = 7 gcode = {% if adaptive_enable == True %} {% set all_points = printer.exclude_object.objects | map(attribute='polygon') | sum(start=[]) %} {% set x_origin = (all_points | map(attribute=0) | min | default(x_default + distance_to_object_x + size)) - distance_to_object_x - size %} {% set y_origin = (all_points | map(attribute=1) | min | default(y_default + distance_to_object_y + size)) - distance_to_object_y - size %} {% set x_origin = ([x_origin, 0] | max) %} {% set y_origin = ([y_origin, 0] | max) %} {% if x_origin < x_default %} set x_origin = x_default | float {% endif %} {% if y_origin < y_default %} set y_origin = y_default | float {% endif %} {% else %} {% set x_origin = x_default | float %} {% set y_origin = y_default | float %} {% endif %} {% set purge_move_speed = 2.31 * size * flow_rate / (purge_amount * 2.405) %} {% set prepurge_speed = flow_rate / 2.405 %} {% set travel_speed = printer.toolhead.max_velocity %} { action_respond_info( "x: " + x_origin|string + " y: " + y_origin|string + " purge_move_speed: " + purge_move_speed|string + " prepurge_speed: " + prepurge_speed|string ) } G92 E0 G90 G0 X{x_origin} Y{y_origin+size/2} F3000 G0 Z{z_height} F1500 G0 F3000 M83 G1 E{tip_distance} F{prepurge_speed*60} G1 F600 G1 X{x_origin+size*0.1976875} Y{y_origin+size*0.0538125} E{purge_amount*0.00362396204033215} G1 X{x_origin+size*0.2070625} Y{y_origin+size*0.056375} E{purge_amount*0.00348517200474496} G1 X{x_origin+size*0.273} Y{y_origin+size*0.0889375} E{purge_amount*0.0253226571767497} G1 X{x_origin+size*0.3568125} Y{y_origin+size*0.125125} E{purge_amount*0.0313760379596679} G1 X{x_origin+size*0.442375} Y{y_origin+size*0.1563125} E{purge_amount*0.0312455516014235} G1 X{x_origin+size*0.5295625} Y{y_origin+size*0.1825} E{purge_amount*0.0311731909845789} G1 X{x_origin+size*0.5311875} Y{y_origin+size*0.1829375} E{purge_amount*0.000575326215895611} G1 X{x_origin+size*0.6196875} Y{y_origin+size*0.2038125} E{purge_amount*0.0311376037959668} G1 X{x_origin+size*0.7093125} Y{y_origin+size*0.219625} E{purge_amount*0.0312253855278766} G1 X{x_origin+size*0.799875} Y{y_origin+size*0.2301875} E{purge_amount*0.0313368920521945} G1 X{x_origin+size*0.8735625} Y{y_origin+size*0.2349375} E{purge_amount*0.0254270462633452} G1 X{x_origin+size*0.8824375} Y{y_origin+size*0.237} E{purge_amount*0.00326809015421115} G1 X{x_origin+size*0.8913125} Y{y_origin+size*0.2390625} E{purge_amount*0.00339739027283511} G1 X{x_origin+size*0.8959375} Y{y_origin+size*0.2481875} E{purge_amount*0.00381494661921708} G1 X{x_origin+size*0.9005} Y{y_origin+size*0.257375} E{purge_amount*0.00366548042704626} G1 X{x_origin+size*0.951125} Y{y_origin+size*0.4463125} E{purge_amount*0.0668623962040332} G1 X{x_origin+size*0.9521875} Y{y_origin+size*0.4540625} E{purge_amount*0.00276156583629893} G1 X{x_origin+size*0.9531875} Y{y_origin+size*0.46175} E{purge_amount*0.00282443653618031} G1 X{x_origin+size*0.9528125} Y{y_origin+size*0.4654375} E{purge_amount*0.00138078291814947} G1 X{x_origin+size*0.9458125} Y{y_origin+size*0.4720625} E{purge_amount*0.00359193357058126} G1 X{x_origin+size*0.9388125} Y{y_origin+size*0.4786875} E{purge_amount*0.00342467378410439} G1 X{x_origin+size*0.9145625} Y{y_origin+size*0.4951875} E{purge_amount*0.00993950177935943} G1 X{x_origin+size*0.8395} Y{y_origin+size*0.547875} E{purge_amount*0.0316453143534994} G1 X{x_origin+size*0.7680625} Y{y_origin+size*0.6045} E{purge_amount*0.0314733096085409} G1 X{x_origin+size*0.700125} Y{y_origin+size*0.665125} E{purge_amount*0.0314483985765125} G1 X{x_origin+size*0.6358125} Y{y_origin+size*0.7295} E{purge_amount*0.0314317912218268} G1 X{x_origin+size*0.5755625} Y{y_origin+size*0.7971875} E{purge_amount*0.0312977461447212} G1 X{x_origin+size*0.5465} Y{y_origin+size*0.8325625} E{purge_amount*0.0155836298932384} G1 X{x_origin+size*0.492125} Y{y_origin+size*0.9056875} E{purge_amount*0.0313190984578885} G1 X{x_origin+size*0.451125} Y{y_origin+size*0.967125} E{purge_amount*0.0254341637010676} G1 X{x_origin+size*0.444625} Y{y_origin+size*0.9739375} E{purge_amount*0.00337959667852906} G1 X{x_origin+size*0.4380625} Y{y_origin+size*0.98075} E{purge_amount*0.00353262158956109} G1 X{x_origin+size*0.428125} Y{y_origin+size*0.98} E{purge_amount*0.00372123368920522} G1 X{x_origin+size*0.41825} Y{y_origin+size*0.97925} E{purge_amount*0.00354211150652432} G1 X{x_origin+size*0.22925} Y{y_origin+size*0.928625} E{purge_amount*0.0668837485172005} G1 X{x_origin+size*0.2204375} Y{y_origin+size*0.924125} E{purge_amount*0.00351601423487545} G1 X{x_origin+size*0.2115625} Y{y_origin+size*0.919625} E{purge_amount*0.00366903914590747} G1 X{x_origin+size*0.2091875} Y{y_origin+size*0.910625} E{purge_amount*0.00343179122182681} G1 X{x_origin+size*0.2068125} Y{y_origin+size*0.9016875} E{purge_amount*0.00329774614472123} G1 X{x_origin+size*0.2020625} Y{y_origin+size*0.82825} E{purge_amount*0.0253404507710558} G1 X{x_origin+size*0.1915} Y{y_origin+size*0.737625} E{purge_amount*0.0313582443653618} G1 X{x_origin+size*0.17575} Y{y_origin+size*0.6479375} E{purge_amount*0.0312431791221827} G1 X{x_origin+size*0.154875} Y{y_origin+size*0.5593125} E{purge_amount*0.0311791221826809} G1 X{x_origin+size*0.1544375} Y{y_origin+size*0.5576875} E{purge_amount*0.000575326215895611} G1 X{x_origin+size*0.12825} Y{y_origin+size*0.470625} E{purge_amount*0.0311328588374852} G1 X{x_origin+size*0.0970625} Y{y_origin+size*0.385125} E{purge_amount*0.0312253855278766} G1 X{x_origin+size*0.061} Y{y_origin+size*0.3014375} E{purge_amount*0.0313190984578885} G1 X{x_origin+size*0.02825} Y{y_origin+size*0.2351875} E{purge_amount*0.0254483985765125} G1 X{x_origin+size*0.025625} Y{y_origin+size*0.226125} E{purge_amount*0.00338671411625148} G1 X{x_origin+size*0.023} Y{y_origin+size*0.2170625} E{purge_amount*0.00352313167259787} G1 X{x_origin+size*0.028625} Y{y_origin+size*0.208875} E{purge_amount*0.00370937129300119} G1 X{x_origin+size*0.03425} Y{y_origin+size*0.200625} E{purge_amount*0.003570581257414} G1 X{x_origin+size*0.1725625} Y{y_origin+size*0.0623125} E{purge_amount*0.0668623962040332} G1 X{x_origin+size*0.1804375} Y{y_origin+size*0.0568125} E{purge_amount*0.00343297746144721} G1 X{x_origin+size*0.18375} Y{y_origin+size*0.0545} E{purge_amount*0.00150652431791222} G92 E0 M82 G0 Z{z_height*2} {% if printer["gcode_macro status_printing"] != null %} status_printing {% endif %} [gcode_macro PRINT_END] gcode = M400 TURN_OFF_HEATERS M106 S0 PARK_CENTER_REAR G0 Z230 F3000 [gcode_macro PARK_CENTER_REAR] gcode = {% if printer["gcode_macro status_busy"] != null %} status_busy {% endif %} {% set th = printer.toolhead %} {% set x_safe = th.position.x + 20 * (1 if th.axis_maximum.x - th.position.x > 20 else -1) %} {% set y_safe = th.position.y + 20 * (1 if th.axis_maximum.y - th.position.y > 20 else -1) %} G0 X{th.axis_maximum.x//2} Y{th.axis_maximum.y - 2} F3600 {% if printer["gcode_macro status_ready"] != null %} status_ready {% endif %} [gcode_macro TEST_SPEED] gcode = G0 Z10 {% set speed = params.SPEED|default(printer.configfile.settings.printer.max_velocity)|int %} {% set iterations = params.ITERATIONS|default(5)|int %} {% set accel = params.ACCEL|default(printer.configfile.settings.printer.max_accel)|int %} {% set bound = params.BOUND|default(20)|int %} {% set smallpatternsize = SMALLPATTERNSIZE|default(20)|int %} {% set x_min = printer.toolhead.axis_minimum.x + bound %} {% set x_max = printer.toolhead.axis_maximum.x - bound %} {% set y_min = printer.toolhead.axis_minimum.y + bound %} {% set y_max = printer.toolhead.axis_maximum.y - bound %} {% set x_center = (printer.toolhead.axis_minimum.x|float + printer.toolhead.axis_maximum.x|float ) / 2 %} {% set y_center = (printer.toolhead.axis_minimum.y|float + printer.toolhead.axis_maximum.y|float ) / 2 %} {% set x_center_min = x_center - (smallpatternsize/2) %} {% set x_center_max = x_center + (smallpatternsize/2) %} {% set y_center_min = y_center - (smallpatternsize/2) %} {% set y_center_max = y_center + (smallpatternsize/2) %} SAVE_GCODE_STATE NAME=TEST_SPEED { action_respond_info("TEST_SPEED: starting %d iterations at speed %d, accel %d" % (iterations, speed, accel)) } M400 G28 {% if printer.configfile.settings.quad_gantry_level %} {% if printer.quad_gantry_level.applied == False %} QUAD_GANTRY_LEVEL G28 Z {% endif %} {% endif %} G90 G1 X{printer.toolhead.axis_maximum.x-50} Y{printer.toolhead.axis_maximum.y-50} F{30*60} M400 G28 X Y G0 X{printer.toolhead.axis_maximum.x-1} Y{printer.toolhead.axis_maximum.y-1} F{30*60} G4 P1000 GET_POSITION G0 X{x_min} Y{y_min} Z{bound + 10} F{speed*60} SET_VELOCITY_LIMIT VELOCITY={speed} ACCEL={accel} ACCEL_TO_DECEL={accel / 2} {% for i in range(iterations) %} G0 X{x_min} Y{y_min} F{speed*60} G0 X{x_max} Y{y_max} F{speed*60} G0 X{x_min} Y{y_min} F{speed*60} G0 X{x_max} Y{y_min} F{speed*60} G0 X{x_min} Y{y_max} F{speed*60} G0 X{x_max} Y{y_min} F{speed*60} G0 X{x_min} Y{y_min} F{speed*60} G0 X{x_min} Y{y_max} F{speed*60} G0 X{x_max} Y{y_max} F{speed*60} G0 X{x_max} Y{y_min} F{speed*60} G0 X{x_center_min} Y{y_center_min} F{speed*60} G0 X{x_center_max} Y{y_center_max} F{speed*60} G0 X{x_center_min} Y{y_center_min} F{speed*60} G0 X{x_center_max} Y{y_center_min} F{speed*60} G0 X{x_center_min} Y{y_center_max} F{speed*60} G0 X{x_center_max} Y{y_center_min} F{speed*60} G0 X{x_center_min} Y{y_center_min} F{speed*60} G0 X{x_center_min} Y{y_center_max} F{speed*60} G0 X{x_center_max} Y{y_center_max} F{speed*60} G0 X{x_center_max} Y{y_center_min} F{speed*60} {% endfor %} SET_VELOCITY_LIMIT VELOCITY={printer.configfile.settings.printer.max_velocity} ACCEL={printer.configfile.settings.printer.max_accel} M400 G28 G90 G0 X{printer.toolhead.axis_maximum.x-1} Y{printer.toolhead.axis_maximum.y-1} F{30*60} G4 P1000 GET_POSITION RESTORE_GCODE_STATE NAME=TEST_SPEED [led_effect progress_bar] leds = neopixel:back autostart = true frame_rate = 24 layers = progress -1 0 add ( 0, 0, 1),( 0, 0.1, 0.6) static 0 0 top ( 0, 0, 0.1) [gcode_macro update_git] gcode = {% set message = params.MESSAGE|default() %} {% if message %} RUN_SHELL_COMMAND CMD=update_git_script_message PARAMS="'{params.MESSAGE}'" {% else %} RUN_SHELL_COMMAND CMD=update_git_script {% endif %} [gcode_shell_command update_git_script] command = bash -c "bash $HOME/klipper-backup/script.sh" timeout = 90.0 verbose = True [gcode_shell_command update_git_script_message] command = bash -c "bash $HOME/klipper-backup/script.sh $0" timeout = 90.0 verbose = True [bed_mesh default] version = 1 points = -0.026610, 0.013390, 0.018390, 0.013390, 0.048390 0.133390, 0.118390, 0.073390, 0.048390, 0.048390 0.298390, 0.243390, 0.198390, 0.153390, 0.123390 0.328390, 0.273390, 0.208390, 0.168390, 0.118390 0.118390, 0.078390, 0.028390, -0.001610, -0.016610 x_count = 5 y_count = 5 mesh_x_pps = 2 mesh_y_pps = 2 algo = bicubic tension = 0.2 min_x = 55.0 max_x = 245.0 min_y = 10.0 max_y = 290.0 ======================= Extruder max_extrude_ratio=103.937922 mcu 'mcu': Starting CAN connect Created a socket webhooks client 281473467091216: New connection webhooks client 281473467091216: Client info {'program': 'Moonraker', 'version': 'v0.8.0-331-gc857e1a'} Loaded MCU 'mcu' 108 commands (v0.12.0-132-ge37b007f / gcc: (15:8-2019-q3-1+b1) 8.3.1 20190703 (release) [gcc-8-branch revision 273027] binutils: (2.35.2-2+14+b2) 2.35.2) MCU 'mcu' config: ADC_MAX=4095 BUS_PINS_i2c1_PB6_PB7=PB6,PB7 BUS_PINS_i2c1_PB8_PB9=PB8,PB9 BUS_PINS_i2c2_PB10_PB11=PB10,PB11 BUS_PINS_spi1=PA6,PA7,PA5 BUS_PINS_spi1a=PB4,PB5,PB3 BUS_PINS_spi2=PB14,PB15,PB13 BUS_PINS_spi2a=PC2,PC3,PB10 BUS_PINS_spi3a=PC11,PC12,PC10 BUS_PINS_spi4=PE13,PE14,PE12 BUS_PINS_spi5=PF8,PF9,PF7 BUS_PINS_spi5a=PH7,PF11,PH6 BUS_PINS_spi6=PG12,PG14,PG13 CANBUS_BRIDGE=1 CLOCK_FREQ=400000000 MCU=stm32h723xx PWM_MAX=255 RECEIVE_WINDOW=192 RESERVE_PINS_CAN=PD0,PD1 RESERVE_PINS_USB=PA11,PA12 RESERVE_PINS_crystal=PH0,PH1 STATS_SUMSQ_BASE=256 STEPPER_BOTH_EDGE=1 mcu 'EBBCan': Starting CAN connect Created a socket Loaded MCU 'EBBCan' 108 commands (v0.12.0-132-ge37b007f / gcc: (15:8-2019-q3-1+b1) 8.3.1 20190703 (release) [gcc-8-branch revision 273027] binutils: (2.35.2-2+14+b2) 2.35.2) MCU 'EBBCan' config: ADC_MAX=4095 BUS_PINS_i2c1_PA9_PA10=PA9,PA10 BUS_PINS_i2c1_PB6_PB7=PB6,PB7 BUS_PINS_i2c1_PB8_PB9=PB8,PB9 BUS_PINS_i2c2_PB10_PB11=PB10,PB11 BUS_PINS_i2c2_PB13_PB14=PB13,PB14 BUS_PINS_i2c3_PB3_PB4=PB3,PB4 BUS_PINS_i2c3_PC0_PC1=PC0,PC1 BUS_PINS_spi1=PA6,PA7,PA5 BUS_PINS_spi1a=PB4,PB5,PB3 BUS_PINS_spi2=PB14,PB15,PB13 BUS_PINS_spi2a=PC2,PC3,PB10 BUS_PINS_spi3=PB4,PB5,PB3 CANBUS_FREQUENCY=1000000 CLOCK_FREQ=64000000 MCU=stm32g0b1xx PWM_MAX=255 RECEIVE_WINDOW=192 RESERVE_PINS_CAN=PB0,PB1 RESERVE_PINS_crystal=PF0,PF1 STATS_SUMSQ_BASE=256 STEPPER_BOTH_EDGE=1 mcu 'CB1': Starting connect mcu 'CB1': got {'count': 139, 'sum': 171337, 'sumsq': 1175410, '#name': 'stats', '#sent_time': 2728.997790842, '#receive_time': 2729.003050884} Loaded MCU 'CB1' 112 commands (v0.12.0-132-ge37b007f / gcc: (Debian 10.2.1-6) 10.2.1 20210110 binutils: (GNU Binutils for Debian) 2.35.2) MCU 'CB1' config: ADC_MAX=4095 CLOCK_FREQ=50000000 MCU=linux PCA9685_MAX=4096 PWM_MAX=32768 STATS_SUMSQ_BASE=256 mcu_temperature 'mcu' nominal base=-281.244980 slope=1644.578313 mcu_temperature 'EBBCan' nominal base=-275.555556 slope=1317.105263 Config error Traceback (most recent call last): File "/home/biqu/klipper/klippy/klippy.py", line 180, in _connect cb() File "/home/biqu/klipper/klippy/mcu.py", line 746, in _connect self._send_config(None) File "/home/biqu/klipper/klippy/mcu.py", line 677, in _send_config cb() File "/home/biqu/klipper/klippy/extras/bus.py", line 174, in build_config bus = resolve_bus_name(self.mcu, "i2c_bus", self.bus) File "/home/biqu/klipper/klippy/extras/bus.py", line 25, in resolve_bus_name raise ppins.error("Unknown %s '%s'" % (param, bus)) pins.error: Unknown i2c_bus 'i2c1' Attempting MCU 'EBBCan' reset command Attempting MCU 'CB1' config_reset command b'Got EOF when reading from device' Attempting MCU 'mcu' reset command webhooks client 281473467091216: Disconnected Restarting printer Start printer at Sat Apr 27 00:53:35 2024 (1714179215.1 2744.8) ===== Config file ===== [mcu] canbus_uuid = b983bbdcfe30 [mcu EBBCan] canbus_uuid = d8d5848615b3 [mcu CB1] serial = /tmp/klipper_host_mcu [printer] kinematics = corexy max_velocity = 500 max_accel = 10000 max_z_velocity = 50 max_z_accel = 500 [virtual_sdcard] path = /home/biqu/printer_data/gcodes on_error_gcode = CANCEL_PRINT [pause_resume] [display_status] [respond] [gcode_macro CANCEL_PRINT] description = Cancel the actual running print rename_existing = CANCEL_PRINT_BASE gcode = PRINT_END [gcode_macro PAUSE] description = Pause the actual running print rename_existing = PAUSE_BASE gcode = {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %} {% set idle_timeout = client.idle_timeout|default(0) %} {% set temp = printer[printer.toolhead.extruder].target if printer.toolhead.extruder != '' else 0 %} {% set restore = False if printer.toolhead.extruder == '' else True if params.RESTORE|default(1)|int == 1 else False %} SET_GCODE_VARIABLE MACRO=RESUME VARIABLE=last_extruder_temp VALUE="{{'restore': restore, 'temp': temp}}" {% if idle_timeout > 0 %} SET_GCODE_VARIABLE MACRO=RESUME VARIABLE=restore_idle_timeout VALUE={printer.configfile.settings.idle_timeout.timeout} SET_IDLE_TIMEOUT TIMEOUT={idle_timeout} {% endif %} PAUSE_BASE {client.user_pause_macro|default("")} _TOOLHEAD_PARK_PAUSE_CANCEL {rawparams} [gcode_macro RESUME] description = Resume the actual running print rename_existing = RESUME_BASE variable_last_extruder_temp = {'restore': False, 'temp': 0} variable_restore_idle_timeout = 0 variable_idle_state = False gcode = {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %} {% set velocity = printer.configfile.settings.pause_resume.recover_velocity %} {% set sp_move = client.speed_move|default(velocity) %} {% set runout_resume = True if client.runout_sensor|default("") == "" else True if not printer[client.runout_sensor].enabled else printer[client.runout_sensor].filament_detected %} {% set can_extrude = True if printer.toolhead.extruder == '' else printer[printer.toolhead.extruder].can_extrude %} {% set do_resume = False %} {% set prompt_txt = [] %} {% if printer.idle_timeout.state|upper == "IDLE" or idle_state %} SET_GCODE_VARIABLE MACRO=RESUME VARIABLE=idle_state VALUE=False {% if last_extruder_temp.restore %} RESPOND TYPE=echo MSG='{"Restoring \"%s\" temperature to %3.1f\u00B0C, this may take some time" % (printer.toolhead.extruder, last_extruder_temp.temp) }' M109 S{last_extruder_temp.temp} {% set do_resume = True %} {% elif can_extrude %} {% set do_resume = True %} {% else %} RESPOND TYPE=error MSG='{"Resume aborted !!! \"%s\" not hot enough, please heat up again and press RESUME" % printer.toolhead.extruder}' {% set _d = prompt_txt.append("\"%s\" not hot enough, please heat up again and press RESUME" % printer.toolhead.extruder) %} {% endif %} {% elif can_extrude %} {% set do_resume = True %} {% else %} RESPOND TYPE=error MSG='{"Resume aborted !!! \"%s\" not hot enough, please heat up again and press RESUME" % printer.toolhead.extruder}' {% set _d = prompt_txt.append("\"%s\" not hot enough, please heat up again and press RESUME" % printer.toolhead.extruder) %} {% endif %} {% if runout_resume %} {% if do_resume %} {% if restore_idle_timeout > 0 %} SET_IDLE_TIMEOUT TIMEOUT={restore_idle_timeout} {% endif %} {client.user_resume_macro|default("")} _CLIENT_EXTRUDE RESUME_BASE VELOCITY={params.VELOCITY|default(sp_move)} {% endif %} {% else %} RESPOND TYPE=error MSG='{"Resume aborted !!! \"%s\" detects no filament, please load filament and press RESUME" % (client.runout_sensor.split(" "))[1]}' {% set _d = prompt_txt.append("\"%s\" detects no filament, please load filament and press RESUME" % (client.runout_sensor.split(" "))[1]) %} {% endif %} {% if not (runout_resume and do_resume) %} RESPOND TYPE=command MSG="action:prompt_begin RESUME aborted !!!" {% for element in prompt_txt %} RESPOND TYPE=command MSG='{"action:prompt_text %s" % element}' {% endfor %} RESPOND TYPE=command MSG="action:prompt_footer_button Ok|RESPOND TYPE=command MSG=action:prompt_end|info" RESPOND TYPE=command MSG="action:prompt_show" {% endif %} [gcode_macro SET_PAUSE_NEXT_LAYER] description = Enable a pause if the next layer is reached gcode = {% set pause_next_layer = printer['gcode_macro SET_PRINT_STATS_INFO'].pause_next_layer %} {% set ENABLE = params.ENABLE|default(1)|int != 0 %} {% set MACRO = params.MACRO|default(pause_next_layer.call, True) %} SET_GCODE_VARIABLE MACRO=SET_PRINT_STATS_INFO VARIABLE=pause_next_layer VALUE="{{ 'enable': ENABLE, 'call': MACRO }}" [gcode_macro SET_PAUSE_AT_LAYER] description = Enable/disable a pause if a given layer number is reached gcode = {% set pause_at_layer = printer['gcode_macro SET_PRINT_STATS_INFO'].pause_at_layer %} {% set ENABLE = params.ENABLE|int != 0 if params.ENABLE is defined else params.LAYER is defined %} {% set LAYER = params.LAYER|default(pause_at_layer.layer)|int %} {% set MACRO = params.MACRO|default(pause_at_layer.call, True) %} SET_GCODE_VARIABLE MACRO=SET_PRINT_STATS_INFO VARIABLE=pause_at_layer VALUE="{{ 'enable': ENABLE, 'layer': LAYER, 'call': MACRO }}" [gcode_macro SET_PRINT_STATS_INFO] rename_existing = SET_PRINT_STATS_INFO_BASE description = Overwrite, to get pause_next_layer and pause_at_layer feature variable_pause_next_layer = { 'enable': False, 'call': "PAUSE" } variable_pause_at_layer = { 'enable': False, 'layer': 0, 'call': "PAUSE" } gcode = {% if pause_next_layer.enable %} RESPOND TYPE=echo MSG='{"%s, forced by pause_next_layer" % pause_next_layer.call}' {pause_next_layer.call} SET_PAUSE_NEXT_LAYER ENABLE=0 {% elif pause_at_layer.enable and params.CURRENT_LAYER is defined and params.CURRENT_LAYER|int == pause_at_layer.layer %} RESPOND TYPE=echo MSG='{"%s, forced by pause_at_layer [%d]" % (pause_at_layer.call, pause_at_layer.layer)}' {pause_at_layer.call} SET_PAUSE_AT_LAYER ENABLE=0 {% endif %} SET_PRINT_STATS_INFO_BASE {rawparams} [gcode_macro _TOOLHEAD_PARK_PAUSE_CANCEL] description = Helper: park toolhead used in PAUSE and CANCEL_PRINT gcode = {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %} {% set velocity = printer.configfile.settings.pause_resume.recover_velocity %} {% set use_custom = client.use_custom_pos|default(false)|lower == 'true' %} {% set custom_park_x = client.custom_park_x|default(0.0) %} {% set custom_park_y = client.custom_park_y|default(0.0) %} {% set park_dz = client.custom_park_dz|default(2.0)|abs %} {% set sp_hop = client.speed_hop|default(15) * 60 %} {% set sp_move = client.speed_move|default(velocity) * 60 %} {% set origin = printer.gcode_move.homing_origin %} {% set act = printer.gcode_move.gcode_position %} {% set max = printer.toolhead.axis_maximum %} {% set cone = printer.toolhead.cone_start_z|default(max.z) %} {% set round_bed = True if printer.configfile.settings.printer.kinematics is in ['delta','polar','rotary_delta','winch'] else False %} {% set z_min = params.Z_MIN|default(0)|float %} {% set z_park = [[(act.z + park_dz), z_min]|max, (max.z - origin.z)]|min %} {% set x_park = params.X if params.X is defined else custom_park_x if use_custom else 0.0 if round_bed else (max.x - 5.0) %} {% set y_park = params.Y if params.Y is defined else custom_park_y if use_custom else (max.y - 5.0) if round_bed and z_park < cone else 0.0 if round_bed else (max.y - 5.0) %} _CLIENT_RETRACT {% if "xyz" in printer.toolhead.homed_axes %} G90 G1 Z{z_park} F{sp_hop} G1 X{x_park} Y{y_park} F{sp_move} {% if not printer.gcode_move.absolute_coordinates %} G91 {% endif %} {% else %} RESPOND TYPE=echo MSG='Printer not homed' {% endif %} [gcode_macro _CLIENT_EXTRUDE] description = Extrudes, if the extruder is hot enough gcode = {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %} {% set use_fw_retract = (client.use_fw_retract|default(false)|lower == 'true') and (printer.firmware_retraction is defined) %} {% set length = params.LENGTH|default(client.unretract)|default(1.0)|float %} {% set speed = params.SPEED|default(client.speed_unretract)|default(35) %} {% set absolute_extrude = printer.gcode_move.absolute_extrude %} {% if printer.toolhead.extruder != '' %} {% if printer[printer.toolhead.extruder].can_extrude %} {% if use_fw_retract %} {% if length < 0 %} G10 {% else %} G11 {% endif %} {% else %} M83 G1 E{length} F{(speed|float|abs) * 60} {% if absolute_extrude %} M82 {% endif %} {% endif %} {% else %} RESPOND TYPE=echo MSG='{"\"%s\" not hot enough" % printer.toolhead.extruder}' {% endif %} {% endif %} [gcode_macro _CLIENT_RETRACT] description = Retracts, if the extruder is hot enough gcode = {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %} {% set length = params.LENGTH|default(client.retract)|default(1.0)|float %} {% set speed = params.SPEED|default(client.speed_retract)|default(35) %} _CLIENT_EXTRUDE LENGTH=-{length|float|abs} SPEED={speed|float|abs} [gcode_arcs] resolution = 1 [exclude_object] [gcode_macro AXES_MAP_CALIBRATION] gcode = {% set z_height = params.Z_HEIGHT|default(20)|int %} {% set speed = params.SPEED|default(80)|float * 60 %} {% set accel = params.ACCEL|default(1500)|int %} {% set feedrate_travel = params.TRAVEL_SPEED|default(120)|int * 60 %} {% set accel_chip = params.ACCEL_CHIP|default("adxl345") %} {% set mid_x = printer.toolhead.axis_maximum.x|float / 2 %} {% set mid_y = printer.toolhead.axis_maximum.y|float / 2 %} {% set accel = [accel, printer.configfile.settings.printer.max_accel]|min %} {% set old_accel = printer.toolhead.max_accel %} {% set old_cruise_ratio = printer.toolhead.minimum_cruise_ratio %} {% set old_sqv = printer.toolhead.square_corner_velocity %} {% if not 'xyz' in printer.toolhead.homed_axes %} { action_raise_error("Must Home printer first!") } {% endif %} {action_respond_info("")} {action_respond_info("Starting accelerometer axe_map calibration")} {action_respond_info("This operation can not be interrupted by normal means. Hit the \"emergency stop\" button to stop it if needed")} {action_respond_info("")} SAVE_GCODE_STATE NAME=STATE_AXESMAP_CALIBRATION G90 SET_VELOCITY_LIMIT ACCEL={accel} MINIMUM_CRUISE_RATIO=0 SQUARE_CORNER_VELOCITY={[(accel / 1000), 5.0]|max} G1 Z{z_height} F{feedrate_travel / 8} G1 X{mid_x - 15} Y{mid_y - 15} F{feedrate_travel} G4 P500 ACCELEROMETER_MEASURE CHIP={accel_chip} G4 P1000 G1 X{mid_x + 15} F{speed} G4 P1000 G1 Y{mid_y + 15} F{speed} G4 P1000 G1 Z{z_height + 15} F{speed} G4 P1000 ACCELEROMETER_MEASURE CHIP={accel_chip} NAME=axemap RESPOND MSG="Analysis of the movements..." RUN_SHELL_COMMAND CMD=shaketune PARAMS="--type axesmap --accel {accel|int} --chip_name {accel_chip}" SET_VELOCITY_LIMIT ACCEL={old_accel} MINIMUM_CRUISE_RATIO={old_cruise_ratio} SQUARE_CORNER_VELOCITY={old_sqv} RESTORE_GCODE_STATE NAME=STATE_AXESMAP_CALIBRATION [gcode_macro AXES_SHAPER_CALIBRATION] description = Perform standard axis input shaper tests on one or both XY axes to select the best input shaper filter gcode = {% set min_freq = params.FREQ_START|default(5)|float %} {% set max_freq = params.FREQ_END|default(133.3)|float %} {% set hz_per_sec = params.HZ_PER_SEC|default(1)|float %} {% set axis = params.AXIS|default("all")|string|lower %} {% set scv = params.SCV|default(None) %} {% set max_sm = params.MAX_SMOOTHING|default(None) %} {% set keep_results = params.KEEP_N_RESULTS|default(3)|int %} {% set keep_csv = params.KEEP_CSV|default(True) %} {% set X, Y = False, False %} {% if axis == "all" %} {% set X, Y = True, True %} {% elif axis == "x" %} {% set X = True %} {% elif axis == "y" %} {% set Y = True %} {% else %} { action_raise_error("AXIS selection invalid. Should be either all, x or y!") } {% endif %} {% if scv is none %} {% set scv = printer.toolhead.square_corner_velocity %} {% endif %} {% if X %} TEST_RESONANCES AXIS=X OUTPUT=raw_data NAME=x FREQ_START={min_freq} FREQ_END={max_freq} HZ_PER_SEC={hz_per_sec} M400 RESPOND MSG="X axis frequency profile generation..." RESPOND MSG="This may take some time (1-3min)" RUN_SHELL_COMMAND CMD=shaketune PARAMS="--type shaper --scv {scv} {% if max_sm is not none %}--max_smoothing {max_sm}{% endif %} {% if keep_csv %}--keep_csv{% endif %}" {% endif %} {% if Y %} TEST_RESONANCES AXIS=Y OUTPUT=raw_data NAME=y FREQ_START={min_freq} FREQ_END={max_freq} HZ_PER_SEC={hz_per_sec} M400 RESPOND MSG="Y axis frequency profile generation..." RESPOND MSG="This may take some time (1-3min)" RUN_SHELL_COMMAND CMD=shaketune PARAMS="--type shaper --scv {scv} {% if max_sm is not none %}--max_smoothing {max_sm}{% endif %} {% if keep_csv %}--keep_csv{% endif %}" {% endif %} M400 RUN_SHELL_COMMAND CMD=shaketune PARAMS="--type clean --keep_results {keep_results}" [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 = {% 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 keep_results = params.KEEP_N_RESULTS|default(3)|int %} {% set keep_csv = params.KEEP_CSV|default(True) %} 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 MSG="Belts comparative frequency profile generation..." RESPOND MSG="This may take some time (3-5min)" RUN_SHELL_COMMAND CMD=shaketune PARAMS="--type belts {% if keep_csv %}--keep_csv{% endif %}" M400 RUN_SHELL_COMMAND CMD=shaketune PARAMS="--type clean --keep_results {keep_results}" [gcode_macro EXCITATE_AXIS_AT_FREQ] description = Maintain a specified excitation frequency for a period of time to diagnose and locate a source of vibration 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 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 %} TEST_RESONANCES OUTPUT=raw_data AXIS={axis} FREQ_START={frequency-1} FREQ_END={frequency+1} HZ_PER_SEC={1/(time/3)} M400 [gcode_macro VIBRATIONS_CALIBRATION] gcode = {% set size = params.SIZE|default(60)|int %} {% set direction = params.DIRECTION|default('XY') %} {% set z_height = params.Z_HEIGHT|default(20)|int %} {% set min_speed = params.MIN_SPEED|default(20)|float * 60 %} {% set max_speed = params.MAX_SPEED|default(200)|float * 60 %} {% set speed_increment = params.SPEED_INCREMENT|default(2)|float * 60 %} {% set feedrate_travel = params.TRAVEL_SPEED|default(200)|int * 60 %} {% set accel = params.ACCEL|default(3000)|int %} {% set accel_chip = params.ACCEL_CHIP|default("adxl345") %} {% set keep_results = params.KEEP_N_RESULTS|default(3)|int %} {% set keep_csv = params.KEEP_CSV|default(True) %} {% set mid_x = printer.toolhead.axis_maximum.x|float / 2 %} {% set mid_y = printer.toolhead.axis_maximum.y|float / 2 %} {% set nb_samples = ((max_speed - min_speed) / speed_increment + 1) | int %} {% set accel = [accel, printer.configfile.settings.printer.max_accel]|min %} {% set old_accel = printer.toolhead.max_accel %} {% set old_cruise_ratio = printer.toolhead.minimum_cruise_ratio %} {% set old_sqv = printer.toolhead.square_corner_velocity %} {% set direction_factor = { 'XY' : { 'start' : {'x': -0.5, 'y': -0.5 }, 'move_factors' : { '0' : {'x': 0.5, 'y': -0.5, 'z': 0.0 }, '1' : {'x': 0.5, 'y': 0.5, 'z': 0.0 }, '2' : {'x': -0.5, 'y': 0.5, 'z': 0.0 }, '3' : {'x': -0.5, 'y': -0.5, 'z': 0.0 } } }, 'AB' : { 'start' : {'x': 0.0, 'y': 0.0 }, 'move_factors' : { '0' : {'x': 0.5, 'y': -0.5, 'z': 0.0 }, '1' : {'x': -0.5, 'y': 0.5, 'z': 0.0 }, '2' : {'x': 0.0, 'y': 0.0, 'z': 0.0 }, '3' : {'x': 0.5, 'y': 0.5, 'z': 0.0 }, '4' : {'x': -0.5, 'y': -0.5, 'z': 0.0 }, '5' : {'x': 0.0, 'y': 0.0, 'z': 0.0 } } }, 'ABXY' : { 'start' : {'x': -0.5, 'y': 0.5 }, 'move_factors' : { '0' : {'x': -0.5, 'y': -0.5, 'z': 0.0 }, '1' : {'x': 0.5, 'y': -0.5, 'z': 0.0 }, '2' : {'x': -0.5, 'y': 0.5, 'z': 0.0 }, '3' : {'x': 0.5, 'y': 0.5, 'z': 0.0 }, '4' : {'x': -0.5, 'y': -0.5, 'z': 0.0 }, '5' : {'x': -0.5, 'y': 0.5, 'z': 0.0 } } }, 'B' : { 'start' : {'x': 0.5, 'y': 0.5 }, 'move_factors' : { '0' : {'x': -0.5, 'y': -0.5, 'z': 0.0 }, '1' : {'x': 0.5, 'y': 0.5, 'z': 0.0 } } }, 'A' : { 'start' : {'x': -0.5, 'y': 0.5 }, 'move_factors' : { '0' : {'x': 0.5, 'y': -0.5, 'z': 0.0 }, '1' : {'x': -0.5, 'y': 0.5, 'z': 0.0 } } }, 'X' : { 'start' : {'x': -0.5, 'y': 0.0 }, 'move_factors' : { '0' : {'x': 0.5, 'y': 0.0, 'z': 0.0 }, '1' : {'x': -0.5, 'y': 0.0, 'z': 0.0 } } }, 'Y' : { 'start' : {'x': 0.0, 'y': 0.5 }, 'move_factors' : { '0' : {'x': 0.0, 'y': -0.5, 'z': 0.0 }, '1' : {'x': 0.0, 'y': 0.5, 'z': 0.0 } } }, 'Z' : { 'start' : {'x': 0.0, 'y': 0.0 }, 'move_factors' : { '0' : {'x': 0.0, 'y': 0.0, 'z': 1.0 }, '1' : {'x': 0.0, 'y': 0.0, 'z': 0.0 } } }, 'E' : { 'start' : {'x': 0.0, 'y': 0.0 }, 'move_factor' : 0.05 } } %} {% if not 'xyz' in printer.toolhead.homed_axes %} { action_raise_error("Must Home printer first!") } {% endif %} {% if params.SPEED_INCREMENT|default(2)|float * 100 != (params.SPEED_INCREMENT|default(2)|float * 100)|int %} { action_raise_error("Only 2 decimal digits are allowed for SPEED_INCREMENT") } {% endif %} {% if (size / (max_speed / 60)) < 0.25 and direction != 'E' %} { action_raise_error("SIZE is too small for this MAX_SPEED. Increase SIZE or decrease MAX_SPEED!") } {% endif %} {% if not (direction in direction_factor) %} { action_raise_error("DIRECTION is not valid. Only XY, AB, ABXY, A, B, X, Y, Z or E is allowed!") } {% endif %} {action_respond_info("")} {action_respond_info("Starting speed and vibration calibration")} {action_respond_info("This operation can not be interrupted by normal means. Hit the \"emergency stop\" button to stop it if needed")} {action_respond_info("")} SAVE_GCODE_STATE NAME=STATE_VIBRATIONS_CALIBRATION G90 SET_VELOCITY_LIMIT ACCEL={accel} MINIMUM_CRUISE_RATIO=0 SQUARE_CORNER_VELOCITY={[(accel / 1000), 5.0]|max} G1 Z{z_height} F{feedrate_travel / 10} G1 X{mid_x + (size * direction_factor[direction].start.x) } Y{mid_y + (size * direction_factor[direction].start.y)} F{feedrate_travel} {% for curr_sample in range(0, nb_samples) %} {% set curr_speed = min_speed + curr_sample * speed_increment %} RESPOND MSG="{"Current speed: %.2f mm/s" % (curr_speed / 60)|float}" ACCELEROMETER_MEASURE CHIP={accel_chip} {% if direction == 'E' %} G0 E{curr_speed*direction_factor[direction].move_factor} F{curr_speed} {% else %} {% for key, factor in direction_factor[direction].move_factors|dictsort %} G1 X{mid_x + (size * factor.x) } Y{mid_y + (size * factor.y)} Z{z_height + (size * factor.z)} F{curr_speed} {% endfor %} {% endif %} ACCELEROMETER_MEASURE CHIP={accel_chip} NAME=sp{("%.2f" % (curr_speed / 60)|float)|replace('.','_')}n1 G4 P300 M400 {% endfor %} RESPOND MSG="Machine and motors vibration graph generation..." RESPOND MSG="This may take some time (3-5min)" RUN_SHELL_COMMAND CMD=shaketune PARAMS="--type vibrations --axis_name {direction} --accel {accel|int} --chip_name {accel_chip} {% if keep_csv %}--keep_csv{% endif %}" M400 RUN_SHELL_COMMAND CMD=shaketune PARAMS="--type clean --keep_results {keep_results}" SET_VELOCITY_LIMIT ACCEL={old_accel} MINIMUM_CRUISE_RATIO={old_cruise_ratio} SQUARE_CORNER_VELOCITY={old_sqv} RESTORE_GCODE_STATE NAME=STATE_VIBRATIONS_CALIBRATION [gcode_shell_command shaketune] command = ~/printer_data/config/K-ShakeTune/scripts/shaketune.sh timeout = 600.0 verbose = True [stepper_x] step_pin = PE6 dir_pin = !PE5 enable_pin = multi_pin:z_enable microsteps = 16 rotation_distance = 32 endstop_pin = EBBCan: PB6 position_endstop = 0 position_max = 315 homing_speed = 50 [stepper_y] step_pin = PE2 dir_pin = !PE1 enable_pin = !PE4 microsteps = 16 rotation_distance = 32 endstop_pin = ^PF3 position_endstop = 300 position_max = 300 homing_speed = 50 [stepper_z] step_pin = PB8 dir_pin = PB7 enable_pin = !PE0 microsteps = 16 rotation_distance = 32 endstop_pin = probe:z_virtual_endstop position_max = 230 position_min = -5.0 homing_speed = 20 second_homing_speed = 10 homing_retract_dist = 5 [stepper_z1] step_pin = PB4 dir_pin = !PB3 enable_pin = !PB6 microsteps = 16 rotation_distance = 32 [stepper_z2] step_pin = PG13 dir_pin = !PG12 enable_pin = !PG15 microsteps = 16 rotation_distance = 32 [extruder] step_pin = EBBCan: PD0 dir_pin = EBBCan: PD1 enable_pin = !EBBCan: PD2 microsteps = 16 rotation_distance = 3.43 nozzle_diameter = 0.600 filament_diameter = 1.750 heater_pin = EBBCan: PB13 sensor_type = EPCOS 100K B57560G104F sensor_pin = EBBCan: PA3 min_temp = 0 max_temp = 250 max_extrude_cross_section = 250 max_extrude_only_distance = 250 control = pid pid_kp = 16.610 pid_ki = 0.527 pid_kd = 130.805 [tmc5160 stepper_x] cs_pin = PC13 spi_software_mosi_pin = PG6 spi_software_miso_pin = PG7 spi_software_sclk_pin = PG8 run_current = 1.400 [tmc5160 stepper_y] cs_pin = PE3 spi_software_mosi_pin = PG6 spi_software_miso_pin = PG7 spi_software_sclk_pin = PG8 run_current = 1.400 [tmc2209 stepper_z] uart_pin = PB9 run_current = 0.850 stealthchop_threshold = 999999 [tmc2209 stepper_z1] uart_pin = PB5 run_current = 0.850 stealthchop_threshold = 999999 [tmc2209 stepper_z2] uart_pin = PG14 run_current = 0.850 stealthchop_threshold = 999999 [tmc2209 extruder] uart_pin = EBBCan: PA15 run_current = 0.650 [multi_pin z_enable] pins = !PC14, PA5 [heater_bed] heater_pin = PA0 sensor_type = ATC Semitec 104GT-2 sensor_pin = PB1 control = pid pid_kp = 54.027 pid_ki = 0.770 pid_kd = 948.182 min_temp = 0 max_temp = 130 [fan] pin = EBBCan: PA1 [heater_fan hotend_fan] pin = EBBCan: PA0 heater = extruder heater_temp = 50.0 [controller_fan tmc_fan] pin = PF7 stepper = stepper_x [temperature_fan CB1] pin = PF8 sensor_type = temperature_host min_temp = 10 max_temp = 90 control = pid pid_kp = 2 pid_ki = 4 pid_kd = 0.1 [temperature_sensor mcu_temp] sensor_type = temperature_mcu min_temp = 0 max_temp = 100 [temperature_sensor EBB_Temperature] sensor_type = temperature_mcu sensor_mcu = EBBCan [temperature_sensor bed_top] sensor_type = EPCOS 100K B57560G104F sensor_pin = PB0 [temperature_sensor Chamber_Middle] sensor_type = AHT10 i2c_mcu = mcu i2c_bus = i2c [bltouch] sensor_pin = ^EBBCan:PB8 control_pin = EBBCan:PB9 stow_on_each_sample = false probe_with_touch_mode = true x_offset = 55 y_offset = 0 speed = 10 lift_speed = 20 samples = 2 samples_tolerance_retries = 4 z_offset = 1.200 [idle_timeout] timeout = 960000 [filament_switch_sensor switch_sensor] switch_pin = ^PF0 pause_on_runout = false runout_gcode = PAUSE [filament_motion_sensor motion_sensor] switch_pin = ^PC15 detection_length = 4 extruder = extruder pause_on_runout = false runout_gcode = PAUSE [neopixel outside] pin = CB1: gpio259 chain_count = 79 color_order = GRB initial_red = 0.5 initial_green = 0.5 initial_blue = 0.5 [neopixel back] pin = PD15 chain_count = 29 color_order = GRB initial_red = 0.5 initial_green = 0.5 initial_blue = 0.5 [z_tilt] z_positions = 0, 25 300, 25 150, 300 points = 0, 20 245, 20 95, 295 speed = 125 horizontal_move_z = 10 retries = 8 retry_tolerance = 0.01 [bed_mesh] speed = 125 horizontal_move_z = 10 mesh_min = 55, 10 mesh_max = 245,290 probe_count = 5, 5 algorithm = bicubic bicubic_tension = 0.2 fade_start = 1 fade_end = 10 fade_target = 0 [safe_z_home] home_xy_position = 100, 150 speed = 150 [input_shaper] shaper_freq_x = 83.8 shaper_type_x = mzv shaper_freq_y = 65.2 shaper_type_y = mzv [adxl345] cs_pin = EBBCan: PB12 spi_software_sclk_pin = EBBCan: PB10 spi_software_mosi_pin = EBBCan: PB11 spi_software_miso_pin = EBBCan: PB2 axes_map = x,y,z [resonance_tester] accel_chip = adxl345 probe_points = 160, 150, 50 [gcode_macro PRINT_START] gcode = {% set BED = params.BED_TEMP|int %} {% set EXTRUDER = params.EXTRUDER_TEMP|int %} M140 S{BED} M104 S{EXTRUDER} G28 Z_TILT_ADJUST BED_MESH_CALIBRATE _ADAPTIVE_PURGE_V1 [gcode_macro Z_TILT_ADJUST] rename_existing = Z_TILT_ADJUST_1 gcode = {% if printer["gcode_macro status_leveling"] != null %} status_leveling {% endif %} Z_TILT_ADJUST_1 { rawparams } {% if printer["gcode_macro status_ready"] != null %} status_ready {% endif %} [gcode_macro BED_MESH_CALIBRATE] rename_existing = _BED_MESH_CALIBRATE variable_buffer = 2 gcode = {% set bedMeshConfig = printer['configfile'].config["bed_mesh"] %} {% set bed_mesh_min = bedMeshConfig.mesh_min %} {% set bed_mesh_max = bedMeshConfig.mesh_max %} {% set all_points = printer.exclude_object.objects | map(attribute='polygon') | sum(start=[]) %} {% 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]) %} {% if printer["bed_mesh"].profile_name == '' %} { action_respond_info("No existing bed mesh found.") } {% set last_area_end_x=-1 %} {% endif %} {% if printer.toolhead.homed_axes != "xyz" %} G28 {% endif %} {% set klicky_available = printer['gcode_macro _Probe_Variables'] != null %} {% set probeConfig = printer['configfile'].config["probe"] %} {% if probeConfig %} {% set OffsetX = probeConfig.x_offset|default(0)|float %} {% set OffsetY = probeConfig.y_offset|default(0)|float %} {% endif %} {% set print_min_x = x_min|float %} {% set print_min_y = y_min|float %} {% set print_max_x = x_max|float %} {% set print_max_y = y_max|float %} {% set mesh_min_x = bed_mesh_min.split(",")[0]|float %} {% set mesh_min_y = bed_mesh_min.split(",")[1]|float %} {% set mesh_max_x = bed_mesh_max.split(",")[0]|float %} {% set mesh_max_y = bed_mesh_max.split(",")[1]|float %} {% if (print_min_x < mesh_min_x) or (print_max_x > mesh_max_x) or (print_min_y < mesh_min_y) or (print_max_y > mesh_max_y) %} {% set print_min_x = mesh_min_x %} {% set print_min_y = mesh_min_y %} {% set print_max_x = mesh_max_x %} {% set print_max_y = mesh_max_y %} {% endif %} {% if klicky_available %} _CheckProbe action=query Attach_Probe {% elif euclid_available %} DEPLOY_PROBE {% endif %} {% if (print_min_x < print_max_x) and (print_min_y < print_max_y) %} {% set minimum_probe_count = 3 %} {% set medium_probe_count = 5 %} {% set probe_count = bedMeshConfig.probe_count.split(",") %} {% set probe_count_x = probe_count[0]|int %} {% if probe_count.__len__() > 1 %} {% set probe_count_y = probe_count[1]|int %} {% else %} {% set probe_count_y = probe_count_x|int %} {% endif %} {% set relative_reference_index = bedMeshConfig.relative_reference_index %} {% if print_max_x - print_min_x < (mesh_max_x - mesh_min_x) * 0.75 %} {% set probe_count_x = medium_probe_count %} {% endif %} {% if print_max_y - print_min_y < (mesh_max_y - mesh_min_y) * 0.75 %} {% set probe_count_y = medium_probe_count %} {% endif %} {% if print_max_x - print_min_x < (mesh_max_x - mesh_min_x) * 0.50 %} {% set probe_count_x = minimum_probe_count %} {% endif %} {% if print_max_y - print_min_y < (mesh_max_y - mesh_min_y) * 0.50 %} {% set probe_count_y = minimum_probe_count %} {% endif %} {% if print_min_x - buffer >= mesh_min_x %} {% set mesh_min_x = print_min_x - buffer %} {% endif %} {% if print_min_y - buffer >= mesh_min_y %} {% set mesh_min_y = print_min_y - buffer %} {% endif %} {% if print_max_x + buffer <= mesh_max_x %} {% set mesh_max_x = print_max_x + buffer %} {% endif %} {% if print_max_y + buffer <= mesh_max_y %} {% set mesh_max_y = print_max_y + buffer %} {% endif %} { action_respond_info("mesh_min: %s,%s" % (mesh_min_x, mesh_min_y)) } { action_respond_info("mesh_max: %s,%s" % (mesh_max_x, mesh_max_y)) } { action_respond_info("probe_count: %s,%s" % (probe_count_x,probe_count_y)) } {% if printer["gcode_macro status_meshing"] != null %} status_meshing {% endif %} {% if relative_reference_index == 0 or relative_reference_index == null %} _BED_MESH_CALIBRATE mesh_min={mesh_min_x},{mesh_min_y} mesh_max={mesh_max_x},{mesh_max_y} probe_count={probe_count_x},{probe_count_y} {% else %} {% set relative_reference_index = ((probe_count_x * probe_count_y - 1) / 2)|int %} { action_respond_info("relative_reference_index: %s" % relative_reference_index) } _BED_MESH_CALIBRATE mesh_min={mesh_min_x},{mesh_min_y} mesh_max={mesh_max_x},{mesh_max_y} probe_count={probe_count_x},{probe_count_y} relative_reference_index={relative_reference_index} {% endif %} {% else %} {% if printer["gcode_macro status_meshing"] != null %} status_meshing {% endif %} _BED_MESH_CALIBRATE {% endif %} {% if klicky_available %} Dock_Probe {% elif euclid_available %} STOW_PROBE {% endif %} {% if printer["gcode_macro status_ready"] != null %} status_ready {% endif %} [gcode_macro _ADAPTIVE_PURGE_V1] description = A purge macro that adapts to be near your actual printed objects variable_adaptive_enable = True variable_z_height = 0.3 variable_tip_distance = 10 variable_purge_amount = 30 variable_flow_rate = 10 variable_x_default = 5 variable_y_default = 5 variable_size = 16 variable_distance_to_object_x = 7 variable_distance_to_object_y = 7 gcode = {% if adaptive_enable == True %} {% set all_points = printer.exclude_object.objects | map(attribute='polygon') | sum(start=[]) %} {% set x_origin = (all_points | map(attribute=0) | min | default(x_default + distance_to_object_x + size)) - distance_to_object_x - size %} {% set y_origin = (all_points | map(attribute=1) | min | default(y_default + distance_to_object_y + size)) - distance_to_object_y - size %} {% set x_origin = ([x_origin, 0] | max) %} {% set y_origin = ([y_origin, 0] | max) %} {% if x_origin < x_default %} set x_origin = x_default | float {% endif %} {% if y_origin < y_default %} set y_origin = y_default | float {% endif %} {% else %} {% set x_origin = x_default | float %} {% set y_origin = y_default | float %} {% endif %} {% set purge_move_speed = 2.31 * size * flow_rate / (purge_amount * 2.405) %} {% set prepurge_speed = flow_rate / 2.405 %} {% set travel_speed = printer.toolhead.max_velocity %} { action_respond_info( "x: " + x_origin|string + " y: " + y_origin|string + " purge_move_speed: " + purge_move_speed|string + " prepurge_speed: " + prepurge_speed|string ) } G92 E0 G90 G0 X{x_origin} Y{y_origin+size/2} F3000 G0 Z{z_height} F1500 G0 F3000 M83 G1 E{tip_distance} F{prepurge_speed*60} G1 F600 G1 X{x_origin+size*0.1976875} Y{y_origin+size*0.0538125} E{purge_amount*0.00362396204033215} G1 X{x_origin+size*0.2070625} Y{y_origin+size*0.056375} E{purge_amount*0.00348517200474496} G1 X{x_origin+size*0.273} Y{y_origin+size*0.0889375} E{purge_amount*0.0253226571767497} G1 X{x_origin+size*0.3568125} Y{y_origin+size*0.125125} E{purge_amount*0.0313760379596679} G1 X{x_origin+size*0.442375} Y{y_origin+size*0.1563125} E{purge_amount*0.0312455516014235} G1 X{x_origin+size*0.5295625} Y{y_origin+size*0.1825} E{purge_amount*0.0311731909845789} G1 X{x_origin+size*0.5311875} Y{y_origin+size*0.1829375} E{purge_amount*0.000575326215895611} G1 X{x_origin+size*0.6196875} Y{y_origin+size*0.2038125} E{purge_amount*0.0311376037959668} G1 X{x_origin+size*0.7093125} Y{y_origin+size*0.219625} E{purge_amount*0.0312253855278766} G1 X{x_origin+size*0.799875} Y{y_origin+size*0.2301875} E{purge_amount*0.0313368920521945} G1 X{x_origin+size*0.8735625} Y{y_origin+size*0.2349375} E{purge_amount*0.0254270462633452} G1 X{x_origin+size*0.8824375} Y{y_origin+size*0.237} E{purge_amount*0.00326809015421115} G1 X{x_origin+size*0.8913125} Y{y_origin+size*0.2390625} E{purge_amount*0.00339739027283511} G1 X{x_origin+size*0.8959375} Y{y_origin+size*0.2481875} E{purge_amount*0.00381494661921708} G1 X{x_origin+size*0.9005} Y{y_origin+size*0.257375} E{purge_amount*0.00366548042704626} G1 X{x_origin+size*0.951125} Y{y_origin+size*0.4463125} E{purge_amount*0.0668623962040332} G1 X{x_origin+size*0.9521875} Y{y_origin+size*0.4540625} E{purge_amount*0.00276156583629893} G1 X{x_origin+size*0.9531875} Y{y_origin+size*0.46175} E{purge_amount*0.00282443653618031} G1 X{x_origin+size*0.9528125} Y{y_origin+size*0.4654375} E{purge_amount*0.00138078291814947} G1 X{x_origin+size*0.9458125} Y{y_origin+size*0.4720625} E{purge_amount*0.00359193357058126} G1 X{x_origin+size*0.9388125} Y{y_origin+size*0.4786875} E{purge_amount*0.00342467378410439} G1 X{x_origin+size*0.9145625} Y{y_origin+size*0.4951875} E{purge_amount*0.00993950177935943} G1 X{x_origin+size*0.8395} Y{y_origin+size*0.547875} E{purge_amount*0.0316453143534994} G1 X{x_origin+size*0.7680625} Y{y_origin+size*0.6045} E{purge_amount*0.0314733096085409} G1 X{x_origin+size*0.700125} Y{y_origin+size*0.665125} E{purge_amount*0.0314483985765125} G1 X{x_origin+size*0.6358125} Y{y_origin+size*0.7295} E{purge_amount*0.0314317912218268} G1 X{x_origin+size*0.5755625} Y{y_origin+size*0.7971875} E{purge_amount*0.0312977461447212} G1 X{x_origin+size*0.5465} Y{y_origin+size*0.8325625} E{purge_amount*0.0155836298932384} G1 X{x_origin+size*0.492125} Y{y_origin+size*0.9056875} E{purge_amount*0.0313190984578885} G1 X{x_origin+size*0.451125} Y{y_origin+size*0.967125} E{purge_amount*0.0254341637010676} G1 X{x_origin+size*0.444625} Y{y_origin+size*0.9739375} E{purge_amount*0.00337959667852906} G1 X{x_origin+size*0.4380625} Y{y_origin+size*0.98075} E{purge_amount*0.00353262158956109} G1 X{x_origin+size*0.428125} Y{y_origin+size*0.98} E{purge_amount*0.00372123368920522} G1 X{x_origin+size*0.41825} Y{y_origin+size*0.97925} E{purge_amount*0.00354211150652432} G1 X{x_origin+size*0.22925} Y{y_origin+size*0.928625} E{purge_amount*0.0668837485172005} G1 X{x_origin+size*0.2204375} Y{y_origin+size*0.924125} E{purge_amount*0.00351601423487545} G1 X{x_origin+size*0.2115625} Y{y_origin+size*0.919625} E{purge_amount*0.00366903914590747} G1 X{x_origin+size*0.2091875} Y{y_origin+size*0.910625} E{purge_amount*0.00343179122182681} G1 X{x_origin+size*0.2068125} Y{y_origin+size*0.9016875} E{purge_amount*0.00329774614472123} G1 X{x_origin+size*0.2020625} Y{y_origin+size*0.82825} E{purge_amount*0.0253404507710558} G1 X{x_origin+size*0.1915} Y{y_origin+size*0.737625} E{purge_amount*0.0313582443653618} G1 X{x_origin+size*0.17575} Y{y_origin+size*0.6479375} E{purge_amount*0.0312431791221827} G1 X{x_origin+size*0.154875} Y{y_origin+size*0.5593125} E{purge_amount*0.0311791221826809} G1 X{x_origin+size*0.1544375} Y{y_origin+size*0.5576875} E{purge_amount*0.000575326215895611} G1 X{x_origin+size*0.12825} Y{y_origin+size*0.470625} E{purge_amount*0.0311328588374852} G1 X{x_origin+size*0.0970625} Y{y_origin+size*0.385125} E{purge_amount*0.0312253855278766} G1 X{x_origin+size*0.061} Y{y_origin+size*0.3014375} E{purge_amount*0.0313190984578885} G1 X{x_origin+size*0.02825} Y{y_origin+size*0.2351875} E{purge_amount*0.0254483985765125} G1 X{x_origin+size*0.025625} Y{y_origin+size*0.226125} E{purge_amount*0.00338671411625148} G1 X{x_origin+size*0.023} Y{y_origin+size*0.2170625} E{purge_amount*0.00352313167259787} G1 X{x_origin+size*0.028625} Y{y_origin+size*0.208875} E{purge_amount*0.00370937129300119} G1 X{x_origin+size*0.03425} Y{y_origin+size*0.200625} E{purge_amount*0.003570581257414} G1 X{x_origin+size*0.1725625} Y{y_origin+size*0.0623125} E{purge_amount*0.0668623962040332} G1 X{x_origin+size*0.1804375} Y{y_origin+size*0.0568125} E{purge_amount*0.00343297746144721} G1 X{x_origin+size*0.18375} Y{y_origin+size*0.0545} E{purge_amount*0.00150652431791222} G92 E0 M82 G0 Z{z_height*2} {% if printer["gcode_macro status_printing"] != null %} status_printing {% endif %} [gcode_macro PRINT_END] gcode = M400 TURN_OFF_HEATERS M106 S0 PARK_CENTER_REAR G0 Z230 F3000 [gcode_macro PARK_CENTER_REAR] gcode = {% if printer["gcode_macro status_busy"] != null %} status_busy {% endif %} {% set th = printer.toolhead %} {% set x_safe = th.position.x + 20 * (1 if th.axis_maximum.x - th.position.x > 20 else -1) %} {% set y_safe = th.position.y + 20 * (1 if th.axis_maximum.y - th.position.y > 20 else -1) %} G0 X{th.axis_maximum.x//2} Y{th.axis_maximum.y - 2} F3600 {% if printer["gcode_macro status_ready"] != null %} status_ready {% endif %} [gcode_macro TEST_SPEED] gcode = G0 Z10 {% set speed = params.SPEED|default(printer.configfile.settings.printer.max_velocity)|int %} {% set iterations = params.ITERATIONS|default(5)|int %} {% set accel = params.ACCEL|default(printer.configfile.settings.printer.max_accel)|int %} {% set bound = params.BOUND|default(20)|int %} {% set smallpatternsize = SMALLPATTERNSIZE|default(20)|int %} {% set x_min = printer.toolhead.axis_minimum.x + bound %} {% set x_max = printer.toolhead.axis_maximum.x - bound %} {% set y_min = printer.toolhead.axis_minimum.y + bound %} {% set y_max = printer.toolhead.axis_maximum.y - bound %} {% set x_center = (printer.toolhead.axis_minimum.x|float + printer.toolhead.axis_maximum.x|float ) / 2 %} {% set y_center = (printer.toolhead.axis_minimum.y|float + printer.toolhead.axis_maximum.y|float ) / 2 %} {% set x_center_min = x_center - (smallpatternsize/2) %} {% set x_center_max = x_center + (smallpatternsize/2) %} {% set y_center_min = y_center - (smallpatternsize/2) %} {% set y_center_max = y_center + (smallpatternsize/2) %} SAVE_GCODE_STATE NAME=TEST_SPEED { action_respond_info("TEST_SPEED: starting %d iterations at speed %d, accel %d" % (iterations, speed, accel)) } M400 G28 {% if printer.configfile.settings.quad_gantry_level %} {% if printer.quad_gantry_level.applied == False %} QUAD_GANTRY_LEVEL G28 Z {% endif %} {% endif %} G90 G1 X{printer.toolhead.axis_maximum.x-50} Y{printer.toolhead.axis_maximum.y-50} F{30*60} M400 G28 X Y G0 X{printer.toolhead.axis_maximum.x-1} Y{printer.toolhead.axis_maximum.y-1} F{30*60} G4 P1000 GET_POSITION G0 X{x_min} Y{y_min} Z{bound + 10} F{speed*60} SET_VELOCITY_LIMIT VELOCITY={speed} ACCEL={accel} ACCEL_TO_DECEL={accel / 2} {% for i in range(iterations) %} G0 X{x_min} Y{y_min} F{speed*60} G0 X{x_max} Y{y_max} F{speed*60} G0 X{x_min} Y{y_min} F{speed*60} G0 X{x_max} Y{y_min} F{speed*60} G0 X{x_min} Y{y_max} F{speed*60} G0 X{x_max} Y{y_min} F{speed*60} G0 X{x_min} Y{y_min} F{speed*60} G0 X{x_min} Y{y_max} F{speed*60} G0 X{x_max} Y{y_max} F{speed*60} G0 X{x_max} Y{y_min} F{speed*60} G0 X{x_center_min} Y{y_center_min} F{speed*60} G0 X{x_center_max} Y{y_center_max} F{speed*60} G0 X{x_center_min} Y{y_center_min} F{speed*60} G0 X{x_center_max} Y{y_center_min} F{speed*60} G0 X{x_center_min} Y{y_center_max} F{speed*60} G0 X{x_center_max} Y{y_center_min} F{speed*60} G0 X{x_center_min} Y{y_center_min} F{speed*60} G0 X{x_center_min} Y{y_center_max} F{speed*60} G0 X{x_center_max} Y{y_center_max} F{speed*60} G0 X{x_center_max} Y{y_center_min} F{speed*60} {% endfor %} SET_VELOCITY_LIMIT VELOCITY={printer.configfile.settings.printer.max_velocity} ACCEL={printer.configfile.settings.printer.max_accel} M400 G28 G90 G0 X{printer.toolhead.axis_maximum.x-1} Y{printer.toolhead.axis_maximum.y-1} F{30*60} G4 P1000 GET_POSITION RESTORE_GCODE_STATE NAME=TEST_SPEED [led_effect progress_bar] leds = neopixel:back autostart = true frame_rate = 24 layers = progress -1 0 add ( 0, 0, 1),( 0, 0.1, 0.6) static 0 0 top ( 0, 0, 0.1) [gcode_macro update_git] gcode = {% set message = params.MESSAGE|default() %} {% if message %} RUN_SHELL_COMMAND CMD=update_git_script_message PARAMS="'{params.MESSAGE}'" {% else %} RUN_SHELL_COMMAND CMD=update_git_script {% endif %} [gcode_shell_command update_git_script] command = bash -c "bash $HOME/klipper-backup/script.sh" timeout = 90.0 verbose = True [gcode_shell_command update_git_script_message] command = bash -c "bash $HOME/klipper-backup/script.sh $0" timeout = 90.0 verbose = True [bed_mesh default] version = 1 points = -0.026610, 0.013390, 0.018390, 0.013390, 0.048390 0.133390, 0.118390, 0.073390, 0.048390, 0.048390 0.298390, 0.243390, 0.198390, 0.153390, 0.123390 0.328390, 0.273390, 0.208390, 0.168390, 0.118390 0.118390, 0.078390, 0.028390, -0.001610, -0.016610 x_count = 5 y_count = 5 mesh_x_pps = 2 mesh_y_pps = 2 algo = bicubic tension = 0.2 min_x = 55.0 max_x = 245.0 min_y = 10.0 max_y = 290.0 ======================= Extruder max_extrude_ratio=103.937922 mcu 'mcu': Starting CAN connect Created a socket webhooks client 281473462061568: New connection webhooks client 281473462061568: Client info {'program': 'Moonraker', 'version': 'v0.8.0-331-gc857e1a'} Loaded MCU 'mcu' 108 commands (v0.12.0-132-ge37b007f / gcc: (15:8-2019-q3-1+b1) 8.3.1 20190703 (release) [gcc-8-branch revision 273027] binutils: (2.35.2-2+14+b2) 2.35.2) MCU 'mcu' config: ADC_MAX=4095 BUS_PINS_i2c1_PB6_PB7=PB6,PB7 BUS_PINS_i2c1_PB8_PB9=PB8,PB9 BUS_PINS_i2c2_PB10_PB11=PB10,PB11 BUS_PINS_spi1=PA6,PA7,PA5 BUS_PINS_spi1a=PB4,PB5,PB3 BUS_PINS_spi2=PB14,PB15,PB13 BUS_PINS_spi2a=PC2,PC3,PB10 BUS_PINS_spi3a=PC11,PC12,PC10 BUS_PINS_spi4=PE13,PE14,PE12 BUS_PINS_spi5=PF8,PF9,PF7 BUS_PINS_spi5a=PH7,PF11,PH6 BUS_PINS_spi6=PG12,PG14,PG13 CANBUS_BRIDGE=1 CLOCK_FREQ=400000000 MCU=stm32h723xx PWM_MAX=255 RECEIVE_WINDOW=192 RESERVE_PINS_CAN=PD0,PD1 RESERVE_PINS_USB=PA11,PA12 RESERVE_PINS_crystal=PH0,PH1 STATS_SUMSQ_BASE=256 STEPPER_BOTH_EDGE=1 mcu 'EBBCan': Starting CAN connect Created a socket Loaded MCU 'EBBCan' 108 commands (v0.12.0-132-ge37b007f / gcc: (15:8-2019-q3-1+b1) 8.3.1 20190703 (release) [gcc-8-branch revision 273027] binutils: (2.35.2-2+14+b2) 2.35.2) MCU 'EBBCan' config: ADC_MAX=4095 BUS_PINS_i2c1_PA9_PA10=PA9,PA10 BUS_PINS_i2c1_PB6_PB7=PB6,PB7 BUS_PINS_i2c1_PB8_PB9=PB8,PB9 BUS_PINS_i2c2_PB10_PB11=PB10,PB11 BUS_PINS_i2c2_PB13_PB14=PB13,PB14 BUS_PINS_i2c3_PB3_PB4=PB3,PB4 BUS_PINS_i2c3_PC0_PC1=PC0,PC1 BUS_PINS_spi1=PA6,PA7,PA5 BUS_PINS_spi1a=PB4,PB5,PB3 BUS_PINS_spi2=PB14,PB15,PB13 BUS_PINS_spi2a=PC2,PC3,PB10 BUS_PINS_spi3=PB4,PB5,PB3 CANBUS_FREQUENCY=1000000 CLOCK_FREQ=64000000 MCU=stm32g0b1xx PWM_MAX=255 RECEIVE_WINDOW=192 RESERVE_PINS_CAN=PB0,PB1 RESERVE_PINS_crystal=PF0,PF1 STATS_SUMSQ_BASE=256 STEPPER_BOTH_EDGE=1 mcu 'CB1': Starting connect Loaded MCU 'CB1' 112 commands (v0.12.0-132-ge37b007f / gcc: (Debian 10.2.1-6) 10.2.1 20210110 binutils: (GNU Binutils for Debian) 2.35.2) MCU 'CB1' config: ADC_MAX=4095 CLOCK_FREQ=50000000 MCU=linux PCA9685_MAX=4096 PWM_MAX=32768 STATS_SUMSQ_BASE=256 mcu_temperature 'mcu' nominal base=-281.244980 slope=1644.578313 mcu_temperature 'EBBCan' nominal base=-275.555556 slope=1317.105263 Config error Traceback (most recent call last): File "/home/biqu/klipper/klippy/klippy.py", line 180, in _connect cb() File "/home/biqu/klipper/klippy/mcu.py", line 746, in _connect self._send_config(None) File "/home/biqu/klipper/klippy/mcu.py", line 677, in _send_config cb() File "/home/biqu/klipper/klippy/extras/bus.py", line 174, in build_config bus = resolve_bus_name(self.mcu, "i2c_bus", self.bus) File "/home/biqu/klipper/klippy/extras/bus.py", line 25, in resolve_bus_name raise ppins.error("Unknown %s '%s'" % (param, bus)) pins.error: Unknown i2c_bus 'i2c'