From 27d83ef7bd439f0c939bcc96c7c40fc72a597b81 Mon Sep 17 00:00:00 2001 From: sokolovjek Date: Fri, 12 Jan 2024 08:56:47 +0000 Subject: [PATCH 1/3] STEAPP-851: disabled rotate the axis A before parcing --- stereotech_config/750/homing_override.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stereotech_config/750/homing_override.cfg b/stereotech_config/750/homing_override.cfg index 6939579e6651..f1ed1f127f4f 100644 --- a/stereotech_config/750/homing_override.cfg +++ b/stereotech_config/750/homing_override.cfg @@ -1,5 +1,5 @@ [homing_override] -rotate_a: true +rotate_a: false axes: gcode: G28 Z From c38129092b6eb5388fb259690e4849f374d09f15 Mon Sep 17 00:00:00 2001 From: sokolovjek Date: Fri, 12 Jan 2024 14:43:47 +0000 Subject: [PATCH 2/3] STEAPP-851: Made changes to the auto-calibration algorithm in the configuration of the 750th printer --- HTE750-0-0-23.cfg | 17 +- stereotech_config/750/calibrate/probe_3d.cfg | 29 +++ stereotech_config/750/calibrate/probe_5d.cfg | 200 ++++++++++++++++++ .../750/calibrate/probe_5d_template.cfg | 161 ++++++++++++++ .../750/calibrate/probe_5d_tool.cfg | 184 ++++++++++++++++ stereotech_config/750/calibrate/probe_750.cfg | 93 ++++++++ stereotech_config/750/calibrate/probe_v3.cfg | 151 +++++++++++++ 7 files changed, 830 insertions(+), 5 deletions(-) create mode 100644 stereotech_config/750/calibrate/probe_3d.cfg create mode 100644 stereotech_config/750/calibrate/probe_5d.cfg create mode 100644 stereotech_config/750/calibrate/probe_5d_template.cfg create mode 100644 stereotech_config/750/calibrate/probe_5d_tool.cfg create mode 100644 stereotech_config/750/calibrate/probe_750.cfg create mode 100644 stereotech_config/750/calibrate/probe_v3.cfg diff --git a/HTE750-0-0-23.cfg b/HTE750-0-0-23.cfg index 6a7378d7f198..b2718f56a430 100644 --- a/HTE750-0-0-23.cfg +++ b/HTE750-0-0-23.cfg @@ -35,8 +35,16 @@ path: /home/ste/uploads [include stereotech_config/750/module_3d_macros.cfg] [include stereotech_config/750/module_5d.cfg] -[include stereotech_config/750/probe_main.cfg] -[include stereotech_config/750/probe_v3.cfg] +# [include stereotech_config/750/probe_main.cfg] +# [include stereotech_config/750/probe_v3.cfg] + +# sections probe +[include stereotech_config/750/calibrate/probe_750.cfg] +[include stereotech_config/750/calibrate/probe_3d.cfg] +[include stereotech_config/750/calibrate/probe_5d.cfg] +[include stereotech_config/750/calibrate/probe_5d_tool.cfg] +[include stereotech_config/750/calibrate/probe_5d_template.cfg] +[include stereotech_config/750/calibrate/probe_v3.cfg] [include stereotech_config/750/print_macros.cfg] [include stereotech_config/common/variables.cfg] @@ -44,9 +52,8 @@ path: /home/ste/uploads [gcode_macro CONSTANTS] description: Holds printer constants -variable_probe_a_horizontal: 301, 328, 57 -# variable_probe_a_vertical: 301, 328, 107 -variable_probe_a_vertical: 301, 328, 57 +variable_probe_a_horizontal: 303, 329, 57 +variable_probe_a_vertical: 303, 325, 55 variable_offsets_sensor: -60, -6, 29.0 variable_extruder_load_length: 210 variable_extruder1_load_length: 1650 diff --git a/stereotech_config/750/calibrate/probe_3d.cfg b/stereotech_config/750/calibrate/probe_3d.cfg new file mode 100644 index 000000000000..37631e217334 --- /dev/null +++ b/stereotech_config/750/calibrate/probe_3d.cfg @@ -0,0 +1,29 @@ +[gcode_macro CALIBRATE_MODULE_THREE_D] +description: 3D module calibration +gcode: + {% if printer["gcode_button five_axis_module"].state == "RELEASED" %} + {% set axis_max = printer.toolhead.axis_maximum %} + {% set offsets = printer.probe.offsets %} + {% set center_probe_x = (axis_max[0] / 2.0) - offsets[0] %} + {% set center_probe_y = (axis_max[1] / 2.0) - offsets[1] %} + G0 X{center_probe_x} Y{center_probe_y} F6000 + G0 Z40 F3600 + PROBE + G91 + G0 Z30 F3600 + G90 + MODULE_THREE_D_MESH_CALIBRATE + G91 + G0 Z30 F3600 + G90 + G0 X{center_probe_x + offsets[0]} Y50 F3600 + {% endif %} + +[gcode_macro MODULE_THREE_D_MESH_CALIBRATE] +description: 3D module calibration +gcode: + {% if printer["gcode_button five_axis_module"].state == "RELEASED" %} + Z_OFFSET_APPLY_PROBE Z={printer.probe.last_result[2]} + BED_MESH_CALIBRATE PROFILE=module_3d + BED_MESH_CLEAR + {% endif %} diff --git a/stereotech_config/750/calibrate/probe_5d.cfg b/stereotech_config/750/calibrate/probe_5d.cfg new file mode 100644 index 000000000000..6feb294c4832 --- /dev/null +++ b/stereotech_config/750/calibrate/probe_5d.cfg @@ -0,0 +1,200 @@ +[gcode_macro PROBE_TEMPLATE_POINT] +description: Macro for calibration template probing +variable_a_probe_z: 0.0 +variable_a_v_probe_z: 0.0 +gcode: + {% set point = params.POINT|default('A_Z') %} + {% set offsets = printer.probe.offsets %} + {% set probe_a_horizontal = printer["gcode_macro CONSTANTS"].probe_a_horizontal %} + {% set probe_a_vertical = printer["gcode_macro CONSTANTS"].probe_a_vertical %} + {% set whitelist = ['A_Z', 'B_Z', 'C_Y', 'D_Y'] %} + {% set a_z = printer['gcode_macro PROBE_TEMPLATE_POINT'].a_probe_z if printer['gcode_macro PROBE_TEMPLATE_POINT'].a_probe_z > 0 else probe_a_horizontal[2] + offsets[2] %} + {% set a_v_z = printer['gcode_macro PROBE_TEMPLATE_POINT'].a_v_probe_z if printer['gcode_macro PROBE_TEMPLATE_POINT'].a_v_probe_z > 0 else probe_a_vertical[2] + offsets[2] %} + {% set a = [probe_a_horizontal[0] - offsets[0], probe_a_horizontal[1] - offsets[1], a_z] %} + {% set a_v = [probe_a_vertical[0] - offsets[0], probe_a_vertical[1] - offsets[1], a_v_z] %} + {% set max_y = printer.toolhead.axis_maximum[1]|float %} + #{% set whitelist = ['A_Z', 'A_Z_A0', 'A_Z_A90', 'A_X', 'A_Y', 'A_MX', 'A_MY', 'A_Z_A90', 'A_X_A90', 'A_MX_A90'] %} + #{% if point in whitelist %} + {% if point.split('_')|length == 4 %} + {% set p, ax, a_deg, c_deg = point.split('_') %} + {% elif point.split('_')|length == 3 %} + {% set p, ax, a_deg = point.split('_') %} + {% set c_deg = 'C0' %} + {% else %} + {% set p, ax = point.split('_') %} + {% set a_deg = 'A0' %} + {% set c_deg = 'C0' %} + {% endif %} + {% set target_x = a_v[0] if a_deg == 'A90' else a[0] %} + {% set target_y = a_v[1] if a_deg == 'A90' else a[1] %} + {% set target_z = a_v[2] if a_deg == 'A90' else a[2] %} + {% set target_a = a_deg[1:]|float %} + {% set target_c = c_deg[1:]|float %} + {% set safe_distance_z = (probe_a_vertical[2] + 70 + offsets[2]) if a_deg == 'A90' else (probe_a_horizontal[2] + 20 + offsets[2]) %} + {% set axis = ax[-1] %} + {% set positive = 0 if (ax[0] == 'M' or ax[0] == 'Z') else 1 %} + + {% if p == 'A' and target_a == 0.0 %} + {% set target_y = target_y - 4 %} + {% elif p == 'B' %} + {% if target_a == 0.0 and target_c == 0.0 %} + {% set target_y = target_y - 55 %} + {% elif target_a == 0.0 and target_c == 30.0 %} + {% set target_x = target_x - 50 %} + {% elif target_a == 0.0 and target_c == 15.0 %} + {% set target_x = target_x - 35 %} + {% set target_y = target_y - 35 %} + {% elif target_a == 90.0 and target_c == 60.0 %} + {% set target_z = target_z + 50 %} + {% endif %} + {% elif p == 'C' %} + {% set target_x = target_x - 50 %} + {% set target_y = target_y - 4 %} + {% elif p == 'D' %} + {% set target_x = target_x + 50 %} + {% set target_y = target_y - 4 %} + {% endif %} + + {% if ax != 'Z' %} + {% set target_z = target_z - 6 %} + {% else %} + {% set target_z = target_z + 20 %} + {% endif %} + + {% if ax == 'X' %} + {% set target_x = target_x - 20 %} + {% set axis = 'X' %} + {% elif ax == 'MX' %} + {% set target_x = target_x + 20 %} + {% set axis = 'X' %} + {% elif ax == 'Y' %} + {% set target_y = target_y - 20 %} + {% set axis = 'Y' %} + {% elif ax == 'MY' %} + {% set target_y = target_y + 20 %} + {% set axis = 'Y' %} + {% endif %} + #{% endif %} + {% if target_y|float > (max_y - 4.3) %} + {% set target_y = max_y - 5.5 %} + {% endif %} + G0 Z{safe_distance_z} F3600 + G0 A0 C0 F3600 + G0 A{target_a} C{target_c} F3600 + G0 X{target_x} Y{target_y} F3600 + G0 Z{target_z} F3600 + PROBE AXIS={axis} POSITIVE_DIR={positive} + G0 X{target_x} Y{target_y} F3600 + G0 Z{safe_distance_z} F3600 + G0 A0 C0 F3600 + +[gcode_macro PROBE_TOOL_POINT] +Description: This macro does movement and measurement relative to the tool. +gcode: + {% set point = params.POINT|default('A_Z') %} + {% set offsets = printer.probe.offsets %} + {% set wcs_1 = printer.gcode_move.wcs_offsets[1] %} + {% set wcs_2 = printer.gcode_move.wcs_offsets[2] %} + {% set wcs_4 = printer.gcode_move.wcs_offsets[4] %} + {% set a = [wcs_1[0] - offsets[0], wcs_1[1] - offsets[1], wcs_1[2] + offsets[2]] %} + {% set a_v = [wcs_2[0] - offsets[0], wcs_2[1] - offsets[1], wcs_2[2] + offsets[2]] %} + {% set max_z = printer.toolhead.axis_maximum[2]|float %} + {% set min_y = printer.toolhead.axis_minimum[1]|float %} + {% set radius = printer['gcode_macro CALC_TOOL_PARAMS'].radius|float %} + {% set tool_length = printer['gcode_macro CALC_TOOL_PARAMS'].length|float %} + {% if tool_length < 35.0 %} + {action_raise_error('208: Error, tool length not enough, less 35 mm')} + {% endif %} + #{% set whitelist = ['A_Z', 'A_X', 'A_Y', 'A_MX', 'A_MY', 'A_Z_A90', 'A_X_A90', 'A_MX_A90'] %} + #{% if point in whitelist %} + {% if point.split('_')|length == 4 %} + {% set p, ax, a_deg, c_deg = point.split('_') %} + {% elif point.split('_')|length == 3 %} + {% set p, ax, a_deg = point.split('_') %} + {% set c_deg = 'C0' %} + {% else %} + {% set p, ax = point.split('_') %} + {% set a_deg = 'A0' %} + {% set c_deg = 'C0' %} + {% endif %} + {% set a_z = a[2] if tool_length != 999.0 else (max_z / 3) * 2 %} + {% set a_v_y = a_v[1] if tool_length != 999.0 else min_y %} + {% set a_v_z = a_v[2] + radius if radius != 999.0 else (max_z / 2.0) %} + {% set target_x = a_v[0] if a_deg == 'A90' else a[0] %} + {% set target_y = a_v_y if a_deg == 'A90' else a[1] %} + {% set target_z = a_v_z if a_deg == 'A90' else a_z %} + {% set target_a = a_deg[1:]|float %} + {% set target_c = c_deg[1:]|float %} + {% set axis = ax[-1] %} + {% set positive = 0 if (ax[0] == 'M' or ax[0] == 'Z') else 1 %} + {% set safe_distance_z = a_v_z + 20 if a_deg == 'A90' else a_z + 20 %} + {% if p == 'A' %} + {% if target_a == 90.0 %} + {% set target_y = target_y + 2 %} + {% endif %} + {% elif p == 'B' %} + {% if target_a == 90.0 and ax == 'Z' %} + # {% set target_y = target_y + 25 %} + {% set target_y = ((wcs_4[1] + 10) - offsets[1]) - 20 %} + {% elif target_a == 90.0 %} + # {% set target_y = target_y + 25 %} + {% set target_y = (wcs_4[1] + 10 - offsets[1]) - 35 %} + {% endif %} + {% endif %} + {% if ax != 'Z' %} + {% set z = [radius, 10]|min %} + {% set target_z = target_z - 5 %} + {% elif ax == 'Z' and radius < 999.0 %} + {% set target_z = target_z + 20 %} + {% endif %} + {% if ax == 'X' %} + {% set target_x = target_x - (radius + 10) %} + {% elif ax == 'MX' %} + {% set target_x = target_x + (radius + 10) %} + {% elif ax == 'Y' %} + {% set target_y = (target_y - (radius + 10)) if target_a == 0.0 else (target_y - 20)%} + {% elif ax == 'MY' %} + {% set target_y = target_y + (radius + 10) %} + {% endif %} + #{% endif %} + {% if target_a == 90 and printer.toolhead.position[3]|float < 45.0 %} + G0 A{target_a} C{target_c} F3600 + G0 X{target_x} Y{target_y} F3600 + G0 Z{safe_distance_z} F3600 + {% elif target_a == 0 and printer.toolhead.position[3]|float > 45.0 %} + G0 Z{safe_distance_z} F3600 + {% endif %} + G0 A{target_a} C{target_c} F3600 + G0 X{target_x} Y{target_y} F3600 + G0 Z{target_z} F3600 + PROBE AXIS={axis} POSITIVE_DIR={positive} + G0 X{target_x} Y{target_y} F3600 + G0 Z{safe_distance_z} F3600 + +[gcode_macro SET_POINT] +gcode: + {% set macro = params.MACRO %} + {% set point = params.POINT|default(0) %} + {% set probe_point = printer.probe.last_result %} + {% set offsets = printer.probe.offsets %} + {% set x = probe_point[0] + offsets[0] - printer.gcode_move.homing_origin.x %} + {% set y = probe_point[1] + offsets[1] - printer.gcode_move.homing_origin.y %} + {% set z = probe_point[2] - offsets[2] - printer.gcode_move.homing_origin.z %} + # checking the axes that they are within the allowable range + {% set home_min = printer.toolhead.axis_minimum %} + {% set home_max = printer.toolhead.axis_maximum %} + {% if x < home_min[0] or x > home_max[0] %} + {action_raise_error('201: axis x=%f out of range (%f - %f)' % (x, home_min[0], home_max[0]))} + {% elif y < home_min[1] or y > home_max[1] %} + {action_raise_error('202: axis y=%f out of range (%f - %f)' % (y, home_min[1], home_max[1]))} + {% elif z < home_min[2] or z > home_max[2] %} + {action_raise_error('203: axis z=%f out of range (%f - %f)' % (z, home_min[2], home_max[2]))} + {% endif %} + {macro} POINT={point} COORDS='{x},{y},{z}' + +[gcode_macro RESET_WCS] +gcode: + {% set wcs_3 = printer.gcode_move.wcs_offsets[3] %} + {% set wcs_4 = printer.gcode_move.wcs_offsets[4] %} + G10 L2 P2 X{wcs_3[0]} Y{wcs_3[1]} Z{wcs_3[2]} + G10 L2 P3 X{wcs_4[0]} Y{wcs_4[1]} Z{wcs_4[2]} diff --git a/stereotech_config/750/calibrate/probe_5d_template.cfg b/stereotech_config/750/calibrate/probe_5d_template.cfg new file mode 100644 index 000000000000..0527e9838144 --- /dev/null +++ b/stereotech_config/750/calibrate/probe_5d_template.cfg @@ -0,0 +1,161 @@ +[gcode_macro CALIBRATE_MODULE_FIVE_D] +description: macro for get first point to auto calibrate 5d and align teamplate +gcode: + {% if printer["gcode_button five_axis_module"].state == "PRESSED" %} + G28 A + M204 S500 + G0 C0.1 + G0 C0 + ADJUST_TEMPLATE_HEIGHT A=0 + ALIGN_C_AXIS + ALIGN_A_AXIS + ADJUST_TEMPLATE_HEIGHT A=0 + ADJUST_TEMPLATE_HEIGHT A=90 + AUTO_WCS + ALIGN_C_AXIS + MOVE_TO_AUTO_WCS + M204 S1500 + {% endif %} + +[gcode_macro ADJUST_TEMPLATE_HEIGHT] +gcode: + {% set a = params.A|default(0)|int %} + {% if a in [0, 90] %} + PROBE_TEMPLATE_POINT POINT={"A_Z_A" ~ a} + SET_TEMPLATE_HEIGHT A={a} + {% endif %} + +[gcode_macro SET_TEMPLATE_HEIGHT] +gcode: + {% set a = params.A|default(0)|int %} + {% set v = 'v_' if a == 90 else '' %} + SET_GCODE_VARIABLE MACRO=PROBE_TEMPLATE_POINT VARIABLE={"a_" ~ v ~"probe_z"} VALUE={printer.probe.last_result[2] - printer.gcode_move.homing_origin.z} + +[gcode_macro ALIGN_C_AXIS] +description: align template along axis x +variable_repeat: 2 +gcode: + {% set repeat = printer["gcode_macro ALIGN_C_AXIS"].repeat %} + {% for idx in range(repeat) %} + PROBE_TEMPLATE_POINT POINT=D_Y + SET_POINT MACRO=SAVE_C_AXIS_POINT POINT=1 + PROBE_TEMPLATE_POINT POINT=C_Y + SET_POINT MACRO=SAVE_C_AXIS_POINT POINT=0 + CALC_C_AXIS_ALIGN + {% endfor %} + +[gcode_macro ALIGN_A_AXIS] +description: align template along horizontal plane +variable_repeat: 2 +gcode: + {% set repeat = printer["gcode_macro ALIGN_A_AXIS"].repeat %} + {% for idx in range(repeat) %} + PROBE_TEMPLATE_POINT POINT=A_Z + SET_POINT MACRO=SAVE_A_AXIS_POINT POINT=0 + PROBE_TEMPLATE_POINT POINT=B_Z + SET_POINT MACRO=SAVE_A_AXIS_POINT POINT=1 + CALC_A_AXIS_OFFSET + {% endfor %} + +[gcode_macro MOVE_TO_AUTO_WCS] +gcode: + {% set set_xy = params.XY|default(0) %} + {% set y_shift = 50 if set_xy else 7 %} + ; make a check to avoid collision of the sensor and the template for printer v750 + {% if y_shift == 7 and printer["gcode_macro CONSTANTS"].offsets_sensor[1]|float > -15.0 %} + {% set y_shift = y_shift + 15 %} + {% endif %} + {% if printer["gcode_button five_axis_module"].state == "PRESSED" %} + G0 X{printer.auto_wcs.wcs[0][0]} Y{printer.auto_wcs.wcs[0][1] - y_shift} Z{printer.auto_wcs.wcs[0][2] + 10} F3600 + {% endif %} + +[gcode_macro ADJUST_PROBE_OFFSET_Z] +gcode: + {% if printer["gcode_button five_axis_module"].state == "PRESSED" %} + {% set wcs_0 = printer.auto_wcs.wcs[0] %} + {% set wcs_1 = printer.auto_wcs.wcs[1] %} + {% set offsets = printer.probe.offsets %} + {% set coord_z = printer.gcode_move.position.z - printer.gcode_move.homing_origin.z %} + {% set delta_z = wcs_0[2] - coord_z %} + Z_OFFSET_APPLY_PROBE Z={(offsets[2] + delta_z)|abs} + {% if params.ADJUST_CALIBRATION|default(0) %} + {% set b_axis_params = printer.b_axis_compensation %} + B_AXIS_COMPENSATION_VARS Z={b_axis_params.rot_center_z - delta_z} + {% endif %} + {% if params.ADJUST_WCS|default(0) %} + {% set auto_wcs_params = printer.auto_wcs.wcs %} + {% set x0 = auto_wcs_params[0][0] %} + {% set y0 = auto_wcs_params[0][1] %} + {% set z0 = auto_wcs_params[0][2] - delta_z %} + SET_AUTO_WCS WCS=0 COORDS='{x0},{y0},{z0}' + {% set x1 = auto_wcs_params[1][0] %} + {% set y1 = auto_wcs_params[1][1] %} + {% set z1 = auto_wcs_params[1][2] - delta_z %} + SET_AUTO_WCS WCS=1 COORDS='{x1},{y1},{z1}' + {% endif %} + {% endif %} + +[gcode_macro ADJUST_PROBE_OFFSET_XY] +gcode: + {% if printer["gcode_button five_axis_module"].state == "PRESSED" %} + {% set y_shift = 50 %} + {% set wcs_0 = printer.auto_wcs.wcs[0] %} + {% set wcs_1 = printer.auto_wcs.wcs[1] %} + {% set offsets = printer.probe.offsets %} + {% set coord_x = printer.gcode_move.position.x - printer.gcode_move.homing_origin.x %} + {% set coord_y = printer.gcode_move.position.y + y_shift - printer.gcode_move.homing_origin.y %} + {% set delta_x = wcs_0[0] - coord_x %} + {% set delta_y = wcs_0[1] - coord_y %} + # edit offset between nozzle and probe_sensor + Z_OFFSET_APPLY_PROBE X={offsets[0] - delta_x} Y={offsets[1] - delta_y} + # set b_compensation vars + {% if params.ADJUST_CALIBRATION|default(0) %} + {% set b_axis_params = printer.b_axis_compensation %} + B_AXIS_COMPENSATION_VARS X={b_axis_params.rot_center_x - delta_x} + {% endif %} + # edit wcs in auto_wcs module from the new offsets + {% if params.ADJUST_WCS|default(0) %} + {% set auto_wcs_params = printer.auto_wcs.wcs %} + {% set x0 = auto_wcs_params[0][0] - delta_x %} + {% set y0 = auto_wcs_params[0][1] - delta_y %} + {% set z0 = auto_wcs_params[0][2] %} + SET_AUTO_WCS WCS=0 COORDS='{x0},{y0},{z0}' + {% set x1 = auto_wcs_params[1][0] - delta_x %} + {% set y1 = auto_wcs_params[1][1] - delta_y %} + {% set z1 = auto_wcs_params[1][2] %} + SET_AUTO_WCS WCS=1 COORDS='{x1},{y1},{z1}' + {% endif %} + {% endif %} + +[gcode_macro SET_WCS_FROM_AUTO_WCS] +gcode: + {% set auto_wcs_params = printer.auto_wcs.wcs %} + {% set max_x = printer.toolhead.axis_maximum[0]|float %} + {% set max_z = printer.toolhead.axis_maximum[2]|float %} + G10 L2 P2 X{auto_wcs_params[0][0]} Y{auto_wcs_params[0][1]} Z{auto_wcs_params[0][2]} + G10 L2 P4 X{auto_wcs_params[0][0]} Y{auto_wcs_params[0][1]} Z{auto_wcs_params[0][2]} + G10 L2 P3 X{auto_wcs_params[1][0]} Y{auto_wcs_params[1][1]} Z{auto_wcs_params[1][2]} + G10 L2 P5 X{auto_wcs_params[1][0]} Y{auto_wcs_params[1][1]} Z{auto_wcs_params[1][2]} + G90 + G0 Z{max_z / 2.0} F3600 + G54 + G0 X{max_x / 2.0} Y50 F3600 + +[gcode_macro MOVE_ACCURACY_SET_MODULE_FIVE_D] +Description: This macro do moved for accuracy set the module 5d. +gcode: + G28 A + M204 S500 + G0 C0.1 + G0 C0 + ADJUST_TEMPLATE_HEIGHT A=0 + ALIGN_C_AXIS + PROBE_TEMPLATE_POINT POINT=C_Z + SET_POINT MACRO=SAVE_SKEW_POINT POINT=0 + PROBE_TEMPLATE_POINT POINT=D_Z + SET_POINT MACRO=SAVE_SKEW_POINT POINT=1 + PROBE_TEMPLATE_POINT POINT=C_Y_A90 + SET_POINT MACRO=SAVE_SKEW_POINT POINT=2 + PROBE_TEMPLATE_POINT POINT=D_Y_A90 + SET_POINT MACRO=SAVE_SKEW_POINT POINT=3 + CHECK_ACCURACY_SET_MODULE_FIVE_D diff --git a/stereotech_config/750/calibrate/probe_5d_tool.cfg b/stereotech_config/750/calibrate/probe_5d_tool.cfg new file mode 100644 index 000000000000..8a9743398208 --- /dev/null +++ b/stereotech_config/750/calibrate/probe_5d_tool.cfg @@ -0,0 +1,184 @@ +[gcode_macro CALC_TOOL_PARAMS] +description: Tool length and radius calculation +variable_length: 999.0 +variable_radius: 999.0 +gcode: + {% if params.LENGTH|default(0)|int > 0 %} + {% if params.LEN_PROBE|default(1)|int > 0 %} + PROBE_TOOL_POINT POINT=A_Z + ADJUST_BASEMENT_WCS_V2 WCS=0 + {% endif %} + SET_TOOL_LENGTH + {% endif %} + {% if params.APPROXIMATE_RADIUS|default(0)|int > 0 %} + {% if params.APPROXIMATE_RADIUS_PROBE|default(1)|int > 0 %} + PROBE_TOOL_POINT POINT=A_Z_A90 + {% endif %} + SET_APPROXIMATE_TOOL_RADIUS + {% endif %} + {% if params.RADIUS|default(0)|int > 0 %} + SET_TOOL_RADIUS + {% endif %} + +[gcode_macro SET_TOOL_LENGTH] +description: This macro calculate length tool. +gcode: + {% set old_z = printer.gcode_move.wcs_offsets[3][2] %} + {% set template_thickness = printer.save_variables.variables.template_thickness|default(10.0)|float %} + {% set wcs_1_z = printer.gcode_move.wcs_offsets[1][2] %} + {% set tool_length = wcs_1_z - (old_z - template_thickness) %} + SET_GCODE_VARIABLE MACRO=CALC_TOOL_PARAMS VARIABLE=length VALUE={tool_length} + {action_respond_info('tool length=%s' % tool_length)} + +[gcode_macro SET_APPROXIMATE_TOOL_RADIUS] +description: moved to measure and set tool approximate radius. +gcode: + {% set wcs_z = printer.gcode_move.wcs_offsets[4][2] %} + {% set point = printer.probe.last_result %} + {% set offsets = printer.probe.offsets %} + {% set z = point[2] - offsets[2] - printer.gcode_move.homing_origin.z %} + SET_GCODE_VARIABLE MACRO=CALC_TOOL_PARAMS VARIABLE=radius VALUE={z - wcs_z} + {action_respond_info('raw tool radius=%s' % (z - wcs_z))} + +[gcode_macro SET_TOOL_RADIUS] +description: moved to measure tool radius and calculate it. +gcode: + PROBE_TOOL_POINT POINT=A_X_A90 + SET_POINT MACRO=SAVE_WCS_CALC_POINT POINT=1 + PROBE_TOOL_POINT POINT=A_MX_A90 + SET_POINT MACRO=SAVE_WCS_CALC_POINT POINT=2 + PROBE_TOOL_POINT POINT=A_Z_A90 + SET_POINT MACRO=SAVE_WCS_CALC_POINT POINT=0 + CALC_TOOL_RADIUS + SET_PRECISE_RADIUS + +[gcode_macro SET_PRECISE_RADIUS] +gcode: + SET_GCODE_VARIABLE MACRO=CALC_TOOL_PARAMS VARIABLE=radius VALUE={printer.auto_wcs.tooling_radius} + ADJUST_BASEMENT_WCS_V2 WCS=3 + +[gcode_macro CALC_WCS_TOOL] +gcode: + {% set wcs = params.WCS|default(0)|int %} + {% set axis = params.AXIS|default(0)|int %} + {% set adjust = params.ADJUST|default(0)|int %} + {% set axis_names = 'XYZ' %} + {% set value = (printer.auto_wcs.points[0][axis] + printer.auto_wcs.points[1][axis]) / 2.0 %} + {action_respond_info('calculated wcs_%s_%s=%s' % (wcs, axis, value))} + {% if adjust > 0 %} + G10 L2 P{wcs + 1} {axis_names[axis]}{value} + {% endif %} + +[gcode_macro ALIGN_A_AXIS_TOOL] +description: align template along horizontal plane +variable_repeat: 2 +gcode: + {% set repeat = printer["gcode_macro ALIGN_A_AXIS_TOOL"].repeat %} + {% for idx in range(repeat) %} + PROBE_TOOL_POINT POINT=B_Z_A90 + SET_POINT MACRO=SAVE_A_AXIS_POINT POINT=0 + PROBE_TOOL_POINT POINT=A_Z_A90 + SET_POINT MACRO=SAVE_A_AXIS_POINT POINT=1 + # PROBE_TOOL_POINT POINT=B_Z_A90_C60 + # SET_POINT MACRO=SAVE_A_AXIS_POINT POINT=2 + # PROBE_TOOL_POINT POINT=A_Z_A90_C60 + # SET_POINT MACRO=SAVE_A_AXIS_POINT POINT=3 + # CALC_A_AXIS_OFFSET_TOOL + CALC_A_AXIS_OFFSET + {% endfor %} + +[gcode_macro CHECK_SKEW_TOOL] +description: This macro calculates the x-axis skew between four points using the average. +gcode: + {% set tool_length = printer['gcode_macro CALC_TOOL_PARAMS'].length|float %} + {% if printer.save_variables.variables.measure_skew|default(0)|int %} + CALC_SKEW_COMPENSATION_WCS FACTOR=XY + CALC_SKEW_COMPENSATION_WCS FACTOR=XZ + CALC_SKEW_COMPENSATION_WCS FACTOR=YZ + SKEW_PROFILE SAVE=module_5d + {% if tool_length > 50.0 %} + PROBE_TOOL_POINT POINT=A_X_A90 + SET_POINT MACRO=SAVE_SKEW_POINT POINT=2 + PROBE_TOOL_POINT POINT=B_X_A90 + SET_POINT MACRO=SAVE_SKEW_POINT POINT=0 + PROBE_TOOL_POINT POINT=A_X_A90_C60 + SET_POINT MACRO=SAVE_SKEW_POINT POINT=3 + PROBE_TOOL_POINT POINT=B_X_A90_C60 + SET_POINT MACRO=SAVE_SKEW_POINT POINT=1 + CALC_SKEW_COMPENSATION FACTOR=XY MSG=skew_calculate_by_tool + SKEW_PROFILE SAVE=module_5d + {% else %} + {action_respond_info('Warning, tool length less 50mm for calculate skew for the axis X, where use only wcs_2 points!')} + {% endif %} + {% else %} + {action_respond_info('Skew compensation measurement disabled.')} + {% endif %} + +[gcode_macro SET_ECCENTRICITY] +Description: This macro save eccentricity for wcs_1. +gcode: + {% set x1 = params.X1|default(-0.001)|float %} + {% set x2 = params.X2|default(-0.001)|float %} + {% set y1 = params.Y1|default(-0.001)|float %} + {% set y2 = params.Y2|default(-0.001)|float %} + # checking params + {% set max_val = 9.0 %} + {% set max_diff = 2.0 %} + {% for param in [x1, x2, y1, y2] %} + {% if param > max_val or param < -0.001 %} + {action_raise_error('2048: The parameter value is out of range, param=%smm max=%smm, min=0.0mm. Check params.' % (param, max_val))} + {% endif %} + {% endfor %} + {% if (x1 - x2)|abs > max_diff or (y1 - y2)|abs > max_diff %} + {action_raise_error('2049: Large difference between two values (x1-x2 or y1-y2), maximum difference=%smm. Check the parameters.' % max_diff)} + {% endif %} + # applying parameters + {% if x1 >= 0.0 and x2 >= 0.0 %} + {% set offset_x = (x2 - x1) / 2.0 %} + SAVE_VARIABLE VARIABLE=eccentricity_offset_x VALUE={offset_x} + {action_respond_info('offset_x=%.3f; for correcting ECCENTRICITY saved! Please use calibrate mode "auto calibrate the start point" for apply this params.' % offset_x)} + {% endif %} + {% if y1 >= 0.0 and y2 >= 0.0 %} + {% set offset_y = (y1 - y2) / 2.0 %} + SAVE_VARIABLE VARIABLE=eccentricity_offset_y VALUE={offset_y} + {action_respond_info('offset_y=%.3f; for correcting ECCENTRICITY saved! Please use calibrate mode "auto calibrate the start point" for apply this params.' % offset_y)} + {% endif %} + +[gcode_macro APPLY_ECCENTRICITY] +Description: This macro apply eccentricity correction for wcs_1 and wcs_2 to axes XY. +gcode: + {% set svv = printer.save_variables.variables %} + {% set offset_x = svv.eccentricity_offset_x|default(0.0)|float %} + {% set offset_y = svv.eccentricity_offset_y|default(0.0)|float %} + {% set old_wcs1_x = printer.gcode_move.wcs_offsets[1][0] %} + {% set old_wcs1_y = printer.gcode_move.wcs_offsets[1][1] %} + {% set old_wcs2_x = printer.gcode_move.wcs_offsets[2][0] %} + {% set old_wcs2_y = printer.gcode_move.wcs_offsets[2][1] %} + {% set new_wcs1_x = old_wcs1_x + offset_x %} + {% set new_wcs1_y = old_wcs1_y + offset_y %} + {% set new_wcs2_x = old_wcs2_x + offset_x %} + {% set new_wcs2_y = old_wcs2_y + offset_y %} + G10 L2 P2 R1 X{offset_x} + G10 L2 P2 R1 Y{offset_y} + G10 L2 P3 R1 X{offset_x} + G10 L2 P3 R1 Y{offset_y} + {action_respond_info('Old wcs_2_x=%.3f, wcs_2_y=%.3f. New wcs_2_x=%.3f, wcs_2_y=%.3f' % (old_wcs2_x, old_wcs2_y, new_wcs2_x, new_wcs2_y))} + {action_respond_info('Old wcs_1_x=%.3f, wcs_1_y=%.3f. New wcs_1_x=%.3f, wcs_1_y=%.3f' % (old_wcs1_x, old_wcs1_y, new_wcs1_x, new_wcs1_y))} + {action_respond_info('Applied offset for corrective eccentricity. offset_x=%.3f; offset_y=%.3f.' % (offset_x, offset_y))} + SAVE_VARIABLES + +[gcode_macro AUTO_BASEMENT_WCS_MOVE] +description: This macro does a move for measuring wcs_1_z and wcs_2_y-raw mode FULL wcs_2_y and wcs_1_z-raw mode SPIRAL. +gcode: + {% set wcs = params.WCS|default(0)|int %} + {% set offsets = printer.probe.offsets %} + {% set wcs_offsets = printer.gcode_move.wcs_offsets[wcs + 3] %} + {% set max_z = printer.toolhead.axis_maximum[2]|float %} + {% set x = wcs_offsets[0] - offsets[0] %} + {% set y = wcs_offsets[1] - offsets[1] %} + {% set z = wcs_offsets[2] + offsets[2] %} + {% set a = '0' if wcs == 0 else '90' %} + G28 A + G0 A{a} F3600 + G0 Z{max_z / 2} F3600 + G0 X{x} Y{y} F3600 diff --git a/stereotech_config/750/calibrate/probe_750.cfg b/stereotech_config/750/calibrate/probe_750.cfg new file mode 100644 index 000000000000..894e0d10d0cf --- /dev/null +++ b/stereotech_config/750/calibrate/probe_750.cfg @@ -0,0 +1,93 @@ +[probe] +pin: !manta_mcu:probe_pin +samples: 4 +samples_tolerance_retries: 1 +samples_result: median +lift_speed: 10.0 +x_offset: 0.0 +y_offset: 0.0 +z_offset: 0.0 + +[bed_mesh] +speed: 120 +horizontal_move_z: 180 +mesh_min: 120, 10 +mesh_max: 480, 530 +probe_count: 6, 6 +fade_start: 1 +fade_end: 10 +fade_target: 0 +algorithm: bicubic +mesh_pps: 1, 1 + +[bed_mesh module_3d] +version = 1 +points = + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 +x_count = 6 +y_count = 6 +mesh_x_pps = 1 +mesh_y_pps = 1 +algo = bicubic +tension = 0.2 +min_x = 120.0 +max_x = 480.0 +min_y = 10.0 +max_y = 530.0 + +[skew_correction] + +[b_axis_compensation] + +[c_axis_align] + +[auto_wcs] + +[skew_correction module_3d] +xy_skew = 0.0 +xz_skew = 0.0 +yz_skew = 0.0 + +[skew_correction module_5d] +xy_skew = 0.0 +xz_skew = 0.0 +yz_skew = 0.0 + +[gcode_macro TEST_PROBE] +gcode: + QUERY_PROBE + UPDATE_DELAYED_GCODE ID=test_probe_loop DURATION=1.0 + +[gcode_macro CANCEL_TEST_PROBE] +gcode: + UPDATE_DELAYED_GCODE ID=test_probe_loop DURATION=0.0 + {action_respond_info('Abort check loop')} + +[delayed_gcode test_probe_loop] +gcode: + {% if printer["probe"].last_query %} + UPDATE_DELAYED_GCODE ID=test_probe_loop DURATION=0.0 + {action_respond_info('Probe pressed, abort check loop')} + {% else %} + {action_respond_info('Probe not pressed')} + QUERY_PROBE + UPDATE_DELAYED_GCODE ID=test_probe_loop DURATION=1.0 + {% endif %} + +[gcode_macro AUTO_WCS] +gcode: + AUTO_WCS_OFFSET_V2 + +[gcode_macro AUTO_BASEMENT_WCS] +gcode: + AUTO_BASEMENT_WCS_V2 {rawparams} + MOVE_SERVICE_POSITION_HEAD PARKING=0 + +[gcode_macro ADJUST_BASEMENT_WCS] +gcode: + ; pass diff --git a/stereotech_config/750/calibrate/probe_v3.cfg b/stereotech_config/750/calibrate/probe_v3.cfg new file mode 100644 index 000000000000..79193c069e3a --- /dev/null +++ b/stereotech_config/750/calibrate/probe_v3.cfg @@ -0,0 +1,151 @@ +[gcode_macro AUTO_WCS_OFFSET_V2] +description: macro do move for measuring and calculated WCS. Sensor DAC_v_2 +gcode: + {% if printer["gcode_button five_axis_module"].state == "PRESSED" %} + ; get wcs3_z + PROBE_TEMPLATE_POINT POINT=A_Z + SET_POINT MACRO=SAVE_WCS_CALC_POINT POINT=0 + ; get wcs3_y + PROBE_TEMPLATE_POINT POINT=B_MY_A0_C30 + SET_POINT MACRO=SAVE_WCS_CALC_POINT POINT=7 + PROBE_TEMPLATE_POINT POINT=B_Y_A0_C30 + SET_POINT MACRO=SAVE_WCS_CALC_POINT POINT=1 + ; get wcs3_x + PROBE_TEMPLATE_POINT POINT=C_X + SET_POINT MACRO=SAVE_WCS_CALC_POINT POINT=2 + PROBE_TEMPLATE_POINT POINT=D_MX + SET_POINT MACRO=SAVE_WCS_CALC_POINT POINT=3 + # get wcs4_z + PROBE_TEMPLATE_POINT POINT=A_Z_A90 + SET_POINT MACRO=SAVE_WCS_CALC_POINT POINT=4 + # get wcs4_y + PROBE_TEMPLATE_POINT POINT=B_Y_A90_C60 + SET_POINT MACRO=SAVE_WCS_CALC_POINT POINT=5 + PROBE_TEMPLATE_POINT POINT=B_MY_A90_C60 + SET_POINT MACRO=SAVE_WCS_CALC_POINT POINT=6 + # get wcs4_x + PROBE_TEMPLATE_POINT POINT=B_MX_A90_C60 + SET_POINT MACRO=SAVE_WCS_CALC_POINT POINT=8 + PROBE_TEMPLATE_POINT POINT=B_X_A90_C60 + SET_POINT MACRO=SAVE_WCS_CALC_POINT POINT=9 + ; calculating start wcs coordinates + {% 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.0)|float %} + CALC_WCS_PARAMS THICKNESS={ template_thickness } ADJUSTMENT={ auto_wcs_adj } SENSOR_VERSION=1 + {% endif %} + +[gcode_macro AUTO_BASEMENT_WCS_V2] +description: macro do main moves for get wcs for SPIRAL and FULL modes. +gcode: + RESET_WCS + SET_GCODE_VARIABLE MACRO=CALC_TOOL_PARAMS VARIABLE=length VALUE=999.0 + SET_GCODE_VARIABLE MACRO=CALC_TOOL_PARAMS VARIABLE=radius VALUE=999.0 + {% set wcs = params.WCS|default(0)|int %} + {% if wcs == 0 %} + MOVE_AUTOCALIBRATE_FULL_V2 + {% else %} + MOVE_AUTOCALIBRATE_SPIRAL_V2 + {% endif %} + SET_GCODE_VARIABLE MACRO=CALC_TOOL_PARAMS VARIABLE=length VALUE=999.0 + SET_GCODE_VARIABLE MACRO=CALC_TOOL_PARAMS VARIABLE=radius VALUE=999.0 + +[gcode_macro MOVE_AUTOCALIBRATE_FULL_V2] +description: macro do move for measuring and calculated WCS for FULL-SPIRAL mode. Sensor DAC_v_2 +gcode: + {% set max_z = printer.toolhead.axis_maximum[2]|float %} + ; set approximate radius, length and measuring the wcs_1_z + CALC_TOOL_PARAMS LENGTH=1 APPROXIMATE_RADIUS=1 + ; checking and apply offset for axis A + ALIGN_A_AXIS_TOOL + ; move for measuring the wcs_2_y + PROBE_TOOL_POINT POINT=A_Y_A90 + ADJUST_BASEMENT_WCS_V2 WCS=2 + ; move for measuring the wcs_2_x + PROBE_TOOL_POINT POINT=A_X_A90 + SET_POINT MACRO=SAVE_WCS_CALC_POINT POINT=0 + PROBE_TOOL_POINT POINT=A_MX_A90 + SET_POINT MACRO=SAVE_WCS_CALC_POINT POINT=1 + CALC_WCS_TOOL WCS=2 AXIS=0 ADJUST=1 + ; set radius and measuring the wcs_2_z + CALC_TOOL_PARAMS APPROXIMATE_RADIUS=1 RADIUS=1 + ; move for measuring the wcs_1_x + PROBE_TOOL_POINT POINT=A_X + SET_POINT MACRO=SAVE_WCS_CALC_POINT POINT=0 + PROBE_TOOL_POINT POINT=A_MX + SET_POINT MACRO=SAVE_WCS_CALC_POINT POINT=1 + CALC_WCS_TOOL WCS=1 AXIS=0 ADJUST=1 + ; move for measuring the wcs_1_y + PROBE_TOOL_POINT POINT=A_Y + SET_POINT MACRO=SAVE_WCS_CALC_POINT POINT=0 + PROBE_TOOL_POINT POINT=A_MY + SET_POINT MACRO=SAVE_WCS_CALC_POINT POINT=1 + CALC_WCS_TOOL WCS=1 AXIS=1 ADJUST=1 + ; eccentricity correction + APPLY_ECCENTRICITY + ; check skew axis X + CHECK_SKEW_TOOL + +[gcode_macro MOVE_AUTOCALIBRATE_SPIRAL_V2] +description: macro do move for measuring and calculated WCS for SPIRAL mode. Sensor DAC_v_2 +gcode: + {% set max_z = printer.toolhead.axis_maximum[2]|float %} + PROBE + G91 + G1 Z25 F1500 + G90 + ; set the wcs_1_z and wcs_2_y + ADJUST_BASEMENT_WCS_V2 WCS=1 + ; set approximate radius and length + CALC_TOOL_PARAMS LENGTH=1 APPROXIMATE_RADIUS=1 LEN_PROBE=0 APPROXIMATE_RADIUS_PROBE=0 + ; move to calculate wcs by tool + MOVE_MEASURING_SPIRAL + +[gcode_macro MOVE_MEASURING_SPIRAL] +description: This macro do move and calculate wcs for SPIRAL mode. +gcode: + {% set radius = printer['gcode_macro CALC_TOOL_PARAMS'].radius|float %} + {% set tool_length = printer['gcode_macro CALC_TOOL_PARAMS'].length|float %} + {% if radius < 5.0 and tool_length > 35.0 %} + ; checking and apply offset for axis A + ALIGN_A_AXIS_TOOL + ; move for measuring the wcs_2_x + PROBE_TOOL_POINT POINT=A_X_A90 + SET_POINT MACRO=SAVE_WCS_CALC_POINT POINT=0 + PROBE_TOOL_POINT POINT=A_MX_A90 + SET_POINT MACRO=SAVE_WCS_CALC_POINT POINT=1 + CALC_WCS_TOOL WCS=2 AXIS=0 ADJUST=1 + ; set precise radius and set the wcs_2_z + CALC_TOOL_PARAMS APPROXIMATE_RADIUS=1 RADIUS=1 + ; check skew axes + CHECK_SKEW_TOOL + {% else %} + {action_respond_info("Radius greater than 5 mm or tool length less 35mm, movement to calculate wcs by tool is not available. Wcs will be calculated from the template.")} + {% endif %} + +[gcode_macro ADJUST_BASEMENT_WCS_V2] +gcode: + {% set wcs = params.WCS|default(0)|int %} + {% set point = printer.probe.last_result %} + {% set offsets = printer.probe.offsets %} + {% set wcs_0 = printer.gcode_move.wcs_offsets[3] %} + {% set x = point[0] + offsets[0] - printer.gcode_move.homing_origin.x %} + {% set y = point[1] + offsets[1] - printer.gcode_move.homing_origin.y %} + {% set z = point[2] - offsets[2] - printer.gcode_move.homing_origin.z %} + {% set wcs_1 = printer.gcode_move.wcs_offsets[4] %} + {% set old_z = wcs_0[2] %} + {% set old_y = wcs_1[1] %} + {% set probe_backlash_y = printer.auto_wcs.probe_backlash_y|default(0.0)|float %} + {% set tool_length = printer['gcode_macro CALC_TOOL_PARAMS'].length|float %} + {% set radius = printer['gcode_macro CALC_TOOL_PARAMS'].radius %} + {% set auto_wcs_adj = printer.save_variables.variables["auto_wcs_adj"]|default(0.0)|float %} + {% if wcs == 0 %} + G10 L2 P2 Z{z + auto_wcs_adj} + G10 L2 P3 Y{old_y - (z - old_z)} + {% elif wcs == 1 %} + G10 L2 P3 Y{y} + G10 L2 P2 Z{old_z - (y - old_y)} + {% elif wcs == 2 %} + G10 L2 P3 Y{y + probe_backlash_y} + {% elif wcs == 3 %} + G10 L2 P3 Z{z - radius + auto_wcs_adj} + {% endif %} From fec3c932ea8d8b455ba71f361125e772c45e95c0 Mon Sep 17 00:00:00 2001 From: sokolovjek Date: Mon, 15 Jan 2024 08:00:11 +0000 Subject: [PATCH 3/3] STEAPP-851: deleted unneeded files. adapted config files for support to any printers --- HTE750-0-0-23.cfg | 11 +- stereotech_config/750/calibrate/probe_3d.cfg | 29 --- stereotech_config/750/calibrate/probe_5d.cfg | 200 ------------------ .../750/calibrate/probe_5d_template.cfg | 161 -------------- .../750/calibrate/probe_5d_tool.cfg | 184 ---------------- stereotech_config/HTE750-0-0-23.cfg | 29 +-- stereotech_config/calibrate/probe_3d.cfg | 8 +- stereotech_config/calibrate/probe_5d.cfg | 5 +- .../calibrate/probe_5d_template.cfg | 14 +- 9 files changed, 33 insertions(+), 608 deletions(-) delete mode 100644 stereotech_config/750/calibrate/probe_3d.cfg delete mode 100644 stereotech_config/750/calibrate/probe_5d.cfg delete mode 100644 stereotech_config/750/calibrate/probe_5d_template.cfg delete mode 100644 stereotech_config/750/calibrate/probe_5d_tool.cfg diff --git a/HTE750-0-0-23.cfg b/HTE750-0-0-23.cfg index b2718f56a430..ce2e02d602ba 100644 --- a/HTE750-0-0-23.cfg +++ b/HTE750-0-0-23.cfg @@ -35,16 +35,13 @@ path: /home/ste/uploads [include stereotech_config/750/module_3d_macros.cfg] [include stereotech_config/750/module_5d.cfg] -# [include stereotech_config/750/probe_main.cfg] -# [include stereotech_config/750/probe_v3.cfg] - # sections probe [include stereotech_config/750/calibrate/probe_750.cfg] -[include stereotech_config/750/calibrate/probe_3d.cfg] -[include stereotech_config/750/calibrate/probe_5d.cfg] -[include stereotech_config/750/calibrate/probe_5d_tool.cfg] -[include stereotech_config/750/calibrate/probe_5d_template.cfg] [include stereotech_config/750/calibrate/probe_v3.cfg] +[include stereotech_config/calibrate/probe_3d.cfg] +[include stereotech_config/calibrate/probe_5d.cfg] +[include stereotech_config/calibrate/probe_5d_tool.cfg] +[include stereotech_config/calibrate/probe_5d_template.cfg] [include stereotech_config/750/print_macros.cfg] [include stereotech_config/common/variables.cfg] diff --git a/stereotech_config/750/calibrate/probe_3d.cfg b/stereotech_config/750/calibrate/probe_3d.cfg deleted file mode 100644 index 37631e217334..000000000000 --- a/stereotech_config/750/calibrate/probe_3d.cfg +++ /dev/null @@ -1,29 +0,0 @@ -[gcode_macro CALIBRATE_MODULE_THREE_D] -description: 3D module calibration -gcode: - {% if printer["gcode_button five_axis_module"].state == "RELEASED" %} - {% set axis_max = printer.toolhead.axis_maximum %} - {% set offsets = printer.probe.offsets %} - {% set center_probe_x = (axis_max[0] / 2.0) - offsets[0] %} - {% set center_probe_y = (axis_max[1] / 2.0) - offsets[1] %} - G0 X{center_probe_x} Y{center_probe_y} F6000 - G0 Z40 F3600 - PROBE - G91 - G0 Z30 F3600 - G90 - MODULE_THREE_D_MESH_CALIBRATE - G91 - G0 Z30 F3600 - G90 - G0 X{center_probe_x + offsets[0]} Y50 F3600 - {% endif %} - -[gcode_macro MODULE_THREE_D_MESH_CALIBRATE] -description: 3D module calibration -gcode: - {% if printer["gcode_button five_axis_module"].state == "RELEASED" %} - Z_OFFSET_APPLY_PROBE Z={printer.probe.last_result[2]} - BED_MESH_CALIBRATE PROFILE=module_3d - BED_MESH_CLEAR - {% endif %} diff --git a/stereotech_config/750/calibrate/probe_5d.cfg b/stereotech_config/750/calibrate/probe_5d.cfg deleted file mode 100644 index 6feb294c4832..000000000000 --- a/stereotech_config/750/calibrate/probe_5d.cfg +++ /dev/null @@ -1,200 +0,0 @@ -[gcode_macro PROBE_TEMPLATE_POINT] -description: Macro for calibration template probing -variable_a_probe_z: 0.0 -variable_a_v_probe_z: 0.0 -gcode: - {% set point = params.POINT|default('A_Z') %} - {% set offsets = printer.probe.offsets %} - {% set probe_a_horizontal = printer["gcode_macro CONSTANTS"].probe_a_horizontal %} - {% set probe_a_vertical = printer["gcode_macro CONSTANTS"].probe_a_vertical %} - {% set whitelist = ['A_Z', 'B_Z', 'C_Y', 'D_Y'] %} - {% set a_z = printer['gcode_macro PROBE_TEMPLATE_POINT'].a_probe_z if printer['gcode_macro PROBE_TEMPLATE_POINT'].a_probe_z > 0 else probe_a_horizontal[2] + offsets[2] %} - {% set a_v_z = printer['gcode_macro PROBE_TEMPLATE_POINT'].a_v_probe_z if printer['gcode_macro PROBE_TEMPLATE_POINT'].a_v_probe_z > 0 else probe_a_vertical[2] + offsets[2] %} - {% set a = [probe_a_horizontal[0] - offsets[0], probe_a_horizontal[1] - offsets[1], a_z] %} - {% set a_v = [probe_a_vertical[0] - offsets[0], probe_a_vertical[1] - offsets[1], a_v_z] %} - {% set max_y = printer.toolhead.axis_maximum[1]|float %} - #{% set whitelist = ['A_Z', 'A_Z_A0', 'A_Z_A90', 'A_X', 'A_Y', 'A_MX', 'A_MY', 'A_Z_A90', 'A_X_A90', 'A_MX_A90'] %} - #{% if point in whitelist %} - {% if point.split('_')|length == 4 %} - {% set p, ax, a_deg, c_deg = point.split('_') %} - {% elif point.split('_')|length == 3 %} - {% set p, ax, a_deg = point.split('_') %} - {% set c_deg = 'C0' %} - {% else %} - {% set p, ax = point.split('_') %} - {% set a_deg = 'A0' %} - {% set c_deg = 'C0' %} - {% endif %} - {% set target_x = a_v[0] if a_deg == 'A90' else a[0] %} - {% set target_y = a_v[1] if a_deg == 'A90' else a[1] %} - {% set target_z = a_v[2] if a_deg == 'A90' else a[2] %} - {% set target_a = a_deg[1:]|float %} - {% set target_c = c_deg[1:]|float %} - {% set safe_distance_z = (probe_a_vertical[2] + 70 + offsets[2]) if a_deg == 'A90' else (probe_a_horizontal[2] + 20 + offsets[2]) %} - {% set axis = ax[-1] %} - {% set positive = 0 if (ax[0] == 'M' or ax[0] == 'Z') else 1 %} - - {% if p == 'A' and target_a == 0.0 %} - {% set target_y = target_y - 4 %} - {% elif p == 'B' %} - {% if target_a == 0.0 and target_c == 0.0 %} - {% set target_y = target_y - 55 %} - {% elif target_a == 0.0 and target_c == 30.0 %} - {% set target_x = target_x - 50 %} - {% elif target_a == 0.0 and target_c == 15.0 %} - {% set target_x = target_x - 35 %} - {% set target_y = target_y - 35 %} - {% elif target_a == 90.0 and target_c == 60.0 %} - {% set target_z = target_z + 50 %} - {% endif %} - {% elif p == 'C' %} - {% set target_x = target_x - 50 %} - {% set target_y = target_y - 4 %} - {% elif p == 'D' %} - {% set target_x = target_x + 50 %} - {% set target_y = target_y - 4 %} - {% endif %} - - {% if ax != 'Z' %} - {% set target_z = target_z - 6 %} - {% else %} - {% set target_z = target_z + 20 %} - {% endif %} - - {% if ax == 'X' %} - {% set target_x = target_x - 20 %} - {% set axis = 'X' %} - {% elif ax == 'MX' %} - {% set target_x = target_x + 20 %} - {% set axis = 'X' %} - {% elif ax == 'Y' %} - {% set target_y = target_y - 20 %} - {% set axis = 'Y' %} - {% elif ax == 'MY' %} - {% set target_y = target_y + 20 %} - {% set axis = 'Y' %} - {% endif %} - #{% endif %} - {% if target_y|float > (max_y - 4.3) %} - {% set target_y = max_y - 5.5 %} - {% endif %} - G0 Z{safe_distance_z} F3600 - G0 A0 C0 F3600 - G0 A{target_a} C{target_c} F3600 - G0 X{target_x} Y{target_y} F3600 - G0 Z{target_z} F3600 - PROBE AXIS={axis} POSITIVE_DIR={positive} - G0 X{target_x} Y{target_y} F3600 - G0 Z{safe_distance_z} F3600 - G0 A0 C0 F3600 - -[gcode_macro PROBE_TOOL_POINT] -Description: This macro does movement and measurement relative to the tool. -gcode: - {% set point = params.POINT|default('A_Z') %} - {% set offsets = printer.probe.offsets %} - {% set wcs_1 = printer.gcode_move.wcs_offsets[1] %} - {% set wcs_2 = printer.gcode_move.wcs_offsets[2] %} - {% set wcs_4 = printer.gcode_move.wcs_offsets[4] %} - {% set a = [wcs_1[0] - offsets[0], wcs_1[1] - offsets[1], wcs_1[2] + offsets[2]] %} - {% set a_v = [wcs_2[0] - offsets[0], wcs_2[1] - offsets[1], wcs_2[2] + offsets[2]] %} - {% set max_z = printer.toolhead.axis_maximum[2]|float %} - {% set min_y = printer.toolhead.axis_minimum[1]|float %} - {% set radius = printer['gcode_macro CALC_TOOL_PARAMS'].radius|float %} - {% set tool_length = printer['gcode_macro CALC_TOOL_PARAMS'].length|float %} - {% if tool_length < 35.0 %} - {action_raise_error('208: Error, tool length not enough, less 35 mm')} - {% endif %} - #{% set whitelist = ['A_Z', 'A_X', 'A_Y', 'A_MX', 'A_MY', 'A_Z_A90', 'A_X_A90', 'A_MX_A90'] %} - #{% if point in whitelist %} - {% if point.split('_')|length == 4 %} - {% set p, ax, a_deg, c_deg = point.split('_') %} - {% elif point.split('_')|length == 3 %} - {% set p, ax, a_deg = point.split('_') %} - {% set c_deg = 'C0' %} - {% else %} - {% set p, ax = point.split('_') %} - {% set a_deg = 'A0' %} - {% set c_deg = 'C0' %} - {% endif %} - {% set a_z = a[2] if tool_length != 999.0 else (max_z / 3) * 2 %} - {% set a_v_y = a_v[1] if tool_length != 999.0 else min_y %} - {% set a_v_z = a_v[2] + radius if radius != 999.0 else (max_z / 2.0) %} - {% set target_x = a_v[0] if a_deg == 'A90' else a[0] %} - {% set target_y = a_v_y if a_deg == 'A90' else a[1] %} - {% set target_z = a_v_z if a_deg == 'A90' else a_z %} - {% set target_a = a_deg[1:]|float %} - {% set target_c = c_deg[1:]|float %} - {% set axis = ax[-1] %} - {% set positive = 0 if (ax[0] == 'M' or ax[0] == 'Z') else 1 %} - {% set safe_distance_z = a_v_z + 20 if a_deg == 'A90' else a_z + 20 %} - {% if p == 'A' %} - {% if target_a == 90.0 %} - {% set target_y = target_y + 2 %} - {% endif %} - {% elif p == 'B' %} - {% if target_a == 90.0 and ax == 'Z' %} - # {% set target_y = target_y + 25 %} - {% set target_y = ((wcs_4[1] + 10) - offsets[1]) - 20 %} - {% elif target_a == 90.0 %} - # {% set target_y = target_y + 25 %} - {% set target_y = (wcs_4[1] + 10 - offsets[1]) - 35 %} - {% endif %} - {% endif %} - {% if ax != 'Z' %} - {% set z = [radius, 10]|min %} - {% set target_z = target_z - 5 %} - {% elif ax == 'Z' and radius < 999.0 %} - {% set target_z = target_z + 20 %} - {% endif %} - {% if ax == 'X' %} - {% set target_x = target_x - (radius + 10) %} - {% elif ax == 'MX' %} - {% set target_x = target_x + (radius + 10) %} - {% elif ax == 'Y' %} - {% set target_y = (target_y - (radius + 10)) if target_a == 0.0 else (target_y - 20)%} - {% elif ax == 'MY' %} - {% set target_y = target_y + (radius + 10) %} - {% endif %} - #{% endif %} - {% if target_a == 90 and printer.toolhead.position[3]|float < 45.0 %} - G0 A{target_a} C{target_c} F3600 - G0 X{target_x} Y{target_y} F3600 - G0 Z{safe_distance_z} F3600 - {% elif target_a == 0 and printer.toolhead.position[3]|float > 45.0 %} - G0 Z{safe_distance_z} F3600 - {% endif %} - G0 A{target_a} C{target_c} F3600 - G0 X{target_x} Y{target_y} F3600 - G0 Z{target_z} F3600 - PROBE AXIS={axis} POSITIVE_DIR={positive} - G0 X{target_x} Y{target_y} F3600 - G0 Z{safe_distance_z} F3600 - -[gcode_macro SET_POINT] -gcode: - {% set macro = params.MACRO %} - {% set point = params.POINT|default(0) %} - {% set probe_point = printer.probe.last_result %} - {% set offsets = printer.probe.offsets %} - {% set x = probe_point[0] + offsets[0] - printer.gcode_move.homing_origin.x %} - {% set y = probe_point[1] + offsets[1] - printer.gcode_move.homing_origin.y %} - {% set z = probe_point[2] - offsets[2] - printer.gcode_move.homing_origin.z %} - # checking the axes that they are within the allowable range - {% set home_min = printer.toolhead.axis_minimum %} - {% set home_max = printer.toolhead.axis_maximum %} - {% if x < home_min[0] or x > home_max[0] %} - {action_raise_error('201: axis x=%f out of range (%f - %f)' % (x, home_min[0], home_max[0]))} - {% elif y < home_min[1] or y > home_max[1] %} - {action_raise_error('202: axis y=%f out of range (%f - %f)' % (y, home_min[1], home_max[1]))} - {% elif z < home_min[2] or z > home_max[2] %} - {action_raise_error('203: axis z=%f out of range (%f - %f)' % (z, home_min[2], home_max[2]))} - {% endif %} - {macro} POINT={point} COORDS='{x},{y},{z}' - -[gcode_macro RESET_WCS] -gcode: - {% set wcs_3 = printer.gcode_move.wcs_offsets[3] %} - {% set wcs_4 = printer.gcode_move.wcs_offsets[4] %} - G10 L2 P2 X{wcs_3[0]} Y{wcs_3[1]} Z{wcs_3[2]} - G10 L2 P3 X{wcs_4[0]} Y{wcs_4[1]} Z{wcs_4[2]} diff --git a/stereotech_config/750/calibrate/probe_5d_template.cfg b/stereotech_config/750/calibrate/probe_5d_template.cfg deleted file mode 100644 index 0527e9838144..000000000000 --- a/stereotech_config/750/calibrate/probe_5d_template.cfg +++ /dev/null @@ -1,161 +0,0 @@ -[gcode_macro CALIBRATE_MODULE_FIVE_D] -description: macro for get first point to auto calibrate 5d and align teamplate -gcode: - {% if printer["gcode_button five_axis_module"].state == "PRESSED" %} - G28 A - M204 S500 - G0 C0.1 - G0 C0 - ADJUST_TEMPLATE_HEIGHT A=0 - ALIGN_C_AXIS - ALIGN_A_AXIS - ADJUST_TEMPLATE_HEIGHT A=0 - ADJUST_TEMPLATE_HEIGHT A=90 - AUTO_WCS - ALIGN_C_AXIS - MOVE_TO_AUTO_WCS - M204 S1500 - {% endif %} - -[gcode_macro ADJUST_TEMPLATE_HEIGHT] -gcode: - {% set a = params.A|default(0)|int %} - {% if a in [0, 90] %} - PROBE_TEMPLATE_POINT POINT={"A_Z_A" ~ a} - SET_TEMPLATE_HEIGHT A={a} - {% endif %} - -[gcode_macro SET_TEMPLATE_HEIGHT] -gcode: - {% set a = params.A|default(0)|int %} - {% set v = 'v_' if a == 90 else '' %} - SET_GCODE_VARIABLE MACRO=PROBE_TEMPLATE_POINT VARIABLE={"a_" ~ v ~"probe_z"} VALUE={printer.probe.last_result[2] - printer.gcode_move.homing_origin.z} - -[gcode_macro ALIGN_C_AXIS] -description: align template along axis x -variable_repeat: 2 -gcode: - {% set repeat = printer["gcode_macro ALIGN_C_AXIS"].repeat %} - {% for idx in range(repeat) %} - PROBE_TEMPLATE_POINT POINT=D_Y - SET_POINT MACRO=SAVE_C_AXIS_POINT POINT=1 - PROBE_TEMPLATE_POINT POINT=C_Y - SET_POINT MACRO=SAVE_C_AXIS_POINT POINT=0 - CALC_C_AXIS_ALIGN - {% endfor %} - -[gcode_macro ALIGN_A_AXIS] -description: align template along horizontal plane -variable_repeat: 2 -gcode: - {% set repeat = printer["gcode_macro ALIGN_A_AXIS"].repeat %} - {% for idx in range(repeat) %} - PROBE_TEMPLATE_POINT POINT=A_Z - SET_POINT MACRO=SAVE_A_AXIS_POINT POINT=0 - PROBE_TEMPLATE_POINT POINT=B_Z - SET_POINT MACRO=SAVE_A_AXIS_POINT POINT=1 - CALC_A_AXIS_OFFSET - {% endfor %} - -[gcode_macro MOVE_TO_AUTO_WCS] -gcode: - {% set set_xy = params.XY|default(0) %} - {% set y_shift = 50 if set_xy else 7 %} - ; make a check to avoid collision of the sensor and the template for printer v750 - {% if y_shift == 7 and printer["gcode_macro CONSTANTS"].offsets_sensor[1]|float > -15.0 %} - {% set y_shift = y_shift + 15 %} - {% endif %} - {% if printer["gcode_button five_axis_module"].state == "PRESSED" %} - G0 X{printer.auto_wcs.wcs[0][0]} Y{printer.auto_wcs.wcs[0][1] - y_shift} Z{printer.auto_wcs.wcs[0][2] + 10} F3600 - {% endif %} - -[gcode_macro ADJUST_PROBE_OFFSET_Z] -gcode: - {% if printer["gcode_button five_axis_module"].state == "PRESSED" %} - {% set wcs_0 = printer.auto_wcs.wcs[0] %} - {% set wcs_1 = printer.auto_wcs.wcs[1] %} - {% set offsets = printer.probe.offsets %} - {% set coord_z = printer.gcode_move.position.z - printer.gcode_move.homing_origin.z %} - {% set delta_z = wcs_0[2] - coord_z %} - Z_OFFSET_APPLY_PROBE Z={(offsets[2] + delta_z)|abs} - {% if params.ADJUST_CALIBRATION|default(0) %} - {% set b_axis_params = printer.b_axis_compensation %} - B_AXIS_COMPENSATION_VARS Z={b_axis_params.rot_center_z - delta_z} - {% endif %} - {% if params.ADJUST_WCS|default(0) %} - {% set auto_wcs_params = printer.auto_wcs.wcs %} - {% set x0 = auto_wcs_params[0][0] %} - {% set y0 = auto_wcs_params[0][1] %} - {% set z0 = auto_wcs_params[0][2] - delta_z %} - SET_AUTO_WCS WCS=0 COORDS='{x0},{y0},{z0}' - {% set x1 = auto_wcs_params[1][0] %} - {% set y1 = auto_wcs_params[1][1] %} - {% set z1 = auto_wcs_params[1][2] - delta_z %} - SET_AUTO_WCS WCS=1 COORDS='{x1},{y1},{z1}' - {% endif %} - {% endif %} - -[gcode_macro ADJUST_PROBE_OFFSET_XY] -gcode: - {% if printer["gcode_button five_axis_module"].state == "PRESSED" %} - {% set y_shift = 50 %} - {% set wcs_0 = printer.auto_wcs.wcs[0] %} - {% set wcs_1 = printer.auto_wcs.wcs[1] %} - {% set offsets = printer.probe.offsets %} - {% set coord_x = printer.gcode_move.position.x - printer.gcode_move.homing_origin.x %} - {% set coord_y = printer.gcode_move.position.y + y_shift - printer.gcode_move.homing_origin.y %} - {% set delta_x = wcs_0[0] - coord_x %} - {% set delta_y = wcs_0[1] - coord_y %} - # edit offset between nozzle and probe_sensor - Z_OFFSET_APPLY_PROBE X={offsets[0] - delta_x} Y={offsets[1] - delta_y} - # set b_compensation vars - {% if params.ADJUST_CALIBRATION|default(0) %} - {% set b_axis_params = printer.b_axis_compensation %} - B_AXIS_COMPENSATION_VARS X={b_axis_params.rot_center_x - delta_x} - {% endif %} - # edit wcs in auto_wcs module from the new offsets - {% if params.ADJUST_WCS|default(0) %} - {% set auto_wcs_params = printer.auto_wcs.wcs %} - {% set x0 = auto_wcs_params[0][0] - delta_x %} - {% set y0 = auto_wcs_params[0][1] - delta_y %} - {% set z0 = auto_wcs_params[0][2] %} - SET_AUTO_WCS WCS=0 COORDS='{x0},{y0},{z0}' - {% set x1 = auto_wcs_params[1][0] - delta_x %} - {% set y1 = auto_wcs_params[1][1] - delta_y %} - {% set z1 = auto_wcs_params[1][2] %} - SET_AUTO_WCS WCS=1 COORDS='{x1},{y1},{z1}' - {% endif %} - {% endif %} - -[gcode_macro SET_WCS_FROM_AUTO_WCS] -gcode: - {% set auto_wcs_params = printer.auto_wcs.wcs %} - {% set max_x = printer.toolhead.axis_maximum[0]|float %} - {% set max_z = printer.toolhead.axis_maximum[2]|float %} - G10 L2 P2 X{auto_wcs_params[0][0]} Y{auto_wcs_params[0][1]} Z{auto_wcs_params[0][2]} - G10 L2 P4 X{auto_wcs_params[0][0]} Y{auto_wcs_params[0][1]} Z{auto_wcs_params[0][2]} - G10 L2 P3 X{auto_wcs_params[1][0]} Y{auto_wcs_params[1][1]} Z{auto_wcs_params[1][2]} - G10 L2 P5 X{auto_wcs_params[1][0]} Y{auto_wcs_params[1][1]} Z{auto_wcs_params[1][2]} - G90 - G0 Z{max_z / 2.0} F3600 - G54 - G0 X{max_x / 2.0} Y50 F3600 - -[gcode_macro MOVE_ACCURACY_SET_MODULE_FIVE_D] -Description: This macro do moved for accuracy set the module 5d. -gcode: - G28 A - M204 S500 - G0 C0.1 - G0 C0 - ADJUST_TEMPLATE_HEIGHT A=0 - ALIGN_C_AXIS - PROBE_TEMPLATE_POINT POINT=C_Z - SET_POINT MACRO=SAVE_SKEW_POINT POINT=0 - PROBE_TEMPLATE_POINT POINT=D_Z - SET_POINT MACRO=SAVE_SKEW_POINT POINT=1 - PROBE_TEMPLATE_POINT POINT=C_Y_A90 - SET_POINT MACRO=SAVE_SKEW_POINT POINT=2 - PROBE_TEMPLATE_POINT POINT=D_Y_A90 - SET_POINT MACRO=SAVE_SKEW_POINT POINT=3 - CHECK_ACCURACY_SET_MODULE_FIVE_D diff --git a/stereotech_config/750/calibrate/probe_5d_tool.cfg b/stereotech_config/750/calibrate/probe_5d_tool.cfg deleted file mode 100644 index 8a9743398208..000000000000 --- a/stereotech_config/750/calibrate/probe_5d_tool.cfg +++ /dev/null @@ -1,184 +0,0 @@ -[gcode_macro CALC_TOOL_PARAMS] -description: Tool length and radius calculation -variable_length: 999.0 -variable_radius: 999.0 -gcode: - {% if params.LENGTH|default(0)|int > 0 %} - {% if params.LEN_PROBE|default(1)|int > 0 %} - PROBE_TOOL_POINT POINT=A_Z - ADJUST_BASEMENT_WCS_V2 WCS=0 - {% endif %} - SET_TOOL_LENGTH - {% endif %} - {% if params.APPROXIMATE_RADIUS|default(0)|int > 0 %} - {% if params.APPROXIMATE_RADIUS_PROBE|default(1)|int > 0 %} - PROBE_TOOL_POINT POINT=A_Z_A90 - {% endif %} - SET_APPROXIMATE_TOOL_RADIUS - {% endif %} - {% if params.RADIUS|default(0)|int > 0 %} - SET_TOOL_RADIUS - {% endif %} - -[gcode_macro SET_TOOL_LENGTH] -description: This macro calculate length tool. -gcode: - {% set old_z = printer.gcode_move.wcs_offsets[3][2] %} - {% set template_thickness = printer.save_variables.variables.template_thickness|default(10.0)|float %} - {% set wcs_1_z = printer.gcode_move.wcs_offsets[1][2] %} - {% set tool_length = wcs_1_z - (old_z - template_thickness) %} - SET_GCODE_VARIABLE MACRO=CALC_TOOL_PARAMS VARIABLE=length VALUE={tool_length} - {action_respond_info('tool length=%s' % tool_length)} - -[gcode_macro SET_APPROXIMATE_TOOL_RADIUS] -description: moved to measure and set tool approximate radius. -gcode: - {% set wcs_z = printer.gcode_move.wcs_offsets[4][2] %} - {% set point = printer.probe.last_result %} - {% set offsets = printer.probe.offsets %} - {% set z = point[2] - offsets[2] - printer.gcode_move.homing_origin.z %} - SET_GCODE_VARIABLE MACRO=CALC_TOOL_PARAMS VARIABLE=radius VALUE={z - wcs_z} - {action_respond_info('raw tool radius=%s' % (z - wcs_z))} - -[gcode_macro SET_TOOL_RADIUS] -description: moved to measure tool radius and calculate it. -gcode: - PROBE_TOOL_POINT POINT=A_X_A90 - SET_POINT MACRO=SAVE_WCS_CALC_POINT POINT=1 - PROBE_TOOL_POINT POINT=A_MX_A90 - SET_POINT MACRO=SAVE_WCS_CALC_POINT POINT=2 - PROBE_TOOL_POINT POINT=A_Z_A90 - SET_POINT MACRO=SAVE_WCS_CALC_POINT POINT=0 - CALC_TOOL_RADIUS - SET_PRECISE_RADIUS - -[gcode_macro SET_PRECISE_RADIUS] -gcode: - SET_GCODE_VARIABLE MACRO=CALC_TOOL_PARAMS VARIABLE=radius VALUE={printer.auto_wcs.tooling_radius} - ADJUST_BASEMENT_WCS_V2 WCS=3 - -[gcode_macro CALC_WCS_TOOL] -gcode: - {% set wcs = params.WCS|default(0)|int %} - {% set axis = params.AXIS|default(0)|int %} - {% set adjust = params.ADJUST|default(0)|int %} - {% set axis_names = 'XYZ' %} - {% set value = (printer.auto_wcs.points[0][axis] + printer.auto_wcs.points[1][axis]) / 2.0 %} - {action_respond_info('calculated wcs_%s_%s=%s' % (wcs, axis, value))} - {% if adjust > 0 %} - G10 L2 P{wcs + 1} {axis_names[axis]}{value} - {% endif %} - -[gcode_macro ALIGN_A_AXIS_TOOL] -description: align template along horizontal plane -variable_repeat: 2 -gcode: - {% set repeat = printer["gcode_macro ALIGN_A_AXIS_TOOL"].repeat %} - {% for idx in range(repeat) %} - PROBE_TOOL_POINT POINT=B_Z_A90 - SET_POINT MACRO=SAVE_A_AXIS_POINT POINT=0 - PROBE_TOOL_POINT POINT=A_Z_A90 - SET_POINT MACRO=SAVE_A_AXIS_POINT POINT=1 - # PROBE_TOOL_POINT POINT=B_Z_A90_C60 - # SET_POINT MACRO=SAVE_A_AXIS_POINT POINT=2 - # PROBE_TOOL_POINT POINT=A_Z_A90_C60 - # SET_POINT MACRO=SAVE_A_AXIS_POINT POINT=3 - # CALC_A_AXIS_OFFSET_TOOL - CALC_A_AXIS_OFFSET - {% endfor %} - -[gcode_macro CHECK_SKEW_TOOL] -description: This macro calculates the x-axis skew between four points using the average. -gcode: - {% set tool_length = printer['gcode_macro CALC_TOOL_PARAMS'].length|float %} - {% if printer.save_variables.variables.measure_skew|default(0)|int %} - CALC_SKEW_COMPENSATION_WCS FACTOR=XY - CALC_SKEW_COMPENSATION_WCS FACTOR=XZ - CALC_SKEW_COMPENSATION_WCS FACTOR=YZ - SKEW_PROFILE SAVE=module_5d - {% if tool_length > 50.0 %} - PROBE_TOOL_POINT POINT=A_X_A90 - SET_POINT MACRO=SAVE_SKEW_POINT POINT=2 - PROBE_TOOL_POINT POINT=B_X_A90 - SET_POINT MACRO=SAVE_SKEW_POINT POINT=0 - PROBE_TOOL_POINT POINT=A_X_A90_C60 - SET_POINT MACRO=SAVE_SKEW_POINT POINT=3 - PROBE_TOOL_POINT POINT=B_X_A90_C60 - SET_POINT MACRO=SAVE_SKEW_POINT POINT=1 - CALC_SKEW_COMPENSATION FACTOR=XY MSG=skew_calculate_by_tool - SKEW_PROFILE SAVE=module_5d - {% else %} - {action_respond_info('Warning, tool length less 50mm for calculate skew for the axis X, where use only wcs_2 points!')} - {% endif %} - {% else %} - {action_respond_info('Skew compensation measurement disabled.')} - {% endif %} - -[gcode_macro SET_ECCENTRICITY] -Description: This macro save eccentricity for wcs_1. -gcode: - {% set x1 = params.X1|default(-0.001)|float %} - {% set x2 = params.X2|default(-0.001)|float %} - {% set y1 = params.Y1|default(-0.001)|float %} - {% set y2 = params.Y2|default(-0.001)|float %} - # checking params - {% set max_val = 9.0 %} - {% set max_diff = 2.0 %} - {% for param in [x1, x2, y1, y2] %} - {% if param > max_val or param < -0.001 %} - {action_raise_error('2048: The parameter value is out of range, param=%smm max=%smm, min=0.0mm. Check params.' % (param, max_val))} - {% endif %} - {% endfor %} - {% if (x1 - x2)|abs > max_diff or (y1 - y2)|abs > max_diff %} - {action_raise_error('2049: Large difference between two values (x1-x2 or y1-y2), maximum difference=%smm. Check the parameters.' % max_diff)} - {% endif %} - # applying parameters - {% if x1 >= 0.0 and x2 >= 0.0 %} - {% set offset_x = (x2 - x1) / 2.0 %} - SAVE_VARIABLE VARIABLE=eccentricity_offset_x VALUE={offset_x} - {action_respond_info('offset_x=%.3f; for correcting ECCENTRICITY saved! Please use calibrate mode "auto calibrate the start point" for apply this params.' % offset_x)} - {% endif %} - {% if y1 >= 0.0 and y2 >= 0.0 %} - {% set offset_y = (y1 - y2) / 2.0 %} - SAVE_VARIABLE VARIABLE=eccentricity_offset_y VALUE={offset_y} - {action_respond_info('offset_y=%.3f; for correcting ECCENTRICITY saved! Please use calibrate mode "auto calibrate the start point" for apply this params.' % offset_y)} - {% endif %} - -[gcode_macro APPLY_ECCENTRICITY] -Description: This macro apply eccentricity correction for wcs_1 and wcs_2 to axes XY. -gcode: - {% set svv = printer.save_variables.variables %} - {% set offset_x = svv.eccentricity_offset_x|default(0.0)|float %} - {% set offset_y = svv.eccentricity_offset_y|default(0.0)|float %} - {% set old_wcs1_x = printer.gcode_move.wcs_offsets[1][0] %} - {% set old_wcs1_y = printer.gcode_move.wcs_offsets[1][1] %} - {% set old_wcs2_x = printer.gcode_move.wcs_offsets[2][0] %} - {% set old_wcs2_y = printer.gcode_move.wcs_offsets[2][1] %} - {% set new_wcs1_x = old_wcs1_x + offset_x %} - {% set new_wcs1_y = old_wcs1_y + offset_y %} - {% set new_wcs2_x = old_wcs2_x + offset_x %} - {% set new_wcs2_y = old_wcs2_y + offset_y %} - G10 L2 P2 R1 X{offset_x} - G10 L2 P2 R1 Y{offset_y} - G10 L2 P3 R1 X{offset_x} - G10 L2 P3 R1 Y{offset_y} - {action_respond_info('Old wcs_2_x=%.3f, wcs_2_y=%.3f. New wcs_2_x=%.3f, wcs_2_y=%.3f' % (old_wcs2_x, old_wcs2_y, new_wcs2_x, new_wcs2_y))} - {action_respond_info('Old wcs_1_x=%.3f, wcs_1_y=%.3f. New wcs_1_x=%.3f, wcs_1_y=%.3f' % (old_wcs1_x, old_wcs1_y, new_wcs1_x, new_wcs1_y))} - {action_respond_info('Applied offset for corrective eccentricity. offset_x=%.3f; offset_y=%.3f.' % (offset_x, offset_y))} - SAVE_VARIABLES - -[gcode_macro AUTO_BASEMENT_WCS_MOVE] -description: This macro does a move for measuring wcs_1_z and wcs_2_y-raw mode FULL wcs_2_y and wcs_1_z-raw mode SPIRAL. -gcode: - {% set wcs = params.WCS|default(0)|int %} - {% set offsets = printer.probe.offsets %} - {% set wcs_offsets = printer.gcode_move.wcs_offsets[wcs + 3] %} - {% set max_z = printer.toolhead.axis_maximum[2]|float %} - {% set x = wcs_offsets[0] - offsets[0] %} - {% set y = wcs_offsets[1] - offsets[1] %} - {% set z = wcs_offsets[2] + offsets[2] %} - {% set a = '0' if wcs == 0 else '90' %} - G28 A - G0 A{a} F3600 - G0 Z{max_z / 2} F3600 - G0 X{x} Y{y} F3600 diff --git a/stereotech_config/HTE750-0-0-23.cfg b/stereotech_config/HTE750-0-0-23.cfg index c1273f371393..b27fea1843bc 100644 --- a/stereotech_config/HTE750-0-0-23.cfg +++ b/stereotech_config/HTE750-0-0-23.cfg @@ -29,37 +29,30 @@ path: /home/ste/uploads [include config/common/extruder_macros.cfg] [include config/common/filament_control.cfg] [include config/common/filament_control_second.cfg] - -# sections probe -# [include config/calibrate/probe_5-8-23.cfg] -# [include config/calibrate/probe_3d.cfg] -# [include config/calibrate/probe_5d.cfg] -# [include config/calibrate/probe_5d_tool.cfg] -# [include config/calibrate/probe_5d_template.cfg] -# [include config/calibrate/probe_v2.cfg] -# # sections new probe need adapted its -[include config/750/probe_main.cfg] -[include config/750/probe_v3.cfg] - -# [include config/750/nozzle_offset.cfg] -[include config/common/extruder_macros.cfg] # [include config/750/power_control.cfg] [include config/750/module_3d.cfg] [include config/750/module_3d_macros.cfg] [include config/750/module_5d.cfg] +# sections probe +[include config/750/calibrate/probe_750.cfg] +[include config/750/calibrate/probe_v3.cfg] +[include config/calibrate/probe_3d.cfg] +[include config/calibrate/probe_5d.cfg] +[include config/calibrate/probe_5d_tool.cfg] +[include config/calibrate/probe_5d_template.cfg] + [include config/750/print_macros.cfg] [include config/common/variables.cfg] # [include config/750/diagnostics.cfg] [gcode_macro CONSTANTS] description: Holds printer constants -variable_probe_a_horizontal: 301, 328, 57 -# variable_probe_a_vertical: 301, 328, 107 -variable_probe_a_vertical: 301, 328, 57 +variable_probe_a_horizontal: 303, 329, 57 +variable_probe_a_vertical: 303, 325, 55 variable_offsets_sensor: -60, -6, 29.0 -variable_extruder_load_length: 210 +variable_extruder_load_length: 210 variable_extruder1_load_length: 1650 # variable_path_to_model_nozzle_offset: '/home/ste/klipper/config/common/model_hybrid_nozzle_offset.gcode' gcode: diff --git a/stereotech_config/calibrate/probe_3d.cfg b/stereotech_config/calibrate/probe_3d.cfg index ffde0fe51f61..37631e217334 100644 --- a/stereotech_config/calibrate/probe_3d.cfg +++ b/stereotech_config/calibrate/probe_3d.cfg @@ -2,7 +2,11 @@ description: 3D module calibration gcode: {% if printer["gcode_button five_axis_module"].state == "RELEASED" %} - G0 X197 Y195 F6000 + {% set axis_max = printer.toolhead.axis_maximum %} + {% set offsets = printer.probe.offsets %} + {% set center_probe_x = (axis_max[0] / 2.0) - offsets[0] %} + {% set center_probe_y = (axis_max[1] / 2.0) - offsets[1] %} + G0 X{center_probe_x} Y{center_probe_y} F6000 G0 Z40 F3600 PROBE G91 @@ -12,7 +16,7 @@ gcode: G91 G0 Z30 F3600 G90 - G0 X150 Y50 F3600 + G0 X{center_probe_x + offsets[0]} Y50 F3600 {% endif %} [gcode_macro MODULE_THREE_D_MESH_CALIBRATE] diff --git a/stereotech_config/calibrate/probe_5d.cfg b/stereotech_config/calibrate/probe_5d.cfg index f38ea9d52217..6feb294c4832 100644 --- a/stereotech_config/calibrate/probe_5d.cfg +++ b/stereotech_config/calibrate/probe_5d.cfg @@ -33,7 +33,8 @@ gcode: {% set safe_distance_z = (probe_a_vertical[2] + 70 + offsets[2]) if a_deg == 'A90' else (probe_a_horizontal[2] + 20 + offsets[2]) %} {% set axis = ax[-1] %} {% set positive = 0 if (ax[0] == 'M' or ax[0] == 'Z') else 1 %} - {% if p == 'A' %} + + {% if p == 'A' and target_a == 0.0 %} {% set target_y = target_y - 4 %} {% elif p == 'B' %} {% if target_a == 0.0 and target_c == 0.0 %} @@ -53,11 +54,13 @@ gcode: {% set target_x = target_x + 50 %} {% set target_y = target_y - 4 %} {% endif %} + {% if ax != 'Z' %} {% set target_z = target_z - 6 %} {% else %} {% set target_z = target_z + 20 %} {% endif %} + {% if ax == 'X' %} {% set target_x = target_x - 20 %} {% set axis = 'X' %} diff --git a/stereotech_config/calibrate/probe_5d_template.cfg b/stereotech_config/calibrate/probe_5d_template.cfg index a91145a25c4e..ac4f80c5076a 100644 --- a/stereotech_config/calibrate/probe_5d_template.cfg +++ b/stereotech_config/calibrate/probe_5d_template.cfg @@ -61,6 +61,10 @@ gcode: gcode: {% set set_xy = params.XY|default(0) %} {% set y_shift = 50 if set_xy else 7 %} + ; make a check to avoid collision of the sensor and the template for printer v750 + {% if y_shift == 7 and printer.extruder and printer.extruder1 and printer.extruder2 %} + {% set y_shift = y_shift + 15 %} + {% endif %} {% if printer["gcode_button five_axis_module"].state == "PRESSED" %} G0 X{printer.auto_wcs.wcs[0][0]} Y{printer.auto_wcs.wcs[0][1] - y_shift} Z{printer.auto_wcs.wcs[0][2] + 10} F3600 {% endif %} @@ -126,18 +130,16 @@ gcode: [gcode_macro SET_WCS_FROM_AUTO_WCS] gcode: {% set auto_wcs_params = printer.auto_wcs.wcs %} + {% set max_x = printer.toolhead.axis_maximum[0]|float %} + {% set max_z = printer.toolhead.axis_maximum[2]|float %} G10 L2 P2 X{auto_wcs_params[0][0]} Y{auto_wcs_params[0][1]} Z{auto_wcs_params[0][2]} G10 L2 P4 X{auto_wcs_params[0][0]} Y{auto_wcs_params[0][1]} Z{auto_wcs_params[0][2]} G10 L2 P3 X{auto_wcs_params[1][0]} Y{auto_wcs_params[1][1]} Z{auto_wcs_params[1][2]} G10 L2 P5 X{auto_wcs_params[1][0]} Y{auto_wcs_params[1][1]} Z{auto_wcs_params[1][2]} G90 - G0 Z150 F1500 + G0 Z{max_z / 2.0} F3600 G54 - {% if printer.toolhead.axis_maximum[0] > 250 %} - G0 X150 Y50 F3600 - {% else %} - G0 X100 Y50 F3600 - {% endif %} + G0 X{max_x / 2.0} Y50 F3600 [gcode_macro MOVE_ACCURACY_SET_MODULE_FIVE_D] Description: This macro do moved for accuracy set the module 5d.