Update : The solution mentioned post #30 is totally working. No error declared and the value of position is visible every 24ms which is quick. Thanks everyone for help ! Have a nice day
Lucas
Update : The solution mentioned post #30 is totally working. No error declared and the value of position is visible every 24ms which is quick. Thanks everyone for help ! Have a nice day
Lucas
No i'm not so familiar with WorkVisual, just started to work on it since april, this is a great alternative, i will try to work on this until I cant test my solution,
Display MoreWhy not use a cyclic Analog output? It's updated every 12 ms and there are plenty of way to create an almost real-time representation of axis or cartesian positions without the added expense of an RSI option package. It's limited to 4 concurrent channels which should be enough for 3-D. The description can be found on xpert.kuka.com under ID SE63407.
Syntax
Starting cyclical writing:
ANOUT ON
Signal name=
Factor*
Control element<
±Offset> <DELAY =
±Time> <MINIMUM =
Minimum value> <MAXIMUM =
Maximum value>
Ending cyclical writing:
ANOUT OFF
Signal nameAll the variables are REAL, as is $POS_ACT_MES and all other position or velocity variables.
Although the Analog command was originally designed for synchronising a gluing process with TCP velocity, it should work with positions. The nice thing about the command is it can work in the advance run using planned positions, so by using $POS_ACT instead of $POS_ACT_MES and using a negative DELAY, it should be possible to overcome any system lag.
It's easy to assign each $ANOUT[n] to the fieldbus IO in WorkVisual - you don't need a physical analog device - but only 16bit INT is supported. By manipulating the calibration factor, it's possible to determine the accuracy and range required.
Hi Razzzhead, it seems to be a very good idea,
I checked how to map $ANOUT on workvisual but it is fully greyed and I cant connect them,
Thanks !
I see, i will try it tomorrow,
;FOLD
ERR_CLEAR($ERR)
ON_ERROR_PROCEED
POSXact = $POS_ACT_MES.X
IF $ERR.NUMBER>0 THEN
POSXact=-9999
ERR_CLEAR($ERR)
ENDIF
ON_ERROR_PROCEED
POSYact = $POS_ACT_MES.Y
IF $ERR.NUMBER>0 THEN
POSYact=-9999
ERR_CLEAR($ERR)
ENDIF
ON_ERROR_PROCEED
POSZact = $POS_ACT_MES.Z
IF $ERR.NUMBER>0 THEN
POSZact=-9999
ERR_CLEAR($ERR)
ENDIF
;ENDFOLD
Display More
I'm looking for the spec of ON_ERROR_PROCEED, I remember found it in a doc but cant get my hand on it ..
EDIT :
QuoteAdditional information about ON_ERROR_PROCEED is provided in the KU-KA System Software (KSS) service and programming manuals - KSS 8.4
Thanks
Of course,
Base and tool are defined for the entire program, that's why i dont understand how POSXact stay at -9999.
Thanks
Hi everyone, i'm coming with some results,
To resume the thread, I'm searching to get the current cartesian position of the robot during a program to print it into a HMI.
For this I used $POS_ACT_MES for each axes $POS_ACT_MES.X, $POS_ACT_MES.Y,$POS_ACT_MES.Z)
And, in the loop of the SPS.SUB :
;FOLD POSITION TPS REEL
ON_ERROR_PROCEED
POSXact = $POS_ACT_MES.X
IF $ERR.NUMBER>0 THEN
POSXact=-9999
ERR_CLEAR($ERR)
ENDIF
ON_ERROR_PROCEED
POSYact = $POS_ACT_MES.Y
IF $ERR.NUMBER>0 THEN
POSYact=-9999
ERR_CLEAR($ERR)
ENDIF
ON_ERROR_PROCEED
POSZact = $POS_ACT_MES.Z
IF $ERR.NUMBER>0 THEN
POSZact=-9999
ERR_CLEAR($ERR)
ENDIF
;ENDFOLD
Display More
And in the VAR_CONST
;************************************************
GLOBAL SIGNAL POSXact $OUT[2160] to $OUT[2191]
GLOBAL SIGNAL POSYact $OUT[2192] to $OUT[2223]
GLOBAL SIGNAL POSZact $OUT[2224] to $OUT[2255]
;************************************************
I installed my WorkVisual Project without problem. I start the robot. It was already at home position, no base and tool are declared, so $POS_ACT_MES shouldn't be valid. I take the smartpad,
display -> variables -> unit -> POSXact
then POSXact is equal to -9999 as mentioned in the sps in the case of error ($pos_act_mes not valid).
So, I lunch the program of the robot, then the robot act as usual but POSXact doesn't make a move (stay at -9999).
My program contain around 15 different points and it last for more than 7 seconds so I literally have the time to see the movements of POSXact ,
I looked for any error in Smartpad but nothing happen,
If you have any idea don't hesitate,
Thanks a lot,
Lucas
Are you talking about mapping I/O?
What type and robot are you using ?
when signal is 32-bit (no more and no less) then it is a signed INT (SINT) and the most significant bit is a sign.
if the signal is less than 32-bit wide, it is always unsigned (sign bit is chopped off).
so in case one wants less than 32-bit signed value (SINT16 for example), programmer would need to ensure that value is interpreted correctly which is easy to do.
Thanks for the help, I will check this
The format for the 32 bit is well known as two's complement. You can search for it, and will find many examples.
Well, wasn't sur about it, thanks !
The kuka plc I was working with is called ProConOs (IDE: Multiprog wt).
There are several function blocks having direct access to the robot base system (like $POS_ACT_MES - 12ms)
Suggestion: check with KUKA
(you need this soft plc from kuka because they provide you the kuka specific function blocks)
I see, I will send a mail to KUKA about this, thanks a lot !
Ok nice,
I was searching about SIGNAL manual, I found that SIGNAL was declared as INT and can be max assign as 32 bits. But i didnt found how these bits take care about the negative numbers. Some of my coordinate looks like -1450.
Do you have some informations about this ?
Is there a bit of sign ?
Thanks,
multiplying with 1 does nothing except make more work for CPU.
I try without but this line appear :
Some values cannot be initialized correctly when a value of type 'REAL' is used for a parameter of type 'INT'.
So i guess that $POS_ACT_MES.X is REAL and the signal a INT as you said, should I do any operations to make it INT? or make my Output REAL (that's why i multiplied by 1)
Thanks panic mode
multiplying with 1 does nothing except make more work for CPU.
that will work but it will give you position value rounded to a millimeter because SIGNAL is an INT type, not a REAL. to send REAL value to PLC, you need to transfer bit-by-bit value from REAL to INT before assigning it to POSXAct for example.
another workaround to preserve at least some of decimal places is to multiply REAL value by some factor (such as 1000.0). then receiving side should of course divide received value by same factor.
This is fine for my test, i just wanted to use value rounded to millimeter,
Thanks for the information, I will think about it
I will try asap, I must have made a mistake when doing the count, thank you
Nice, thanks all again, have a nice day
24ms seems good for my use, do you think it's possible to make it works as i described before (post #6)?
I find this post questioning about position with axis and the conversion from matrix to coordinates.
Do you think it's possible to get the $AXIS_POS_MES in "real time" (around 10ms) thanks to I/O and then convert it through the HMI using maths ? (even if the coordinate are according to the world base)
Thx in advance,
depends on your definition of real time. submit is slow and low priority task.
you can use RSI or FSD instead of IOs and submit. then you get position data down to 1ms.
Thanks @PanicMode but i'm was searching for a free way to do it, just for some program tests not for the overall operation.
But it's likely what i'm trying to do, i will consider the fact that it's not really possible for free,
Using ON_ERR_PROCEED only applies to the next line of KRL code -- so ON_ERR_PROCEED on Line 1 only applies to Line 2. By line 3, the ON_ERR_PROCEED "trap" has "expired". So the odds of any other error being "caught" is extremely low. Any error that occurs on a line that is not immediately preceded by ON_ERR_PROCEED will be be caught by the system error handler and halt the program. Also, ON_ERR_PROCEED will not affect errors like collisions, E-Stops, communications failures, etc.
It does not create a safety issue, b/c none of this code is safety-qualified, and as such should never be used for safety-critical interlocks.
Thanks SkyeFire,
I didnt catch the fact that only the error of the current line is aim,
I guess that the code i post will make me more error than data i can use,
One option (especially for press lines) could be a soft plc (from kuka) having direct access to actual robot position in real time
Thanks Mom, did you have something in mind about a soft plc ? Something like mxAutomation from KUKA ?
Update : I found this post having the same problem,
Clearly it seems to have no way to get these informations in real time,
Thx for help
Hello MOM,
I see,
then do you think these two error code are enough for my case ?
I'm searching in the KSS Manual in case of similar error,
Thks
NB : I forgot to tell you that this robot is part of a cell with a press and security elements, that's why I would like to avoid passing any erroneous code
Thanks SkyeFire your time,
As i understand, my sps must be like this,
;************ X AXE **********
ON_ERROR_PROCEED
POSXact = $POS_ACT_MES.X*1
IF $ERR.NUMBER>0 THEN
POSXact=-9999
ERR_CLEAR($ERR)
ENDIF
;*****************************
;************ Y AXE **********
ON_ERROR_PROCEED
POSYact = $POS_ACT_MES.Y*1
IF $ERR.NUMBER>0 THEN
POSYact=-9999
ERR_CLEAR($ERR)
ENDIF
;*****************************
;************ Z AXE **********
ON_ERROR_PROCEED
POSZact = $POS_ACT_MES.Z*1
IF $ERR.NUMBER>0 THEN
POSZact=-9999
ERR_CLEAR($ERR)
ENDIF
;*****************************
Display More
But there is something disrupting me,
If the ERR is >0 then, the error can be everything, this can be a problem ?
I've checked the KSS System Message Manual and found such number error like
- 1418 : <X,Y,Z,A,B,C> Base not defined
- 1419 : <X,Y,Z,A,B,C> Tool not defined
- 1422 : Reading < Variable $> Incorrect value
So my question is the following one :
Should I identify the error codes that relate to my case? Or it does not pose a real problem of safety?
I'm afraid to bypass another error by leaving >0
Thanks in advance
I just refind this topic from 2018, it seems to be on a krc2 :
I guess this is different for KRC4,