ACAD to G&M Codes

Electronics Computer Programming Q&A
Post Reply
User avatar
jwax
Posts: 2234
Joined: Mon Feb 09, 2004 1:01 am
Location: NY
Contact:

ACAD to G&M Codes

Post by jwax »

My CNC machine uses "G & M" Codes to direct its' cutting tool in x,y, and z axis.
If I draw a figure in AutoCad, any ideas on how I can convert those files to tool path motions?
The ACAD files have all the point-to-point xyz coordinates, but the CNC machine wants ASCII commands to tell it where to go.
Can you tell I'm new at this?
Thanks!
John :(
WA2RBA
User avatar
CeaSaR
Posts: 1949
Joined: Sat Nov 08, 2003 1:01 am
Location: Phoenixville, PA USA
Contact:

Re: ACAD to G&M Codes

Post by CeaSaR »

Found some insight to G&M codes here. Click on the help button once the applet loads. Unfortunately the text is in another applet, so you can't cut and paste, but the codes are there. The G codes deal with manipulation of the cutting head and subroutines while the M codes deal with coolant and ending the program. <p>Your X Y Z coordinates correspond to: X = horizontzal, Y = vertical and Z = depth (in my line of work: Northing, Easting and Elevation - any idea what I do?). You might want to verify that with your CNC manual as X and Y might be switched. Also, check to see where your 0 (zero) Z is in relation to the cutting head. When you draw your picture in ACAD, you have to give your lines elevations, specifically the beginning and ends of them - if they have a slope. If the line is all one plane, then one Z for the whole line is OK. As for ASCII conversion, 2 things pop to my mind.<p>1, export your drawing as a .DXF file. This format is a ASCII text listing of the file used for universal exchange between programs. Look at the file and see if you can insert the G and M codes where you think they ought to be. Try a simple test (ie basic shape and cheap test) and see if that works.<p>2, export your points in a complimentary X Y Z format (note the spaces as indicated in the previously mentioned help file). If you don't have points, then you'll have to draw them and give them a "Z" elevation. Note: when exporting DO NOT select a binary file! That would defeat the purpose of having a ASCII file. Once you have your ASCII file, insert the appropriate G & M codes and try that test.<p>Hopefully one of these options will help you. Without a sample of the actual output to the CNC machine, I can't be more specific or helpful. As far as I know these are the only 2 ACAD ASCII file types available.<p>CeaSaR<p>PS - does the manufacturer of your CNC machine have a free/trial program or sample of the output code available? It would really help to see exactly what the machine needs to read in order to operate.
Hey, what do I know?
User avatar
jwax
Posts: 2234
Joined: Mon Feb 09, 2004 1:01 am
Location: NY
Contact:

Re: ACAD to G&M Codes

Post by jwax »

Thank you, Caesar! Appreciate your reply!
Found someone with MasterCAD knowledge!
Fascinating what 3D modeling can do!
John
WA2RBA
Post Reply

Who is online

Users browsing this forum: No registered users and 18 guests