Forward Dynamics with Coordinate Actuators

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
POST REPLY
User avatar
Vishal R
Posts: 47
Joined: Wed Oct 29, 2014 4:20 pm

Forward Dynamics with Coordinate Actuators

Post by Vishal R » Mon Jul 08, 2019 8:40 am

Hi team,

I am trying to do a forward dynamic simulation of gait10dof18muscle model. I removed/disabled the muscles in the model and was trying to run the model with reserve actuators in CMC. Once I get the controls for the gait, I tried using them in the forward dynamics with same reserve actuators. However, I find the model behaving very odd. ( I did follow the guidelines mentioned https://simtk-confluence.stanford.edu:8 ... mics+Works )

- Could you please give me some pointers on how to perform an FD with just coordinate actuators?

- Should I add torque actuators instead of coordinate actuators in the model?

- In the model navigator, I find no forces other than the coordinate limit forces added for the joints, but the coordinate actuators are appended to the simulation by adding the external reserve actuator files. Is that okay?

Thanks,
Vishal

Tags:

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

Re: Forward Dynamics with Coordinate Actuators

Post by jimmy d » Tue Jul 09, 2019 9:14 am

Hi, Vishal-

I vaguely remember having a similar issue a few years ago. I could only get a stable FWD solution when adding a CorrectionController to the ForwardTool. Despite CMC doing a good job of computing controls for all the actuators, there are still tiny errors in the estimated controls so, when applied in Fwd, they accumulate quickly and cause the simulation to blow up.

I have attached a test folder where I made a few versions of the Setup Files and Actuator Files. I have included Fwd Setup files that have the correction controller and give a stable solution. If you view the output controls from the version with the correction controller, you can see that the contribution is very small.

Goodluck,
-J
Attachments
test.zip
(119.74 KiB) Downloaded 85 times

User avatar
Vishal R
Posts: 47
Joined: Wed Oct 29, 2014 4:20 pm

Re: Forward Dynamics with Coordinate Actuators

Post by Vishal R » Wed Jul 10, 2019 2:14 am

Thanks a lot, James! I wasn't aware of this CorrectionController at all.
May I know how you wrote this setup file after adding the controller. I mean how did you know the correct names of the tags that have to be put. The API docs show member functions only https://simtk.org/api_docs/opensim/api_ ... ml#details
Just curious to understand the process, Thanks a lot for your time :)

Best,
Vishal

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

Re: Forward Dynamics with Coordinate Actuators

Post by jimmy d » Wed Jul 10, 2019 7:18 am

Good Question. Doxygen is decent for most things but can be pretty unwieldy since it is autogenerated.

The easiest way of finding the XML block for a class is in the OpenSim GUI. If you select Help->XML Browser.., a window will open with all the XML snippets for all the classes (Below). You scroll to the class you want, highlight the XML, copy, and paste.
Screen Shot 2019-07-10 at 10.07.27 AM.png
Screen Shot 2019-07-10 at 10.07.27 AM.png (223.08 KiB) Viewed 558 times

Typically, my personal process is to use a combination of Doxygen and searching directly in the source code. In this case, if you search for 'CorrectionController' in the OpenSim repo, you get a bunch of hits for the C++ code but also XML examples of where it has been used. I would copy-paste the XML from one of the previous examples and use it in my file. Actually...what I do is to use Atom (it could be any decent text-editor come IDE) to index the entire OpenSim source code and use the search functionality to find the class definition and any usages of the class. Perhaps that works for me though because I am reasonably familiar with OpenSim.

Hope that helps,
-James

POST REPLY