LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

3D elliptical surfact fits with random points

Labview has a 3D surface sample fit for a 2D gaussian surface.  However this only uses regulare spaced z(Xi,Yj )coordinate pairs.  How to due an ellisoidal surface fit to a three D data cloud with random x,y data points in labview.
0 Kudos
Message 1 of 11
(4,796 Views)
I assume you have LabVIEW 8.0 or higher.
 
All you need is a function thay calculates Z given X and Y (and a set or fitting paramters ) and a way to send X and Y to the function. There are many ways to do this, for example you could make the "X array" input simply twice as long by interlacing the X and Y arrays and using the "Y input" for your Z data array.
(If you open Lev-Mar, you notice that the size of the X array is fortunately irrelenvant ;))
 
Another possibility would be to not even use the X array input and package your xy values into a variant and transmit it via the "data" input.
 
How complicated is your ellipsoid? Are the main axes always aligned with the coordinate axes or can it have arbitrary orientation?
 
Since it is possible to have zero, one, or two Z values for any given xy pair, you need to be a bit careful that it does not blow up. Is you ellipsoid a closed 3D surface or just an elliptical "bump" on an infinite xy surface.
 
Message 2 of 11
(4,790 Views)
Daer Altenbach,
 
you sound like you know what to due to make labview process a 2D array of x,y as X array for the fitting routine. 
The formula I try to fit is  (Z-Z0)^2/A^2 + (X-X0)^2/B^2  + (Y-Y0)^2/B^2 = 1  with A, B, X0, Y0, Z0  a parameters to fit
 
The data come in X(n),Y(n),Z(n)  tripplets in a 2D spreadsheet  from a comparator scanning in perpendicular cross sections  in X and Y for now and perhaps in random pattern (X, Y, random)  later) and I need to find the best A, B, X0, Y0, Z0  to optimize a tooling manufacturing process by providing feedback to the CNC laid from the actual result versus programmed shape.  We have to due this many time, thats why I'm looking into using laview to due this in an automated way,
 
Can you show me how to use the data input to process Z as Y array and data (X,Y) as X array for the Lev-Mar vi?
 
thanks, KZ
0 Kudos
Message 3 of 11
(4,775 Views)
Daer Altenbach,
 
you sound like you know what to due to make labview process a 2D array of x,y as X array for the fitting routine. 
The formula I try to fit is  (Z-Z0)^2/A^2 + (X-X0)^2/B^2  + (Y-Y0)^2/B^2 = 1  with A, B, X0, Y0, Z0  a parameters to fit
 
The data come in X(n),Y(n),Z(n)  tripplets in a 2D spreadsheet  from a comparator scanning in perpendicular cross sections  in X and Y for now and perhaps in random pattern (X, Y, random)  later) and I need to find the best A, B, X0, Y0, Z0  to optimize a tooling manufacturing process by providing feedback to the CNC laid from the actual result versus programmed shape.  We have to due this many time, thats why I'm looking into using laview to due this in an automated way,
 
Can you show me how to use the data input to process Z as Y array and data (X,Y) as X array for the Lev-Mar vi?
 
thanks, KZ
0 Kudos
Message 4 of 11
(4,775 Views)

Dear Altenbach,

I forgot to mentione that we only meassure the top part of the ellopoid, like cutting a football at the top on third  (near on of the focal points of the ellipsoid and perpendicular to the main axis) and putting it on the table so that the vertical axis is the Z (A) axis.  The X0, Y0 are nearly 0 and represent coordinate centering setup errors.  The Z0 is approximately the  A-c with c=sqrt(A^2-B^2)

0 Kudos
Message 5 of 11
(4,772 Views)


@Karlheinzs wrote:
Can you show me how to use the data input to process Z as Y array and data (X,Y) as X array for the Lev-Mar vi?

I still would need to know your LabVIEW version. All the fitting tools received a significant overhaul in 8.0 and the solution would be much more difficult in 7.1 or below.


 

0 Kudos
Message 6 of 11
(4,761 Views)
I have labiview up to 8.2
0 Kudos
Message 7 of 11
(4,760 Views)
You're in luck because I already had a suitable code skeleton from last year. The only thing needed was to change the model subVI.
(LabVIEW 8.0).
 
 
See if this makes sense to you. 🙂
 
I use the full function with x0,y0,z0,A,B,C. If e.g. A=B, the function is even simpler.
 
(You need to define the function outside the valid range, Currently I set ot to Z=z0. Modify as needed).

Message Edited by altenbach on 02-19-2007 11:28 AM

Download All
Message 8 of 11
(4,751 Views)
Thanks Altenbach,
 
I thank you very much, this is 95% of what I'm looking for and I can take if from here.  Thanks for sharing and updating your code for me.
 
Karlheinz Strobl
0 Kudos
Message 9 of 11
(4,746 Views)
Hi Altenbach,
 
I was wondering if the precession of the fit can be improved by using differentials calculate by formuals, see attached?  IF so how to incorporate it into your VI?  See attached VI, not yet fully tested.
 
Also if B=C given, I should be able to modify the model to get more accurate fits for A, B, etc.  Which part of the model do I need to change to remove the dependency of C?
 
Just wondering, how to get the ultimate, 
 
KZ,
ex theoretical physicist.
0 Kudos
Message 10 of 11
(4,729 Views)