This paper proposes a new approach to minimize the cogging torque of a stator interior permanent magnet (SIPM) machine. The optimization of stator slot gap and permanent magnet is carried out and the cogging torque ripple is analyzed by using finite element analysis. Experiments on a prototype machine verify the theoretical analysis. A comparison between the improved SIPM generator and a radial flux permanent magnet synchronous generator for a 3-MW wind turbine is carried out. It shows that the proposed SIPM generator has the advantages of higher power density and lower cost.