Page 1 of 1

Modeling a cable

Posted: Mon Jun 02, 2014 12:18 pm
by martielo
I am trying to model a cable that would replace a tendon, but the cable is inflexible (i.e. it does not stretch). In OpenSim, I am trying to use a ligament for this, but ligaments stretch and since this is programmed in to OpenSim, I am having a hard time controlling this stretch. What can I do to make the ligament inflexible or replace the ligament with another force object that does not stretch. Also, I can not use coupled coordinates because the "cable" is going through a specified path that I can not simulate with coupled coordinates.

Re: Modeling a cable

Posted: Wed Jun 04, 2014 2:06 pm
by bradh
Here is what I have done:

1) Create a point to point actuator between points on 2 bodies (optimal=1, max=inf, min=-inf)
2) Create a custom controller to generate cable force
- Calculate the distance and velocity between the 2 points. Use a siffness and damping coeff to calculate a force. You will need the damping for stability if the cable is stiff.
- If the cable is in compression, set the output value of the controller to 0. There are a couple of tricks you can do to taper the velocity term with position also.

You will need to add the cable starting length as a parameter that you set. If you want visualization of the cable, a path actuator can provide that. You may also want to look at ClutchedPathSpring (I have not used it, new in v3.2).

I believe the tug-of-war API Example demonstrates some of this.

Regards,

Brad

Re: Modeling a cable

Posted: Thu Jun 05, 2014 11:27 am
by martielo
Thank you for the suggestions. Would this method work with a forward dynamics simulation? (I am still fairly new to OpenSim and in no way a programmer, so I still only have a vague understanding of the software).

Re: Modeling a cable

Posted: Thu Jun 05, 2014 1:15 pm
by bradh
Yes - it will work in forward dynamics. If you are new to OpenSim, I would take a look at the ClutchedPathSpring. It looks pretty cool and handles the initial displacement in a nice way. You can find it in the xml browser under help and a description of it here:

https://simtk.org/api_docs/opensim/api_ ... ml#details

My algorithm below is going to need you to use the API (which is a good thing to be able to do), but it is going to take longer and the ClutchedPathSpring sounds as if it can do what you want (Bravo Ajay).

Brad