Universal Robots Forum

Interface to control UR with PLC

Hello, I am working on an industrial automation project where a UR5e is used. The entire system will be controlled by a B&R PLC. The goal is to have the operation of the machine done by only one HMI which is connected to the PLC. For simplicity of operation, the teach pendant of the UR shall not be needed in normal operation. This includes the start-up of the machine.
There are different tasks the robot must perform (mostly pick and place). The order in which these tasks must be performed varies and shall be defined by the PLC while the robot is in operation.
The way I see it, there are two main possibilities in how the programming will be done:
First: all instructions and every single waypoint the robot has to go to is programmed on the PLC.
Second: The steps the robot performs should be programmed with PolyScope on the UR teach pendant. These steps should be able to get called by the PLC. This way the PLC can tell the robot which step he needs to do next.
If it is possible, I would like to pursue the second possibility as I think it is less complicated to program. Now my questions:

  1. Is this possible the way it is described above or if there is a better solution?

  2. Which protocol should best be used to set up the interface between the B&R PLC and the robot controller and why? As of my current knowledge, a possible solution would be to use the Dashboard Server (Port 29999) for start, stop close pop-ups etc. And use PROFINET to send commands like which step the robot has to do next.
    Would this work or is there another protocol or combination of protocols that makes more sense in this case?

  3. Are there programming examples/ code examples of how to set up such an interface with a PLC?

Thanks a lot for your valued answer!

Best regards,
Manuel

Answers in Bold

Hello, I am working on an industrial automation project where a UR5e is used. The entire system will be controlled by a B&R PLC. The goal is to have the operation of the machine done by only one HMI which is connected to the PLC. For simplicity of operation, the teach pendant of the UR shall not be needed in normal operation. This includes the start-up of the machine. Check out ‘Remote I/O’ in control box, I’ve always wanted to try to trigger robot on/off without using teach pendant
There are different tasks the robot must perform (mostly pick and place). The order in which these tasks must be performed varies and shall be defined by the PLC while the robot is in operation.
The way I see it, there are two main possibilities in how the programming will be done:
First: all instructions and every single waypoint the robot has to go to is programmed on the PLC. Yep, probably using primary interface or ROS
Second: The steps the robot performs should be programmed with PolyScope on the UR teach pendant. These steps should be able to get called by the PLC. This way the PLC can tell the robot which step he needs to do next. Yep probably open socket connection with PLC and handshake with robot using cases within Polyscope program to move to different locations
If it is possible, I would like to pursue the second possibility as I think it is less complicated to program. This is really up to you, you can send lines of URscript directly or you can build the program in Polyscope and handshake with itNow my questions:

  1. Is this possible the way it is described above or if there is a better solution? Hm… Not really sure I haven’t used ROS and I’m not sure how involved it is when programming, but that might be an option. Someone else in the community might have to answer this.
  2. Which protocol should best be used to set up the interface between the B&R PLC and the robot controller and why? As of my current knowledge, a possible solution would be to use the Dashboard Server (Port 29999) for start, stop close pop-ups etc. Yep dashboard server interface is pretty nifty and if you check out UR’s document you can find other useful commandsAnd use PROFINET to send commands like which step the robot has to do next.
    Would this work or is there another protocol or combination of protocols that makes more sense in this case? I’ve also seen people use the socket commands to send strings or integers for changing steps or cases in a program
  3. Are there programming examples/ code examples of how to set up such an interface with a PLC? I’m sure someone from the urcommunity can share some insight or program examples unfortunately I can’t

Really the decision is up to you on how you want to approach it, if you want to keep the code on the PLC you can certainly do that, but if you plan on changing/adding/modifying additional moves I might recommend programming it on the pendant so you can quickly program the robot in ‘manual’ mode then put the robot back into ‘remote’ mode for the PLC. There may be some better answers the urcommunity might have but that’s all I got for now, hope that helps and best of luck!

1 Like

Hi,
OK, I would not recommend using ROS. Only suitable for a PC based application and an academic project in my humble opinion. I would go for your ‘second’ approach. Create a robot program that is a consumer of commands from the PLC. It would be a state machine of sorts. IF the goal is to control every aspect of the robot from the PLC (and/or it’s HMI) then I would use ProfiNet or EthernetIP and the PLC will need to get status of the robot from the fieldbus interface and send commands as appropriate. You could have the PLC talk to the dashboard server directly via tcp/ip socket commands but this is cumbersome too (I recently learned of a colleague that spent two days just doing this part of the communications on a B&R PLC). The less cumbersome approach is to use a URcap from a URplus partner called Robot27. The product is called Robot27-Connect and here is a link to it : Products-Connect - Robot27

It will allow the PLC to simply send commands to the robots dashboard server via an integer register (for doing all the things you normally do manually via the teach pendant).

2 Likes

Thank you very much for your answer. In the meantime, I found out about Robot27 myself and I would approach the task pretty much the same as you described. With that assurance, I am now positive that I am on the right track :slight_smile:

Thanks for sharing it with us this type of solution for that urcap - unfortunately I could not find it on their website or maybe it is necessary to pay for urcap - will ask them!
Regarding the PLC communication with the robot - I would mention like you said PROFINET (but MODBUS should work as well) is the most plausible solution in this case - you have access to all information required from robot.

My UR robot runs ~15-20 different jobs based on a Job # value given from the PLC over Modbus.

  • Main Program -
    [Before start] initialize any IO used in case one was left on from an incomplete cycle, move home
    [ Main loop] - Wait for job # value & start input
    - CASE statement with Job #, and call subprogram

  • Subprogram -
    Contains all moves and IO for each job / model *Be sure to check box to keep in sync with original program

I wrote the subprogram first, copy for each job number then wrote the main job loop & case.