## 4 Electromagnetic Torque Modeling and Torque Density Optimization
### Torque Density Optimization  
In this paper, the motor optimization variables are analyzed based on the electromagnetic torque analytical model. Using the genetic algorithm (GA) optimizer in Maxwell software, the motor optimization objectives are designed and refined. The detailed optimization process is illustrated in Figure 26.  
Since the AFPMM designed in this paper is intended for use in quadruped robots, the motor is required to have a higher torque density. Therefore, the torque density of the motor is defined as the optimization objective in this paper, and its calculation formula is expressed as follows:  
\[S=\frac{T_{\text{ele\_avg}}}{m_{\text{ele}}} \tag{22}\]  
In the formula, \(S\) represents the motor torque density, \(T_{\text{ele\_avg}}\) is the average rated electromagnetic torque over an electric cycle, and \(m_{\text{ele}}\) denotes the motor's effective mass. As can be seen from Equation (22), to enhance the torque density of the AFPMM, it is necessary to maximize the rated torque of the motor while minimizing its effective mass. Based on the electromagnetic torque analytical model of the axial flux permanent magnet motor, the stator slot width, stator slot depth, stator yoke thickness, and permanent magnet thickness affect the motor torque, while the air gap length influences the motor performance. First, an excessively narrow stator slot width leads to a smaller output electromagnetic torque. If the stator slot depth remains unchanged, it will increase the slot fill factor of the motor,thereby limiting the winding arrangement. However, an overly wide stator slot width can cause magnetic saturation in the teeth. Second, the stator yoke must be sufficiently thick to prevent magnetic saturation, but excessive thickness will increase the motor weight and reduce the torque density. Additionally, an excessively small air gap can cause magnetic saturation and rubbing between the rotor and stator (sweeping the chamber). An overly large air gap requires an increase in the permanent magnet thickness to maintain the electromagnetic torque, which in turn increases the motor weight. Lastly, the thickness of the permanent magnet affects the air gap magnetic field and electromagnetic torque. An increase in thickness raises the air gap magnetic flux density and electromagnetic torque. However, if the magnetic flux density in the stator yoke reaches saturation, the electromagnetic torque will stabilize. Therefore, the thickness of the permanent magnet needs to be optimized in conjunction with the thickness of the stator yoke. The selected optimization variables include stator slot width \(b_{0}\), stator slot depth \(h_{\mathrm{s}}\), stator yoke thickness \(h_{\mathrm{sy}}\), permanent magnet thickness \(t_{\mathrm{m}}\), and motor air gap length \(h_{\mathrm{g}}\). Their respective value ranges are provided in Table 3, and their positions are shown in Figure 27.  
Figure 26: Optimization process of axial flux permanent magnet motor. During the optimization of the stator slot width and depth, the slot fill factor of the motor will be affected. An excessively high slot fill factor can increase the difficulty of winding or even make it impossible to wind the coils, while a low slot fill factor leads to material wastage. Therefore, the slot fill factor is set between 0.65 and 0.8. When optimizing the five parameters, the rated load back electromotive force (EMF) of the motor will also change. To ensure that the motor can reach its peak speed, the maximum value of the rated load back EMF should be limited to 0.35 to 0.45 times the rated voltage. During the optimization process, the magnetic flux densities in the stator yoke and teeth will also vary. Excessively high magnetic flux density in the yoke increases losses and heat generation, while a low magnetic flux density leads to material wastage.