586,080 active members*
3,475 visitors online*
Register for free
Login
Page 1 of 2 12
Results 1 to 20 of 32
  1. #1
    Join Date
    Jun 2005
    Posts
    1431

    Cutting a non-circular arc ?

    If I want to cut a parabolic path, or any non-circular arc, do I need to be able to programme ?
    The alternative to writing hundreds of lines of code for small incremental moves would be to either write my own program, , or to be able to tell the machine to run some sort of iterative code that stops after a given number of cycles, then moves on the the next instruction.
    Any help, please ?
    John
    It's like doing jigsaw puzzles in the dark.
    Enjoy today's problems, for tomorrow's may be worse.

  2. #2
    Join Date
    Mar 2006
    Posts
    474
    Well, there's no canned cycle that will cut a parabolic arc, but if you can define the arc mathematically, I don't see why you couldn't get EMC to move from point to point along the arc.

    Running for a set number of cycles and them moving on, or cutting each cycle with a slightly different path (such as stepping down, or over, or along a radius) is the REASON I switched from Mach3 to EMC. I use conditional loops and program variables constantly at work, and just HAD to have them at home, too.

    http://www.linuxcnc.org/docview/html/gcode_main.html
    http://www.youtube.com/user/vlmarshall

  3. #3
    Join Date
    Mar 2003
    Posts
    35538
    The end result is always a series of short, straight moves. The easiest way to get there is to find a CAD program that'll let you do what you want, and export a .dxf of line segments and convert that to g-code.

    Another easy way is to use Excel to output the G-code.
    Gerry

    UCCNC 2017 Screenset
    http://www.thecncwoodworker.com/2017.html

    Mach3 2010 Screenset
    http://www.thecncwoodworker.com/2010.html

    JointCAM - CNC Dovetails & Box Joints
    http://www.g-forcecnc.com/jointcam.html

    (Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management)

  4. #4
    Join Date
    Dec 2008
    Posts
    226
    Programming the part's surface path isn't so hard... figuring out how to compensate for the shape of your cutter can be fun though
    I.E. calculate the path of a vertical circular arc...
    x^2+Z^2=R^2
    Z=(R^2-X^2)^.5

    If your cutter is a sphere, it would come out fine if you just subtract its radius from the final radius, but if your cutter is a cylinder, flat end, like an end mill.... then you need some Trig. to find your cutter compensation... same for a parabola and a round cutter.

  5. #5
    Join Date
    May 2006
    Posts
    2420
    Hi John, I had a small program a couple of years ago that created code for mirrors, lenses and I think it would do parabola's as well, I cannot think of its name but if I can dig it up I will let you know.

    Cheers.

    Russell.

  6. #6
    Join Date
    Feb 2008
    Posts
    586
    If an ellipse is oriented in one of the axes, it would be a one axis scaling thing, which I don't know if EMC has.

  7. #7
    Join Date
    Jun 2005
    Posts
    1431
    Morning all, and hi Russell.
    Welcome to another room in Greybeard's Home for the Bewildered.

    My request for this bit of info comes from my other thread on working out a centre line Roman letter plot.
    To generate a decent looking serif, the 60 degree v-cutter needs to follow a short parabolic helix, and given the emc doesn't have a gcode for that, it's going to be a series of short cuts, ramping down to the final depth of the main stroke of the letter.

    I have no problem with producing the function of the curve, but only have a vague idea on how to write the gcode such that the interpreter will calculate a series of steps for me.
    For example, if I needed to cut a sine curve -
    X [#1], y[ sin^-1#1] (where #1 goes from 0 to 1 in steps of 0.05 )(Not sure if ^ is the correct symbol for "to the power of")
    Then when #1 reaches 1, the plot moves on to the next line of code.
    I have some idea that this uses an IF -, THEN -, structure, but I don't know how to set it out.
    Regards
    John
    It's like doing jigsaw puzzles in the dark.
    Enjoy today's problems, for tomorrow's may be worse.

  8. #8
    Join Date
    May 2006
    Posts
    2420
    Hmmm... V-Carve would do this pretty easily

    Russell.

  9. #9
    Join Date
    Jun 2005
    Posts
    1431
    If I had a dog, I wouldn't have to bark
    John
    It's like doing jigsaw puzzles in the dark.
    Enjoy today's problems, for tomorrow's may be worse.

  10. #10
    Join Date
    Mar 2006
    Posts
    474
    Quote Originally Posted by greybeard View Post
    Morning all, and hi Russell.
    Welcome to another room in Greybeard's Home for the Bewildered.

    My request for this bit of info comes from my other thread on working out a centre line Roman letter plot.
    To generate a decent looking serif, the 60 degree v-cutter needs to follow a short parabolic helix, and given the emc doesn't have a gcode for that, it's going to be a series of short cuts, ramping down to the final depth of the main stroke of the letter.

    I have no problem with producing the function of the curve, but only have a vague idea on how to write the gcode such that the interpreter will calculate a series of steps for me.
    For example, if I needed to cut a sine curve -
    X [#1], y[ sin^-1#1] (where #1 goes from 0 to 1 in steps of 0.05 )(Not sure if ^ is the correct symbol for "to the power of")
    Then when #1 reaches 1, the plot moves on to the next line of code.
    I have some idea that this uses an IF -, THEN -, structure, but I don't know how to set it out.
    Regards
    John
    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.
    http://www.youtube.com/user/vlmarshall

  11. #11
    Join Date
    Jun 2005
    Posts
    1431
    Quote Originally Posted by vlmarshall View Post
    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.
    Thanks for your help vlmarshal.
    My [sin^-1 *#1] was a complete guess as to how to express
    "that number which was the sine of n degrees, where n went from 0 degrees to 90 degrees in 20 steps".
    I think it should have read Y[SIN[**-1]#1], but I see it wouldn't have worked anyway.

    I'll see what I can learn about the WHILE/ENDWHILE command, but I may come back for more help.

    Regards
    John
    It's like doing jigsaw puzzles in the dark.
    Enjoy today's problems, for tomorrow's may be worse.

  12. #12
    Join Date
    Jun 2005
    Posts
    1431
    Is there a list of O-codes showing specific meaning associated with particular numbers, or does the operator define their own meaning ?
    It's like doing jigsaw puzzles in the dark.
    Enjoy today's problems, for tomorrow's may be worse.

  13. #13
    Join Date
    Mar 2006
    Posts
    474
    Quote Originally Posted by greybeard View Post
    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.
    http://www.youtube.com/user/vlmarshall

  14. #14
    Join Date
    Jun 2005
    Posts
    1431
    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(chair)
    It's like doing jigsaw puzzles in the dark.
    Enjoy today's problems, for tomorrow's may be worse.

  15. #15
    Join Date
    Jun 2005
    Posts
    1431
    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
    It's like doing jigsaw puzzles in the dark.
    Enjoy today's problems, for tomorrow's may be worse.

  16. #16
    Join Date
    Mar 2006
    Posts
    474
    Quote Originally Posted by greybeard View Post
    In the WHILE/ENDWHILE , what does the LE signify ?
    Less-than or Equal-to.
    Congrats on the progress!
    http://www.youtube.com/user/vlmarshall

  17. #17
    Join Date
    Jun 2005
    Posts
    1431
    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
    It's like doing jigsaw puzzles in the dark.
    Enjoy today's problems, for tomorrow's may be worse.

  18. #18
    Join Date
    Jun 2005
    Posts
    1431
    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
    It's like doing jigsaw puzzles in the dark.
    Enjoy today's problems, for tomorrow's may be worse.

  19. #19
    Join Date
    Mar 2009
    Posts
    106
    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!
    Have you checked out this page: http://wiki.linuxcnc.org/cgi-bin/emc...ode_Generators?
    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

  20. #20
    Join Date
    Jun 2005
    Posts
    1431
    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
    It's like doing jigsaw puzzles in the dark.
    Enjoy today's problems, for tomorrow's may be worse.

Page 1 of 2 12

Similar Threads

  1. Circular Cut
    By mikelohj in forum LinuxCNC (formerly EMC2)
    Replies: 1
    Last Post: 06-18-2009, 06:19 PM
  2. What do you know about this circular saw???
    By mailloux in forum WoodWorking Topics
    Replies: 5
    Last Post: 10-17-2007, 04:34 AM
  3. Circular pockets not cutting round - Help!
    By watsonstudios in forum DIY CNC Router Table Machines
    Replies: 6
    Last Post: 07-05-2007, 09:42 PM
  4. Circular Cut
    By Sanghera in forum Uncategorised CAM Discussion
    Replies: 13
    Last Post: 11-13-2006, 05:26 PM
  5. Circular Milling - G12/G13
    By HPT in forum Servo Motors / Drives
    Replies: 6
    Last Post: 05-14-2006, 07:22 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •