The gap metric is introduced to design the robust controller for the quantitative analysis of uncertainty as much as possible. The robust margin of the robust controller is defined in a tracking system based on the gap metric, and the robust controller is designed according to the gap metric in the tracking system. Uncertainty the plant and the controller should be considered simultaneously to make the designed controller has some ability of disturbance rejection, when a control system is being synthesized. Simulation results show that the robust controller having bigger robust margin has abilities of both stronger disturbance rejection ability and better tracking performance compared with common PID controller when additive uncertainty is existing.