LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Finding the center of rotation of a set of 3D points

Solved!
Go to solution

OK, this dataset has a bit more curvature. Good!

 

If you look at the raw data (zoom into the x y or z trace) there are some small discontinuities (due to e.g. vibration, stiktion, or similar). They show up in my "distances" graph as jumps and there is no way for a circle to follow the data.

 

If I do the sphere fit, the difference between actual radius and best fit radius has a standard deviation of only 2 mils, well within your 5 mil accuracy (max. deviation is 12 and -6 mils). (Of course you would need to calculate the error propagation from x,y,z, to r, etc. :))

 

I think it works fine.

 

 

Message 11 of 20
(2,886 Views)

Yes, the vibration is expected as the movement is driven by a bipolar stepper motor in full step mode. We are now using a low cost MCH-5 Motion Checker for development but for the real calibration we will use microstepping.

 

I understand the reason why it is not possible to fit a circle on the raw data but ultimately the center must be on the best fit plane. In the first picture the (x0,y0,z0) point seem to be centered but in the second one we see that it is not in the same plane.

 

view-1.pngview-2.png

 

Would it be reasonable to assert that the projection of (x0,y0,z0) onto the best fit plane could generate a result within the range of sensor resolution? (I will try it when I have time, I'm actually busy on another project)

 

Ben64 

0 Kudos
Message 12 of 20
(2,876 Views)
Solution
Accepted by ben64

Why not treat the best fit plane as a constraint on the sphere fit?
Fitting on a sphere.vi reduces to the solution of a single linear system. The best fit plane equation can be viewed as an equality constraint, and is implemented as an additional row in the linear system solve inside Fitting on a Sphere with Constraint.vi
I re-implemented the Fitting on a Sphere.vi to be a little clearer (using linear algebra to clarify the diagram a bit), and to incorporate the plane constraint. Note the use of a weight. By adding the extra row the linear system is now over-determined, so the weight can be adjusted to emphasize the constraint as needed. A weight of 1 seems to work well for this problem. I didn't notice significant constraint violation until the weight was reduced to ~1E-5 or so.

-Jim

Message 13 of 20
(2,852 Views)

Yes, projection of all data to the best fit plane will guarantee that the center is in that plane. I guess your data shows slight assymmetry around that plane, causing the center to move out of the plane.

I think it would also be easy to implement a nonlinear fit that uses the plane constraints.

 

(Sorry, posting by phone. Cannot look at the code above)

0 Kudos
Message 14 of 20
(2,848 Views)

Thanks DSPGuy, this looks very promising. I will take some time to understand what is going on in your code.

 

Ben64

0 Kudos
Message 15 of 20
(2,830 Views)

Hi Ben

Are you going to use this Optitrack system with sensors on people?  Are you only ever going to be tracking one marker? The reason I ask is that this sort of fitting is a well-trodden path, and depending on the "joint", it isn't always a centre point you want.  Sometimes it is an axis.  How many degrees of freedom do you have?  I thought I would offer an article reference that uses SVD to determine the movement of one body relative to another.

I. Soderkvist, P.A. Wedin Determining the movements of the skeleton using well-configured markers J....

0 Kudos
Message 16 of 20
(2,823 Views)

Hi Paul,

 

We are using the Optitrack for rigid body tracking (an antenna gimbal structure) and we are using more than one marker. We have 6 DoF.

 

Ben

0 Kudos
Message 17 of 20
(2,805 Views)

Thanks to all for your help.

 

Ben

0 Kudos
Message 18 of 20
(2,793 Views)

Just for reference, here's a (very!!!) old discussion (with links) that talks about the algorithm used when fitting on a sphere.

Message 19 of 20
(2,771 Views)

@altenbach wrote:

Just for reference, here's a (very!!!) old discussion (with links) that talks about the algorithm used when fitting on a sphere.


Thanks for the link.

 

Ben

0 Kudos
Message 20 of 20
(2,769 Views)