This paper utilizes the Improved Particle Swarm Optimization (IPSO) with bounded constraints technique for adjusting the gains of a Proportional-Integral-Derivative (PID) and Iterative Learning Control (ILC) controllers. This study compares the conventional ILC-PID controller with proposed IPSO-ILC-PID controller. A cycloid trajectory for mimicking the real industrial motion profile is applied. Two system plants with nonminimum phase are numerically simulated. Proposed IPSO with bounded constraints technique is evaluated on one axis of linear synchronous motor (LSM) with a PC-based real time controller. Simulations and experiment results show that the proposed controller can reduce the error significantly after two iterations.