# Thread: How would you do an oval?

1. ## 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. Do you mean an ellipse?
An oval is two half circles with straight lines between them. Two G2's and two G1's.

3. Hi Gerry,

Originally Posted by ger21
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. 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. I draw it in AutoCAD with arcs and create the code from that.

6. Originally Posted by alank2
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
#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. Hi,

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

Alan

8. 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.

9. here is an example written for linuxcnc.

LinuxCNC Documentation Wiki: Oword

I have not tried it...

sam

10. Originally Posted by alank2
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. Originally Posted by ger21
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. Originally Posted by angelw
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.

Page 1 of 3 123 Last