diff --git a/stereotech_config/630/board_stm32f4.cfg b/stereotech_config/630/board_stm32f4.cfg index a682fc1711ea..e2d0a6146bb8 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, heatsink_fan_pin=PD12, + 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, @@ -15,8 +15,10 @@ aliases: second_extruder_enable_pin=PD4, second_extruder_heater_pin=PA3, second_extruder_sensor_pin=PF4, second_extruder_filament_sensor_pin=PG15, - fiber_cut_step_pin=PE6, fiber_cut_dir_pin=PA14, - fiber_cut_enable_pin=PE0, + 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, heatsink_sensor_pin=PF7, heatsink_servo_pin=PD7, + probe_pin=PG13, probe_servo=PB7, + chamber_fan_pin=PA8, chamber_heater=PB10, chamber_sensor_pin=PF6, # 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..a5b660494930 --- /dev/null +++ b/stereotech_config/630/calibrate/probe_630.cfg @@ -0,0 +1,98 @@ +[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: + PUSH_PROBE_SENSOR + +[bed_mesh] +speed: 120 +horizontal_move_z: 30 +mesh_min: 10, -97 +mesh_max: 310, 133 +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/chamber.cfg b/stereotech_config/630/chamber.cfg index bedbd36c44b5..30539c71ae2a 100644 --- a/stereotech_config/630/chamber.cfg +++ b/stereotech_config/630/chamber.cfg @@ -1,5 +1,29 @@ -[fan_generic chamber_fan] -pin: PA8 +[fan] +pin: fan_pin + + +[heater_generic chamber_heater] +gcode_id: C +heater_pin: chamber_heater +sensor_type: NTC 100K MGB18-104F39050L32 +sensor_pin: chamber_sensor_pin +control: pid +pid_Kp: 44.327 +pid_Ki: 0.211 +pid_Kd: 2332.142 +min_temp: -150 +max_temp: 100 +# FOR DEBUG +max_power: 0.5 + +#FOR DEBUG +[verify_heater chamber_heater] +check_gain_time: 1000 + +[heater_fan chamber_fan] +pin: chamber_fan_pin +heater: chamber_heater +heater_temp: 40 [temperature_fan bottom_fan] pin: PD13 @@ -14,31 +38,6 @@ target_temp: 45.0 min_speed: 0.0 gcode_id: E -[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} - {% endif %} - -[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 %} - # LED Light controls [led case_led] diff --git a/stereotech_config/630/main_extruder.cfg b/stereotech_config/630/main_extruder.cfg index 5ff45b0b9717..2e972369637c 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 @@ -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/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 new file mode 100644 index 000000000000..7eab43f6f402 --- /dev/null +++ b/stereotech_config/630/printhead.cfg @@ -0,0 +1,75 @@ +[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: 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 probe_servo] +pin: probe_servo +initial_angle: 140 +maximum_servo_angle: 180 + +[gcode_macro PUSH_PROBE_SENSOR] +gcode: + {% set enable = params.ENABLE|default(1)|int %} + {% if enable %} + {action_respond_info("----------PUSH_PROBE_SENSOR 1")} + SET_SERVO SERVO=probe_servo ANGLE=0 + {% elif enable == 0 %} + {action_respond_info("----------PUSH_PROBE_SENSOR 2")} + SET_SERVO SERVO=probe_servo ANGLE=140 + {% else %} + {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: + {% set curr_ex = printer.toolhead.extruder %} + {% set s = params.S|default(0)|int %} + # 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 angle = (start_pos_extruder1 - (ko * s))|round %} + {% elif curr_ex == 'extruder1' %} + {% 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 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/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 diff --git a/stereotech_config/HTE630-0-C-23.cfg b/stereotech_config/HTE630-0-C-23.cfg index 85bc0bc5497a..4f1ad48e9734 100644 --- a/stereotech_config/HTE630-0-C-23.cfg +++ b/stereotech_config/HTE630-0-C-23.cfg @@ -16,11 +16,11 @@ 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] -[include config/calibrate/probe_3d.cfg] +[include config/630/calibrate/probe_630.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] @@ -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: -42.0, -33.1, 22.5 +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 %}