What's new
What's new

G-code newb help

JoshD818

Plastic
Joined
Sep 28, 2011
Location
Australia
Hey there, I'm new to G-code and am currently working on a little program for a uni assignment. I dont have the software to simulate my program so I've no idea if mines correct. The design should produce a basic club shape in 2D, would it be possible for anyone to have a quick look and see if im on the right track? Cheers

Here is my code:

N10 G91;
N20 M06 T02;
N30 G00 X612.00 Y-320.00;
N40 G00 Z-392.26;
N50 M03 S400;
N60 G01 Z-5.00 F100;

N70 G02 X22.00 Y-3.77 I0.00 J-66.00;
N80 G01 X-9.96 Y17.25;

N92 G03 X-22.00 Y22.00 I7.01 J20.85;
N103 G03 X2.95 Y-11.00 I-19.05 J11.00;
N112 G03 X7.01 Y1.15 I0.00 J-22.00;

N120 G01 X-9.96 Y-17.25;
N130 G02 X22.00 Y3.77 I12.04 J-79.48;

N140 G01 Z10.00;
N150 M05;
N160 G28 X0.00 Y0.00 Z0.00;
N170 M30;
 
looks a little bit odd to me.
See attached screenshot.

I would not program that in G91 mode.
 

Attachments

  • Screenshot.jpg
    Screenshot.jpg
    12.8 KB · Views: 211
I am pretty noob too but is part of your assignment to program in incremental mode? Also I think it would be a good idea to practice your format. Safety line, work and tool offset call outs as well. I can't run the code, though it looks like someone already did. What's with the rpm and feed?
 
My Matt needs a g91 to do a tool change,like this g91 g28 zo,sends the head to t/c postion,but I agree usally only a sub is inc.for a example plus there is more,BUT back to OPs gram, please check it for the person guys.
Stick around Josh, deeese folks wil help.
Gw
 
Cheers guys, will have another crack at it. Its my circular interpolations that i wasnt sure about. Might try in absolute mode and see if that works.
 
My Matt needs a g91 to do a tool change,like this g91 g28 zo,sends the head to t/c postion,but I agree usally only a sub is inc.for a example plus there is more,BUT back to OPs gram, please check it for the person guys.
Stick around Josh, deeese folks wil help.
Gw

Greg, you lost me here. What machine are you running? My Matsuura RA1 goes to machine z-zero just fine in either G90 or G91 since G28 means machine zero on specified axis.

Bob
 
Okk so ive fixed a few mistakes and replaced all the IJ crap with R (we were only taught the IJ way but I had a look on a few sites and using the radius just seems easier). Can anyone sim this and tell me if it works. Cheers guys

N10 G91;
N20 M06 T02;
N30 G00 X612.00 Y-320.00;
N40 G00 Z-392.26;
N50 M03 S400;
N60 G01 Z-5.00 F100;

N70 G02 X22.00 Y-3.77 R66.00 F320; (feed r. should stay @ 320?)
N80 G01 X-9.96 Y17.25;

N90 G03 X7.01 Y42.85 R22.00;
N100 G03 X-38.10 Y0.00 R22.00;
N110 G03 X7.01 Y-42.85 R22.00;

N120 G01 X-9.96 Y-17.25;
N130 G02 X22.00 Y3.77 R66.00;

N140 G01 Z10.00;
N150 M05;
N160 G28 X0.00 Y0.00 Z0.00;
N170 M30;
 
I will investagate and return to zero ,i mean return with data,ha?
Good ? Bob . I do know its a MX2,yasnac control.
Gw

Greg, I think that what you're doing by entering the G91 G28 Z0 is saying your mid-point enroute to machine zero is incrementally zero. Meaning that it is the point where Z is currently located. If you were in absolute, entering the Z-value for the current location would have the same effect; Z would move straight to home at rapid.

Bob
 
Okk so ive fixed a few mistakes and replaced all the IJ crap with R (we were only taught the IJ way but I had a look on a few sites and using the radius just seems easier). Can anyone sim this and tell me if it works. Cheers guys

N10 G91;
N20 M06 T02;
N30 G00 X612.00 Y-320.00;
N40 G00 Z-392.26;
N50 M03 S400;
N60 G01 Z-5.00 F100;

N70 G02 X22.00 Y-3.77 R66.00 F320; (feed r. should stay @ 320?)
N80 G01 X-9.96 Y17.25;

N90 G03 X7.01 Y42.85 R22.00;
N100 G03 X-38.10 Y0.00 R22.00;
N110 G03 X7.01 Y-42.85 R22.00;

N120 G01 X-9.96 Y-17.25;
N130 G02 X22.00 Y3.77 R66.00;

N140 G01 Z10.00;
N150 M05;
N160 G28 X0.00 Y0.00 Z0.00;
N170 M30;

No, your program does not simulate correctly. Post a sketch of your required part shape, including dimensions; it will make debugging your programm easier.

With regards to using I and J crap, as you put it, as opposed to R, I would use I and J every time. When using R, you can end up with an erroneously shaped part without it being obvious.

When I and J are used, the conntrol does a check to determine if the programmed endpoint is on the arc as defined by the start point and the arc center defined by the I and J, within a tolerance specified in parameters. When using R in circular interpolation, the control calculates the arc center based on the start, end point and the R value specified, and as long as its geometrically possible, the arc is made pass through the given start and end points based on the calculated arc center. If either, or both the start and end points are incorrect, the control just shifts the center to make the arc fit. I would stick to using I, J and Ks, you will become a better programmer.

Regards,

Bill
 








 
Back
Top