# Gear coupling?

Discussion in 'Priority support' started by rubstar, Feb 10, 2020.

1. ### rubstar

I'm working on a 1 DoF gripper. Is it possible to couple the two jaws using a "virtual" gear? I want the jaws to be kinematically constrained, and have just 1 actuator.

This is what the gripper looks like:

3. ### rubstar

Hi Emo,

I see the equality constraints, and I'm using them for the 4-bar linkage, but it's not clear how to couple the two driving actuators into one. I've highlighted where the actuators sit and attached the .xml for this particular setup.

File size:
3.8 KB
Views:
243
4. ### rubstar

So I was able to solve the above problem using the "coupling" equality, but now I have an issue with numerical stability using solref for the anchor links that complete the kinematic chain. I want the position of the anchor to be as rigid as possible, so I'm using solref="-1000000 -1000". The problem is as the stiffness terms gets large, I start to lose stability. Any advice on fixing this. Attached is the .xml

#### Attached Files:

• ###### gripper.xml
File size:
5.2 KB
Views:
248

Large stiffness always leads to instability when integrating ODEs. You could make the step size smaller or use RK4, but it is better to reduce the stiffness. Also, did you try positive numbers for solref?

6. ### rubstar

Thanks Emo,

Is there another approach for closing the kinematic chain other than using an anchor equality constraint?

You have to use a constraint, no matter how you formulate the kinematics and dynamics of the system. MuJoCo uses minimal coordinates where some constraints are imposed by the kinematic tree and cannot be violated, while the rest have to be imposed numerically. The alternative is to use over-complete representations where all constraints are imposed numerically.

The only way around this is to explicitly construct a (nonlinear) coordinate system over the manifold of configurations satisfying the constraints, and express the physics in those coordinates. Then constraint violations will never occur. However you would have to do a lot of math and coding for every new system; basically you will be deriving new equations of motion (on the bright side, the resulting equations will be named after you The point of a physics engine is to avoid this effort and automate the process as much as possible.

If you can always reduce constraint violations by decreasing the time step and increasing the stiffness, but the simulation slow down.