Periodic disturbances occur during repetitive operation of machines in industrial production. Compensation for the periodic disturbances is an important issue to realize proper machine works beacause the periodic disturbances deteriorate machining precision. In order to eliminate the periodic disturbances, an adaptive periodic-disturbance observer (APDOB) has been proposed as an effective method that can also estimate and compensate for frequency-varying periodic disturbances. However, the APDOB has a problem that design of the APDOB is complicated owing to its six design parameters, which need to be empirically adjusted. Here, we propose an approach based on a genetic algorithm (GA) including a Lévy flight to automatically adjust the six design parameters. The proposed method can remove the conventional empirical design. Moreover, the Lévy flight could improve the exploration ability of the GA by optimizing mutation operator and the best solution found by the GA including Lévy flight could improve the performance of the APDOB.