Trouble with Contact

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
POST REPLY
User avatar
Anne Schmitz
Posts: 76
Joined: Thu May 31, 2007 7:44 am

Trouble with Contact

Post by Anne Schmitz » Thu Sep 26, 2013 11:30 am

I would like to run a forward dynamics simulation of 2 bones bouncing to check I have contact implemented correctly. I have checked and double checked my geometry and syntax but contact does not occur. Any reason why? What I am I missing?

Thanks,

Anne
Attachments
Knee_Contact.zip
(243.21 KiB) Downloaded 161 times

User avatar
jimmy d
Posts: 1375
Joined: Thu Oct 04, 2007 11:51 pm

Re: Trouble with Contact

Post by jimmy d » Tue Oct 01, 2013 11:34 am

Hi Anne,
by the look of it, you have prescribed kinematics in the forward simulation. With this type of analysis the kinematics will always win. Your contacts will interact if you put a constraint on the joint (slider?) and then apply a force to the tibia that moves it vertically.
You may also want to change your medial plateau for half-plane force rather than a mesh.

cheers,
-james

User avatar
Anne Schmitz
Posts: 76
Joined: Thu May 31, 2007 7:44 am

Re: Trouble with Contact

Post by Anne Schmitz » Tue Oct 01, 2013 12:56 pm

Hi James,

Thanks for the reply. However, the tibiofemoral kinematics are set to <prescribed>false<prescribed> in the model so I don't think that is the case. The tibia drops under gravity (+y) and should bounce off of the femur, which it doesn't. I'm using a mesh so later I can substitute in a more detailed tibial cartilage geometry. Regardless, the contact 'should' work.

Thanks,

Anne

User avatar
jimmy d
Posts: 1375
Joined: Thu Oct 04, 2007 11:51 pm

Re: Trouble with Contact

Post by jimmy d » Tue Oct 01, 2013 7:04 pm

Hi Anne,

Sorted that and saw that problem is the meshes themselves. If you attach a force reporter as an analysis in forward dynamics you will see the meshes do exert a force on one another. I increased the stiffness by acouple of zeros and confirmed that this was proportional.

Problem will be that your meshes are thin and interpenetration happens quickly. Once that occurs, the components of the mesh dont interact as you would expect.

Perhaps try modeling the medial plateu as an 'infinite plane' and see the result.

Goodluck,
-james

User avatar
Anne Schmitz
Posts: 76
Joined: Thu May 31, 2007 7:44 am

Re: Trouble with Contact

Post by Anne Schmitz » Tue Oct 01, 2013 7:42 pm

I dropped each part separately onto an infinite plane to test out the mesh. I found that the femur penetrates the plane a LOT before it bounces. I also dropped a sphere onto an ellipsoid and found the same thing, a lot of penetration. The amount of penetration seems unreasonably large so I suspect an issue with the contact code within OpenSim, so I reported a bug. It shouldn't matter if the parts are thin. There shouldn't be that much penetration, at least it was ok in much previous versions of OpenSim (but really slow in previous versions too). I could increase the stiffness to decrease the penetration, but then this would be much larger than is physiologically realistic. Maybe the transition velocity would affect this?

User avatar
Anne Schmitz
Posts: 76
Joined: Thu May 31, 2007 7:44 am

Re: Trouble with Contact

Post by Anne Schmitz » Wed Oct 02, 2013 7:29 am

For anyone who runs into this problem, I found a solution. I increased the stiffness and now the parts bounce with much less penetration. Although, the stiffness seems unrealistically high, which suggests other parameters may need adjustment.

James, thanks for all your help.

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

Re: Trouble with Contact

Post by Michael Sherman » Wed Oct 02, 2013 2:10 pm

Forwarding an email from Anne:

I'm using the Elastic Foundation contact model in OpenSim. I read your paper on SimBody from the 2011 Symposium on Human Body Dynamics. This is a great paper and very clearly explains the formulation of the elastic foundation force. However, I am a little confused how it is done in OpenSim. What is assumed for elastic material thickness, h? I don't see a way to set this variable in my .osim file. Also, is the 'stiffness' parameter the elastic modulus? Your time is very much appreciated.
Great question! I had to do some code archaeology to answer it. There should be a separate parameter for thickness h of the Elastic Foundation layer, but currently there isn't one in OpenSim. That means you'll have to supply stiffness (which should have elastic modulus units of stress/strain) instead as pre-scaled by the thickness ((stress/strain)/depth). So if the actual stiffness is 1e6 (force/area)/strain and the layer is 1mm thick then the scaled stiffness would be 1e9, meaning that 100% strain would occur at 1mm of penetration. This might explain why the contacts seemed too soft to you -- not scaling is the same as saying the thickness is h=1 meter!

This is a bug in the current contact interface. We are currently reworking contact extensively and will fix this and a number of other contact-related issues when we replace the old contact system with the new one (planned for next year). In the meanwhile scaling the stiffness should produce reasonable behavior.

Regards,
Sherm

User avatar
Dario Cazzola
Posts: 44
Joined: Mon Jun 03, 2013 8:08 am

Re: Trouble with Contact

Post by Dario Cazzola » Thu Feb 11, 2016 10:32 am

Great post!

I think I am currently experiencing a similar problem. :|
Indeed I am using EF and the contact seems very soft. Also it looks like it responds more to low speed impacts rather than high speed ones. For example, if there is a first high speed impact, a rebound phase, and a low speed impact, the force reporter shows force generated only during the second low-speed impact.

I wanted to change the h (thickness) value but I could not find it.
Has the EF method been already refined in OpenSim 3.3?

Cheers

Dario

User avatar
Anne Schmitz
Posts: 76
Joined: Thu May 31, 2007 7:44 am

Re: Trouble with Contact

Post by Anne Schmitz » Tue Feb 16, 2016 12:06 pm

Hi Dario,

The modulus in the .osim file is actually modulus divided by thickness. I think a refined contact model is in the works but not sure if/when it will be implemented.

Thanks,

Anne

POST REPLY