Modeling a cable
- Elon Martin
- Posts: 6
- Joined: Sat Oct 05, 2013 12:11 pm
Modeling a cable
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.
- Brad Humphreys
- Posts: 79
- Joined: Thu Feb 03, 2011 11:32 am
Re: Modeling a cable
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
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
- Elon Martin
- Posts: 6
- Joined: Sat Oct 05, 2013 12:11 pm
Re: Modeling a cable
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).
- Brad Humphreys
- Posts: 79
- Joined: Thu Feb 03, 2011 11:32 am
Re: Modeling a cable
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
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