Can't create working GCode in FreeCAD

I’ve been trying for several hours to create a simple part in FreeCAD. I have it created and when I run the simulator, it looks great. Unfortunately, the Maslow won’t use it to cut. The main problem appears to be that the Gcode is using all positive Z positions.

All I need is a cylinder that is 19mm in diameter and 13mm tall that has a 10mm hole through the center. I can 3D print it from my model, but I need it in wood. If someone could walk me through creating this in a way that work, I would appreciate it. I have been using the PART workbench for a while for 3D printing, but not the PART DESIGN workbench, which for some reason it completely different and utterly confusing.

So, I created a Body from the 19x13mm cylinder, then another body from the 10x13mm, then did a Boolean operation to create a Cut which created a combined Body that looked like I wanted. I created a sketch on the XY plane from this, then added a 13mm Reversed Pad to the Body. I then added a Tool, a Job, and a Contour and Pocket cut for the body. Again, in the Simulation it looks great, but when I export the Gcode with GRBL post Processor, all the Z values are positive. Here’s the output:

(Exported by FreeCAD)
(Post Processor: PathScripts.post.grbl_post)
(Output Time:2018-07-28 12:29:49.746018)
(begin preamble)
G17 G90
G21
(begin operation: Job)
(Path: Job)
(Contour)
(Compensated Tool Path. Diameter: 5.0)
G0 Z19.0000
G0 X15.2020 Y15.2020
G0 Z17.0000
G1 X15.2020 Y15.2020 Z9.0000
G2 X2.1151 Y-21.3946 Z9.0000 I-15.2020 J-15.2020
G2 X-2.1441 Y21.3917 Z9.0000 I-2.1151 J21.3946
G2 X15.2020 Y15.2020 Z9.0000 I2.1442 J-21.3917
G1 X15.2020 Y15.2020 Z4.0000
G2 X2.1151 Y-21.3946 Z4.0000 I-15.2020 J-15.2020
G2 X-2.1441 Y21.3917 Z4.0000 I-2.1151 J21.3946
G2 X15.2020 Y15.2020 Z4.0000 I2.1442 J-21.3917
G1 X15.2020 Y15.2020 Z-1.0000
G2 X2.1151 Y-21.3946 Z-1.0000 I-15.2020 J-15.2020
G2 X-2.1441 Y21.3917 Z-1.0000 I-2.1151 J21.3946
G2 X15.2020 Y15.2020 Z-1.0000 I2.1442 J-21.3917
G0 Z19.0000
(Pocket_Shape)
G0 Z19.0000
G0 X5.3027 Y5.3024
G0 Z17.0000
G1 X5.3027 Y5.3024 Z9.0000
G2 X-0.2181 Y-7.4881 Z9.0000 I-5.2992 J-5.2994
G1 X0.0000 Y-2.4929 Z9.0000
G1 X-0.2181 Y-7.4881 Z9.0000
G1 X-0.6535 Y-7.4691 Z9.0000
G2 X0.6535 Y7.4691 Z9.0000 I0.6535 J7.4691
G2 X5.3027 Y5.3024 Z9.0000 I-0.6499 J-7.4661
G0 X5.3027 Y5.3024 Z19.0000
G0 X1.7628 Y1.7627 Z19.0000
G1 X1.7628 Y1.7627 Z9.0000
G2 X0.0000 Y-2.4929 Z9.0000 I-1.7628 J-1.7627
G2 X-2.4929 Y-0.0000 Z9.0000 I-0.0000 J2.4929
G2 X0.0000 Y2.4929 Z9.0000 I2.4929 J-0.0000
G2 X1.7628 Y1.7627 Z9.0000 I0.0000 J-2.4929
G1 X1.7628 Y1.7627 Z4.0000
G2 X0.0000 Y-2.4929 Z4.0000 I-1.7628 J-1.7627
G2 X-2.4929 Y-0.0000 Z4.0000 I-0.0000 J2.4929
G2 X0.0000 Y2.4929 Z4.0000 I2.4929 J-0.0000
G2 X1.7628 Y1.7627 Z4.0000 I0.0000 J-2.4929
G0 X1.7628 Y1.7627 Z19.0000
G0 X0.0000 Y-2.4929 Z19.0000
G1 X0.0000 Y-2.4929 Z4.0000
G1 X-0.2181 Y-7.4881 Z4.0000
G1 X-0.6535 Y-7.4691 Z4.0000
G2 X0.6535 Y7.4691 Z4.0000 I0.6535 J7.4691
G2 X-0.2181 Y-7.4881 Z4.0000 I-0.6499 J-7.4661
G1 X0.0000 Y-2.4929 Z4.0000
G1 X0.0000 Y-2.4929 Z0.0000
G2 X-2.4929 Y-0.0000 Z0.0000 I-0.0000 J2.4929
G2 X0.0000 Y2.4929 Z0.0000 I2.4929 J-0.0000
G2 X2.4929 Y-0.0000 Z0.0000 I0.0000 J-2.4929
G2 X0.0000 Y-2.4929 Z0.0000 I-2.4929 J0.0000
G1 X0.0000 Y-2.4929 Z0.0000
G1 X-0.2181 Y-7.4881 Z0.0000
G1 X-0.6535 Y-7.4691 Z0.0000
G2 X0.6535 Y7.4691 Z0.0000 I0.6535 J7.4691
G2 X-0.2181 Y-7.4881 Z0.0000 I-0.6499 J-7.4661
G1 X0.0000 Y-2.4929 Z0.0000
G0 Z19.0000
(finish operation: Job)
(begin postamble)
M5
G17 G90
; M2

1 Like

@Walt_Moorhouse welcome to our group. Looking at it in a gcode simulator there are many problems reported and the path looks incomplete. Perhaps someone can help I’m not a freecad user. Maybe try Exporting to .DXF and import to makercam at http://www.makercam.com/

Thank you

The approach is to model in the original coordinate system (X right, Y back, Z up) with the part top surface at Z=0. FreeCAD will create paths milling down into the material, towards negative Z.

Can you upload the .fcstd? I might steal time somewhere to take a look.

1 Like

I’ll try that Gero, thanks for the tip! Here’s the FCStd file I have so far. If you have time and feel like it, thanks. If not, no worries. I’ll make a new one below the Z plane and post that one if I’m still having issues.

CurtainRodAdapter.FCStd (26.4 KB)

1 Like

@Gero I created a new one using only the Part Design workbench and Sketcher, then the Path workbench to create the Gcode. It looks better, haven’t ran it yet. Going to do that now.

CurtainRodAdapter-PartDesign.FCStd (18.6 KB)
CurtainRodAdapter-PartDesign.nc (2.5 KB)

@Bee what code simulator are you using? I’d like to have a way to check the one inside FreeCAD.

I feel like I’m close now, that seemed to do the trick, but it’s moving so slowly that the wood is starting to scorch. Anyway know of a way to speed it up in FreeCAD without mucking with the GCode itself? (Edit: It looks like that is located in the Setup Sheet and Tool definition. I’m changing it in both. It seems like the correct speed from other comments is 11 mm/s or 700 mm/min depending on the units asked for.)

(Edit2: 11 wasn’t fast enough, I’m trying 40mm/s. Also, it appears that I’m going to need to learn to add tabs to the design before I run this with a bit in. :slight_smile: )

Thanks @Gero and everyone who offered help to get me going in FreeCAD so I didn’t have to learn another tool, just another way of doing things in FreeCAD.

Perfect! Exactly what I was trying to make! Thanks to everyone who helped get me here!

Here’s the GCode:
CurtainRodAdapter-PartDesign-tags.nc (3.2 KB)

And some photos:

3 Likes

I wrote up a tutorial to help anyone else get started.

2 Likes

@Walt_Moorhouse

I’m using CAMotics to preview Gcode.

camotics.org

Thank you

1 Like

I did download, tried and failed on all efforts to move it below Z0.
It showed an error on the boolean operation (hole) and no workbench would allow me do edit the placement on x/y/z. The assembly workbench allowed me to move, but that is just for the eye.
What version are you running? If it’s not 0.17 stable, I recommend to update.

Happy you could find the lid to the gas tank and are keeping the car. Expecting to see some awesome drifts soon.

2 Likes

I think it was because I converted it from a Part to Part Design and did it incorrectly, when I recreated it purely in Part Design it worked. So I’ll go with that workflow for now. And yes, I’m on the 0.17 stable. :slight_smile:

1 Like