Design and simulation of a waist–trunk system for a humanoid robot