FreeCad

FreeCad Path Workbench

2024/03/11

FreeCad Paths

I’ve been using FreeCad to create STL files for 3D Printing for a long time. It’s a good tool with a some quirks but mostly lets me do what I want without too much trouble. So I’ve been happy with it more or less. I recently discovered it can also create g-code for CNCs with the Path Workbench. I’ve used Carbide Create in the past and was
eager to see how easy FreeCad is to work with. This post is based on the notes I took while learning how to use the Path Workbench.

WARNING My CNC is currently not working, so I haven’t tried the paths created in these tests. I am not an expert at FreeCad or CNC. Use any information presented here at your own risk.

Create an Object

Nearly all of the tutorials I’ve seen show paths carving out flat shapes and drilling holes in the stock.
1. Select Part Design Workbench Select Part Design workbench drop down 2. Create a new document with the Create New button or File > New menu. Create a new document 3. Click on Create Body followed by Create Sketch Create a body button Create a sketch button 4. In the sketch draw a rectangle define the shape of your body. How you center your sketch might depend on your CNC. I believe mine starts at 0,0 and works in the positive X and Y directions. So I select the XY-plane for the sketch. Select XY Plane for sketch 5. For my test I just want a simple rectangle with some simple features added to it. I switched to the Sketcher workbench and added a 254 x 114.3 mm rectangle to it.
Rectangle sketch 6. I use the Pad operation to set the height of the object to 31.75mm. Padded Rectangle 7. I want to create a curved face on the top of the object. To do this I select a side face and press Create Sketch.
8. I used the B-Spline tool and a line to create a curve. B-spline on face 9. And cut it out of the box with the Pocket tool. Pocketed B-Spline

I also added a square to the top and made a 5mm deep pocket with it.

Path Workbench

We use the Path Workbench to create tool paths. When I select Paths, I get a warning: > The currently selected unit schema: > ‘Standard (mm, kg, s, degree)’ > Does not use ‘minutes’ for velocity values.

Velocity is needed when specifying how quickly the tools will move through the paths. So we should set this by editing the Unit Systems value. To do this 1. Go to Edit > Preferences menu to open the preferences dialog 2. In the General Tab set your Unit System to Metric small parts & CNC(mm, mm/min) Unit System in General Tab 3. Press OK to close it.

Creating a Tool

FreeCad’s Path Workbench comes with a set of pre-defined tools. These probably won’t be the same specs as our end-mills. So we need to define tools that match our sets.

Tools > Path workbench
  1. In the Path menu select Toolbit Library editor
    Path > Toolbit Library Editor

  2. This will open a Directory dialog. Select the directory where you want to store the library and press OK. From Here FreeCad will ask you a series of questions.

It proceeds to ask to set up a * Toolbit working directory * Bit directory, a Shape Directory Just say yes to these. I also said yes to Copy example files to the new Bit directory andCopy example files to the new Library directory

  1. Once finished, you’ll see list of Default tools. To add your own bit press the Create Toolbit button Default Tools

  2. FreeCad will ask you to select a Tool Shape. They list several different types. For this post I’ll go with the Endmill Endmill shape

  3. Set the name you want to save your endmill to: File Name for custom tool it will show up in the list as a new toolbit New custom tool in list

  4. Double click on the tool to edit its properties You can use the Shape tab to edit the physical dimensions of the bit. tool shape properties * diameter * cutting edge height ( the bit part ) * shank diameter

The Attributes tab lets you edit other properties such as Material and Spindle Direction. tool attributes properties

edit as needed and press OK to save your edits

Press Close to close the toolbit library editor

Path Job

Once you have your tools defined, you can create Jobs. You use jobs to define the paths you want your CNC to follow.

  1. If you’re not already in the path workbench, Select the Path workbench. from the tool bar Tools > Path workbench
  2. Press the Job button ( or select Path > job menu) Path Job button This brings up the Create Job window. You can use this window to select the body you want the job to apply to. In this case, there’s only one body so it’s already selected for us.

Create Job NOTE I’m new to the Path Workbench so I don’t have a template yet. I’ll look into it and make another post someday.

press OK

  1. The Combo View now shows a Job Edit section and defaults to the Setup tab. Use the Stock group to define your stock. The default is Extend model's Bounding Box which seems good place to start.

Job Edit I extended the stock out a bit for the simulation. Job Edit

Once your job is setup, you can add operations to it.

Pocket Shape Operation

A fairly basic operation is the Pocket Shape operation. This creates paths to carve out a pocket in your stock.

To add a Pocket Shape 1. Select the face you wish to apply the Pocket Shape to. Select Face 2. Press the Pocket Shape button ( or select Path > Pocket Shape ) Pocket Shape Button 3. The Combo view now shows the properties for the Pocket Shape operation. Of interest are the Depths section. This appear to be set correctly by default. The height of my object was 31.750 and the pocket was 5mm deep. Pocket Shape Button NOTE The Depths are greyed out, but can be edited by pressing the formula button. 4. The Operation section is where you define the path taken by your tool.

  • The Pattern determines how the tool will be moved through the stock. ZigZag is the default.
  • The Angle is the angle in which the Zig Zag pattern is applied to the stock. By default this is 45 degrees.
  • The StepOver determines how far the tool moves for each line in the pattern. It defaults to 100%. At 100% the tool won’t overlap as it passes through your stock material. You may want this lower than 100% depending on your job.

Press Apply to show shows the path the tool will take in the 3D view. (green lines) Estimated Tool Paths in 3D View

press OK to complete the operation.

FreeCad lets you simulate the operation so you can see what your stock might look like after the operations complete.

  1. Press the CAM Simulator button: Pocket Shape Button
  2. The 3D view adds the stock and the Combo View shows the Path Simulator controls. The controls are similar to a video player. You can stop, play, pause, and fast forward the simulation. Path Simulator Controls Press the Play button to simulate the operation. It will show the tool as it moves through the stock

Path Simulation mid simulation frame Path Simulation End Frame

The results are pretty jagged.
Path Simulation Jagged Little Results With a step-size of 100, the edges of the pocket will be shaped like the endmill. We can fix this by editing the Pocket Shape parameters.

  1. To edit the parameters go to the Combo View and expand Job > Operations in my case I see the Pocket Shape job Combo View - Job > Operations
  2. Double click on Pocket Shape to get back to its editor.
  3. In the operation section change the Pattern: to ZigZagOffset, press Apply, and press OK New Pattern : ZigZagOffset
  4. Run the simulation again. The simulation results look much better ZigZagOffset simulation results The sides are now smooth.

Unfortunately, there’s another potential problem with my path. The tool is immediately plunged 5mm into the stock and does the zig-zag at this depth. This might work. It depends on the material and the CNC you’re using. You’ll want to remove harder materials layer by layer. We can do this by editing the Step Down value.

  1. Go to the Combo View and expand Job > Operations
  2. Double click on Pocket Shape to get back to its editor
  3. In the Depths section Step Down text box is disabled by default. Click the Formula Editor button to edit it. Step Down
  4. Step Down value in the Formula Editor. I went with 0.2 mm for this test.
    Step Down Formula Editor

The tool path now covers multiple layers Multi Layer Tool Path

NOTE The actual values you use will depend on a number of factors. You should familiarize yourself with your CNC machine and the materials you’re using in order to pick appropriate settings

Pocket3D Operation

There’s a also a curved section in my model that I’d like to cut out. It’s not flat, so Pocket Shape won’t create usable paths for it. Instead I’ll use the 3D Pocket operation

NOTE You may want to hide or remove the Cut Material from the Job to see what you’re doing. Select it and press Space to hide and Delete to remove it

  1. Select the Face you want to cut. I selected the curved face I made earlier: Curved Face Selected.
  2. Press the 3D Pocket button in the toolbar. This opens the Pocket3D settings in the Combo View 3D Pocket button
  3. This time around, I’m going to edit the Step Down and Pattern settings immediately.

I set the Step Down in Depths to 0.5 mm 3D Pocket Depth I also set Pattern to ZigZagOffset in Operation. 3D Pocket pattern When I pressed Apply and the resulting path looks pretty reasonable 3D Pocket path

Running the simulation shows the cut follows the general shape of the curved surface. 3D Pocket Simulation It has a stair step pattern to it that can probably be smoothed out in post processing and possibly by decreasing the Step Down size.

Profile Operation

This is good so far, but in order to be useful, we want the paths to also cut our model out from the stock. This can be done with the Profile operation

  1. Press the Profile button in the toolbar. This opens a Profile operation in the Combo View. Profile button
  2. Depending on your material and your CNC machine, you may want to adjust the Step Down value in the Depths section. I’m going with 1 mm here. Profile Step Down
  3. The Operation defaults are to cut on the Outside and leave no extra offset which is good enough for me. Profile Operation Default Settings Press Apply to see the new path. In this case you get a bunch of green paths around the model sides. Press OK to exit Profile Paths

The simulation results look pretty good. There’s a potential problem because the profile cuts entirely around the object. This can lead to a a free floating object and may cause problems in the real world. The way to fix this is to add Tags to your Profile operation.

  1. Navigate to the Profile operation in the Combo View Combo View - Job > Operations > Profile
  2. Right click on Profile to get to the context menu and select Tag. This opens the Holding Tags Task. Profile Context Menu
  3. The default for me had 4 tags automatically and placed them around the object. Two tags on both of the long sides. Profile Tag Default Settings
  4. You can increase the number of tags with the Auto Generate section. Setting this to 8 and pressing Replace All put tags on all sides of the object.

You can also change the shape of the tag by altering the Width, Height, Angle, and Radius values. I didn’t see much change with Radius but changing Width, Height, and Angle to 10.00, 8.00, and 90.0 changed the triangular shape to a small rectangle. Profile Tag Edited Settings

Once your tabs are to your liking press OK

The simulation results look pretty good. Profile Tag Simulation

My next post about FreeCad will cover saving the paths and getting them to work on a real CNC machine.

About Me

Greg Gallardo

I'm a software developer and sys-admin in Iowa. I use C++, C#, Java, Swift, Python, JavaScript and TypeScript in various projects. I also maintain Windows and Linux systems on-premise and in the cloud ( Linode, AWS, and Azure )

Github

Mastodon

YouTube

About you

IP Address: 3.15.143.181

User Agent: Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)

Language:

Latest Posts

Iowa City Weather

Today

-- ˚F / 61 ˚F

Sunday

71 ˚F / 54 ˚F

Monday

64 ˚F / 46 ˚F

Tuesday

76 ˚F / 54 ˚F

Wednesday

76 ˚F / 56 ˚F

Thursday

72 ˚F / 51 ˚F

Friday

67 ˚F / 47 ˚F