Mitsubishi Electric MELFA CR800-D Series User Manual page 62

Industrial robot
Hide thumbs Also See for MELFA CR800-D Series:
Table of Contents

Advertisement

4 Calibration assistance function
(5) Sample program (WRKCALB.prg)
'##########################################################
'Workpiece coordinate calibration program
'##########################################################
'
Dim POFS(2)
Dim PW(4), PV(4), PVtmp(4)
'
'### Initialization processing ###
*Init
P0 = P0
' Teaching point
PVSize = PVSize
PGoal = PGoal
PW(1) = PW(1)
PW(2) = PW(2)
PW(3) = PW(3)
PW(4) = PW(4)
PAng = PAng
POFS(1) = POFS(1)
POFS(2) = POFS(2)
'
CCOM$ = "COM2:"
CPRG1$ = "WRKCALB.job"
MHndENo = 1
'Hand eye calibration number
MTLCalNo = 1
'Tool number (Distance from flange to camera center)
MCalNo = 2
'Calibration number (Image coordinates -> Workpiece coordinates)
MWrkNo = 1
' Workpiece coordinate number of registration destination
MFlng = 120
' Focal length [mm]
MGain = 1.0
'Gain value of feedback control
'
PVCenter = P_Zero
PVCenter.X = PVSize.X/2
PVCenter.Y = PVSize.Y/2
PT2V = P_Zero
Ptmp = PVSCal( MHndENo, 0, 0, 0 )
PT2V.C = Ptmp.C
'#####
Main Program
*main
PBTL = P_Tool
Mov P0
'Move to teaching point
Tool P_NTool
'Tool initialization
PC0 = P_Fbc
' Get current position
'
MFLG = 0
GoSub *SVSOPEN
GoSub *SCalcAngleScale
' Tool settings
M_Tool = MTLCalNo
PTL = P_Tool
Tool P_NTool
PCamTL.X = PTL.X
PCamTL.Y = PTL.Y
'
MPRMA = MFlng/MScale
MPRMB = MFlng/MScale
MPRMC = PVCenter.X
MPRMD = PVCenter.Y
'
PCS = PC0
GoSub *SMovCenter
Tool PCamTL
'Set camera tool
PC0 = P_Fbc
' Get current position
4-52 Workpiece coordinate calibration
' resolution (X, Y)
' End condition (Posture of vision sensor in workpiece coordinates)
'The posture of the second point used when estimating the work coordinate origin
'Open the line and set the line number
'Set vision job
' Set image center
'X
'Y
'Vision sensor mounting error
#####
'Open line of vision sensor
'Calculate camera angle / scale
' Internal parameter A
' Internal parameter B
' Internal parameter C
' Internal parameter D
' Set initial position
'Move mark to camera center

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents