Page 1 of 1

CMC algorithm

Posted: Thu Jan 02, 2020 4:37 am
by kakagary85
Dear all, I have some question about the detail process of the CMC algorithm.
Wish someone can answer it for me.

According to the CMC algorithm(PIC1) and activation equation(PIC2) which represented eq.1 in PIC1.
PIC1Image
PIC2Image

I now try to conclude a reasonable explanation of the overall process. Here are my thought with some questions and hoping you can tell me if I misunderstanding anything.

After computed the desired acceleration. Static optimization start. With the equation of motion below,
PIC3Image
We can computed the required muscle force fm, then with the musclotendon-contraction dynamics here
https://simtk-confluence.stanford.edu:8 ... scle+Model with some performance criteria like minimize the sum square activation of muscle or other special needs that you mentioned in your reply, we can get our output activation for the model to track the desired trajectory. Next, I search another CMC flow chart with more detail about the transformation between the activation we just get and the excitation we need.

PIC4Image

First question here,in PIC 4, assume sampling rate is 100 Hz, If I have an activation output a_starred from stage 2 at t=1.01 sec, should I use the feedback activation a from stage 4 at t=1.00 sec (from last time step) to compute the excitation u for t=1.01sec ?

Next , when we finally get the desired excitation u. We also have to know the activation level so that we can use the equation in PIC2 to get access to the time rate of change of the activation at that time. So I don't know how can we get the activation level here to further computed the a_dot. Or I can just use the feedback activation from stage 4 at last time step as well just as what I mentioned in the first question?

Final, I searched for EMG as you recommend and I found this paper https://www.mdpi.com/2076-3417/8/12/2345 which said that the EMG pattern can be transformed into muscle activation but not excitation, is it right? And according to PIC 4. where should I put these EMG-transformed-activation and how to use it in opensim? Do you means that I don't need static optimization to computed the activation so I can just use the EMG-transformed-activation to transform into excitation for forward dynamics?

Thanks again for reading my post and looking forward to anyone that can answer my question.

Re: CMC algorithm

Posted: Fri Jan 03, 2020 11:18 am
by mitkof6
As for pic 4, I think the implementation in OpenSim might be slightly different. It is hard to tell, because there are a lot of details when one have to make the tool work for any movement. You can check the source code and try to understand the steps:

https://github.com/opensim-org/opensim- ... l.cpp#L384

The CMC user guide documentation might be helpful:

https://simtk-confluence.stanford.edu:8 ... +CMC+Works

A future desired acceleration is computed (see link above) using a PD controller. In OpenSim, with static optimization one can try to find the muscle activation or excitations that minimizes the distance between a desired acceleration and an induced acceleration due to the excitations.

EMG is a measure of muscle excitation. However, it is very challenging to use EMG as an input to drive a model. You can search for EMG-driven methods:

https://journals.plos.org/plosone/artic ... ne.0052618
https://onlinelibrary.wiley.com/doi/ful ... /jor.21544

Re: CMC algorithm

Posted: Tue Jan 07, 2020 9:42 am
by kakagary85
mitkof6 wrote:
Fri Jan 03, 2020 11:18 am
A future desired acceleration is computed (see link above) using a PD controller. In OpenSim, with static optimization one can try to find the muscle activation or excitations that minimizes the distance between a desired acceleration and an induced acceleration due to the excitations.
Thanks you, Dimitar, for your fast reply. I'll check the source code of CMC algorithms.
And I wish to make sure my realization toward Static optimization is all clear and right .So here I wish to explain the Static Optimization in my own words and If you can check whether I misunderstand anything or not, I'll be really appreciate.

As mentioned in the page.https://simtk-confluence.stanford.edu:8 ... tion+Works The Static optimization use either equation 1 or 2 to find out the activation that can meet the joint torque which are used to reproduce the experiment poses. However,even with the Optimal Muscle Force or the force-length-velocity properties known, there might be not only one but many muscles on one body segments which results in infinite set of solutions to reproduce the joint torque. So the Static Optimization introduced the performance criterion function J known as equation 3 in the link to choose the activation set that best meet the criterion. Thus we can get the best options of activation to use as input for Forward dynamics. And back to the equation 1 and 2, since the joint torque have already been calculated in ID, static optimization try activation from 0 to 1 for every muscles. So if there are 10 muscles in one body segment, and the activation assumed to be adjusted 0.001 per iteration, Static Optimization try 10*1000 times to meet not only the torque equations but the performance criterion. Am I understanding it right ?

Re: CMC algorithm

Posted: Tue Jan 14, 2020 6:22 pm
by yangkaiwen
Gary,

If I understand you quesiton correctly, there are 1000 static optimizations going on between 0s and 1s. Within each optimization, optimizer operates in vector form, so the number of muscles has nothing to do with the number of time optimizer 'trys'.

Kaiwen Yang

Re: CMC algorithm

Posted: Tue Jan 14, 2020 6:24 pm
by yangkaiwen
mitkof6 wrote:
Fri Jan 03, 2020 11:18 am
As for pic 4, I think the implementation in OpenSim might be slightly different. It is hard to tell, because there are a lot of details when one have to make the tool work for any movement. You can check the source code and try to understand the steps:

https://github.com/opensim-org/opensim- ... l.cpp#L384

The CMC user guide documentation might be helpful:

https://simtk-confluence.stanford.edu:8 ... +CMC+Works

A future desired acceleration is computed (see link above) using a PD controller. In OpenSim, with static optimization one can try to find the muscle activation or excitations that minimizes the distance between a desired acceleration and an induced acceleration due to the excitations.

EMG is a measure of muscle excitation. However, it is very challenging to use EMG as an input to drive a model. You can search for EMG-driven methods:

https://journals.plos.org/plosone/artic ... ne.0052618
https://onlinelibrary.wiley.com/doi/ful ... /jor.21544
Does static optimization here include muscle passive force?

Re: CMC algorithm

Posted: Sun Jan 19, 2020 10:03 pm
by kakagary85
Thanks you for your reply, Kaiwen. I think I finally understand it.
Gary.