How to add a torque as a function of the joint angle and angular speed

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
POST REPLY
User avatar
Kuang Nie
Posts: 1
Joined: Sun Jan 17, 2021 3:16 pm

How to add a torque as a function of the joint angle and angular speed

Post by Kuang Nie » Thu Jan 09, 2025 8:02 pm

Hi all,

I have customized a two-link structure imported to the OpenSim, I need to define a torque between 2 links at the revolute joint of the manipulator as a function of the joint angle and speed. Does anyone know how to define that?

Thank you!

Tags:

User avatar
Jon Stingel
Posts: 17
Joined: Fri Jan 19, 2018 5:54 pm

Re: How to add a torque as a function of the joint angle and angular speed

Post by Jon Stingel » Tue Jan 14, 2025 4:43 pm

Hi Kuang,

Based on your description it sounds like an ExpressionBasedCoordinateForce could be what you are looking for. It allows you to specify the coordinate that the force should be associated with, and then provide an expression that includes the joint angle (q) and velocity (qdot).

For a made up example of how this looks in an .osim file:

Code: Select all

<ExpressionBasedCoordinateForce name="Name_Your_Force">
	<!--Coordinate (name) to apply force to.-->
	<coordinate>Your_Coordinate</coordinate>
	<!--Expression of the force magnitude as a function of the coordinate value (q)and its time derivative (qdot). Note, expression cannot have any whitespaceseparating characters-->
	<expression>(-0.4*qdot)+(5*q)</expression>
</ExpressionBasedCoordinateForce>
Hope this helps!
Jon

POST REPLY