ros-industrial / abb_libegm

A C++ library for interfacing with ABB robot controllers supporting Externally Guided Motion (689-1)
BSD 3-Clause "New" or "Revised" License
96 stars 54 forks source link

Read joint motor torques using EGM resources #86

Closed Mariunil closed 4 years ago

Mariunil commented 4 years ago

Hi,

We are working on external control of the ABB YuMi, and wish to read the joint motor torques of the arm's joints and send these to the external computer controlling the robot, preferably at a high Hz.

Are there any EGM routines which can be used to retrieve and transmit this information? If not, what would be our best bet at fetching these values?

jontje commented 4 years ago

Hi @Mariunil,

You could perhaps use TestSignDefine(Channel SignalId MechUnit Axis SampleTime) in the RAPID code to setup some test signals.

Extract from the manual:

The following test signals are available for both robot and additional axes and are predefined in the system. All data is measured on the arm side of the axis. Test signal Signal ID Unit
Position 4000 degrees or mm [1]
Speed 4001 degrees/second or mm/s [1]
Torque 4002 Nm
External torque [2] 4003 Nm

[1] The unit depends on if the axis is rotational or linear. [2] Returns an estimated externally applied torque (by contact with the environment). On an additional axis External torque might not be valid.

And here are two potential options for accessing the test signal values.

Option 1

The EGM protocol has a field for test signals, but I haven't tried to use this myself so I haven't exposed this in the abb_libegm's interface classes. But it might be worth to investigate.

Option 2

Use abb_librws to setup a RWS subscription to an IO-signal, so that you get a notification with its new values when it is updated.

Then create a RAPID timer that periodically reads the test signals and updates the IO-signal. If I remember correctly, then RAPID timers can only run at 10 Hz. And if the timer is too slow, then you could setup a separate RAPID task which can run faster but is slightly more complicated to configure than a timer.

Also, I haven't looked, but there might exist RWS services for reading test signals directly. Please note that RWS is not designed for high performance, but I would suggest to at least try it out.

I hope this can help!

AlbertoRemus commented 4 years ago

You could perhaps use TestSignDefine(Channel SignalId MechUnit Axis SampleTime) in the RAPID code to setup some test signals.

Test signal Signal ID Unit
Position 4000 degrees or mm [1]
Speed 4001 degrees/second or mm/s [1]
Torque 4002 Nm
External torque [2] 4003 Nm

Option 1 The EGM protocol has a field for test signals, but I haven't tried to use this myself so I haven't exposed this in the abb_libegm's interface classes. But it might be worth to investigate.

Hi all,

I'm working with my team on a ABB IRB 2600 6-axis industrial robot, we're setting up all the motion control framework based on abb_libegm for high performance, and testing the implementation against RobotStudio.

Since we also need the measurements of joint motor torques, the above comment has been really useful to us.

Considering we are interested in Option 1, I investigated a little bit and performed the following steps to be able to extract the test signals:

To see if the signals are actually read, in a semistatic task I perform:

MODULE TGetMotorTorques(SYSMODULE)

    PROC main()

        VAR num torques{6};

        WHILE TRUE DO

            FOR ii FROM 1 TO 6 DO
                torques{ii} := TestSignRead(ii);
            ENDFOR  

            SetAO motorTorque1, torques{1};
            SetAO motorTorque2, torques{2};
            SetAO motorTorque3, torques{3};
            SetAO motorTorque4, torques{4};
            SetAO motorTorque5, torques{5};
            SetAO motorTorque6, torques{6};

            WaitTime 0.004;

        ENDWHILE

    ENDPROC

ENDMODULE

And by inspecting with the Signal analyzer I can see the 6 measured torques values changing accordingly to an imposed motion.

However the problem is that when I try to read this values as:

abb::egm::wrapper::TestSignals jointTorques;
        jointTorques.CopyFrom(dataPtr->in_buffer_.testsignals());

google::protobuf::RepeatedField<double> signals = jointTorques.signals();

by printing signals I get this strange values X 0 0 0 0 0, where X seems to be a counter increasing of one unit after each run.

Could you explain me if the pipeline followed is correct and, if not, which are the faulty stages?

I remain at disposal for clarification about my comment.

jontje commented 4 years ago

Hello @AlbertoRemusIIT,

by printing signals I get this strange values X 0 0 0 0 0, where X seems to be a counter increasing of one unit after each run.

I ran a simple test of my own, and I experienced the same behaviour as you. I have checked with one of the developers, and unfortunately it seems that the test signal part of EGM has not been fully implemented.

Could you explain me if the pipeline followed is correct and, if not, which are the faulty stages?

The pipeline looks fine, and as I mentioned above, then the fault is inside the robot controller.

AlbertoRemus commented 4 years ago

Thanks a lot for the feedback @jontje, I'll stay tuned for any update.

gavanderhoorn commented 4 years ago

@jontje: what are the chances of this getting fixed "upstream"?

If there is a chance, we can keep this open as blocked on dependency. Otherwise I suggest we close it (for now).

jontje commented 4 years ago

@jontje: what are the chances of this getting fixed "upstream"?

If there is a chance, we can keep this open as blocked on dependency. Otherwise I suggest we close it (for now).

I think the chances are slim at the moment, at least that was the impression I got.

So I will close this for the time being, but feel free to post additional comments if necessary.

gavanderhoorn commented 4 years ago

According to this post on the RobotStudio forum, this should now work ?

jontje commented 4 years ago

According to this post on the RobotStudio forum, this should now work ?

Unfortunately, no, I don't think so. This issue is about the testSignals field in the EGM messages, and not the measuredForce field.

What I understood from the post is the following:

Also, I haven't seen anything in the RobotWare release notes about EGM getting full support for test signals.

gavanderhoorn commented 4 years ago

Hm, teaches me to post something without fully reading it :(

Too bad though. Any idea why the test signals part is not implemented fully?

Seems like something that would be really worthwhile to have.

jontje commented 4 years ago

Hm, teaches me to post something without fully reading it :(

No worries, it's better to ask than not.

Too bad though. Any idea why the test signals part is not implemented fully?

Hm... I don't know, maybe because there haven't been enough customer requests about it.

Seems like something that would be really worthwhile to have.

I agree, it would be useful.

traversaro commented 4 years ago

Too bad though. Any idea why the test signals part is not implemented fully?

Hm... I don't know, maybe because there haven't been enough customer requests about it.

On which channel do you think it would be more appropriate for a customer to make a request in this direction?

jontje commented 4 years ago

On which channel do you think it would be more appropriate for a customer to make a request in this direction?

I suggest to try one of these channels:

buckleytoby commented 1 year ago

@jontje Has there been any updates on this endeavor? Using test signals to read out joint torque values?