Programma per Creare l'origine del braccio slave in configurazione Dual Arm

Da ArcoWiki.

Description

This program is used to establish a new origin in a dual arm configuration.
The CMM shall be already aligned with the common reference system.
The program runs in CNC mode, it is necessary to assign the variables to define the probe name and the safety distance in Y.
This program runs together with the relative Arm1 (Server) program which shall be executed prior the execution of the Arm2 (Client) program.

Variables to be Assigned

In order to have the program run it is necessary to assign the following variables:

PROBE_NAME=ASSIGN/'P1_0_0P0_0' Name of the probe
SAFEY=ASSIGN/200 Safety Distance from the sphere

Program

MODE/PROG,MAN

DELETE/F(SPHERE_ORIG)
USE/F(SPHERE_ORIG)

DECL/DOUBLE,XX,YY,ZZ,SAFEY
DECL/CHAR,100,PROBE_NAME

PROBE_NAME=ASSIGN/'P2_0_0P0_0'
SAFEY=ASSIGN/200

SNSLCT/SA(@PROBE_NAME)

XX=OBTAIN/F(SPHERE_ORIG),4
YY=OBTAIN/F(SPHERE_ORIG),5
ZZ=OBTAIN/F(SPHERE_ORIG),6


SNSET/APPRCH,5.0000
SNSET/RETRCT,5.0000
SNSET/SEARCH,10.0000

GOTO/xx,yy+safey,zz
F(SPHERE_ARM2)=FEAT/SPHERE,OUTER,CART,XX,YY,ZZ,25.4,0.00000000,0.00000000,1.00000000
MEAS/SPHERE,F(SPHERE_ARM2),5
ENDMES
GOTO/xx,yy+safey,zz

V(TEXT)=VFORM/ALL
DISPLY/STOR,V(TEXT)
T(3D)=TOL/DISTB,NOMINL,0.0000,-0.0200,0.0200,PT2PT
T(DX)=TOL/DISTB,NOMINL,0.0000,-0.0200,0.0200,XAXIS
T(DY)=TOL/DISTB,NOMINL,0.0000,-0.0200,0.0200,YAXIS
T(DZ)=TOL/DISTB,NOMINL,0.0000,-0.0200,0.0200,ZAXIS


OUTPUT/FA(SPHERE_ORIG),FA(SPHERE_ARM2),TA(3D)
OUTPUT/FA(SPHERE_ORIG),FA(SPHERE_ARM2),TA(DX)
OUTPUT/FA(SPHERE_ORIG),FA(SPHERE_ARM2),TA(DY)
OUTPUT/FA(SPHERE_ORIG),FA(SPHERE_ARM2),TA(DZ)

DECL/DOUBLE,XDEV,YDEV,ZDEV,3DDEV
XDEV=OBTAIN/TA(DX),3
YDEV=OBTAIN/TA(DY),3
ZDEV=OBTAIN/TA(DZ),3
3DDEV=OBTAIN/TA(3D),3

DISPLY/OFF

DECL/CHAR,100,txt
txt=ASSIGN/CONCAT('The deviation on the origin is:',CHR(10),'X: ',STR(XDEV),CHR(10),'Y: ',STR(YDEV),CHR(10),'Z ',STR(ZDEV),CHR(10),'3D: ',STR(3DDEV),CHR(10),CHR(10),'DO YOU WANT TO APPLY THE CORRECTION? (1-YES 0-NO)'

TEXT/QUERY,(AN_QUERY),40,N,L,TXT
IF/(AN_QUERY.EQ.1)
D(ORIG_ARM2) = TRANS/XORIG,FA(SPHERE_ARM2),YORIG,FA(SPHERE_ARM2),ZORIG,FA(SPHERE_ARM2)
D(ORIG_ARM2) = TRANS/XORIG,-XX,YORIG,-YY,ZORIG,-ZZ
SETMACREF/TRANS,D(ORIG_ARM2)
ENDIF

RECALL/D(MAC)

ENDFIL