Hi All,
I have a Kuka KR4, with a compact controller that I am trying to do some basic programming on. I'm fairly new to this, so this may be a basic question for all, so apologies if that is the case
I want to redo a movement in multiple locations and not sure the best way to set this up. Think of it like I have a group of movements that traces out the letter "W". I want to do this multiple times in the workspace with a new start point for each "W".
At present I have defined the movement in the Base coordinate system, but not sure how to make it such that I can repeat the movement path with a new starting point (without doing each "W" as a new set of point).
I'm sure there is an easy way, but I am not sure where to start searching to do this. Any pointers would be much appreciated
How to Repeat a group of movements
-
Joe27 -
February 22, 2021 at 1:26 AM -
Thread is Unresolved
-
-
there are different ways to go about it:
1. recalculate positions
2. offset base
3. use relative motions
-
An array of points:
Code
Display MoreDECL FRAME Array[5] Array[1] = {X 0,Y 0,Z 0,A 0,B 0,C 0} Array[2] = {X 100,Y 0,Z 0,A 0,B 0,C 0} Array[3] = {X 100,Y 100,Z 0,A 0,B 0,C 0} Array[4] = {X 0,Y 100,Z 0,A 0,B 0,C 0} Array[5] = {X 0,Y 0,Z 0,A 0,B 0,C 0} DECL INT Index FOR Index = 1 TO 5 LIN Array[Index] ENDFOR
To do the same with Base offsets:
CodeDECL E6POS MyPoint MyPoint = $POS_ACT_MES ; set to current physical position FOR Index = 1 TO 5 $BASE = BASE_DATA[1] : Array[Index] ; active base is BASE_DATA[1] plus the offset LIN MyPoint ENDFOR
Point Offsets:
-
Thanks all - from a little more searching, I found a similar example here using the base offset:
So I adapted that code for my application, and it seems to be working - now I just need to adapt it to add the real code/offsets etc
Thanks so much for the help
Code
Display More&ACCESS RVP &REL 2 DEF DB_BC_FOLD_TEST_base_off() DECL INT X,Y; variable used for loop counter DECL INT X_Max, Y_Max ; variables that specify number of repetitions DECL REAL dX, dY ; offsets DECL FRAME Ofs ; this is the base offset dX = 0 ; X-offset dY = -3; Y-offset X_Max = 1; one row Y_Max = 2 ; four columns Ofs=$nullframe ;Base 3 is the original values for the Fold Base ;Base 2 is the one that is offset and moved each time BASE_DATA[2] = BASE_DATA[3]; ReSet Base 2 (from 3) incase the program was interrupted FOR X=1 to X_Max FOR Y=1 to Y_Max Ofs.X = (X-1)*dX Ofs.Y = (Y-1)*dY BASE_DATA[2] = BASE_DATA[2]:Ofs ; Offset Base[2] DB_test01(); Deburring program (for 1 channel) ENDFOR ENDFOR BASE_DATA[2] = BASE_DATA[3]; Reset Base 2 to the original values END