From 71ed32c46ed02c456e835b64413e364a9f49bd87 Mon Sep 17 00:00:00 2001 From: sokolovjek Date: Wed, 17 May 2023 08:28:22 +0100 Subject: [PATCH 1/3] STEAPP-479: added statuses. --- stereotech_config/filament_control.cfg | 5 +++-- stereotech_config/filament_control_2.cfg | 12 ++++++++++++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/stereotech_config/filament_control.cfg b/stereotech_config/filament_control.cfg index a03ead5f5671..27620eceae6e 100644 --- a/stereotech_config/filament_control.cfg +++ b/stereotech_config/filament_control.cfg @@ -26,7 +26,7 @@ gcode: {% set sensor = params.SENSOR %} {% if printer[printer.toolhead.extruder].can_extrude %} M400 - M117 try_do_extrude + M117 try_do_extrude_{printer["gcode_macro TRY_DO_EXTRUDE"].retries_count} EXTRUDE_WITH_CURRENT_TEMP M400 EXTRUDE_WITH_COOLING_AND_HEATING SENSOR={sensor} @@ -57,7 +57,7 @@ gcode: M117 resume_after_trigered_sensor RESUME {% else %} - M117 failed_try_do_extrude + M117 all_attempt_extrude_failed {action_respond_info('All extruding attempt completed failed.')} {% if sensor == 'extruder_sensor' %} SET_GCODE_VARIABLE MACRO=CONTINUE_PRINT_WITH_EXTRUDER VARIABLE=triggered_extruder VALUE=0 @@ -89,6 +89,7 @@ gcode: {% set triggered_extruder = printer["gcode_macro CONTINUE_PRINT_WITH_EXTRUDER"].triggered_extruder|int %} {% if triggered_extruder == 0 %} {action_respond_info('Printing continued with extruder 2.')} + M117 resume_print_another_extruder SET_GCODE_VARIABLE MACRO=PAUSE VARIABLE=current_extruder VALUE=1 SET_GCODE_VARIABLE MACRO=PAUSE VARIABLE=extruder1_temp VALUE={printer["gcode_macro PAUSE"].extruder_temp} SET_GCODE_VARIABLE MACRO=PAUSE VARIABLE=extruder_temp VALUE=0 diff --git a/stereotech_config/filament_control_2.cfg b/stereotech_config/filament_control_2.cfg index a869ff080516..f60868bb5556 100644 --- a/stereotech_config/filament_control_2.cfg +++ b/stereotech_config/filament_control_2.cfg @@ -67,6 +67,7 @@ gcode: SET_GCODE_VARIABLE MACRO=RECOVER_EXTRUSION VARIABLE=enable_second_extruder VALUE=0 {% endif %} #Set timeout and wait for user + M117 all_attempt_extrude_failed UPDATE_DELAYED_GCODE ID=TURN_OFF_EXTRUDERS_DELAYED DURATION=300 SET_GCODE_VARIABLE MACRO=RECOVER_EXTRUSION VARIABLE=enable_offset VALUE=1 SET_GCODE_VARIABLE MACRO=RECOVER_EXTRUSION VARIABLE=enable_prime VALUE=1 @@ -94,6 +95,7 @@ gcode: G10 L2 P0 R1 Z-{reset_value} {% endif %} {% else %} + M117 recover_extrusion_by_offset_attempt_{printer["gcode_macro RECOVER_EXTRUSION_BY_OFFSET"].checks_made + 1} {% if printer.gcode_move.current_wcs == 0 %} SET_GCODE_OFFSET Z_ADJUST={printer["gcode_macro RECOVER_EXTRUSION_BY_OFFSET"].check_value} MOVE=1 {% else %} @@ -130,6 +132,7 @@ gcode: SET_GCODE_VARIABLE MACRO=RECOVER_EXTRUSION_BY_PRIME VARIABLE=use_cooldown VALUE=0 CHECK_FILAMENT_MOTION_SENSOR SENSOR={sensor} {% else %} + M117 try_do_extrude_{printer["gcode_macro RECOVER_EXTRUSION_BY_PRIME"].checks_made + 1} M400 G4 P3000 LOAD_MATERIAL @@ -147,6 +150,7 @@ gcode: {% set filament_detected = printer['filament_motion_sensor ' ~ sensor].filament_detected %} {% if filament_detected %} {action_respond_info('Extruding attempt completed successfully, resuming printing.')} + M117 resume_after_trigered_sensor RESUME {% else %} UPDATE_DELAYED_GCODE ID=RECOVER_EXTRUSION_DELAY DURATION=1 @@ -163,6 +167,7 @@ gcode: SET_GCODE_VARIABLE MACRO=PAUSE VARIABLE=extruder_temp VALUE={printer["gcode_macro PAUSE"].extruder_temp} SET_GCODE_VARIABLE MACRO=RECOVER_EXTRUSION_BY_SECOND_EXTRUDER VARIABLE=enabled VALUE=0 {% else %} + M117 resume_print_another_extruder SET_GCODE_VARIABLE MACRO=RECOVER_EXTRUSION_BY_SECOND_EXTRUDER VARIABLE=enabled VALUE=1 SET_GCODE_OFFSET X_ADJUST=-25.0 MOVE=1 ENABLE_CONSTRAIN ENABLE=1 @@ -171,3 +176,10 @@ gcode: SET_GCODE_VARIABLE MACRO=PAUSE VARIABLE=extruder_temp VALUE=0 RESUME {% endif %} + + + +[gcode_macro MY] +gcode: + M117 try_do_extrude{printer["gcode_macro RECOVER_EXTRUSION_BY_PRIME"].checks_made + 1} + SET_GCODE_VARIABLE MACRO=RECOVER_EXTRUSION_BY_PRIME VARIABLE=checks_made VALUE={printer["gcode_macro RECOVER_EXTRUSION_BY_PRIME"].checks_made + 1} From 183c3c532934586ae2fe3de946c9b01f41d42add Mon Sep 17 00:00:00 2001 From: sokolovjek Date: Wed, 17 May 2023 08:38:45 +0100 Subject: [PATCH 2/3] STEAPP-479: added statuses. --- klippy/extras/auto_wcs.py | 69 +------------- stereotech_config/probe.cfg | 170 ++++------------------------------ stereotech_config/probe_2.cfg | 165 ++++----------------------------- 3 files changed, 36 insertions(+), 368 deletions(-) diff --git a/klippy/extras/auto_wcs.py b/klippy/extras/auto_wcs.py index a238fde7ad0f..c7f6ddb443f6 100644 --- a/klippy/extras/auto_wcs.py +++ b/klippy/extras/auto_wcs.py @@ -25,14 +25,8 @@ def __init__(self, config): [0., 0., 0.], [0., 0., 0.] ] - self.probe_backlash_x = 0. - self.probe_backlash_y = 0. - self.probe_backlash_y_2 = 0. - self.tooling_radius = 0. - self.tooling_radius_2 = 0. self.adjust_angle = 10 / RAD_TO_DEG self.gcode = self.printer.lookup_object('gcode') - self.printer.register_event_handler("klippy:ready", self._handle_ready) self.gcode.register_command( 'SAVE_WCS_CALC_POINT', self.cmd_SAVE_WCS_CALC_POINT, desc=self.cmd_SAVE_WCS_CALC_POINT_help) @@ -42,15 +36,6 @@ def __init__(self, config): self.gcode.register_command( 'SET_AUTO_WCS', self.cmd_SET_AUTO_WCS, desc=self.cmd_CALC_WCS_PARAMS_help) - self.gcode.register_command( - 'GET_RADIUS_TOOLING', self.cmd_GET_RADIUS_TOOLING, - desc=self.cmd_GET_RADIUS_TOOLING_help) - - def _handle_ready(self): - save_variables = self.printer.lookup_object('save_variables') - self.probe_backlash_x = save_variables.allVariables.get('probe_backlash_x', 0.) - self.probe_backlash_y = save_variables.allVariables.get('probe_backlash_y', 0.) - self.probe_backlash_y_2 = save_variables.allVariables.get('probe_backlash_y_2', 0.) def _calc_wcs_old_sensor(self, thickness, adj, gcmd): thickness = thickness / 2.0 @@ -95,53 +80,10 @@ def _calc_wcs_2_new_sensor(self, thickness, adj, gcmd): thickness = thickness / 2. len_thickness = 10. x = (self.point_coords[8][0] + self.point_coords[9][0]) / 2. - y = ((self.point_coords[5][1] + self.point_coords[6][1]) / 2.) - thickness + y = (self.point_coords[5][1] + self.point_coords[6][1]) / 2. - thickness z = self.point_coords[4][2] - (len_thickness - adj) return x, y, z - def calculate_probe_backlash(self, x1, y1, y2): - self.probe_backlash_x = abs(self.point_coords[3][0] - (x1 + 55)) - self.probe_backlash_y = abs(self.point_coords[5][1] - y2) - self.probe_backlash_y_2 = abs(self.point_coords[1][1] - (y1 - 5)) - - def cmd_GET_RADIUS_TOOLING(self, gcmd): - x1, y1 = self.point_coords[1][0] + self.probe_backlash_x, self.point_coords[1][1] - x2, y2 = self.point_coords[0][0], self.point_coords[0][1] + self.probe_backlash_y - x3, y3 = self.point_coords[2][0] - self.probe_backlash_x, self.point_coords[2][1] - c = (x1-x2)**2 + (y1-y2)**2 - a = (x2-x3)**2 + (y2-y3)**2 - b = (x3-x1)**2 + (y3-y1)**2 - s = 2*(a*b + b*c + c*a) - (a*a + b*b + c*c) - px = (a*(b+c-a)*x1 + b*(c+a-b)*x2 + c*(a+b-c)*x3) / s - py = (a*(b+c-a)*y1 + b*(c+a-b)*y2 + c*(a+b-c)*y3) / s - ar = a**0.5 - br = b**0.5 - cr = c**0.5 - r = ar*br*cr / ((ar+br+cr)*(-ar+br+cr)*(ar-br+cr)*(ar+br-cr))**0.5 - self.tooling_radius = r - gcmd.respond_info('radius_tooling_1= %s, centr_tool(%s;%s)' % (self.tooling_radius, px, py)) - self.get_radius_2(gcmd) - return px, py, r - cmd_GET_RADIUS_TOOLING_help = "command for get the tooling radius from measuring points." - - def get_radius_2(self, gcmd): - x1, y1 = self.point_coords[1][0] + self.probe_backlash_x, self.point_coords[1][1] - x2, y2 = self.point_coords[0][0], self.point_coords[0][1] + self.probe_backlash_y_2 - x3, y3 = self.point_coords[2][0] - self.probe_backlash_x, self.point_coords[2][1] - c = (x1-x2)**2 + (y1-y2)**2 - a = (x2-x3)**2 + (y2-y3)**2 - b = (x3-x1)**2 + (y3-y1)**2 - s = 2*(a*b + b*c + c*a) - (a*a + b*b + c*c) - px = (a*(b+c-a)*x1 + b*(c+a-b)*x2 + c*(a+b-c)*x3) / s - py = (a*(b+c-a)*y1 + b*(c+a-b)*y2 + c*(a+b-c)*y3) / s - ar = a**0.5 - br = b**0.5 - cr = c**0.5 - r = ar*br*cr / ((ar+br+cr)*(-ar+br+cr)*(ar-br+cr)*(ar+br-cr))**0.5 - self.tooling_radius_2 = r - gcmd.respond_info('radius_tooling_2= %s, centr_tool(%s;%s)' % (self.tooling_radius_2, px, py)) - return px, py, r - def cmd_SAVE_WCS_CALC_POINT(self, gcmd): point_idx = gcmd.get_int('POINT', 0) coords = gcmd.get('COORDS', None) @@ -160,6 +102,7 @@ def cmd_SAVE_WCS_CALC_POINT(self, gcmd): cmd_SAVE_WCS_CALC_POINT_help = "Save point for WCS calculation" + def cmd_CALC_WCS_PARAMS(self, gcmd): #todo: get thickness default 10 thickness = gcmd.get_float('THICKNESS', 10.) @@ -168,7 +111,6 @@ def cmd_CALC_WCS_PARAMS(self, gcmd): if sensor_version: x, y, z = self._calc_wcs_new_sensor(thickness, adjustment_coeff, gcmd) x2, y2, z2 = self._calc_wcs_2_new_sensor(thickness, adjustment_coeff, gcmd) - self.calculate_probe_backlash(x, y, y2) delta_y = y - y2 delta_z = z - z2 avg_delta = (delta_y + delta_z) / 2.0 @@ -206,12 +148,7 @@ def cmd_SET_AUTO_WCS(self, gcmd): def get_status(self, eventtime=None): return { - "wcs": self.wcs, - "probe_backlash_x": self.probe_backlash_x, - "probe_backlash_y": self.probe_backlash_y, - "probe_backlash_y_2": self.probe_backlash_y_2, - 'tooling_radius': self.tooling_radius, - 'tooling_radius_2': self.tooling_radius_2 + "wcs": self.wcs } def load_config(config): diff --git a/stereotech_config/probe.cfg b/stereotech_config/probe.cfg index 9dc4905d2f7e..10e0484f9260 100644 --- a/stereotech_config/probe.cfg +++ b/stereotech_config/probe.cfg @@ -334,19 +334,19 @@ gcode: SET_A_OFFSET_POINT POINT=1 CALC_A_AXIS_OFFSET - ;PROBE_TEMPLATE_POINT POINT=CZ - ;SET_B_COMPENSATION_POINT POINT=0 - ;PROBE_TEMPLATE_POINT POINT=CZ1 - ;SET_B_COMPENSATION_POINT POINT=1 - ;PROBE_TEMPLATE_POINT POINT=AZ - ;SET_B_COMPENSATION_POINT POINT=2 - ;PROBE_TEMPLATE_POINT POINT=BZ - ;SET_B_COMPENSATION_POINT POINT=3 - ;PROBE_TEMPLATE_POINT POINT=AX - ;SET_B_COMPENSATION_POINT POINT=4 - ;PROBE_TEMPLATE_POINT POINT=BX - ;SET_B_COMPENSATION_POINT POINT=5 - ;CALC_B_AXIS_COMPENSATION ENABLE=0 + PROBE_TEMPLATE_POINT POINT=CZ + SET_B_COMPENSATION_POINT POINT=0 + PROBE_TEMPLATE_POINT POINT=CZ1 + SET_B_COMPENSATION_POINT POINT=1 + PROBE_TEMPLATE_POINT POINT=AZ + SET_B_COMPENSATION_POINT POINT=2 + PROBE_TEMPLATE_POINT POINT=BZ + SET_B_COMPENSATION_POINT POINT=3 + PROBE_TEMPLATE_POINT POINT=AX + SET_B_COMPENSATION_POINT POINT=4 + PROBE_TEMPLATE_POINT POINT=BX + SET_B_COMPENSATION_POINT POINT=5 + CALC_B_AXIS_COMPENSATION ENABLE=0 ; skew corection ; xy skew @@ -546,8 +546,6 @@ gcode: {% set template_thickness = printer.save_variables.variables.template_thickness|default(10.0)|float %} {% set auto_wcs_adj = printer.save_variables.variables.auto_wcs_adj|default(0.3)|float %} CALC_WCS_PARAMS THICKNESS={ template_thickness } ADJUSTMENT={ auto_wcs_adj } SENSOR_VERSION={probe_sensor_version} - SAVE_PROBE_BACKLASH - PROBE_TEMPLATE_POINT POINT=AY SET_C_ALIGN_POINT POINT=0 PROBE_TEMPLATE_POINT POINT=BY @@ -556,19 +554,6 @@ gcode: MOVE_TO_AUTO_WCS {% endif %} -[gcode_macro SAVE_PROBE_BACKLASH] -description: this macros save the sensor backlash. -gcode: - {% set probe_backlash_x = printer.auto_wcs.probe_backlash_x %} - {% set probe_backlash_y = printer.auto_wcs.probe_backlash_y %} - {% set probe_backlash_y_2 = printer.auto_wcs.probe_backlash_y_2 %} - SAVE_VARIABLE VARIABLE=probe_backlash_x VALUE={probe_backlash_x} - SAVE_VARIABLE VARIABLE=probe_backlash_y VALUE={probe_backlash_y} - SAVE_VARIABLE VARIABLE=probe_backlash_y_2 VALUE={probe_backlash_y_2} - {action_respond_info('save probe_backlash_x=%s' % probe_backlash_x)} - {action_respond_info('save probe_backlash_y=%s' % probe_backlash_y)} - {action_respond_info('save probe_backlash_y_2=%s' % probe_backlash_y_2)} - [gcode_macro MOVE_TO_AUTO_WCS] gcode: {% set set_xy = params.XY|default(0) %} @@ -603,6 +588,7 @@ gcode: {% endif %} {% endif %} + [gcode_macro ADJUST_PROBE_OFFSET_XY] gcode: {% if printer["gcode_button five_axis_module"].state == "PRESSED" %} @@ -649,29 +635,15 @@ gcode: {% endif %} [gcode_macro AUTO_BASEMENT_WCS] -description: This macro performs move based on the required measuring(wcs1_z, wcs2_y, wcs2_z), and takes measurements. gcode: {% set wcs = params.WCS|default(0)|int %} {% if wcs == 0 %} - ; move for measuring wcs_1_z - AUTO_BASEMENT_WCS_ONE_Z_MOVE - PROBE - {% elif wcs == 2 %} - ; move and probing for measuring the wcs_2_y - AUTO_BASEMENT_WCS_TWO_Y_MOVE - {% elif wcs == 3 %} - ; move and probing for measuring the tooling radius - {% for i in range(3) %} - AUTO_BASEMENT_MOVE_MEASURE_RADIUS PROBE={i} - {% endfor %} - GET_RADIUS_TOOLING - {% else %} - PROBE + AUTO_BASEMENT_WCS_MOVE {% endif %} + PROBE G0 Z150 F3600 -[gcode_macro AUTO_BASEMENT_WCS_ONE_Z_MOVE] -description: This macro does a move for measuring wcs_1_z. +[gcode_macro AUTO_BASEMENT_WCS_MOVE] gcode: {% set wcs = params.WCS|default(0)|int %} {% set offsets = printer.probe.offsets %} @@ -684,84 +656,7 @@ gcode: G0 Z150 F3600 G0 X{x} Y{y} F3600 -[gcode_macro AUTO_BASEMENT_WCS_TWO_Y_MOVE] -description: This macro does a move for measuring wcs_2_y. -gcode: - {% set offsets = printer.probe.offsets %} - {% set wcs_offsets = printer.gcode_move.wcs_offsets[2] %} - {% set radius = printer.auto_wcs.tooling_radius|float %} - {% set x = wcs_offsets[0] - offsets[0] %} - {% set y = wcs_offsets[1] - offsets[1] %} - {% set z = wcs_offsets[2] + offsets[2] %} - G0 A90 F3600 - G0 X{x} Y{y - 20} F3600 - {% if radius > 3.0 %} - G0 Z{z + (radius - 3) } F3600 - {% else %} - G0 Z{z - (radius / 2)} F3600 - {% endif %} - PROBE AXIS=y POSITIVE_DIR=1 - G0 X{x} Y{y - 10} F3600 - -[gcode_macro AUTO_BASEMENT_MOVE_MEASURE_RADIUS] -description: measuring radius for geting wcs_2_z. -gcode: - {% set probe = params.PROBE|default(0)|int %} - {% set offsets = printer.probe.offsets %} - {% set wcs_offsets = printer.gcode_move.wcs_offsets[1] %} - {% set point = printer.probe.last_result %} - {% set x = wcs_offsets[0] - offsets[0] %} - {% set y = wcs_offsets[1] - offsets[1] %} - {% set z = wcs_offsets[2] + offsets[2] %} - G0 A0 F3600 - {% if probe == 0 %} - G0 X{x} Y{y - 60} F3600 - G0 Z{z - 5} F3600 - PROBE AXIS=y POSITIVE_DIR=1 - G0 X{x} Y{y - 60} F3600 - {% elif probe == 1 %} - {% set advance_radius = y - point[1] %} - G0 X{x - (advance_radius + 10)} Y{y} F3600 - G0 Z{z - 5} F3600 - PROBE AXIS=x POSITIVE_DIR=1 - G0 X{x - (advance_radius + 10)} Y{y} F3600 - {% elif probe == 2 %} - {% set advance_radius = x - point[0] %} - G0 X{x + (advance_radius + 10)} Y{y} F3600 - G0 Z{z - 5} F3600 - PROBE AXIS=x POSITIVE_DIR=0 - G0 X{x + (advance_radius + 10)} Y{y} F3600 - {% endif %} - SET_AUTO_WCS_POINT_RADIUS POINT={probe} - G0 Z{z + 10} F3600 - -[gcode_macro SET_AUTO_WCS_POINT_RADIUS] -description: This macro is for saving the points required for calculating the radius. -gcode: - {% set point = printer.probe.last_result %} - {% set index = params.POINT|default(0) %} - {% set x = point[0] %} - {% set y = point[1] %} - {% set z = point[2] %} - SAVE_WCS_CALC_POINT POINT={index} COORDS='{x},{y},{z}' - -[gcode_macro AUTO_BASEMENT_WCS_TWO_Z_MOVE] -description: This macro does a move for measuring wcs_2_z. -gcode: - {% set offsets = printer.probe.offsets %} - {% set wcs_offsets = printer.gcode_move.wcs_offsets[2] %} - {% set radius = printer.auto_wcs.tooling_radius %} - {% set x = wcs_offsets[0] - offsets[0] %} - {% set y = wcs_offsets[1] - offsets[1] %} - {% set z = wcs_offsets[2] + offsets[2] %} - G0 A90 F3600 - G0 X{x} Y{y + 5} F3600 - G0 Z{z + (radius + 10)} F3600 - PROBE - G0 Z150 F3600 - [gcode_macro ADJUST_BASEMENT_WCS] -description: macro needed for set wcs based selected mode the manager calibrate. gcode: {% set wcs = params.WCS|default(0)|int %} {% set point = printer.probe.last_result %} @@ -773,41 +668,10 @@ gcode: {% set wcs_1 = printer.gcode_move.wcs_offsets[4] %} {% set old_z = wcs_0[2] %} {% set old_y = wcs_1[1] %} - {% set probe_sensor_version = printer.save_variables.variables.probe_sensor_version|default(0)|int %} - {% set template_thickness = printer.save_variables.variables.template_thickness|default(10.0)|float %} {% if wcs == 0 %} - ; apply measuring for the set wcs_1_z and wcs_2_y. Mode SPIRAL-FULL G10 L2 P2 Z{z} G10 L2 P3 Y{old_y - (z - old_z)} - {% if probe_sensor_version %} - {% set tool_length = z - old_z + template_thickness %} - {action_respond_info('tool_length=%s' % tool_length)} - {% if tool_length > 35.0 %} - ; move for measure wcs_2_y - AUTO_BASEMENT_WCS WCS=2 - ;apply measuring for the set wcs_2_y - SET_WCS_TWO_Y - ; moving for measure radius the tool - AUTO_BASEMENT_WCS WCS=3 - {% else %} - {action_raise_error("Tool length not enough for calculate wcs_2_y!")} - {% endif %} - {% endif %} {% elif wcs == 1 %} - ; apply measuring for the set wcs_2_y and wcs_1_z(raw). Mode SPIRAL G10 L2 P3 Y{y} G10 L2 P2 Z{old_z - (y - old_y)} - {% elif wcs == 2 %} - ; {% set radius = printer.auto_wcs.tooling_radius %} - ; apply measuring for the set wcs_2_z radius. - ; G10 L2 P3 Z{z - radius} {% endif %} - -[gcode_macro SET_WCS_TWO_Y] -description: macro needed for set wcs_2_y -gcode: - {% set point = printer.probe.last_result %} - {% set offsets = printer.probe.offsets %} - {% set y = point[1] + offsets[1] - printer.gcode_move.homing_origin.y %} - {% set probe_backlash_y = printer.save_variables.variables.probe_backlash_y|default(0.0)|float %} - G10 L2 P3 Y{y + probe_backlash_y} diff --git a/stereotech_config/probe_2.cfg b/stereotech_config/probe_2.cfg index 2e1317a9b5c4..2c8f8a218d7f 100644 --- a/stereotech_config/probe_2.cfg +++ b/stereotech_config/probe_2.cfg @@ -333,19 +333,19 @@ gcode: SET_A_OFFSET_POINT POINT=1 CALC_A_AXIS_OFFSET - ;PROBE_TEMPLATE_POINT POINT=CZ - ;SET_B_COMPENSATION_POINT POINT=0 - ;PROBE_TEMPLATE_POINT POINT=CZ1 - ;SET_B_COMPENSATION_POINT POINT=1 - ;PROBE_TEMPLATE_POINT POINT=AZ - ;SET_B_COMPENSATION_POINT POINT=2 - ;PROBE_TEMPLATE_POINT POINT=BZ - ;SET_B_COMPENSATION_POINT POINT=3 - ;PROBE_TEMPLATE_POINT POINT=AX - ;SET_B_COMPENSATION_POINT POINT=4 - ;PROBE_TEMPLATE_POINT POINT=BX - ;SET_B_COMPENSATION_POINT POINT=5 - ;CALC_B_AXIS_COMPENSATION ENABLE=0 + PROBE_TEMPLATE_POINT POINT=CZ + SET_B_COMPENSATION_POINT POINT=0 + PROBE_TEMPLATE_POINT POINT=CZ1 + SET_B_COMPENSATION_POINT POINT=1 + PROBE_TEMPLATE_POINT POINT=AZ + SET_B_COMPENSATION_POINT POINT=2 + PROBE_TEMPLATE_POINT POINT=BZ + SET_B_COMPENSATION_POINT POINT=3 + PROBE_TEMPLATE_POINT POINT=AX + SET_B_COMPENSATION_POINT POINT=4 + PROBE_TEMPLATE_POINT POINT=BX + SET_B_COMPENSATION_POINT POINT=5 + CALC_B_AXIS_COMPENSATION ENABLE=0 ; skew corection ; xy skew @@ -539,7 +539,6 @@ gcode: {% set template_thickness = printer.save_variables.variables.template_thickness|default(10.0)|float %} {% set auto_wcs_adj = printer.save_variables.variables.auto_wcs_adj|default(0.3)|float %} CALC_WCS_PARAMS THICKNESS={ template_thickness } ADJUSTMENT={ auto_wcs_adj } SENSOR_VERSION=1 - SAVE_PROBE_BACKLASH PROBE_TEMPLATE_POINT POINT=AY SET_C_ALIGN_POINT POINT=0 PROBE_TEMPLATE_POINT POINT=BY @@ -548,19 +547,6 @@ gcode: MOVE_TO_AUTO_WCS {% endif %} -[gcode_macro SAVE_PROBE_BACKLASH] -description: this macros save the sensor backlash. -gcode: - {% set probe_backlash_x = printer.auto_wcs.probe_backlash_x %} - {% set probe_backlash_y = printer.auto_wcs.probe_backlash_y %} - {% set probe_backlash_y_2 = printer.auto_wcs.probe_backlash_y_2 %} - SAVE_VARIABLE VARIABLE=probe_backlash_x VALUE={probe_backlash_x} - SAVE_VARIABLE VARIABLE=probe_backlash_y VALUE={probe_backlash_y} - SAVE_VARIABLE VARIABLE=probe_backlash_y_2 VALUE={probe_backlash_y_2} - {action_respond_info('probe_backlash_x=%s' % probe_backlash_x)} - {action_respond_info('probe_backlash_y=%s' % probe_backlash_y)} - {action_respond_info('probe_backlash_y_2=%s' % probe_backlash_y_2)} - [gcode_macro MOVE_TO_AUTO_WCS] gcode: {% set set_xy = params.XY|default(0) %} @@ -642,29 +628,15 @@ gcode: {% endif %} [gcode_macro AUTO_BASEMENT_WCS] -description: This macro performs move based on the required measuring(wcs1_z, wcs2_y, wcs2_z), and takes measurements. gcode: {% set wcs = params.WCS|default(0)|int %} {% if wcs == 0 %} - ; move for measuring wcs_1_z - AUTO_BASEMENT_WCS_ONE_Z_MOVE - PROBE - {% elif wcs == 2 %} - ; move and probing for measuring the wcs_2_y - AUTO_BASEMENT_WCS_TWO_Y_MOVE - {% elif wcs == 3 %} - ; move and probing for measuring the tooling radius - {% for i in range(3) %} - AUTO_BASEMENT_MOVE_MEASURE_RADIUS PROBE={i} - {% endfor %} - GET_RADIUS_TOOLING - {% else %} - PROBE + AUTO_BASEMENT_WCS_MOVE {% endif %} + PROBE G0 Z150 F3600 -[gcode_macro AUTO_BASEMENT_WCS_ONE_Z_MOVE] -description: This macro does a move for measuring wcs_1_z. +[gcode_macro AUTO_BASEMENT_WCS_MOVE] gcode: {% set wcs = params.WCS|default(0)|int %} {% set offsets = printer.probe.offsets %} @@ -677,84 +649,7 @@ gcode: G0 Z150 F3600 G0 X{x} Y{y} F3600 -[gcode_macro AUTO_BASEMENT_WCS_TWO_Y_MOVE] -description: This macro does a move for measuring wcs_2_y. -gcode: - {% set offsets = printer.probe.offsets %} - {% set wcs_offsets = printer.gcode_move.wcs_offsets[2] %} - {% set radius = printer.auto_wcs.tooling_radius|float %} - {% set x = wcs_offsets[0] - offsets[0] %} - {% set y = wcs_offsets[1] - offsets[1] %} - {% set z = wcs_offsets[2] + offsets[2] %} - G0 A90 F3600 - G0 X{x} Y{y - 20} F3600 - {% if radius > 3.0 %} - G0 Z{z + (radius - 3) } F3600 - {% else %} - G0 Z{z - (radius / 2)} F3600 - {% endif %} - PROBE AXIS=y POSITIVE_DIR=1 - G0 X{x} Y{y - 10} F3600 - -[gcode_macro AUTO_BASEMENT_MOVE_MEASURE_RADIUS] -description: measuring radius for geting wcs_2_z. -gcode: - {% set probe = params.PROBE|default(0)|int %} - {% set offsets = printer.probe.offsets %} - {% set wcs_offsets = printer.gcode_move.wcs_offsets[1] %} - {% set point = printer.probe.last_result %} - {% set x = wcs_offsets[0] - offsets[0] %} - {% set y = wcs_offsets[1] - offsets[1] %} - {% set z = wcs_offsets[2] + offsets[2] %} - G0 A0 F3600 - {% if probe == 0 %} - G0 X{x} Y{y - 60} F3600 - G0 Z{z - 5} F3600 - PROBE AXIS=y POSITIVE_DIR=1 - G0 X{x} Y{y - 60} F3600 - {% elif probe == 1 %} - {% set advance_radius = y - point[1] %} - G0 X{x - (advance_radius + 10)} Y{y} F3600 - G0 Z{z - 5} F3600 - PROBE AXIS=x POSITIVE_DIR=1 - G0 X{x - (advance_radius + 10)} Y{y} F3600 - {% elif probe == 2 %} - {% set advance_radius = x - point[0] %} - G0 X{x + (advance_radius + 10)} Y{y} F3600 - G0 Z{z - 5} F3600 - PROBE AXIS=x POSITIVE_DIR=0 - G0 X{x + (advance_radius + 10)} Y{y} F3600 - {% endif %} - SET_AUTO_WCS_POINT_RADIUS POINT={probe} - G0 Z{z + 10} F3600 - -[gcode_macro SET_AUTO_WCS_POINT_RADIUS] -description: This macro is for saving the points required for calculating the radius. -gcode: - {% set point = printer.probe.last_result %} - {% set index = params.POINT|default(0) %} - {% set x = point[0] %} - {% set y = point[1] %} - {% set z = point[2] %} - SAVE_WCS_CALC_POINT POINT={index} COORDS='{x},{y},{z}' - -[gcode_macro AUTO_BASEMENT_WCS_TWO_Z_MOVE] -description: This macro does a move for measuring wcs_2_z. -gcode: - {% set offsets = printer.probe.offsets %} - {% set wcs_offsets = printer.gcode_move.wcs_offsets[2] %} - {% set radius = printer.auto_wcs.tooling_radius %} - {% set x = wcs_offsets[0] - offsets[0] %} - {% set y = wcs_offsets[1] - offsets[1] %} - {% set z = wcs_offsets[2] + offsets[2] %} - G0 A90 F3600 - G0 X{x} Y{y + 5} F3600 - G0 Z{z + (radius + 10)} F3600 - PROBE - G0 Z150 F3600 - [gcode_macro ADJUST_BASEMENT_WCS] -description: macro needed for set wcs based selected mode the manager calibrate. gcode: {% set wcs = params.WCS|default(0)|int %} {% set point = printer.probe.last_result %} @@ -766,38 +661,10 @@ gcode: {% set wcs_1 = printer.gcode_move.wcs_offsets[4] %} {% set old_z = wcs_0[2] %} {% set old_y = wcs_1[1] %} - {% set template_thickness = printer.save_variables.variables.template_thickness|default(10.0)|float %} {% if wcs == 0 %} - ; apply measuring for the set wcs_1_z and wcs_2_y. Mode SPIRAL-FULL G10 L2 P2 Z{z} G10 L2 P3 Y{old_y - (z - old_z)} - {% set tool_length = z - old_z + template_thickness %} - {action_respond_info('tool_length=%s' % tool_length)} - {% if tool_length > 35.0 %} - ; move for measure wcs_2_y - AUTO_BASEMENT_WCS WCS=2 - ;apply measuring for the set wcs_2_y - SET_WCS_TWO_Y - ; moving for measure radius the tool - AUTO_BASEMENT_WCS WCS=3 - {% else %} - {action_raise_error("Tool length not enough for calculate wcs_2_y!")} - {% endif %} {% elif wcs == 1 %} - ; apply measuring for the set wcs_2_y and wcs_1_z(raw). Mode SPIRAL G10 L2 P3 Y{y} G10 L2 P2 Z{old_z - (y - old_y)} - {% elif wcs == 2 %} - ; {% set radius = printer.auto_wcs.tooling_radius %} - ; apply measuring for the set wcs_2_z radius. - ; G10 L2 P3 Z{z - radius} {% endif %} - -[gcode_macro SET_WCS_TWO_Y] -description: macro needed for set wcs_2_y -gcode: - {% set point = printer.probe.last_result %} - {% set offsets = printer.probe.offsets %} - {% set y = point[1] + offsets[1] - printer.gcode_move.homing_origin.y %} - {% set probe_backlash_y = printer.save_variables.variables.probe_backlash_y|default(0.0)|float %} - G10 L2 P3 Y{y + probe_backlash_y} From 169aae49cf80b1b84c681fcd17bcf201c4cd3250 Mon Sep 17 00:00:00 2001 From: sokolovjek Date: Wed, 17 May 2023 08:40:00 +0100 Subject: [PATCH 3/3] STEAPP-479: added statuses. --- stereotech_config/filament_control_2.cfg | 7 ------- 1 file changed, 7 deletions(-) diff --git a/stereotech_config/filament_control_2.cfg b/stereotech_config/filament_control_2.cfg index ced2efbc096b..f12292e2e7b1 100644 --- a/stereotech_config/filament_control_2.cfg +++ b/stereotech_config/filament_control_2.cfg @@ -176,10 +176,3 @@ gcode: SET_GCODE_VARIABLE MACRO=PAUSE VARIABLE=extruder_temp VALUE=0 RESUME {% endif %} - - - -[gcode_macro MY] -gcode: - M117 try_do_extrude{printer["gcode_macro RECOVER_EXTRUSION_BY_PRIME"].checks_made + 1} - SET_GCODE_VARIABLE MACRO=RECOVER_EXTRUSION_BY_PRIME VARIABLE=checks_made VALUE={printer["gcode_macro RECOVER_EXTRUSION_BY_PRIME"].checks_made + 1}