A robust control design method was proposed for a class of nonlinear systems with uncertainty. The controller was composed of a proportional integral differential (PID)controller and a robust compensator. The whole design was divided into two steps. A PID controller was developed based on the linear nominal model of the plant. On the basis of the developed PID controller, a robust compensator was given to compensate for the bad influence resulted from the system parameter perturbation, the unknown external disturbance , the model error because of linearization and so on. The compensating control law was derived by Lyapunov stability theory, as a result, the stability of the closed loop system was guaranteed despite the uncertainty, the robustness of the system was improved accordingly. Applying the proposed control method to the tracking control of an inverted pendulum, the results of numerical simulations show the validity of this scheme.