Learning to layout simple code ?

More
24 Feb 2010 11:49 #2035 by grey1beard
I'm finding the AXIS gui good for finding my mistakes, but this one defeates me "Near line 11, unkown operation".
Just the first few lines of the code to illustrate -

#1=0.1 (SH)
#2=50 (letter size)
#3=300 (Feed )
#4=[0.023816*#2] (Z at serif end)
#5=[0.121244*#2] (Z at full depth)

g00 x[0.000000*#2] y[1.000000*#2] Z#1 (letter home)
g00 x[0.013750*#2] y[0.986250*#2] (starting point top left)
g01 x[0.013750*#2] y[0.986250*#2] Z#4 F#3 (cutting depth)
g01 x[0.0400000#2] y[0.986250*#2] F#3 (straight cut)
g02 x[0.206109*#2] y[0.925850*#2] Z#5 I[0] J[-0.258944*#2] F#3 (first arc)
g02 x[0.215000*#2] y[0.860000*#2] I[-4.89139*#2] J[-0.700000*#2] F#3 (second arc)

I'm not sure if AXis counts gaps as lines, so I've posted possibly one too many.
John

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

More
24 Feb 2010 12:00 #2036 by BigJohnT
John,

You have a typo on line 10 and yes Axis counts blank lines.

John

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

More
24 Feb 2010 12:36 #2037 by grey1beard
Thanks John. I had to stare at it for about two minutes before I spotted it.
Regards
"little"John

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

More
24 Feb 2010 13:17 #2040 by BigJohnT
I figured it would be more fun if I just gave you a hint...

John

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

More
24 Feb 2010 13:39 #2042 by grey1beard
It's funny how you can trip up over such a little zit .
As I'd copied/pasted that bit of code further down, I cleared up the other one, but have also noticed that I've got theZ sign wrong, and that's why it appears to be up in the air instead of down in the wood.
Cutting this afternoon I hope ;)
"Long tall skinny" John

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

More
24 Feb 2010 13:46 #2043 by BigJohnT
I like to "cut some air" first if I'm not 100% sure of the code I just wrote or generated. Sounds like your starting to get things lined up and sorted out.

John

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

More
26 Feb 2010 17:50 #2078 by grey1beard
Well, I got it to show me the code in the AXIS gui, then I cut the code !!
Hardly suprising though that the result wasn't quite what I was hoping for.
Oh well, plenty of time to learn, I hope.

Fundamental problem I'm trying to get round is not being able to drive the cutter in a curve in three axis all at the same time.
So it seems that I'm going to have to generate code that increments the curve as a series of 2D curves with Z as a series of short steps.
Rather than write out a vast number of lines of code, is it possible to enter a mathematical expression that is then solved for a given number of steps, before moving on to the next lines of code ?

A pointer to any real examples would be most gratefully received.
Regards all,
John

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

More
27 Feb 2010 20:43 #2103 by Rick G
Hello,

You may want to look here wiki.linuxcnc.org/cgi-bin/emcinfo.pl?Oword
There is information as well as an example of a ball in a box.

Rick G

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

More
27 Feb 2010 21:04 #2104 by grey1beard
Many thanks Rick.
I've only just glanced at the first few lines, but it looks exactly like what I'm looking for, stating with an explanation of O-words !
I've just asked about them on cnc zone, and you've already posted the answer.
John

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

More
28 Feb 2010 22:17 #2128 by grey1beard
Making progress, but I'm now stumped by AXIS regecting a line of code.
Of the two lines below, the first one is accepted as part of a WHILE/ENDWHILE loop, but the second one, which is intended to spatially mirror the action of the first is rejected with the comment "Near line 23, bad "*" character".
I may have got more square brackets than is necessary, but I don't think so.
Careful comparison of the two by me can't spot the problem .
Can you help ?
John

g01 x[#6*#1] y2.006173*[#6**2]+0.015]*#1] z[-1*SQRT[3]*[[2.006173*[#6**2]+0.015]*#1 F#3

g01 x[#7*#1] y2.006173*[[-0.36+#7]**2+0.015]*#1] z[-1*SQRT[3]*2.006173*[[-0.36+#7]**2+0.015]*#1]] F#3

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

Time to create page: 0.241 seconds
Powered by Kunena Forum