Skip to main content
Version: v2

Joint torque

note

There are two torque streaming modes:

  • 5 Joint torques on top of gravity compensation
  • 6 Joint torques without gravity compensation
danger

In the torque modes, the controller does not follow a trajectory. Only your torques move and hold the Robot. In mode 6, the Robot falls if your torques do not compensate gravity. Keep your hand on the emergency stop button and start with small torques.

Streaming message format

Streaming message format for the joint torque modes

OffsetFieldTypeUnit
0Indexuint8–
1Mode (5 or 6)uint8–
2Number of joints nuint8–
3Joint torques, one per jointn × doubleNm

Message length: 3 + 8 · n bytes. n must equal the number of joints of the Robot. The format is the same as in the Joint position mode, with torques instead of positions.

Behavior​

After the Start streaming request, the controller is in the ready state and holds the Robot in position until the first valid torque command arrives. With the first valid command, the drives switch to torque control and the state changes to streaming.

From then on, the controller applies the latest valid torque command in every control cycle. There is no filter and no interpolation: the command stays unchanged until the next valid command arrives. A command older than 100 ms stops streaming, so send commands at a steady rate well above 10 Hz. target_frequency must still be between 50 Hz and 500 Hz, but is not used otherwise.

The two modes differ in what is applied:

  • Mode 5: the drives receive the gravity compensation torque, calculated by the controller from its dynamic model of the Robot and the configured payload, plus your torque. A command of all zeros lets the Robot float, as in hand guiding. It may slowly drift due to model inaccuracies or a wrongly configured payload.
  • Mode 6: the drives receive your torque only, without any model based feed-forward. For the first 200 ms after the first command is applied, the controller checks that the Robot stands still: if any joint moves by more than 1°, streaming stops and the controller reports status code 0x0241. This catches a controller that does not compensate gravity correctly.

The controller discards a torque command, keeps the latest valid one and logs a warning, if:

  • the torque of any joint, plus the gravity compensation torque in mode 5, exceeds the peak torque of the drive,
  • the joint count does not match the Robot, or
  • it contains non-finite values (NaN, infinity).
warning

Besides the safety functions, nothing but your controller keeps the Robot within its limits. The controller only stops streaming when a joint reaches its soft limit. For all stop conditions, see Stop conditions.

When streaming ends, the controller switches back to position control in the same control cycle and decelerates the Robot to standstill.

Feedback​

For a torque control loop, enable the joint torque feedback message (0x06). It contains the measured joint positions together with the commanded torque, the torque estimated by the drives and the model based torque.