Hello Guest it is March 28, 2024, 07:45:37 AM

Author Topic: g-code save  (Read 8787 times)

0 Members and 1 Guest are viewing this topic.

g-code save
« on: June 29, 2010, 10:31:38 AM »
Is there some way to save the g-code that Mach3 has loaded? The situation is that I'm writing a macro that will take some g-code file and adjust certain parameters in it, then feed that to Mach3 (using open/load teachfile). However, sometimes the g-code will originate from another wizard, which would use open/load teachfile itself, so I would need to be able to get to the generated g-code.

Offline budman68

*
  • *
  •  2,352 2,352
    • View Profile
Re: g-code save
« Reply #1 on: June 29, 2010, 11:02:13 AM »
When you are ready to save it, couldn't you just open up whatever editor you're using to edit the GCode and save it somewhere by renaming it to a special folder you want to save it in?

Dave
----------------------------------------------------------------------
Just because I'm a Global Moderator, don't assume that I know anything !

Dave->    ;)
Re: g-code save
« Reply #2 on: June 29, 2010, 11:27:11 AM »
I'm not editing g-code :)

The situation is that I'm making PCBs (but could be engraving - similar requirements). The width of the cut is critical and, since a v-cutter is used, the depth is also critical. We are talking 1 or 2 mil here. So, what my code (actually a wizard) will do is to firstly probe the surface of the copper to build up a 3D map. It will then load in some g-code, generated by a PCB CAD utility, and run through this fixing up the z-offsets to be relative to the 3D map it has of the PCB surface (thus negating any warping which would make the tracks be too thick/thin). The result is written to the teaching file, and then loaded and run. No manual intervention anywhere, except to specifiy the PCB file.

But... since the cutting depth is so critical the tool profile can affect things too. V-cutters don't have an infinite point, so working out the depth from the cutter angle is usually wrong. The cutters I currently use have a tip width specified at 0.2mm but the one I'm using right now is 0.17mm. Doesn't sound a lot of difference, but when the cutting depth is 0.15mm...

So, to resolve that issue I wrote a wizard that basically performs the kind of bracketing you might use for photo exposures: decide the value you want, then do some tests either side of that. My wizard takes the cutter details (angle, tip, etc) and target width, then works out the depth and generates code to cut a series of test tracks around that. For instance, if it figures the depth should be 0.15mm it might cut 5 short tracks of 0.11, 0.13, 0.15, 0.17 and 0.19. The actual cut width can then be checked and the correct depth chosen for that tool.

Trouble is that the results of the bracket test may not be correct because any warpage of the board hasn't been allowed for. So what I need is to take the code for the bracket test and feed that through the mapping wizard. I could do that by just writing to a known file, but it strikes me that sometimes the first wizard won't be one I wrote, hence I would need to be able to get to the code that's already loaded into Mach3 waiting to be run.

Hope that explains it better :)

Offline budman68

*
  • *
  •  2,352 2,352
    • View Profile
Re: g-code save
« Reply #3 on: June 29, 2010, 11:31:52 AM »
It definitely explains it a bit better but unfortunately I'm not sure if Mach can do what you're asking.

I will leave this to someone better qualified as there are some very sharp folks around here that will be along very soon to help.  ;)

Dave
----------------------------------------------------------------------
Just because I'm a Global Moderator, don't assume that I know anything !

Dave->    ;)

Offline ger21

*
  • *
  •  6,295 6,295
    • View Profile
    • The CNC Woodworker
Re: g-code save
« Reply #4 on: June 29, 2010, 11:41:44 AM »
If it'sloaded in Mach3, can't you click the Edit G-code button and save it? Or does that not work?
Gerry

2010 Screenset
http://www.thecncwoodworker.com/2010.html

JointCAM Dovetail and Box Joint software
http://www.g-forcecnc.com/jointcam.html
Re: g-code save
« Reply #5 on: June 29, 2010, 12:35:47 PM »
Very close, but I can't see how a wizard can get to the data in the editor. Granted, it could be used as a manual workaround (by saving to a file, then giving that to the wizard) but it's a non-obvious step and I'm trying to automate as much as possible.

Offline ger21

*
  • *
  •  6,295 6,295
    • View Profile
    • The CNC Woodworker
Re: g-code save
« Reply #6 on: June 29, 2010, 03:24:33 PM »
That's what happens when you don't read the whole question. :)
Gerry

2010 Screenset
http://www.thecncwoodworker.com/2010.html

JointCAM Dovetail and Box Joint software
http://www.g-forcecnc.com/jointcam.html
Re: g-code save
« Reply #7 on: June 29, 2010, 03:48:16 PM »
I had missed the edit button, in looking for a save facility, and missed that the manual bit was doable. So a useful comment even if it wasn't the solution :)