Controlling External Hardware

Hello,

I am new to this topic and I am working on a project controlling a prosthetic hand attached to an e-series cobot. There will be an external computer to manage everything because the cobot doesn’t have enough IO ports, and the cobot must communicate its position/velocity/other data.

I am seeking help/guidance on the following:

  • I have made a simple URCap following this tutorial from universal robots https://www.universal-robots.com/articles/ur/urplus-resources/urcap-my-first-urcap/ to model a 2 fingered gripper with 2 degrees of freedom each, and I was wondering what urscript functions I should use to control the speed/position of a brushless DC motor that would be plugged into the external computer. Below is the current code I have where the urscript is added and it models the step in the tutorial titled “Creating the Contribution”:
    public void generateScript(ScriptWriter writer) {
    writer.appendLine(“set_standard_digital_out(”+getDOF()+“, True)”);
    writer.sleep(getDuration());
    writer.appendLine(“set_standard_digital_out(”+getDOF()+“, False)”);
    }

I don’t think the function “set_standard_digital_out” has the capability to to control the speed/position of a brushless DC motor. Are there any functions here that I should use?

  • What protocol is recommended for communicating between the computer and cobot?
    I think this can be done with TCP/IP and RTDE, but I am not sure what is best for this scenario, how they work, or how to implement them.

I appreciate any help

I think RTDE is the best way for you to comunicate with an external PC see Real-Time Data Exchange (RTDE) Guide - 22229

Using this you can set and read Boolean, Real and Integer registers to give you the flexibility you need for speed control.