Nonlinear Control of Inverted Pendulum Based on Potential Function