Skip to main content

4.6. Measuring the Amount of Deformation by Using the Sensor, and Auto-Calibrating the Tool

4.6. Measuring the Amount of Deformation by Using the Sensor, and Auto-Calibrating the Tool

 

'-- Measurement 2D without signal reflection

'-- Initial parameter setting

CALL 1020_INIT_SET

 

'-- Calculate Circle Pose

CALL 1021_CALC_C1

 

'-- Reset pending error

IF gxError=1 THEN

gyReset=1

WAIT gxError=0

gyReset=0

ENDIF

 

'-- Set Program Number 1 --

gyPrgNrBit1=1

gyPrgNrBit2=0

gyPrgNrBit3=0

gyPrgNrBit4=0

gyPrgNrBit5=0

 

'-- WAIT ready --

WAIT gxReadyForMes

 

'-- Reset tool data --

Tool[giToolNrCorr]=Tool[giToolNrOrig]

'-- Double-circle with Tool[giToolNrCorr]

S1   MOVE L,gpCirPose1,S=50%,A=0,T=giToolNrCorr        '-- Move to the starting point      --

S2   MOVE C,gpCirPose2,S=50mm/s,A=3,T=giToolNrCorr  '-- 1st quarter circle movement --

S3   MOVE C,gpCirPose3,S=50mm/s,A=3,T=giToolNrCorr  '-- 2nd quarter circle movement --

S4   MOVE C,gpCirPose4,S=50mm/s,A=3,T=giToolNrCorr  '-- 3rd quarter circle movement --

S5   MOVE C,gpCirPose1,S=50mm/s,A=3,T=giToolNrCorr  '-- 4th quarter circle movement --

S6   MOVE C,gpCirPose2,S=50mm/s,A=3,T=giToolNrCorr  '-- 1st quarter circle movement --

S7   MOVE C,gpCirPose3,S=50mm/s,A=3,T=giToolNrCorr  '-- 2nd quarter circle movement --

S8   MOVE C,gpCirPose4,S=50mm/s,A=3,T=giToolNrCorr  '-- 3rd quarter circle movement --

S9   MOVE C,gpCirPose1,S=50mm/s,A=3,T=giToolNrCorr  '-- 4th quarter circle movement --

 

'-- Execute “Get measured values and Correction”

'-- Get measurement result and Correction --

'-------------------------------------------

V100%=19 'sensor node number

'-- Set measurement movement to finished --

gyMeMovFinish=1

 

'-- Wait until the measurement result is calculated or error --

WAIT gxMesResCalc=1 OR gxError=1

 

'-- Read measured values only if gxMesResCalc == 1 --

IF gxMesResCalc=1 THEN

gdCorrX =(gxXOffsetBit - 30000)  / 100.0 '-- X-Offset --

gdCorrY =(gxYOffsetBit - 30000)  / 100.0 '-- Y-Offset --

gdCorrZ =(gxZOffsetBit - 30000)  / 100.0 '-- Z-Offset --

gdCorrRX=(gxXOriOffset - 30000) / 100.0 '-- Rotation around X --

gdCorrRY=(gxYOriOffset - 30000) / 100.0 '-- Rotation around Y --

gdCorrRZ=(gxZOriOffset - 30000) / 100.0 '-- Rotation around Y --

ENDIF

 

'-- If error gxError set correction to zero

IF gxError=1 THEN

gdCorrX =0

gdCorrY =0

gdCorrZ =0

gdCorrRX=0

gdCorrRY=0

gdCorrRZ=0

ENDIF

 

'-- Reset Measurement movement to finished

gyMeMovFinish=0

 

'-- WAIT until the calculated measurement result is reset

WAIT gxMesResCalc=0

'-- Apply correction to tool data

LP1=P*

LR1=(0,0,0,0,0,0)T

LR1.X=gdCorrX

LR1.Y=gdCorrY

LR1.Z=gdCorrZ

LR1.RX=gdCorrRX

LR1.RY=gdCorrRY

LR1.RZ=gdCorrRZ

 

S1   MOVE P,P*-LR1,S=10%,A=0,T=giToolNrCorr

LP2=P*

ATDC T=giToolNrCorr,OrgP=LP1,NewP=LP2

DELAY 0.1

END

'-- Acknowledge error during measurement --

'-- Identify and rectify error cause --

IF gxError=1 THEN

'-- Reset tool data --

Tool[giToolNrCorr]=Tool[giToolNrOrig]

gyReset=1

WAIT gxError=0

gyReset=0

ENDIF

 

'-- Reset Program Number 1 --

gyPrgNrBit1=0

gyPrgNrBit2=0

gyPrgNrBit3=0

gyPrgNrBit4=0

gyPrgNrBit5=0

END

 

Figure4.5 Measurement of the Amount of Tool Deformation, and Auto-Calibration