A controller includes a combining module that generates a total control
signal for the drive device of a disk drive by combining a feedback
control signal and a feedforward control signal. A feedback control
module generates the feedback control signal in response to at least one
state of the drive device. A feedforward control module generates the
feedforward control signal based on a smoothing function and a
feedforward control function. The smoothing function is determined by
evaluating a plurality of candidate smoothing functions by determining a
smoothness factor associated with the control signal that results from
each of the plurality of candidate smoothing functions, and selecting the
smoothing function as one of the plurality of candidate smoothing
functions, based on the smoothness factor.