#1
Does anyone in the pit know g-code?

I have a test on CNC machining tomorrow and I have the general idea but I don't really know how to write g-code and m-code because I just use solidworks to do it for me

so can anyone tell me any particular formats that are used?

I know some to cancel all presets and home return. I won't be tested on macro programs or canned cycles.

Anything good to remember going into this test?

Thanks

EDIT: inb4 "did anyone else read the title as g-spot?"
MaKing thE possiBlE...
...totaLlY impossible
Last edited by EnyoAdonai at Oct 8, 2009,
#3
Quote by jetfuel495
Keep it real, G. That's the only rule.

that quote in your sig is awesome.
MaKing thE possiBlE...
...totaLlY impossible
#5
Quote by jetfuel495
Why thank you, good sir. I'm bumping your thread in hopes that someone who knows what you're talking about (because I certainly don't) will be able to
help you.

Why thank you too

I'm hoping there'll be someone, I get the feeling there're quite a few post-grads here who don't post until they find a thread about something other than relationships.

Otherwise I'm picking this thread will be jumped and turned into a thread about womens' (or maybe even mens'... ) underwear.
MaKing thE possiBlE...
...totaLlY impossible
#6
1: G71 "metric system input"
2: G90 "absolute diamension programming"
3: G54 "stored zero datum"
4: G98 "graphic window frame" x -20 y -20 z 20 i 190 j 190 k -60
5: G99 "GUI settings" z 0 y 0 z 0 i 150 j 150 k -20
6: T1 M6 S1000 F500 "tool change/spindle speed/feed speed"
7: G0 x -20 y 20 z 5 "rapid traverse"
8: G1 x-20 y 20 z -20 "go to this point"

^thats how i was taught to set one up before you do anything.

then...

9: map out cutting path using various G codes (g1=straight line, g2=clockwise circle, g3=counter-clockwise circle etc.

you also need to manually use the edge finder to get x 0 y 0 and z 0


this is probably missing stuff because i havent used one in over a year.
#7
Quote by MapOfYourHead
1: G71 "metric system input"
2: G90 "absolute diamension programming"
3: G54 "stored zero datum"
4: G98 "graphic window frame" x -20 y -20 z 20 i 190 j 190 k -60
5: G99 "GUI settings" z 0 y 0 z 0 i 150 j 150 k -20
6: T1 M6 S1000 F500 "tool change/spindle speed/feed speed"
7: G0 x -20 y 20 z 5 "rapid traverse"
8: G1 x-20 y 20 z -20 "go to this point"

^thats how i was taught to set one up before you do anything.

then...

9: map out cutting path using various G codes (g1=straight line, g2=clockwise circle, g3=counter-clockwise circle etc.

you also need to manually use the edge finder to get x 0 y 0 and z 0


this is probably missing stuff because i havent used one in over a year.


That sounds good, thanks a lot

We are given g-code for the test so devising the algorithms shouldn't be too hard, but I am concerned about syntax

Where you said T_ M06, I've been taught M06 T_. Does it matter which order you put things?

If I were to say G03 X0 Y0 R5 X10 Y0 R5 would it matter which way I put X0 and Y0 etc? and can G03 go after the parameters? and... would that code even work??

Thanks
MaKing thE possiBlE...
...totaLlY impossible
#8
Quote by EnyoAdonai

1:Where you said T_ M06, I've been taught M06 T_. Does it matter which order you put things?

2:If I were to say G03 X0 Y0 R5 X10 Y0 R5 would it matter which way I put X0 and Y0 etc? and can G03 go after the parameters? and... would that code even work??


1: on the machines i used you could input in any order, but best stick to what you were taught.

2: you usually put them in the order i have listed x,y,z,... etc, its just convention.

G03 cant go after the parameter, the G is telling the machine what type of work your about to do and the parameters are the variables of how the machine will do it.

i dont think that will work, why have you got (X,Y and Z) then (X,Y and Z) again?
unless the machine can do as many runs on a single line of code as it wants, without needing a new line for every movement. but that would just confuse somebody reading it (somebody who didnt write it).
#9
Quote by MapOfYourHead
1: on the machines i used you could input in any order, but best stick to what you were taught.

2: you usually put them in the order i have listed x,y,z,... etc, its just convention.

G03 cant go after the parameter, the G is telling the machine what type of work your about to do and the parameters are the variables of how the machine will do it.

i dont think that will work, why have you got (X,Y and Z) then (X,Y and Z) again?
unless the machine can do as many runs on a single line of code as it wants, without needing a new line for every movement. but that would just confuse somebody reading it (somebody who didnt write it).


Yeah I'm not sure on the syntax of G03, I remember having to specify the start point and end point of the arc and then the radius, but I wasn't exactly sure.

is it G03 X_ Y_ X_ Y_ R_ ?

Thanks, all this is a big help to me.
MaKing thE possiBlE...
...totaLlY impossible
#10
When coding circular moves, you must specify where the machine must go and where the center of the arc is in either of two ways: By specifying the center of the arc with I and J words, or giving the radius as an R word.

I is the incremental distance from the X starting point to the X coordinate of the center of the arc. J is the incremental distance from the Y starting point to the Y coordinate of the center of the arc.

Examples:
G1 X0.0 Y1.0 F20.0 ----go to X1.0, Y0.0 at a feed rate of 20 inches/minute
G2 X1.0 Y0.0 I0.0 J-1.0 ----go in an arc from X0.0, Y1.0 to X1.0 Y0.0, with the center of the arc at X0.0, Y0.0
G1 X0.0 Y1.0 F20.0 ----go to X1.0, Y0.0 at a feed rate of 20 inches/minute
G2 X1.0 Y0.0 R1.0 ----go in an arc from X0.0, Y1.0 to X1.0 Y0.0, with a radius of R=1.0


quoted from a website i just found a second ago. honestly, i wasnt too sure about it.

http://www.linuxcnc.org/handbook/gcode/g-code.html
#11
Quote by MapOfYourHead
quoted from a website i just found a second ago. honestly, i wasnt too sure about it.

http://www.linuxcnc.org/handbook/gcode/g-code.html


Hmm... I haven't seen that notation before. Maybe I'm getting it all wrong. I feel like I'm royally fucked actually... Never been one to program on paper, it's much worse with C though Here's hoping we get an easy piece to machine tomorrow...

THanks for your help
MaKing thE possiBlE...
...totaLlY impossible