Hello,
Can someone help for how to offset a tool?
KRC1 V4.1.4
Hello,
Can someone help for how to offset a tool?
KRC1 V4.1.4
You have to elaborate it more. What exactly you mean to say?
I'll change my tool and not to have to relearn all my trajectory, I will wish to put offset in my current tool
There are many ways to do it. One way is to calibrate the tool or using numeric inputs to a fixed value if you have dimensional details of your tool.
You can also offset the tool by writing the code in your program like:
If let say you are using TOOL[10] in the motion point then:
TOOL_DATA[10]=DEFAULT_VALUE+OFFSET
where: DEFAULT_VALUE (REAL) is the calibrated value of the tool or by numeric input (dimensional details known)
OFFSET (REAL) is the offset value which you want to use to offset the tool.
Then you need to assign TOOL[10] in the motion points which you will program.
how is your tool offset? relative to flange? relative to tool direction/orientation?
decl frame ofs
ofs=$nullframe
ofs.x=20
then try
tool_data[11]=ofs:tool_data[10]
or
tool_data[11]=tool_data[10]:ofs
Thanks....I make that
TOOL_DATA[10]=DEFAULT_VALUE+OFFSET
And it's ok
Other question please...
How to make offset point relative to a base?
I tray this, but it's not working,robot move only at the same point (depose boite)
;FOLD LIN {X 0,Y 0,Z -950,A 0,B 0,C 0}:Depose_Boite CONT Vel= 0.05 m/s CPDAT7 Tool[1]:Pince Base[10]:Offset ;%{PE}%R 4.1.7,%MKUKATPBASIS,%CMOVE,%VLIN,%P 1:LIN, 2:Depose_Boite, 3:C_DIS, 5:0.05, 7:CPDAT7
$BWDSTART = FALSE
LDAT_ACT=LCPDAT7
BAS(#CP_DAT)
FDAT_ACT=FDepose_Boite
BAS(#FRAMES)
BAS(#VEL_CP,0.05)
LIN XDepose_Boite C_DIS
;ENDFOLD
I think you are doing a mistake. You can always offset the TOOL or BASE whichever you want but in the motion command (Inline Form), you have to assign the offseted value. This will allow TCP to take assigned position relative to base.
I would say again to explain your problem as it seems very confusing up to now or post your complete code or archive.
Thanks
I have a final point who is "depose_boite"
before i want a another point who is -950mm in Z direction of base 10 relative to "depose_boite"
I have a final point who is "depose_boite"before i want a another point who is -950mm in Z direction of base 10 relative to "depose_boite"
I have a function that you can use
;move PTP -950 above "depose_boite" relative to base
PTP pos_relb(depose_boite,0,0,-950,0,0,0)
; move to p but offset by x, y, Z ,a,b and c relative base
GLOBAL DEFFCT POS pos_relb(pos:IN,x:IN,y:IN,z:IN,a:IN,b:IN,c:IN)
POS pos,p1
real x,y,z,a,b,c
p1=pos
p1.X=p1.X+x
p1.Y=p1.Y+y
p1.Z=p1.Z+z
p1.A=p1.A+a
p1.B=p1.B+b
p1.C=p1.C+c
return(p1)
ENDFCT
aspgbe: Your function only works in some cases, if A,B,C of the base are zero.
For the universal soution just use:
{X 0, Y 0, Z -950,A 0, B 0, C 0} : depose_boite
or the function:
Ok thanks,
I have a other question
I have a palletizing application .... I created this
&ACCESS RVO1
&REL 5
&PARAM TEMPLATE = C:\KRC\Roboter\Template\vorgabe
&PARAM EDITMASK = *
DEF roller_5( )
;FOLD INI;%{PE}%V3.2.0,%MKUKATPBASIS,%CINIT,%VCOMMON,%P
;FOLD BAS INI;%{E}%V3.2.0,%MKUKATPBASIS,%CINIT,%VINIT,%P
GLOBAL INTERRUPT DECL 3 WHEN $STOPMESS==TRUE DO IR_STOPM ( )
INTERRUPT ON 3
BAS (#INITMOV,0 )
;ENDFOLD (BAS INI)
;FOLD A20 INI;%{E}%V3.2.0,%MKUKATPA20,%CINIT,%VINIT,%P
IF ARC20==TRUE THEN
A20 (ARC_INI)
INTERRUPT DECL 6 WHEN $CYCFLAG[3]==FALSE DO A20(TECH_STOP2)
ENDIF
;ENDFOLD (A20 INI)
;FOLD A10 INI;%{E}%V3.2.0,%MKUKATPARC,%CINIT,%VINIT,%P
IF A10_OPTION==#ACTIVE THEN
INTERRUPT DECL 4 WHEN $CYCFLAG[2]==FALSE DO A10 (#APPL_ERROR)
INTERRUPT DECL 7 WHEN A_ARC_SWI==#ACTIVE DO A10 (#ARC_SEAM)
INTERRUPT DECL 5 WHEN A_FLY_ARC==TRUE DO A10 (#HPU_ARC)
INTERRUPT ON 5
A10_INI ( )
ENDIF
;ENDFOLD (A10 INI)
;FOLD GRIPPER INI;%{E}%V3.2.0,%MKUKATPGRIPPER,%CINIT,%VINIT,%P
USER_GRP(0,DUMMY,DUMMY,GDEFAULT)
;ENDFOLD (GRIPPER INI)
;FOLD SPOT INI;%{E}%V3.2.0,%MKUKATPSPOT,%CINIT,%VINIT,%P
USERSPOT(#INIT)
;ENDFOLD (SPOT INI)
;FOLD TOUCHSENSE INI;%{E}%V3.2.0,%MKUKATPTS,%CINIT,%VINIT,%P
IF H70_OPTION THEN
INTERRUPT DECL 15 WHEN $MEAS_PULSE[TOUCH_I[TOUCH_ACTIVE].IN_NR] DO H70 (6,CD0 )
INTERRUPT DECL 16 WHEN $ZERO_MOVE DO H70 (7,CD0 )
INTERRUPT DECL 17 WHEN $TECHPAR_C[FG_TOUCH,8]>0.5 DO H70 (8,CD0)
H70 (1,CD0 )
ENDIF
;ENDFOLD (TOUCHSENSE INI)
;FOLD USER INI;%{E}%V3.2.0,%MKUKATPUSER,%CINIT,%VINIT,%P
;Make your modifications here
;ENDFOLD (USER INI)
;ENDFOLD (INI)
;FOLD INITIALISATION VARIABLES
;INITIALISATION VARIABLES
RENTRE_RETAQUAGE=TRUE
OUVERTURE_PINCE=TRUE
HL_ROLLERS_PLEIN= FALSE
HL_DEM_ACCES= FALSE
HL_FIN_CAMPAGNE= FALSE
DEM_ACCES = FALSE
FIN_CAMPAGNE = FALSE
NB_RANGEE = 0
NB_COLONNE = 0
NUM_DEF=0
DECL E6POS Depose_Boite = {X 100, Y 75.25, Z 100, A 0,B 0,C 0}
;ENDFOLD
;ENDFOLD
;********************
;*DEBUT DU PROGRAMME*
;********************
$timer[1]=0
$timer_stop[1]=FALSE
WAIT FOR (SQ2_PINCE_OUVERTE OR ($timer[1]>2000))
WHILE NOT SQ2_PINCE_OUVERTE
IF NOT SQ2_PINCE_OUVERTE THEN
NUM_DEF=2
msg_defaut ( )
HALT
NUM_DEF=0
ENDIF
ENDWHILE
$timer_stop[1]=TRUE
;FOLD PTP HOME Vel= 30 % DEFAULT;%{PE}%R 4.1.7,%MKUKATPBASIS,%CMOVE,%VPTP,%P 1:PTP, 2:HOME, 3:, 5:30, 7:DEFAULT
$BWDSTART = FALSE
PDAT_ACT=PDEFAULT
BAS(#PTP_DAT)
FDAT_ACT=FHOME
BAS(#FRAMES)
BAS(#VEL_PTP,30)
$H_POS=XHOME
PTP XHOME
;ENDFOLD
REPEAT
;*******************************
prise_boite() ;* Appel programme prise_boite *
;*******************************
;FOLD PTP HOME Vel= 30 % DEFAULT;%{PE}%R 4.1.7,%MKUKATPBASIS,%CMOVE,%VPTP,%P 1:PTP, 2:HOME, 3:, 5:30, 7:DEFAULT
$BWDSTART = FALSE
PDAT_ACT=PDEFAULT
BAS(#PTP_DAT)
FDAT_ACT=FHOME
BAS(#FRAMES)
BAS(#VEL_PTP,30)
$H_POS=XHOME
PTP XHOME
;ENDFOLD
IF DEM_ACCES==TRUE THEN
HL_DEM_ACCES=TRUE
HALT
HL_DEM_ACCES=FALSE
DEM_ACCES=FALSE
ENDIF
;FOLD PTP App_1_Depose_Boite Vel= 30 % DEFAULT Tool[1]:Pince Base[1]:Prise boite;%{PE}%R 4.1.7,%MKUKATPBASIS,%CMOVE,%VPTP,%P 1:PTP, 2:App_1_Depose_Boite, 3:, 5:30, 7:DEFAULT
$BWDSTART = FALSE
PDAT_ACT=PDEFAULT
BAS(#PTP_DAT)
FDAT_ACT=FApp_1_Depose_Boite
BAS(#FRAMES)
BAS(#VEL_PTP,30)
PTP XApp_1_Depose_Boite
;ENDFOLD
;FOLD MACRO PALETTISATION
;MACRO PALETTISATION
FOR NB_COLONNE = 0 TO 1
FOR NB_RANGEE = 0 TO 4
NextPos = Depose_Boite
NextPos.X = NextPos.X + (NB_COLONNE* OFFSET_X)
NextPos.Z = NextPos.Z + (NB_RANGEE * OFFSET_Z)
App_2_Depose_Boite = NextPos
App_2_Depose_Boite.Z = App_2_Depose_Boite.Z -40
App_2_Depose_Boite.X = App_2_Depose_Boite.X -40
App_3_Depose_Boite = NextPos
App_3_Depose_Boite.Z = App_3_Depose_Boite.Z -40
Deg_1__Depose_Boite = NextPos
Deg_1_Depose_Boite.Y = Deg_1_Depose_Boite.Y -13
Deg_2__Depose_Boite = NextPos
Deg_2_Depose_Boite.Y = Deg_2_Depose_Boite.Y -13
Deg_2_Depose_Boite.Z = Deg_2_Depose_Boite.Z -25
LIN App_2_Depose_Boite
LIN App_3_Depose_Boite
LIN NextPos
;FOLD WAIT Time= 0.5 sec;%{PE}%R 4.1.7,%MKUKATPBASIS,%CWAIT,%VWAIT,%P 2:0.5
WAIT SEC 0.5
;ENDFOLD
OUVERTURE_PINCE=TRUE
$timer[1]=0
$timer_stop[1]=FALSE
WAIT FOR (SQ2_PINCE_OUVERTE OR ($timer[1]>2000))
WHILE NOT SQ2_PINCE_OUVERTE
IF NOT SQ2_PINCE_OUVERTE THEN
NUM_DEF=2
msg_defaut ( )
HALT
NUM_DEF=0
ENDIF
ENDWHILE
$timer_stop[1]=TRUE
LIN Deg_1_Depose_Boite
LIN Deg_2_Depose_Boite
ENDFOR
ENDFOR
;ENDFOLD
;ENDFOLD
;FOLD PTP App_1_Depose_Boite Vel= 30 % DEFAULT Tool[1]:Pince Base[1]:Prise boite;%{PE}%R 4.1.7,%MKUKATPBASIS,%CMOVE,%VPTP,%P 1:PTP, 2:App_1_Depose_Boite, 3:, 5:30, 7:DEFAULT
$BWDSTART = FALSE
PDAT_ACT=PDEFAULT
BAS(#PTP_DAT)
FDAT_ACT=FApp_1_Depose_Boite
BAS(#FRAMES)
BAS(#VEL_PTP,30)
PTP XApp_1_Depose_Boite
;ENDFOLD
;FOLD PTP HOME Vel= 30 % DEFAULT;%{PE}%R 4.1.7,%MKUKATPBASIS,%CMOVE,%VPTP,%P 1:PTP, 2:HOME, 3:, 5:30, 7:DEFAULT
$BWDSTART = FALSE
PDAT_ACT=PDEFAULT
BAS(#PTP_DAT)
FDAT_ACT=FHOME
BAS(#FRAMES)
BAS(#VEL_PTP,30)
$H_POS=XHOME
PTP XHOME
;ENDFOLD
IF NB_COLONNE == 1 THEN
NB_RANGEE = NB_RANGEE + 1
ENDIF
IF NB_COLONNE == 0 THEN
NB_COLONNE = 1
ELSE
NB_COLONNE = 0
ENDIF
IF DEM_ACCES==TRUE THEN
HL_DEM_ACCES=TRUE
HALT
HL_DEM_ACCES=FALSE
DEM_ACCES=FALSE
ENDIF
UNTIL NB_RANGEE == 5
;****************************************
;*Fin de programme si 5 rangees empilees*
;****************************************
END
Display More
firstly , that it seems you okay ?
And, secondly,i wish I could learn my original point ( Depose_Boite) in my program with touch "mod_pos"
no, that is not ok...
you can declare and initialize variable in same line in DAT file but not in SRC file.
declaration must be before INI, initialization must be in or after INI
then one wonders about tool and base not set before using KRL motions.
to teach point you need inline form (or ExpertTech). if using inline form, your point variable will get prefix 'x' and will get declared in DAT file.
this is needed if you want data to be retained.
etc.
I also need help with tool offsets.
Currently I am using a KR10 (KRC4) to pack objects into a box. I have 5 points to move into and place objects into the box.
PTP P1 CONT VEL=25% TOOL[2] BASE[0]
PTP P2 CONT VEL=25% TOOL[2] BASE[0]
PTP P3 CONT VEL=25% TOOL[2] BASE[0]
PTP P4 CONT VEL=25% TOOL[2] BASE[0]
PTP P5 CONT VEL=25% TOOL[2] BASE[3]
Base 3 is a Z offset to pack objects in layers for each iteration
I want to use Tool 2 to offset the rotation of axis 6
Essentially I want to place one object at A6 = 0 degrees for every point, then A6 = 90 degrees for every point. Back and forth until the box is full.
Currently I have:
Tool_Ofs = $NULLFRAME
Tool_Ofs.A = -90
IF TestEvenOrOdd(Layer) THEN
TOOL_DATA[2] = TOOL_DATA[1]:Tool_Ofs
ENDIF
Where tool 1 is the actual tool data. But this does not work. Is there a way to accomplish this?
That will only work if the TCP of TOOL_DATA[1] is colinear with A6 (that is, TOOL_DATA[1].X, .Y, .B, .C all =0). And even then, it would only work if your boxes were square, not rectangular.
If you want to rotate boxes in your palletizing pattern, you have to not only account for the rotation, but the XY side-effects of that rotation, and apply corrective shifts to either Base or Tool.
I see my problem. Though my tool is actually colinear with A6, its XY value is not 0 in the TOOL DATA. I went and changed these values to 0 and everything worked great! Thanks