Using tendons as actuators: how is moment arm determined?

Discussion in 'Simulation' started by Chris Richards, Jun 20, 2016.

  1. I'm setting up a muscle-like system applying point forces to sites on the links in my model. I'm using tendons as actuators and they seem to be behaving as expected. However, I just want to confirm if my understanding is correct: Is it true that the software automatically computes the actuator's moment arm given the tendon path that I define? I.e., as the tendon dynamically moves with respect to the joint, will the the software likewise compute the joint torque as if the actuator's line-of-action is through the path of the tendon at each instant in time?

    Thanks very much for your time,
    Best,
    Chris
     
  2. Emo Todorov

    Emo Todorov Administrator Staff Member

    Yes, the software automatically computes the tendon spatial path, length and moment arm at each simulation step.

    Btw, there is a bug in site actuators which will be fixed in the next release -- the coordinate transformation from local forces to global forces is transposed at the moment. You can instead apply forces directly on the bodies by setting xfrc_applied; this works correctly.
     
  3. OK, that's perfect.

    Thanks also for the heads-up about the bug in site actuators. I have noticed some strange behavior (which could be my own error or bug-related).

    Currently I have a model with two identical 'legs' attached to a pelvis in the middle. I'm trying to actuate the femur on the right side only, but the sim behaves as if the forces are applied to the left side. I'm still troubleshooting this issue, but can you tell me whether my implementation will encounter the bug you mentioned?

    In my .xml file:
    Code:
        <actuator>
      
            <!--  ================= Torque actuators ================= /-->
            <motor tendon='t_hRET_R'     name='a_hRET_R' gear="0 0 1 0 0 1"/><!--hip retractor, right side -->
            <motor tendon='t_hADD_R'     name='a_hADD_R' gear="0 0 1 0 0 1"/><!--hip adductor, right side -->
    
        </actuator>
    In my .c file:
    Code:
    {
        int switches[2] = {1, 1};//to toggle constant force
        for( int i=0; i<nu; i++ )
            qfrc_applied[i] = -0.5* switches[i];
    }
    So, I am currently using xfrc_applied, but it is within the actuator model. Does this mean I am experiencing issues related to the bug? How would I use qfrc_applied 'through' a tendon without specifying that as an actuator within the .xml code?

    Thanks again,
    Best,
    Chris
     
    Last edited: Jun 23, 2016
  4. Emo Todorov

    Emo Todorov Administrator Staff Member

    The bug I mentioned is related to site actuators - which you are not using. In your code, you are setting qfrc_applied which generates torques on the joints (in the order defined in the XML) and bypasses the actuation model. To use the actuators, you have to set ctrl rather than qfrc_applied.

    Also, for tendon actuators you should be using a scalar gear. The vector gear is only used for site and ball joint actuators. The way you have it now, the first element of gear is 0, which effectively disables the tendon actuator. I recommend removing the gear attribute altogether; for tendons the natural setting is 1, which is the default. Gears make sense when you model gear boxes or cables, with transmission ratios that depend on the mechanism. But for tendons, the moment arm does the necessary scaling and there is no need to apply additional scaling using the gear attribute.

    To illustrate the use of tendons, attached is a model of an index finger with 4 complicated tendons (this is a robotic model with unusual tendon routing). You can select the counter-weight objects and perturb them with the mouse to see it moving. It does not have actuators but it is easy to add them to the tendons.
     

    Attached Files:

  5. OK, fantastic, it works now!

    Thanks very much.