Contact force oscillations/parameter tuning

OpenSim Moco is a software toolkit to solve optimal control problems with musculoskeletal models defined in OpenSim using the direct collocation method.
User avatar
Ross Miller
Posts: 375
Joined: Tue Sep 22, 2009 2:02 pm

Re: Contact force oscillations/parameter tuning

Post by Ross Miller » Tue Nov 09, 2021 8:20 am

I noticed recently that Moco has an "AccelerationTrackingGoal" that minimizes the squared deviations between the model's accelerations and target accelerations, so it seems like users could implement an acceleration-minimizing term for explicit dynamics as well (i.e. use AccelerationTrackingGoal with the target accelerations all set to zero).

I've had better luck (more consistent convergence) using explicit multibody dynamics in Moco, but have not explored this extensively. When I use implicit, especially for high-dimensional problems, the convergence is spotty.

Ross

User avatar
Ross Miller
Posts: 375
Joined: Tue Sep 22, 2009 2:02 pm

Re: Contact force oscillations/parameter tuning

Post by Ross Miller » Wed Nov 10, 2021 6:04 am

Related question: if you minimize accelerations of all DoF, is this (conceptually) equivalent to minimizing accelerations of the center of mass? I think it is, but only thought about it long enough to type this post.

User avatar
Pasha van Bijlert
Posts: 227
Joined: Sun May 10, 2020 3:15 am

Re: Contact force oscillations/parameter tuning

Post by Pasha van Bijlert » Wed Nov 10, 2021 3:52 pm

Thanks for the tip about the AccelerationTrackingGoal, I'll have to try that in the future.

I think minimizing the accelerations of the individual DoF's is not completely equivalent to minimizing CoM accelerations, assuming your DoFs are joint angles, and not CoM position/velocity of individual segments.

Minimizing CoM accelerations would affect the shape of the GRF (presumably making it more spread out). There would be no effect if there is no contact with the ground (so during the flight phase of a jump, for instance, or a somersault). Arguably, minimizing the accelerations of all the DOFs could have an effect on intersegmental movement (but not total CoM movement) even if you're not touching the ground, so I think there are situations that you might get (slightly different results) from the two.

Cheers,
Pasha

User avatar
Nicholas Bianco
Posts: 1050
Joined: Thu Oct 04, 2012 8:09 pm

Re: Contact force oscillations/parameter tuning

Post by Nicholas Bianco » Wed Nov 10, 2021 9:41 pm

I'm not sure about minimizing the COM accelerations, but the MocoAccelerationTrackingGoal is for tracking body accelerations, not generalized accelerations. So if you track "zero" data, you will be minimizing body accelerations, which is different than "solver.set_minimize_implicit_multibody_accelerations(true)" for implicit mode.

You can always use MocoOutputGoal for minimizing body accelerations too.

User avatar
Pasha van Bijlert
Posts: 227
Joined: Sun May 10, 2020 3:15 am

Re: Contact force oscillations/parameter tuning

Post by Pasha van Bijlert » Sat Dec 11, 2021 5:27 pm

Hi all,

I was wondering if someone has tried using MocoContactTrackingGoal to reduce impact peaks in their predictive optimizations? Did this result in qualitatively/quantitatively improved GRF curves in gait prediction?

Cheers,
Pasha

User avatar
Ross Miller
Posts: 375
Joined: Tue Sep 22, 2009 2:02 pm

Re: Contact force oscillations/parameter tuning

Post by Ross Miller » Sun Dec 12, 2021 9:43 am

I've not tried that for predictive simulations. You could try giving it tracking targets of zero and see what happens.

My experience with impact peaks in predictive simulations (limited to human walking and running simulations):
- They tend to come from the foot quickly "slapping" the ground after initial contact
- Multi-segment feet seem to help although I'm not sure why
- More overall compliance and damping in the model seems to help, e.g. I see them mostly in 2-D and not so much in 3-D, and including passive joint moments with a damping term seems to help

I'd be inclined to try MocoAccelerationTrackingGoal with targets of zero (maybe for the whole body or maybe just for the feet) as well, since GRF spikes should be accompanied by body acceleration spikes.

Ross

User avatar
Pasha van Bijlert
Posts: 227
Joined: Sun May 10, 2020 3:15 am

Re: Contact force oscillations/parameter tuning

Post by Pasha van Bijlert » Sun Dec 12, 2021 10:06 am

I've not tried that for predictive simulations. You could try giving it tracking targets of zero and see what happens.
This was my thinking as well. Since ContactTrackingGoal is a squared cost term, this might push down the impact peaks. Planning on trying it somewhere in the coming weeks.
I'd be inclined to try MocoAccelerationTrackingGoal with targets of zero (maybe for the whole body or maybe just for the feet) as well, since GRF spikes should be accompanied by body acceleration spikes.
I'll give that a shot as well, although I'd switched to implicit MBD so that I could minimize multibody accelerations. I'll report back when I get around to it.
- More overall compliance and damping in the model seems to help, e.g. I see them mostly in 2-D and not so much in 3-D, and including passive joint moments with a damping term seems to help
Compliance definitely helped in my case. Damping/dissipation actually increased the impact peaks for me, which makes sense because you're punishing speeds with a higher reaction force (specifically in the contact model though, not sure what a joint damper might do).

Cheers,
Pasha

User avatar
Pasha van Bijlert
Posts: 227
Joined: Sun May 10, 2020 3:15 am

Re: Contact force oscillations/parameter tuning

Post by Pasha van Bijlert » Sun Dec 19, 2021 3:25 pm

Hi all,

I've added in a MocoContactTrackingGoal, with a GRF .STO that's all zeros. Because moco reads this in as a TimeSeriesTable, I had to add a timeseries vector. Does this time vector then get used during the optimisation, or does MOCO only use the force values with the row numbers as the collocation points? The time vector doesn't seem to have to correspond to the times in my initial guess of the mocoTrajectory, but I'm not sure how the input data is treated for this cost in that case. I've got the same question regarding acceleration tracking goal, since that requires a TimeSeriesTableVec3 (which also has a time vector).

Cheers,

Pasha

User avatar
Nicholas Bianco
Posts: 1050
Joined: Thu Oct 04, 2012 8:09 pm

Re: Contact force oscillations/parameter tuning

Post by Nicholas Bianco » Mon Jan 03, 2022 12:11 pm

Hi Pasha,

Yes, the time vector is relevant for both tracking goals. You'll need to ensure that the time vector spans the time range of your simulation.

Carmichael Ong from our lab at Stanford has previously minimized the acceleration of the head to help reduce ground reaction force peaks in his 2D predictive simulations: https://pubmed.ncbi.nlm.nih.gov/31589597/.

Though, if you've already switched to implicit multibody dynamics, I'd think that minimizing accelerations would do the trick.

Best,
Nick

User avatar
Matthew Lee
Posts: 52
Joined: Sat Jun 20, 2020 7:46 pm

Re: Contact force oscillations/parameter tuning

Post by Matthew Lee » Tue Mar 12, 2024 4:56 am

Hi Pasha,

Sorry to reopen this old topic. Could you give me some suggestions on how you finally solved the problem of oscillation and spikes occured in vertical ground reaction force ?

Best Wishes,
Matthew

POST REPLY