Fusion 360 Combing G-Codes

Has anyone had success combining codes? I have three processes where the origin changes relative to the part to maximize material usage. I’d like to combine all three codes so Fusion moves seamlessly from one process to the next, but I seem to be doing something wrong.

I tried combining them in Fusion, but it doesn’t seem to handle the variation in stock orientation well. When I combined them in Notepad++, only the first set of code shows up in the OF render. I suspect this might have to do with the headers or footers in the individual codes.

Has anyone experienced this or have any advice?

I use Fusion - still learning - and have combined toolpaths successfully. I use Visual Studio Code, and cut and paste the gcode then resave.

Can you provide a few more details about the three processes, and what you mean by stock orientation variation.

Perhaps a screen shot of the toolpaths, and an image of the stock you are starting off with would also add clarity.

VS Code would be my first choice. Though fusion should theoretically do it, I’ve never tried.

Hello John,

In Fusion, if the three processes are all part of the same setup you can combine them in one file by clicking on each one on the Operations page of the NC Program page. They do have to be all using the same cutter in the free version of Fusion however. They do not have to be consecutive to each other.

To combine the three processes if they are not all part of the same setup you can combine them in one file by turning on each setup on the Operations page of the NC Program page and turning on just the processes you wish to make into one file.


You will get a warning message when you do this because it is up to you to make sure you won’t get a crash between the setups - if the stocks are at different heights and the tool is not lifting up enough between them or you are using different origins but you have not setup multiple origins on your machine for instance. But it will output the combined code.

To combine code from Fusion in an editor, open the first file in an editor and scroll to the bottom.
Screenshot 2024-09-15 213544
Then delete the last 2 lines. You want to make sure you cutter is ending that file on a lift to a safe clearance height - G53 G0 Z0 in this case. That way it is clear of everything to rapid to the next starting place.
Screenshot 2024-09-15 214354

Then open the next file in another instance of your editor:

And delete the first line - the % character.
If your file has a second line that starts with “O” - that is a capital o - then delete that line too.


But note the G54 on line N30. If the first file is G54 also then they will use the same physical origin on your machine table. If you don’t want that you need to make one of them G55 for example but you have to know how to setup multiple origins on your machine.

Now you can copy (CTL-A then CTL-C) and paste it to the end of the first file.
You will need to do the possess all over again at the end of that combined file and the third file to combine them.

From your original post I see you do want multiple origins. That’s a more involved topic. I will try to post something about it latter - maybe not till tomorrow.
But in the mean time here is some bedtime reading for you:
Work offsets (G54-G59)

2 Likes

The basic instruction to set multiple origins on the BB controller is by adding the following lines to a file, or making a NC file with just these lines in them.
G92.1
G10 L2 P_ X___ Y___ Z___

The G92.1 turns off the universal offsets of G92 so they will not get added to the other offsets.
G10 L2 sets a coordinate system.
The P value is which offset register you want to use - i.e. P1=G54 P2=G55 P3=G56 etc. based on table here
For the X, Y and Z values you need to fill in the offset from your origin to home.
You can get that info when you find your origin. Just look under the “OFFSETS” column on the control. This is the offset distance from home.

Here is a sample of what 3 offsets would look like:

%
G92.1
G10 L2 P1 X2.345 Y4.567 Z-3.45 ( SET G54 )
G10 L2 P2 X6.456 Y9.567 Z-2.3 ( SET G55 )
G10 L2 P3 X15.356 Y20.456 Z-1.345 ( SET G56 )

These commands are modal so they will stay in effect until you reboot or rehome. So you do not need to put them in every file - just the first one you run.

I have never seen anyone suggest using G92.1 before but I now think it is crucial to reliable results.
There is one confusing issue with the BB controller that has made setting offsets always unreliable for me in the past. That issue is thoroughly discussed here. Thanks to Aiph5u for setting me straight.

Simply stated it is this:
When you set an origin with touch probe you are not setting G54 as I had always thought. It is actually setting G92 which is a universal offset of all coordinate systems. G54 is in fact still set to all zeros.

You can test this by rebooting the machine to get rid of all origin settings then touch off a stock corner with the probe as normal. Then move the spindle away and type G59 G00 X0 Y0 in the MDI.

I would have always expected that command to take the spindle back to the home position since G59 has not been set.
But in fact it will go the spot you touched off with the probe. All coordinates G54 - G59.3 will go to the same spot even though you have not set any of them. And if you set some origins with G10 - then you use the touch probe somewhere else - ALL the origins will move relative to that spot.

This fact complicates the simple instruction of using G10 L2 P_ X___ Y___ Z___ to set multiple origins. If there is something set in G92 then that will be ADDED TO whatever you set with G10.

So I did some checking tonight and verified that we can turn off G92 by using G92.1
The best way to set offsets then I think is to put G92.1 in the file before you set offsets with G10.

And if you decide to re probe one of your pieces at some point after you have used G10 - then be sure to run G92.1 again or else all of the origins will be thrown off of where they were.

2 Likes

Thanks Chris, I tried selecting mutliple setups.

I get the following error.
image

I did try the second method and it worked perfectly.

Thank you so much!

1 Like