This paper presents a gradient-based parameter optimization method to find the optimal compensator that minimizes the standard deviation (PES) of the position error signal (PES) in a hard disk drive servo system. By using the plant response data and the PES gradient information based on the nominal plant model, optimal digital controllers that minimized the 3 PES of a plant with uncertainty were selected within a pre-found robust stable region. As a result, an optimal track-following controller that minimized the standard deviation of the measured PES (PESm) was able to be obtained without the prior knowledge of the disturbance and noise model. Furthermore, we proved that if the measurement noise is white, an optimal controller that minimizes the 3 PESm also minimizes the 3 PES. Both simulation and implementation results suggest that such a gradient-based search process is faster than nongradient optimization methods such as Random Neighborhood Search and genetic algorithms. Index Terms-Gradient method, hard disk drive (HDD) servo, optimization, track mis-registration (TMR). I. INTRODUCTION I MPROVING the servo system performance for lower track mis-registration (TMR) is one of the prerequisites of moving to higher recording density in hard disk drives (HDDs). To cope with the challenge of the actuator pivot nonlinearity, high-frequency uncertainty, the effects of various external disturbances and noises, many efforts on the spindle motor, air flow, and arm/suspension designs have been made to reduce disturbance level and increase the actuator resonance frequency [1]. In addition, the improved servo control designs, such as proportional-integral-derivative (PID), LQG/LTR [2], [3], multirate control [4], [5], disturbance observer [6], and mode-switching control [7] also have been studied extensively as a cost-effective way toward higher track density. However, due to the limitation of the accuracy and uncertainty of the plant and disturbance models, system sampling frequency, controller order, stable margin requirements, and plant input saturation, the real servo system could not increase its bandwidth to an arbitrarily high value and achieve the best disturbance rejection.