This paper presents the application of iterative learning control (ILC) to compensate hysteresis in a piezoelectric actuator. The proposed controller is a hybrid of proportional-integral-differential (PID) control, whose main function is for trajectory tracking, and a chatter-based ILC, whose main function is for hysteresis compensation. Stability analysis of the proposed ILC is presented, with the PID included in the dynamic of the piezoelectric actuator. The performance of the proposed controller is analysed through simulation and verified with experiment with a piezoelectric actuator.