This paper presents the power hardware-in-the-loop (PHIL) study of a variable speed diesel generator with supercapacitors and renewable energy sources. The proposed configuration is suitable to test different control strategies for variable speed diesel generators. It can also be used to study different hybrid AC/DC microgrid configurations that include the variable speed diesel generator. The variable speed diesel generator is more efficient than constant speed diesel generator in terms of fuel consumption. The supercapacitor and its control are used in the study to enhance the dynamic performance of the DC grid. The overall control method and its stability analysis are presented in this paper. The proposed control method and configuration are validated by PHIL experiment.