Learning to layout simple code ?

More
08 Feb 2010 12:10 - 08 Feb 2010 23:37 #1809 by grey1beard
Having come into EMC from superCam/Turbo cam, I feel I have a basic understanding of Gcode instructions, and having managed to write some simple projects for them and cut successfully,
I'm a bit thwarted by the code I find in the axis.ngc file.
Working in XP, I've now got Taskpad as a text editor, and can start to learn more, as I examine that code to carve "AXIS EMC2".
What has thrown me somewhat, is the "syntax"(?).
I don't know if that's the right word, but what I mean is that although each Gcode is easily found in the manuals, and I'm aware of things like parameters, and such like, but I can't find a reference to "how to write code for EMC2", the nitty gritty of laying it out.
I'm not thinking of writing out huge blocks of code, merely small jobs, or modifications to existing files.
For example, it would be fun to modify the lines of code so that the m/c would carve "AXIS E=MC2".
Can someone point me to any such help ?
Much appreciated,
John
Last edit: 08 Feb 2010 23:37 by BigJohnT.

Please Log in or Create an account to join the conversation.

More
08 Feb 2010 23:38 - 08 Feb 2010 23:53 #1827 by BigJohnT
John,

I had to edit your post and replace the superscript 2 with a normal 2 so it would show up.

Just looking at the axis.ngc code and it is a series of lines and is using parameter #3 as the scale for each letter. To add a letter you would have to program each little line of the letter. There are programs to generate letters to cut. The basic syntax is G1 for line and G2 or G3 for arcs and G0 for rapids. Beyond that are many things to explore. The manual is a good place to start, but for complicated parts software to generate the code is much easier. I hope this helps.

John
Last edit: 08 Feb 2010 23:53 by BigJohnT.

Please Log in or Create an account to join the conversation.

More
09 Feb 2010 08:56 #1836 by grey1beard
Thanks John.
I've started the long learning curve, and a book to lean against the coffee pot would help, so I often print manuals out, just to avoid the glare of the laptop.
SWMBO reckons I get square pink eyes :D
It's the variation in "style" or layout that I need to get into my head, I think.
I've got an overall grasp of it, just trip over the details ;)

John

Please Log in or Create an account to join the conversation.

More
11 Feb 2010 11:42 #1861 by BigJohnT
I don't understand what you mean by

the variation in "style" or layout

Can you elaborate a bit on that?

John

Please Log in or Create an account to join the conversation.

More
11 Feb 2010 14:11 - 11 Feb 2010 15:23 #1864 by grey1beard
I've started to read the article at www.isd.mel.nist.gov on RS274/NGC language, and noticed their use of the word "dialect" for the Gcode that is used by EMC, so perhaps that's the best I can do at the moment.
But I'll put my thinking cap on, and try and come up with a fuller explanation asap.
John

EDIT It may be just that I started at the deep end, so I've gone back to read the gcode overview in the User manual, and try to get a grip there.
I have spotted one difference - my previous but short experience was with 247D, and I didn't come across the use of <> signs.
But then I didn't come across a lot else, so it may just be a spot of indegestion that's stopping me running before I can walk.
:unsure:
Last edit: 11 Feb 2010 15:23 by grey1beard. Reason: afterthoughts

Please Log in or Create an account to join the conversation.

More
11 Feb 2010 17:35 #1865 by BigJohnT
Each flavor of G Code once you get past the basics of G0,1,2,3 usually have some differences, some minor and some are major. The is the reason that post processors have to be tailored to each control software needs. If you study the RS274/NGC and EMC you will most likly find a few things that are different even though EMC is based on RS274/NGC.

John

Please Log in or Create an account to join the conversation.

More
11 Feb 2010 18:14 #1867 by grey1beard
Notes so far - There are certainly more functions available, and using slightly different names, like ASIN instead of ARCSIN, the use of ** instead of ^ for "raise to the power of".
But perhaps more importantly, in Chapter 9, the order of execution defined by a list rather than by position in the line.
Happily, Chapter 10 suggests that it is more important to write unambiguous code than follow chapter 9. :)
So I think I shall make out now.
John

Please Log in or Create an account to join the conversation.

More
12 Feb 2010 21:18 #1873 by BigJohnT
Good to hear your making headway on this and keeping a sense of humor along the way.

John

Please Log in or Create an account to join the conversation.

More
17 Feb 2010 11:52 #1940 by grey1beard
As a precursor to writing the code, and to save me a lot of typing, does anyone know of a piece of software that will convert a simple vector drawing into an xy data set ?
I've got a ancient digitizer pad, and could draw over a printout of the drawing, but it ought to be much quicker, and more accurate "on screen".
I've tried googling every combination of words that might point me to one, but I generally get something far to complex that will take me longer to learn than to do it the slow way.
John

Please Log in or Create an account to join the conversation.

More
17 Feb 2010 12:52 #1942 by BigJohnT
If you mean a dxf file, there are a few out there that will convert it to g code.

wiki.linuxcnc.org/cgi-bin/emcinfo.pl?Cam

Keep in your mind that the actual path of the tool might not be the lines on the drawing unless your engraving letters.

John

Please Log in or Create an account to join the conversation.

Time to create page: 0.185 seconds
Powered by Kunena Forum