发布于 2009-11-19 15:24:36
1楼
CYCLE996 workpiece: Measure kinematics
Programming example
%_N_HEAD_BC_MPF
;$PATH=/_N_WKS_DIR/_N_ HEAD_BC_WPD
;Measure kinematics
;Starting positions for HEAD_BC (swivel head)
;Calibration ball D = 25mm
;P1...P3 rotary axis 1
;P4...P6 rotary axis 2
;P1,P4 kinematics initial state
DEF REAL _P1[5]=SET(27.5,-184.5,22.5,0,0)
DEF REAL _P2[5]=SET(83,-108,22.5,45,0)
DEF REAL _P3[5]=SET(-65,-200,22.5,-45,0)
DEF REAL _P4[5]=SET(27.5,-184.5,22.5,0,0)
DEF REAL _P5[5]=SET(124,-184.5,-17,0,45)
DEF REAL _P6[5]=SET(-68.8,-184.5,-17,0,-
45)
;P1 xyz 1.RA 2.RA
;P2 xyz 1.RA 2.RA
;P3 xyz 1.RA 2.RA
;P4 xyz 1.RA 2.RA
;P5 xyz 1.RA 2.RA
;P6 xyz 1.RA 2.RA
T99 D1
G500
CYCLE800()
TRAFOOF
;3D probe
IF (NOT $P_SEARCH)
_OVR[40]=0
ENDIF
;If no block search
;reset measurement counter to zero
;--------------------- 1st measurement of rotary axis 1
G0 Z100
BB=_P1[3] CC=_P1[4]
X=_P1[0] Y=_P1[1] Z=_P1[2]
;Safely retract axis Z
;kinematics initial state
_MVAR=10010091 _TNUM=1 _SETVAL=25.000 _FA=3.000 _TSA=6.000 _VMS=500.000 _PRNUM=1
_SETV[3]=0.000 _SETV[4]=0.000
CYCLE996
M0
;--------------------- 2nd measurement of rotary axis 1
G0 Z100
BB=_P2[3] CC=_P2[4]
X=_P2[0] Y=_P2[1] Z=_P2[2]
_MVAR=10092 _TNUM=1 _SETVAL=25.000 _FA=3.000 _TSA=6.000 _VMS=500.000 _PRNUM=1
_SETV[3]=0.000 _SETV[4]=0.000
CYCLE996
M0
;--------------------- 3rd measurement of rotary axis 1
G0 Z100
BB=_P3[3] CC=_P3[4]
X=_P3[0]
Y=_P3[1] Z=_P3[2]
_MVAR=10093 _TNUM=1 _SETVAL=25.000 _FA=3.000 _TSA=6.000 _VMS=500.000 _PRNUM=1
_SETV[3]=0.000 _SETV[4]=0.000
CYCLE996
M0
;======================= 1st measurement of rotary axis 2
G0 Z100
BB=_P4[3] CC=_P4[4]
X=_P4[0]
Y=_P4[1] Z=_P4[2]
_MVAR=20091 _TNUM=1 _SETVAL=25.000 _FA=3.000 _TSA=6.000 _VMS=500.000 _PRNUM=1
_SETV[3]=0.000 _SETV[4]=0.000
CYCLE996
M0
;--------------------- 2nd measurement of rotary axis 2
G0 Z100
BB=_P5[3] CC=_P5[4]
X=_P5[0]
Y=_P5[1] Z=_P5[2]
_MVAR=20092 _TNUM=1 _SETVAL=25.000 _FA=3.000 _TSA=6.000 _VMS=500.000 _PRNUM=1
_SETV[3]=0.000 _SETV[4]=0.000
CYCLE996
M0
;--------------------- 3rd measurement of rotary axis 2
G0 Z100
BB=_P6[3] CC=_P6[4]
X=_P6[0]
Y=_P6[1] Z=_P6[2]
_MVAR=20093 _TNUM=1 _SETVAL=25.000 _FA=3.000 _TSA=6.000 _VMS=500.000 _PRNUM=1
_SETV[3]=0.000 _SETV[4]=0.000
CYCLE996
M0
;-------------------- Calculate kinematics; no normalizing
_MVAR=20001194 _TNUM=1 _SETV[5]=0.000 _SETV[6]=0.000 _SETV[7]=100.000000
_SETV[8]=10.000000
CYCLE996
MSG("Kinematics measurement, 1st rotary
axis OK")
M0
M02