MoCap_LowerBody and MoCap_FullBody debug problems

Hi Anybody support
This is Hai. I’m using AMS V6.0 and AMMR v1.6.2. I tried to used Anybody to simulate human normal walking. So I used the codes in the examples named “MoCapModel”. Since I have motion capture data but didn’t have force plate data, I just blocked force part code. Then I wanted to do kinematics analysis.
First, I run the Mocap_LowerBody.main code only for Kinematic analysis in KinematicStudyForParameterIdentification. I got these errors:
0) Kinematic analysis…
Failed to resolve kinematic constraints. Newton relaxation too small. (final kin. error = 1.347571E-003)
Constraint no. 91 above error tolerance 0.001000, error = 0.001348.
Constraint no. 95 above error tolerance 0.001000, error = 0.001014.
160) …Kinematic analysis terminated
ERROR(OBJ.MCH.KIN3) : E:/AnyBodyCode/M…1/Model/Kinematics.any(23) : KinematicStudyForParameterIdentification.Kinematics : Kinematic analysis failed in time step 160.
Second, I run the Mocap_FullBody.main code only for Kinematic analysis in KinematicStudyForParameterIdentification. I also got a warning and errors:
0) Kinematic analysis…
WARNING(OBJ.MCH.KIN6) : C:/Pro…es/A…y/A…0/AMMR/Body/A…n/Arm/Jnt.any(46) : GHRot : Close to singular position : Orientation close to Gimbal Lock, i.e., first and third axis of rotation being parallel
Failed to resolve kinematic constraints. Newton relaxation too small. (final kin. error = 1.676913E-003)
Constraint no. 175 above error tolerance 0.001000, error = 0.001677.
Constraint no. 179 above error tolerance 0.001000, error = 0.001270.
160) …Kinematic analysis terminated
ERROR(OBJ.MCH.KIN3) : E:/AnyBodyCode/M…1/Model/Kinematics.any(23) : KinematicStudyForParameterIdentification.Kinematics : Kinematic analysis failed in time step 160
By the way, here I use the optiTrack motion capture system and the marker protocol is the as the VICON motion capture system (http://www.idmil.org/mocap/Plug-in-Gait+Marker+Placement.pdf).
So what’s the reason for these errors? What should I do to modify the codes for dealing with these errors? I attached the files.
Looking forward to your kind help.

Hello Hai,

I had a quick look at your problem and saw that the error shows up in the last steps of the simulation. The error messages you see indicate a solver problem where the solver is not able to solve the kinematic equations properly. There are different possibilities to try to solve this kind of problem.

One way to handle this problem would be to cut off the last frames of the measurements by changing number of frames that are used for the simulation.
As a trial, I set LastFrameOffset in the file TrialSpecificData.any to a value of 100 and with this, the MotionAndParameterOptimization is successful.

Other possibilities are to e.g. change tolerances of the solver or change weights of markers to avoid this kind of solver error. But if it is ok to skip the last frames, this is probably the fastest solution of the problem.

Best regards
Daniel

Hi Daniel
Thanks a lot for your quick reply and your solutions. Regarding to your second suggestion, I don’t understand the concept of “tolerances of the solver” and “weights of markers” clearly. Could you explain deeply about them? Meanwhile, where can I change tolerances of the solver and weights of markers? or how to change them?

Best wishes
Hai

Hello Hai,

the solvers in AMS are iterative solvers which have a stopping criterion based on a measure of the residual of the problem. These residuals and tolerances are the values you can see in the error messages you posted. As you can see, the error and the tolerance are quite close to each other and therefor it might be possible to change this solver tolerance a bit to avoid this error message and check the solution to make sure that the result is acceptable. You can find these tolerances as a member of the Study that you are running in the folders Kinematics (and also InitialConditions, but this is probably not relevant for your problem now). For the MoCap model, this is e.g. Main.Studies.MotionOptimization.Kinematics.KinematicTol for the MotionOptimization study. You can also read in the reference manual about these settings. Changing these tolerances is typically a bit trial and error.

About the weights: Sometimes it helps to change the marker positions and/or weights a bit to improve the results of the MotionAndParameterOptimization. You can find these in the ModelSetup.any, and there in the Markers.any file. These are even more parameters you can change if you find any markers that do not fit properly (Weight* for the weights of a marker and sRelOpt for the marker positions). Sometimes, adjusting these markers helps to get a solution.

Best regards
Daniel

Hi Daniel
Thank you very much for your explanations. It does help me. I have tried your method. Everything works very well.
Have a good day.

Best wishes
Hai