Hello Guest it is May 14, 2024, 11:36:54 PM

Author Topic: Mach4 vs Mach3 Gcode?  (Read 1843 times)

0 Members and 1 Guest are viewing this topic.

Mach4 vs Mach3 Gcode?
« on: August 28, 2021, 12:07:06 PM »
Does Mach3 lathe code directly cross over to Mach4 lathe? I have a .tap that runs good in mach3. Mach4 has the arc mode settings matching my mach3 setup. At the G03 the tool path goes clockwise gouging into the piece instead of going counter clockwise and leaving a nice radius on the end of the piece.

Distance mode is set to Absolute and IJ mode is set to Incremental just like Mach3. I have been using this code to make this piece for well over a year just wont translate to Mach4.

G20 G90 G91.1 G64 G40 G18


Re: Mach4 vs Mach3 Gcode?
« Reply #1 on: August 28, 2021, 08:38:36 PM »
Is it a bug in mach4 or did I do something wrong? All my G02's are going Counter and all my G03's are going clockwise.
Re: Mach4 vs Mach3 Gcode?
« Reply #2 on: August 29, 2021, 06:47:18 AM »
Is it a bug in mach4 or did I do something wrong? All my G02's are going Counter and all my G03's are going clockwise.

I went thru and manually changed all my G02's to G03's and viseversa. All seems good now but I shouldn't have to give a CCW command to get a CW movement. Is there a problem with Mach4? Is this something that is getting fixed in the next release of the software? I'm to the point where I want to buy the license but if i am going to have to edit all my programs (100's) I might just load Mach3 back on the new computer and hope for the best.
Re: Mach4 vs Mach3 Gcode?
« Reply #3 on: August 29, 2021, 08:41:25 AM »
Mach3 has a "Reversed arcs in front post" checkbox hidden away in the setup under ports and pins / lathe options. Does Mach4 have one hidden away somewhere?

Offline smurph

*
  • *
  •  1,548 1,548
  • "That there... that's an RV."
    • View Profile
Re: Mach4 vs Mach3 Gcode?
« Reply #4 on: August 29, 2021, 04:31:39 PM »
No, Mach3 lathe and Mach4 are totally different.  Mach 3 had lathe functions "bolted" onto the one and only G code interpreter which was primarily a mill interpreter.  Mach4 has the capability of having multiple interpreters (chosen in the first tab of the configuration dialog).  So Mach 4 has a proper lathe interpreter that is Fanuc compatible.  It will accept one or two line variants of the G76 threading cycle, so a generic Fanuc post processor in most CAM systems should do well. 

Steve
Re: Mach4 vs Mach3 Gcode?
« Reply #5 on: August 29, 2021, 06:00:52 PM »
Nice to meet you.
I am migrating from Mach3 to Mach4.
I also got an error when I loaded Gcord that worked on Mach3 into Mach4 as it is.
I gave up. I use FUSION 360 for CADCAM. When generating a Tap file, Mach4 is specified and the Tap file for Mach4 is used.
Re: Mach4 vs Mach3 Gcode?
« Reply #6 on: August 29, 2021, 06:37:43 PM »
Ok then I will see if there is a fanuc pp in my cam program.  Thanks
« Last Edit: August 29, 2021, 06:39:55 PM by stevehuck »

Offline smurph

*
  • *
  •  1,548 1,548
  • "That there... that's an RV."
    • View Profile
Re: Mach4 vs Mach3 Gcode?
« Reply #7 on: August 29, 2021, 07:26:56 PM »
Nice to meet you.
I am migrating from Mach3 to Mach4.
I also got an error when I loaded Gcord that worked on Mach3 into Mach4 as it is.
I gave up. I use FUSION 360 for CADCAM. When generating a Tap file, Mach4 is specified and the Tap file for Mach4 is used.

Mach4 is not Mach3.  Most G code made specifically for Mach3 will not work in Mach4.  This is true primarily for Lathe but can also be the case for Mill as well.  Mach 4 is a lot stricter and adheres to a standard a LOT more than Mach 3.  Since Fanuc is pretty much the industry standard, we made Mach4 primarily emulate a Fanuc 21i system in both Mill and Lathe.  This made it a LOT easier for people to run CAM programs that didn't have a Mach 3 specific post processor. 

But the fact that some Mach3 G code will not run on Mach4 is not a bug, it was by design.  In fact, most machine controllers can have major differences between versions.  But Fanuc maintains compatibility better than some of the others, which is another reason we chose to become Fanuc compatible. 

Steve
Re: Mach4 vs Mach3 Gcode?
« Reply #8 on: August 30, 2021, 04:02:17 PM »
That makes sense and I think you did the right thing but Why does a G02 go CCW and a G03 go CW? Is it because the tool post is mounted front and a fanuc is mounted in the rear? I guess i would have thought that those two commands are set in stone. If it is a case where it is tool post dependent there would be an option check box for forward or reverse tool post.

Offline smurph

*
  • *
  •  1,548 1,548
  • "That there... that's an RV."
    • View Profile
Re: Mach4 vs Mach3 Gcode?
« Reply #9 on: August 31, 2021, 03:57:15 PM »
That makes sense and I think you did the right thing but Why does a G02 go CCW and a G03 go CW? Is it because the tool post is mounted front and a Fanuc is mounted in the rear? I guess i would have thought that those two commands are set in stone. If it is a case where it is tool post dependent there would be an option check box for forward or reverse tool post.
It depends on which side the tool post is and which way the spindle turns.  It is more machine centric than controller centric as the machine tool builder decides where the tool post is and the spindle direction.  Meaning all Fanuc controlled machines will not have the tool post mounted in the rear.  However, most CNC machines have the tool post in the rear or they have both a rear and front tool post.  And most CNC lathes determine the spindle direction as if looking at the spindle from behind the chuck too.  Mach3 could not handle a dual tool post machine and it did not adhere to any industrial standard.  But even Mach 3 defaulted to a rear tool post for a CNC lather.  However, most lathes that Mach 3 ran were manual lathe conversions that had the tool post in the front, hence the swap G02/G03 checkbox. 

Mach4 adheres to an industrial standard and can handle a dual tool post machine where some tools can be on the rear tool post and some tools can be on the rear tool post.  So it isn't a binary choice where all tools are either on a front or rear tool post like Mach3.  Have a look at the "Newfangled Lathe Turret Standard.pdf" doc.  It explains the tool direction.  Since Mach 4 can support both a read and front tool post, it is a little more complicated than just having a check box to swap G02/G03 in Mach4. 

To fix your issue, you have two options.

1. Change the direction of your tool in the tool table.  Keep in mind you may need to change the spindle direction as well (swap the direction that M3 and M4 do).  You just have to figure out if you need one, the other, or both. 
2. Swap G02/G03 in the G code.  (Change what the post processor outputs if you use CAM.) 

Steve