This paper applies a particle swarm optimization (PSO) technique using hybrid terms. This technique is used to adjust the learning gain of the anticipatory iterative learning control (AILC). This research proposes the hybrid PSO cognitive and social components on the updating velocity terms. The optimized AILC's gain facilitates the improvement of the learning process and positioning accuracy. Simulations were conducted, and the results were compared with the fixed gain of ILC, fixed gain of AILC and three lead time of AILC by using PSO method. The learnable error signals through a bandwidth-tuning mechanism adaptively and successfully shaped the new input trajectory. The simulation results validate the effectiveness of the new PSO-AILC for precision accuracy for a one-axis linear motor.