Reading torque (current)

I know how to track the current in MotionScope following the instructions that you provided, but now I want to capture this value in our telemetry code. Looking at the memory.cpp sample I’m guessing it would be something like:
addr = axis->AddressGet(RSIAxisAddressType::RSIAxisAddressTypeDEMAND );
current = controller->MemoryGet(addr));

Is this correct? What are the units on the current returned?

That’s close. In fact, the DEMAND is a 64-bit double. (Even though the torque demand is usually sent to drives with a 16-bit range.)

So you’ll need to use:

current = controller->MemoryDoubleGet(addr);

Where you should expect to see a value that ranges from 32767.0 to -32767.0.

However, this torque demand is only valid if your drive is in Cyclic Torque mode. Most RMP users are using Cyclic Position mode, so the torque demand would always be zero. Is your drive in torque mode?

Thanks, I did wonder about the torque demand as it didn’t seem quite right. You are correct, we are using Position Mode. How do we read the torque/current in Position Mode? I don’t know if it’s important but we are using AKD motors.

Ok, so you’ll be able to read the “Torque actual value” directly from the PDO network input.

You’ll need to know the index of the network input. You can use NetworkInputNameGet() to confirm you’ve got the right one.

Then you can use NetworkInputValueGet() to read the value. You’ll need to scale it to a signed 16-bit value in your software.

Here it is in RapidSetup:

We got the basic functionality working using your suggestions and we see the same numbers that are showing in Network data.
What units are the values in? I know its a 16 bit value but it doesn’t seem to be directly related to the current. Also is it a signed or unsigned value.
When we track the value during our moves we see some interesting results. We have three servos which hold a position and a forth Z servo which is pushing down and compressing onto the other three servos. When this compression starts, we see the current/torque values increasing on the three servos which are holding position, and this is as expected since they need to exert more torque to hold position against the downwards pressure. The z servo behaves differently, as soon as it starts moving, the torque goes from a small number, ~40 to ~65500 and stays there until it moves back up. Any idea why the we get this off/on behavior with Z servo?

The drive determines what units are returned. If it follows the DS402 standard (likely), it should be per thousand of rated torque. Its a good idea to check the manual. The AKD follows the standard so a value of 1000 represents 100% rated torque.

Note that the 16 value has a max value of 65536 which is really just -1 or 0.1 rated torque. You should operate mostly in the (negative 64537-65536-0-1000 positive 100%) range. Peak torque is fine beyond these but will wear your system.

Just want to say thanks. We have this all working now and it’s very helpful.