To control the systems which operate in a repetitive mode is known to be a difficult task. For example, systems like robotic manipulators are used for doing the repetitive assigned task. This can be overcome by the iterative learning control (ILC) method. In this article, the DC motor model is discussed for controlling the speed of the motor by the design of an ILC algorithm, and its performance is compared with the conventional PID algorithm. The ILC algorithm is implemented for the minimum and non-minimum phase systems. The resulting response, absolute and integral absolute errors are plotted. The Z-N tuning method is used to implement PID control. The performance of the DC motor has been evaluated by comparing the Integral Square Error (ISE), Integral Absolute Error (IAE), and Integral Time Absolute Error (ITAE) with the conventional PID controller. © 2020 Published under licence by IOP Publishing Ltd.