A diesel generator utilizes a diesel engine and electric generator to generate electrical energy. Liquid fuels or natural gas are usually used as the primary fuel of the diesel generator. Totally, a diesel generator works based on air compression and the fuel.