Dynamic balance of the head in a flexible legged robot for efficient biped locomotion