Automatic control of limb movement and posture