AuxAxis: wire DROPTOOL/GRABTOOL/RELEASE/CLAMP as gcode hooks
Adds atc_droptool/atc_grabtool/atc_release/atc_clamp wrappers in
AuxAxis (each just an RPC waiting on the matching terminal reply
line from the firmware), and registers them as internal hook
handlers in Ctrl. Macros and gcode programs can now invoke the
tool changer with:
(MSG,HOOK:droptool:)
(MSG,HOOK:grabtool:)
(MSG,HOOK:release:)
(MSG,HOOK🗜️)
block_unpause + auto_resume mirrors the W-axis hooks: the program
pauses while the ESP runs the pneumatic sequence and resumes when
done. Soft timeouts match the worst-case ESP sequence durations.
This commit is contained in:
@@ -156,6 +156,11 @@ class Ctrl(object):
|
||||
mm = float(data) if data else 0.0
|
||||
self.aux.set_position_mm(mm)
|
||||
|
||||
def _hook_droptool(ctx): self.aux.atc_droptool()
|
||||
def _hook_grabtool(ctx): self.aux.atc_grabtool()
|
||||
def _hook_release(ctx): self.aux.atc_release()
|
||||
def _hook_clamp(ctx): self.aux.atc_clamp()
|
||||
|
||||
self.hooks.register_internal('aux', _hook_move,
|
||||
block_unpause=True, auto_resume=True)
|
||||
self.hooks.register_internal('aux_rel', _hook_move_rel,
|
||||
@@ -165,6 +170,21 @@ class Ctrl(object):
|
||||
timeout=180)
|
||||
self.hooks.register_internal('aux_setzero', _hook_setzero,
|
||||
block_unpause=True, auto_resume=True)
|
||||
# ATC pneumatics. block_unpause + auto_resume so a program
|
||||
# using M6 - implemented as (MSG,HOOK:droptool:) etc - pauses
|
||||
# at the right point and resumes once the sequence is done.
|
||||
self.hooks.register_internal('droptool', _hook_droptool,
|
||||
block_unpause=True, auto_resume=True,
|
||||
timeout=60)
|
||||
self.hooks.register_internal('grabtool', _hook_grabtool,
|
||||
block_unpause=True, auto_resume=True,
|
||||
timeout=60)
|
||||
self.hooks.register_internal('release', _hook_release,
|
||||
block_unpause=True, auto_resume=True,
|
||||
timeout=10)
|
||||
self.hooks.register_internal('clamp', _hook_clamp,
|
||||
block_unpause=True, auto_resume=True,
|
||||
timeout=15)
|
||||
log.info('Aux hooks registered')
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user