forces in joints

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
POST REPLY
User avatar
Uwe Mittag
Posts: 23
Joined: Mon Dec 06, 2010 2:09 am

forces in joints

Post by Uwe Mittag » Fri Jun 21, 2013 5:12 am

Hi,

I would like to implement kind of backdrawing forces/angular momenta in a free joint (on the way to a multisegment simulation of an elastic body, e.g. a stick or later a human tibia). Best would be, if it would be possible to define a kind of potential for every coordinate. Is that possible or has that already been done with OpenSim?

Thanks and regards
Uwe

User avatar
Michael Sherman
Posts: 807
Joined: Fri Apr 01, 2005 6:05 pm

Re: forces in joints

Post by Michael Sherman » Fri Jun 21, 2013 9:24 am

Hi, Uwe. OpenSim 3.1 has several "bushing" force elements that might serve your purpose. They are: BushingForce, FunctionBasedBushingForce and ExpressionBasedBushingForce. These are intended to model stiffness and damping that resist relative motion between two coordinate frames in six degrees of freedom.

There is an example of BushingForce here.

Regards,
Sherm

User avatar
Uwe Mittag
Posts: 23
Joined: Mon Dec 06, 2010 2:09 am

Re: forces in joints

Post by Uwe Mittag » Tue Jun 25, 2013 8:40 am

Thanks Sherm,

I have implemented a bushing force (for three rotational degrees of freedom) into my simple model (two cylinders with a joint and the bushing force in between, one of it the "ground"). And my Opensim2.4.0 did not complain on loading the model (?). For upgrade I only found an Opensim v 3.0.1. on your download page.

I could not really test if it works, because my actuator, that I implemented at the end of the free second cylinder (for applying a bending force) does not seem working.

So next questions:
Do I really need a version 3.1 for the bushing forces, and if yes how can I get it?
How do I (as an Opensim newbee) get my actuator active for testing?

Thanks in advance
Uwe

User avatar
Ayman Habib
Posts: 2248
Joined: Fri Apr 01, 2005 12:24 pm

Re: forces in joints

Post by Ayman Habib » Tue Jun 25, 2013 10:50 am

Hi Uwe,

BushingForce is already included in 3.0.1 so you should be able to locate it and use it (the XML representation is shown in the Help->XML Browser window). My suggestion however would be to get version 3.1 (beta) which is available on the downloads page under the package "OpenSim Release Betas" as this has the more elaborate BushingForce(s) that Sherm described and will be the official release fairly soon. It would also help you upgrade to the latest API for ModelComponents which has been revamped in the 3.0 stream, and alert us to any upgrade issues that we need to document or fix.

Thanks and please let me know if you have any further questions.
-Ayman

User avatar
Uwe Mittag
Posts: 23
Joined: Mon Dec 06, 2010 2:09 am

Re: forces in joints

Post by Uwe Mittag » Wed Jun 26, 2013 2:29 am

Thanks again,

seems to work in principle, but when running the session I get an exception:

Integrating from 0 to 1000
ForwardTool::run() caught exception
SimTK Exception thrown at Integrator.cpp:427:
Integrator initialization failed apparently because:
SimTK Exception thrown at SmallMatrixMixed.h:878:
Error detected by Simbody method lapackInverse(Mat<>): Matrix is singular so can't be inverted (Lapack getrfinfo=1)

I assume, that I have to fix the "ground"-body, before I can apply any forces to the system. Am I right? How to do?

edit1:
sorry, I got it running now without error, after having set masses and inertia. But I can not see any motion in my system. What is the forward::run doing? Is it driving the actuator force from 0 to max value? Then I would expect to see increasing 'bending' of my system. But nothing happens. Only the time is running up.

Thanks and regards
Uwe

User avatar
Ayman Habib
Posts: 2248
Joined: Fri Apr 01, 2005 12:24 pm

Re: forces in joints

Post by Ayman Habib » Wed Jun 26, 2013 3:50 pm

Hi Uwe,

The ground body is always assumed to be fixed (you don't need to do anything on your side to force that). The message suggests excessive force/acceleration maybe due to missing inertial properties, or an issue with initialization of some force elements or muscles that cause very-large or infinite forces.

Could either of these be the case?

-Ayman

User avatar
Uwe Mittag
Posts: 23
Joined: Mon Dec 06, 2010 2:09 am

Re: forces in joints

Post by Uwe Mittag » Thu Jun 27, 2013 2:18 am

Thanks Ayman,

perhaps you missed my correction of my last post. I have added masses and inertia and the forward::run() activated by the green arrow is working error-free now, but nothing happens on the scene. I expect, that the upper cylinder would experience the actuator force (I went up to 80 with the optimal force, I think it is Newton,is it?) and would show bending against the bushing angular momentum (0.1 in all rotational coordiates,I guess it is Nm). I do not want to see dynamics at the moment, I would be very happy, if I could see the static reaction on a pushing actuator.

Thanks again and regards
Uwe

User avatar
Uwe Mittag
Posts: 23
Joined: Mon Dec 06, 2010 2:09 am

Re: forces in joints

Post by Uwe Mittag » Tue Jul 02, 2013 7:57 am

Sorry, were my questions too stupid? I really need a hint, how to activate or analyse my self-written little model. The tutorials did not really help me with that. Is it possible to upload my code in a text file?

Thanks again & regards
Uwe

User avatar
Jiang Ping
Posts: 132
Joined: Sun Aug 26, 2012 4:09 am

Re: forces in joints

Post by Jiang Ping » Tue Jul 02, 2013 8:27 am

Hi,

If you could poster your model here, maybe i can help you.

I have some questions about your model:
1. How many bodies are there in your model (including ground)?
2. What kind of force or actuator did you add to the model?
A passive bouncing force or a certain active actuator?

thanks,

Jiang

User avatar
Ayman Habib
Posts: 2248
Joined: Fri Apr 01, 2005 12:24 pm

Re: forces in joints

Post by Ayman Habib » Tue Jul 02, 2013 11:19 am

Hi Uwe,

Sorry I missed one of your earlier messages on this thread, particularly this part.
What is the forward::run doing? Is it driving the actuator force from 0 to max value? Then I would expect to see increasing 'bending' of my system. But nothing happens. Only the time is running up.
forward::run() integrates the equations of motion forward in time. It does not change actuator force on its own, instead an actuator has a control signal (usually provided by a controller) that affects what force it exerts on the system. If you want a Force instead (no control) then you should implement a Force object rather than an Actuator.

If you can use an off-the-shelf component in OpenSim and the model doesn't behave as you expect then please post the model and the steps you're following and we'll help you troubleshoot.

Best regards,
-Ayman

POST REPLY