Errors are NOT driven to zero with CMC.

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

Errors are NOT driven to zero with CMC.

Post by Sietse Achterop » Thu Apr 27, 2023 8:24 am

Hello list,

Cannot get CMC to work with my model.
The problem is that the error in the position (joint angles) is NOT driven to zero, so CMC does not seem to be working!
I asked on this list and posted an issue (#3345) on opensim-core, but no reaction at all.
I really don't know what to do now apart from repeating my question here!

I started with a larger model, which eventually should describe a human in a simplified rowing boat.
I am only interested in simulation and want to use CMC to prescribe the motion of the rower.
The goal is to find out how fast the boat is moving giving a rigging of the boat and the dimensions and movement of the rower.

A first basic version, using no muscles, didn't work, so I started simplifying it.
It now is reduced to only 2 joints: a pinJoint and a ballJoint, but it still doesn't work.
model.png
model.png (214.2 KiB) Viewed 252 times
Here an image of the model. To use it a trajectory is created.
Apart from a short wiggle in one joint at the beginning it should stay still, but after the wiggle the system becomes unstable.
Trajectory.png
Trajectory.png (33.42 KiB) Viewed 252 times
Please find the resulting behaviour below which is completely wrong!
Run_away.png
Run_away.png (44.85 KiB) Viewed 252 times
A trajectory without the wiggle also makes the system unstable, only a few seconds later.
Maybe because no muscles are used here? Should the CMC algorithm be different for this situation?

The zipfile below contains the, very simple, model and trajectory.
Again, please help! Sietse


PS. Here a fragment of the log at about 1.7 seconds.

Code: Select all

[info] CMC::computeControls, root solve (tFinal = 1.7):
[info]  -- controls = 1.7
[info] 
[info] CMC::computeControls, t = 1.7
[info]  -- step size = 0.00200000, target time = 1.70200
[info] ------------------------------
[info] CMC::computeControls, summary:
[info] ------------------------------
[info]  -- Q = ~[0.140326 0.183636 3.3165 -27.1329 0]
[info]  -- U = ~[-1.16965 4.20952 -5.7145 110.305]
[info]  -- Z = ~[]
[info]  -- Qdesired =  0.119718 0.934394 2.04204 -0.409413
[info]  -- Udesired =  4.73686e-28 3.74167e-27 1.5158e-26 7.57898e-27
[info]  -- Qcorrection =  0.0206076 -0.750757 1.27446 -26.7235
[info]  -- Ucorrection =  -1.16965 4.20952 -5.7145 110.305
[info] ------------------------------
[info] 
[info] Errors at time 1.7: 
[warning] Task 'lbackangle': pErr = -0.0206076, vErr = 1.16965.
[info] 
[warning] Task 'uarmleft_out': pErr = 0.750757, vErr = -4.20952.
[info] 
[warning] Task 'uarmleft_trn': pErr = -1.27446, vErr = 5.7145.
[info] 
[warning] Task 'uarmleft_up': pErr = 26.7235, vErr = -110.305.
[info] 
          .........
[info] 
[info] Desired actuator forces:  2382.42 -40.7849 39.8364 525.41
[info] 
Both pErr and vErr are very large and increasing with each step for 'uarmleft_up'.
But the optimization still succeeds while driving q away(!) from the value in the trajectory!
The simulation will end after the forces are exceeding the set limit.
Attachments
Test4.zip
(14.55 KiB) Downloaded 4 times

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

Re: Errors are NOT driven to zero with CMC.

Post by Sietse Achterop » Wed May 17, 2023 2:55 am

Because I somehow think that not using muscles is the problem here I changed the CoordinateActuator in the
lower PinJoint into 2 muscles.
withmuscle.png
withmuscle.png (223.24 KiB) Viewed 157 times
But it does not make any difference in the behavior, the balljoint becomes unstable just the same!

I don't know what to do next. Where can I turn to for help with CMC?

Sietse

PS. Also see https://github.com/opensim-org/opensim-core/issues/3345

POST REPLY