Page 1 of 1

Contact slip : running

Posted: Wed Apr 22, 2020 12:58 pm
by charleskhazoom
Hi,

First of all, I just discovered Moco and I strongly believe in its potential !

I have tried optimal running at 4 m/s with Moco and wish to bring it to 10 m/s (sprint). I started from the 2D walking example. Upon foot landing, the model's feet slip (see video of my simulation here: https://imgur.com/LUVE9fS ).

From what I understand in the model's osim files, the contact sphere implement a continuous friction model. I played around with the parameters (increasing damping, increasing coefficient of friction,reducing stiffness, etc.). Should I change the parameters.

I know these types of models require a fine time step for simulations (like in shooting optimization methods). By analogy, whould a finer mesh also be required for a better representation of the contact models at impact in the realm of direct collocation ?

Thank you for your help!

Re: Contact slip : running

Posted: Wed Apr 22, 2020 1:06 pm
by chrisdembia
That's pretty amazing!!

You should definitely use a finer mesh for faster motions. You could consider ensuring that energy is conserved throughout the motion to a tolerance that you think is relevant for any questions you hope to answer with the simulation; see Model::calcKineticEnergy() and Model::calcPotentialEnergy(): https://simtk.org/api_docs/opensim/api_ ... f6f3d9f73b

I wonder if you might also want to alter the contact model's transition velocity, which is a parameter of the continuous friction model.

Re: Contact slip : running

Posted: Wed Apr 22, 2020 2:07 pm
by charleskhazoom
Thank you for your reply. I will definitely refine the mesh.

I was also wondering whether it will be possible in Moco to manage contacts in a ''discontinuous'' fashion through the use multiple phases? Either by scheduling the modes in advance or even without scheduling (like as ''trough-contact methods'' suggested in this paper :

Posa, Michael, and Russ Tedrake. ''Direct Trajectory Optimization of Rigid Body Dynamical Systems through Contact.'' https://doi.org/10.1007/978-3-642-36279-8_32.

Thanks again !

Re: Contact slip : running

Posted: Wed Apr 22, 2020 2:12 pm
by chrisdembia
Moco currently uses compliant contact, which is common for direct collocation within movement biomechanics. In robotics, it's more common to model foot-ground contact with rigid contact (intermittent kinematic constraints).

Moco does not yet support multi-phase problems, with or without scheduling. This is something we would like to add in the future, but there is no timeline for adding this and, given the success of compliant contact, I'd say it's not a high priority. Posa's paper, and others like it (from Zac Manchester and Amir Patel), are on our radar.

Re: Contact slip : running

Posted: Thu Apr 23, 2020 5:24 pm
by aafox
This is pretty cool stuff Charles!

Out of interest - is your sprinting simulation a tracking or predictive problem? I played around with the 2D (or it might have been the 3D) walking problem with predictive simulations, iteratively increasing the speed and using the previous solution as the starting guess in the predictive simulation. I found that at around 4-5 metres per second the model began to shift to a skipping/marching style motion - whereas you seem to have generated a more appropriate leg action that better resembles high-speed running.

Aaron

Re: Contact slip : running

Posted: Sat Apr 25, 2020 4:31 am
by rosshm
Hi Charles,

This is cool! Nice work.

I always had trouble simulating sprinting with direct collocation. It would "work" in the sense that the model would run fast, but it did weird things like heel-striking and very-large lumbar flexion that I was never able to figure out, so I never tried to publish any of it.

I also found that the results (maximum sprinting speed) were sensitive to the grid density up to 300 intervals per stride (150/step if doing a "mirrored" simulation). This was a 2D model with ~25 muscles and a Backward Euler discretization scheme, which I think is not energy-conserving (some schemes are; not sure about Moco's schemes).

So I would first try cranking the number of intervals up to at least 50/step if you're not already doing that, and if that doesn't fix it, crank up the coefficient of friction and see if that helps.

You might also try setting the speed itself as the cost function (rather than a constraint) and removing the control effort cost, or giving it a very light weight. Maybe the model is sliding because it's a cheap way to move fast and meet the constraint. I'm not sure if speed can be a goal in Moco but maybe with MocoSumSquaredStateGoal you could tell it to minimize the negation of the squared pelvis translation or something similar.

Hope this helps,
Ross

Re: Contact slip : running

Posted: Sat Apr 25, 2020 6:06 am
by charleskhazoom
To Aaron, the sprinting simulation is a 2D predictive simulation, but with the initial guess coming from a walking tracking problem. More specifically, I achieved this predictive simulation by only slightly modifiying the code in the 2D walking example : loosening the bounds on the model's coordinates to allow for greater amplitudes of movements, loosening the bounds on the final time.


To Ross, thank you for the advices, I will look into this. I simulated a single step (mirrored simulation) and increased the grid up to 300/step, without noticeable improvement. I might try increasing the coefficient of friction substantially.