Machsupport Forum

G-Code, CAD, and CAM => G-Code, CAD, and CAM discussions => Topic started by: Planobilly on December 29, 2017, 01:12:16 PM

Title: Need help with this drawing for G Code
Post by: Planobilly on December 29, 2017, 01:12:16 PM
(https://i.imgur.com/g50mtfCl.jpg)

(https://i.imgur.com/Occy7BIl.jpg)

Hi,

I am struggling with circular interpolation and g41/g42 offsets. As you can see from the tool path point 5 is not placed correctly.

Here is the code. How do I program to get to point 5???

%
n1 (P0) g00 x0 y0 z0
n2 (P1) g01  x0. y1.750 z0.250 f5 (Entering move)
n3 g01 g41 x0 y1 d1 f5 (g41 move to P1)
n4 g01 z-0.005  ( lower cutter to start cut)
n5 (P2) g02 x1 y1 r.625 f10
n6 (P3) g03 x1 y0 r.625 f10
n7 (P4) g03 x1 y-1 r.625 f10
n8 (P4) g01 z.250
n9 g01 x1.750 y-1.750 (Entering move)
n10 g01 g41  x1 y-1 z-.005
n11 g02 x0 y-1 r.625
m30

Thanks,

Billy

BTW, I also need to understand how to use the I and J commands for this example. I have read page 247 in Peter's book till I rubbed all the ink off the page...lol As this is programmed in all four quadrants it is a bit beyond my understanding at the moment.

Title: Re: Need help with this drawing for G Code
Post by: Planobilly on December 29, 2017, 03:31:49 PM
Update

Here is the final code which worked but clipped the part by .010 at point 8.

I am sure there is a better way to do this!!

%
(Outside Profile)
( All radius .625)
n1 (P0) g00 x0 y0 z0
n2 (P1) g01  x0. y1.750 z0.250 f5 (Entering move)
n3 g01 g41 x0 y1 d1 f5 (g41 move to P1)
n4 g01 z-0.005  ( lower cutter to start cut)
n5 (P2) g02 x1 y1 r.625 f10
n6 (P3) g03 x1 y0 r.625 f10
n7 (P4) g03 x1 y-1 r.625 f10
n8 (P4) g01 z.250
n9 g01 x1.750 y-1.750 (Exit move from P4)
n10 (P4)g01 g41  x1 y-1 z-.005
n11 (P5) g02 x0 y-1 r.625
n12 (P6) g02 x-1 y-1 r.625
n13 (P7) g03 x-1 y0 r.625
n14 (P8) g02 x-1 y1 r.625

n15 (P8) g01 z.100
n16 (p9) g01 x0 y1.750 ( e move)
n17 (P9) g01 g42 x0 y1
n18 (P9) g01 z-.005
n19 (P9) g03 x-1 y1 r.625
n20 (P0) g01 z2
n21 (P0) g00 x0 y0
m30
%
 Perhaps I will ask the I,J question in another post.

Billy
Title: Re: Need help with this drawing for G Code
Post by: TOTALLYRC on December 30, 2017, 02:47:14 AM
I am sure there is a better way to do this!!

CAM software comes to mind. Being able to read and trouble shoot G-code is a great idea, but programing parts longhand is not the best way unless it is really simple like a square.

Of course this is just my opinion for what it is worth.

Mike
Title: Re: Need help with this drawing for G Code
Post by: garyhlucas on December 30, 2017, 12:35:38 PM
This is clearing a classroom exercise not a real part, so I’d say cam is out. I think you will find that programming without G41 and adding it after the tool path is proven will make it easier for you.  If Mach 3 is not in exact stop mode it will try to go around the P8 corner at speed and likely would round it off. The other inside corners are sharp enough to force an almost complete stop. Enable full stop mode and all the corners will be as expected.
Title: Re: Need help with this drawing for G Code
Post by: Third-Gen on December 31, 2017, 05:30:33 AM
theres an issue with your lines overlapping.....here look at this
Title: Re: Need help with this drawing for G Code
Post by: Third-Gen on December 31, 2017, 06:10:40 AM
trying to upload a pic but i dont have a place to host it. if you plot out the .625 R it overlaps at P5, try upping the R to .750 and try again.
Title: Re: Need help with this drawing for G Code
Post by: Tweakie.CNC on December 31, 2017, 06:36:34 AM
Quote
trying to upload a pic but i dont have a place to host it.

Use the Reply tab then select Additional Options...

Tweakie.
Title: Re: Need help with this drawing for G Code
Post by: Third-Gen on December 31, 2017, 07:16:58 AM
ya but i cant upload a photo directly, I can only link to an image thats hosted elsewhere? never mind i found it
Title: Re: Need help with this drawing for G Code
Post by: Third-Gen on December 31, 2017, 07:18:24 AM
this is the overlap in green with the .625 radius. the red is .750R
Title: Re: Need help with this drawing for G Code
Post by: Tweakie.CNC on December 31, 2017, 07:48:56 AM
Quote
ya but i cant upload a photo directly, I can only link to an image thats hosted elsewhere? never mind i found it

 :)

Title: Re: Need help with this drawing for G Code
Post by: Planobilly on December 31, 2017, 10:38:32 AM
Thanks guys,

This is  not a real part. I just drew this to teach myself about the issues revolving around radius and offset issues. And secondly, I am trying to set up Mach3 to work in the same manner as a Fagor controller I have on a large machine. Well, to the extent I can. I work at a machine shop that has several Haas and other brands of CNC machines. One thing I learned pretty quick is there is not much in the way of standards when it comes to CNC machines.

Also, no matter where the code is generated, I want to know where the damn cutter is going when I push the Cycle Start button!!...LOL

As for the CAM issue, I have access to Solid Works  and MasterCam. I am only doing all this to actually understand G Code well, and see how Mach3 handles the code.

Thanks for the full stop idea Gary. I assume if one needed to make the part as drawn there should be some way to cut the .625 radius. Perhaps by using tangential moves...not sure.

Thanks,

Billy
Title: Re: Need help with this drawing for G Code
Post by: Planobilly on December 31, 2017, 11:14:17 AM
EDIT: Just so you know, six weeks ago I did not know how to spell G Code...LOL I am into a serious learning curve. I am retired and have no need to work and all this is just something that interest me. The machine shop I work at is just a fun place for me to pass time at. Yes, I actually do things there that are useful to the owners, but it is not a real job for me. All the code they run is manually programmed...kinda crazy but it is what it is. I understand trig and geometry well enough to muddle through it so that helps.

A larger issue I am having is the use of I and J. I can make it work some times and at others I get totally lost!!...LOL It is a critical part of learning G Code, especially if one need to do much mirroring. The quadrant issues are required understanding to make all this work. Well...poco a poco as we say here in Miami. 
Title: Re: Need help with this drawing for G Code
Post by: Graham Waterworth on January 07, 2018, 03:21:54 PM
The safest thing is to put a very tiny rad on the end of any sharp point that way the tool has a clearly defined outside path, the rad can be .001" or even less but it forces the comp to stay on the same side of the line.
Title: Re: Need help with this drawing for G Code
Post by: garyhlucas on January 07, 2018, 05:36:36 PM
EDIT: Just so you know, six weeks ago I did not know how to spell G Code...LOL I am into a serious learning curve. I am retired and have no need to work and all this is just something that interest me. The machine shop I work at is just a fun place for me to pass time at. Yes, I actually do things there that are useful to the owners, but it is not a real job for me. All the code they run is manually programmed...kinda crazy but it is what it is. I understand trig and geometry well enough to muddle through it so that helps.

A larger issue I am having is the use of I and J. I can make it work some times and at others I get totally lost!!...LOL It is a critical part of learning G Code, especially if one need to do much mirroring. The quadrant issues are required understanding to make all this work. Well...poco a poco as we say here in Miami. 

Any shop doing all manual programming in this day is just plain stupid. I've done lots of manual programming and the operators thought I was really good it at.  However you can't make money programming for hours when even a HOBBY Cam program can blow your doors off.  We do really simple parts for our own products.  We use a hobby grade program called CamBam.  40 Sessions for free, $150 to buy perpetual license with upgrades.  We use it do internal and external tapered pipe threads, 3D machined nozzles for our plastic welding guns, 3D machined housings for the bottom of a strainer, used the mill as a lathe to cut a large diameter gasket mold and ground the tools for that task, modified a stainless pump housing, engrave nameplates with text and our logo, circular mill tapered flanges for valves.

There really is NO excuse to waste money manual programming everything.
Title: Re: Need help with this drawing for G Code
Post by: Planobilly on January 13, 2018, 11:40:51 AM
Hi Gary,

I agree with you about using a CAM program. Why things are done in this shop manually is beyond my understanding. But like I said "it is what it is".

Technology in every field is advancing. I have a very well designed autopilot in my airplane. The autopilot can fly the plane with greater precision than I can hand fly the plane, until it fails.... At that point I have the requirement to fly the plane manually, well, or crash the plane and die!!...lol

It is unlikely that "crashing" a CNC machine is going to get anyone killed or seriously injured. I do think it is prudent for a machine operator to understand the code being being generated by what ever method.

The more complex the part the greater the need for high quality CAD/CAM software. In fact, the part does not have to be very complex for it to be impossible to machine by hand and next to impossible to program manually.  Software exist that does a very good job at  complex part making. That same software is not very easy to use to do simple things. Solid Works and Master CAM come to mind.

I have no desire to plow "my" garden with a water buffalo but they are in constant use in many parts of the world and to this day produce millions of tons of food.

Sometimes businesses do well in spite of their lack of ability to adopt best practices and modern methods.

Cheers,

Billy