I want to perform ABC 3 point BASE measurement programmatically. Let's suppose I know the 3 point of the model and I can move the robot to it. Is it possible to call the measurement method in robot program?
ABC 3 point BASE measurement. How does algorithm works?
-
Mischa -
December 25, 2014 at 9:01 AM -
Thread is marked as Resolved.
-
-
not that I know of... you will need to make own function and if that is what you want, you will need to dive into math and KRL programming.
for example, teaching base with 3-points means that points are:
P1 - origin
P2 - point on X axis
P3 - point on XY plane (positive Y)
from each of the three points you only need translation components X,Y,Z, orientation A,B,C and Status and Turn do not matter...to create new base you just need to assign frame data {X,Y,Z,A,B,C} to base of your choice.
XYZ components are easy - they are already in P1 (if P1 is expressed in WORLD)
however, determining ABC is a bit more work and requires knowing how the rotations are computed on kuka, then solving inverse of a rotation matrix.
and this will take some math skill...order of rotations matter. in kuka, rotations are done in order A > B> C where
A is rotation about Z
B is rotation about Y
C is rotation about Xsee
http://en.wikipedia.org/wiki/Euler_anglessuppose you start with WORLD coordinate system where unit vectors that form base are <i,j,k>
after transform through rotation matrix you get <i',j',k'>we know that
i=(1,0,0)
j=(0,1,0)
k=(0,0,1)you can compute i',j',k' from your points and the rotation matrix. (forgive me for any typos, i am still in party mode, got to love eggnog )
for example i' is a unit vector in same direction as a vector P12 which is from P1 to P2.
in fact all we need to do is normalize P12 and that is our i'to get k' we need to compute cross product P12xP13 and normalize it.
to get j' we just do a cross product of k' x i'
btw normalizing vector means dividing each of its component by vector length
For example:P12=(P2.x-P1.x, P2.y-P1.y, P2.z-P1.z)
|P12| = sqrt( (P12.x)^2 + (P12.y)^2 + (P12.z)^2)
i'=(1/|P12|)*P12P13=(P3.x-P1.x, P3.y-P1.y, P3.z-P1.z)
|P13| = sqrt( (P13.x)^2 + (P13.y)^2 + (P13.z)^2)
u'=(1/|P13|)*P13k'= i' x u'
j' = k' x i'now that the easy part is done (i', j', k' are columns of rotation matrix), you still need to determine values of angles A,B, C that result in that particular rotation matrix:
-
C and S are just short hand notation for COS and SIN functions. since rotations are A,B,C (or about axes Z>Y>X), that should be:
C1=Cos(A)
C2=Cos(B)
C3=Cos(C)
S1=Sin(A)
S2=Sin(B)
S3=Sin(C) -
hello panic mode !
i really really need your knowledge.
but i can't understand ....for example...
i have 3 points like below
Origin 194.380200 1665.665000 1041.952000
x axis 201.715089 1561.051559 1086.998435
y axis 294.122864 1671.903273 1041.523605how can i calculate A, B, C?
i want to set base coordinate
BASE_DATA[1] = {x 0.0, y 0.0, z 0.0, A 0, B 0, C 0}x, y, z is 194.380200, 1665.665000, 1041.952000
but i can't calculate A , B, C...
please help me -
My respect to you, panic mode!
Your explanation is so good for me, I got it, only the one thing to make clearer.
Is the rotation matrix looks like this? -
kaneyja, panic mode just explained all at the up. You need to calculate rotation matrix and from it find ABC values. It looks pretty clear, read it one more time
-
i calcaulated rotation matrix... like below
0.073349 0.997427 0.079695
-1.046134 0.062383 -0.433822
0.450464 -0.004284 3.865506but i read one more time, i can't understand how can i get A, B, C value.
-
now you have:
cos(A)*cos(B)=0.073349
sin(A)*cos(B)=-1.046134
-sin(B)=0.450464and others, did you understand the logic?
so you just need to find:
B from -sin(B)=0.450464
than if you have B, you can find A :sin(A)*cos(B)=-1.046134
and finally if you have B, you can find C: cos(B)*sin(C)=-0.004284 -
you're right!
but as you know sin , cos value has several values.
so i can't decide what value is correct.in my case.
B value is 206.77345760534847393051262491475 or 333.22654239465152606948737508525 or
-153.22654239465152606948737508525 or -26.77345760534847393051262491475
C = 2.7503460678655562714068002632689 or -2.7503460678655562714068002632689
A = 94.712540033588601703511414758019 or 85.287459966411398296488585241981 or
94.712540033588601703511414758019 or 85.287459966411398296488585241981 -
How they have several values?
When you are using on your calculator sin^(-1) you will get only 1 value.
For example
-sin(B)= 0.450464;
sin^(-1)(-0.450464) = -26.77345761 degrees -
but
-sin(B) = 0.450464
so B has several value don't you?and i used sin^(-1), i will get only 1 value .
but this value has Condition like ( 180/2 degree < B <0 degree)
i really Confused.Please save me
-
my friend you are mixing something. Sin and cos have only one values in each point. Think yourself, sin(pi/2)=0; sin(pi)=1/2; etc. Look to the graph that you sent before and try to find this values
-
Have a look at the attachement in that message:
http://www.roboterforum.de/roboter-forum/…30441/#msg30441 -
hermann, this attachment is not accessible
-
mentioned results cannot be right...
sin and cos functions can NEVER have value that is greater than 1 or smaller than -1.
and when you multiply such values (magnitude of each one is <=1), result will only get smaller - there is just no way to get values of magnitude like 1.046 or 3.866 (positive or negative, does not matter).also, not every matrix is a valid rotation matrix:
rotation matrix MUST be invertible (determinant not zero).
every element of rotation matrix MUST have value in range [-1,1]..
rotation matrix MUST be right hand and orthonormal (unless academic case), meaning that norm of
every row and every column, MUST be equal to 1 (otherwise matrix not just rotates
but also scales rotated vectors which is not valid, they must retain same length).so when I tried values from points:
Origin 194.380200 1665.665000 1041.952000
x axis 201.715089 1561.051559 1086.998435
y axis 294.122864 1671.903273 1041.523605my rotation matrix became:
0.064 0.956 -0.286
-0.917 0.170 0.362
0.395 0.239 0.887Note that left column (i') is normalized P12; right column (k') is normalized P12xP13; and
center column (j') is just cross product of those two (of course order of multiplication matters).if my program does not lie, result should work out to
base_data[1]={X 194.3802, Y 1665.665, Z 1041.952, A -85.989, B -23.246, C 15.097} -
So here is the attachement.
You have to register to the german forum to download it. -
hermann, which input is required to perform the calculation? Is this only PT_IN_WORLD[] matrix that include 3 points? Thank you
-
you need to declare array of three FRAME
-
How they have several values?When you are using on your calculator sin^(-1) you will get only 1 value.
For example
-sin(B)= 0.450464;
sin^(-1)(-0.450464) = -26.77345761 degreesoh boy...
blindly trusting calculator is sure to bite back (and more often than you think...)all periodic functions eventually have same result over and over - because they are periodic!
for example SIN(-210), SIN(30), SIN(150) and SIN(390) etc all have same result: 0.5. but when using calculator to compute inverse,
you only get ONE result which is 30deg. I hope you realize that 30 and 150deg are very different.
calculators are not very smart and just because you get result it does not mean it is a correct one.
YOU are supposed to then reason out which of the values may make sense and accordingly make adjustments by hand
(select result from proper quadrant if you have enough of data).SIN is positive in quadrants 1 and 2
COS is positive in quadrants 1 and 4TAN=SIN/COS
so you get positive result in both quadrants 1 (sin/cos both positive) and 3 (sin/cos both negative)
ATAN does not distinguish between the two and you need to adjust result by hand (if and when you can deduce correct one).
this is why in some cases (like in KRL) there is also ATAN2 which takes two arguments...I am sure any calculator will also tell that square root of 4 is 2, but that is not correct either. there are two possible solutions:
(2)*(2)=4
(-2)*(-2)=4I am pretty sure you would not want robot axis to go to +2meter position if the intention was to go to -2meter.
The same would be sending some axis to 30 instead of 150deg -
panic mode, thank you
otherwise, which SIN(-210), SIN(150) and SIN(390) you are talking about? we are talking only about base ABC position, not robot! Can you imagine that your base will be turned 150 or -210 degree in any direction???
Of course I just need to choose smallest value, where the calculators result will be enoughtanyway, thank you again
-