Learning G-Code - Where to begin

Hello. Long time lurker, first time poster.

After several years working with newby-friendly CNC software (Easel, and now Carbide Create Pro since earlier this summer) I would like to begin learning how to actually write and edit G-Code.

Does anyone have recs on a good way to begin doing that?

My current CAD/CAM workflow is a mishmash of Illustrator and or SketchUp for design/drawing, Carbide Create Pro for setting up projects and generating G-Code.

I am specifically interested in learning how to code:

  • Ramping cuts
  • Cuts that change direction from conventional to climb at specified places
  • Altering code generated by CCPro so that Carbide Motion parks the spindle somewhere other than the back corner

Any suggestions would be appreciated. Thanks!

I’m no expert and I’m trying to learn right now as well. In a recent thread it was pointed out that the GRBL that runs the Shapeoko machines uses a limited subset of g-code Built-in flattening feature idea - #7 by WillAdams

So here’s a couple links to what is supported:

And some helpful links for general reference for g and m codes

Hope these help!

3 Likes

Ramping is a feature in Carbide Create Pro and the new Angled modeling feature:

allows one to make such in the 3D model.

We do have Climb vs. Conventional control in Pro.

It is my understanding that we are hoping to add more user configuration in CM7:

but, if you have Pro, then this can be done using JavaScript for a custom post-processor:

(not sure if there are hooks for the others)

If you understand some basic programming concepts, a post-processor is pretty straight-forward — if you get stuck, zip up the file and upload it here and we can look into this with you.

If you want a deep dive, my personal pet project touches on this sort of thing:

(but it may be a better fit at: https://forum.makerforums.info/ )

Let us know what you have difficulty with and we will gladly look into it with you.

2 Likes

For the final one, you would need to:

  • Remove the end-of-program command (M02)
  • Add movement command(s) to position the spindle. You probably want to retract first, then move to your destination. Something like:
G53G0Z-1
G53G0Y-1
G53G0X-1

This example first retracts on Z, then moves straight back, then move all the way right - i.e., similar to the current behaviour. You would want to determine how many different moves you want to make.

You could combine all three moves into one - G53G0X-1Y-1Z-1. This will move in a straight line from the current position to the destination.

The G53 means to use machine co-ordinates. The G0 is a rapid move. In machine co-ordinates, the upp back right corner is considered (0,0,0) location. So, all movement on the machine is into negative numbers. When the Z is at very top of travel, that’s Z=0. Moving down means subtracting values, so all valid Z machine co-ordinates are negative. Same with X and Y.

Without the G53, you are moving to somewhere relative to your zeros that you set for the job. That could be anywhere on the machine, so you need to use machine co-ordinates to specify a specific point on the machine.

5 Likes