Enhanced Avid Post Processor for Fusion 360

I have published an enhancement to the Avid post processor for Fusion 360 here: https://github.com/berrianmtn/avid-fusion-post-processor

This is a very early version, but it allows you to use many standard Fusion tool paths, such as 3D parallel pass tool paths using the Avid laser. Essentially the laser is turned on, at the appropriate power based on the spindle speed during cutting operations, and you can utilize the smooth lead in/lead out/transition that Fusion provides between lines.

Should work for contour (simple vector) and pocket (filling) paths. Probably works for most paths. Note: this will follow Z axis geometry, so if your milling tool path would move in the Z axis, so will this later tool path.

For example, here is a 3D parallel tool path using sketch geometry to choose parallel path geometry

Zooming in very far, you can see the cutting (blue) geometry during which the laser would be burning, along side the non-cutting (lead-in, lead-out) paths. This may be difficult to see, but the smooth geometry (green, light blue in the following pic) allows for smooth machine movements from one scan line to another.

Final (awesome) result here:

A video showing the laser filling then cutting out the Avid keychain example is here: https://www.youtube.com/watch?v=7XVRGJMU7Sg

Code (post processor) is available here and will always be free, and Avid you can take/use 100% of anything you want: GitHub - berrianmtn/avid-fusion-post-processor: BMP Customized post processor for Fusion CNC

Very cool!

What have you changed over the stock post? Right now in the stock post you can use the special fusion laser mode, and if you want you can currently use regular milling tool paths as laser tool paths.

You just need to be on tool 99 and have that tools RPM set to the laser power you want.

The stock post processor wasn’t always including M3 in the tool path section, so the spindle (laser) was never turned on:

(STOCK)
(MACHINE)
(  VENDOR AVID EX ROTARY)
(  MODEL CHETEX)
(T99 D=0.007 CR=0. - ZMIN=0.234 - FLAT END MILL)
G90 G94 G40 G49 G17
G20
(-ATTENTION- PROPERTY SAFE RETRACTS IS SET TO CLEARANCE HEIGHT.)
(ENSURE THE CLEARANCE HEIGHT WILL CLEAR THE PART AND OR FIXTURES.)
(RAISE THE Z-AXIS TO A SAFE HEIGHT BEFORE STARTING THE PROGRAM.)

(PARALLEL1)
T99 M6
G17 G90 G94
G0 A0.
G0 X1.5092 Y0.2002
Z0.834
G0 Z0.314
G1 Z0.2347 F50.
....

Note: my machine has a different name/model but is actually unmodified from the avid machine profile.

Even if it did include that, for example S21 M3the laser would be on at 21% for the entire tool path, including rapids, lead ins, lead outs, dwells, …

My post will ensure, when the laser tool is being used, that a S0 M3is issued in the section header (fusion tool path start) after the T99 M6.

Only during the cutting (CUTTING and FINISH_CUTTING) movements the laser is turned on at the spindle RPM and is turned off for non-cutting operations (lead-in, lead-out, rapids, etc.). This is done by introducing the onMovement function:

function onMovement(movement) {
  if (!bmpLaserMilling) return;
  switch (movement) {
    case MOVEMENT_CUTTING:
    case 14: /* finishing cut */
      if (bmpLaserState == 0) {
         writeBlock(sOutput.format(currentSection.getTool().spindleRPM));          
        bmpLaserState = 1;
        gMotionModal.reset();
      }
        break;
    default:
      if (bmpLaserState == 1) {
        bmpLaserState = 0;
        writeBlock(sOutput.format(0));        
        gMotionModal.reset();
      }
  }  
}

M3s should always be issued! Odd that it’s not happening.

have you tried the dedicated laser tool pathing in fusion?

Yeah, it’s weird. Looking at the code, IIRC (I’m away from my main computer), the logic should emit an M3 after tool change, or if it is the first section (tool path) always, or similar logic.

I assume you are referring to setting the operation type to cutting in the manufacturing setup? In that case, all that is exposed is a 2D profile tool path. Maybe I’m missing something??

My use case for laser on the Avid CNC is 99% engraving/marking – almost zero cutting. I have a dedicated laser system based on homegrown centroid for more typical laser only use cases. That is generally driven by lightburn, though that can be a mess (I mentioned the g-code and rounding issues that plagues lightburn in some other thread). Also, for my use cases, the engraving is almost always after typical milling (routing) operations.

Attached is the Fusion project for the Avid keychain, if you are curious.

Avid Keychain v5.f3d (1.1 MB)

Ok, so this special post makes a little more sense… Question: Why not just use VCarve/Aspire with the laser module? It makes these type of engravings a total piece of cake.

Switching CAM software can be a pain, but Vectric really does make laser engraving easy.

That may be good option for some. I chose to enhance F360 capabilities and share it for the benefit of those using Fusion. And Free.

That’s awesome, thank you for doing this.

We did a similar thing for Mach… basically we let users convert router g code into laser g code right in Mach. That works well, but you do lose out on some of the toolpath optimization you get in something that’s more dedicated to lasering… Like for example being able to raster across a whole bunch of items at once, etc. That feature alone saves a lot of time when lasering.

I do wish Fusion would add some more support for toolpaths like that. Perhaps an “Add-in” could be created to do that…

Can this post processor be enable to use M11/M10 instead of M3/M5? Right now I use two different lightburn profiles to generate code for my Mach3 system.

I have an Endurance 10W laser that I mount on my CNC. I have a Mach 3 profile that uses M11/M10 to avoid the delay on on/off with M3/M5. This works well but requires me to convert light burn code, which does not support Mach 3, to something my system can read.

To do this I use the GRBL-M3 profile in lightburn when I want to cut something as this will only fire my laser at 100% When I want to engrave something at less than 100% or use fill tool path, I use the GRBL-NEW profile. To make these compatible with Mach3 and my specific laser, I used ChatGPT to create an apple script that coverts the light burn code to something that Mach3 can use. The GRBL-new profile allows me to control the laser power but still requires some manipulation if I want to use variable power within the same program. Come to think of it I could probably just use the GRBL-new profile all of the time.

I imagine it could be tweaked. Assuming M11 is turn on laser and M10 is turn off, those commands could replace the current output.

Note: the laser power output by this processor is really controlled by spindle speed. M3 is used to enable the “spindle” (laser), and S commands turn on/off/control the power.

So the workflow is more like:

Section Start:

M3 S0 ; enable spindle, laser off

G0 x y ; go somewhere to start

g1 x y s20 ; move to new location with laser on at 20%

….

g0 x y s0 ; move to new location with laser off

….

M5 ; disable spindle

unfortunately in Mach 3 it is not as simple as just using M11/M10. I have a separate laser only machine 3 profile with many modification made to the configuration to make those commands work without any delay in firing the laser. This also requires a small breakout board to be added to your CNC controller this is outlined in the mach 3 set upI have attached. I made this profile many years ago after scouring Mach 3 and other forums for information. I don’t know if this will help you but it might help others who have Mach 3 and would like to use a laser attachment. I will also attach my apple scripts for GRBL-M3 and GRBL-NEW to convert these to something created in lightburn that Mach3 can use. This could very well be specific to my Endurance laser and how it interacts with Mach 3. I have never tested it with a different set up. Hopefully there is some value to it for you.

I have attached my set up guide for Mach 3. this is also posted in this forum in a different thread. I will add the link to the thread also. Mach 3 set up thread

Mach 3 set up.pdf (372.9 KB)

I am not able to upload scripts to this thread. my laser script is pasted into this thread. M3/M5 to M11/M10 apple script. This is the apple script I use to convert GRBL-M3 in light burn for 100% power/cutting. I have a separate script that I use for fill tool paths or to use less than 100% power that works with GRBL-NEW. That script Adds M11PxSx commands above every G0 move to an fire or turn off the laser.

this apple script is pasted below as I can not upload the file. Again I’m not sure how much use this is but maybe it gives you some information or helps someone else. Feel free to use/modify this as needed if it is helpful to you. One day I will try to modify these further to see if I can get my system to output greyscale raster images but I have not yet had the time or motivation to try this. But this thread has be shining about this again.

_________________________________________________________________________

-- Choose the file to be modified using the Finder

set chosenFile to choose file with prompt “Choose a file to modify:”

set fileReference to open for access chosenFile with write permission

-- Initialize variables

set modifiedLines to {}

-- Define the text to be inserted

set insertLineAbove to “M10P2”

set insertLineBelow to “M11P2 S45”

-- Read and process the file line by line

try

-- Read the file line by line

**set** eofReached **to** *false*

**repeat** **until** eofReached

	**try**

		-- Read the current line

		**set** currentLine **to** **read** fileReference until "

"

		-- Check if the line contains "G0"

		**if** currentLine **contains** "G0" **then**

			-- Add M10P2 one line above the G0 command

			**set** **end** **of** modifiedLines **to** insertLineAbove

			**set** **end** **of** modifiedLines **to** currentLine

			-- Add M11P2 S30 one line below the G0 command

			**set** **end** **of** modifiedLines **to** insertLineBelow

		**else**

			-- Keep the line unchanged

			**set** **end** **of** modifiedLines **to** currentLine

		**end** **if**

	**on** **error**

		-- End of file reached

		**set** eofReached **to** *true*

	**end** **try**

**end** **repeat**

-- Close the file

**close access** fileReference

-- Combine the modified lines into a single string

**set** modifiedText **to** (*items* 1 **thru** -2 **of** modifiedLines) **as** *text*

-- Write the modified text back to the file

**set** fileReference **to** **open for access** chosenFile **with** write permission

**set eof** **of** fileReference to 0

**write** modifiedText to fileReference

**close access** fileReference

**display dialog** "File successfully modified and saved." buttons {"OK"} default button "OK"

on error errMsg

-- Handle any errors that occur

**try**

	**close access** fileReference

**end** **try**

**display dialog** "Error: " & errMsg buttons {"OK"} default button "OK"

end try