In this paper, we propose a novel controller design technique which is applicable to nonlinear systems. Based on the classical power shaping methodology, we establish some sufficient conditions which are able to guarantee the stability of the resulting closed-loop system. By relaxing some preliminary conditions, the particular expression of the nonlinear controller is given and the asymptotic stability of desired equilibria can be proved according to the Lyapunov theory. To motivate the application of the new proposed controller design technique and illustrate its feasibility, we verify the proposed methodology with a magnetic levitated system. Moreover, simulation results are presented to show the performance of the designed controller.