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

Basic automated ATC implementations (Draft/WIP) #1297

Open
wants to merge 14 commits into
base: main
Choose a base branch
from

Conversation

nicolas-lang
Copy link

My intention is mostly to offer my implementation for review and maybe as contribution for further automated ATC implementations.
The code is untested but seems to compile, unless I am doing the compile incorrectly.
I am slightly scared in uploading it, as I don't want to brick my ATC-hardware 😉
Since this PR is not intended to be merged, I'll just target main.

Description

The idea is to have the ATC to move to the tool's xy position, and then use a tool changer specific macro to perform any pickup/return moves, operating required outputs to the ATC with M62/63.
This way it should be rather compatible with different hardware only requiring yaml-cfg changes.
The only downside I see with this behaviour right now, would be exposing the ATC-I/Os to the Gcode - but I would consider this acceptable, since GCode already has millions of ways of crashing your machine anyways.

for a simple vertical ATC the pickup macro could look like this:

G91 (or alternatively use G90 moves and the variables set up by the ATC: G0 Z#<_tc_tool_z>)
M62 P6 (Triggers air valve to open the ATC )
G4 P0 1.0 (wait for ATC to settle)
G0 Z-50.0 (go to tool-pickup location)
M63 P6 (Triggers air valve to close the ATC )
G4 P0 1.0 (wait for ATC to settle)
G0 Z50.0 (lift tool from fixture)

It shouldn't be difficult to adapt the macro for a fork-holder atc that is accessed from the side, or run the spindle for something like the rapidchange ATC.

P.S.
The general implementation of "using macros" is mostly guesswork since i haven't found any related documentation in the wiki, Especially for the macro variables I am not confident at all.

@nicolas-lang
Copy link
Author

Just a short update:
I have tested a bit and unfortunately it doesn't work yet, I was sooooo confident with my implementation ;-/

I have tested with this config:

atc_basic:
  safe_z_mpos_mm: -1.000000
  probe_seek_rate_mm_per_min: 400.000000
  probe_feed_rate_mm_per_min: 40.000000
  ets_mpos_mm: -72.500 -7.500 -45.000
  ets_rapid_z_mpos_mm: 0.000000
  toolreturn_macro: G91&G0 Z-10.0&M62 P6&G4 P0 1.0&M63 P6&G4 P0 1.0&G0 Z10.0
  toolpickup_macro: G91&M62 P6&G4 P0 1.0&G0 Z-10.0&M63 P6&G4 P0 1.0&G0 Z10.0
  tool1_mpos_mm: -100.000 -7.500 -15.000
  tool2_mpos_mm: -120.000 -7.500 -15.000
  tool3_mpos_mm: -140.000 -7.500 -15.000
  tool4_mpos_mm: -160.000 -7.500 -15.000
  tool5_mpos_mm: -180.000 -7.500 -15.000
  tool6_mpos_mm: -200.000 -7.500 -15.000
  tool7_mpos_mm: -220.000 -7.500 -15.000
  tool8_mpos_mm: -240.000 -7.500 -15.000

but all I get when M6 T2 is

[MSG:INFO: Relay spindle changed to tool:2 using ATC:atc_basic]
Guru Meditation Error: Core  1 panic'ed (LoadProhibited). Exception was unhandled.
Core  1 register dump:
PC      : 0x40108f20  PS      : 0x00060e30  A0      : 0x801093d9  A1      : 0x3ffb1fd0
A2      : 0x3ffaf510  A3      : 0x00000000  A4      : 0x3ffae99c  A5      : 0x3ffc74c8
A6      : 0x0000000f  A7      : 0x00000038  A8      : 0x00000c24  A9      : 0x3ffb1fb0
A10     : 0x3ffae8ec  A11     : 0x00000000  A12     : 0x3ffe5280  A13     : 0x00000039
A14     : 0x3ffe52c6  A15     : 0x3ffe5280  SAR     : 0x00000008  EXCCAUSE: 0x0000001c
EXCVADDR: 0x00000004  LBEG    : 0x4008bf75  LEND    : 0x4008bf97  LCOUNT  : 0xffffffff
Backtrace: 0x40108f1d:0x3ffb1fd0 0x401093d6:0x3ffb2000 0x40106499:0x3ffb20b0 0x400e1e7f:0x3ffb20f0 0x400fce1d:0x3ffb21d0 0x400fde21:0x3ffb2210 0x400edff0:0x3ffb2250 0x40129929:0x3ffb2290
ELF file SHA256: f0f5be5fabded9f2

@bdring
Copy link
Owner

bdring commented Aug 22, 2024

If you use the vscode serial monitor, it will decode the backtrace.


if (new_tool > 0) {
//pickup tool, if this is the 1st pickup ever, we also probe the tool_setter_offset
move_to_tool_position(_prev_tool);
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this needs to use new_tool

@nicolas-lang
Copy link
Author

If you use the vscode serial monitor, it will decode the backtrace.

that helped a lot ! Thanks for the suggestion.

After a bit of debugging it already looks quite promising.
It looks like Tools are successfull being measured and changed.

I still have to double check probing with dial gauge and debug some strange observations...
(it behaves a bit like my dual Z is loosing it's secondary offset when probing a tool, at least it looks like there is a slight jerk in Y2 )

@nicolas-lang
Copy link
Author

Added a small description with macro and cfg examples here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants