Machine Joint using torque control (from hinge rigid body constraint)

Hi,

I have managed to build a couple of 2d joints using hinge rigid body constraints, I then add force to the rigid body and I can move the object around the hinge, and I use collision to resrict the movement. However, on releasing the force, the arm drops. I wish to have a more machine like feel where the joint is controlled with maybe torque (so varying strength) and if the instruction to move stops it can stay in place.

This is my progress with a hinge rigid body constraint… (E key to see force effect).

TorqueExample02.blend (521 KB)

Any help or advice would be greatly appreciated.

UPDATE: Torque added, it requires some tinkering with the angle of the hinge constraint to enable the torque to work. However, the torque is applied to the object not the constraint. I know Bullet API has a motor for the torque constraint, any idea how to get to this via Blender?
Cheers,
Jon