Revolute Joint with Spring Like Behavior

I'd like to use a joint that has both revolution and spring like behavior. A good example of what I'm looking for would be a door knob. You turn it one way and when you let go it springs back to it's normal position. So far I have a b2RevoluteJoint set up, but I'm not seeing a clear way to create this effect. Any ideas?

Thanks,
makemachine
What you need to do is update the torque and speed every frame. To adjust torque is easy; just use Hooke's Law (http://en.wikipedia.org/wiki/Hooke%27s_law) in a rotational form, where x = the angular distance between the current joint angle and the desired angle. Friction, if desired, can be laid over this simply by subtracting a set amount from the net torque.

Setting the desired speed is pretty simple in this context. Set it to an arbitrarily high value in the current direction in which there is an active force, or zero if the net force is zero. To reduce jitter at the expense of a little accuracy, if you experience any of the former, any time the motor torque (ignoring friction) would be lower than a certain threshold, ignore it, apply frictional torque and set target speed to zero.

Original thread: https://box2d.org/forum/viewtopic.php?t=6851