Units and expression for SpringGeneralizedForce
Posted: Tue Jan 05, 2021 7:05 am
Hi all,
For a simple model of walking with a transtibial prosthesis, I remove all the ankle muscles and replace them with a linear torsional spring-damper: F = k*q + b*qdot, where q and qdot are the coordinate and its speed and F is the moment at the coordinate. Previously I've done this with ExpressionBasedCoordinateForce, which works well (optimizer converges on good results):
In this example the spring stiffness k = -400 Nm/rad and the damping b = -1.0 Nm/(rad/s). I would like to have Moco optimize the values of these parameters (k and b), which I think can't be done using ExpressionBasedCoordinateForce, so I've switched to SpringGeneralizedForce and am struggling to get good results:
I first tried SpringGeneralizedForce with stiffness = 400 and viscosity = 1.0 and the optimizer would not converge. I then tried it with the values above, stiffness = -400 and viscosity = -1.0. This time the optimizer converged but the result was not good, bad tracking of the target data and too-high muscle activity.
For SpringGeneralizedForce, can anyone confirm what the units should be on stiffness and viscosity for rotational coordinates, e.g. Nm/rad vs. Nm/deg, and if the negative signs in the XML tags above are needed, i.e. is the expression that's implemented F = -k*q - b*qdot or F = k*q + b*qdot, or something else? I checked the SpringGeneralizedForce documentation but couldn't find this info.
Thanks much!
Ross
For a simple model of walking with a transtibial prosthesis, I remove all the ankle muscles and replace them with a linear torsional spring-damper: F = k*q + b*qdot, where q and qdot are the coordinate and its speed and F is the moment at the coordinate. Previously I've done this with ExpressionBasedCoordinateForce, which works well (optimizer converges on good results):
Code: Select all
<ExpressionBasedCoordinateForce name="prosthetic_ankle_r">
<coordinate>ankle_angle_r</coordinate>
<expression>-400.0*q-1.0*qdot</expression>
</ExpressionBasedCoordinateForce>
Code: Select all
<SpringGeneralizedForce name="prosthetic_ankle_r">
<isDisabled>false</isDisabled>
<coordinate>ankle_angle_r</coordinate>
<stiffness>-400.0</stiffness>
<rest_length>0</rest_length>
<viscosity>-1.0</viscosity>
</SpringGeneralizedForce>
For SpringGeneralizedForce, can anyone confirm what the units should be on stiffness and viscosity for rotational coordinates, e.g. Nm/rad vs. Nm/deg, and if the negative signs in the XML tags above are needed, i.e. is the expression that's implemented F = -k*q - b*qdot or F = k*q + b*qdot, or something else? I checked the SpringGeneralizedForce documentation but couldn't find this info.
Thanks much!
Ross