This paper utilized the improved particle swarm optimization (IPSO) technique for adjusting the gains of PID controller, Iterative Learning Control (ILC) and the bandwidth of zero-phase Butterworth filter of ILC. The conventional ILC learning process has the potential to excite rich frequency contents and try to learn the error signals. However the learnable and unlearnable error signals should be separated for bettering control process as repetition goes. Producing unlearnable frequencies for error compensation signals should be avoided when the filter bandwidth is not changed at every repetition. Thus the adaptive bandwidth in ILC with the aid of IPSO tuning is proposed here. Simulation results show the controller can cancel the errors as repetition goes. The frequency response of the error signals is verified by the Hilbert Huang Transform (HHT) method. Tracking errors are reduced and validated with application to positioning profile of the Computer Numerical Control (CNC) machine tool and robot arm systems.