Joint compliance in non-thumb fingers

Discussion in 'HAPTIX' started by David Kluger, May 29, 2015.

  1. When we try to grasp objects with the virtual limb, we are finding it difficult to pick up and grasp objects. While increasing frictional coefficients helps, we are noticing that the non-thumb fingers do not conform well to the objects it is trying to grasp and objects fall or pop out of the hand as a result. Our hypothesis is that more contact with phalanges will improve gripping, but we are having trouble getting all three phalanges of the fingers to flex and conform around objects. The lack of contact occurs because flexing the fingers causes them to curl so only one segment of the fingers ever contacts the objects at a time (unless the object has the "perfect" shape). The lack of contact is exacerbated by interphalangeal joints not being very compliant.

    My initial reaction was to increase the "compliance" field as intuition tells me more compliant joints would conform better to objects in the simulation. The modelling overview indicates compliance as one of the joint fields which we can tweak. However, MuJoCo does not seem to recognize this field and throws an error when I add this call to joint declarations in the .xml files. Is this because the MPLs you are modelling the virtual limb after will not be able to have compliant joint motors?

    Is there another method to increase joint compliance? Is the error MuJoCo returns when I try to change compliance a bug?
     
  2. Emo Todorov

    Emo Todorov Administrator Staff Member

    The modelling overview chapter is outdated; the plan is to rewrite it over the summer. For now, look at the XML tab in the "?" dialog; it shows all valid XML elements and their attributes. The "compliance" field is no longer used, so the parser is complaining for good reason.

    I suspect your intuition is correct and if you increase compliance the fingers will morph around objects and give you more stable grasps. However you need to change the compliance of the equality constraints (used to enforce mechanical coupling) rather than the joints. Look at the section <equality> towards the end of the XML. The <tendon> elements create equality constraints fixing the length of the specified tendon to zero. These "tendons" are simply combinations of joint angles defined in the preceding section (MuJoCo also supports spatial tendons that wrap around objects but we are not using them here). So to increase the compliance of any one of these constraints, replace:

    <tendon name="E_index32_cpl" tendon1="T_index32_cpl"/>

    with

    <tendon name="E_index32_cpl" tendon1="T_index32_cpl" solprm="10 10 20 100"/>

    The field solprm changes the properties of the constraint solver (it can also be used for contacts, joint limits and dry friction). The four numbers are M, M, B, K where M is constraint mass, B is constraint damping and K is constraint stiffness. This is a new type of soft constraint model and is not easy to explain in a forum, see this paper for details:

    Convex and analytically-invertible dynamics with contacts and constraints: Theory and implementation in MuJoCo
    Todorov E (2014). In International Conference on Robotics and Automation
    http://homes.cs.washington.edu/~todorov/papers/TodorovICRA14.pdf

    Briefly, assuming x is the constraint deformation and f is the constraint force computed by the solver, the dynamics of the constraint deformation are:

    M * (xddot + B*xdot + K*x) = f

    This is integrated implicitly so it tends to be very stable, but nevertheless the deformation behaves roughly like a mass-spring-damper (only roughly because the force f computed by the solver is anticipating the constraint).

    So in a nutshell, smaller values of M, B, K correspond to more compliant constraints. Note that critical damping corresponds to B = 2*sqrt(K), and that M scales B and K. The reason M is repeated twice is because by making the two values different you can enable a soft layer effect (which also requires setting the margin parameters).

    I am not sure that (10,10, 20, 100) are good values; you can experiment.

    One problem you may encounter is that we are actuating only one joint and relying on the constraints to move the coupled joints. So if you make the constraints compliant this will effectively reduce the actuation... maybe we should redefine the actuators to act in a more distributed way, affecting all coupled joints directly.
     
    Last edited: May 31, 2015
  3. I tried editing this feature in the .xml. I removed the proximal-intermediate phalanx coupling from the MCP actuator and added a second actuator to control the distal two phalanges for the index finger. The two distal phalanges are still coupled. I opted for this method just by trying to flex my index finger in unique ways. I find it easy to keep my index finger straight and flex from the metacarpal-proximal joint. I find it difficult to keep the intermediate-proximal joint straight and flex the distal-proximal joint. This gives us much more control over finger position and allows us to grasp more complex geometries, but the added DOF to each finger may be difficult to control with neural decodes (this is something we have never attempted before). I will try solprm modifications to see if helps.
     
    Last edited: Jun 1, 2015
  4. solprm modifications do not appear to add the compliance we are looking for in the fingers. Is there a way to change how the fingers actuate, possibly editing tendon fields other than solprm, to achieve this goal?
     
  5. Emo Todorov

    Emo Todorov Administrator Staff Member

    I agree about added DOFs -- it is not a good idea given the neural decoding context. And besides, the actual devices do not have that many independent motors.

    The change I had in mind was indeed to edit the actuators so that they act directly on all coupled joints and not just on the base joint. If you also make the equality constrains more compliant (to reduce the coupling) the combined effect should be better passive curling around objects.

    Currently the actuators act on single joints. To make them act on combinations of joints, define a "fixed tendon" with the desired linear combination of joints, and then define the actuator as acting on this tendon... don't know how doable this is given the incomplete/outdated XML documentation on the website though.
     
  6. Any advice on how to accomplish this given the lack of documentation would be greatly appreciated. Thank you.
     
  7. Vikash Kumar

    Vikash Kumar Guest

    1) Add a fixed tendon over the joints you want it to act over. Use with the "coef" values to choose the moment of the tendon over each joint.

    <!--Index finger tendon-->
    <tendon>
    <fixed name="T_index123_cpl">
    <joint joint="index_DIP" coef="0.00205"/>
    <joint joint="index_PIP" coef="0.00405"/>
    <joint joint="index_MCP" coef="0.00705"/>
    </fixed>
    </tendon>


    2) Replace the actuator to act over the tendon instead of the joint. Use "kp" to choose the overall gain of the position actuator over the tendon.

    Replace <position name="A_index_MCP" joint="index_MCP" ctrlrange="0 1.6"/> with <position name="A_index" tendon="T_index123_cpl" kp="100" ctrlrange="-1 1"/> in the actuator section.
    {UPDATE: Replace with <position name="A_index_MCP" tendon="T_index123_cpl" kp="10000" ctrlrange="-0.0001 0.015"/>}

    Above changes were tested with objects of different curvature at different position relative of the palm. Attached figures show representative wrapping achieved.
    1.PNG 2.PNG 3.PNG 4.PNG 5.PNG 6.PNG 7.PNG 8.PNG 9.PNG 10.PNG
     
    Last edited by a moderator: Jun 16, 2015
  8. The finger compliance with this approach is exactly what we are looking for, but this comes at the expense of maintaining positional control of the finger. Controlling the actuator in the way you suggested causes the fingers to flex/extend until their control limit is reached when the actuator is at any level +/- 0, respectively. We need to have positional control over the fingers AND compliance when an object comes between the finger and palms. Now that I have a better grasp on what the fixed tendon and equality fields do, I will tinker and try to make this happen myself. I will post if I come up with anything. If you come up with a solution in the meantime, I would greatly appreciate hearing about it.
     
  9. Vikash Kumar

    Vikash Kumar Guest

    Seems like that was caused due to wide control range provided in 'ctrlrange' field of the actuator. Here are revised instructions

    1) Add a fixed tendon over the joints you want it to act over. Use "kp" with the "coef" values to choose the moment of the tendon over each joint.

    <!--Index finger tendon-->
    <tendon>
    <fixed name="T_index123_cpl">
    <joint joint="index_DIP" coef="0.00205"/>
    <joint joint="index_PIP" coef="0.00405"/>
    <joint joint="index_MCP" coef="0.00705"/>
    </fixed>
    </tendon>


    2) Replace the actuator to act over the tendon instead of the joint. Use "kp" to choose the overall gain of the position actuator over the tendon.

    Replace <position name="A_index_MCP" joint="index_MCP" ctrlrange="0 1.6"/> with <position name="A_index_MCP" tendon="T_index123_cpl" kp="10000" ctrlrange="-0.0001 0.015"/> in the actuator section.