# Posts by Martinator5000

• ## Calculate TCP using centre of sphere from 4 points

I figured it out. What was mentioned above is correct. The tr means that the value is a transform and the ! means that the transform is inverted. The transform that is used here is a homogeneous transformation matrix. I attached an example.

After I figured out how the transform worked, I needed to know what values the matrix consisted of. I attached a sketch where I explain which transforms fills the matrix. The most important thing in this sketch is that the matrix for trSphere and trCenter use the same orientation. This means that the rotation part of both matrices is the same before trSphere is inverted. The last collum of the matrices need to be filled with the location of a point on the sphere for trSphere and the location of the reference point for trCenter.

Finally, trSphere is inverted and is multiplied with trCenter. This gives back a matrix trTempTool. The last column of the matrix gives the temporary TCP. In the Staubli code this is done four times. The 4 calculated values for the TCP are then added up and divided by 4. This gives the average of the 4 temporary TCP's. This average is the final TCP.

I attached a Matlab file with the calculator I made for determining the TCP.

//Inverse sphere * center
for l_nI=0 to 3
trTempTool[l_nI]=!trSphere[l_nI]*trCenter

Thank you for helping me solve this problem.

• ## VAL3 = ! Cartesian

Hello,

I have found some VAL3 code which calculates a TCP from 4 points. Previously of acquiring this code already had figured out how I could calculate the center of a sphere. I am wondering how to calculate the TCP using this center and the 4 points. Attached is the code from Staubli where the TCP is calculated. Below is the piece of code that I don't understand.

//Inverse sphere * center
for l_nI=0 to 3
trTempTool[l_nI]=!trSphere[l_nI]*trCenter

In my understanding, trSphere is a Cartesian value which is equal to one of the 4 points. The ! inverts this value. My question is: Is this correct? If so, how do you invert a Cartesian?

I hope someone can help me with this problem.

• ## Calculate TCP using centre of sphere from 4 points

In the Val3 code, they are using an inverse sphere. Below is the code I mentioned. If I understand correctly, then =! means that trSphere is the opposite of itself. trSphere is a cartesian value (x, y, z, Rx, Ry, Rz) of a point on the sphere. What would be the opposite of a cartesian value like this?
They also mention an inverse sphere. There are no calculations in the file for an inverse sphere. Is there a function in the Staubli controller that does this, or does this happen somewhere else?

//Inverse sphere * center
for l_nI=0 to 3
trTempTool[l_nI]=!trSphere[l_nI]*trCenter

• ## Calculate TCP using centre of sphere from 4 points

This is exactly what I was looking for TygerDawg. I found the files from Staubli you mentioned and attached them.
It would also be great if someone has any extra information or an explanation of how to calculate the TCP from the center of the sphere and the 4 points.

• ## Calculate TCP using centre of sphere from 4 points

Thank you for your answer SkyeFire. However, I already know how to calculate the center of a sphere. I am looking to calculate the TCP using the center of the sphere and 4 points on its surface. I don't understand how I can calculate the X, Y, Z values of the TCP. I already know how to get X, Y, Z values of the center of the sphere.

• ## Calculate TCP using centre of sphere from 4 points

Hello,

I am trying to calculate a TCP using 4 points. I am using cartesian data. These four points are all defined using the same reference point.
I know how to calculate the centre of a sphere. I don't understand how to use this information to calculate a TCP.

Currently I align the first point in a Rx 180 Ry 0 Rz 0 orientation. This way I can just take the first point minus the centre of the sphere, this gives me the TCP. I would like the first position to be in a random orientation, just like the 3 other points.

How can I use the orientations of the 4 points to calculate a TCP using the centre of the sphere?