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
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
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)
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.
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)
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
%
Hi,
Thanks everyone!! I'll try out that code Bill!
Alan
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.
here is an example written for linuxcnc.
LinuxCNC Documentation Wiki: Oword
I have not tried it...
sam
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.
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
That is the macro I would like to see.
Imperial, naturally. The metric system, in its simplicity, is confusing :P
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