FANUC Modular G- Code Programming

FANUC Modular G- Code Programming

wgr_eng
Enthusiast Enthusiast
1,868 Views
8 Replies
Message 1 of 9

FANUC Modular G- Code Programming

wgr_eng
Enthusiast
Enthusiast

Hello 

 

I was wondering if I could modify the generic Fanuc post to output code in this format. 

 

The generic Fanuc post is of no use. I get a lot of errors when I run in my Hardinge GX 250 5 AX Fanuc 31 I B5 controller.

 

I stop & run operations from the middle of the program and since the generic post doesn't output safety blocks before each operation I really can't run operations from the middle of the program.

 

It'll be great if some could help me figure out a working post. 

 

It has been almost 3 months since we purchased Fusion 360 and there is not one part we have made using it.

 

TIAModular G-Code Programming Format FANUC.png

 

 

 

 

 

 

0 Likes
1,869 Views
8 Replies
Replies (8)
Message 2 of 9

KrupalVala
Autodesk
Autodesk

Hi @wgr_eng ,

 

Instead of G65 P9006 (Activate Features) you want to call a O9006 (Activation Macro) and Instead of G65 P9008 (Deactivate Features)you want to call a O9008 (Deactivation Macro) ?

 

Thanks,



Krupal Vala
Senior Technology Consultant - Post Processor & Machine Simulation
0 Likes
Message 3 of 9

wgr_eng
Enthusiast
Enthusiast

Hello @KrupalVala 

 

Thank you for getting back.

 

The generic Fanuc controller doesn't output proper G code. After the end of a multi axis operation I get an improper G code alarm.

So I wanna have my custom macros 

I want to do a macro call G65 P9006 to activate all the 5 - axis features.

Then the body of the program with the part geometry.

Before the end of the program or tool change I wanna deactivate all the 5 Axis features using another Macro G65 P9008. 

 

Please review my current sample programs and lemme know if you have any questions. 

 

Thank you 

 

 

0 Likes
Message 4 of 9

wgr_eng
Enthusiast
Enthusiast

Hello Krupal 

 

I am using a Fanuc Post Processor for the machine Bridgeport GX 250 5 AX-  with A & C axes Fanuc 31 I controller. The machine does not have a probe so please ignore the Probe Macros.

 

I couldn't use the generic FANUC post (with so many alarms) so I was thinking if I could use working custom activation & deactivation macros as given in the Fanuc Manual. 

 

But it maybe be a complex logic to build. So I was wondering if you could help me modify the post with the custom changes needed.

 

Please refer to the nc files attached. I attached 3 NC code files & the project file.

 

>>> SOLIDCAM FANUC WORKING G CODE

Working G code from SolidCam

 

>>>FANUC GENERIC POST OUTPUT 1003 - UNEDITED

 

>>>CHANGES NEEDED 1002 - CHANGES NEEDED COMMENTED

pmtPMHSG_0-1603249577042.png

 

0 Likes
Message 5 of 9

wgr_eng
Enthusiast
Enthusiast

Basically I am trying to do a manual Force tool change before each operation because I run operations from the middle of the program.  So the changes I needed will be the initial safety commands before a tool change , cancellation after the operation  & retract to safe plane.

 

Please find the attached PROJECT FILE.

 

Let me know if you have any further questions

 

Thank you 

 

 

 

0 Likes
Message 6 of 9

KrupalVala
Autodesk
Autodesk

Hi @wgr_eng ,

 

Thanks for sharing the files. I will work on it.

 

 



Krupal Vala
Senior Technology Consultant - Post Processor & Machine Simulation
0 Likes
Message 7 of 9

KrupalVala
Autodesk
Autodesk

Hi @wgr_eng ,

 

I have compared both files and found that some of the options you can activate through post properties and CAM project.

To get G54.1 P1, You need to set  WCS offset more than 5 in CAM project.

Capture.JPG

To get smoothing codes and G53 safe retract, You can control through post properties.
Capture2.JPG

To output, Q codes instead of P, Search below codes and change it  Q.

// Output each operation as a subprogram
  if (!usePattern && properties.useSubroutines) {
    currentSubprogram = ++lastSubprogram;
    writeBlock(mFormat.format(98), "Q" + oFormat.format(currentSubprogram));
    firstPattern = true;
    subprogramStart(_initialPosition, _abc, false);
  }

 

to get force G69 at the start of the program, search below codes and codes as shown below,

// absolute coordinates and feed per min

// add these two lines codes from here to
  gRotationModal.reset();
  writeBlock(gRotationModal.format(69)); 
// here

  writeBlock(gAbsIncModal.format(90), gFeedModeModal.format(properties.useG95 ? 95 : 94), gPlaneModal.format(17), gFormat.format(49), gFormat.format(40), gFormat.format(80));

 

to get force G0 or G90 with other NC codes, You need reset the codes {___.reset()} and then Add the code(G90 or etc) with other NC codes(X,Y....)

 

} else {
    gAbsIncModal.reset(); // reset
    gMotionModal.reset();// reset
    writeBlock(
      gAbsIncModal.format(90),
      gMotionModal.format(0),
      conditional(machineConfiguration.isMachineCoordinate(0), "A" + abcFormat.format(abc.x)),
      conditional(machineConfiguration.isMachineCoordinate(1), "B" + abcFormat.format(abc.y)),
      conditional(machineConfiguration.isMachineCoordinate(2), "C" + abcFormat.format(abc.z))
    );
  }

 

please note after the modification save the post and then test it carefully. I know there are other minor or same modification required as per the sample file but I think, now you can manage it. 

 

I hope this helps, but please let me know if you need anything else or if you have any questions.

 

Thanks,



Krupal Vala
Senior Technology Consultant - Post Processor & Machine Simulation
0 Likes
Message 8 of 9

wgr_eng
Enthusiast
Enthusiast

Hello @KrupalVala

 

Sorry for the late reply. I've been very busy.

 

So I made those changes and tested the program and I noticed the Euler angles are not correct. 

 

G68.2 .png

 

How can I influence these angles to output code as required.

 

Thank you 

0 Likes
Message 9 of 9

KrupalVala
Autodesk
Autodesk

Hi @wgr_eng 

 

In default condition Fanuc work with ZXZ Euler Convention method.

But Based on your requirement/Configuration, You can change the Euler method by changing the ZXZ to any Convention method as shown below Image. 

 

KrupalVala_0-1604385427672.png

 

Please refer controller manual before changing the Euler angle it also change the Rotary as well as linear axis direction.

 

Thanks,

 



Krupal Vala
Senior Technology Consultant - Post Processor & Machine Simulation
0 Likes