A Closed-loop sinusoid reference generating system was designed based on FPGA, to meet the requirement of highly integrated and intelligent system in protection relay testing device. A FPGA was used as a system on chip, integrating digital filters and PID controllers. The prototypes of low pass and high pass digital filter was designed and their functions were implemented in the chip by recursion algorithm. The separating theory of amplitude and phase in demodulation was analyzed. Closed-loop control block diagrams of phase and amplitude were given, with the discrete expression of controller. The experimental results indicate that, the error was under 0.01% when outputting signal with amplitude above 5 volts. Comparing with open-loop system, the precision was improved with closed-loop system, when outputting lower amplitude signals. This closed-loop sinusoid generating system in a FPGA provides a novel design and implementation method for high precision and highly integrated protection relay testing device.