So my question is - how does human actually balance himself(to not to fall down)?
There are basically two independent problems:
1. Physics simulation:
Imagine a human standing on only one leg. That's a system of 20 bodies and the foot body and ankle joint has to carry all the weight.
Mass ratio here is 1:50, worst case for game physics libs. Bullet can't even simulate a stack of a few equal mass bodies without jitter (the last time i've checked),
and also it may miss the necessary features for powered joints. So it's not the best choice for a demanding simulation like this and you'll have to add a lot of work,
probably ending up doing your own constraint solver.
I have experience with Bullet, Havok and ODE, but when i tried Newton i was blown away by the difference in stability, accuracy and robustness it offers.
It's by far the best library for this kind of simulation - sadly only few people know about this.
I would consider using Newton instead Bullet - no matter how much effort it takes to integrate it to the blender engine, it will pay off.
Other options would be:
* Simulate in smaller timesteps or use more substeps. That way the problem becomes easier for the physics lib to solve (at the cost of performance).
(Actually all research papers i know on the topic mention that practice - they use much higher settings than actual games do.)
* Cheat and use external forces to stabilize the system :)
(I assume Natural Motion does this, but that's just an assumption)
2. Control the simulation.
For the balancing i'll explain how i do it, but there are lots of totally different approaches.
There is the well studied control problem of balancing a Inverted Pendulum on a moving cart ( = balancing a stick with your hand).
See there at the picture in the middle:
http://www.elysium-labs.com/robotics-corner/learn-robotics/biped-basics/zero-moment-point-zmp/So, by moving the cart left and right, the stick can be balanced to stay upright.
Same is for human feet, but instead moving the cart we move the center of pressure between heel and toes.
Those limits also define the min / max angular acceleration the ankle joint can apply to the center of mass of the humkan body without tipping over.
Controlling this system with max efficiency is harder than it sounds, but you see the nice simplification from a 20 to a 2 bodies system.
To use it for the real ragdoll i use this procedure each simulation step:
* Divide the ragdoll into two groups of bodies, most likely at the ankle joint(s): group1: left and right foot, group2: all the other bodies
* Create a virtual single body for each of the groups conserving physical properties.
* Create the Inverted Pendulum from those 2 virtual bodies.
* Do the control task with the IP, resulting in differnt target state for the upper body
* Rotate the upper group of ragdoll bodies to reflect the changed state, use IK solvers to compensate errors introduced from that simplification.