Im tryin to rotate my base frame around a single point. How would i write this on a KUKA. any help would be great
Rotate Base Fame
-
RobotGuy -
May 18, 2016 at 4:26 PM -
Thread is marked as Resolved.
-
-
You base data is stored in R1/System/$config.dat, in BASISTECH fold.
It will look like:
BASE_DATA[ x ]={X 0.0,Y 0.0,Z 0.0,A 0.0,B 0.0,C 0.0}to permanently rotate it around the origin you will need to modify A, B or C here depending on which axis you wish to orientate around.
To modify it during your program, it will need to be something like:
BASE_DATA[ x ]=BASE_DATA[ x].(A,B OR C)+/-(Angle of required Rotation).Don't know if this answers your question?
-
First off, what robot/controller type, and what (if any) KSS version?
Second, what point do you want to do the rotation around? Rotating any FRAME type variable around its own origin is easy. Rotating a FRAME around some arbitrary point in space... hm. Gotta think about that one. For one thing, any 6DOF "point" is a fully-characterized XYZABC -- that is, it has its own orientation, as well as position, so you want to rotate FRAME_X around POINT_Y, you have to define if the axes of rotation are FRAME_X's axes or POINT_Y's axes (since they may not be parallel).
Assuming you're doing this in KRL (as opposed to an iiWA's Java environment), rotating any FRAME variable (Bases are all of type FRAME) around any of its own axes is a simple matter of using the Geometric Operator, which is essentially a matrix cross product of two FRAMEs:
CodeDECL FRAME _fShiftFrame _fShiftFrame = {X 0,Y 0,Z 0,A 5,B -5,C 7} BASE_DATA[1] = BASE_DATA[1] : _fShiftFrame
Keeping in mind the Euler angle sequence in KRL is Z, Y', X'', this would take your BASE_DATA[1] and rotate it around its own Z axis by 5deg, then around Y by -5deg, and then around X by 7deg. As the X, Y, and Z values of _fShiftFrame are 0, no translation occurs. But the Geometric Operator requires that some valid value exist in all 6 elements of both FRAME variables, otherwise the matrices are incomplete and the cross product fails.
-
KRC4 Compact
below is my main and sub program, All i did was make a triangle now i want to rotate around Z and make it offset by 10 deg each run
DEF MainTriang( )
DECL INT cntr
DECL FRAME _fShiftFramecntr = 210
;FOLD PTP HOME Vel=100 % DEFAULT;%{PE}%R 8.3.40,%MKUKATPBASIS,%CMOVE,%VPTP,%P 1:PTP, 2:HOME, 3:, 5:100, 7:DEFAULT
$BWDSTART=FALSE
PDAT_ACT=PDEFAULT
FDAT_ACT=FHOME
BAS(#PTP_PARAMS,100)
$H_POS=XHOME
PTP XHOME
;ENDFOLDLoopStart:
_fShiftFrame = {X 0,Y 0,Z 0,A 10,B 0,C 0}
BASE_DATA[3] = BASE_DATA[3] : _fShiftFrameWHILE (TRUE)
cntr = cntr - 5
IF cntr <= 5 THENEXIT
ENDIFtriang(cntr)
ENDWHILE
;FOLD PTP HOME Vel=100 % DEFAULT;%{PE}%R 8.3.40,%MKUKATPBASIS,%CMOVE,%VPTP,%P 1:PTP, 2:HOME, 3:, 5:100, 7:DEFAULT
$BWDSTART=FALSE
PDAT_ACT=PDEFAULT
FDAT_ACT=FHOME
BAS(#PTP_PARAMS,100)
$H_POS=XHOME
PTP XHOME
;ENDFOLDEND
this is my sub program:
;FOLD LIN P0 Vel=2 m/s CPDAT0 Tool[1]:Test2 Base[3];%{PE}%R 8.3.40,%MKUKATPBASIS,%CMOVE,%VLIN,%P 1:LIN, 2:P0, 3:, 5:2, 7:CPDAT0
$BWDSTART=FALSE
LDAT_ACT=LCPDAT0
FDAT_ACT=FP0
BAS(#CP_PARAMS,2)
LIN XP0
;ENDFOLDP1Temp = $POS_ACT
P2Temp = P1Temp
P2Temp.X = P1Temp.X + lengthLIN P2Temp
P3Temp = P1Temp
P3Temp.X = P1Temp.X + (length/2)
P3Temp.Y = P1Temp.Y + sqrt((length*length)-(length/2)*(length/2))LIN P3Temp
LIN P1Temp -
You didn't mention KSS version, but for a KRC4 Compact, I can guess it's 8.2.x or 8.3.x. Fortunately, the Geo-Op works the same across KSS versions.
You have LOOPSTART: but never have a GOTO to it. And the shift of BASE_DATA[3] is above the WHILE TRUE, so it's only going to rotate once.
Also, since you have the shift before the first call, your first triangle will be rotated 10deg, rather than being at your "zero" orientation. The shift should probably be after the call to TRIANG.
Another thing: you'll probably want a way to put BASE_DATA[3] back to its original value when you're done. Otherwise, the next time you run the program, it'll start with the base already rotated 50deg, and keep on rotating. Changes to Bases are retentive.
-
I placed the frame shift and base data after the triang program. im getting an array index inadmissable. also not sure how to write the code to place it back to zero
wouldn't i have to declare a temp base frame shift
-
"Array Index Inadmissible" only happens if the you try to access an array element of 0 or less, or higher than the max range of the array. Since BASE_DATA is declared at least 16 elements in size, 3 can't be inadmissible. Check for typos. Maybe throw a WAIT FOR TRUE right after the call to TRIANG just to ensure the advance pointer isn't an issue.
For restoration, the usual approach is to create a static FRAME variable, usually with a CONST declaration so it can't be easily changed, in your DAT file, and fill it with the nominal starting values for your Base. Then, at the top of your program, before you do any shifts, you assign BASE_DATA[3] to your Const Frame, then make your shifts to Base 3 like always. Basically, the idea is to make a copy of the "original" base, then always only make your on-the-fly shifts to the copy.
For most mathematically generated programs, the more usual approach is simply to rewrite $BASE on the fly, but having an inline-form motion point inside your loop can screw with that.
-
everything I write out throws an error or im just writing it wrong.
-
Okay, post the full code.
-
hello,
I want to know how to change the coordinate system of KUKA in KRL . I mean I defined a new coordinate system on the table and I want all the movements to be relative to the table
thank you in advance -
hello,
I want to know how to change the coordinate system of KUKA in KRL . I mean I defined a new coordinate system on the table and I want all the movements to be relative to the table
thank you in advancewhat KSS?
if you are using inline form instructions, select frame parameters through instruction editor. if you are using KRL motion, write line of code that initializes $BASE
-
I'm working with KSS 8.3 and I took the XMLCallback.src (to make EthernetKRL communication)I wanted to make the KUKA move depending on the base I defined on the table. Here is what I added:
;FOLD INI
;FOLD BASISTECH INI
BAS (#INITMOV,0 )
;ENDFOLD (BASISTECH INI)
;FOLD USER INI
;FOLD STARTPOSITION - BASE IS 0, TOOL IS 1, SPEED IS 5%, POSITION IS A1 5,A2 -90,A3 100,A4 5,A5 10,A6 -5,E1 0,E2 0,E3 0,E4 0
$BWDSTART = FALSE
PDAT_ACT = {VEL 5,ACC 100,APO_DIST 50}
FDAT_ACT = {TOOL_NO 1,BASE_NO 0,IPO_FRAME #BASE}
BAS (#PTP_PARAMS,5)
PTP {A1 5,A2 -90,A3 100,A4 5,A5 10,A6 -5,E1 0,E2 0,E3 0,E4 0}
;ENDFOLD
I hope you could help me more about the instructions I write in the KRL program -
i am afraid, you wont get far like that...
it appears that you are missing some basic concepts so i strongly suggest kuka training. for example:
1. you are telling robot to go to move axes to specific position. this will always have same result regardless of used tool and base.
2. you are intending to use some base but in your program you are picking world coordinate system
3. you are hacking inline forms and adding KRL code when you really have a long way to go
4. try focusing on one thing at a time, brake task into smaller problems (EKI communication and moving in different coordinate systems are independent issues).I suggest to start with base measurement and use. what is the base number you want to use? what is the frame data for that base? do you know how to select base manually and by program?
manual selection is done from HMI, by clicking on T?/B? screen area and selecting base from pull down list. while using base coordinate systems and joging in particular direction (X for example), you should see difference when different base is selected. select tool as well and jog robot to point X 0, Y 0, Z 0. Does it match origin of your base?
selecting base N by program can be done by
N = 3 ; base number can be 1-32 by default
;....
$BASE = base_data[N]or
BAS(#BASE, N)Writing program that will take base into consideration requires:
a) specifying/measuring tool and base
b) selecting tool and base (not zeroes/nullframe or undefined)
c) using motions with cartesian coordinates (not axis specific as you have).and you will not go wrong by reading system integrator manual (and system variable manual).
-
I'm so thankful for your help. Ok now I measured my tool and base( named TABLE) and I have their names and numbers. In my program,I hope I'm understanding your explanation I will write:
BAS (#TABLE,1 )(the base name is TABLE and its number 1)
DECL FRAME TABLE
TABLE={FRAME: X 668.276,Y -43.223,Z 416.072,A 0,B 0,C 0} (this is the origin of coordinate system of the table)
and then I want to move KUKA to a point in the table that I want to have its coordinates relative to the base TABLE
Thank you so much for your help -
no....
tool and base names are just for user (robot does not care about them)
BAS.SRC is a file containing program BAS()
when calling BAS() in your programs, you can pass parameters. one of parameters is enumeration - its elements are predefined (constants starting with #). you cannot introduce random thing like #TABLE (unless you declare your own ENUMs).
when you measure base, it is saved into array BASE_DATA[]
first base is saved as BASE_DATA[1], second is BASE_DATA[2] etc.when you wish to use particular base, you need to select it. in program ou can do that by assigning base of your choice to system variable $BASE, for example, selecting base number 27 is done using either
$BASE=base_data[27] ; this is direct assignment of base
or
BAS(#BASE,27) ; this sets base through BAS.SRC and specifying parameter #BASE
-
I appreciate your explanation then after the instruction
BAS (#INITMOV,0 ) I will write BAS (#BASE,0 ) and KUKA will take this base to work with I mean if I move it to any position it will give its coordinates in that base, right ? -
another question please, when I move KUKA from KRL using cartesian coordinates there are errors in A1 and so on I think I need to change S and T how do I change those values ?
-
if the message talks about soft limit, chances are you need to use intermediate point or toggle turn bit for that axis.
if the message talks about workspace limits, and robot should be able to reach the point, check status value. -
Thank you so much everything works fine no more messages I was able to put the right S and T and know my KRL program works based to the base I defined, though the remaining issue is that the origin of the base is normally 0,0 but I get 0 for X and another value of Y . Do you have any recommandations for that please ?
and Thank you so much -
are you sure you measured both tool and base correctly?
-