585,933 active members*
4,024 visitors online*
Register for free
Login
Page 1 of 2 12
Results 1 to 20 of 28
  1. #1
    Join Date
    Apr 2012
    Posts
    83

    How would you do an oval?

    Hi,

    I've been playing around with the G02 command using emc2 sim mode, but I don't see a way to do an oval. How would you make an oval?

    Thanks,

    Alan

  2. #2
    Join Date
    Mar 2003
    Posts
    35538
    Do you mean an ellipse?
    An oval is two half circles with straight lines between them. Two G2's and two G1's.
    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)

  3. #3
    Join Date
    Apr 2012
    Posts
    83
    Hi Gerry,

    Quote Originally Posted by ger21 View Post
    Do you mean an ellipse?
    An oval is two half circles with straight lines between them. Two G2's and two G1's.
    Yes, I'm sorry, an ellipse - how would it be done?

    Thanks,

    Alan

  4. #4
    Join Date
    May 2004
    Posts
    4519
    You can either simulate an ellipse with multiple arcs or you can write a macro that will calculate the elliptical points down to the resolution of your machine. Either way, you need to be fairly knowledgeable and practiced on your math skills.

  5. #5
    Join Date
    Mar 2003
    Posts
    35538
    I draw it in AutoCAD with arcs and create the code from that.
    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)

  6. #6
    Join Date
    Sep 2010
    Posts
    1230
    Quote Originally Posted by alank2 View Post
    Hi Gerry,



    Yes, I'm sorry, an ellipse - how would it be done?

    Thanks,

    Alan
    Hi Alan,
    Here's an example of how to machine an ellipse using User Macro. The resolution of the ellipse is achieved via variable #4.

    Regards,
    Bill

    %
    O0021
    N1 G00 G17 G21 G40 G80
    G91 G28 Z0.0
    G28 Y0.0
    T01 M06
    S1000 M03
    G90 G54
    #1=100 (X RADIUS)
    #2=50 (Y RADIUS)
    #3=0 (START ANGLE)
    #4=50 (NUM OF POINTS)
    #5=360/#4(ANGLE INCREMENT)
    #6=0 (COUNTER)
    #24=#1*COS[#3]
    #25=#2*SIN[#3]
    G00 X#24 Y#25
    G43 Z10.000 H01
    G01 Z1.000 F1000.0
    G01 Z-5.000 F100.0
    #6=#6+1
    #3=#3+#5
    WHILE [#6 LE [#4] ] DO1
    #24=#1*COS[#3]
    #25=#2*SIN[#3]
    G01 X#24 Y#25 F300.0
    #6=#6+1
    #3=#3+#5
    END1
    G00 Z10.000
    G91 G28 Z0.0
    G28 Y0.0
    M30
    %

  7. #7
    Join Date
    Apr 2012
    Posts
    83
    Hi,

    Thanks everyone!! I'll try out that code Bill!

    Alan

  8. #8
    Join Date
    Jun 2007
    Posts
    3757
    As long as the long axis is X or Y, you can change the scaling on 1 axis, then just program a circle.
    Easy in MAch3. Not sure about emc2 though. Never used it. Never wanted to. Probably never will.
    Super X3. 3600rpm. Sheridan 6"x24" Lathe + more. Three ways to fix things: The right way, the other way, and maybe your way, which is possibly a faster wrong way.

  9. #9
    Join Date
    Jul 2003
    Posts
    1754
    here is an example written for linuxcnc.

    LinuxCNC Documentation Wiki: Oword

    I have not tried it...

    sam

  10. #10
    Join Date
    Sep 2010
    Posts
    1230
    Quote Originally Posted by alank2 View Post
    Hi,

    Thanks everyone!! I'll try out that code Bill!

    Alan
    Hi Alan,
    The Macro Language used in my example is for a Fanuc or Yasnac control, but the logic and math is the same irrespective of the control.

    Regards,

    Bill

  11. #11
    Join Date
    Feb 2006
    Posts
    1792
    Quote Originally Posted by ger21 View Post
    I draw it in AutoCAD with arcs and create the code from that.
    Let us say major/minor diameters and angle of major dia with x-axis is given.
    What do you do next?

  12. #12
    Join Date
    Jul 2011
    Posts
    65
    Quote Originally Posted by angelw View Post
    Hi Alan,
    Here's an example of how to machine an ellipse using User Macro. The resolution of the ellipse is achieved via variable #4.

    Regards,
    Bill

    %
    O0021
    N1 G00 G17 G21 G40 G80....
    %
    Thanks a ton for this, I mean really, a ton. It's useful little goodies like this that make me ok(ish) with not using software to write programming. I came up with a hole boring sub with variables like the program you have here, and I was far happier than I imagine I would've been had the code just gotten thrown at me.

  13. #13
    Join Date
    May 2004
    Posts
    4519
    Quote Originally Posted by sinha_nsit View Post
    Let us say major/minor diameters and angle of major dia with x-axis is given.
    What do you do next?
    Huh? If you have the major axis and minor axis given, you do not need rotation angle on the X axis. The macro posted simulates an ellipse with straight line segments.

  14. #14
    Join Date
    Sep 2010
    Posts
    1230
    Quote Originally Posted by txcncman View Post
    Huh? If you have the major axis and minor axis given, you do not need rotation angle on the X axis. The macro posted simulates an ellipse with straight line segments.
    I think Sinha was referring to what to do next if using AutoCad to draw the ellipse.

    An ellipse doesn't necessarily have to have its axes parallel to the corresponding drawing axes, so its reasonable to include a parameter for the axis alignment, I assume that's what Sinha is referring to.

    In the example Macro I posted, you're correct that its constructed with straight line segments. Accordingly, the smoothness of the resulting tool path is contingent on the number of Points included in the elliptical form. I have another version where I've used a Bicubic Polynomial algorithm. With this method the number of points can be greatly reduced and an accurate form produced.

    Regards,

    Bill

  15. #15
    Join Date
    May 2004
    Posts
    4519
    That is the macro I would like to see.

  16. #16
    Join Date
    Sep 2011
    Posts
    68
    Quote Originally Posted by neilw20 View Post
    As long as the long axis is X or Y, you can change the scaling on 1 axis, then just program a circle.
    Easy in MAch3. Not sure about emc2 though. Never used it. Never wanted to. Probably never will.
    VERY few machines let you do an oval by scaling one axis. Most machines take either the smallest or largest axis scale factor and apply it to all axes.

  17. #17
    Join Date
    Sep 2011
    Posts
    68
    Quote Originally Posted by FuddMcDee View Post
    Thanks a ton for this, I mean really, a ton.
    Is that a metric ton or imperial ton?

  18. #18
    Join Date
    Jul 2011
    Posts
    65
    Imperial, naturally. The metric system, in its simplicity, is confusing :P

  19. #19
    Join Date
    Dec 2010
    Posts
    0

    another way of generating an ellipse in Gcode

    Depending on whether absolute accuracy is required, there is a simpler way to program most ellipses. It gets very close, if someone wants to they can draw both methods in autocad (for example) and compare them.

    It is called an ellipse approximated by 4 radii.
    We used to use this method for grinding elliptical punches and dies at a punch manufacturer I worked at. Got very close and it can be done on a standard whirly grinding fixture. Our punches were +/-.0005" normal tolerance

    You will have to search online for ellipse approximated with 4 radii to find the exact formula. For doing it in G code, it is 4 arcs and you are done (plus lead in, exit, etc).

    I wrote a program for my HP50 calculator to give me the the 4 arcs, given the rectangle the ellipse fits in. That may not help you if you do not have the same calculator.

    This method is fast to run and you do not have to depend on the cnc you are working on the have the macro language enabled.

    Check it out and see if it will work for you.

    skm

  20. #20
    Join Date
    Jan 2012
    Posts
    0
    Quote Originally Posted by skm View Post
    Depending on whether absolute accuracy is required, there is a simpler way to program most ellipses. It gets very close, if someone wants to they can draw both methods in autocad (for example) and compare them.

    It is called an ellipse approximated by 4 radii.
    We used to use this method for grinding elliptical punches and dies at a punch manufacturer I worked at. Got very close and it can be done on a standard whirly grinding fixture. Our punches were +/-.0005" normal tolerance

    You will have to search online for ellipse approximated with 4 radii to find the exact formula. For doing it in G code, it is 4 arcs and you are done (plus lead in, exit, etc).

    I wrote a program for my HP50 calculator to give me the the 4 arcs, given the rectangle the ellipse fits in. That may not help you if you do not have the same calculator.

    This method is fast to run and you do not have to depend on the cnc you are working on the have the macro language enabled.

    Check it out and see if it will work for you.

    skm
    Could your calculator program be easily done in Excel?

Page 1 of 2 12

Similar Threads

  1. Aluminum half/oval rounds
    By kiramunch@sympa in forum MetalWork Discussion
    Replies: 0
    Last Post: 03-15-2011, 08:52 PM
  2. Oval Wire Compression Spring
    By cnckid in forum Mechanical Calculations/Engineering Design
    Replies: 0
    Last Post: 01-15-2011, 07:52 AM
  3. oval thread
    By riverracer in forum Mastercam
    Replies: 7
    Last Post: 10-22-2009, 08:14 AM
  4. Oval/Round Toolpath Chatter
    By Absolute Steve in forum Shopsabre
    Replies: 11
    Last Post: 04-17-2009, 03:26 AM
  5. Oval holes
    By abcdef in forum MetalWork Discussion
    Replies: 5
    Last Post: 08-11-2007, 07:40 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
  •