Hello,
I write programs for large CNC routers, and I'm trying to make a parametric program that uses an ellipse in it. I need to know the formula or formulas used to produce the arcs that make up a pellipse so that I can get the radii, and end points of each arc. Any help would be greatly appreciated, Thanks.
-Norm
Solved! Go to Solution.
In the past I have used the geometry of http://en.wikipedia.org/wiki/Trammel_of_Archimedes in VBA to generate coordinates along eliptical arcs.
A
@Anonymous wrote:In the past I have used the geometry of http://en.wikipedia.org/wiki/Trammel_of_Archimedes in VBA to generate coordinates along eliptical arcs.
A
Thanks, I have looked at that already - which is great, but doesn't give enough information. I have also looked into the "five centered arch" in http://mysite.du.edu/~jcalvert/math/ellipse.htm, which is ok, but not as accurate or usable as the pellipse in AutoCAD.
For programming, the current way a pellipse is created is great. Each quadrant is made up of 4 arcs. The end point for each arc is in line with the center of the arcs on either side of it, which flow seamlessly into each other.
For my purposes, I need to be able to calculate the radius, and start & end point of every arc (referenced from the center of the ellipse). Thanks.
-Norm
@Anonymous wrote:
I don't know why you would want to create arcs? Surely that's an inaccurate way to do it?
I just generated a series of points along the elliptical arc and fed that directly into the tool path.
What more information do you need in addition to that wikipedia page?
Unfortunately I can't create ellipses on the machines I'm programming. The accuracy of the Pellipse isn't perfect, but good for my application, and easy to check the logic in Excel and AutoCAD. I really like the Trammel of Archimedes, but I don't know how to apply it. The basic parametric programming logic I do can be replicated within excel.
-Norm
This is what I've been able to figure out so far...
Based on the picture shown above:
AF is major axis
AB is minor axis
Line IHD is perpendicular to BF
Line JIC is perpendicular to BD
Line HGE is perpendicular to DF
Line GF = First Arc Radius
Line HE = Second Arc Radius
Line IC = Third Arc Radius
Line JB = Fourth Arc Radius
Yes the trammel option gives X and Y coordinates easily (If only it could be that easy ), but the arcs between can't be calculated which means they would not line up. Trammel option doesn't give the radii of the arcs.
The key to making this without being able to program ellipses is to have all the arcs have the same start angle as the one that it connects to.
Without arcs I can't make ellipses, unless I use hundreds or thousands of small lines from a CADCAM program - which can't be parametric and the reason I'm looking for some formula(s)!
Parametric programming for me and the machines that I take care of is always written manually. Who wants to manually write a program with hundreds or thousands of calculations & lines of code for a machine that at the end of it, and expect to have not made any errors in the program, let alone the crazy amount of time required to do it???
@Anonymous wrote:
Surely whatever code you have to write would allow some kind of loop such that you just tell it to run the calculation say a thousand times?
You said that you needed a formula that could be calculated in Excel and Excel would not require you to work out each tiny line individually! If you must insist on using inaccurate arcs then you could use the coordinates generated by the accurate formula as the start, end and midpoints to plot arcs.
I feel like I'm not being listened to. I cannot program ellipses - therefor I have to program arcs. I need formula(s) that can replicate a pellipse from AutoCAD, which requires knowing the start, end, and radius of each and every arc.
I've been writing parametric programs for many years for CNC routers, which require formula(s) in order to make them!
-Norm
You "cannot program ellipses - therefor" you should program many lines.
For the record, it's not the best way to do it, but you can just use the trammel formula to generate the three points for each of the arcs.
Norm,
Can you explain how you use autocad to 'program' the cnc machine? Does the cnc machine understand an acad drawing? I presume if it does, then it only 'understands' certain drawing element types (ie arc, lines, but not ellipses).
If what i just said is incorrect, can you explain it a bit more, especially when you say it needs 'formulas'?
I think AGX may be able to help you if I could understand your needs a bit better.
Thanks
John
studioDIGITALresin.
This may not be any help to you, but it happens that if you offset an ellipse in AutoCAD it becomes a spline. So if a spline would be of more use than an ellipse just offset it a certain distance, erase the original ellipse then offset it back.
I doubt it that if the CNC machine cant work with Ellipses, then it wont understand splines. This is a complete guess 😉
I write Gcode programming - my options are only lines and arcs, and the routers do not accept drawings of any kind (no CADCAM on machines). I have limited number of variables so even if I wanted the daunting task of calculating and writing formulas for hundreds of lines, and even with looping it wouldn't work (program space issues then).
When I program any line - I need the X & Y axis location for the start and end points of that line. When I program arcs - I need the X & Y axis start and end points as well as either the radius or the X & Y axis location of the center of the Arc in relation to the start point. I'm not 100% sure, but I don't think that using the Trammel formula "on 3 point arcs" (which I didn't think of using it that way) will work because of having to find either the arc's center or the radius.
Basically, I need to enter the Major axis, and Minor axis sizes into 2 variables, and be able to calculate the start, end, and radii of a set number of arcs to mimic an ellipse or pellipse. This is why I said that excel can be used in programming. Enter 200 in one cell and 350 in another, and then calculate with formulas the arcs that would make up a quadrant (other quadrants can be mirrored).
A Pellipse in AutoCAD is great because each arc flows into the next because the ending angle of one arc is the starting angle of the next, and there are only 4 arcs which simplifies the calculations required (when you have the formula). I understand how the Pellipse is made (see picture posted earlier in this thread), but I don't have the formula(s) to complete it.
-Norm