In this work, an axial flux permanent magnet generator is designed for a 30 kW direct wind turbine and the design parameters are optimized to achieve high efficiency. In order to reduce the ripple components of rotational torque and electromagnetic torque, air core topology has been used and in order to increase the power capacity of the generator, modular structure has been used. The advantage of the modular design is that each module can be considered as a generator unit and depending on the wind speed conditions, the number of units related to the wind speed can be placed in the circuit and the generator will always work at maximum efficiency. . First, using the governing equations, the dimensions and performance characteristics of the generator are specified, and then the prototype of the generator is made based on the electromagnetic design. To evaluate the output performance of the generator, machine simulation was performed in Maxwell finite element analysis software and the characteristic curves for voltage, current and ohmic losses were extracted. To evaluate the accuracy of the results, the results of the analytical method were compared with the results of experimental tests.