Gradient array systems can produce highly flexible spatial encoding magnetic fields. In the array structure, time fidelity of gradient current waveforms decreases due to high mutual coupling between gradient coils. Here we propose a closed-loop feedback in combination with feedforward to compensate for errors in the gradient current waveforms. A real-time digital PID controller is designed by considering the transfer function of the array system. The controller updates the applied voltage on the gradient coil by changing the duty cycle of pulse-width modulated (PWM) signals to decrease the error between desired and measured currents.