CNC Customize Parts Professional Solution & Processing Provider

How to Write G Code (basics)

by:QY Precision      2019-09-22
The basics of writing G code and some M code start the first line with \"%\" and press enter.
The next line should start with the capital letter \"o.
If the character is zero, the machine will throw the error code.
After capital letter O, there is no space and there should be 4 or 5 letters.
This is called the program name.
Once the project has a name, it\'s time to consider the security issue, line 3.
It will be fast, so we wrote the \"g00\" program, which tells the machine to move or program as quickly as possible.
Here is the G90 for absolute position mode.
G80, cancel the canned cycle used before.
G28, to get to home quickly.
G17, select the x, y circle sports field.
G20, select inch coordinate system. (
G21, select metrics)
G40, cancel the tool compensation.
G49, cancel the tool height compensation.
Now, this puts us safely in the position of the machine.
This step is for lucky people to have an automatic tool changer (ATC).
First type the letter \"t\" and then enter a number.
This should look like \'t01\' or maybe just \'T1 \'.
On the cnc lathe, it will be tracked by a non-set number like \"t0101.
This will call tool number 1 and apply off set 01 to it, you will need to program \"t0100\" to clear offest before the next tool changes.
Instead of using the offset number, the Haas lathe uses the mill format \"01\" and \"t1 \".
So far, we have placed the tool changer in the position of #1, but the tool has not yet been placed on the spindle.
The M code tells the machine what to do, the M01 is an optional stop, and the M03 starts the spindle.
To do this, we will use M06, which specifies that the machine will trade with the tool it currently has at the ATC location currently being called.
On the lathe M06 rotate the turret to that position.
If you don\'t have a turret or ATC, the line after this is where the M01 is placed.
I put the lathe here and focus on the Mills.
Specifically, let\'s see that G41/G42 and G43/G44G41 and G42 are similar in use, but not functionally.
The G41 is the tool radius set on the left side of the center.
G42 is on the right.
They position the tool so that any number of terminal factories can be used when contouring operations without rewriting the program and calculating it themselves.
All you have to do is tell the machine \"d01\" or any tool number that needs to be turned off.
G43 and G44 deviate from the positive number of tool length (G43)and negative(G44)directions.
This is for multiple settings that use different tools or the same tools on different cutting planes.
G43 will be used mainly.
This requires a height command such as \"h01\" or any tool number that needs to be offset.
G00, move quickly to postiong01, linear cut from current position to programming X, Y, ZG02, move the cutter along the arc in the direction of the clock until the current position is new programming move the cutter along the counter
Until the current position is a new programming position, like G01, but with the dwell command, all of these commands are modal, which means that the machine will continue to run fast, until a different command is programmed, or unless G00 is called
There are many cool commands including canned loops.
I\'m too lazy to explain all of this because there are more than 180G codes and machines based on 100 or more M codes.
Find more information for yourself or get the machine manual for the machine.
With Cnc machines, there are endless choices and opportunities!
First of all, I would like to say that if this teaches anyone interested in cnc machining something new, I\'m glad I can help.
Secondly, please like this if you like it.
So now, if I win a 3D printer, I\'ll create prototypes of what I created in my mind and post them here, share what I know, hopefully from the others
Custom message
Chat Online
Chat Online
Chat Online inputting...
Sign in with: