Page 1 of 1

Using .sto file to prescribe controls

Posted: Fri Mar 27, 2020 3:27 pm
by mprice
Hi Thomas,

I was wondering if there is a simple way to import all of the model controls from a .sto file in a ScriptController. I'm interested in optimizing muscle parameters with a given set of controls to track a motion. I imagine this would work similarly to how the model states are imported with the MimicMeasure, but I can't see how to do it with a Lua script offhand.

Thank you for the useful resource,
Mark

Re: Using .sto file to prescribe controls

Posted: Tue Mar 31, 2020 5:58 am
by tgeijten
Hi Mark,

Do I understand correctly that you want to load a series of excitation values from a file to control the model? Even though this is technically possible, it is not recommended to do such an optimization, because the number of control parameters will be very high (e.g. >>1000). The CMA-ES optimization algorithm does not work well with such high-dimensional parameter spaces.

The prefered way would be to use a controller with less parameters and estimate the initial values based on the controls you have. If you can tell me a bit more about the model and task you wish to perform, I can give you a more detailed suggestion.

Re: Using .sto file to prescribe controls

Posted: Tue Mar 31, 2020 12:02 pm
by mprice
Yes, that's more or less correct. The only difference is that I'm not intending for the muscle controls to be used as optimization parameters. I was hoping to load a series of excitations that play out the same way every time, based on some EMG data we've previously collected. The only optimization variables would be the muscle model parameters, attempting to minimize the tracking error between our experimental joint angles and the simulated joint angles.

The main reason I wanted to do it this way was so that I could use our recorded EMG data as model inputs, and solve a tracking problem by optimizing the muscle parameters. Maybe it's possible to simplify the EMG signal into an expression with fewer dimensions, however.

Re: Using .sto file to prescribe controls

Posted: Thu Apr 02, 2020 5:27 am
by tgeijten
That might work, depending on the complexity of the model and the duration of the motion. If your motion has external contact forces (e.g. walking), then I would not recommend this approach. Also, you're likely to need at least some optimization of the control signal, if only to compensate for inaccuracies in the EMG signal.