OpenBuilds-CONTROL icon indicating copy to clipboard operation
OpenBuilds-CONTROL copied to clipboard

Toolchanges

Open petervanderwalt opened this issue 6 years ago • 54 comments

Normally you'd want the GCODE to have M6 (Pause) then a Tx command. The UI should pause streaming at the M6, and prompt you to insert tool X. Then you jog to zero tool length, setzero z, and unpause. But thats not in the code yet... Sorry! (: - couple weeks though!

So the hack here is to split your gcode into seperate files for each tool. The machine will hold position between jobs (unless your gcode resets coordinates with G10, etc). Run the job file for tool 1. When its finished, change tool, zero z (dont rezero xy). Load file for tool 2, go. etc. I know its a kludge, but bare with us (; theres a lot of features that still has to be added - and we'll get to them all eventually (:

petervanderwalt avatar Nov 16 '18 13:11 petervanderwalt

Has anything been done to add the capability to accommodate tool changes and resetting Z manually in a single g-code file?

gmorse7 avatar Apr 30 '19 15:04 gmorse7

Not yet (: (Or this issue wouldnt have been "open" right)

petervanderwalt avatar Apr 30 '19 17:04 petervanderwalt

Working on Toolchanges (finally!) this week:

First light:

dropdown

petervanderwalt avatar Sep 03 '19 18:09 petervanderwalt

@swarfer @sharmstr - (: if you have any comments on it so far (and have some more sample gcode files to throw in the testing pool)

Basically the parser looks at the gcode, finds a M6 and splits it at that point. We look around for related comments to populate the description a little better

Ideally i want it to have the whole wizard like feel in the end (not yet) where it just runs and pauses on M6, lets you rezero etc, but for now (quicker) i figure handling each section/tool as a mini "job" means once its done we have access to all the usual jog/probe etc to prep for the next tool? Or allows starting just a specific tool in a file

petervanderwalt avatar Sep 03 '19 18:09 petervanderwalt

Here's a simple sample with tool change generated by the Fusion 360 GRBL post processor. I agree, pause on M6, allow movement to facilitate tool change and Z re-zero then resume. A message box prompt would be nice but given the multitude of possible platforms...unless of course there is a simple way. ToolChangeTestPiece.docx

gmorse7 avatar Sep 03 '19 19:09 gmorse7

Here's some psuedo code I used to modify a post processor for another machine.

image

gmorse7 avatar Sep 03 '19 21:09 gmorse7

Ps. Official Gcode spec calls for Tx before M6 (; and can be called many lines earlier too to give ATCs time to work

On Tue, Sep 3, 2019, 11:11 PM gmorse7 [email protected] wrote:

Here's some psuedo code I used to modify a post processor for another machine.

[image: image] https://user-images.githubusercontent.com/50146581/64209156-a1e19100-ce54-11e9-840c-802d9f95ef4d.png

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/OpenBuilds/OpenBuilds-CONTROL/issues/26?email_source=notifications&email_token=AHP6BN2QHYRG6RDERFWMZATQH3HI3A5CNFSM4GEZAOQ2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD5ZS53Q#issuecomment-527642350, or mute the thread https://github.com/notifications/unsubscribe-auth/AHP6BNZSW6SCHB55LIKPBYLQH3HI3ANCNFSM4GEZAOQQ .

petervanderwalt avatar Sep 03 '19 21:09 petervanderwalt

@swarfer @sharmstr - (: if you have any comments on it so far (and have some more sample gcode files to throw in the testing pool)

Basically the parser looks at the gcode, finds a M6 and splits it at that point. We look around for related comments to populate the description a little better

As a temp solution, its probably fine. I know I'm going to press the wrong run button, but you cant code for that :)

I'll get you some sample files tomorrow.

sharmstr avatar Sep 03 '19 22:09 sharmstr

Here is a SketchUcam file with tool changes. This is created by generating a file for T1 and another for T2 and then using the joiner tool to join the files together. pockettester.txt

swarfer avatar Sep 04 '19 07:09 swarfer

Note the Sketchucam can also insert a macro for the toolchange which may not include a M6 command. User beware (-:

swarfer avatar Sep 04 '19 07:09 swarfer

Lol (: always right Does yours have start/end markers we can seperate it out?

On Wed, Sep 4, 2019, 9:34 AM David the Swarfer [email protected] wrote:

Note the Sketchucam can also insert a macro for the toolchange which may not include a M6 command. User beware (-:

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/OpenBuilds/OpenBuilds-CONTROL/issues/26?email_source=notifications&email_token=AHP6BNZNL3ZMWCWNPNWL7FDQH5QIBA5CNFSM4GEZAOQ2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD52UYYI#issuecomment-527780961, or mute the thread https://github.com/notifications/unsubscribe-auth/AHP6BN2DUW2I4UUUN5U7P5LQH5QIBANCNFSM4GEZAOQQ .

petervanderwalt avatar Sep 04 '19 09:09 petervanderwalt

yep, just look in the file. the joiner hooks a few lines from the comment header of each file and includes them in the output just before the tool change command

swarfer avatar Sep 04 '19 10:09 swarfer

Here's one from Fusion using the Tormach post. I disabled G30 output.

PegBoard-Fusion-Tormach.txt

sharmstr avatar Sep 04 '19 14:09 sharmstr

So did the parser get it right? Two operations: 1 = Holes cut with a 6.35mm endmil 2 = chamfering with a 12.7mm 30deg

two ops

petervanderwalt avatar Sep 04 '19 15:09 petervanderwalt

re @sharmstr " know I'm going to press the wrong run button, " - the Run Complete Job one is the one I am still working on and the one most should use. Idea is to get it to run to a toolchange, popup a message telling you which tool to load, then lets you jog/probe/etc and finally continue

petervanderwalt avatar Sep 04 '19 15:09 petervanderwalt

The parsed info looks good.

Ah, ok. During the tool change, will macros be available so I can use a modified G28 for my tool change location instead of having to jog?

sharmstr avatar Sep 04 '19 15:09 sharmstr

Yeah I'm forseeing handling each section "like a job", ie when it gets to the end, before the toolchange it "stops" streaming completely. Instead of duplicating jog/probe/macro buttons onto a dialog. Just click "ok i'll load up that tool" (hehe) and then we hand you back to the full UI but play button will say "Continue" or something like that which actually starts the next section

petervanderwalt avatar Sep 04 '19 15:09 petervanderwalt

@swarfer :

Here is a SketchUcam file with tool changes. This is created by generating a file for T1 and another for T2 and then using the joiner tool to join the files together. Looks like it worked (:

pockettest

I checked the file and I do see it having the headers from the joiner as described. But for Sketchucam can also insert a macro for the toolchange which may not include a M6 command - what do you (or more importantly what do I have the parser look for) use instead of M6 then I'm hoping for something like

(start of toolchangemacro)
G28
G10 L2 Z0 etc etc
(end of toolchangemacro)

So basically I can look for the two comments and know gcode before start is "the job", between the comments is the "toolchange macro" and after end, is the next section with the new tool. (so the dropdown can reflect accordingly. When you get to the macro, we either let you manually do it, or run the macro

petervanderwalt avatar Sep 04 '19 16:09 petervanderwalt

@gmorse7 yours looks good too:

file2

But I dislike how it looks in the 3D viewer (; - so will fix that for you too (;

petervanderwalt avatar Sep 04 '19 16:09 petervanderwalt

@swarfer :

Here is a SketchUcam file with tool changes. This is created by generating a file for T1 and another for T2 and then using the joiner tool to join the files together. Looks like it worked (:

yep

I checked the file and I do see it having the headers from the joiner as described. But for Sketchucam can also insert a macro for the toolchange which may not include a M6 command - what do you (or more importantly what do I have the parser look for) use instead of M6 then

in this case there is no way to automatically split the file as we have no idea what a user may put into the toolchange macro. none at all since the macro is user defined. the point of the macro is to do the tool change without stopping the job so using it and then expecting CONTROL to cooperate with it is a bit of a stretch.

swarfer avatar Sep 05 '19 07:09 swarfer

If theres no M6, we'll just keep on running. Sounds like that is spot on then

On Thu, Sep 5, 2019, 9:48 AM David the Swarfer [email protected] wrote:

@swarfer https://github.com/swarfer :

Here is a SketchUcam file with tool changes. This is created by generating a file for T1 and another for T2 and then using the joiner tool to join the files together. Looks like it worked (:

yep

I checked the file and I do see it having the headers from the joiner as described. But for Sketchucam can also insert a macro for the toolchange which may not include a M6 command - what do you (or more importantly what do I have the parser look for) use instead of M6 then

in this case there is no way to automatically split the file as we have no idea what a user may put into the toolchange macro. none at all since the macro is user defined. the point of the macro is to do the tool change without stopping the job so using it and then expecting CONTROL to cooperate with it is a bit of a stretch.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/OpenBuilds/OpenBuilds-CONTROL/issues/26?email_source=notifications&email_token=AHP6BNYCKXGTDB6YSBELFUTQIC2VFA5CNFSM4GEZAOQ2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD56F2BQ#issuecomment-528243974, or mute the thread https://github.com/notifications/unsubscribe-auth/AHP6BN76JS7LNAUNAQIEH23QIC2VFANCNFSM4GEZAOQQ .

petervanderwalt avatar Sep 05 '19 10:09 petervanderwalt

How close is this to being released? Not pressuring, but the fusion post will need to be adjusted. Just wondering how much time I have :)

sharmstr avatar Sep 05 '19 13:09 sharmstr

Phew more than i thought. Had 4 days allocated to work on it but got pulled off on something else for now. I'd say I am not halfway yet

On Thu, Sep 5, 2019, 3:19 PM sharmstr [email protected] wrote:

How close is this to being released? Not pressuring, but the fusion post will need to be adjusted. Just wondering how much time I have :)

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/OpenBuilds/OpenBuilds-CONTROL/issues/26?email_source=notifications&email_token=AHP6BN3MN2OVVWKONPRNM23QIEBPRA5CNFSM4GEZAOQ2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD57CBXA#issuecomment-528359644, or mute the thread https://github.com/notifications/unsubscribe-auth/AHP6BN7NEAH3G2IJRSZVTQLQIEBPRANCNFSM4GEZAOQQ .

petervanderwalt avatar Sep 05 '19 13:09 petervanderwalt

So something like this: Just before the M6, streaming stops, this pops up:

dialog

(also playing with the idea of instead of a dialog popping up, I show this where the 3D viewer usually is)

You use the regular tools/macros etc to effect the toolchange

then hit the Play button up top (its description now says Continue)

petervanderwalt avatar Sep 05 '19 19:09 petervanderwalt

I like it. Can you clarify a few things?

1 - I'm assuming the cutter image will always be the same. If so, I guarantee someone will ask why its not showing their v-bit. LOL

2 - After rezero'ing, will your continue button raise the cutter?

sharmstr avatar Sep 05 '19 20:09 sharmstr

  1. no no - the boss really wants it to show the correct bits or at least close. It might be "best effort" by looking for keywords like "ball" or "flat" or "v"

  2. Hmmm, thats a good Beta testing question (: - i dont think the cam/posts give us a raise before/after the M6 right, so probably going to have to either do it for users (then i see the "z=5, vs G53 0 fights coming). But excellent catch this will need some debate for sure

petervanderwalt avatar Sep 05 '19 20:09 petervanderwalt

1 - Oh good luck with that. I can certainly help you with that on the Fusion end. And maybe even the Aspire end (though I only have the desktop version which doesnt allow multiple tools anyways).

2 - The Tormach sample I gave you does. Right after the tool change the first move is in Z to your clearance height before any x/y moves. But it doesnt look like the Autodesk version of grbl post does. Right after M6 it goes to x/y, then to your Z clearance height. That could be bad potentially. I can make sure in our version of the Fusion post that we move to clearance height first if need be, but probably best that control does it.

sharmstr avatar Sep 05 '19 20:09 sharmstr

  1. If not able to determine, show a cartoonish endmill lol
  2. yeah can be really bad, guess we can check what the first move is and decide whether to add one or something. Future Peters problem! hehe. And yeah we can can fix it in our posts, but you know people are going to load default/other posts etc too

petervanderwalt avatar Sep 05 '19 20:09 petervanderwalt

Does the M6 triggered code raise to safe height and command a spindle stop?

Tool change user prompt window and text looks good to me.

gmorse7 avatar Sep 05 '19 20:09 gmorse7

That should happen in the gcode before the M6.

Even your ToolChangeTestPiece doc above raises and stops the spindle before the M6 call. I've never seen a post that wont do that, so I think we are safe there.

Hmmm, as soon as I say that I now see that Davids file didnt have it. Well, shoot.

sharmstr avatar Sep 05 '19 20:09 sharmstr