Iterative learning control (ILC) enables high performance for exactly repeating tasks in motion systems. Many motion systems also perform slightly varying tasks during normal operation. The achieved performance with ILC algorithms can significantly deteriorate in such cases. The aim of this paper is to develop a new framework based on frequency-domain ILC that achieves high performance for both repeating and varying tasks. The proposed ILC framework achieves high machine performance for motion systems, while relying on straightforward loop-shaping based design methods for both performance and robustness. Furthermore, basis functions are used to cope with variations in tasks. An experimental validation on a high-speed axis of an industrial w...