合并坐标系是通过变换一个已存在的坐标系来创建新坐标系。这种变换与其他两种坐标系是相同的关系。
如需要将MCS坐标系转换为CRD3,可以在数模和工件上构建相同位置的坐标系CRD1和CRD2,CRD1和CRD2的关系与MCS和CRD3的关系是相同的。
合并坐标系原理:用一个基准坐标系将两个没有联系的坐标系建立在一起。
该功能用于把该定坐标系在源坐标系中的相对位置关系,转换到目标坐标系下的相对位置关系。该功能主要用于CAD模型对齐、测量过程中移动工件等。可以实现工件,关节臂的蛙跳等功能。
注意事项:
切记:如果合并坐标系在编程时激活的是MCS,那么在执行这段合并坐标系程序时也需要激活MCS。
CRD1:根据CAD上的理论元素创建的坐标系。
CRD2:在工件上测量得到的实际坐标系,和理论坐标CRD一致。
MCS:当前坐标系需要是MCS
CRD3:是一个用CRD1到CRD2关系自动转换CADM 1的新坐标系.
操作步骤:
(1)调用机器坐标系MCS,在数模上选取相应的理论值,建立一个理论坐标系CRD1。(在数模上用快速3-2-1(或其他建立坐标系的方法)构建坐标系CRD1,然后“添加激活坐标”)
(2)调用机器坐标系MCS,在相同位置上实测对应的元素,建立一个实际坐标系CRD2 ;(在工件上实际构建相同位置的坐标系CRD2,然后“添加激活坐标”)
(3)调用机器坐标系MCS,在软件“ 坐标系操作区”-->合并坐标系配置-->拖放从(CRD1)到(CRD2);
(4)点击“添加激活坐标系”,再在数模上鼠标右键选择数模对齐。
合并坐标系实现对DMIS语言的支持:
产生如下的语言:
RECALL/D(MCS) 调用机器坐标系
DMESW/COMAND,'D(CRD3) = LOCATE/MERGE,D(MCS),D(CRD1),D(CRD2)'
$$ Set.CAD2PCS.CADM_1 模型对齐语句自动记录
DMISMN/'Created by [深圳力合精密装备科技有限公司-090118] on 星期六, 七月 14, 2018', 4.0
UNITS/MM, ANGDEC, MMPS
WKPLAN/XYPLAN
PRCOMP/ON
TECOMP/ON
FLY/1.000000
MODE/PROG, MAN
SNSET/APPRCH, 3.000000
SNSET/RETRCT, 3.000000
SNSET/DEPTH, 0.000000
SNSET/SEARCH, 10.000000
SNSET/CLRSRF, 30.000000
RECALL/D(MCS)
SNSLCT/S(ROOTSN1)
GEOALG/BF, LSTSQR
GEOALG/ANGLB, DEFALT
GEOALG/CIRCLE, LSTSQR
GEOALG/ARC, LSTSQR
GEOALG/PLANE, LSTSQR
$$
$$
MODE/MAN
F(PLN1)=FEAT/PLANE,CART,31.250000,46.787796,35.000000,0.000000,0.000000,1.000000
F(PLN2)=FEAT/PLANE,CART,62.500000,0.000000,8.750000,-0.000000,-1.000000,-0.000000
F(PLN3)=FEAT/PLANE,CART,0.000000,62.507601,8.766211,-1.000000,-0.000000,-0.000000
D(CRD1) = DATSET/F(PLN1), ZDIR, ZORIG, F(PLN2), -YDIR, YORIG, F(PLN3), XORIG
D(CRD1) = TRANS/ZORIG, -0, YORIG, -0, XORIG, -0
RECALL/D(MCS)
MODE/MAN
F(PLN4)=FEAT/PLANE,CART,54.300950,41.842865,35.000000,0.000000,0.000000,1.000000
$$ Measurement points are created through actual points
MEAS/PLANE, F(PLN4), 4
PTMEAS/CART, 10.116560, 79.408554, 35.000000, 0.000000, 0.000000, 1.000000
PTMEAS/CART, 5.424369, 24.959614, 35.000000, 0.000000, 0.000000, 1.000000
PTMEAS/CART, 79.022545, 16.783190, 35.000000, 0.000000, 0.000000, 1.000000
PTMEAS/CART, 122.640327, 46.220100, 35.000000, 0.000000, 0.000000, 1.000000
ENDMES
F(PLN5)=FEAT/PLANE,CART,25.802968,0.000000,11.609228,-0.000000,-1.000000,-0.000000
$$ Measurement points are created through actual points
MEAS/PLANE, F(PLN5), 4
PTMEAS/CART, 5.013587, -0.000000, 17.188761, -0.000000, -1.000000, -0.000000
PTMEAS/CART, 4.759843, 0.000000, 8.118085, -0.000000, -1.000000, -0.000000
PTMEAS/CART, 44.133980, 0.000000, 6.459020, -0.000000, -1.000000, -0.000000
PTMEAS/CART, 49.304462, -0.000000, 14.671045, -0.000000, -1.000000, -0.000000
ENDMES
F(PLN6)=FEAT/PLANE,CART,0.000000,43.275065,27.328765,-1.000000,-0.000000,-0.000000
$$ Measurement points are created through actual points
MEAS/PLANE, F(PLN6), 4
PTMEAS/CART, 0.000000, 15.849735, 32.662212, -1.000000, -0.000000, -0.000000
PTMEAS/CART, 0.000000, 19.454422, 24.489674, -1.000000, -0.000000, -0.000000
PTMEAS/CART, 0.000000, 61.559410, 21.136663, -1.000000, -0.000000, -0.000000
PTMEAS/CART, 0.000000, 76.236694, 31.026512, -1.000000, -0.000000, -0.000000
ENDMES
D(CRD2) = DATSET/FA(PLN4), ZDIR, ZORIG, FA(PLN5), -YDIR, YORIG, FA(PLN6), XORIG
D(CRD2) = TRANS/ZORIG, -0, YORIG, -0, XORIG, -0
RECALL/D(MCS)
DMESW/COMAND,'D(CRD3) = LOCATE/MERGE,D(MCS),D(CRD1),D(CRD2)'
$$ Set.CAD2PCS.CADM_1
$$ Set.CADViewCenter.CADM_1
MODE/PROG,MAN
$$ MACRO: EASI_CLEARPLN_GOTO
$$ FUNCTION: CLEARANCE SURFACE IMPLEMENTATION
$$ Move machine CLEAR SURFACE DIST above the current clear surface
$$ plane and then move machine parallel to the clear surface plane
$$ ALL Macro parameters are in PCS and Current UNITS
$$ Last update: 3-1-04 Add mode checking. only works in PROG MODE
$$ Last update: 8-24-04 Clear position is based on the surface of
$$
$$ This sample DMIS Macro is provided by External-Array Software, Inc.
$$ It should be modified for your own use. There is no guarantee for
$$ the quality of this Macro. November, 2003
M(EASI_CLEARPLN_GOTO) = MACRO/ISNOM, TARX, TARY, TARZ
DECL/LOCAL, REAL, CCX, CCY, CCZ, CCI, CCJ, CCK
DECL/LOCAL, REAL, CURX, CURY, CURZ, TD, CLRDIST, SDIAM
DECL/LOCAL, CHAR, 255, CLRLABEL, FLABEL, MMODE, SNAME
MMODE = VALUE/MODE
CLRLABEL = VALUE/SNSET, CLRSRF
IF/ ( (LEN(CLRLABEL) .GT. 0) .AND. (MMODE .EQ. 'PROG,MAN') )
CLRDIST = VALUE/SNSET, CLRSRF, DIST
FLABEL = ASSIGN/'FA'
IF/ ISNOM .EQ. 0
FLABEL = ASSIGN/'F'
ENDIF
CCX = OBTAIN/FLABEL(@CLRLABEL), 3
CCY = OBTAIN/FLABEL(@CLRLABEL), 4
CCZ = OBTAIN/FLABEL(@CLRLABEL), 5
CCI = OBTAIN/FLABEL(@CLRLABEL), 6
CCJ = OBTAIN/FLABEL(@CLRLABEL), 7
CCK = OBTAIN/FLABEL(@CLRLABEL), 8
SNAME = VALUE/SNSLCT
SDIAM = OBTAIN/SS(SNAME), 8
CCX = ASSIGN/CCX + CCI * SDIAM/2
CCY = ASSIGN/CCY + CCJ * SDIAM/2
CCZ = ASSIGN/CCZ + CCK * SDIAM/2
CURX = VALUE/GOTOM, XAXIS
CURY = VALUE/GOTOM, YAXIS
CURZ = VALUE/GOTOM, ZAXIS
TD = ASSIGN/(CURX - CCX) * CCI + (CURY - CCY) * CCJ + (CURZ - CCZ) * CCK
IF/ TD .LT. CLRDIST
TD = ASSIGN/(CLRDIST - TD)
GOTO/CURX+CCI*TD, CURY+CCJ*TD, CURZ+CCK*TD
ENDIF
TD = ASSIGN/(TARX - CCX) * CCI + (TARY - CCY) * CCJ + (TARZ - CCZ) * CCK
IF/ TD .LT. CLRDIST
TD = ASSIGN/(CLRDIST - TD)
GOTO/TARX+CCI*TD, TARY+CCJ*TD, TARZ+CCK*TD
ENDIF
ENDIF
ENDMAC
SNSET/APPRCH, 2
SNSET/RETRCT, 2
SNSET/DEPTH, 0.0000
SNSET/SEARCH, 10.0000
SNSET/CLRSRF, F(PLN1), 30.0000
F(CIR1)=FEAT/CIRCLE,INNER,CART,8.000000,55.000000,33.000000,0.000000,0.000000,1.000000, 10.000000
F(CIR2)=FEAT/CIRCLE,INNER,CART,24.000000,82.712813,33.000000,-0.000000,-0.000000,1.000000, 10.000000
F(CIR3)=FEAT/CIRCLE,INNER,CART,56.000000,82.712813,33.000000,0.000000,0.000000,1.000000, 10.000000
F(CIR4)=FEAT/CIRCLE,INNER,CART,72.000000,55.000000,33.000000,0.000000,0.000000,1.000000, 10.000000
F(CIR5)=FEAT/CIRCLE,INNER,CART,56.000000,27.287187,33.000000,-0.000000,-0.000000,1.000000, 10.000000
F(CIR6)=FEAT/CIRCLE,INNER,CART,24.000000,27.287187,33.000000,-0.000000,0.000000,1.000000, 10.000000
$$ Measurement points are created through nominal points
$$ CALL/M(EASI_CLEARPLN_GOTO), 0, 7.476430, 55.855497, 66.997004
MEAS/CIRCLE, F(CIR1), 4
GOTO/CART, 7.476430, 55.855497, 66.997004
PTMEAS/CART, 5.389969, 59.264708, 33.000000, 0.522006, -0.852942, 0.000000
PTMEAS/CART, 3.735292, 52.389969, 33.000000, 0.852942, 0.522006, -0.000000
PTMEAS/CART, 10.610031, 50.735292, 33.000000, -0.522006, 0.852942, -0.000000
PTMEAS/CART, 12.264708, 57.610031, 33.000000, -0.852942, -0.522006, 0.000000
GOTO/CART, 8.855497, 55.523570, 66.997004
ENDMES
$$ Measurement points are created through nominal points
$$ CALL/M(EASI_CLEARPLN_GOTO), 0, 23.021120, 82.494192, 66.997004
MEAS/CIRCLE, F(CIR2), 4
GOTO/CART, 23.021120, 82.494192, 66.997004
PTMEAS/CART, 19.120220, 81.622975, 33.000000, 0.975956, 0.217968, 0.000000
PTMEAS/CART, 25.089838, 77.833033, 33.000000, -0.217968, 0.975956, 0.000000
PTMEAS/CART, 28.879780, 83.802651, 33.000000, -0.975956, -0.217968, -0.000000
PTMEAS/CART, 22.910162, 87.592593, 33.000000, 0.217968, -0.975956, -0.000000
GOTO/CART, 23.781379, 83.691693, 66.997004
ENDMES
$$ Measurement points are created through nominal points
$$ CALL/M(EASI_CLEARPLN_GOTO), 0, 55.002610, 82.606919, 66.997004
MEAS/CIRCLE, F(CIR3), 4
GOTO/CART, 55.002610, 82.606919, 66.997004
PTMEAS/CART, 51.027945, 82.184924, 33.000000, 0.994411, 0.105578, 0.000000
PTMEAS/CART, 56.527889, 77.740758, 33.000000, -0.105578, 0.994411, 0.000000
PTMEAS/CART, 60.972055, 83.240701, 33.000000, -0.994411, -0.105578, 0.000000
PTMEAS/CART, 55.472111, 87.684868, 33.000000, 0.105578, -0.994411, 0.000000
GOTO/CART, 55.894106, 83.710203, 66.997004
ENDMES
$$ Measurement points are created through nominal points
$$ CALL/M(EASI_CLEARPLN_GOTO), 0, 71.033107, 55.266681, 66.997004
MEAS/CIRCLE, F(CIR4), 4
GOTO/CART, 71.033107, 55.266681, 66.997004
PTMEAS/CART, 67.179975, 56.329421, 33.000000, 0.964005, -0.265884, 0.000000
PTMEAS/CART, 70.670579, 50.179975, 33.000000, 0.265884, 0.964005, -0.000000
PTMEAS/CART, 76.820025, 53.670579, 33.000000, -0.964005, 0.265884, -0.000000
PTMEAS/CART, 73.329421, 59.820025, 33.000000, -0.265884, -0.964005, 0.000000
GOTO/CART, 72.266681, 55.966893, 66.997004
ENDMES
$$ Measurement points are created through nominal points
$$ CALL/M(EASI_CLEARPLN_GOTO), 0, 55.217743, 27.914941, 66.997004
MEAS/CIRCLE, F(CIR5), 4
GOTO/CART, 55.217743, 27.914941, 66.997004
PTMEAS/CART, 52.100398, 30.416580, 33.000000, 0.779920, -0.625879, -0.000000
PTMEAS/CART, 52.870607, 23.387585, 33.000000, 0.625879, 0.779920, 0.000000
PTMEAS/CART, 59.899602, 24.157794, 33.000000, -0.779920, 0.625879, 0.000000
PTMEAS/CART, 59.129393, 31.186789, 33.000000, -0.625879, -0.779920, -0.000000
GOTO/CART, 56.627754, 28.069444, 66.997004
ENDMES
$$ Measurement points are created through nominal points
$$ CALL/M(EASI_CLEARPLN_GOTO), 0, 23.488802, 28.150134, 66.997004
$$
MEAS/CIRCLE, F(CIR6), 4
GOTO/CART, 23.488802, 28.150134, 66.997004
PTMEAS/CART, 21.451646, 31.589034, 33.000000, 0.509671, -0.860369, 0.000000
PTMEAS/CART, 19.698153, 24.738833, 33.000000, 0.860369, 0.509671, 0.000000
PTMEAS/CART, 26.548354, 22.985340, 33.000000, -0.509671, 0.860369, -0.000000
PTMEAS/CART, 28.301847, 29.835541, 33.000000, -0.860369, -0.509671, -0.000000
GOTO/CART, 24.862947, 27.798385, 66.997004
ENDMES