Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

STEAPP-611: modified and tested macros for printing and calibration (old template). #156

Merged
merged 10 commits into from
Aug 8, 2023
4 changes: 2 additions & 2 deletions ENDER-23.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ path: /home/ste/uploads
[include stereotech_config/ender/kinematics_tmc.cfg]
[include stereotech_config/ender/homing.cfg]


[include stereotech_config/ender/main_extruder.cfg]
[include stereotech_config/ender/module_3d.cfg]
[include stereotech_config/ender/module_3d_macros.cfg]
[include stereotech_config/ender/module_5d.cfg]

[include stereotech_config/ender/print_macros.cfg]
[include stereotech_config/ender/extruder_macros.cfg]
[include stereotech_config/ender/variables.cfg]

[include stereotech_config/ender/probe.cfg]
# [include stereotech_config/ender/probe.cfg]
10 changes: 10 additions & 0 deletions docs/stereotech/manual_calibrate_bed_level.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
step1
Z_ENDSTOP_CALIBRATE

2
ACCEPT_Z_ENDSTOP

3
ACCEPT_Z_ENDSTOP

.....
42 changes: 42 additions & 0 deletions docs/stereotech/manual_calibrate_old_teamplate.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
"ручная калибровка 5д модуля"
#step5
MOVE_SERVICE_POSITION
MOVE_CALIBRATION_POINT POINT=0
#step6
SET_A_AXIS_OFFSET_POINT POINT=0
SAVE_A_AXIS_POINT POINT=0 COORDS=107.0,41.1,138.1
#step7
MOVE_CALIBRATION_POINT POINT=3
SET_A_AXIS_OFFSET_POINT POINT=1
SAVE_A_AXIS_POINT POINT=1 COORDS=106.3,90.9,139.5
CALC_A_AXIS_OFFSET
MOVE_WCS_ZERO WCS=1
#step8
SET_WCS_OFFSET WCS=1 X=0 Y=0 Z=0
SET_WCS_OFFSET WCS=3 X=0 Y=0 Z=0
MOVE_WCS_ZERO WCS=2
#step 9
SET_WCS_OFFSET WCS=2 X=0 Y=0 Z=0.1
SET_WCS_OFFSET WCS=4 X=0 Y=0 Z=0.1
#step10
HOME_POSITION ABORT=0

"ручная настройка точки старта печати FULL"
# step4
MOVE_SERVICE_POSITION
# step7
MOVE_WCS_ZERO WCS=1
# step8
SET_WCS_OFFSET WCS=1 ADJUST_WCS=2 X=0 Y=0 Z=0
# step9
HOME_POSITION ABORT=0

"ручная настройка точки старта печати SPIRAL"
# step4
MOVE_SERVICE_POSITION
# step7
MOVE_WCS_ZERO WCS=2
# step8
SET_WCS_OFFSET WCS=2 ADJUST_WCS=1 X=0 Y=0 Z=0
# step9
HOME_POSITION ABORT=0
15 changes: 12 additions & 3 deletions stereotech_config/ENDER-23.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
serial: /dev/serial/by-id/usb-1a86_USB_Serial-if00-port0
restart_method: command

[mcu second]
[mcu second_mcu]
serial: /dev/serial/by-id/usb-Klipper_stm32g0b1xx_5800260019504B5735313920-if00
restart_method: command

Expand All @@ -11,9 +11,18 @@ path: /home/ste/uploads

[display_status]



[include config/ender/kinematics.cfg]
[include config/ender/kinematics_tmc.cfg]
[include config/ender/homing.cfg]


[include config/ender/main_extruder.cfg]
[include config/ender/module_3d.cfg]
[include config/ender/module_3d_macros.cfg]
[include config/ender/module_5d.cfg]

[include config/ender/print_macros.cfg]
[include config/ender/extruder_macros.cfg]
[include config/ender/variables.cfg]

# [include config/ender/probe.cfg]
25 changes: 4 additions & 21 deletions stereotech_config/ender/extruder_macros.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
gcode:
G91
{% set active_extruder = printer.toolhead.extruder %}
G1 E130 F300
G1 E100 F300
G90

[gcode_macro EJECT_MATERIAL]
gcode:
LOAD_MATERIAL
G91
{% set active_extruder = printer.toolhead.extruder %}
G1 E-130 F300
G1 E-100 F300
G90

[gcode_macro LOAD_MATERIAL]
Expand All @@ -28,30 +28,13 @@ gcode:
[gcode_macro M109]
rename_existing: M1091
gcode:

{% set extruder = params.T|default(-1)|int %}
{% set current_extruder = printer.toolhead.extruder %}
{% if extruder >= 0 %}
{% if extruder == 0 %}
M117 extruder_heating
{% elif extruder == 1 %}
M117 extruder1_heating
{% endif %}
M1091 T{params.T} S{params.S}
{% else %}
{% if current_extruder == 'extruder' %}
M117 extruder_heating
{% elif current_extruder == 'extruder1' %}
M117 extruder1_heating
{% endif %}
M1091 S{params.S}
{% endif %}
M117 extruder_heating
M1091 S{params.S}
M117

[gcode_macro TURN_OFF_EXTRUDERS]
gcode:
M104 T0 S0
# M104 T1 S0

[delayed_gcode TURN_OFF_EXTRUDERS_DELAYED]
gcode:
Expand Down
24 changes: 12 additions & 12 deletions stereotech_config/ender/homing.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ gcode:
G28 A
G28 C
{% endif %}
G1 Y{axis_max[1] - 10}

[gcode_macro MOVE_SERVICE_POSITION]
gcode:
Expand All @@ -23,24 +22,25 @@ gcode:
G0 X{max_x / 2.0} Y50 F3600
SET_IDLE_TIMEOUT TIMEOUT=7200

# [gcode_macro MOVE_SERVICE_POSITION_HEAD]
# gcode:
# {% set max_x = printer.toolhead.axis_maximum[0] %}
# G54
# TURN_OFF_HEATERS
# G28
# G92 E0
# G90
# G0 X{max_x / 2.0} Y50 Z200 F3600
# SET_IDLE_TIMEOUT TIMEOUT=7200
[gcode_macro MOVE_SERVICE_POSITION_HEAD]
gcode:
{% set max_x = printer.toolhead.axis_maximum[0] %}
G54
TURN_OFF_HEATERS
G28
G92 E0
G90
G0 X{max_x / 2.0} Y50 Z200 F3600
SET_IDLE_TIMEOUT TIMEOUT=7200

[gcode_macro HOME_POSITION]
gcode:
{% set axis_max = printer.toolhead.axis_maximum %}
G54
TURN_OFF_HEATERS
G1 C0
G1 Z{axis_max[2] - 50}
G1 Y{axis_max[1] - 50}
G1 Y0
G28
G92 E0
G90
Expand Down
5 changes: 2 additions & 3 deletions stereotech_config/ender/kinematics.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ microsteps: 16
rotation_distance: 40
endstop_pin: ^PA6
position_endstop: 0
position_max: 235
position_max: 230
homing_speed: 20

[stepper_z]
Expand All @@ -38,7 +38,6 @@ endstop_pin: ^PA7
position_endstop: 0.0
position_max: 250
homing_speed: 20
# position_max: 100

[stepper_a]
step_pin: second_mcu: PB13
Expand All @@ -49,7 +48,7 @@ rotation_distance: 360
gear_ratio: 80:20
endstop_pin: second_mcu:PC0
position_endstop: 0
position_min: 0
position_min: -10
position_max: 90
homing_speed: 10

Expand Down
13 changes: 13 additions & 0 deletions stereotech_config/ender/main_extruder.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,16 @@ pid_Ki: 1.063
pid_Kd: 108.982
min_temp: 0
max_temp: 250

[gcode_macro T0]
gcode:
M117 set_extruder
{% set current_wcs = printer.gcode_move.current_wcs %}
{% if "x" in printer.toolhead.homed_axes and "y" in printer.toolhead.homed_axes and "z" in printer.toolhead.homed_axes and printer.toolhead.extruder != 'extruder' %}
G54
MOVE_UP_Z_AXIS Z=5
G0 X10 Y2 F3600
{% endif %}
ACTIVATE_EXTRUDER extruder=extruder
SET_WCS WCS={current_wcs}
M117
8 changes: 8 additions & 0 deletions stereotech_config/ender/module_3d.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,13 @@ pid_Kd: 948.182
min_temp: 0
max_temp: 130

[bed_screws]
horizontal_move_z: 10.0
screw1: 20,210
screw2: 220,210
screw1_fine_adjust: 159,0
screw3: 20,10
screw4: 220,10

[fan]
pin: PA0
36 changes: 36 additions & 0 deletions stereotech_config/ender/module_3d_macros.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
[gcode_macro M140]
rename_existing: M141
gcode:
{% if printer["gcode_button five_axis_module"].state == "RELEASED" %}
M141 S{ params.S }
{% endif %}

[gcode_macro M190]
rename_existing: M191
gcode:
{% if printer["gcode_button five_axis_module"].state == "RELEASED" %}
M117 platform_heating
M191 S{ params.S }
M117
{% endif %}

[gcode_macro Z_ENDSTOP_CALIBRATE]
rename_existing: Z_ENDSTOP_CALIBRATE_OLD
gcode:
G54
TURN_OFF_HEATERS
SET_GCODE_OFFSET Z=0
G28
G92 E0
G0 X117 Y115 Z10 F3600
SET_IDLE_TIMEOUT TIMEOUT=7200
Z_ENDSTOP_CALIBRATE_OLD

[gcode_macro ACCEPT_Z_ENDSTOP]
gcode:
ACCEPT
G28 Z
{% set probe = params.PROBE|default(0)|int %}
{% if probe < 1 %}
BED_SCREWS_ADJUST
{% endif %}
45 changes: 20 additions & 25 deletions stereotech_config/ender/module_5d.cfg
Original file line number Diff line number Diff line change
@@ -1,36 +1,41 @@
[gcode_button five_axis_module]
pin: second_mcu:PC4
pin: !second_mcu:PC4
press_gcode: QUERY_BUTTON BUTTON=five_axis_module

[a_axis_offset]

[gcode_macro MOVE_WCS_ZERO]
gcode:
{% set z_max = printer.toolhead.axis_maximum %}
G54
G0 Z{z_max[2]} F6000
G0 Z200 F3600
{% set current_wcs = params.WCS|default(1)|int %}
{% set offsets = printer.gcode_move.wcs_offsets[current_wcs] %}
{% if offsets[0] == 0 and offsets[1] == 0 %}
G0 X125 Y50 F6000
G0 X120 Y50 F3600
{% else %}
G0 X{offsets[0]} Y{offsets[1]} F6000
G0 X{offsets[0]} Y{offsets[1]} F3600
{% endif %}
{% if current_wcs == 1 %}
G0 A0
{% elif current_wcs == 2 %}
G0 Y87 A90 F6000
G0 Y110 A90 F3600 C-30
{% endif %}

[gcode_macro SET_WCS_OFFSET]
description: macro for set the wcs for: manual calibrate FULL and SPIRALL and manual calibrate 5d module above old template
gcode:
G54
G90
{% set current_wcs = params.WCS|default(1)|int %}
{% set adjust_wcs = params.ADJUST_WCS|default(0)|int %}
SET_WCS WCS={current_wcs}
G10 L20 X{params.X} Y{params.Y} Z{params.Z}
{% if (current_wcs == 2 or current_wcs == 4) and adjust_wcs == 0 %}
# for manual calibrate 5d module by old template
G10 L20 X{params.X} Y{params.Y} Z{params.Z|float + 50.0}
{% else %}
G10 L20 X{params.X} Y{params.Y} Z{params.Z}
{% endif %}
G54
{% set adjust_wcs = params.ADJUST_WCS|default(0)|int %}
{% if adjust_wcs > 0 and adjust_wcs != current_wcs %}
ADJUST_WCS_OFFSET WCS={current_wcs} ADJUST_WCS={adjust_wcs} X={params.X} Y={params.Y} Z={params.Z}
{% endif %}
Expand All @@ -46,36 +51,26 @@ gcode:
{% set delta_x = printer.gcode_move.wcs_offsets[current_wcs][0] - offsets[0] %}
{% set delta_y = printer.gcode_move.wcs_offsets[current_wcs][1] - offsets[1] %}
{% set delta_z = printer.gcode_move.wcs_offsets[current_wcs][2] - offsets[2] %}
G10 L2 P{adjust_wcs + 1} X{offsets_2[0] + delta_x + params.X|float} Y{offsets_2[1] - delta_z + params.Z|float} Z{offsets_2[2] + delta_y + params.Y|float}
# G10 L2 P{adjust_wcs + 1} X{offsets_2[0] + delta_x + params.X|float} Y{offsets_2[1] - delta_z + params.Z|float} Z{offsets_2[2] + delta_y + params.Y|float}
G10 L2 P{adjust_wcs + 1} X{offsets_2[0] + delta_x + params.X|float} Y{offsets_2[1] - delta_z + params.Z|float} Z{offsets_2[2] + params.Y|float}

[gcode_macro MOVE_CALIBRATION_POINT]
gcode:
G54
{% set point = params.POINT|default(0)|int %}
{% set x = 108 %}
{% set y = 80 %}

{% set x = 118 %}
{% set y = 174 %}
{% if point == 3 or point == 4 %}
{% set y = 87 %}
{% set y = 123 %}
{% endif %}

{% if point == 1 %}
{% set x = 58 %}
{% set x = 118 %}
{% endif %}

{% if point == 2 %}
{% set x = 158 %}
{% endif %}
G0 A0
# G0 X{x} Y{y} Z110 F3600
# point0
# G0 X108 Y80 Z130 F600
# point1
# G0 X58 Y80 Z130 F600
# point2
# G0 X158 Y80 Z130 F600
# point4
# G0 X158 Y87 Z130 F600
G0 X{x} Y{y} Z150 F600
{% if point > 3 %}
G0 Z150 A90 F600
{% endif %}
Expand Down
Loading