State Observer and Controller Design for an Inverted Pendulum on a Cart