Servo Motor - Set toque limit

Hi all,

I wish to hold the position with a servo motor only up to a predetermined torque. For instance, I’d like keep the position of the servo at 0° if a counter moment less than 1 Nm is applied. If otherwise larger I’d like the servo to allow the rotation while holding this torque.

I’m using:
Servo: Dynamixel *XH540-W270-T/R *
Control: Dynamixel OpenCM 9.04 with 485 Expansion Board
I found in the Dynamixel_Serial.h library the function Dynamixel.setMaxTorque (L, H) which allow to set upper (H) and Lower (L) operation torque limits. Unfortunately this library doesn’t work with the OpenCM combination.

Question: I kindly ask you to help me to write a function to accomplish this simple task, or maybe there is another way to solve the problem that I have not found so far. I’m considering to use the DynamixelWorkbench.h library, therefore would be ideal to stay in this environment if possible.

doesn’t torque depend on the effective voltage (less BEMF) applied to the motor? so wouldn’t limiting the voltage when the rpm is zero or small be sufficient?