Page 1 of 1

UMocoD update

Posted: Thu Nov 12, 2020 12:06 pm
by rosshm
Hi all,

I recently uploaded an updated version of my "UMocoD" project to SimTk, you can see it here:

https://simtk.org/frs/?group_id=1910

The model and code is adjusted/refined a bit from the earlier version:
- Has a few more muscles (84 total)
- Upper limb torque actuators have activation dynamics
- Matlab code is streamlined a bit
- Metabolic cost is calculated after the optimization finishes
- A more realistic model of joint ranges of motion (functions from the Anderson & Pandy model) is used

A solution is provided for a tracking problem of walking that tracked the data reasonably well with a realistic metabolic cost (~3.6 J/m/kg), it should be a good starting point for doing other simulations. The GRF sometimes have high-frequency wiggles in predictive simulations that I haven't sorted out, but other than that it seems to work pretty well.

Please let me know if you have any issues/questions/problems using it. I don't check the forum for that project much (ever) so it would be better to post something here or email me (rosshm [at] umd [dot] edu).

Ross

Re: UMocoD update

Posted: Thu Nov 12, 2020 4:40 pm
by nbianco
Thanks Ross! This is fantastic.

I noticed that you're using explicit multibody dynamics over implicit dynamics. Did you find that formulation faster/easier to use?

Re: UMocoD update

Posted: Thu Nov 12, 2020 5:03 pm
by rosshm
I've not yet gotten good results with implicit multibody dynamics, it usually will not converge, and explicit seemed to work well so I've stuck with that recently. I should try again with implicit.

Re: UMocoD update

Posted: Thu Nov 12, 2020 5:59 pm
by nbianco
I've found that when minimizing accelerations with implicit dynamics, I've needed a larger acceleration weight than I originally thought to get good convergence. But then it can be hard to find a balance between good convergence and not letting the acceleration cost term dominate the solution. In that regard, I like the simplicity of explicit dynamics.

Re: UMocoD update

Posted: Sun Nov 15, 2020 9:56 am
by karthick_ganesan
Hi Ross Miller,
Thanks for sharing the updated version. I am curious to know how you formulate the predictive simulations and that will be helpful.
Regards,
Karthick

Re: UMocoD update

Posted: Sun Nov 15, 2020 10:27 am
by rosshm
Hi Karthick,

The easiest way is to just set the weight on all the tracking terms to zero. That would be a "pure predictive" simulation. However, I usually get better results on predictive simulations ("better" = converges faster and more consistently) if I keep a small tracking term in the cost function, so for that you could just crank up the weight on the control effort term (e.g. make it 100,000 instead of 50) or add some other prediction criterion with MocoSumSquaredStateGoal or MocoOutputGoal and give it a heavy weight.

In the code I posted, the cost function score for tracking will typically be ~0.5 or less, so if doing a "pseudo-predictive" simulation (one that still has some light tracking) you'd want to weight your predictive term(s) heavily enough such that their scores when minimized are much greater than 0.5 (so that they dominate the cost function instead of tracking).

Ross