# Monitor or reference current robot position

• If the robot starts in certain positions it needs to move up in the Z to clear fixtures. I cant seem to find how to reference current rob pos in the manuals, I found the LIN \$POS_ACT for clearing.

KR 20 R1810-2

KRC4 NA UL SC5.1

work visual V6.0.16

thanks

• I am fairly sure, this could have been found in expert programming manual. The variable is \$Pos_act - current position of the current tool in current base.

• try

LIN \$POS_ACT:{X 0, Y 0, Z 50, A 0, B 0, Z 0}

or

LIN_REL {Z 50}

2) if you have an issue with robot, post question in the correct forum section... do NOT contact me directly

3) read 1 and 2

• I am fairly sure, this could have been found in expert programming manual. The variable is \$Pos_act - current position of the current tool in current base.

I thought LIN \$POS_ACT was for moving say 50 in the z? How do I know where I am?

if z position is < 100 then LIN \$POS_ACT:{X 0, Y 0, Z 50, A 0, B 0, Z 0}

how do I know my robots z position?

thanks for the help

• try

LIN \$POS_ACT:{X 0, Y 0, Z 50, A 0, B 0, Z 0}

or

LIN_REL {Z 50}

Both of these commands will indeed go 50 in the z.

My problem is how do I know where my Z currently is?

IF (current Z position is < 100) THEN LIN_REL {Z 50};

I need help monitoring or referencing current Z position.

thanks again.

• Code
IF \$POS_ACT.Z < 100 THEN
LIN \$POS_ACT : {X 0,Y 0,Z 50,A 0,B 0,C 0}
ENDIF

\$POS_ACT is the robot's current Cartesian position. LIN \$POS_ACT will basically move the robot to where it already is.

The : is the "Geometric Operator". It "multiplies" the position on the left with the position on the right, and returns the result. Another way to do the same operation as above would be:

Code
DECL POS TemporaryPos
IF \$POS_ACT.Z < 100 THEN
TemporaryPos = \$POS_ACT : {X 0, Y 0, Z 50, A 0, B 0, C 0}
LIN TemporaryPos
ENDIF

The first version is just a more compact way of doing the same thing.

Note: \$POS_ACT_MES is the "better" version of \$POS_ACT, available starting with KSS version 8.

• This worked as expected, thanks for the run down.

• my current issue is when I try to move up it throws a "Impermissible start position".

I found some other posts talking showing how to do this with a PTP move and that works for one scenario, but the second scenario my EOT needs to move LIN or it will crash.

Code
\$BASE = SBASE(1)
; this part works
if (\$pos_act.z > -290) and (\$pos_act.z < 100) and (\$pos_act.x > 1000) then
SPTP P_PrePickPosition CONT Vel=100 % PDAT13 Tool[1]:Tool1 Base[1]:casepacker
endif

; this part throws fault
if (\$pos_act.z > -300) then
SLIN p_clearring Vel=2 m/s CPDAT33 Tool[1]:Tool1 Base[1]:casepacker
endif

I understand my code here can be cleaner, I'm trying to figure out the issue before refining.

thanks

• first of all you should read READ FIRST.

do not post your interpretation of what message tells. post entire message as is (screenshot, with message number).

also you seem to focus on SRC code when message complains about position value. And that is something that you did not share. So what are values of p_Clearing, tool_data[1] and base_data[1], is the position reachable and of course - did you do a BCO before reaching that instruction?

2) if you have an issue with robot, post question in the correct forum section... do NOT contact me directly

3) read 1 and 2

• what?

I think MOM is just expressing his incredulity that you claimed to have read the manuals and still had questions about such basic matters.

• I think MOM is just expressing his incredulity that you claimed to have read the manuals and still had questions about such basic matters.

why is it almost every post on this site has replies from people who act like theyre being bothered?
Ultimately I know why, small men take pleasure in putting others down.

• Ok, I am one of the small men (as you guess) and I am having pleasure putting others down.

This forum wants to help all of the ones having problems and ask for a solution.

Thats it, thank you sir.

What my intension actually was:

- Did actually hermann gave you the final kick (answer)?

because

- No solution found in kuka documents?

- or?

If I insulted you then I really want to apololize because this was never my intention

• He did give the final answer, none of the manuals I have reference ptp \$axis_act' After I was given the secret command I went back and searched for it.

Dont worry about, I was going to leave it alone. Mentat asked so I answered.