From 30317978cd8591ce7f8a91d159a097887c441a6f Mon Sep 17 00:00:00 2001 From: sokolovjek Date: Wed, 14 Feb 2024 07:11:40 +0000 Subject: [PATCH 1/9] STEAPP-914: added main logic for used the new fan for cooling extruders. Printer v630 --- stereotech_config/630/board_stm32f4.cfg | 3 +- stereotech_config/630/chamber.cfg | 38 +++++++++++++++---------- stereotech_config/630/printhead.cfg | 21 ++++++++++++++ stereotech_config/HTE630-0-C-23.cfg | 2 +- 4 files changed, 47 insertions(+), 17 deletions(-) create mode 100644 stereotech_config/630/printhead.cfg diff --git a/stereotech_config/630/board_stm32f4.cfg b/stereotech_config/630/board_stm32f4.cfg index a682fc1711ea..a50cbb00ea21 100644 --- a/stereotech_config/630/board_stm32f4.cfg +++ b/stereotech_config/630/board_stm32f4.cfg @@ -6,7 +6,7 @@ aliases: a_step_pin=PG4, a_dir_pin=PC1, a_en_pin=PA0, a_endstop_pin=PG11, c_step_pin=PF9, c_dir_pin=PF10, c_en_pin=PG2, c_endstop_pin=PB7, bed_heater=PA1, bed_sensor=PF5, - five_axis_pin=PG12, heatsink_fan_pin=PD12, + five_axis_pin=PG12, main_extruder_step_pin=PC13, main_extruder_dir_pin=PF0, main_extruder_enable_pin=PF1, main_extruder_heater_pin=PA2, main_extruder_sensor_pin=PF3, @@ -18,5 +18,6 @@ aliases: fiber_cut_step_pin=PE6, fiber_cut_dir_pin=PA14, fiber_cut_enable_pin=PE0, case_led=PE5, status_led=PB0, + heatsink_fan_pin=PD12, sensor_heatsink_fan_pin=PF7, # for debug fan_pin=PD15, diff --git a/stereotech_config/630/chamber.cfg b/stereotech_config/630/chamber.cfg index bedbd36c44b5..c9040e44892e 100644 --- a/stereotech_config/630/chamber.cfg +++ b/stereotech_config/630/chamber.cfg @@ -14,30 +14,38 @@ target_temp: 45.0 min_speed: 0.0 gcode_id: E +[servo heatsink_servo] +pin: manta_mcu:PC6 +initial_angle: 180 + [gcode_macro M106] rename_existing: M106.1 gcode: - {% set p = params.P|default(0)|int %} {% set s = params.S|default(0)|int %} - {% if p > 0 %} - {% if p == 3 %} - SET_FAN_SPEED FAN=chamber_fan SPEED={params.S|default(0)|int / 255} - {% endif %} - {% else %} - M106.1 S{s} + # extruyder1 79-0 (0% - 100%) 79 + {% set allowed_motion_extruder1 = 79.0 %} + {% set start_pos_extruder1 = 79 %} + # extruder2 106-180 (0% - 100%) 74 + {% set allowed_motion_extruder2 = 74.0 %} + {% set start_pos_extruder2 = 106 %} + + {% set curr_ex = printer.toolhead.extruder %} + + {% if curr_ex == 'extruder' %} + {% set ko = allowed_motion_extruder1 / 255 %} + {% set angle = (start_pos_extruder1 - (ko * s))|round %} + + {% elif curr_ex == 'extruder1' %} + {% set ko = allowed_motion_extruder2 / 255 %} + {% set angle = (start_pos_extruder2 + (ko * s))|round %} {% endif %} + { action_respond_info('----------ex=%s----SET_SERVO SERVO=heatsink_servo ANGLE=%s' % (curr_ex, angle)) } + # SET_SERVO SERVO=heatsink_servo ANGLE={angle} [gcode_macro M107] rename_existing: M107.1 gcode: - {% set p = params.P|default(0)|int %} - {% if p > 0 %} - {% if p == 3 %} - SET_FAN_SPEED FAN=chamber_fan SPEED=0.0 - {% endif %} - {% else %} - M107.1 - {% endif %} + SET_SERVO SERVO=heatsink_servo ANGLE=90 # LED Light controls diff --git a/stereotech_config/630/printhead.cfg b/stereotech_config/630/printhead.cfg new file mode 100644 index 000000000000..9b53f85d8a7d --- /dev/null +++ b/stereotech_config/630/printhead.cfg @@ -0,0 +1,21 @@ +[fan] +pin: fan_pin + +# [heater_fan heatsink_fan] +# pin: heatsink_fan_pin +# heater: extruder, extruder1 +# heater_temp: 50.0 + +[temperature_fan heatsink_fan] +pin: heatsink_fan_pin +sensor_type: Trianglelab T-D500 +sensor_pin: sensor_heatsink_fan_pin +control: pid +pid_Kp: 15 +pid_Ki: 0.5 +pid_Kd: 25 +min_temp: 0 +max_temp: 400 +target_temp: 70.0 +min_speed: 0.0 +gcode_id: H diff --git a/stereotech_config/HTE630-0-C-23.cfg b/stereotech_config/HTE630-0-C-23.cfg index 85bc0bc5497a..112045ddb1cb 100644 --- a/stereotech_config/HTE630-0-C-23.cfg +++ b/stereotech_config/HTE630-0-C-23.cfg @@ -16,7 +16,7 @@ path: /home/ste/uploads [include config/630/chamber.cfg] -[include config/common/printhead.cfg] +[include config/630/printhead.cfg] # sections probe [include config/calibrate/probe_5-8-23.cfg] From 6afb709105170c67341b0f927d142e55d48d377f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A1=D0=BE=D0=BA=D0=BE=D0=BB=D0=BE=D0=B2=20=D0=95=D0=B2?= =?UTF-8?q?=D0=B3=D0=B5=D0=BD=D0=B8=D0=B9?= Date: Wed, 14 Feb 2024 12:50:38 +0300 Subject: [PATCH 2/9] STEAPP-872: edited servo config, for run test move --- stereotech_config/630/board_stm32f4.cfg | 2 +- stereotech_config/630/chamber.cfg | 17 +++++++++---- stereotech_config/630/printhead.cfg | 34 ++++++++++++------------- 3 files changed, 30 insertions(+), 23 deletions(-) diff --git a/stereotech_config/630/board_stm32f4.cfg b/stereotech_config/630/board_stm32f4.cfg index a50cbb00ea21..e89f9aa69f34 100644 --- a/stereotech_config/630/board_stm32f4.cfg +++ b/stereotech_config/630/board_stm32f4.cfg @@ -18,6 +18,6 @@ aliases: fiber_cut_step_pin=PE6, fiber_cut_dir_pin=PA14, fiber_cut_enable_pin=PE0, case_led=PE5, status_led=PB0, - heatsink_fan_pin=PD12, sensor_heatsink_fan_pin=PF7, + heatsink_fan_pin=PD12, heatsink_sensor_pin=PF7, heatsink_servo_pin=PD7, # for debug fan_pin=PD15, diff --git a/stereotech_config/630/chamber.cfg b/stereotech_config/630/chamber.cfg index c9040e44892e..8d9a3dfd802d 100644 --- a/stereotech_config/630/chamber.cfg +++ b/stereotech_config/630/chamber.cfg @@ -15,12 +15,21 @@ min_speed: 0.0 gcode_id: E [servo heatsink_servo] -pin: manta_mcu:PC6 -initial_angle: 180 +pin: heatsink_servo_pin +maximum_servo_angle: 180 +minimum_pulse_width: 0.0003 +maximum_pulse_width: 0.0026 +initial_angle: 90 + +# [servo servo_probe] +# pin: PB7 +# initial_angle: 180 [gcode_macro M106] rename_existing: M106.1 gcode: + {% set curr_ex = printer.toolhead.extruder %} + {% set s = params.S|default(0)|int %} # extruyder1 79-0 (0% - 100%) 79 {% set allowed_motion_extruder1 = 79.0 %} @@ -29,8 +38,6 @@ gcode: {% set allowed_motion_extruder2 = 74.0 %} {% set start_pos_extruder2 = 106 %} - {% set curr_ex = printer.toolhead.extruder %} - {% if curr_ex == 'extruder' %} {% set ko = allowed_motion_extruder1 / 255 %} {% set angle = (start_pos_extruder1 - (ko * s))|round %} @@ -40,7 +47,7 @@ gcode: {% set angle = (start_pos_extruder2 + (ko * s))|round %} {% endif %} { action_respond_info('----------ex=%s----SET_SERVO SERVO=heatsink_servo ANGLE=%s' % (curr_ex, angle)) } - # SET_SERVO SERVO=heatsink_servo ANGLE={angle} + SET_SERVO SERVO=heatsink_servo ANGLE={angle} [gcode_macro M107] rename_existing: M107.1 diff --git a/stereotech_config/630/printhead.cfg b/stereotech_config/630/printhead.cfg index 9b53f85d8a7d..1c8c7cc4c61f 100644 --- a/stereotech_config/630/printhead.cfg +++ b/stereotech_config/630/printhead.cfg @@ -1,21 +1,21 @@ [fan] pin: fan_pin -# [heater_fan heatsink_fan] -# pin: heatsink_fan_pin -# heater: extruder, extruder1 -# heater_temp: 50.0 - -[temperature_fan heatsink_fan] +[heater_fan heatsink_fan] pin: heatsink_fan_pin -sensor_type: Trianglelab T-D500 -sensor_pin: sensor_heatsink_fan_pin -control: pid -pid_Kp: 15 -pid_Ki: 0.5 -pid_Kd: 25 -min_temp: 0 -max_temp: 400 -target_temp: 70.0 -min_speed: 0.0 -gcode_id: H +heater: extruder, extruder1 +heater_temp: 50.0 + +# [temperature_fan heatsink_fan] +# pin: heatsink_fan_pin +# sensor_type: NTC 100K MGB18-104F39050L32 +# sensor_pin: heatsink_sensor_pin +# control: pid +# pid_Kp: 15 +# pid_Ki: 0.5 +# pid_Kd: 25 +# min_temp: 0 +# max_temp: 90 +# target_temp: 45.0 +# min_speed: 0.0 +# gcode_id: H From b7cca321195ed8eb5fc91d47b55c11d4c59ff0e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A1=D0=BE=D0=BA=D0=BE=D0=BB=D0=BE=D0=B2=20=D0=95=D0=B2?= =?UTF-8?q?=D0=B3=D0=B5=D0=BD=D0=B8=D0=B9?= Date: Thu, 15 Feb 2024 09:26:41 +0300 Subject: [PATCH 3/9] STEAPP-914: setting the heatsink fan --- stereotech_config/630/chamber.cfg | 43 +------------- stereotech_config/630/main_extruder.cfg | 2 +- stereotech_config/630/printhead.cfg | 74 ++++++++++++++++++------- 3 files changed, 59 insertions(+), 60 deletions(-) diff --git a/stereotech_config/630/chamber.cfg b/stereotech_config/630/chamber.cfg index 8d9a3dfd802d..00e27ef1c8a2 100644 --- a/stereotech_config/630/chamber.cfg +++ b/stereotech_config/630/chamber.cfg @@ -1,3 +1,6 @@ +[fan] +pin: fan_pin + [fan_generic chamber_fan] pin: PA8 @@ -14,46 +17,6 @@ target_temp: 45.0 min_speed: 0.0 gcode_id: E -[servo heatsink_servo] -pin: heatsink_servo_pin -maximum_servo_angle: 180 -minimum_pulse_width: 0.0003 -maximum_pulse_width: 0.0026 -initial_angle: 90 - -# [servo servo_probe] -# pin: PB7 -# initial_angle: 180 - -[gcode_macro M106] -rename_existing: M106.1 -gcode: - {% set curr_ex = printer.toolhead.extruder %} - - {% set s = params.S|default(0)|int %} - # extruyder1 79-0 (0% - 100%) 79 - {% set allowed_motion_extruder1 = 79.0 %} - {% set start_pos_extruder1 = 79 %} - # extruder2 106-180 (0% - 100%) 74 - {% set allowed_motion_extruder2 = 74.0 %} - {% set start_pos_extruder2 = 106 %} - - {% if curr_ex == 'extruder' %} - {% set ko = allowed_motion_extruder1 / 255 %} - {% set angle = (start_pos_extruder1 - (ko * s))|round %} - - {% elif curr_ex == 'extruder1' %} - {% set ko = allowed_motion_extruder2 / 255 %} - {% set angle = (start_pos_extruder2 + (ko * s))|round %} - {% endif %} - { action_respond_info('----------ex=%s----SET_SERVO SERVO=heatsink_servo ANGLE=%s' % (curr_ex, angle)) } - SET_SERVO SERVO=heatsink_servo ANGLE={angle} - -[gcode_macro M107] -rename_existing: M107.1 -gcode: - SET_SERVO SERVO=heatsink_servo ANGLE=90 - # LED Light controls [led case_led] diff --git a/stereotech_config/630/main_extruder.cfg b/stereotech_config/630/main_extruder.cfg index 5ff45b0b9717..f2306923522c 100644 --- a/stereotech_config/630/main_extruder.cfg +++ b/stereotech_config/630/main_extruder.cfg @@ -14,7 +14,7 @@ pid_Kp: 13.509 pid_Ki: 0.566 pid_Kd: 80.549 min_temp: -150 -max_temp: 500 +max_temp: 450 min_extrude_temp: 100 max_extrude_only_distance: 300.0 max_extrude_cross_section: 2.56 diff --git a/stereotech_config/630/printhead.cfg b/stereotech_config/630/printhead.cfg index 1c8c7cc4c61f..8dad6600fa3a 100644 --- a/stereotech_config/630/printhead.cfg +++ b/stereotech_config/630/printhead.cfg @@ -1,21 +1,57 @@ -[fan] -pin: fan_pin - -[heater_fan heatsink_fan] +[temperature_fan heatsink_fan] pin: heatsink_fan_pin -heater: extruder, extruder1 -heater_temp: 50.0 +#enable_pin: +# See the "fan" section for a description of the above parameters. +sensor_type: NTC 100K MGB18-104F39050L32 +sensor_pin: heatsink_sensor_pin +# control: watermark +control: pid +pid_Kp: 15 +pid_Ki: 0.5 +pid_Kd: 25 +min_temp: 0 +max_temp: 100 +target_temp: 30.0 +gcode_id: H +min_speed: 0.5 +max_speed: 1.0 + +[servo heatsink_servo] +pin: heatsink_servo_pin +maximum_servo_angle: 180 +minimum_pulse_width: 0.0003 +maximum_pulse_width: 0.0026 +initial_angle: 90 + +# [servo servo_probe] +# pin: PB7 +# initial_angle: 180 + +[gcode_macro M106] +rename_existing: M106.1 +gcode: + {% set curr_ex = printer.toolhead.extruder %} + + {% set s = params.S|default(0)|int %} + # extruyder1 79-0 (0% - 100%) 79 + {% set allowed_motion_extruder1 = 79.0 %} + {% set start_pos_extruder1 = 79 %} + # extruder2 106-180 (0% - 100%) 74 + {% set allowed_motion_extruder2 = 74.0 %} + {% set start_pos_extruder2 = 106 %} + + {% if curr_ex == 'extruder' %} + {% set ko = allowed_motion_extruder1 / 255 %} + {% set angle = (start_pos_extruder1 - (ko * s))|round %} + + {% elif curr_ex == 'extruder1' %} + {% set ko = allowed_motion_extruder2 / 255 %} + {% set angle = (start_pos_extruder2 + (ko * s))|round %} + {% endif %} + { action_respond_info('----------ex=%s----SET_SERVO SERVO=heatsink_servo ANGLE=%s' % (curr_ex, angle)) } + SET_SERVO SERVO=heatsink_servo ANGLE={angle} -# [temperature_fan heatsink_fan] -# pin: heatsink_fan_pin -# sensor_type: NTC 100K MGB18-104F39050L32 -# sensor_pin: heatsink_sensor_pin -# control: pid -# pid_Kp: 15 -# pid_Ki: 0.5 -# pid_Kd: 25 -# min_temp: 0 -# max_temp: 90 -# target_temp: 45.0 -# min_speed: 0.0 -# gcode_id: H +[gcode_macro M107] +rename_existing: M107.1 +gcode: + SET_SERVO SERVO=heatsink_servo ANGLE=90 From 8fa10d367a6068e18c3851f6ac7ff4411067e3f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A1=D0=BE=D0=BA=D0=BE=D0=BB=D0=BE=D0=B2=20=D0=95=D0=B2?= =?UTF-8?q?=D0=B3=D0=B5=D0=BD=D0=B8=D0=B9?= Date: Thu, 15 Feb 2024 12:33:45 +0300 Subject: [PATCH 4/9] STEAPP-914: setting for the heat sink fan --- stereotech_config/630/printhead.cfg | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/stereotech_config/630/printhead.cfg b/stereotech_config/630/printhead.cfg index 8dad6600fa3a..98ac71449943 100644 --- a/stereotech_config/630/printhead.cfg +++ b/stereotech_config/630/printhead.cfg @@ -1,10 +1,7 @@ [temperature_fan heatsink_fan] pin: heatsink_fan_pin -#enable_pin: -# See the "fan" section for a description of the above parameters. sensor_type: NTC 100K MGB18-104F39050L32 sensor_pin: heatsink_sensor_pin -# control: watermark control: pid pid_Kp: 15 pid_Ki: 0.5 @@ -31,21 +28,15 @@ initial_angle: 90 rename_existing: M106.1 gcode: {% set curr_ex = printer.toolhead.extruder %} - {% set s = params.S|default(0)|int %} - # extruyder1 79-0 (0% - 100%) 79 - {% set allowed_motion_extruder1 = 79.0 %} - {% set start_pos_extruder1 = 79 %} - # extruder2 106-180 (0% - 100%) 74 - {% set allowed_motion_extruder2 = 74.0 %} - {% set start_pos_extruder2 = 106 %} - + # the angle of the blow hole (ex1 (0% - 100%): 75-0; ex2 (0% - 100%):105-180) + {% set angle_hole = 75.0 %} + {% set ko = angle_hole / 255 %} + {% set start_pos_extruder1 = 75 %} + {% set start_pos_extruder2 = 105 %} {% if curr_ex == 'extruder' %} - {% set ko = allowed_motion_extruder1 / 255 %} {% set angle = (start_pos_extruder1 - (ko * s))|round %} - {% elif curr_ex == 'extruder1' %} - {% set ko = allowed_motion_extruder2 / 255 %} {% set angle = (start_pos_extruder2 + (ko * s))|round %} {% endif %} { action_respond_info('----------ex=%s----SET_SERVO SERVO=heatsink_servo ANGLE=%s' % (curr_ex, angle)) } From 7c37d55a567618c848613046225a81c2eabaacdc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A1=D0=BE=D0=BA=D0=BE=D0=BB=D0=BE=D0=B2=20=D0=95=D0=B2?= =?UTF-8?q?=D0=B3=D0=B5=D0=BD=D0=B8=D0=B9?= Date: Thu, 15 Feb 2024 14:16:12 +0300 Subject: [PATCH 5/9] STEAPP-914: setting for the heat sink fan --- stereotech_config/630/printhead.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stereotech_config/630/printhead.cfg b/stereotech_config/630/printhead.cfg index 98ac71449943..b5d5b175d497 100644 --- a/stereotech_config/630/printhead.cfg +++ b/stereotech_config/630/printhead.cfg @@ -1,5 +1,5 @@ [temperature_fan heatsink_fan] -pin: heatsink_fan_pin +pin: !heatsink_fan_pin sensor_type: NTC 100K MGB18-104F39050L32 sensor_pin: heatsink_sensor_pin control: pid From d6f8bda4f3a656721e1039b0272ab34a3b556417 Mon Sep 17 00:00:00 2001 From: sokolovjek Date: Tue, 20 Feb 2024 08:09:02 +0000 Subject: [PATCH 6/9] STEAPP-915: added probe_servo and commands to manage it --- stereotech_config/630/board_stm32f4.cfg | 5 +- stereotech_config/630/calibrate/probe_630.cfg | 102 ++++++++++++++++++ stereotech_config/630/printhead.cfg | 21 +++- stereotech_config/HTE630-0-C-23.cfg | 4 +- 4 files changed, 125 insertions(+), 7 deletions(-) create mode 100644 stereotech_config/630/calibrate/probe_630.cfg diff --git a/stereotech_config/630/board_stm32f4.cfg b/stereotech_config/630/board_stm32f4.cfg index e89f9aa69f34..c9ccfcb57be3 100644 --- a/stereotech_config/630/board_stm32f4.cfg +++ b/stereotech_config/630/board_stm32f4.cfg @@ -4,9 +4,9 @@ aliases: y_step_pin=PG0, y_dir_pin=PG1, y_en_pin=PF15, y_endstop_pin=PG9, z_step_pin=PF11, z_dir_pin=PG3, z_en_pin=PG5, z_endstop_pin=PG10, a_step_pin=PG4, a_dir_pin=PC1, a_en_pin=PA0, a_endstop_pin=PG11, - c_step_pin=PF9, c_dir_pin=PF10, c_en_pin=PG2, c_endstop_pin=PB7, + c_step_pin=PF9, c_dir_pin=PF10, c_en_pin=PG2, c_endstop_pin=PG12, bed_heater=PA1, bed_sensor=PF5, - five_axis_pin=PG12, + five_axis_pin=PB12, main_extruder_step_pin=PC13, main_extruder_dir_pin=PF0, main_extruder_enable_pin=PF1, main_extruder_heater_pin=PA2, main_extruder_sensor_pin=PF3, @@ -19,5 +19,6 @@ aliases: fiber_cut_enable_pin=PE0, case_led=PE5, status_led=PB0, heatsink_fan_pin=PD12, heatsink_sensor_pin=PF7, heatsink_servo_pin=PD7, + probe_pin=PG13, probe_servo=PB7, # for debug fan_pin=PD15, diff --git a/stereotech_config/630/calibrate/probe_630.cfg b/stereotech_config/630/calibrate/probe_630.cfg new file mode 100644 index 000000000000..c98b2e58562d --- /dev/null +++ b/stereotech_config/630/calibrate/probe_630.cfg @@ -0,0 +1,102 @@ +[probe] +pin: !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 +activate_gcode: + {% if printer["servo probe_servo"].value|float > 90.0 %} + {action_respond_info('-------------------more 90')} + {% else %} + {action_respond_info('-------------------less 90')} + {% endif %} + +[bed_mesh] +speed: 120 +horizontal_move_z: 50 +mesh_min: 20, 20 +mesh_max: 261, 245 +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 = 10.0 +max_x = 261.0 +min_y = 10.0 +max_y = 253.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: + PUSH_PROBE_SENSOR ENABLE=1 + 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 + PUSH_PROBE_SENSOR ENABLE=0 + +[gcode_macro AUTO_BASEMENT_WCS] +gcode: + AUTO_BASEMENT_WCS_V2 {rawparams} + MOVE_SERVICE_POSITION_HEAD PARKING=0 + PUSH_PROBE_SENSOR ENABLE=0 + +[gcode_macro ADJUST_BASEMENT_WCS] +gcode: + ; pass diff --git a/stereotech_config/630/printhead.cfg b/stereotech_config/630/printhead.cfg index b5d5b175d497..96b3ef2b2f9a 100644 --- a/stereotech_config/630/printhead.cfg +++ b/stereotech_config/630/printhead.cfg @@ -20,9 +20,24 @@ minimum_pulse_width: 0.0003 maximum_pulse_width: 0.0026 initial_angle: 90 -# [servo servo_probe] -# pin: PB7 -# initial_angle: 180 +[servo probe_servo] +pin: probe_servo +initial_angle: 0 +maximum_servo_angle: 90 + +[gcode_macro PUSH_PROBE_SENSOR] +gcode: + {% set enable = params.ENABLE|default(1)|int %} + {% set status = printer["servo probe_servo"].value|float %} + {% if enable and status == 0.0 %} + {action_respond_info("----------PUSH_PROBE_SENSOR 1")} + SET_SERVO SERVO=heatsink_servo ANGLE=90.0 + {% elif enable == 0 and status == 90.0 %} + {action_respond_info("----------PUSH_PROBE_SENSOR 2")} + SET_SERVO SERVO=heatsink_servo ANGLE=0 + {% else %} + {action_respond_info("----------PUSH_PROBE_SENSOR 3")} + {% endif %} [gcode_macro M106] rename_existing: M106.1 diff --git a/stereotech_config/HTE630-0-C-23.cfg b/stereotech_config/HTE630-0-C-23.cfg index 112045ddb1cb..79fe29315093 100644 --- a/stereotech_config/HTE630-0-C-23.cfg +++ b/stereotech_config/HTE630-0-C-23.cfg @@ -19,7 +19,7 @@ path: /home/ste/uploads [include config/630/printhead.cfg] # sections probe -[include config/calibrate/probe_5-8-23.cfg] +[include config/630/calibrate/probe_630.cfg] [include config/calibrate/probe_3d.cfg] [include config/calibrate/probe_5d.cfg] [include config/calibrate/probe_5d_tool.cfg] @@ -47,7 +47,7 @@ path: /home/ste/uploads description: Holds printer constants variable_probe_a_horizontal: 159, 248, 40 variable_probe_a_vertical: 159, 235, 35 -variable_offsets_sensor: -42.0, -33.1, 22.5 +variable_offsets_sensor: -2.4, -94.8, 10.8 variable_extruder_load_length: 130 variable_extruder1_load_length: 1600 variable_path_to_model_nozzle_offset: '/home/ste/klipper/config/common/model_hybrid_nozzle_offset.gcode' From 9ace78a2550626239ecea43cf5701240bbbe61a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A1=D0=BE=D0=BA=D0=BE=D0=BB=D0=BE=D0=B2=20=D0=95=D0=B2?= =?UTF-8?q?=D0=B3=D0=B5=D0=BD=D0=B8=D0=B9?= Date: Tue, 20 Feb 2024 15:44:45 +0300 Subject: [PATCH 7/9] STEAPP-915: added main code for support autocalibrate the 3d_mesh, printer v630 --- stereotech_config/630/calibrate/probe_630.cfg | 13 ++- stereotech_config/630/module_5d.cfg | 107 ++++++++++++++++++ stereotech_config/630/printhead.cfg | 12 +- stereotech_config/HTE630-0-C-23.cfg | 4 +- stereotech_config/common/module_3d_macros.cfg | 2 +- 5 files changed, 123 insertions(+), 15 deletions(-) create mode 100644 stereotech_config/630/module_5d.cfg diff --git a/stereotech_config/630/calibrate/probe_630.cfg b/stereotech_config/630/calibrate/probe_630.cfg index c98b2e58562d..6c2a4e7b10f7 100644 --- a/stereotech_config/630/calibrate/probe_630.cfg +++ b/stereotech_config/630/calibrate/probe_630.cfg @@ -8,17 +8,18 @@ x_offset: 0.0 y_offset: 0.0 z_offset: 0.0 activate_gcode: - {% if printer["servo probe_servo"].value|float > 90.0 %} - {action_respond_info('-------------------more 90')} + {% if printer["servo probe_servo"].value|float > 0.005 %} + {action_respond_info('----------template probe ON')} + PUSH_PROBE_SENSOR {% else %} - {action_respond_info('-------------------less 90')} + {action_respond_info('----------template probe OFF')} {% endif %} [bed_mesh] speed: 120 -horizontal_move_z: 50 -mesh_min: 20, 20 -mesh_max: 261, 245 +horizontal_move_z: 30 +mesh_min: 10, -97 +mesh_max: 310, 133 probe_count: 6, 6 fade_start: 1 fade_end: 10 diff --git a/stereotech_config/630/module_5d.cfg b/stereotech_config/630/module_5d.cfg new file mode 100644 index 000000000000..113ec7c964db --- /dev/null +++ b/stereotech_config/630/module_5d.cfg @@ -0,0 +1,107 @@ +[gcode_button five_axis_module] +pin: five_axis_pin +press_gcode: + QUERY_BUTTON BUTTON=five_axis_module + ; if the 3d module is changed to 5d, need to reset the offset. Duration is the 5 sec, for run code after LOAD_VARIABLES + UPDATE_DELAYED_GCODE ID=RESET_GCODE_OFFSET DURATION=5.0 + +[delayed_gcode RESET_GCODE_OFFSET] +gcode: + {action_respond_info("Reset gcode_offset")} + SET_GCODE_OFFSET X=0.0 Y=0.0 Z=0.0 + +[a_axis_offset] + +[gcode_macro MOVE_WCS_ZERO] +description: The macro for manual calibration of the 5_d module using the tool, makes movements to determine the points wcs_1 and wcs_2 +gcode: + {% set current_wcs = params.WCS|default(1)|int %} + {% set offsets = printer.gcode_move.wcs_offsets[current_wcs] %} + {% set wcs_probe_1 = printer["gcode_macro CONSTANTS"].probe_a_horizontal %} + {% set wcs_probe_2 = printer["gcode_macro CONSTANTS"].probe_a_vertical %} + {% set x = wcs_probe_1[0] if (offsets[0] == 0 and offsets[1] == 0) else offsets[0] %} + {% set y = wcs_probe_1[1] if (offsets[0] == 0 and offsets[1] == 0) else offsets[1] %} + {% set z = printer.toolhead.axis_maximum[0] / 2 %} + {% set a = 0 if current_wcs == 1 else 90 %} + G54 + G0 Z{z} F3600 + G0 X{x} Y{y} A{a} F3600 + {% if current_wcs == 2 %} + {% set y = wcs_probe_2[1] - 45 %} + G0 Y{y} F3600 + {% endif %} + +[gcode_macro SET_WCS_OFFSET] +description: The macro for the set wcs after manual calibrate 5d module +gcode: + G54 + G90 + {% set current_wcs = params.WCS|default(1)|int %} + SET_WCS WCS={current_wcs} + G10 L20 X{params.X} Y{params.Y} Z{params.Z} + G54 + {% set adjust_wcs = params.ADJUST_WCS|default(0)|int %} + {% if adjust_wcs > 0 and adjust_wcs != current_wcs %} + {% if adjust_wcs == 1 %} + ADJUST_OFFSET_WCS1 X={params.X} Y={params.Y} Z={params.Z} + {% elif adjust_wcs == 2 %} + ADJUST_OFFSET_WCS2 X={params.X} Y={params.Y} Z={params.Z} + {% endif %} + {% endif %} + +[gcode_macro ADJUST_OFFSET_WCS1] +gcode: + {% set wcs3 = printer.gcode_move.wcs_offsets[3] %} + {% set delta_x = printer.gcode_move.wcs_offsets[4][0] - printer.gcode_move.wcs_offsets[2][0] %} + {% set delta_y = printer.gcode_move.wcs_offsets[4][1] - printer.gcode_move.wcs_offsets[2][1] %} + {% set delta_z = printer.gcode_move.wcs_offsets[4][2] - printer.gcode_move.wcs_offsets[2][2] %} + G10 L2 P2 X{wcs3[0] - delta_x + params.X|float} Y{wcs3[1] - delta_z} Z{wcs3[2] + delta_y + params.Y|float} + +[gcode_macro ADJUST_OFFSET_WCS2] +gcode: + {% set wcs4 = printer.gcode_move.wcs_offsets[4] %} + {% set delta_x = printer.gcode_move.wcs_offsets[3][0] - printer.gcode_move.wcs_offsets[1][0] %} + {% set delta_y = printer.gcode_move.wcs_offsets[3][1] - printer.gcode_move.wcs_offsets[1][1] %} + {% set delta_z = printer.gcode_move.wcs_offsets[3][2] - printer.gcode_move.wcs_offsets[1][2] %} + G10 L2 P3 X{wcs4[0] - delta_x + params.X|float} Y{wcs4[1] + delta_z + params.Z|float} Z{wcs4[2] - delta_y + params.Y|float} + +[gcode_macro MOVE_CALIBRATION_POINT] +description: movements for calibration of the 5d module +gcode: + {% set point = params.POINT|default(0)|int %} + {% set wcs_1 = printer["gcode_macro CONSTANTS"].probe_a_horizontal %} + {% set wcs_2 = printer["gcode_macro CONSTANTS"].probe_a_vertical %} + {% set x = wcs_1[0] + 2 %} + {% set y = wcs_1[1] %} + {% set z = wcs_1[2] + 50 %} + {% set a = 0 %} + G54 + {% if point == 1 %} + {% set x = wcs_1[0] - 55 %} + {% elif point == 2 %} + {% set x = wcs_1[0] + 55 %} + {% elif point == 3 %} + {% set y = wcs_1[1] - 50 %} + {% elif point == 4 %} + {% set y = wcs_2[1] - 40 %} + G0 X{x} Y{y} Z{z} A{a} F3600 + {% set z = wcs_2[2] + 30 %} + {% set a = 90 %} + {% endif %} + G0 X{x} Y{y} Z{z} A{a} C0 F3600 + +[gcode_macro SET_A_AXIS_OFFSET_POINT] +gcode: + {% set point = params.POINT|default(0)|int %} + {% set coord_x = printer.gcode_move.position.x %} + {% set coord_y = printer.gcode_move.position.y %} + {% set coord_z = printer.gcode_move.position.z %} + SAVE_A_AXIS_POINT POINT={point} COORDS={coord_x},{coord_y},{coord_z} + +[gcode_macro SAVE_STATE_MODULE] +gcode: + {% if printer["gcode_button five_axis_module"].state == "RELEASED" %} + SAVE_VARIABLE VARIABLE=5d_module_enabled VALUE=0 + {% else %} + SAVE_VARIABLE VARIABLE=5d_module_enabled VALUE=1 + {% endif %} diff --git a/stereotech_config/630/printhead.cfg b/stereotech_config/630/printhead.cfg index 96b3ef2b2f9a..4f056c1708ea 100644 --- a/stereotech_config/630/printhead.cfg +++ b/stereotech_config/630/printhead.cfg @@ -22,19 +22,19 @@ initial_angle: 90 [servo probe_servo] pin: probe_servo -initial_angle: 0 -maximum_servo_angle: 90 +initial_angle: 140 +maximum_servo_angle: 180 [gcode_macro PUSH_PROBE_SENSOR] gcode: {% set enable = params.ENABLE|default(1)|int %} {% set status = printer["servo probe_servo"].value|float %} - {% if enable and status == 0.0 %} + {% if enable %} {action_respond_info("----------PUSH_PROBE_SENSOR 1")} - SET_SERVO SERVO=heatsink_servo ANGLE=90.0 - {% elif enable == 0 and status == 90.0 %} + SET_SERVO SERVO=probe_servo ANGLE=0 + {% elif enable == 0 %} {action_respond_info("----------PUSH_PROBE_SENSOR 2")} - SET_SERVO SERVO=heatsink_servo ANGLE=0 + SET_SERVO SERVO=probe_servo ANGLE=140 {% else %} {action_respond_info("----------PUSH_PROBE_SENSOR 3")} {% endif %} diff --git a/stereotech_config/HTE630-0-C-23.cfg b/stereotech_config/HTE630-0-C-23.cfg index 79fe29315093..e173891e4dc3 100644 --- a/stereotech_config/HTE630-0-C-23.cfg +++ b/stereotech_config/HTE630-0-C-23.cfg @@ -36,7 +36,7 @@ path: /home/ste/uploads [include config/630/module_3d.cfg] [include config/common/module_3d_macros.cfg] -[include config/5xx/module_5d.cfg] +[include config/630/module_5d.cfg] [include config/common/print_macros.cfg] [include config/common/variables.cfg] @@ -47,7 +47,7 @@ path: /home/ste/uploads description: Holds printer constants variable_probe_a_horizontal: 159, 248, 40 variable_probe_a_vertical: 159, 235, 35 -variable_offsets_sensor: -2.4, -94.8, 10.8 +variable_offsets_sensor: -2, -97, 10 variable_extruder_load_length: 130 variable_extruder1_load_length: 1600 variable_path_to_model_nozzle_offset: '/home/ste/klipper/config/common/model_hybrid_nozzle_offset.gcode' diff --git a/stereotech_config/common/module_3d_macros.cfg b/stereotech_config/common/module_3d_macros.cfg index 082c2d6f8102..03ef39d9c40c 100644 --- a/stereotech_config/common/module_3d_macros.cfg +++ b/stereotech_config/common/module_3d_macros.cfg @@ -25,7 +25,7 @@ gcode: TOGGLE_LIGHT {% endif %} SET_GCODE_OFFSET Z=0 - G28 + G28 Z G92 E0 {% set x = printer.toolhead.axis_maximum[0]|float / 2.0 %} {% set y = printer.toolhead.axis_maximum[1]|float / 2.0 %} From dd06993037bc8b17a1ec9f7dacc6d0fc0e047816 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A1=D0=BE=D0=BA=D0=BE=D0=BB=D0=BE=D0=B2=20=D0=95=D0=B2?= =?UTF-8?q?=D0=B3=D0=B5=D0=BD=D0=B8=D0=B9?= Date: Tue, 20 Feb 2024 16:36:28 +0300 Subject: [PATCH 8/9] STEAPP-915: added code for support autocalibrate the 3d_mesh, printer v630 --- stereotech_config/630/calibrate/probe_630.cfg | 7 +---- stereotech_config/630/probe_3d.cfg | 30 +++++++++++++++++++ stereotech_config/HTE630-0-C-23.cfg | 2 +- 3 files changed, 32 insertions(+), 7 deletions(-) create mode 100644 stereotech_config/630/probe_3d.cfg diff --git a/stereotech_config/630/calibrate/probe_630.cfg b/stereotech_config/630/calibrate/probe_630.cfg index 6c2a4e7b10f7..a5b660494930 100644 --- a/stereotech_config/630/calibrate/probe_630.cfg +++ b/stereotech_config/630/calibrate/probe_630.cfg @@ -8,12 +8,7 @@ x_offset: 0.0 y_offset: 0.0 z_offset: 0.0 activate_gcode: - {% if printer["servo probe_servo"].value|float > 0.005 %} - {action_respond_info('----------template probe ON')} - PUSH_PROBE_SENSOR - {% else %} - {action_respond_info('----------template probe OFF')} - {% endif %} + PUSH_PROBE_SENSOR [bed_mesh] speed: 120 diff --git a/stereotech_config/630/probe_3d.cfg b/stereotech_config/630/probe_3d.cfg new file mode 100644 index 000000000000..6e453121e876 --- /dev/null +++ b/stereotech_config/630/probe_3d.cfg @@ -0,0 +1,30 @@ +[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 - 150} 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 + PUSH_PROBE_SENSOR ENABLE=0 + {% 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/HTE630-0-C-23.cfg b/stereotech_config/HTE630-0-C-23.cfg index e173891e4dc3..4f1ad48e9734 100644 --- a/stereotech_config/HTE630-0-C-23.cfg +++ b/stereotech_config/HTE630-0-C-23.cfg @@ -20,7 +20,7 @@ path: /home/ste/uploads # sections probe [include config/630/calibrate/probe_630.cfg] -[include config/calibrate/probe_3d.cfg] +[include config/630/probe_3d.cfg] [include config/calibrate/probe_5d.cfg] [include config/calibrate/probe_5d_tool.cfg] [include config/calibrate/probe_5d_template.cfg] From 03920fbe41d9ef56cbdafc07ac071c7998c79989 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A1=D0=BE=D0=BA=D0=BE=D0=BB=D0=BE=D0=B2=20=D0=95=D0=B2?= =?UTF-8?q?=D0=B3=D0=B5=D0=BD=D0=B8=D0=B9?= Date: Tue, 20 Feb 2024 16:38:11 +0300 Subject: [PATCH 9/9] STEAPP-915: added code for managing to the second extruder, printer v630 --- stereotech_config/630/main_extruder.cfg | 1 + stereotech_config/630/printhead.cfg | 14 +++++++++++++- stereotech_config/630/second_extruder.cfg | 1 + 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/stereotech_config/630/main_extruder.cfg b/stereotech_config/630/main_extruder.cfg index f2306923522c..2e972369637c 100644 --- a/stereotech_config/630/main_extruder.cfg +++ b/stereotech_config/630/main_extruder.cfg @@ -37,6 +37,7 @@ gcode: G0 X10 Y2 F3600 {% endif %} {% endif %} + PUSH_SECOND_EXTRUDER ENABLE=0 SAVE_EXTRUDER_FLOW ACTIVATE_EXTRUDER extruder=extruder RESTORE_EXTRUDER_FLOW EXTRUDER=extruder diff --git a/stereotech_config/630/printhead.cfg b/stereotech_config/630/printhead.cfg index 4f056c1708ea..7eab43f6f402 100644 --- a/stereotech_config/630/printhead.cfg +++ b/stereotech_config/630/printhead.cfg @@ -28,7 +28,6 @@ maximum_servo_angle: 180 [gcode_macro PUSH_PROBE_SENSOR] gcode: {% set enable = params.ENABLE|default(1)|int %} - {% set status = printer["servo probe_servo"].value|float %} {% if enable %} {action_respond_info("----------PUSH_PROBE_SENSOR 1")} SET_SERVO SERVO=probe_servo ANGLE=0 @@ -39,6 +38,19 @@ gcode: {action_respond_info("----------PUSH_PROBE_SENSOR 3")} {% endif %} +[gcode_macro PUSH_SECOND_EXTRUDER] +gcode: + {% set enable = params.ENABLE|default(1)|int %} + {% if enable %} + {action_respond_info("----------PUSH_SECOND_EXTRUDER 1")} + SET_SERVO SERVO=probe_servo ANGLE=180 + {% elif enable == 0 %} + {action_respond_info("----------PUSH_SECOND_EXTRUDER 2")} + SET_SERVO SERVO=probe_servo ANGLE=140 + {% else %} + {action_respond_info("----------PUSH_SECOND_EXTRUDER 3")} + {% endif %} + [gcode_macro M106] rename_existing: M106.1 gcode: diff --git a/stereotech_config/630/second_extruder.cfg b/stereotech_config/630/second_extruder.cfg index 84389ab25a97..fbc318a6a4b1 100644 --- a/stereotech_config/630/second_extruder.cfg +++ b/stereotech_config/630/second_extruder.cfg @@ -39,6 +39,7 @@ gcode: G0 X10 Y2 F3600 {% endif %} {% endif %} + PUSH_SECOND_EXTRUDER SAVE_EXTRUDER_FLOW ACTIVATE_EXTRUDER extruder=extruder1 RESTORE_EXTRUDER_FLOW EXTRUDER=extruder1