Using RevoluteJoint to track an angle (jittering problem)

I have been using the code listed in the manual to orient one body around another based on the cursor position.

Code:
... Game Loop Begin ...

float32 angleError = myJoint->GetJointAngle() - angleTarget;

float32 gain = 0.1f;

myJoint->SetMotorSpeed(-gain * angleError);

... Game Loop End ...


Where angleTarget is calculated using atan2 and the cursor position. My problem is that unless the two bodies are very close to each other the joint oscillates somewhat around the target angle instead of staying stationary. What is the best way to overcome this? I have seen a few threads related to this problem but haven't been able to find a solution that works.
What happens if you make the max motor torque very large?
Doesn't seem to make any difference. If I want to rotate one body around another, and they don't share the same anchor point, is there a better joint to use or perhaps a combination of joints? The problem with altering the motorspeed on the fly seems to be that it can overshoot the target angle due to the angular velocity the rotating body gains. This causes the body to oscillate around the target angle.
I guess I don't understand your setup.

It is hard to get motors to track exactly, but I can often get a good result without jittering. Perhaps you can make a video or a testbed example.

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