Skip to content

Commit

Permalink
STEAPP-587: added macro for check accuracy set the 5d module. (#157)
Browse files Browse the repository at this point in the history
* STEAPP-587: added macro for check accuracy set the 5d module.

* STEAPP-587: added macro for check accuracy set the 5d module.

* STEAPP-587: added macro for check accuracy set the 5d module.

* STEAPP-587: added macro for check accuracy set the 5d module.

* STEAPP-587: added command for check accuracy set the module 5d.

---------

Co-authored-by: Ilya Gushchin <[email protected]>
  • Loading branch information
SokolovJek and frylock34 authored Aug 8, 2023
1 parent bfcb0e0 commit d612c1c
Show file tree
Hide file tree
Showing 5 changed files with 124 additions and 34 deletions.
10 changes: 10 additions & 0 deletions klippy/extras/skew_correction.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ def __init__(self, config):
gcode.register_command('CALC_SKEW_COMPENSATION',
self.cmd_CALC_SKEW_COMPENSATION,
desc=self.cmd_CALC_SKEW_COMPENSATION_help)
gcode.register_command(
'CHECK_ACCURACY_SET_MODULE_FIVE_D', self.cmd_CHECK_ACCURACY_SET_MODULE_FIVE_D,
desc=self.cmd_CHECK_ACCURACY_SET_MODULE_FIVE_D_help)
gcode.register_command('CALC_SKEW_COMPENSATION_WCS',
self.cmd_CALC_SKEW_COMPENSATION_WCS,
desc=self.cmd_CALC_SKEW_COMPENSATION_WCS_help)
Expand Down Expand Up @@ -122,6 +125,13 @@ def cmd_SAVE_SKEW_POINT(self, gcmd):
self.point_coords[point_idx][axis] = coord
cmd_SAVE_SKEW_POINT_help = "Save point for align skew"

cmd_CHECK_ACCURACY_SET_MODULE_FIVE_D_help = "command for checked accuracy set the module 5d."
def cmd_CHECK_ACCURACY_SET_MODULE_FIVE_D(self, gcmd):
diferent_z = self.point_coords[0][2] - self.point_coords[1][2]
diferent_y = self.point_coords[2][1] - self.point_coords[3][1]
gcmd.respond_info("difference between Z: %f\ndifference between Y: %f"
% (diferent_z, diferent_y))

def cmd_CALC_MEASURED_SKEW(self, gcmd):
ac = gcmd.get_float("AC", above=0.)
bd = gcmd.get_float("BD", above=0.)
Expand Down
60 changes: 47 additions & 13 deletions stereotech_config/probe.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -139,19 +139,23 @@ gcode:
SET_A_OFFSET_POINT POINT=1
CALC_A_AXIS_OFFSET

;PROBE_TEMPLATE_POINT POINT=CZ
;SET_B_COMPENSATION_POINT POINT=0
;PROBE_TEMPLATE_POINT POINT=CZ1
;SET_B_COMPENSATION_POINT POINT=1
;PROBE_TEMPLATE_POINT POINT=AZ
;SET_B_COMPENSATION_POINT POINT=2
;PROBE_TEMPLATE_POINT POINT=BZ
;SET_B_COMPENSATION_POINT POINT=3
;PROBE_TEMPLATE_POINT POINT=AX
;SET_B_COMPENSATION_POINT POINT=4
;PROBE_TEMPLATE_POINT POINT=BX
;SET_B_COMPENSATION_POINT POINT=5
;CALC_B_AXIS_COMPENSATION ENABLE=0
; checked accuracy set the module 5d.
;MOVE_ACCURACY_SET_MODULE_FIVE_D

; calculate b compensation
; PROBE_TEMPLATE_POINT POINT=CZ
; SET_B_COMPENSATION_POINT POINT=0
; PROBE_TEMPLATE_POINT POINT=CZ1
; SET_B_COMPENSATION_POINT POINT=1
; PROBE_TEMPLATE_POINT POINT=AZ
; SET_B_COMPENSATION_POINT POINT=2
; PROBE_TEMPLATE_POINT POINT=BZ
; SET_B_COMPENSATION_POINT POINT=3
; PROBE_TEMPLATE_POINT POINT=AX
; SET_B_COMPENSATION_POINT POINT=4
; PROBE_TEMPLATE_POINT POINT=BX
; SET_B_COMPENSATION_POINT POINT=5
; CALC_B_AXIS_COMPENSATION ENABLE=0

; skew corection
; xy skew
Expand Down Expand Up @@ -692,6 +696,36 @@ gcode:
G10 L2 P2 Z{old_z - (y - old_y)}
{% endif %}

[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

PROBE_TEMPLATE_POINT POINT=AY
SET_C_ALIGN_POINT POINT=0
PROBE_TEMPLATE_POINT POINT=BY
SET_C_ALIGN_POINT POINT=1
CALC_C_AXIS_ALIGN

PROBE_TEMPLATE_POINT POINT=O
SET_A_OFFSET_POINT POINT=0
PROBE_TEMPLATE_POINT POINT=CZ
SET_A_OFFSET_POINT POINT=1
CALC_A_AXIS_OFFSET

PROBE_TEMPLATE_POINT POINT=CHECK_MODULE_Z1
SET_SKEW_COMPENSATION_POINT POINT=0
PROBE_TEMPLATE_POINT POINT=CHECK_MODULE_Z2
SET_SKEW_COMPENSATION_POINT POINT=1
PROBE_TEMPLATE_POINT POINT=YZ2
SET_SKEW_COMPENSATION_POINT POINT=2
PROBE_TEMPLATE_POINT POINT=YZ3
SET_SKEW_COMPENSATION_POINT POINT=3
CHECK_ACCURACY_SET_MODULE_FIVE_D
[gcode_macro SET_ECCENTRICITY]
Description: This macro save eccentricity for wcs_1.
gcode:
Expand Down
60 changes: 47 additions & 13 deletions stereotech_config/probe_2.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -118,19 +118,22 @@ gcode:
SET_A_OFFSET_POINT POINT=1
CALC_A_AXIS_OFFSET

;PROBE_TEMPLATE_POINT POINT=CZ
;SET_B_COMPENSATION_POINT POINT=0
;PROBE_TEMPLATE_POINT POINT=CZ1
;SET_B_COMPENSATION_POINT POINT=1
;PROBE_TEMPLATE_POINT POINT=AZ
;SET_B_COMPENSATION_POINT POINT=2
;PROBE_TEMPLATE_POINT POINT=BZ
;SET_B_COMPENSATION_POINT POINT=3
;PROBE_TEMPLATE_POINT POINT=AX
;SET_B_COMPENSATION_POINT POINT=4
;PROBE_TEMPLATE_POINT POINT=BX
;SET_B_COMPENSATION_POINT POINT=5
;CALC_B_AXIS_COMPENSATION ENABLE=0
; checked accuracy set the module 5d.
;MOVE_ACCURACY_SET_MODULE_FIVE_D

; PROBE_TEMPLATE_POINT POINT=CZ
; SET_B_COMPENSATION_POINT POINT=0
; PROBE_TEMPLATE_POINT POINT=CZ1
; SET_B_COMPENSATION_POINT POINT=1
; PROBE_TEMPLATE_POINT POINT=AZ
; SET_B_COMPENSATION_POINT POINT=2
; PROBE_TEMPLATE_POINT POINT=BZ
; SET_B_COMPENSATION_POINT POINT=3
; PROBE_TEMPLATE_POINT POINT=AX
; SET_B_COMPENSATION_POINT POINT=4
; PROBE_TEMPLATE_POINT POINT=BX
; SET_B_COMPENSATION_POINT POINT=5
; CALC_B_AXIS_COMPENSATION ENABLE=0

;; skew corection
;; xy skew
Expand Down Expand Up @@ -552,6 +555,37 @@ gcode:
GET_RADIUS_TOOLING
{% endif %}

[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

PROBE_TEMPLATE_POINT POINT=AY
SET_C_ALIGN_POINT POINT=0
PROBE_TEMPLATE_POINT POINT=BY
SET_C_ALIGN_POINT POINT=1
CALC_C_AXIS_ALIGN

PROBE_TEMPLATE_POINT POINT=O
SET_A_OFFSET_POINT POINT=0
PROBE_TEMPLATE_POINT POINT=CZ
SET_A_OFFSET_POINT POINT=1
CALC_A_AXIS_OFFSET

PROBE_TEMPLATE_POINT POINT=CHECK_MODULE_Z1
SET_SKEW_COMPENSATION_POINT POINT=0
PROBE_TEMPLATE_POINT POINT=CHECK_MODULE_Z2
SET_SKEW_COMPENSATION_POINT POINT=1
PROBE_TEMPLATE_POINT POINT=YZ2
SET_SKEW_COMPENSATION_POINT POINT=2
PROBE_TEMPLATE_POINT POINT=YZ3
SET_SKEW_COMPENSATION_POINT POINT=3
CHECK_ACCURACY_SET_MODULE_FIVE_D

[gcode_macro ADJUST_BASEMENT_WCS]
gcode:
{% set wcs = params.WCS|default(0)|int %}
Expand Down
14 changes: 10 additions & 4 deletions stereotech_config/probe_fiber_printer.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ gcode:
{% set target_z = printer['gcode_macro PROBE_TEMPLATE_POINT'].probe_z - 6 %}
{% set axis = 'Y' %}
{% set positive = 1 %}
{% elif point=='CHECK_MODULE_Z1' %}
{% set target_x = O[0] - 45 %}
{% set target_z = printer['gcode_macro PROBE_TEMPLATE_POINT'].probe_z + 5 %}
{% elif point=='CHECK_MODULE_Z2' %}
{% set target_x = O[0] + 45 %}
{% set target_z = printer['gcode_macro PROBE_TEMPLATE_POINT'].probe_z + 5 %}
{% elif point=='AY1' %}
{% set target_x = O[0] - 32 %}
{% set target_y = O[1] - 83 %}
Expand Down Expand Up @@ -188,15 +194,15 @@ gcode:
G0 A90 C60 F3600
{% elif point=='YZ2' %}
{% set target_x = O[0] - 45 %}
{% set target_y = O[1] - 60 %}
{% set target_z = printer['gcode_macro PROBE_TEMPLATE_POINT'].probe_z %}
{% set target_y = O[1] - 30 %}
{% set target_z = printer['gcode_macro PROBE_TEMPLATE_POINT'].probe_z - 2 %}
{% set axis = 'Y' %}
{% set positive = 1 %}
G0 A90 C5 F3600
{% elif point=='YZ3' %}
{% set target_x = O[0] + 45 %}
{% set target_y = O[1] - 60 %}
{% set target_z = printer['gcode_macro PROBE_TEMPLATE_POINT'].probe_z %}
{% set target_y = O[1] - 30 %}
{% set target_z = printer['gcode_macro PROBE_TEMPLATE_POINT'].probe_z - 2 %}
{% set axis = 'Y' %}
{% set positive = 1 %}
G0 A90 C-5 F3600
Expand Down
14 changes: 10 additions & 4 deletions stereotech_config/probe_hybrid_printer.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ gcode:
{% set target_z = printer['gcode_macro PROBE_TEMPLATE_POINT'].probe_z - 6 %}
{% set axis = 'Y' %}
{% set positive = 1 %}
{% elif point=='CHECK_MODULE_Z1' %}
{% set target_x = O[0] - 45 %}
{% set target_z = printer['gcode_macro PROBE_TEMPLATE_POINT'].probe_z + 5 %}
{% elif point=='CHECK_MODULE_Z2' %}
{% set target_x = O[0] + 45 %}
{% set target_z = printer['gcode_macro PROBE_TEMPLATE_POINT'].probe_z + 5 %}
{% elif point=='AY1' %}
{% set target_x = O[0] - 32 %}
{% set target_y = O[1] - 83 %}
Expand Down Expand Up @@ -188,15 +194,15 @@ gcode:
G0 A90 C60 F3600
{% elif point=='YZ2' %}
{% set target_x = O[0] - 45 %}
{% set target_y = O[1] - 60 %}
{% set target_z = printer['gcode_macro PROBE_TEMPLATE_POINT'].probe_z %}
{% set target_y = O[1] - 30 %}
{% set target_z = printer['gcode_macro PROBE_TEMPLATE_POINT'].probe_z - 2 %}
{% set axis = 'Y' %}
{% set positive = 1 %}
G0 A90 C5 F3600
{% elif point=='YZ3' %}
{% set target_x = O[0] + 45 %}
{% set target_y = O[1] - 60 %}
{% set target_z = printer['gcode_macro PROBE_TEMPLATE_POINT'].probe_z %}
{% set target_y = O[1] - 30 %}
{% set target_z = printer['gcode_macro PROBE_TEMPLATE_POINT'].probe_z - 2 %}
{% set axis = 'Y' %}
{% set positive = 1 %}
G0 A90 C-5 F3600
Expand Down

0 comments on commit d612c1c

Please sign in to comment.