Hierarchical Sliding-mode Control Method for an Inverted Pendulum System