• You're one step from joining CNC Machining Forum – G-Code, Tooling, Automation & Pro Techniques.
    Create a free account to post, follow threads, and never miss an update.  Sign up free →

G54 code in CNC

GreenFlagMan

Active member
Joined
Mar 25, 2025
Messages
32
City & State/Province
New Jersey
I'm trying to learn more about how the Doosan Puma 240 uses the G54 coordinate system, I need it for my new job. I need to know how the machine knows where the cutting tool is cause it's related to the part I'm making.
I understand the basic G and M codes, but the G54 thing still confuses me. Is there any good online tutorials, that explain g54 code in CNC?
 
the g54 is a great way to set your parts zero point on the machine table. Say your table's bottom left is machine zero, If your parts zero is in the middle, you use g54 to tell the machine to shift its x and y coordinates. then, when your program tells the machine where to go, it adds that shift. this is pretty handy for doing multiple parts because you can set a zero for each one using g54, g55, etc. and your part program stays simple.
 
G54 helps your machine figure out where the starting point of your part is. You set the offsets for X, Y, and Z from the machine home to where your workpeice starts, enter those into the G54 offset page, and then use G54 in your program. After that, all your movments are based on that point, which is really useful when you're working with several parts
 
Honestly….CNC machining with G codes and M codes are dinosaurs from the past. While it doesn’t exist, there really should be a better system. All of these things come from the 1970s and 80s when programming was hand coded. There is room for vast improvement in the way CNC machining is done. Ai is bound to change all of it. The sooner the better in my opinion.
 
That's why packages like CadCam, Carbide3d, vectric etc etc exist. They've already removed the need for knowing the ins and outs of gcode.
 
I am a hobby machinist but on odd occasions do fixed price machining of small parts, the Emco and Denford cnc lathes used are both programmed by use of a G&M code editor as is an Emco F1cnc milling machine.

I do use the post processor in Fusion360 to write programs on occasions but because there are only 210 lines of code allowed for the Emco machines per program, I find writing my programs using the cyclic functions in the Emco library of codes has many advantages.

It takes about 12 lines of code to program a face, turn and thread operation plus a line for each tool change/speed adjusment, these programs can be entered and run in less time than it takes to draw the part and output the program so it can be useful to have G code writing ability.
 
Honestly….CNC machining with G codes and M codes are dinosaurs from the past. While it doesn't exist, there really should be a better system. All of these things come from the 1970s and 80s when programming was hand coded. There is room for vast improvement in the way CNC machining is done. Ai is bound to change all of it. The sooner the better in my opinion.
Absolutely! Dinosaurs is right. I have trouble with circle making when I need a center but have to increase the radius. Instead of having I and J as the absolute center, if you increase the radius, you hyaqve to change I and J. What a crock of ---you know what. It would be SO much easier to have I and J fixt then simply change the radius--but no, a dinosaur it is.
 
When I first began, G54 seemed like magic to me. That was until a more experienced machinist explained that it's really just a clever way of telling the machine, "This is the zero point for this part." It all became much clearer when I saw it in action. If you get the chance, try to watch someone set it up in person, it makes everything click into place quickly
 
Honestly….CNC machining with G codes and M codes are dinosaurs from the past. While it doesn't exist, there really should be a better system. All of these things come from the 1970s and 80s when programming was hand coded. There is room for vast improvement in the way CNC machining is done. Ai is bound to change all of it. The sooner the better in my opinion.
It is true that its an antiquated system like the keyboard itself who's key organization is a relic from typewriters in order to keep people typing slowly enough not to jam a mechanical typewriter we haven't used in a century. Though I would love the addition of new codes and maybe the implementation of a new system. The ability to recognize codes that have been used for decades and remain the same when they pop up unexpectedly while checking a program is a live saver for not crashing machines or tools. I've used some AI in programming tool paths and so far haven't found it to do things I've found necessarily all that time saving. I've found one of the only things I liked about one of the AI tool path programming was an easier way to reduce wasted machine travel time. However even at the time that problem could be solved by clicking a few more buttons and was eventually entirely solved at least for me as a I'm a Fusion360 "Insider" so I receive certain beta features before most but I imagine it has made it to the mainstream by now. With the length of toolpathes getting longer and longer as parts are not simple shapes they often once were though the need for AI "spell checking" for programs is certainly becoming needed as I just can't spend the time to check every code like I may have before on long programs and have resorted to checking only machine, tool and position codes prior to first run which I don't like. I don't know that I see a need for a full rewrite of CNC codes abandoning what has been built on from the 1970s though in order for us to benefit from AI in manufacturing. Maybe we'll just have to ask AI its opinion on the matter as I could be wrong.

Thanks,
Nate
 
It is true that its an antiquated system like the keyboard itself who's key organization is a relic from typewriters in order to keep people typing slowly enough not to jam a mechanical typewriter we haven't used in a century. Though I would love the addition of new codes and maybe the implementation of a new system. The ability to recognize codes that have been used for decades and remain the same when they pop up unexpectedly while checking a program is a live saver for not crashing machines or tools. I've used some AI in programming tool paths and so far haven't found it to do things I've found necessarily all that time saving. I've found one of the only things I liked about one of the AI tool path programming was an easier way to reduce wasted machine travel time. However even at the time that problem could be solved by clicking a few more buttons and was eventually entirely solved at least for me as a I'm a Fusion360 "Insider" so I receive certain beta features before most but I imagine it has made it to the mainstream by now. With the length of toolpathes getting longer and longer as parts are not simple shapes they often once were though the need for AI "spell checking" for programs is certainly becoming needed as I just can't spend the time to check every code like I may have before on long programs and have resorted to checking only machine, tool and position codes prior to first run which I don't like. I don't know that I see a need for a full rewrite of CNC codes abandoning what has been built on from the 1970s though in order for us to benefit from AI in manufacturing. Maybe we'll just have to ask AI its opinion on the matter as I could be wrong.

Thanks,
Nate
My guess is that Ai will soon be added to the machine’s control system. Think of it like this…first we had machine code (zeros and ones) programming in the 1950s. That made programming nearly impossible so a higher level language was needed. Assembly language came into existence in the late 1950s and early 1960s. Even higher levels were needed so we invented FORTRAN, COBOL, Basic, etc. That was not good enough so we invented C and C++. Now we have Python, etc. We are only about one generation away from natural language programming. In the end it all gets compiled down into machine code but the user doesn’t care. It simply works. While G-code may always be the underlying control of CNC, the user will never see it. G-code will be the machine code of the computer industry.

In some ways we are starting to see this now. I’m going to be trying out Toolpath for Fusion when I return from vacation. There are now a couple of automated toolpath generators. From what I can see, they don’t solve every problem (yet) but in a few years I believe they will be the go-to solution for most machinists.
 
It is true that its an antiquated system like the keyboard itself who's key organization is a relic from typewriters in order to keep people typing slowly enough not to jam a mechanical typewriter we haven't used in a century.
You're absolutely right. While G-code and QWERTY layouts might seem a bit old-fashioned, their reliability is incredibly helpful when things go wrong. AI in toolpath programming still seems more like a helpful add-on than a game-changer especially for experienced users like you who can fix inefficiencies quickly. However, as parts become more intricate and programs get longer, AI-assisted verification might become crucial. It's not about rewriting the whole coding language, but rather about catching mistakes we previously had time to review.
 
Back
Top