So, in my Advanced manufacturing class at Job Corps, I will soon be learning G code. Yay!

For those who don't know, G-code is code for a CNC machine. It looks sort of like this:

Code:
O1000
T1 M6
G0 G90 G40 G21 G17 G94 G80
G54 X-75 Y-25 S500 M3  (Start Point)
G43 Z100 H1
Z5
G1 Z-20 F100
X-50 M8               (Position 1)
Y0                    (Position 2)
X0 Y50                (Position 3)
X50 Y0                (Position 4)
X0 Y-50               (Position 5)
X-50 Y0               (Position 6)
Y25                   (Position 7)
X-75                  (Position 8)
G0 Z100
M30


This is what I'll be doing. Maybe if I get good enough, I can program stuff into a 3D printer, as this is the same code. Very Happy

I'll be posting my progress in this topic, so you can all follow along and learn if you want to.
G-code is indeed cool stuff. A few of us have a passing familiarity with it from working with our 3D printers, for which it is also used. I'd imagine that our resident CAD/CAM/CNC expert, Jonimus, would know the most about G-code if you have any questions.
Well the first thing you will learn about G-Code is its standardized in the same way BASIC is standardized. Sure most machines will read G1 and G0 but once you start going beyond that it starts to differ quickly. Let us know if you have any questions about G-Code itself or with the CAM software you are using to create it.
I didn't realize that we had a in-house CNC expert. I will probably be asking a great deal of questions, but we will see, because as I am not normally allowed to be on this website during normal class time, so I may forget my questions as I will have to hop on after school time. But it's nice to know that I have someone who can help me.


I've already learned a bit about G-code, such as what letters mean what, and what certain commands do, like G1 is a straight-line cut, also how to input XYZ coordinates.

As for CAD/CAM program, I am using the latest edition of Mastercam X9 for Solidworks (it's a add-in in this case) to generate my G-code.
So far, I've made a reference guide. For those want to see it, here it is.

Quote:
G-code reference guide
%- must begin and end each program with this
O#####- second line of program, may designate program name
Safe codes- third line of code. Examples:
1. N5-Line number
2. G90-Absolute positioning command
3. G20-Verify Inch coordinate positioning
4. G54-Work offset positioning
5. G28-Return to Machine zero
6. G40-Cutter compensation or Cancel G41/G42/G141
7. G80-Cancel Canned Cycle
T##- Tool selection #
M06- Tool change
G43-Tool length compensator
H##- Always paired with a G43, and the # references the tool you want to compensate
S####- Spindle speed setter
M03-Turn spindle on going clockwise
G00- Rapid motion (non-cutting motion) to XYZ. DOES NOT TURN OFF UNTIL TOLD A DIFFERENT G##
G01-Straight line cut from point to point
F##- Feedrate set
G02- Clockwise arc. Needs the following:
1. Plane selected
a. G17-Arc parallel to XY-plane
b. G18- Arc parallel to ZX-plane
c. G19- Arc parallel to YZ-plane
2. Arc start position- XYZ
3. Rotation direction
a. G02-Clockwise direction
b. G03-Counterclockwise direction
4. Arc end position (G90 for absolute) or G91 for incremental
a. XYZ coordinates
5. IJK for arc end point

M05- Stop the spindle
G28- Go to machine home
M30- End the program

Made from
CNC G Code Programming: A CNC Mill Tutorial explaining G Codes - YouTube
Lately, I've started to teach my fellow classmates G-code. If anyone has any tips, they would be appreciated.

Also, is there a command for drawing a circle? Or is it just two arcs attached to each other to make a circle?
*bump*


I've learned a few things, but I will still be posting my questions here.

One such question:

Is there a command for a circle, or is it just two arcs who start/endpoints are the same?
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are GMT - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement