CMC-tool failing/crashing with more complicated model.

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
POST REPLY
User avatar
Sietse Achterop
Posts: 72
Joined: Tue Sep 14, 2021 3:01 am

CMC-tool failing/crashing with more complicated model.

Post by Sietse Achterop » Tue Dec 21, 2021 8:46 am

Hello List,

I created a model of a "rower" in a "rowing boat".
After using the CMC-tool with a simpler example (3 joints) I now am trying to get it to work with this more complicated example (26 joints/33 actuators), but the tool is failing/hanging/crashing in the first step with the following (opensim 4.3):

Code: Select all

info] CMC::computeControls, t = 0.02
[error] SimTK Exception thrown at InteriorPointOptimizer.cpp:264:
  Optimizer failed: Ipopt: Infeasible problem detected (status 2)
[error] OPTIMIZATION FAILED...
[error] CMC::computeControls: Optimizer could not find a solution.
Unable to find a feasible solution at time = 0.02.
Model cannot generate the forces necessary to achieve the target acceleration.
Possible issues: 1. not all model degrees-of-freedom are actuated,
2. there are tracking tasks for locked coordinates, and/or
3. there are unnecessary control constraints on reserve/residual actuators.
The code can be found in https://github.com/SietseAchterop/Rowing-simulator in subdirectory BootBaan.
The model is created from bootbaan.py.
And note that this is pure simulation where the trajectory is calculated in the script trajectory.py.
To avoid the problem above I made the prescribed movement very slow, to avoid large accelerations. I learned that from the simpler model (Pusher) that does work.

The above can easily be replicated using BootBaan.osim, and trajectory.trc from the repo.
The IK-tool works, there is a webm-video in the repo that shows that.

It fails, in the CMC-tool, in the first timestep at t = 0.02. It takes a fairly long time to crash, say 20 seconds.
Does the ipopt error status 2 means CPUTIME_EXCEEDED? (from ipopt enum)

1. All model degrees-of-freedom (33) have actuators. There are no muscles used, only CoordinateActuators.
2. There is no locking. I do use clamping to avoid unwanted solutions.
3. There are only 3 WeldContraints to make the model complete.

So I don't know what I am doing wrong here.
Or is this model too complicated for opensim?

There is one thing in the CMC_Tasks.xml file. I had to set the name-value as in:

Code: Select all

   <CMC_Joint name='bJoint_1'> <coordinate>bJoint_1</coordinate> </CMC_Joint>
to the coordinate, and not the jointname as I first thought.
I get errors when I use the relevant joint.

I am at a loss here, what could be problem?
Help would be very much appreciated!

Sietse

User avatar
Sietse Achterop
Posts: 72
Joined: Tue Sep 14, 2021 3:01 am

Re: CMC-tool failing/crashing with more complicated model.

Post by Sietse Achterop » Thu Jan 06, 2022 9:42 am

Hello List,

I reduced the model as much a possible, but the problem still exists!
There are now only 6 joints and 7 actuators.
Not much more than an upper- and lower-leg connected to one fixed and one movable box, see the picture.
The code can be found in https://github.com/SietseAchterop/Rowin ... /CMC_error
cmc_error.png
cmc_error.png (33.14 KiB) Viewed 306 times
The only interesting thing is that the lower leg contains a WeldConstraint because the model contains a loop.
There is only 1 marker that is in the origin of the movable box, and the trajectory is to move the movable box slowly a bit horizontally.
Looking that the trajectory.trc and trajectory.mot, everything is in perfect order. I can't find anything wrong with it.

I used coord.set_clamped(True) for the knee to exclude an unwanted solution, which works fine with IK.
I now also use a CoordinateLimitForce there because I understood that it is needed for CMC, but that doesn't make a difference.
(update: forget this last remark about it being needed)

Again, to try it out, load the BootBaan.osim model, use IK and then CMC to see the problem.
What else can I try?

Thanks in advance, Sietse

PS. This is both on Windows and Linux.

User avatar
Sietse Achterop
Posts: 72
Joined: Tue Sep 14, 2021 3:01 am

Re: CMC-tool failing/crashing with more complicated model.

Post by Sietse Achterop » Wed Jan 12, 2022 6:58 am

I now understand that it is a challenge to use CMC in the fast target mode, especially when using contact forces.
Therefore I switched to the slow target mode, this works better.
But alas, I now suffer from all kinds of instability. I with post a new message to describe it.

POST REPLY