Go Back   Forums > Self-Supported Forum > Debug model


Thread Tools Display Modes
Old 09-08-2014, 06:59 PM
JakubSikorski JakubSikorski is offline
Junior Member
Join Date: Jun 2014
Posts: 3
Default Modelling Bipedal Stance Using Conditional Contact - KKT error

Hello everyone,

I am quite new here, working with AnyBody to develop a simulation of human standing in different, programmable poses. I need my model to output the body geometry along with ground reaction forces for both feet.

In my attempts to simulate the ground contact realistically, yet in a simple way, my model employs four conditional contact points, two per foot - located at the heel and big toe of each one of them.

I implemented the stance control such that the user selects the location of heels, and the angular orientation of feet with respect to the x axis of the fixed reference frame. I programmed drivers which keep feet in these locations, serving as hard constrains. Moreover, I introduced a driver that keeps the body CoM's X and Z coordinates in the geometric centre of the base of support.

With these constrains I want the inverse dynamics to optimize the force distribution between the four contact points.

The problem is that for most configurations a notorious KKT error strikes, and I cannot diagnose its origin. So far my observations are:

1. There is a certain range of postures (eg. when feet are less than 0.7 m apart), when the inverse dynamics works and gives reasonable force distribution - exactly what I want to achieve.

2. When the body muscles are taken out of the model and all body joints given the "Reaction.Type={On}", this stable range diminishes significantly.

3. At any other position, the KKT error pops out.

I tried changing the "muscle force" at the conditional contacts, ran through all possible combinations of "Reaction.Type" setups, and I just cannot find any explanation why my model fails. I even made an initial attempt to follow the suggestions in this paper (see the NumStabMuscles.any file) - with no effect:


To improve numerical stability, additional muscle-like actuators were attached at the origin of the pelvis segment, which could generate small residual forces and moments up to 10 N or Nm. The activation level of these muscles was solved as part of the muscle recruitment optimization problem, so as to minimize their contribution.

I would be extremely grateful for any suggestions.

I attach all the files necessary to recreate my model in the .zip file in this post. When open, several points of different colours should be seen along with the body:

Red - desired position of the heels (modifiable through Mannequin)
Green - final position of the toes (computed from heel position and foot orientation)
Blue - the point the body CoM will be kept over (nominally the geometric center of the base of support, but the offset can be introduced in the Mannequin file)
Magenta - unrelated. These are the points I need for further data processing outside of AnyBody. They should cause no problem.

If you need any of my files commented in larger details, or any other information that could facilitate your understanding of what I have done wrong, please let me know.

Thank you very much for any help in advance.

Jakub Sikorski

Ps. I use AnyBody v. 6.0.3 along with AMMR v. 1.6
Attached Files
File Type: zip (13.0 KB, 5 views)

Last edited by JakubSikorski; 09-08-2014 at 07:04 PM.
Reply With Quote
Old 09-09-2014, 02:49 PM
mkjung9980's Avatar
mkjung9980 mkjung9980 is offline
Senior Member
Join Date: Aug 2009
Posts: 860

Dear Jakub Sikorski,

I tried to analyze your model and tried to modify something on that to make it working.

1) First, I would set all the 'Reaction.Type' of the constraints as 'Off'.

2) You have used only two points on each foot for conditional contacts.
Sometimes two points may not be enough to generate the necessary reaction moments on the foot. So we usually recommend to use at least 3 points on the foot for conditional contacts.
So I added one more conditional contact on each foot(ToeMedialContactNode).
But if you don't mind then you can also add one more conditional contact using the 'ToeLateralContactNode'.

3) Pelvis residual forces are usually used for gait analysis with measure force data to correct the inconsistency between the real subject and the computational model (due to body-segment parameter errors, motion capture marker error, force plate error and so on).
But in this kind of model you don't need to use that pelvis residual forces.

I hope this may be helpful to you.

Best regards,
Attached Files
File Type: zip Full Leg (12.3 KB, 8 views)

Moon Ki Jung, Ph.D, Application Engineer, AnyBody Technology A/S.

※ AnyScript™ Reference Manual is the bible.
※ AnyScript™ wiki page is the best supplementary information(
※ When you would upload your models, please write information about your AMS and AMMR versions.
※ If you want to get more intensive support, please update your information(profile, organization and signature).
Reply With Quote
Old 09-09-2014, 03:36 PM
JakubSikorski JakubSikorski is offline
Junior Member
Join Date: Jun 2014
Posts: 3

Dear Moonki,

Thanks a lot! I did not know that the solution is so simple. The model works exactly as I want it to.

Reply With Quote

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT +2. The time now is 02:14 AM.