# Thread: Cutting a non-circular arc ?

1. Originally Posted by greybeard
Is there a list of O-codes showing specific meaning associated with particular numbers, or does the operator define their own meaning ?
Nah, the O number can be anything, it's just a number to identify the subroutine.

2. Just discovered how age distorts meaning
I now find that [sin^-1] is the same as "inverse sine", is the same as "arcsin", is the same as "ASIN".
So I've got 50+ years of name changing to catch up on.
Ho hum.
Regards
John

I think I'll go to bed with a headache

3. Back to square one, but at least it works so far !

g17 g21 g40 g49 g54 g80 g90 g94

#1=50 (scale)
#2=[0.05*#1] (sh)
#3=[8*#1] (feed)
#6=0
#7=0.36
g00 x[0] y[0] z#2
g01 x[0] y[0.015*#1] F#3 (start point)
g01 x[0] y[0.015*#1] z[0.015*SQRT[3]*#1] F#3 (start serif depth and width)

O100 WHILE [#6 LE 0.18]
g01 x[#6*#1] y[[2.006173*[#6**2]+0.015]*#1] z[SQRT[3]*[[2.006173*[#6**2]+0.015]*#1]] F#3
#6=[#6+0.009]
O100 ENDWHILE

g00 z#2

AXIS allows me to use this bit of the code to cut a short path to start the serif, a parabola that ramps down to join the main vertical stoke.

Next problem is how to most easily mirror/invert the curve, so that I can cut the other four corners the same, with similar code.

In the WHILE/ENDWHILE , what does the LE signify ?

Examples welcome.

John

4. Originally Posted by greybeard
In the WHILE/ENDWHILE , what does the LE signify ?
Less-than or Equal-to.
Congrats on the progress!

5. Oh G, it makes sense now. I can read it in English "While #6, is less than or equal to 0.18perform the following instruction".

Thanks for the enlightenment

6. Next curious problem.
N01 g01 x[#6*#1] y[[2.006173*[#6**2]+0.015]*#1] z[-1*SQRT[3]*[[2.006173*[#6**2]+0.015]*#1]] F#3
N02 g01 x[#7*#1] y[[2.006173*[[-0.36+#7]**2]]+0.015]*#1] z[-1*SQRT[3]*[[2.006173*[[-0.36+#7]**2]]+0.015]*#1]] F#3

The first line is accepted by AXIS, but the second is rejected with a warning that in the second line, a "*" is a "bad character".
I'd be grateful for yet more help in identifying the error, as it's not something that I can see.

The [-0.36+#7] was originaly [#7-0.36], but I switched it round when trying to track down the source of this problem, but it hasn't made any difference.

I've found the pop-up window that AXIS uses sometimes not particularly helpful in the way it expresses an error.
For instance using the "near line ..." rather than something more specific, and sometimes the targeted symbol is not the actual error at all, just affected by it.

John

7. John-
I haven't had time to pursue this myself but I've been following your progress and have been quite impressed with what you've accomplished so far!
Look at the dxf2gcode generator and the text engraving routine. It looks like you could find some good code to work with here if you want to delve into python.

Keep up the good work!

Best regards,
Greg

8. Hi Greg, and thanks for the encouraging words.
I've already had a quick look at those pages, and thought that I might well follow them up later.

I feel the route I'm following at the moment, while it might seem a bit masochistic to some, will give me a good intro to gcode.
Having to understand some of the details in depth will be a good discipline if and when I want to move on to python et al.

I've been a problem solver all my life, and it's hard to give up the habit.
Regards
John

9. Originally Posted by vlmarshall
Something like:

O100 While [#1 LE 1]
G1 X [#1], Y[ SIN^-1#1]
#1=[#1+.05]
O100 ENDWHILE

...but the [sin^-1] doesn't work.

10. It might help if I expand the current problem by posting a few lines of code.

N01 O100 WHILE [#6 LE 0.18]
N02 g01 x[#6*#1] y[[2.006173*[#6**2]+0.015]*#1] z[-1*SQRT[3]*[[2.006173*[#6**2]+0.015]*#1]] F#3
N03 #6=[#6+0.009]
N04 O100 ENDWHILE

N06 g00 x[0.18*#1] y[0.08*#1] z#2
N07 g00 x[0.36*#1] y[0.015*#1]
N08 g01 x[0.36*#1] y[0.015*#1] z[-0.015*SQRT[3]*#1] F#3

N10 O100 WHILE [#7 GE 0.18]
N11 g01 x[#7*#1] y[[2.006173*[[#7-0.36]**2]+0.015]*#1] z[-1*SQRT[3]*[[2.006173*[[#7-0.36]**2]+0.015]*#1]] F#3
N12 #7=[#7-0.009]
N13 O100 ENDWHILE

All goes well till line N10, where my attempt at producing a mirror image of the curve cut by lines N01 to N04 produces garbage - "G.I.G.O."

Been trying to resolve the problem by trial and error, but no luck so far.
John

11. Just a guess, but your using the same program name o100 in the second program.
Try o101

12. Originally Posted by Pandinus
Just a guess, but your using the same program name o100 in the second program.
Try o101
That seems very sensible, so I'll do it. Thanks.
In the meantime I've managed to get the best of three with AXIS, and now have a parabolic curve meeting its mirror image in the centre

One thing I've noticed though, and here's a small bit of code to illustrate the point -
#1=0
O100 WHILE [#1 LE 0.18]
g01 x[#1] y[0.5*#1]
#1=[#1+0.009]
O100 ENDWHILE

Running this in the AXIS gui, the curve only goes from x0 y0 to x0.171 y0.0855 , rather than x0.18 y0.09.

Is this correct ?
I assumed the "less than or equal to" would finish when #1 reached 0.18

John

Page 2 of 3 First 123 Last