Torque control

Typically: "How do I... ", "How can I... " questions
alphaUser
Posts: 19
Joined: 12 Feb 2013, 15:24

Torque control

Post by alphaUser »

How would I adjust a joint so that it operates in torque control?

Thanks

coppelia
Site Admin
Posts: 7838
Joined: 14 Dec 2012, 00:25

Re: Torque control

Post by coppelia »

EDIT: make sure you read this section.


Hello,

Double-click your joint icon in the scene hierarchy. This opens the joint properties dialog. There, make sure your joint is in "force/torque mode". Then, click "show dynamic parameters" to open the dynamic properties dialog for that joint. There, check "motor enabled" and uncheck "Position control enabled". Set a very high target velocity (e.g. 99999). Now your joint will be controlled with the indicated force/torque. If your joint has no load, or a very small load, then it might reach the target velocity in one simulation step.

You can adjust that value programmatically with simSetJointForce

Cheers

ironmanames
Posts: 1
Joined: 14 Feb 2013, 19:09

Re: Torque control

Post by ironmanames »

Won't this only apply torque in one direction? If the torque needs to be applied in the other direction won't you need to set the velocity the other direction? Or can you set a negative torque?

nikolaus
Posts: 18
Joined: 13 Feb 2013, 23:17

Re: Torque control

Post by nikolaus »

You can't set a negative torque; you have to swap the sign of the velocity.

betaUser
Posts: 1
Joined: 15 Feb 2013, 19:23

Re: Torque control

Post by betaUser »

I have attempted to control a joint using "torque control" as you explained, but I am not getting the desired behavior. Using a standard open loop controller on a three link pendulum, it seems that the momentum created by the velocity saturation caused the joints to "pulse." I have also attempted to alter the source code in the dynamics plugin.

At line 1376 in ConstraintDyn.cpp, I changed the two lines:

Code: Select all

dJointSetHingeParam(_odeConstraint,dParamFMax,_simGetDynamicMotorMaxForce(joint)*torqueScaling); //********** SCALING
dJointSetHingeParam(_odeConstraint,dParamVel,vel);
to be:

Code: Select all

dJointAddHingeTorque (_odeConstraint, simGetDynamicMotorMaxForce(joint)*torqueScaling);
using the max force variable for a quick hack. I am still observing a pulsing behavior in the joints. Any suggestions?

coppelia
Site Admin
Posts: 7838
Joined: 14 Dec 2012, 00:25

Re: Torque control

Post by coppelia »

Hello betaUser,

Can you send us a simple example scene that illustrates this?
Please send it to info coppeliarobotics com
Thanks

nikolaus
Posts: 18
Joined: 13 Feb 2013, 23:17

Re: Torque control

Post by nikolaus »

Hey there,
I'm trying to use torque mode to control a joint, and I'm having an issue. Namely, if I make an inverted pendulum, I can't seem to be able to stop it from falling over. I set the velocity to 0, and the force to 1,000,000, and it still slowly falls down. Is this just integration error or something? Should I be unconcerned?
Thanks!

coppelia
Site Admin
Posts: 7838
Joined: 14 Dec 2012, 00:25

Re: Torque control

Post by coppelia »

Hello Nikolaus,

You probably want to use your joint in position control mode.
Or, if you want to directly control the force/torque exerted, then you will have to turn up the velocity to a high value, then regulate the force/torque. Remember that the physics engines do not operate like reality, and it can help to read the respective documentations. What basdically happens is:

1) the engine will apply the specified torque/force to the joint
2) if the load on the joint is very small, the maximum velocity will be reached in one simulation step. And the joint will stay at that maximum velocity
3) if the load on the joint is high, the joint will accelerate, until the maximum velocity is reached

So you see it doesn't make any sense to use the joint with zero velocity (unless you want to simulate friction in a passive joint)

From V-REP 3.0.2 to be released around mid-March 2013, you will be able to directly write low-level joint controllers in Lua.

Cheers

Husnu

Re: Torque control

Post by Husnu »

Hi Marc!

Thanks a lot for the great work.

As far as I understand from the discussion above, there is no explicit way to control a robot joint in a purely torque control mode?
For instance, I just calculate some task-specific torques (without concerning max velocity etc.) and implement it to actuators.
Is that possible?

coppelia
Site Admin
Posts: 7838
Joined: 14 Dec 2012, 00:25

Re: Torque control

Post by coppelia »

Hello Husnu,

yes, that is possible.
If you want a pure torque control, then:
Since you can only specify positive forces/torques for a joint, you will have to set the sign via the target velocity.

Cheers

Post Reply