March 23, 2019, 09:01:20 AM
Robotforum | Industrial Robots Community

 UR5 interface

Author Topic:  UR5 interface  (Read 446 times)

0 Members and 1 Guest are viewing this topic.

January 06, 2019, 04:30:36 PM
Read 446 times
Offline

sirvan


Hi Guys,

I am a beginner with all kind of robots. In form of my project, I need to read the raw data of a universal robot(UR5). could anyone explain me how should I do it? has this kind of robot any interface, which provide data? if yes, how could I reach it?

Today at 09:01:20 AM
Reply #1

Advertisement

Guest

January 06, 2019, 05:08:28 PM
Reply #1
Offline

matthewd92


What data are you looking for?  There are several different interfaces that are supplied. There are 3 different streaming systems. The first is at port 30001 and streams packets of info including all the robot telemetry data as well as variables, log messages, etc. port 30003 is the Real Time Engine and streams at 125hz (CB3) a 1070 byte packer that contains all of the telemetry data about the robot.

Port 30004 is the Real Time Data Exchange and allows you to specify what you want to listen to from the telemetry as asll as feed data back into the system which gives you the ability to control the robot from another system such as a PC.

Then there is modbus and most info about the robot is available as registers in modbus.

Only the first port, 30001 provides access to variables and log messages as streaming data.

The robots also support Profinet and EthernetIP which allow you to monitor all of the telemetry data from a PLC as well as do two way communication using bit, integer and double registers.




Sent from my iPhone using Tapatalk

January 07, 2019, 11:28:49 PM
Reply #2
Offline

sirvan


 I am looking for the data, such as sensor data, axis position, temperature and so on. could you please explain to me how could I use EthernetIP feature of the robot to reach this kind of information? or better to say, how could I find an IP, which allows me to reach an interface, that provides me the intern data of the robot? i would appreciate all kind of information. tnx a lot

January 08, 2019, 05:05:07 PM
Reply #3
Offline

SkyeFire

Global Moderator
To get all that information over EthernetIP, you'd probably have to build a background task in the URC that would periodically load those data into the EIP registers.  And IIRC, there's only a few of those registers.

Getting the data over TCP/IP is actually easier, and there's a lot of examples around.  Such as
https://www.universal-robots.com/how-tos-and-faqs/how-to/ur-how-tos/real-time-data-exchange-rtde-guide-22229/
http://www.zacobria.com/universal-robots-zacobria-forum-hints-tips-how-to/script-via-socket-connection/
http://www.zacobria.com/universal-robots-knowledge-base-tech-support-forum-hints-tips/knowledge-base/script-from-host-to-robot-via-socket-connection/

This worked pretty well for me under Python. 
Code: [Select]
import socket
import time
import struct
import random

HOST = "192.168.58.131" # The remote host
PORT_30003 = 30003

Encyclopedia = [
{'Lst': [0], 'LstLength':1, 'FirstByte': 4, 'Bytes': 8, 'Format': '!d', 'Title': ["TimeStamp"]}, 
{'Lst': [0,0,0,0,0,0], 'LstLength':6, 'FirstByte': 444, 'Bytes': 8, 'Format': '!d', 'Title': ["X","Y","Z","Rx","Ry","Rz"]},
{'Lst': [0,0,0,0,0,0], 'LstLength':6, 'FirstByte': 252, 'Bytes': 8, 'Format': '!d', 'Title': ["A1","A2","A3","A4","A5","A6"]},
{'Lst': [0], 'LstLength':1, 'FirstByte': 684, 'Bytes': 8, 'Format': '!d', 'Title': ["Inputs"]},
{'Lst': [0], 'LstLength':1, 'FirstByte': 1044, 'Bytes': 8, 'Format': '!d', 'Title': ["Outputs"]},
{'Lst': [0,0,0], 'LstLength':3, 'FirstByte': 1060, 'Bytes': 8, 'Format': '!d', 'Title': ["Elbow X","Elbow Y","Elbow Z"]},
{'Lst': [0,0,0], 'LstLength':3, 'FirstByte': 1084, 'Bytes': 8, 'Format': '!d', 'Title': ["Elbow VX","Elbow VY","Elbow VZ"]},
{'Lst': [0,0,0], 'LstLength':3, 'FirstByte': 868, 'Bytes': 8, 'Format': '!d', 'Title': ["Accel X","Accel Y","Accel Z"]},
{'Lst': [0], 'LstLength':1, 'FirstByte': 940, 'Bytes': 8, 'Format': '!d', 'Title': ["Speed"]},
{'Lst': [0,0,0,0,0,0], 'LstLength':6, 'FirstByte': 492, 'Bytes': 8, 'Format': '!d', 'Title': ["Vx","Vy","Vz","VRx","VRy","VRz"]},
{'Lst': [0], 'LstLength':1, 'FirstByte': 948, 'Bytes': 8, 'Format': '!d', 'Title': ["NormCartMom"]},
{'Lst': [0,0,0,0,0,0], 'LstLength':6, 'FirstByte': 300, 'Bytes': 8, 'Format': '!d', 'Title': ["VA1","VA2","VA3","VA4","VA5","VA6"]},
{'Lst': [0,0,0,0,0,0], 'LstLength':6, 'FirstByte': 300, 'Bytes': 8, 'Format': '!d', 'Title': ["Fx","Fy","Fz","Tx","Ty","Tz"]},
{'Lst': [0], 'LstLength':1, 'FirstByte': 740, 'Bytes': 8, 'Format': '!d', 'Title': ["ThreadEx"]},
{'Lst': [0,0,0,0,0,0], 'LstLength':6, 'FirstByte': 692, 'Bytes': 8, 'Format': '!d', 'Title': ["TmpA1","TmpA2","TmpA3","TmpA4","TmpA5","TmpA6"]}
]

def ElementParse(Packet, Target):
  _format = Target['Format']
  for Index in range(Target['LstLength']):
    Target['Lst'][Index] = Packet[(Target['FirstByte'] + (Index*8)):(Target['FirstByte']+((Index+1)*Target['Bytes']))]
    Target['Lst'][Index]=Target['Lst'][Index].encode("hex")
    Target['Lst'][Index] = struct.unpack(_format,Target['Lst'][Index].decode('hex'))[0]
  return Target['Lst']

print "Starting Program"

file=open("C:/tmp/Stream.log","w")
LabelList = []
for entry in Encyclopedia:
  for title in entry['Title']:
    LabelList.append(title)
file.write(",".join(LabelList) + "\n")

try:
  s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
  s.settimeout(10)
  s.connect((HOST, PORT_30003)) #

  counter = 0
  while (counter<10000):
    FullPacket = s.recv(1108)
   
    LogString = ""
    for entry in Encyclopedia:
      LogString = LogString + ",".join(map(str,ElementParse(FullPacket,entry))) + ","

    #LogString = LogString.translate(None,'[]()') # strip brackets
    LogString = LogString.rstrip(",") # remove trailing comma

    #print (LogString)
    file.write(LogString + "\n")
    counter = counter + 1

except socket.error as socketerror:
  print("Error: ", socketerror)
  print "Program finish"

file.close()
s.close()


January 08, 2019, 11:18:41 PM
Reply #4
Offline

matthewd92


UR provides both a Profinet and EthernetIP adapter built into the robot, you just need an Ethernet IP scanner such as an AB PLC. We use both protocols in various cells that we have. Our preference is Profinet as we prefer Siemens PLC’s and I think the structure of the data is much better than EIP but that’s a personal preference. You can find more information about connecting the robot to a PLC here

https://www.universal-robots.com/how-tos-and-faqs/how-to/ur-how-tos/ethernet-ip-guide-18712/

https://www.universal-robots.com/how-tos-and-faqs/how-to/ur-how-tos/profinet-guide-20596/

In both of the data matrix documents realize the left hand column addresses are given in bits, not bytes. Sure makes it easier to find what you are looking for.

The nice thing about using this is it provides two way communication between the two systems. We use this primarily for transferring data between other systems and the robot such as cameras and screw gun controllers. We have also used it with a Siemens drive system for controlling a 7th axis very easily from the robot.

Sent from my iPhone using Tapatalk
« Last Edit: January 08, 2019, 11:20:53 PM by matthewd92 »


Share via facebook Share via linkedin Share via pinterest Share via reddit Share via twitter

clip
ABB RRI(Robot Reference Interface) "Init of communication interface failed"

Started by franktly on ABB Robot Forum

0 Replies
295 Views
Last post September 27, 2018, 02:52:11 AM
by franktly
xx
i/o interface

Started by Dean on Fanuc Robot Forum

3 Replies
843 Views
Last post February 23, 2018, 08:39:44 PM
by stare284
question
Interface with PC

Started by marcoss_aurelio on KUKA Robot Forum

6 Replies
5412 Views
Last post June 21, 2015, 02:20:49 PM
by marcoss_aurelio
xx
UDP interface

Started by zicki_88 on KUKA Robot Forum

5 Replies
484 Views
Last post August 16, 2018, 12:57:12 PM
by zicki_88