Page 1 of 4
forces in joints
Posted: Fri Jun 21, 2013 5:12 am
by mittag
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
Re: forces in joints
Posted: Fri Jun 21, 2013 9:24 am
by sherm
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
Re: forces in joints
Posted: Tue Jun 25, 2013 8:40 am
by mittag
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
Re: forces in joints
Posted: Tue Jun 25, 2013 10:50 am
by aymanh
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
Re: forces in joints
Posted: Wed Jun 26, 2013 2:29 am
by mittag
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
Re: forces in joints
Posted: Wed Jun 26, 2013 3:50 pm
by aymanh
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
Re: forces in joints
Posted: Thu Jun 27, 2013 2:18 am
by mittag
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
Re: forces in joints
Posted: Tue Jul 02, 2013 7:57 am
by mittag
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
Re: forces in joints
Posted: Tue Jul 02, 2013 8:27 am
by jp123909
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
Re: forces in joints
Posted: Tue Jul 02, 2013 11:19 am
by aymanh
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