Hello Guest it is March 28, 2024, 05:41:35 AM

Author Topic: Stitching G-Code Together  (Read 4379 times)

0 Members and 1 Guest are viewing this topic.

Stitching G-Code Together
« on: August 12, 2007, 05:30:40 PM »
I've been working on my machine and machIII to get things running the way I have always wanted, my brain hurts from all the reading but I have tool changes working and added some commands so that the Gantry would clear the work area so I can flip pieces over (some of the pieces are two sided and use index holes to locate on the vaccum clamp). I'm also working on putting all my tools into the tool table so I can use offsets automatically, my brains starting fuzz out :)

One of the things I make on the CNC are Guitar Bridges, here's how it works today:

1. I have a jig where I drill two small index holes to locate the piece into a vaccum clamp.

2. I run a program that shapes the bottom to a 25ft or 30ft radius (or whatever they want), creates an edge for sitting over a guitars finish and then adds two more small holes so I can flip the piece and do the top.

3. I flip the piece over and load and run the next program which cuts the profile, shapes the bridge, adds the string holes.

4. I get a tool change pause, the code then runs and cuts string slots into the bridge and ends with a special bit.

Once this is done I put the bridge onto a second jig that is angled to cut the saddle at a 2deg tilt...

The whole process takes 30 minutes on average, but upon reflection one thing I keep running into is that clients want different string spacings, which effects the hole routine and the string slot routine. Today I use Rhino and change everything to the new spacings, then generate a whole new program using Rhino-Cam. It's tedious but it works. But the big issue for me is that I end up with a bunch of .CAD files and if they want changes to the base design or if I want to make a change to improve the process then I have to regen code from ALL those .CAD files using Rhino-Cam... It's a pain...

So I have an idea I wan to float....

How about a directory with all the common G-Code operations already validated and ready to run, a library if you will of options...

Then the core program would simply call operations from the library as needed, I could write a vbscript program to simply pull all the pieces together for me and output one piece of GCode, but I think it would be cleaner to do it from within Mach, I'm not sure if this has been done before like this or if there are hidden problems with doing this. I see the LoadRun command and assume that I could use that but does that mean I have to create a wizard to do this? It's not something I've played with but it does have possibilities :)

I was also wondering if it could be done with M-Commands, but would not one program overwrite the current one?

Anyway just looking for some direction, my goal is to remove some of the redundancy on doing these parts, today they simply take too much effort to be profitable and that's why I'm looking at ways to streamline the process, plus I'll be teaching my son how to do all this so I have to make it well... Um... Young Adult Proof :)
-Paul-

Paul Davis
Luthier
Patriot Guitars

Offline Graham Waterworth

*
  • *
  •  2,668 2,668
  • Yorkshire Dales, England
    • View Profile
Re: Stitching G-Code Together
« Reply #1 on: August 12, 2007, 05:57:45 PM »
There is no reason why you could not use Sub programs,  all your subs would be the programs you use now.  You would have a new main program that calls the subs in the right sequence.

Main (bridge type 1)

M98 P0002 (CALL SUB PROGRAM NUMBER 2)
M98 P0004
M98 P0019
M98 P0005
Etc.
M30

Graham.

Without engineers the world stops
Re: Stitching G-Code Together
« Reply #2 on: August 12, 2007, 06:47:15 PM »
Hmmmmm that's not a bad idea Graham, I could just copy and paste in new code pieces if there are updates...

I've been playing with the Discriminator for my G-Code and I really like it, so it should be easy to piece it all together...

It would be cool at some point to have a wizard that would walk me through the building process by asking questions, that's something I may tinker with but for now I think you nailed it :)

By the way....

your explanation about the tooltable in other messages cleared the fog around the issue for me, I'm working on entering all my offsets into it and synching it all up with Rhino-Cam.....

So thank you for both things :)

-Paul-
-Paul-

Paul Davis
Luthier
Patriot Guitars
Re: Stitching G-Code Together
« Reply #3 on: August 12, 2007, 06:50:24 PM »
One question on the tooltable, do I need to issue a G43 when I issue a t2 M6 command or does the offset get applied automatically??, as soon as I finish getting everything loaded I'll go and play with some test scripts...

Thanks

-Paul-
-Paul-

Paul Davis
Luthier
Patriot Guitars
Re: Stitching G-Code Together
« Reply #4 on: December 09, 2007, 12:10:13 PM »
There is no reason why you could not use Sub programs,  all your subs would be the programs you use now.  You would have a new main program that calls the subs in the right sequence.

Main (bridge type 1)

M98 P0002 (CALL SUB PROGRAM NUMBER 2)
M98 P0004
M98 P0019
M98 P0005
Etc.
M30

Graham.



Is there a way you can call/load GCODE Files from different input files instead of subroutines?  I understand the subroutine idea, but it would be great if you didn't have to have one big file with subroutines, that way when you made changes to one of the sub-programs you would not have to cut and paste it into the big master file each time you made a change.

Could this be done with a macro somehow?   Then when you made a tweak to a program file, all you would have to do is repost and run the macro file ( no cut and paste on a 10,000 line file )

Thanks,
Joel

Offline Graham Waterworth

*
  • *
  •  2,668 2,668
  • Yorkshire Dales, England
    • View Profile
Re: Stitching G-Code Together
« Reply #5 on: December 09, 2007, 02:26:35 PM »
Yes,

stick all your subs in the subs folder inside Mach3, then you can call them from the main program using there file name.

e.g.

M98 (sub1.tap)
M98 (sub2.tap)
Etc.
M30

Graham.
Without engineers the world stops
Re: Stitching G-Code Together
« Reply #6 on: December 09, 2007, 03:02:10 PM »
Many Thanks !   I will give that a try.

Joel