Hello Guest it is March 18, 2024, 10:35:52 PM

Author Topic: G-Code for Mach4 vs. Mach3  (Read 3653 times)

0 Members and 1 Guest are viewing this topic.

G-Code for Mach4 vs. Mach3
« on: July 12, 2018, 10:43:34 PM »
Hi All--

I'm in the process of transitioning (or trying to) from Mach3 to Mach4.

My CAM package (CamBam) has a postprocessor for Mach3 built in, but none for Mach4.

Is Mach4's interpretation of G-Code identical to that of Mach3?  So that my current CamBam Mach3 postprocessor will generate code that will run under Mach4 without issues?

Or would you all recommend that I use the Fanuc postprocessor (which CamBam also has) instead?

Thanks--

--dave
« Last Edit: July 12, 2018, 10:45:15 PM by MosaicDave »

Offline RICH

*
  • *
  •  7,427 7,427
    • View Profile
Re: G-Code for Mach4 vs. Mach3
« Reply #1 on: July 13, 2018, 05:43:53 AM »
dave,

There are differencs in the gcodes. Would have thought that CamBam would have a
Mach4 postprocessor available, but if not, would suggest you get info on which Fanuc
version is being used by CamBam and compare to current Mach 4 definitions of Gcode.

Don't modify a postprocessor  if you do not understand what your doing.

RICH
Re: G-Code for Mach4 vs. Mach3
« Reply #2 on: July 13, 2018, 06:24:21 AM »
Hi,
I found that all my Mach3 files ran in Mach4. It must be said that the Mach3 files themselves were fairly simple, they didn't have
tool compensation and that sort of stuff just basic movement codes and they run fine in Mach4.

Mach4 is a little stricter with modal commands like drill cycles, we've gotten used to Mach3's rather loose standards and it appears that Mach4
is more difficult, its not, it just more demands closer attention to Gcode syntax.

I've used Fanuc Posts with pretty good success.

Craig
'I enjoy sex at 73.....I live at 71 so its not too far to walk.'
Re: G-Code for Mach4 vs. Mach3
« Reply #3 on: July 15, 2018, 12:12:34 PM »
Interesting: Vectric tells customers to us Mach3 Post processer as there is no significant differences.
Re: G-Code for Mach4 vs. Mach3
« Reply #4 on: July 15, 2018, 03:26:44 PM »
I'd say for a post processor there won't be a lot of difference.

G00, G01, G02, G03, G04, G31
M0, M1, M2, M3, M4, M5, M7, M8, M9 M30
https://machmotion.com/blog/knowledge-g-code
https://machmotion.com/blog/knowledge-support-mcode

Are all the same.....  essentially as far as a post processor is concerned because all they normally do is profile and pocket cut a shape out

Wizards, cyclic (canned) operations, MDI entry..... that is another matter.....  but I've not seen many post processors use canned operations (unless you're using / calling a drilling operation, but most of the time the post processor will look at them as pocket operations (unless you tell it differently that is).

With laser there is the change from M11+M10 >> M62+M63 for synchronous output on + off (but that would be motion controller dependent too, whether its implemented in Mach4, same with threading applications {anything synchronization dependent})
Rob

Albert Einstein ― “If you can't explain it to a six year old, you don't understand it yourself.”
Re: G-Code for Mach4 vs. Mach3
« Reply #5 on: July 17, 2018, 04:19:51 PM »
Okay everyone, just to say for now, thanks very much for the replies.

--dave

Offline smurph

*
  • *
  •  1,544 1,544
  • "That there... that's an RV."
    • View Profile
Re: G-Code for Mach4 vs. Mach3
« Reply #6 on: July 17, 2018, 11:46:31 PM »
For a post processor, the main differences will be in the canned cycles.  You cannot repeat the cycle G code on every line like you could in Mach3.

Mach3 would allow:
G83 X.. Y.. Z.. R.. Q..
G83 X.. Y.. Z.. R.. Q..
G83 X.. Y.. Z.. R.. Q..
G80
...
Mach 4 requires:
G83 X.. Y.. Z.. R.. Q..
X.. Y
X.. Y
G80

Threading on the lathe (G76) is Fanuc compat and Mach3 threading code will just not run in Mach4. 

Steve
Re: G-Code for Mach4 vs. Mach3
« Reply #7 on: July 18, 2018, 08:04:37 AM »
Hi Dave,
Steve is correct. This is a snippet of Gcode that is produced by software utility that produces Gcode for circuit boards.
This particular snippet is part of the PCB drill file. It works fine in Mach3 but not in Mach4.

Code: [Select]
N00160 G82 X33.4300 Y47.1500 Z-2.0000 F100   R1.0000  P0.500000
N00170 G82 X33.4300 Y52.2300
N00180 G82 X33.4300 Y59.8500
N00190 G82 X33.6000 Y12.0600
N00200 G82 X33.6000 Y17.1400
N00210 G82 X34.0650 Y34.4500
N00220 G82 X34.0650 Y42.0700
N00230 G82 X35.7400 Y66.1200
N00240 G82 X35.9700 Y52.2300
N00250 G82 X35.9700 Y59.8500
N00260 G82 X35.9900 Y6.6000 
N00270 G82 X35.9900 Y9.4000 
N00280 G82 X38.0000 Y14.5300
N00290 G82 X38.0000 Y17.0700
N00300 G82 X38.6700 Y63.3300
N00310 G82 X39.6400 Y60.9200

Note that the first line:
Code: [Select]
N00160 G82 X33.4300 Y47.1500 Z-2.0000 F100   R1.0000  P0.500000is complete with all the parameters of the canned cycle, whereas the second line:
Code: [Select]
N00170 G82 X33.4300 Y52.2300 is incomplete. The 'G82' code indicates to Mach to start a modal drill cycle but is then given an incomplete
list of arguments. Mach4 doesn't like it. If the incomplete 'G82''s are edited out...the resulting code is Mach4 compliant:

Code: [Select]
]N00160 G82 X33.4300 Y47.1500 Z-2.0000 F100   R1.0000  P0.500000
N00170 X33.4300 Y52.2300
N00180 X33.4300 Y59.8500
N00190 X33.6000 Y12.0600
N00200 X33.6000 Y17.1400
N00210 X34.0650 Y34.4500
N00220 X34.0650 Y42.0700
N00230 X35.7400 Y66.1200
N00240 X35.9700 Y52.2300
N00250 X35.9700 Y59.8500
N00260 X35.9900 Y6.6000 
N00270 X35.9900 Y9.4000 
N00280 X38.0000 Y14.5300
N00290 X38.0000 Y17.0700
N00300 X38.6700 Y63.3300
N00310 X39.6400 Y60.9200

Craig
'I enjoy sex at 73.....I live at 71 so its not too far to walk.'