Page 1 of 1

Walking simulations with feedback control

Posted: Wed Aug 12, 2020 5:55 am
by rosshm
Hi all,

I think the answer to my question is "yes" generally speaking, but wanted to check with anyone who has actually done it in practice.

A student and I are interested in generating muscle-actuated simulations of walking that have feedback controls, i.e. the muscle excitations u are u = f(x,t) instead of u = f(t), where x is the state of the model. Is this possible?

More specifically, we'd like to first generate a set of excitations without feedback, u = f(t), that produces a well-coordinated walking gait, using standard tracking methods, e.g. CMC or Moco if possible. We would then like to have the user specify an arbitrary form of the feedback control functions, u = f(x,t), and through some sort of least-squares minimization or just hand-tuning, adjust the feedback function parameters so that u = f(x,t) resembles the originally well-coordinated controls closely. I'm imaging this latter step would be done in the Matlab interface.

Has anyone successfully done something like this with OpenSim/Matlab in the past?

Thanks much!
Ross

Re: Walking simulations with feedback control

Posted: Thu Aug 13, 2020 12:22 am
by mitkof6
Hi Ross,

Yes, it is possible to some extend. You can control the model by providing the muscle excitations and stepping the integrator manually. It has been done with the osim-rl project in Python:

https://github.com/stanfordnmbl/osim-rl ... sim.py#L19

However, keep in mind that there is a small drawback of this approach compared to the native C++ implementation. With C++ you can create a new controller that is evaluated each time the numerical integration takes a step. With the osim-rl approach one provides u(t) given x(t) at time = t and then predicts x(t + dt) keeping u(t) constant between t and t + dt.

Alternatively, you can do function approximation given that you know u, x for each t without OpenSim. Although, the last might not necessarily mean that f(x, t) produces stable solutions. How do you plant to ensure that your feedback controller is stable?

Regards,
Dimitar

Re: Walking simulations with feedback control

Posted: Thu Aug 13, 2020 6:32 am
by rosshm
Thanks Dimitar!