This paper presents the development of a self-tuning digital controller for DC motor applications, specifically designed using hardware/software co-design techniques. Two tuning structures are investigated and then implemented, both reliant on a compass direct search algorithm. The developed structures overcome many of the typical limitations of classical self-tuning methods; such as computation complexity, simplicity of adaptation, and ease of real-time tuning. The self-tuning processes are based on measuring the closed loop impulse response by injecting an excitation signal and comparing the measured signal with the desired ideal impulse response. Optimal PID parameters are achieved once the measured and the desired impulse response are matched. Special focus is given on rapid implementation of the presented on-line tuning mechanism for the digital PID controller using the National Instruments-RIO architecture and LabVIEW-FPGA design tools. Validation of the self-tuning and hardware/software co-design approach is demonstrated on an experimental position controlled DC motor drive application.