20 Replies Latest reply on Nov 17, 2009 1:47 PM by Harold Brunt

    Equation Driven Curves

    Harold Brunt
      I had posted a formula some time ago that allowed using the Equation Driven Curve Sketch Tool for generating a conic that could be controlled using the rho value. I'm not looking to rehash the value of having conics in SW but I am looking for any feedback about how I am using the tool and if anyone else is seeing the disparities that I am seeing. Here's my problem: I want to generate my conic surfaces using a formula but there seems to be a small (but to me significant) difference in the results depending on how I generate the curve.

      To get to the point, I tried to confirm the formulas by creating a surface using a rho of 0 and then comparing the areas of the surface with the area of a like surface created using an arc and using a spline with fixed points (the Optis lens creation tool).

      The formula's I used were:
      y=(x^2/R)/(1+(1-(1+b)/(x/R)^2)^1/2)
      and
      y=(b^2*(x/R)^2-x2)^1/2)
      where x = the start and end points, R = the radius and b = the conic constant (Rho). For my "test" I used a radius of 8.4mm, a diameter of 8.8mm (x 0, 4.4) and a Rho value of 0.
      The calculated areas are:
      65.68751533mm2 for the SW arc;
      65.68479891mm2 for the Optis spline;
      65.68423769mm2 for the first formula;
      65.68423769mm2 for the second formula.
      Like I said, not much difference but to me significant since Optis uses the surfaces to do the calculations for raytrace. When I contacted Optis about the differences they were able to confirm that the lens creation tool does create a surface that results in correct optical data when compared to Zemax (which does the calculations mathematically and displays the rays for reference only). Also something to consider in judging the difference as significant is that the curve is only a 4.4mm radius. We do design large hyperbolic reflectors once in a while so the disparity will only get worse. For now I have the Optis interface to use but I would like to better understand why the methods don't match up. Any ideas?
        • Equation Driven Curves
          Mahir Abrahim
          I don't feel like looking them up to make sure, but the conic equations look fine to me. That being said, I wouldn't expect an arc or spline to produce the same results as the equations. The arc gives you a different area because setting b=0 gives you a parabola, not an arc. The radius value in the equation is the instantaneous radius at the apex of the parabola. The further you go from the apex, the larger the instantaneous radius. As for the spline, who knows what exactly is going on under the hood to generate the polynomial curve. Depending on how you've placed and tweaked the spline control points you could get all sorts of variation. A more valid test would be to compare the equation generated results to those using SW's parabola sketch function.
            • Equation Driven Curves
              Harold Brunt
              Thanks for taking a look Mahir. A Rho of 0 does give a sphere (-1 is a parabola, 0>Rho>-1 is an ellipse). I didn't expect the spline to be the best fit to the arc as there have been several discussions about spline approximations for curves on the forums although Optis plots 50 points in the 4.4mm radius. I was hoping to replace the spline curve in Optis with the equation driven curve but it doesn't seem to give reliable results. Using a calculator the results for area match the arc model so I believe the problem is with the equation driven curve tool. I also suspect that the larger the curve the larger the error (I'm glad I'm not designing a wing).
            • Equation Driven Curves
              Mahir Abrahim
              Oops, you're right. All those parentheses threw me off. The first time I looked at the longer equation it seemed as though b=0 degenerated into y=x^2/R.
              • Equation Driven Curves
                Mahir Abrahim
                Harold,
                I just had a though. If you already have Optis why don't you use raytracing as your measurement method instead of lens area? Just place a sensor or output the raytrace to a measurable 3dSketch. I could be wrong, but my gut tells me that an error of .0008-.0050% in the lens surface area will probably not have a measurable impact. By using the raytracing you're matching the measurement tool to the lens' actual performance instead of an arbitrary area. For all you know the curve differences are limited to the outer .01 percent of the lens aperture that nobody uses anyhow. Hopefully, the final result would be that the equation driven curve is close enough to keep using it. I've worked with a fair amount of lenses, and I know what an annoyance it is having to redo a lens from scratch because an optical engineer decided to change the asphere coefficient from 1.214 to 1.215.
                  • Equation Driven Curves
                    Harold Brunt
                    You are right on the money Mahir. I had been using the Optis raytrace data to measure the differences between the methods and the differences are variable depending on the material selection (index), size of the optic and the conic value. We are also designing a lot of conic reflectors lately so the clear aperture extends closer to the edge than would a lens.

                    I have prefered using solids over surfaces for my models for creating prints and assembly files so in the past I would create the asperic surface in Optis and delete the surface leaving the sketch to create the solid. That made the sketch uneditable. The lens creation tool in optis does allow the sketch to be edited if the surface is not deleted so I can always extrude up to the surface if I want a solid.

                    I had subitted a suggestion to Optis to use the Equation Driven Sketch function now that SW supports that feature instead of the spline. When the issue was investigated there it was found that the results were unreliable. I just did a little trial using a few different options available in Optis and most give the same results as a simple arc with the exception of the aspheric which is only slightly different. The largest error seems to be generated using the SW tool.

                    I intend to send something to my VAR soon.
                      • Equation Driven Curves
                        Harold Brunt
                        I sent this in to my VAR 3/23/09 but it is being considered low priority since I have a workaround (The Optis interface). It would be really nice to have this feature working properly or to know if the error is mine. I generated another equation driven sketch of a conic with a Rho value of "0" just for curiosity:

                        y=(R^2 - x^2)^1/2

                        Yep, it's a circle formula. For a cap with a radius of 10mm and a diameter of 10mm, the area's for the original posted formula and the above formula are 84.17430771mm^2 but for a cap generated using an arc the area is 84.17872143mm^2.

                        I read a short discussion at Matt's Blog http://www.dezignstuff.com/blog/?p=937 regarding the use of conics and the rate at which they are being addressed at SW. Perhaps it is because the formula driven sketch function performance that conics are not a feature. Is everybody else having reasonable success with this new tool or isn't it being used? I do know that you need to be picky about entering the formula and such or there will be errors.
                          • Equation Driven Curves
                            Andy Fraser
                            Hi Harold,

                            For polynomials, the equation curve should be exact. For any other type of equation, like your circle example, the curve should be accurate to within 0.001mm, irrespective of the size of the curve.

                            That means in the worst case scenario that your circle is really of radius 10.001mm, then the area of the full circle would be out by pi(10.001^2 - 10^2) = 0.063mm^2.

                            Regards,
                            Andy.
                              • Equation Driven Curves
                                Harold Brunt
                                Hi Andy,

                                Thanks for looking at my question.

                                .063mm^2 seems huge to me but my results also differ from yours in that they are not a maximum offset that does not increase with size. For my "test" I used a radius of 10 to 80mm in 10mm increments and a diameter of 10mm (x1=0, x2=5). The calculated areas for the simple circle formula above compared to the arc are:

                                R sw radius sw formula error
                                10 84.17872145 84.17430767 0.00441378
                                20 79.80691729 79.80336514 0.00355215
                                30 79.09294107 79.08953575 0.00340532
                                40 78.84903301 78.84573716 0.00329585
                                50 78.73715381 78.73382833 0.00332548
                                60 78.67664570 78.67332931 0.00331639
                                70 78.64025105 78.63694012 0.00331093
                                80 78.61666555 78.61335815 0.00330740

                                For a 50mm diameter, 80mm radius cap, the error is .08257146mm^2. If I use a plano surface (disc) offset by 10mm, apply optical properties (SF11) to the part and measure the focal length at 532nm the difference is 2.76mm. That's a lot. I get comparable results using the conic formula to the point that I cannot use the formula driven sketch for optical surfaces. As I've said before : 1. It could be my error, 2. I'm glad I'm not designing something large like an airfoil.



                                  • Equation Driven Curves
                                    Harold Brunt
                                    My VAR generated a SR for my issue 4/13. The point I made while discussing the issue with him is that the documentation for the equation driven sketch tool doesn't say anything about it being an approximation. I cannot have a tolerance on a formula driven sketch anymore than I can have a tolerance on the arc or line segment or have a vertical line be "pretty-much-up-and-down-ish".

                                    The key for me is that the error translates into errors in the optical calculations because the curve is wrong. The area is simply the easiest way to measure the error for someone without OptisWorks (or another ray trace program). We could just as well use volume if I revolved the part as a solid. I would assume the error would be just as unacceptable to someone designing large or high-volume production plastic parts that needs to know exactly how much plastic will be used over time; or for an air foil such as a wing or for cooling vents; or for a microwave antennae, etc.

                                    I've attached the part file that has been sent to SW with the SR. If any Math-a-magicians have a chance to look at the formula's, that'd be great. I don't mind being wrong (even in a public forum) nor am I trying to be a jerk about it, I just want to have this resolved so that I can use the tool with confidence.

                                      • Equation Driven Curves
                                        Harold Brunt
                                        I seem to be having a converstaion with myself but I feel obligated to follow through in case there are users with the same issue but don't care to comment.

                                        I received a response to the SR generated by my VAR:

                                        "The equation curves in SolidWorks have +/- 1e-6 as the accuracy limit, and the customer's application appears to require the curves that are more accurate than this. With this curve 'error', if he creates the surfaces then the difference may look big.
                                        For the accurate representation, customer needs conics in sketcher and unfortunately it is not available in SolidWorks as of now. An enhancement request, SPR # 219494, is already reported and I will add your case to it. You will be informed once this functionality gets implemented."

                                        I looked and the SPR priority is rated "low". A portion of my response (yes, I can be very verbose):

                                        I have to say that I am very frustrated with the "solution". Set aside the secondary question of whether or not SW should have conic curve sketch functionality and consider the results of a surface created from any simple formula. My example being the arc/circle part I submitted.

                                        I generated a spreadsheet with the three different formulas for generating an arc, two using a conic. I calculated 25 points along the curve and compared that result to the spline created by the Optis Lens tool. The errors are 0 e-7 mm for all for an arc of 80mm radius out to 25mm from the origin (a 50mm diameter cap). I then used the arc sketch tool to check the curves. Again 0 e-7. I know the formulas are correct. I compared the area for the surface created by the Optis spline and the SW arc sketch. The same to e-8 mm.

                                        So if the curve in Optis creates the same area as the SW arc sketch, and the formulas that I have entered in the equation driven curve sketch tool are accurate to e-7 mm, why is the area different? For a cap of diameter 500mm with a radius of 600mm the error is 8.6mm2. Perhaps the problem isn't the sketch but instead is in the generation of the surface. Lumping the issue in with the request for a conic curve function doesn't seem to address the problem or to provide a thorough answer.

                                        I'll continue to pursue this through my VAR but unless anyone has some input I'm letting it drop here.
                                          • Equation Driven Curves
                                            cornelius niculas
                                            Hi Harold,
                                            I just came across your forum and noticed last comment was posted in April.
                                            I am fairly new to SW with some exposure to ProE.
                                            I am doing some work in comparing accuracy of surfaces modeled in ProE and SW.
                                            I need to model optical surfaces driven by equation and started with a circle defined by equ. and revolved it.
                                            Analyzing surface found a significant amount of ripple. Sagital values for a 9.0mm radius 16.0mm diameter oscillate up and down from theoretical values by @+/-0.003mm but in local curvature by as much as 0.5mm.
                                            For some the +/-0.003mm may not mean much but for optics guys this is huge.
                                            Attached is a file with just a sketch containing one curve by equ. (right side) and same size radius using the sketcher. It is a JPG file because I could not attach the SW file but is easy to construct looking at annotations.

                                            If you do a curvature analysis you will see what I am talking about.
                                            SPR 506532 was opened today to address this issue. I found it very similar to your kind of problem.

                                            I hope Andy Fraser (Manager - Sketcher Development - SolidWorks Corporation) sees this because it contradicts his statement from an earlier reply in which he claims that curvature is within 0.001mm from a 10.0mm target.
                                            Cornelius Niculas
                                            Cibavision Co.
                                              • Equation Driven Curves
                                                Harold Brunt
                                                Hello Cornelius,

                                                My VAR and SW Corporate have continued working with me to better understand my issue. I suspect the software engineer(s) at SW look at my emails and files and say "Yes, SW is doing exactly as it should. What is the problem?" They can't fix something that they do not perceive to be broken. I have a lot of empathy for them in that regard. At least they haven't given up!

                                                There seems to be a little bit of a communication gap regarding what I believe the equation driven sketch tool (and for that matter, the spline tool) should provide in accuracy and what I can verify with the tools available. The latest email exchange has been this week. My understanding is that SW will not provide an exact calculation for a bspline generated surface (which the equation driven sketch is) and will only return an approximation of "reasonable accuracy" for surface, volume, etc. I'm not exactly sure what "reasonable" is nor do I understand how OptisWorks is able to return calculated results comparable to ZEMAX (which is purely math based) using spline surfaces... just not equation driven sketch surfaces! I also do not understand how other users get by with an approximation when designing conic surfaces (I keep using the example of an airfoil). Wrong is wrong, or is it? Is it right but it measures wrong? I don't know but I need confidence before I re-impliment the tool.

                                                I keep hoping there is a solution and that the equation driven sketch tool will work properly. Better yet of course would be to compliment it with a true conic sketch tool (You may say I'm a dreamer).

                                                By the way, welcome to the forum!
                                                  • Re: Equation Driven Curves
                                                    Andy Fraser

                                                    Hi Harold,

                                                     

                                                    Yes, the differences you noticed were indeed down to the measure tool, and not the accuracy of the equation curve.

                                                     

                                                    For analytical surfaces, for example a cylinder, the measure tool uses simple maths to calculate areas quickly and accurately.  For other surfaces, the measure tool approximates the area.  There is always a trade-off between accuracy and time.  Generally, numerical techniques get more accurate if they run for longer.

                                                     

                                                    I know this doesn't solve your problem, but I hope it helps explain what is going on.

                                                     

                                                    Regards,

                                                    Andy.

                                                  • Re: Equation Driven Curves
                                                    Andy Fraser

                                                    Hi Cornelius,

                                                     

                                                    The curve you provided only deviates by a few tens of nanometres from a pure circle; this is within the tolerance of the tool.  Only deviation accuracy and not curvature accuracy is built into the tool.  This means that even though the equation curve is very similar to a circle, it may oscillate around a true circle to a maximum deviation of 0.001mm.  This causes the curvature defects you are seeing.

                                                     

                                                    The equation curve tool is exact for polynomials, so for example, for parabolas written in the form a + bx + cx^2.

                                                     

                                                    Have you tried 2010 beta?  The accuracy has not been changed, so this does not address your problem, but the curves are now easier to position.  Parametric and 3D curves are also supported, as is using dimensions in the equation definition.

                                                     

                                                    Out of interest, to what accuracy are your optical surfaces manufactured?

                                                     

                                                    Regards,

                                                    Andy.

                                                      • Re: Equation Driven Curves
                                                        Anna Wood

                                                        Andy,

                                                         

                                                        We grind hyperbolic shapes into 4 sides of a tungston mandrel over 12" to 18" in length by about .75" square.  We grind to +/- 1 to 2 millionths of an inch accuracy for the hyperbolas over the entire length of the mandrel.  We are usually closer to 1 millionth or less of accuracy than 2 millionths after they are checked on our CMM.

                                                         

                                                        Cheers,

                                                        • Re: Equation Driven Curves

                                                          Hi Andy:

                                                           

                                                          Have you tried 2010 beta?  The accuracy has not been changed, so this does not address your problem, but the curves are now easier to position.  Parametric and 3D curves are also supported, as is using dimensions in the equation definition.

                                                           

                                                          I did not see 3D curve in SW2010 Beta, only parametric curve is there.

                                                          • Re: Equation Driven Curves
                                                            Harold Brunt

                                                            Andy,

                                                             

                                                            The surfaces we generate in our optical models are toleranced as +/- 1.3nM for a typical lens and as large as +/-13.8nM for a hyperbolic reflector.

                                                             

                                                            All the optical add-in softwares in the SW partner product listing (and several major design packages like OSLO and ZEMAX) will translate surfaces generated in SW for use in analysis. Other than Optis, all require exporting the surfaces so perhaps you can understand why the surfaces need to be accurate. Optis provides a very good user interface for generating optical surfaces but as with all the other add-in softwares the point is being able to generate parts in SW and apply optical properties to those parts.

                                                             

                                                            As for using polynomials, most aspheric surfaces in optics are specified using the radius of curvature and the conic value. Having one formula that allows me to change the surface from an ellipse to a parabola to a hyperbola by manipulating one variable is really convenient as well.

                                                             

                                                            If the limiting factor is the that a higher resolution bspline surface will slow the system down, perhaps the option for a slider similar to the graphics quality could be added. I don't need the accuracy in all my models either if it is going to make my system a dog but when I do need it I really need it.

                                                              • Re: Equation Driven Curves
                                                                Emilio Graff

                                                                I work on optical designs as well and an equation-driven curve, however accurate or inaccurate, is a problem for me, because I want a "free" conic that can move and change shape as a function of other sketch elements.

                                                                 

                                                                For example, in complex 3D optical systems it is often easiest to get a lot of "hand" calculations done before throwing it at an optimizer. Especially when you have to interface with a 3D object, Solidworks is a great way to layout the optical path first before going into optical design. To do this, I sketch out reflections and refractions. Solidworks is limited in this since I can only do this (without extensive construction tricks) by drawing lines tangent to my surface, which, as far as conics go, is only available on the circle and the ellipse.

                                                                 

                                                                Let's say I have an elliptical reflector. I can sketch in the reflectors, then constrain the input and output rays accordingly, and let the ellipse change as necessary. This requires some finessing because the sketch will occasionally "jam". Once I have the ellipse, I can take a few dimensions and stick it in an optical design program and proceed to do accurate ray tracing. This is sometimes the only way to get the optimizer to end up in the right place.

                                                                 

                                                                So an equation driven curve is not a viable solution, because in my case the coefficients themselves are variables. Thus the need for a hyperbola and parabola tool that behaves like the ellipse and circle (able to add tangent relations). Ideally you'd be able to add a "normal to curve" relation, since that elliminates some of the extra construction lines I have to put in.

                                                                 

                                                                In an effort to do something about it, I've created enhancement requests. I don't know the history of the problem, and I was surprised to find no enhancement requests for anything relating to conics. So here you go:

                                                                The hyperbola request is ER# 1-1413855312

                                                                The tangents to conics request is ER# 1-1414911712

                                                                 

                                                                Go vote on them!
                                                                  • Re: Equation Driven Curves
                                                                    Harold Brunt

                                                                    For me the equation driven curve sketch is not the solution but the closest thing to having a conic tool in SW. I rarely need to use the sketch tools as construction tools for the optical system. I have used the ellipse sketch tool and construction lines as a start point for simple reflectors but I have the OptisWorks Add-in for Optical Design (as well as the lighting Add-in) so I don't need to sketch in SW and optimize elsewhere. I can do it all within the SW assembly model but the surfaces need to be accurate however they are created. Optis has an interactive source tool that keeps the trace simple: no optical calculations like focal length, etc and it is in the plane the sketch is created. It is very fast and easy to use.

                                                                     

                                                                    need conics.JPG

                                                                     

                                                                    I am not saying what you are asking for is not necessary. I think the more tools available the better. You might find that conic creation and the tools that other programs have are not as much of a requirement for the general SW user (this is my opinion anyway) and the support you want may not be as overwhelming as you might hope.

                                                                     

                                                                    Harold