Chad Krause

A small blog about my projects

How To Broach In Fusion 360

How To Broach In Fusion 360

How to broach in Fusion 360

Shoving a square peg through a round hole

(To create a keyway)

Fusion 360 (as of July 2, 2019) does not have a canned cycle for broaching. I needed to do this with a VMC.

Note: This is sometimes called linear broaching. Also, I use spindle lock and spindle orient interchangeably

Broaching is really just repetitive plunging. Unfortunatly, I don't think Fusion 360 has anything for plunge milling either. The best way to do broaching is:

  1. Start on the edge of the part, where the first plunge should be
  2. Rapid Down
  3. Rapid Up
  4. Feed .002-.003 to the next position
  5. Repeat 2-4 until you have the size you need.

Fusion has no drilling cycle that is anything like that. The best it has is a standard, feed down, rapid up drilling cycle.

The reason for feeding to the next hole is that some machines will cut corners while rapiding, and we don't want that because that could mean we run into the part and crash.

How to broach in Fusion 360

Step 1: Modifying the post

Since Fusion has no provisions for broaching, naturally the posts (at least our post) does not have anything for broaching either. We need to execute an M19 command to orient/lock the spindle.

In my post, I made a modification so that any time the RPM is set to 0, it calls an M19 instead of a S[ RPM ] M3. My post also has a feature where it will fail if the RPM is less than 1. We have to change that.

First, some parameters. I made two parameters, one to enable locking the spindle, and one to add a dwell (G4) after locking the spindle. I thought this might be good if the machine decided to move before the spindle was completely locked.

In the properties object (line 40 for me), add these above the existing properties:

// user-defined properties
properties = {
  lockSpindle: true, // M19 lock for 0rpm
  lockSpindleDwellSeconds: 2.0, // dwell after lock

and some definitions:

// user-defined property definitions
propertyDefinitions = {
  lockSpindle: {title: "Lock Spindle", description: "When 0rpm is commanded, call M19 to orient/lock the spindle", type: "boolean"},
  lockSpindleDwellSeconds: {title: "Spindle Lock Dwell", description: "Dwell in seconds after M19 is called"},

These will help us later on and allow us to disable locking the spindle if needed.

Next, we need to modify the logic that commands the spindle RPM (line 549 for me):


    if (spindleSpeed < 1) {
      error(localize("Spindle speed out of range."));


    if ((spindleSpeed < 1 && !properties.lockSpindle) || (spindleSpeed < 0 && properties.lockSpindle)) {
      error(localize("Spindle speed out of range."));
What does this line of code do?


If the spindle speed is less than 1 rpm, fail to post.


If the spindle speed is less than 1 rpm and we do not have our 'lockSpindle' parameter turned on, error out. OR if the spindle speed is less than 0 and we do have the 'lockSpindle' parameter turned on, fail to post.

This will preserve the original logic when we don't want our parameter on, but allow us to continue if we do want to lock the spindle.

Next, we have to create a function to lock the spindle instead of turning it on:

 * Locks the spindle using the M19 spindle orient command
function lockSpindle() {
  writeComment("*** LOCKING SPINDLE ***");
  if(properties.lockSpindleDwellSeconds > 0) {
    writeBlock(gFormat.format(4), "P" + milliFormat.format(properties.lockSpindleDwellSeconds * 1000))

Add this right after the writeComment(text) function. Be sure to not put this inside any other function.

What does this function do?

3 things:

  1. Adds a comment letting the user know the spindle is locking.
  2. Writes a M19 (spindle orient)
  3. Addes a dwell if the user put more than 0 seconds (in our lockSpindleDwellSeconds property)

Lastly, call the function when the spindle speed is 0rpm (line 578 for me):


        sOutput.format(sCode), mFormat.format(tool.clockwise ? 3 : 4)


    if (isFirstSection()) { // TAG: if RPM changes


    if(sCode == 0) { // Orientation Lock Mode
    } else { // Normal spindle mode
        writeBlock(sOutput.format(tool.spindleRPM), mFormat.format(tool.clockwise ? 3 : 4));


    if (isFirstSection() && sCode > 0) { // TAG: if RPM changes
What does this code do?

If the spindle is 0rpm, call the function to lock the spindle, otherwise, write a normal spindle command. It will also not call a delay for the isFirstSection part since the rpm is 0 and will cause a divide-by-0 error.

That should be it for the code.

Step 2: Using it in Fusion 360

Since broaching is not a toolpath in Fusion 360, we have to do some extra steps. First, make some points for your broach to plunge on. Remember to take in account the thickness of the broach.

I made a sample pulley with a .500" bore and a .125" x .0625" key.

Line the broach up. You'll see I used 2 1/8" boxes with construction geometry to represent the broach.

Then I added a bunch of points using the rectangular pattern tool and the 'extent' option. I added a point every .003".

Go to the Manufacturing tab and select a drill cycle. I chose a 1/8" drill, although it doesn't really matter. I couldn't figure out how to make a square drill, at least for appearance.

Select the points you just made and set the correct depths and what not. Then before you hit 'OK', set the rpm to 0 and the feed to whatever (the broaches can go fast).

You'll get a warning, just hit 'Yes'

Then you are all set to post process. Make sure you have the new parameters turned on

Now generate you G-Code.

You'll see the M19 command, followed by the dwell, followed by the drill cycle

That's it!

Note: I am not responsible or liable for any machine crashes or broken tools or scrapped parts or whatever. This is unofficial, experimental stuff. USE AT YOUR OWN RISK

Here is a part that my friend created with this code:

Please leave a comment if I helped, or email me at if you have any questions. I will try to help.

Fusion 360 team: Please create a proper broaching routine

All comments