KUKA電伺服機器人焊點位置補償示意圖:
GLOBALDEF Initialize (TEACH_POS : IN,cont:IN )初始化
初始化示教位置
DECLE6Pos TEACH_POS
DECL SG_Cont_T cont
CONTINUE
$ADVANCE = 3
SG_ExtaxActive=ServoGun[SG_ActiveGunNumber].ExtAxNumber
SG_ActiveWeldTimer =ServoGun[SG_ActiveGunNumber].WeldTimerIndex
bckupSetSG_AxVal()
–獲得當前點的外部軸速度加速度—逼近$APO.CPTP和提前運行$RED_VEL
SGE_InitErrorHandler()
IF(ServoGun[SG_ActiveGunNumber].ExtAxNumber>0)then
SGA_SensorReset()
ENDIF
; ------初始化點-----------
P_Part=SGL_CALC_POS(TEACH_POS, ServoGun[SG_ActiveGunNumber].TipCorrection, 0)----獲得焊接點位置
P_Approx=P_Part 位置轉移/傳輸
P_Forcelim=P_Part 位置轉移/傳輸
P_Pressure=P_Part
P_Weld=P_Part焊接位置
P_Ret=P_Part
SG_SpotHelper=P_Part
SG_PartPos = SGL_GET_AXIS_VALUE(TEACH_POS); 力模式下可能的極板接觸位置
END;
GLOBALDEFFCTE6POS SGL_CALC_POS(CURRENT_POS :IN, TipCorrection:IN, TouchDiff:IN)
TouchDiff=0 執行焊接時
CURRENT_POS = TEACH_POS
TipCorrection = ServoGun[SG_ActiveGunNumber].TipCorrection=true電極校正
SGL_CALC_START_POS
REAL TouchDiff, wearflex, wearfix, TouchOffset
E6POS CURRENT_POS,RETURNED_POS
BOOL TipCorrection
IF(TipCorrection)THEN TipCorrection=true電極校正
wearflex = SG_WearFlex[SG_ActiveGunNumber] +SG_TipSeating_mm[SG_ActiveGunNumber]
wearflex彎曲磨損量由銑削后測量出來, SG_TipSeating_mm[1]電極坐值
wearfix = SG_WearFix[SG_ActiveGunNumber] +(SG_TipSeating_mm[SG_ActiveGunNumber]/2)
wearfix磨損修復由銑削后測量出來
ELSE ---沒有使用校正
wearflex=0.0
wearfix= 0.0
ENDIF
X方向的補償改變坐標 –使用BASE坐標
SG_Helpframe=SGL_CALC_TCP_POS(TouchDiff,wearfix) ---計算位置值
RETURNED_POS=CURRENT_POS:SG_Helpframe-----補償值X方向的坐標
轉移外部軸和S,T坐標值,用來沒有激活外部軸時
RETURNED_POS.E1=CURRENT_POS.E1
RETURNED_POS.E2=CURRENT_POS.E2
RETURNED_POS.E3=CURRENT_POS.E3
RETURNED_POS.E4=CURRENT_POS.E4
RETURNED_POS.E5=CURRENT_POS.E5
RETURNED_POS.E6=CURRENT_POS.E6
RETURNED_POS.S=CURRENT_POS.S
RETURNED_POS.T=CURRENT_POS.T
TouchOffset =(wearflex+wearfix-TouchDiff)* SG_ClosingAxDir
計算偏差值
SG_ClosingAxDir=-1
TouchDiff=0 執行焊接時
Wearflex 彎曲磨損
Wearfix 電極磨損
改變補償焊接點的外部軸E1
SWITCH SG_ExtaxActive SG_ExtaxActive=1
Case 1
RETURNED_POS.E1=CURRENT_POS.E1+TouchOffset
Case 2
RETURNED_POS.E2=CURRENT_POS.E2+TouchOffset
Case 3
RETURNED_POS.E3=CURRENT_POS.E3+TouchOffset
Case 4
RETURNED_POS.E4=CURRENT_POS.E4+TouchOffset
Case 5
RETURNED_POS.E5=CURRENT_POS.E5+TouchOffset
Case 6
RETURNED_POS.E6=CURRENT_POS.E6+TouchOffset
ENDSWITCH
RETURN (RETURNED_POS) 反饋返回坐標值
ENDFCT;
GLOBALDEFFCTE6POS SGL_CALC_TCP_POS(touchDiff:IN, wearFix:IN)
計算補償值touchDiff=0, wearFix電極磨損
SGL_CALC_TCP_START_POS
REAL touchDiff, wearFix
E6POS RETURN_HELPFRAME
DECL SG_DIRECTIONTYP_T realDirectio
RETURN_HELPFRAME=$NULLFRAME坐標清0
realDirection = ServoGun[SG_ActiveGunNumber].GunDirection
GunDirection #PX --槍移動方向
IF((FDAT_ACT.IPO_FRAME == #TCP) AND SG_RevFixedGunDirection)THEN
-------------- FDAT_ACT.IPO_FRAME=#BASE 所以此IF語句暫時不執行-------
realDirection =SG_RevToolDirection(ServoGun[SG_ActiveGunNumber].GunDirection)
ENDIF
--------------end---------------------
SWITCH realDirection realDirection=#PX
CASE #NX
RETURN_HELPFRAME.X=-wearFix+touchDiff
CASE #NY
RETURN_HELPFRAME.Y=-wearFix+touchDiff
CASE #NZ
RETURN_HELPFRAME.Z=-wearFix+touchDiff
CASE #PX----------本次機器人執行的補償數據touchDiff=0
RETURN_HELPFRAME.X=wearFix-touchDiff 直接用磨損值來補償X方向
CASE #PY
RETURN_HELPFRAME.Y=wearFix-touchDiff
CASE #PZ
RETURN_HELPFRAME.Z=wearFix-touchDiff
ENDSWITCH
RETURN (RETURN_HELPFRAME)
ENDFCT
-
KUKA
+關注
關注
3文章
217瀏覽量
16574 -
伺服機器人
+關注
關注
0文章
5瀏覽量
3813
原文標題:電伺服USER程序位置補償分析
文章出處:【微信號:gh_a8b121171b08,微信公眾號:機器人及PLC自動化應用】歡迎添加關注!文章轉載請注明出處。
發布評論請先 登錄
相關推薦
評論