-
simple newbie question
I just finished my first cnc and spent several weeks reading The cnc workbook by Nanfara,Uccello,Murphy in an attempt to learn g-codes. Thought i understood them but i was wrong.Question is im trying to cut a very simple part only using the x and y axis. I am trying to cut a part that looks like a comb. That is, the cutter starts at point a,then the y axis moves back toward the column in the + direction cutting into material, then back out, then to the right,the x+ direction, then forward again and out.Basically cutting forward,back,over in the x,forward,back,over,forward,back,over,etc. The workbook states i have to put a - or + before each axis like so-
%
g90 gg20 (absolute and inch programming)
y-0.972 (moving forward)
y+0.972(moving back)
x+0.297(moving to the right)
y-0.906(moving forward)
y+0.906(moving back)
x+0.297(moving to the right)
y-0.873(forward)
y+0.873(back)
etc, forward,back,right,forward,back,right.
I havent seen any + or - in any g-code samples anywhere except for the z-axis,and i am wondering how does the controller know to make the table move right or left, forward or back? can someone show me a brief sample of how i should be writing this? thanks for any input anyone can give.
-
With practically all CNC machines the + is not required for move in the positive dir., although it would just be ignored. In absolute positioning, which is what you are using the only time you need the - sign is if you are crossing over the zero point in the opposite direction, this applies to any axis. It looks to me as though you have mixed absolute programming with relative moves.
Al
-
g-codes
Thanks Al, But im still not sure if i understand.How does the controller know which way to send an axis if there are no + or - in the code? I have seen parts cut in both directions and there were no + or - in the codes with the exception of the z-axis. Thanks
-
Because the code uses absolute coordinates. Your machine has an origin, whereX=0 and Y=0.
G1 X6 will move it 6" in the positive direction
G1 X12 will move it 6" more in the positive direction
G1 X6 will now move back 6" in the negative direction
MOst machines are set up so that all the cutting is done in the positive direction, so no - are needed. It is possible, though, for your origin to be located anywhere on the machine.
-
g-code
I get it now Ger, Thanks alot.