Machsupport Forum

G-Code, CAD, and CAM => G-Code, CAD, and CAM discussions => Topic started by: Bagpipes on July 20, 2006, 12:35:00 PM

Title: Quirky results from G2 command - help a newbie!
Post by: Bagpipes on July 20, 2006, 12:35:00 PM
I'm in the process of getting my K2 CNC set up. I just ran a very simple piece of G-code as a first run to see what would happen. Basically a rectangular cut with radiused corners. When I ran the program the toolpath showed 45 degree angles where my radii should have been. I discovered upon looking at the path in an isometric view that on the x-y plane the cutter was moving at 45 degrees at the corners in x/y but at the same time the radius I had expected to see was being cut in the z-axiz as an arc. Any ideas why this is happening when the G2 is programmed only for x and y??

Title: Re: Quirky results from G2 command - help a newbie!
Post by: ger21 on July 20, 2006, 01:01:08 PM
Are you sure? The toolpath will look like 45° corners if you're speed is a bit high, but the actual cut will still be an arc. Can you post the g-code?
Title: Re: Quirky results from G2 command - help a newbie!
Post by: Bagpipes on July 20, 2006, 01:14:02 PM
ger21 that's a good point - lemme take a look. If that isn't the reason I will post the code
Title: Re: Quirky results from G2 command - help a newbie!
Post by: Bagpipes on July 20, 2006, 01:41:01 PM
Interesting - last night I tried everything I could think of to get round that problem, this morning (after having restarted my computer) the machine is acting normally (i.e. all programmed radii are on the x-y plane where they should be.)  Maybe the restart played a part.

While we're here - can anyone tell me what the protocol for G40 / G41 and G42 are. What conditions need to be met etc. Do I have to have tool data in teh setup page before calling up a G41 in my program? I got an error yesterday when I tried to run a demo program with a G41 in it.
Title: Re: Quirky results from G2 command - help a newbie!
Post by: ger21 on July 20, 2006, 08:11:02 PM
You can either specify a tool number from the table, by using G42 D1 where D is the tool #, or specify the tool radius by using G42 P0.125 where P is the tool radius. With advanced comp, you need to use a lead-in move where the comp is applied. I also like to use a lead out move, because that's how the control on our router at work works. I also use the leadin move to ramp into the cut. Here's an example. Load it into Mach3 and see what it does.

G40
G0 Z0.1250
G0 X-0.5000 Y-0.5000 Z0.1250
G1 X-0.5000 Y-0.5000 Z0.0000 F50
G42P0.125
G1 X-0.2500 Y0.0000 Z-0.2500 F150
G1 X2.0000 Y0.0000 Z-0.2500
G1 X2.0000 Y2.0000 Z-0.2500
G1 X0.0000 Y2.0000 Z-0.2500
G1 X0.0000 Y-0.2500 Z-0.2500
G40
G1 X-0.2500 Y-0.2500 Z-0.2500
G0 X-0.2500 Y-0.2500 Z0.1250
Title: Re: Quirky results from G2 command - help a newbie!
Post by: Bagpipes on July 25, 2006, 01:22:11 PM
OK I ran that code. So we're tracing a square path 2 inches by 2 inches. Using G42 we're recalculating the toolpath to be offset by 1/2 the cutter diameter to the right only. Would that be right?

Let's say that 2" squate path was a piece of material you wanted to machine, like a 2" square coaster. Would I program the path to be 2" square and then use G42 for the bottom and right hand cuts and then G43 for the upper and left hand cuts? Would that yield a 2" square of material?

I have a reason for asking this relating to my next project....
Title: Re: Quirky results from G2 command - help a newbie!
Post by: Bagpipes on July 25, 2006, 01:31:49 PM
I want to use the shape below to machine two pieces of material. Can I machine inside the shape using cutter compensation to create a pocket, and then in another piece of material, machine outside the same shape by compensating in the opposite direction, so that the male and female parts that result will fit precisely into each other??  The dotted line is the actual shape that I have created in Illustrator and converted to DXF
Title: Re: Quirky results from G2 command - help a newbie!
Post by: Brian Barker on July 25, 2006, 04:29:45 PM
You shoud be able to do it no problem... Comp will not work if it is a ton a little line segments :(
Title: Re: Quirky results from G2 command - help a newbie!
Post by: Bagpipes on July 25, 2006, 05:12:28 PM
Hmmm, well my g-code file is all G1 commands, which is what I got from crunching the DXF file. I guess it wont work then...
Title: Re: Quirky results from G2 command - help a newbie!
Post by: Brian Barker on July 25, 2006, 05:22:08 PM
At some point, when I have time :(  I will have lazy cam offset the path for you! It is about 75% done and I have no time to work on it... I spend all day doing support and helping people
Title: Re: Quirky results from G2 command - help a newbie!
Post by: Bagpipes on July 25, 2006, 05:42:29 PM
Thanks Brian. How do I get Lazy Cam?
Title: Re: Quirky results from G2 command - help a newbie!
Post by: Brian Barker on July 28, 2006, 08:23:59 AM
It is free in the latest version of Mach3 :) Just look under File at the top of mach 3 .
Title: Re: Quirky results from G2 command - help a newbie!
Post by: ger21 on July 28, 2006, 08:53:38 AM
I want to use the shape below to machine two pieces of material. Can I machine inside the shape using cutter compensation to create a pocket, and then in another piece of material, machine outside the same shape by compensating in the opposite direction, so that the male and female parts that result will fit precisely into each other??  The dotted line is the actual shape that I have created in Illustrator and converted to DXF

You'll usually need to leave at least .003 clearance for the insert part to fit. You can create that .003 by lying about the tool size. Tell Mach3 it's .0015 smaller than it is.
Title: Re: Quirky results from G2 command - help a newbie!
Post by: ger21 on July 28, 2006, 08:55:21 AM

Let's say that 2" squate path was a piece of material you wanted to machine, like a 2" square coaster. Would I program the path to be 2" square and then use G42 for the bottom and right hand cuts and then G43 for the upper and left hand cuts? Would that yield a 2" square of material?

I have a reason for asking this relating to my next project....


No. Assuming your traveling around the part CCW, the offset will always be to the right, so G42. G41 is Left, btw. G40 turns off the comp. G43 is length compensation.
Title: Re: Quirky results from G2 command - help a newbie!
Post by: ger21 on July 28, 2006, 08:56:29 AM
OK I ran that code. So we're tracing a square path 2 inches by 2 inches. Using G42 we're recalculating the toolpath to be offset by 1/2 the cutter diameter to the right only. Would that be right?

Correct.