I'm trying to create a user frame based on found position from a probe. The following was posted in 2018. I tried this logic and though the user frame x,y,z data was very close to a physically taught uframe, the elements within the matrix PR were not correct. It was saying the frame is not orthogonal. If anyone has any input or advice I would greatly appreciate the help. Thanks!
You want to create a USRFRAME from probed data, here is the code
/MN
1: ;
2: ;
3:L P[1] 2000mm/sec FINE ;
4:L P[2] 2000mm/sec FINE ;
5:L P[3] 2000mm/sec FINE ;
6: ;
7: ;
8: PR[1]=UFRAME[2] ;
9: PR[2]=P[2]-P[1] ;
10: PR[3]=P[3]-P[1] ;
11: PR[4]=P[1] ;
12: PR[1,1]=PR[2,1] ;
13: PR[1,2]=PR[2,2] ;
14: PR[1,3]=PR[2,3] ;
15: PR[1,4]=PR[3,1] ;
16: PR[1,5]=PR[3,2] ;
17: PR[1,6]=PR[3,3] ;
18: PR[1,7]=0 ;
19: PR[1,8]=0 ;
20: PR[1,9]=0 ;
21: PR[1,10]=PR[4,1] ;
22: PR[1,11]=PR[4,2] ;
23: PR[1,12]=PR[4,3] ;
24: UFRAME[2]=PR[1] ;
25: ;
/POS
P[1]{
GP1:
UF : 0, UT : 1, CONFIG : 'N U T, 0, 0, 0',
X = -381.449 mm, Y = 1085.194 mm, Z = 401.513 mm,
W = 180.000 deg, P = -.000 deg, R = 1.774 deg
};
P[2]{
GP1:
UF : 0, UT : 1, CONFIG : 'N U T, 0, 0, 0',
X = -380.630 mm, Y = 1283.780 mm, Z = 401.787 mm,
W = -180.000 deg, P = -.000 deg, R = 1.774 deg
};
P[3]{
GP1:
UF : 0, UT : 1, CONFIG : 'N U T, 0, 0, 0',
X = -530.736 mm, Y = 1086.600 mm, Z = 401.686 mm,
W = 180.000 deg, P = -.000 deg, R = 1.774 deg
};
/END
P1 is the origin of the frame, P2 points in the X direction, P3 points in the Y direction
The code stores the components of the X,Y direction vectors in a Position Register
The controller calculates the W,P,R values when the Position Register is stored into a USERFRAME
I compared the result with the THREE POINT method utility in the FRAME SETUP Menu
Is almost the same result