Robotiq 2 fingers or 3 fingers gripper with Ethercat controller works well.
Posts by omaxio
-
-
Dear all,
Is it possible to use RSI ethernet and Ethernet KRL together in the same program? If it is possible, what will be the IP seting for both? Same IP different port or different IP?
Thank you
-
Hi all,
What is the system sps.sub checking at "background"? I see every time I select the sps.sub, there are several .src files linked together (MsgLib.src, tm_bib.src). If I don't use sps.sub but use my own test.sub, will there be any problem?
Thank you
-
Can you give a little more clarification of your objectives?It is possible to set up the ethernet object so that some known variables are passed from the PC to the controller and vice-versa, but it is quite limited in it's scope.
If you want to be able to set controller variables from an external PC in a more freeform manner, then you will need a different solution.Thanks for your reply. I've already got the solution.
-
I'm using the RSI 3.1.
By using the ethernet object, can I transfer data from PC to KRC and save it in a variable? -
Hrm? There may be a misunderstanding here -- I use conditional branches without breaking the advance run. But I do have to be careful of my code in order to avoid it.In this case, first there's the issue of your communication operation. In a path from point A to B to C, in order to approximate through B, the robot must know the coordinates for C before the advance pointer gets to the PTP C command. With $ADVANCE=3 (factory default) there's no way for you to receive the coords for C early enough unless you receive all your point data before you leave Point A. Basically, your incoming data stream has to stay ahead of the motion pointer, by a number of motions equal to or larger than $ADVANCE.
So... we can try a few things. First, reduce $ADVANCE to 1. You can't have approximated motion at all with 0.
Second, all of your communication code will need to move to a separate subroutine that is called by a TRIGGER command.
Third, your request for point data, and the data coming back, must be complete before the robot reaches the approximation radius of the current motion. So your code structure and timing must be strong and precise and fast. And also fail-safe, in the event of a comm delay.
Very, very roughly, something like this:
Code
Display MoreWHILE TRUE TRIGGER WHEN DISTANCE=0 DELAY=0 DO GetXMLData () PRIO=-1 ; trigger at beginning of next main-run move, with no delay. PTP P[i] C_PTP ; Pos is the the position from the LAST loop ENDWHILE . . . DEF GetXMLData () ; put XML code here, use CONTINUEs as necessary to prevent breaking advance pointer CONTINUE i = i+1 CONTINUE IF (i > 2) THEN i = 1 ENDIF CONTINUE Array [i] = PositionFromXML END
That's probably not quite right, but I'm working on a dying laptop battery right now. The idea is that the XML communications has to stay ahead of the robot motion. The moment the robot leaves point A heading for B, the robot has to be getting the data for point C, and has to have that data into the motion array before the main run reaches the approximation radius of B. One thing that can help here is to shrink the approximation radius as small as practical to allow more time for the communications to take place.I have tried this way of coding, still can not get a smooth motion. $APO.CDIS i set to 20, $Advance=1, and speed is 10%.
My GetXMLData() routine.
Code
Display MoreDEF GetXMLData() ;FOLD Send Data Match SampleSensor+.xml CONTINUE errint = EKX_WriteReal("SampleSensor.Robot.Data.xPos", $POS_ACT.X) CONTINUE EKX_handleerror(errint) CONTINUE errint = EKX_WriteReal("SampleSensor.Robot.Data.yPos", $POS_ACT.Y) CONTINUE EKX_handleerror(errint) CONTINUE errint = EKX_WriteReal("SampleSensor.Robot.Data.zPos", $POS_ACT.Z) CONTINUE EKX_handleerror(errint) CONTINUE errint = EKX_WriteReal("SampleSensor.Robot.Data.aPos", $POS_ACT.A) CONTINUE EKX_handleerror(errint) CONTINUE errint = EKX_WriteReal("SampleSensor.Robot.Data.bPos", $POS_ACT.B) CONTINUE EKX_handleerror(errint) CONTINUE errint = EKX_WriteReal("SampleSensor.Robot.Data.cPos", $POS_ACT.C) CONTINUE EKX_handleerror(errint) CONTINUE errint = EKX_WriteReal("SampleSensor.Robot.Data.Axis1", $AXIS_ACT.A1) CONTINUE EKX_handleerror(errint) CONTINUE errint = EKX_WriteReal("SampleSensor.Robot.Data.Axis2", $AXIS_ACT.A2) CONTINUE EKX_handleerror(errint) CONTINUE errint = EKX_WriteReal("SampleSensor.Robot.Data.Axis3", $AXIS_ACT.A3) CONTINUE EKX_handleerror(errint) CONTINUE errint = EKX_WriteReal("SampleSensor.Robot.Data.Axis4", $AXIS_ACT.A4) CONTINUE EKX_handleerror(errint) CONTINUE errint = EKX_WriteReal("SampleSensor.Robot.Data.Axis5", $AXIS_ACT.A5) CONTINUE EKX_handleerror(errint) CONTINUE errint = EKX_WriteReal("SampleSensor.Robot.Data.Axis6", $AXIS_ACT.A6) CONTINUE EKX_handleerror(errint) ;ENDFOLD ; Match xml file ;FOLD Send Sample Sensor CONTINUE errint = EKX_Send("SampleSensor") CONTINUE EKX_handleerror(errint) ;ENDFOLD ; Mapping Data of SampleSensor+.xml and send to server; Send ;FOLD Get Data from stack, only if there are new values CONTINUE errbl = EKX_WaitForSensorData(0, rectext[7].s[], 5000) CONTINUE IF errbl == FALSE THEN CONTINUE HALT CONTINUE ENDIF ;get Mode CONTINUE errbl = EKX_GetIntegerElement(0, rectext[1].s[], Mode, bNew) ;get MoveData CONTINUE errbl=EKX_GetIntegerElement(0, rectext[2].s[], TempMoveData.Type, bNew) CONTINUE errbl=EKX_GetFrameElement(0, rectext[3].s[], TempMoveData.XFrame, bNew) CONTINUE errbl=EKX_GetRealElement(0, rectext[4].s[], TempMoveData.Speed, bNew) CONTINUE errbl=EKX_GetRealElement(0, rectext[5].s[], TempMoveData.Acc, bNew) CONTINUE errbl=EKX_GetRealElement(0, rectext[6].s[], TempMoveData.Ca, bNew) ;ENDFOLD ; Get Data from Server ;FOLD Creat Ring Buffer For C_PTP CONTINUE m=m+1 CONTINUE IF m>2 THEN CONTINUE m=1 ENDIF CONTINUE pointframes[m]=$POS_ACT CONTINUE pointframes[m].X=pointframes[m].X+TempMoveData.XFrame.X CONTINUE pointframes[m].Y=pointframes[m].Y+TempMoveData.XFrame.Y CONTINUE pointframes[m].Z=pointframes[m].Z+TempMoveData.XFrame.Z CONTINUE pointframes[m].A=pointframes[m].A+TempMoveData.XFrame.A CONTINUE pointframes[m].B=pointframes[m].B+TempMoveData.XFrame.B CONTINUE pointframes[m].C=pointframes[m].C+TempMoveData.XFrame.C ;ENDFOLD (Creat Ring Buffer For C_PTP) END
My move:
CodeWHILE Mode==2 TRIGGER WHEN DISTANCE=0 DELAY=0 DO GetXMLData() PRIO=-1 ; trigger at beginning of next main-run move, with no delay. PTP pointframes[m] C_PTP ENDWHILE
And something strange: I tried to monitor the pointframes[1] and pointframes[2] value, they are the same everytime I checked.
Will the codes inside ethkrlxml.src functions break the $advance pointer?
-
Thank you all I'll try out and let you know the result.
-
To Drudge I'm not sure if i'm allowed to put the archive here. The program I've already posted here, except a standard init and while at the beginning.
-
I'm using KUKA.Ethernet KRL XML 1.2.1 Build03.
I contacted Kuka surpport yesterday. They told me any conditional branch will stop the $advance pointer.
I have an array of positions need to be sent to robot, and every position may have LIN, PTP or CIRC. If no conditional branch can be used, what should I do?
-
Will the Motion command in other cases affect the advance run pointer?I've just check the manual, the for loop will have no effect on the advance pointer. Is it because of the $POS_ACT triggers an advance run stop? I'll try to put a CONTINUE before every $POS_ACT or $AXIS_ACT and try again.
Just tried, no use.
-
Will the Motion command in other cases affect the advance run pointer?
I've just check the manual, the for loop will have no effect on the advance pointer. Is it because of the $POS_ACT triggers an advance run stop? I'll try to put a CONTINUE before every $POS_ACT or $AXIS_ACT and try again.
-
Thanks a lot SkyFire.
$Advance=3.
My send and receive:Code
Display More;FOLD Send Data Match SampleSensor+.xml errint = EKX_WriteString("SampleSensor.Robot.Status", sendtext[3].s[]) EKX_handleerror(errint) errint = EKX_WriteString("SampleSensor.Robot.Mode", sendtext[4].s[]) EKX_handleerror(errint) errint = EKX_WriteReal("SampleSensor.Robot.Data.xPos", $POS_ACT.X) EKX_handleerror(errint) errint = EKX_WriteReal("SampleSensor.Robot.Data.yPos", $POS_ACT.Y) EKX_handleerror(errint) errint = EKX_WriteReal("SampleSensor.Robot.Data.zPos", $POS_ACT.Z) EKX_handleerror(errint) errint = EKX_WriteReal("SampleSensor.Robot.Data.aPos", $POS_ACT.A) EKX_handleerror(errint) errint = EKX_WriteReal("SampleSensor.Robot.Data.bPos", $POS_ACT.B) EKX_handleerror(errint) errint = EKX_WriteReal("SampleSensor.Robot.Data.cPos", $POS_ACT.C) EKX_handleerror(errint) errint = EKX_WriteReal("SampleSensor.Robot.Data.Axis1", $AXIS_ACT.A1) EKX_handleerror(errint) errint = EKX_WriteReal("SampleSensor.Robot.Data.Axis2", $AXIS_ACT.A2) EKX_handleerror(errint) errint = EKX_WriteReal("SampleSensor.Robot.Data.Axis3", $AXIS_ACT.A3) EKX_handleerror(errint) errint = EKX_WriteReal("SampleSensor.Robot.Data.Axis4", $AXIS_ACT.A4) EKX_handleerror(errint) errint = EKX_WriteReal("SampleSensor.Robot.Data.Axis5", $AXIS_ACT.A5) EKX_handleerror(errint) errint = EKX_WriteReal("SampleSensor.Robot.Data.Axis6", $AXIS_ACT.A6) EKX_handleerror(errint) errint = EKX_WriteString("SampleSensor.Robot.Complex.Tickcount", sendtext[6].s[]) EKX_handleerror(errint) ;ENDFOLD ; Match xml file ;FOLD Send Sample Sensor errint = EKX_Send("SampleSensor") EKX_handleerror(errint) ;ENDFOLD ; Mapping Data of SampleSensor+.xml and send to server; Send ;FOLD stuff counter = counter + 1 sendtext[6].s[] = "0" offset = 0 SWRITE(sendtext[6].s[], state,offset,"%d",counter) ;ENDFOLD ; Increase Tick Count ;FOLD Get Data from stack, only if there are new values errbl = EKX_WaitForSensorData(0, rectext[7].s[], 10000) IF errbl == FALSE THEN HALT ENDIF ;get Mode errbl = EKX_GetIntegerElement(0, rectext[1].s[], Mode, bNew) IF errbl == FALSE THEN HALT ENDIF ;get MoveData errbl=EKX_GetIntegerElement(0, rectext[2].s[], TempMoveData.Type, bNew) IF errbl == FALSE THEN HALT ENDIF errbl=EKX_GetFrameElement(0, rectext[3].s[], TempMoveData.XFrame, bNew) IF errbl == FALSE THEN HALT ENDIF errbl=EKX_GetRealElement(0, rectext[4].s[], TempMoveData.Speed, bNew) IF errbl == FALSE THEN HALT ENDIF errbl=EKX_GetRealElement(0, rectext[5].s[], TempMoveData.Acc, bNew) IF errbl == FALSE THEN HALT ENDIF errbl=EKX_GetRealElement(0, rectext[6].s[], TempMoveData.Ca, bNew) IF errbl == FALSE THEN HALT ENDIF ;ENDFOLD ; Get Data from Server
I'm using a case structure for different type of motions:
Code
Display More;FOLD Command and Robot Action SWITCH Mode ;FOLD CASE 0 INIT CASE 0 sendtext[4].s[] = " INIT " sendtext[3].s[] = "Ready" ;ENDFOLD ;FOLD CASE 1 Get Position CASE 1 sendtext[4].s[] = "Get Po" sendtext[3].s[] = "Ready" ;ENDFOLD ;FOLD CASE 2 Relative Move CASE 2 sendtext[4].s[] = " REL " IF TempMoveData.Speed<=0 THEN VelAxis=10 ELSE VelAxis=TempMoveData.Speed ENDIF IF TempMoveData.Acc <= 0 THEN AccAxis=10 ELSE AccAxis=TempMoveData.Acc ENDIF FOR i=1 TO 6 $VEL_AXIS[i]=VelAxis $ACC_AXIS[i]=100 ENDFOR moveframe.X=$POS_ACT.X+TempMoveData.XFrame.X moveframe.Y=$POS_ACT.Y+TempMoveData.XFrame.Y moveframe.Z=$POS_ACT.Z+TempMoveData.XFrame.Z moveframe.A=$POS_ACT.A+TempMoveData.XFrame.A moveframe.B=$POS_ACT.B+TempMoveData.XFrame.B moveframe.C=$POS_ACT.C+TempMoveData.XFrame.C PTP moveframe C_PTP sendtext[3].s[] = "Ready" ;ENDFOLD ;FOLD CASE 3 Move Axis CASE 3 sendtext[4].s[] = "AXIS " MOVEAXIS=$AXIS_ACT MOVEAXIS.A1=MOVEAXIS.A1+TempMoveData.XFrame.X MOVEAXIS.A2=MOVEAXIS.A2+TempMoveData.XFrame.Y MOVEAXIS.A3=MOVEAXIS.A3+TempMoveData.XFrame.Z MOVEAXIS.A4=MOVEAXIS.A4+TempMoveData.XFrame.A MOVEAXIS.A5=MOVEAXIS.A5+TempMoveData.XFrame.B MOVEAXIS.A6=MOVEAXIS.A6+TempMoveData.XFrame.C PTP MOVEAXIS C_PTP sendtext[3].s[] = "Ready" ;ENDFOLD (CASE 3 Move Axis)
-
Thank you all.
I've tried C_PTP, but the movement still jogging. Actually there is no difference with the C_PTP added.
The program is inside a while loop,Code
Display MoreWHILE TRUE ;Some other code: send and receive FOR i=1 TO 6 $VEL_AXIS[i]=10 $ACC_AXIS[i]=10 ENDFOR PTP_REL {frame: x 5, y 0, z 0, a 0, b 0, c 0} C_PTP ENDWHILE
Code
Display MoreWHILE TRUE ;Some other code: send and receive FOR i=1 TO 6 $VEL_AXIS[i]=10 $ACC_AXIS[i]=100 ENDFOR moveframe.X=$POS_ACT.X+5 moveframe.Y=$POS_ACT.Y moveframe.Z=$POS_ACT.Z moveframe.A=$POS_ACT.A moveframe.B=$POS_ACT.B moveframe.C=$POS_ACT.C PTP moveframe C_PTP ENDWHILE
Or, Is there any velocity mode inside KRC? For example, it will move along an Axis in a constant speed.
-
Hi All,
I want to use my computer to continuously move the robot. The mechanism is: both sides are doing a synchronous communication, PTP command is in a loop and the computer will update the next position in a step of 5 mm in one axis every iteration. How do I make the motion continuous and smooth?
Thank you in advance.Code
Display More;FOLD CASE 2 Relative Move CASE 2 sendtext[4].s[] = " REL " IF TempMoveData.Speed<=0 OR TempMoveData.Speed>100 THEN VelAxis=10 ELSE VelAxis=TempMoveData.Speed ENDIF IF TempMoveData.Acc<=0 OR TempMoveData.Acc>100 THEN AccAxis=10 ELSE AccAxis=TempMoveData.Acc ENDIF FOR i=1 TO 6 $VEL_AXIS[i]=VelAxis $ACC_AXIS[i]=AccAxis ENDFOR moveframe=TempMoveData.XFrame PTP_REL moveframe sendtext[3].s[] = "Ready" ;ENDFOLD