Design, Analysis of the Location and Materials of Neodymium Magnets on the Torque and Power of In-Wheel External Rotor PMSM for Electric Vehicles

The technology of mounting electric direct drive motors into vehicle wheels has become one of the trends in the field of electric vehicle drive systems. The article presents suggestions for answering the question: How should magnets be mounted on the External Rotor Permanent Magnet Synchronous Machine (ERPMSM) with three phase concentrated windings, to ensure optimal operation of the electric machine in all climatic and weather conditions? The ERPMSM design methodology is discussed. Step by step, a method related to the implementation of subsequent stages of design works and tools (calculation methods) used in this type of work are presented. By means of FEM 2D software, various ERPMSM designs were analyzed in terms of power, torque, rotational speed, cogging torque and torque ripple. The results of numerical calculations related to variations in geometric sizes and application of different base materials for each of ERPMSM machine components are presented. The final parameters of the motor designed for mounting inside the wheel of the vehicle are presented (Power = 53 kW, Torque = 347 Nm; Base speed = 1550 RPM), which correspond to the adopted initial assumptions.


Introduction
The reduction of energy consumption from fossil fuels is an inspiration for many designers in undertaking the effort of designing new structures used in electric vehicles. One of the trends in the field of electric drive systems is the possibility of using electric machines mounted directly in the wheel of a driven vehicle, according to the invention of Wellington Adams from 1884 (US Patent 300827). Designing an electric motor mounted inside the wheel is a challenge for designers, because the developed design should be characterized by high durability and energy efficiency while having low weight. In this type of electric machines, the rotor is located on the outside of a stationary centrally mounted stator (PMSM (Permanent Magnet Synchronous Machine), ERPMSM (External Rotor PMSM), and ORPMSM (Outer Rotor PMSM)), unlike in classic synchronous motors with permanent magnets (IRPMSM (Internal Rotor PMSM)). One of the aspects to which attention is paid during designing an in-wheel electric machine is the method of attaching the magnets used in the electromagnetic circuit to the rotor.
The purpose of this paper is to analyze the possibilities of changing the geometrical dimensions of an electrical machine, in particular the method of magnets assembly and the materials used for its manufacture. This is a significant issue, giving the answer to the question: At what geometrical dimensions and materials used will we obtain the most power, torque and efficiency from a given volume of the electric machine as well as the smallest cogging torque and torque pulsations? The right choice of materials and geometric dimensions of the machine can contribute to reduction of electric significant. Every fraction of a percent of overall motor efficiency that is possible to gain while designing the components of the electromagnetic circuit later affects the energy savings and increases the range of the electric vehicle.
The main purpose of this article is to analyze the method of mounting the magnets on the ERPMSM rotor embedded in the wheel hub of the vehicle (Figure 1). The correct selection of the shape of the magnets and the way they are assembled, as well as the materials used, will allow optimal use of space in the wheel to obtain maximum power, torque and efficiency, while maintaining a minimum value of torque pulsations and cogging torque value. Against the background of the cited literature, this article presents new unique solutions in the field of the design of magnet assembly methods, affecting the quality of parameters obtained by an electric motor.

Motor Design Considerations
The selection of optimal parameters when designing an electric machine is a multidimensional and multimodal optimization problem, which additionally requires the use of high-performance computers. Moreover, the design process of an electric machine requires calculation of several parameters whose values are mutually dependent, which tends to complicate the optimization calculations [23,37,[51][52][53][54][55][56]. The methodology for the design and analysis of ERPMSM parameters has been implemented based on the diagram presented in Figure 2.

Motor Design Considerations
The selection of optimal parameters when designing an electric machine is a multidimensional and multimodal optimization problem, which additionally requires the use of high-performance computers. Moreover, the design process of an electric machine requires calculation of several parameters whose values are mutually dependent, which tends to complicate the optimization calculations [23,37,[51][52][53][54][55][56]. The methodology for the design and analysis of ERPMSM parameters has been implemented based on the diagram presented in Figure 2.
The proposed ERPMSM design methodology has been divided into three stages. In the first stage, the target parameters of the motor, specifically the power, torque and rotational speed values. are defined. The geometric dimensions of the motor as well as the number of magnets and coils together with the winding schematic are also defined. Then, in the second stage, for the adopted motor parameters and specific constraints mainly related to the geometric constraints and restrictions caused by the materials used to build the ERPMSM, the input variables of the analytical model are defined. The results of simulation tests for specific combinations of geometrical dimension, adopted specification of power, torque and rotational speed of the electrical machine, as well as the maximum efficiency value and losses occurring, constitute the basis for developing the base motor configuration (refer to Figure 2 [Numeric FEM analysis of ERPMSM electromagnetic field]). With the base motor specification complete, the influence of geometric changes on the adopted assumptions in the first part is analyzed. The results are analyzed considering the costs of implementing a particular solution and feasibility of manufacturing such a configuration, mass of the structure and environmental working conditions. The main problems of this stage concern: determination of the shapes and dimensions of magnets and coils; determining the method of fixing magnets; selection of materials for permanent magnets, rotor and stator; and minimizing the latching torque by twisting the stator or rotor. The last, third stage of the postulated ERPMSM design methodology concerns the selection of a solution recognized as the optimal construction solution, for the adopted assumptions and limitations.

Motor Design Considerations
The selection of optimal parameters when designing an electric machine is a multidimensional and multimodal optimization problem, which additionally requires the use of high-performance computers. Moreover, the design process of an electric machine requires calculation of several parameters whose values are mutually dependent, which tends to complicate the optimization calculations [23,37,[51][52][53][54][55][56]. The methodology for the design and analysis of ERPMSM parameters has been implemented based on the diagram presented in Figure 2.   Figure 2. Methodology of the ERPMSM design.

Identification of Vehicle Parameters
To design an electric motor which will operate in the wheel hub of the vehicle, it is necessary to know the available space inside the wheel rim. Another point of interest is the knowledge of the assumed performance figures of the vehicle in which the motor is to be mounted, the vehicle weight (in this particular case, about 1400 kg), acceleration (about 1.5 m/s 2 ), and top speed (about 130 km/h). With the given parameters available, the demand for power and torque generated by the motor can be determined by considering the forces acting on the vehicle during operation (Figure 3). The proposed ERPMSM design methodology has been divided into three stages. In the first stage, the target parameters of the motor, specifically the power, torque and rotational speed values. are defined. The geometric dimensions of the motor as well as the number of magnets and coils together with the winding schematic are also defined. Then, in the second stage, for the adopted motor parameters and specific constraints mainly related to the geometric constraints and restrictions caused by the materials used to build the ERPMSM, the input variables of the analytical model are defined. The results of simulation tests for specific combinations of geometrical dimension, adopted specification of power, torque and rotational speed of the electrical machine, as well as the maximum efficiency value and losses occurring, constitute the basis for developing the base motor configuration (refer to Figure 2 [Numeric FEM analysis of ERPMSM electromagnetic field]). With the base motor specification complete, the influence of geometric changes on the adopted assumptions in the first part is analyzed. The results are analyzed considering the costs of implementing a particular solution and feasibility of manufacturing such a configuration, mass of the structure and environmental working conditions. The main problems of this stage concern: determination of the shapes and dimensions of magnets and coils; determining the method of fixing magnets; selection of materials for permanent magnets, rotor and stator; and minimizing the latching torque by twisting the stator or rotor. The last, third stage of the postulated ERPMSM design methodology concerns the selection of a solution recognized as the optimal construction solution, for the adopted assumptions and limitations.

Identification of Vehicle Parameters
To design an electric motor which will operate in the wheel hub of the vehicle, it is necessary to know the available space inside the wheel rim. Another point of interest is the knowledge of the assumed performance figures of the vehicle in which the motor is to be mounted, the vehicle weight (in this particular case, about 1400 kg), acceleration (about 1.5 m/s 2 ), and top speed (about 130 km/h). With the given parameters available, the demand for power and torque generated by the motor can be determined by considering the forces acting on the vehicle during operation (Figure 3). Figure 3. Forces acting on a moving vehicle: FAD, total aerodynamic drag force; FT, traction force acting on the vehicle; FS, total sliding force; FTD, the force acting on the moving vehicle as a result of friction in the transmission system; FRR, rolling resistance forces; FM, traction force; FGR, weight of the vehicle; FN, normal force of the vehicle; TM, traction torque; α, road inclination.
The basic forces include the aerodynamic resistance, the rolling resistance, the sliding resistance, the inertia resistance and resistances from the mechanisms of the drivetrain. For the vehicle to be able to move by itself, the sum of occurring resistance forces must be less than the force generated by the propulsion system. Forces acting on the vehicle can be expressed based on classical dependencies: The basic forces include the aerodynamic resistance, the rolling resistance, the sliding resistance, the inertia resistance and resistances from the mechanisms of the drivetrain. For the vehicle to be able to move by itself, the sum of occurring resistance forces must be less than the force generated by the propulsion system. Forces acting on the vehicle can be expressed based on classical dependencies: where F R is the total resistance of the vehicle (N), F AD is the total aerodynamic drag force (N), F RR is the total rolling resistance (N), F S is the total sliding force (N), F TD is the force acting on the moving vehicle as a result of friction in the transmission system (N), and F IN is the force inertia of the vehicle and trailer system (N). The forces of aerodynamic drag of vehicle were determined from the following dependence: where C d is the vehicle drag coefficient (−), A is the frontal area of the vehicle m 2 , ρ is the ambient air density kg m 3 , and V is the vehicle speed m s . The rolling resistance of a vehicle can be determined based on: where m is the vehicle mass (kg), g is standard gravity m s 2 , µ RR is the vehicle wheels rolling resistance coefficient (−), R is the vehicle wheel radius (m), and α is the road inclination (deg).
The sliding forces acting on the vehicle are based on equation: The resistance forces of the transmission system resulting from the vehicle's motion, for a system which would employ a planetary gear in the wheel, were determined based on: wherein: where T PG is the torque at planetary gear output shaft at rated speed ω nPG (Nm), ω PG is the planetary gear output shaft rotation speed rad s , ω nPG is the nominal rotational speed of the planetary gear output rad s , T DS is the torque at drive shafts at rated speed ω nDS (Nm), ω DS is the average speed of wheel drive shafts rad s , ω nDS is the nominal rotational speed of wheel drive shafts rad s , and n PG is the final drive (planetary gear) ratio (−).
It should be noted that, for a direct drive system, i.e., without a geared transmission, the drag force of the drive train will equal zero, F TD = 0.
Inertia resistance forces arising from the acceleration and braking of the vehicle were determined based on: where m is the vehicle mass (kg) and a is the vehicle acceleration m s 2 . The source of the traction force F M (N) is traction torque T m (Nm) generated by an electric motor placed in the wheel hub.
The traction power available on the wheels of the vehicle is equal to the product of the vehicle linear velocity V m s and traction force F M (N).
The power of the electric drive motor is equal to the total drive power on the wheels divided by the number of wheels equipped with motors. In most designs, there are two or four drive motors.
For a synchronous motor, the power is equal to the product of the motor torque T (Nm) and its rotational speed n m (RPM): Taking into account the assumed values-vehicle weight approximately 1400 kg; acceleration approximately 1.5 m s 2 ; and top speed approximately 130 km/h-and assuming a drive system consisting of four motors with one in each wheel, the demand for motor power would be about 50 kW, the required torque would be 350 Nm and rotational speed would be about 1500 RPM.

Analysis and Selection of Windings for ERPMSM
With the predicted motor parameters (torque, power and rotational speed), one can proceed with the design of the electromagnetic circuit, determining the number of phases, the number of coils (teeth) and magnets [19,57,58]. The value defining the relationship between the number of concentrated coils and the number of magnets is called the winding factor of the motor, and it can take the maximum value of 1. Motors with the best properties related to the torque they develop have this value close to unity. To make the winding factor optimal, fundamental and secondary assumptions, about the amount and scheme of winding the coils as well as the number of magnets, should be met. The fundamental assumptions are: the number of magnets divisible by 2; the number of concentrated coils divisible by 3; the number of magnets different from the number of concentrated coils; the fulfillment of equality determining the relationship between the multiplicity of the number of phases and the quotient between the number of concentrated coils; and the largest common divisor of the number of concentrated coil and the double of pole pairs number.
The additional assumption is the rejection of winding schemes in which there is an asymmetry of forces acting between the stator and the rotor. This can be achieved by checking whether the largest common divisor of the number of coils and magnets is greater than 2. The method for determining the value of the winding factor k W is shown in [58]. Figure 4 shows the value of the motor winding coefficient k W depending on the various combinations of number of coils and magnets. Non-shaded fields denote the configuration for highly efficient motors. Fields shaded in red represent the configuration for motors that do not meet the basic design requirements. The value of the winding coefficient is shown in the upper part of the cell corresponding to column with specified number of coils and row with specified number of magnets. In the lower part of the cell, the leftmost section displays the number of coil layers possible to be wound with specific magnet and coil combination. The middle section displays cogging steps per rotation for given combination while the rightmost section shows the number of fundamental winding pattern repetitions. It is assumed that motors with coils with a winding coefficient kW less than 0.5 are ineffective, because they inefficiently use the capabilities of the electric machine in terms of the torque developed by it. It results from the following dependence found in [59].
where T is the Motor torque ( ), kw is the winding factor, Ns is the Number of motor slots, Nt is the number of turns, Nl is the number of winding layers (1 or 2), Bσmax is the peak value of air gap magnetic flux density in ( ), Sσ is the area of air gap, Ip is the phase current peak value, and θ is the advance angle.
Motors with kW in the range from 0.5 to 0.86 have medium efficiency, and electric machines with kW greater than 0.86 are highly efficient. When making the final decision about choosing a given configuration, the number of coils and magnets should be considered, as well as whether the chosen arrangement will be physically possible to manufacture, for example, whether the windings fit in a given space. When designing a motor, parameters such as speed at which it will rotate and what power it will be able to produce should be taken into account. The speed of rotation is dependent on the number of layers and turns on the winding at a given supply voltage, while some of the parameters responsible for the amount of generated power are the number and diameter of copper wires used to wind the motor, and the current density of the stator windings. Bearing in mind the It is assumed that motors with coils with a winding coefficient k W less than 0.5 are ineffective, because they inefficiently use the capabilities of the electric machine in terms of the torque developed by it. It results from the following dependence found in [59].
where T is the Motor torque (Nm), k w is the winding factor, N s is the Number of motor slots, N t is the number of turns, N l is the number of winding layers (1 or 2), B σmax is the peak value of air gap magnetic flux density in (T), S σ is the area of air gap, I p is the phase current peak value, and θ is the advance angle. Motors with k W in the range from 0.5 to 0.86 have medium efficiency, and electric machines with k W greater than 0.86 are highly efficient. When making the final decision about choosing a given configuration, the number of coils and magnets should be considered, as well as whether the chosen arrangement will be physically possible to manufacture, for example, whether the windings fit in a given space. When designing a motor, parameters such as speed at which it will rotate and what power it will be able to produce should be taken into account. The speed of rotation is dependent on the number of layers and turns on the winding at a given supply voltage, while some of the parameters responsible for the amount of generated power are the number and diameter of copper wires used to wind the motor, and the current density of the stator windings. Bearing in mind the above assumptions, the numerical calculations were based on a motor consisting of 12 coils and 14 magnets, which has the winding coefficient k W of 0.933.

Selection of ERPMSM Geometric Dimensions
Available space for motor is mainly constrained to the volume inside the wheel rim. Typical wheel sizes used in the vehicles of A and B segments (defined by the European Commission) have rim sizes of 13-14 inches. Considering the way of joining the motor to the suspension, requirements of suspension geometry, including scrub radius and camber (necessitating placement of supports at exact locations) as well as the available space inside the rim (cylindrical space with diameter of 300 mm and width of 140 mm), the dimensions of the electromagnetic circuit of the motor of 280 mm in diameter and 80 mm in thickness were proposed ( Figure 5).
Energies 2018, 11, x FOR PEER REVIEW 8 of 23 above assumptions, the numerical calculations were based on a motor consisting of 12 coils and 14 magnets, which has the winding coefficient kW of 0.933.

Selection of ERPMSM Geometric Dimensions
Available space for motor is mainly constrained to the volume inside the wheel rim. Typical wheel sizes used in the vehicles of A and B segments (defined by the European Commission) have rim sizes of 13-14 inches. Considering the way of joining the motor to the suspension, requirements of suspension geometry, including scrub radius and camber (necessitating placement of supports at exact locations) as well as the available space inside the rim (cylindrical space with diameter of 300 mm and width of 140 mm), the dimensions of the electromagnetic circuit of the motor of 280 mm in diameter and 80 mm in thickness were proposed ( Figure 5).

Selection of the Shape and Geometric Dimensions of Magnets
Having accepted the value of the number of coils and magnets, it is proposed that the next step in the design of the ERPMSM electric machine is to determine the shapes and geometric dimensions of the magnets used for the rotor. Four types of magnet shapes ( Figure 6) were adopted for the analysis. The choice of the shape and geometric dimensions of the magnets affects not only the properties of the electromagnetic circuit, but also the cost of motor manufacture. Figure 7 presents the principle of determination of the length of the magnet measured in electrical degrees (°) in relation to the rotor pole pitch of the electrical machine. The size of the magnet expressed in mechanical degrees is defined by:

Selection of the Shape and Geometric Dimensions of Magnets
Having accepted the value of the number of coils and magnets, it is proposed that the next step in the design of the ERPMSM electric machine is to determine the shapes and geometric dimensions of the magnets used for the rotor. Four types of magnet shapes ( Figure 6) were adopted for the analysis. above assumptions, the numerical calculations were based on a motor consisting of 12 coils and 14 magnets, which has the winding coefficient kW of 0.933.

Selection of ERPMSM Geometric Dimensions
Available space for motor is mainly constrained to the volume inside the wheel rim. Typical wheel sizes used in the vehicles of A and B segments (defined by the European Commission) have rim sizes of 13-14 inches. Considering the way of joining the motor to the suspension, requirements of suspension geometry, including scrub radius and camber (necessitating placement of supports at exact locations) as well as the available space inside the rim (cylindrical space with diameter of 300 mm and width of 140 mm), the dimensions of the electromagnetic circuit of the motor of 280 mm in diameter and 80 mm in thickness were proposed ( Figure 5).

Selection of the Shape and Geometric Dimensions of Magnets
Having accepted the value of the number of coils and magnets, it is proposed that the next step in the design of the ERPMSM electric machine is to determine the shapes and geometric dimensions of the magnets used for the rotor. Four types of magnet shapes ( Figure 6) were adopted for the analysis. The choice of the shape and geometric dimensions of the magnets affects not only the properties of the electromagnetic circuit, but also the cost of motor manufacture. Figure 7 presents the principle of determination of the length of the magnet measured in electrical degrees (°) in relation to the rotor pole pitch of the electrical machine. The size of the magnet expressed in mechanical degrees is defined by:  The choice of the shape and geometric dimensions of the magnets affects not only the properties of the electromagnetic circuit, but also the cost of motor manufacture. Figure 7 presents the principle of determination of the length of the magnet measured in electrical degrees ( • E) in relation to the rotor pole pitch of the electrical machine. The size of the magnet expressed in mechanical degrees is defined by: where α • M is the angular measure of the magnet expressed in mechanical degrees, α • E is the angular measure of the magnet expressed in electrical degrees, and p is the number of magnets (rotor poles).
Energies 2018, 11, x FOR PEER REVIEW 9 of 23 where ° is the angular measure of the magnet expressed in mechanical degrees, ° is the angular measure of the magnet expressed in electrical degrees, and is the number of magnets (rotor poles). Magnets used in electromagnetic circuits of electrical machines are one of the most expensive motor components. At the same time, they allow exciting the electromagnetic circuit while maintaining low mass and volume of the motor in relation to other electrical machines. The least expensive ones are rectangular prismatic magnets, arc shaped magnets are more expensive and the most expensive are lenticular ones. Thanks to the appropriate arrangement of magnets on the rotor, e.g. arranged into the Halbach array, it is possible to obtain the effect of strengthening the magnetic flux on the rotor's side facing the air gap and weakening the flux on the rotor iron side.

Analysis and Selection of Magnet Fixings on the Rotor
The method of mounting magnets on the ERPMSM rotor is a very important aspect related to the correct operation of this electric machine.
The purpose of ERPMSM is to directly drive the wheel of a vehicle that travels on different surfaces such as asphalt, pavement, gravel, stones, sand, mud, snow, ice, etc., with different rotational speeds, in the presence of different temperature conditions (hot, cold, and frost) and varying degrees of humidity (including periodic partial, or total immersion in water or mud). Road surface irregularities cause the wheel mounted motor to experience shocks and vibration. In addition, the magnets mounted on the rotor are subjected to forces caused by action of the coils in the electromagnetic circuit. Very high values of current in the stator circuit, along with extra harmonic content introduced from the inverter circuit can cause heating of magnets, and in extreme cases demagnetization, following their detachment from the rotor surface and permanent damage [60]. The method of mounting magnets on the ERPMSM rotor is to ensure optimal use of their magnetic properties, without compromising the developed parameters of the motor, and regardless of the environmental conditions in which they are used. In this work, various methods of mounting neodymium magnets on the rotor were analyzed (Figure 8): flat on the rotor surface, in milled recesses, through hooks with varying spans of air gaps, in pockets buried beneath the surface of the rotor, and flat on the rotor surface mounted using paramagnetic fixtures. Additional effect of introducing extra magnets, arranged into Halbach array, was also taken into consideration. Magnets used in electromagnetic circuits of electrical machines are one of the most expensive motor components. At the same time, they allow exciting the electromagnetic circuit while maintaining low mass and volume of the motor in relation to other electrical machines. The least expensive ones are rectangular prismatic magnets, arc shaped magnets are more expensive and the most expensive are lenticular ones. Thanks to the appropriate arrangement of magnets on the rotor, e.g. arranged into the Halbach array, it is possible to obtain the effect of strengthening the magnetic flux on the rotor's side facing the air gap and weakening the flux on the rotor iron side.

Analysis and Selection of Magnet Fixings on the Rotor
The method of mounting magnets on the ERPMSM rotor is a very important aspect related to the correct operation of this electric machine.
The purpose of ERPMSM is to directly drive the wheel of a vehicle that travels on different surfaces such as asphalt, pavement, gravel, stones, sand, mud, snow, ice, etc., with different rotational speeds, in the presence of different temperature conditions (hot, cold, and frost) and varying degrees of humidity (including periodic partial, or total immersion in water or mud). Road surface irregularities cause the wheel mounted motor to experience shocks and vibration. In addition, the magnets mounted on the rotor are subjected to forces caused by action of the coils in the electromagnetic circuit. Very high values of current in the stator circuit, along with extra harmonic content introduced from the inverter circuit can cause heating of magnets, and in extreme cases demagnetization, following their detachment from the rotor surface and permanent damage [60]. The method of mounting magnets on the ERPMSM rotor is to ensure optimal use of their magnetic properties, without compromising the developed parameters of the motor, and regardless of the environmental conditions in which they are used. In this work, various methods of mounting neodymium magnets on the rotor were analyzed (Figure 8): flat on the rotor surface, in milled recesses, through hooks with varying spans of air gaps, in pockets buried beneath the surface of the rotor, and flat on the rotor surface mounted using paramagnetic fixtures. Additional effect of introducing extra magnets, arranged into Halbach array, was also taken into consideration.

Motor Modeling
Many programs on the market allow modeling various designs of electrical machines, including those that allow comprehensively modeling and testing the parameters of an ERPMSM. The most known software packages are: ANSYS Maxwell, RMXPRT (ANSOFT), SolidWorks (Magnetostatic Analysis), Motor (CAD), JMAG (Designer), MotorSolve, Flux Motor, and MotorAnalysis [61], the last of which was used for experimental validation of ERPMSM. The solution of permanent magnet electric machine electromagnetic circuit was implemented using a two-dimensional approximation, which is based on the assumption that the magnetic field does not depend on the Z coordinate (Z-axis-parallel to the axis of the rotor shaft). Thanks to this, the electromagnetic circuit was considered in the plane of the machine's cross-section (x-y plane). Thanks to this, in a simplified two-dimensional approach, the current density and the vector of the magnetic field will have only Z components. Thus, they can be expressed in the following way: where μr is the relative permeability of material, A is the magnetic vector potential, J is the electric current density, σe is the electrical conductivity (S/m), U is the voltage in the region of calculation, and l is the length in the Z-axis.

Motor Modeling
Many programs on the market allow modeling various designs of electrical machines, including those that allow comprehensively modeling and testing the parameters of an ERPMSM. The most known software packages are: ANSYS Maxwell, RMXPRT (ANSOFT), SolidWorks (Magnetostatic Analysis), Motor (CAD), JMAG (Designer), MotorSolve, Flux Motor, and MotorAnalysis [61], the last of which was used for experimental validation of ERPMSM. The solution of permanent magnet electric machine electromagnetic circuit was implemented using a two-dimensional approximation, which is based on the assumption that the magnetic field does not depend on the Z coordinate (Z-axis-parallel to the axis of the rotor shaft). Thanks to this, the electromagnetic circuit was considered in the plane of the machine's cross-section (x-y plane). Thanks to this, in a simplified two-dimensional approach, the current density and the vector of the magnetic field will have only Z components. Thus, they can be expressed in the following way: (15) where µr is the relative permeability of material, A is the magnetic vector potential, J is the electric current density, σ e is the electrical conductivity (S/m), U is the voltage in the region of calculation, and l is the length in the Z-axis.
To solve the simplified two-dimensional circuit defined by Equations (14) and (15), two methods were used. The magnetostatic method using finite elements method (FEM) was used for magnetostatic analysis. However, for Dynamic Finite Element Analysis, a transient finite element method is used. An iterative time procedure was used for both adopted methods, aimed at finding parameters of the electromagnetic circuit, whose parameters change over time.
Basing on the Maxwell stress tensor method, electromagnetic torque can be calculated as follows: where l m is the motor lamination stack length, D r is the rotor diameter, d σ is the length of air gap, µ 0 is the magnetic permeability of vacuum, B n is the magnetic flux density in normal direction, and B t is the magnetic flux density in tangential direction. The value of electromagnetic force can be determined based on the known value of the magnetic flux coming from magnets placed on the rotor that move between the starting point and the target point: where ∂W is the change in the magnetic field between the starting point and the target point, and ∂e is the value of the linear shift. The torque value is determined in a similar way: where ∂ϕ is the value of the angular offset. In practice, the torque and power generated by a three-phase electric machine depend mainly on its geometrical dimensions, the materials used and design features [14,30,57,[62][63][64][65][66][67][68][69] These parameters are determined by the internal apparent power P i of the machine and the associated internal electromagnetic torque of the machine: where U RMS is the effective voltage value, I RMS is the effective current value, K is the geometric coefficient of the motor, and ω M is the mechanical angular velocity.
where ω is the voltage pulsation ω = 2π f , f is the frequency, and p is the number of pole pairs. where k B is the shape factor of the excitation field, k U is the shape factor of induced voltage, k w is the winding factor, J L is the linear current density, and B m is the maximum value of magnetic induction.
where k B is the shape factor of the excitation field, B AV is the average value of the magnetic induction, and B m is the maximum value of the magnetic induction.
where k U is the shape factor of induced voltage, U RMS is the effective value of induced voltage, and U AV is the average value of induced voltage. The electromagnetic internal torque of the machine can be determined based on: Figure 9 shows an example of the examined ERPMSM electromagnetic circuit modeled in the MotorAnalysi-PM v1.1 software [61] using the MATLAB package. The electromagnetic internal torque of the machine can be determined based on: Figure 9 shows an example of the examined ERPMSM electromagnetic circuit modeled in the MotorAnalysi-PM v1.1 software [61] using the MATLAB package.

Results of Simulation Research
The space available for an electromagnetic motor circuit is 280 mm in diameter and 80 mm in thickness, and the assumed motor parameters were: base motor speed at 1500 RPM, peak power at 50 kW and torque about 300 Nm. Table 1 presents the preliminary results of calculations for the electromagnetic circuit with flat magnets, lenticular magnets, arc shaped magnets and the Halbach array magnets. The following values were assumed: the number of coils was 16, the wire cross sectional area (CSA) was 13.4 mm 2 , the effective current supplying one phase was 150 A, the inverter DC supply voltage was 400 V, and the angular measure of the magnets was 120 °E. The first column of the table shows the method of fixing magnets on the rotor, as explained in Figure 6

Results of Simulation Research
The space available for an electromagnetic motor circuit is 280 mm in diameter and 80 mm in thickness, and the assumed motor parameters were: base motor speed at 1500 RPM, peak power at 50 kW and torque about 300 Nm. Table 1 presents the preliminary results of calculations for the electromagnetic circuit with flat magnets, lenticular magnets, arc shaped magnets and the Halbach array magnets. The following values were assumed: the number of coils was 16, the wire cross sectional area (CSA) was 13.4 mm 2 , the effective current supplying one phase was 150 A, the inverter DC supply voltage was 400 V, and the angular measure of the magnets was 120 • E. The first column of the table shows the method of fixing magnets on the rotor, as explained in Figure 6, and the percent fill of the available angular measure (180 • = 100%) of the rotor pole pitch with the permanent magnetic material. The consecutive columns in the following tables contain the values of: maximum possible RMS supply voltage per phase U (V); RMS phase voltage U RMS (V); base rotational speed n 0 (RPM); torque T (Nm); cogging torque T P (Nm); maximum efficiency η max (%); mechanical power P M (kW); stator copper losses P Cu (kW); and motor iron losses P Fe (kW). Because the assumed rotational speed of the electrical machine at 1500 (RPM) is lower than the values obtained in the tests (Table 1), the number of turns has been increased to 17 with a simultaneous reduction of the wire cross section to 12.8 [mm 2 ]. Table 2 presents the results of simulation tests for the corrected winding. The obtained base speed value n 0 is now consistent with the assumed value. Further tests of the electromagnetic circuit of the electric machine were carried out based on the methodology presented in Figure 2. The results of simulation tests are included in the following tables. Table 3 shows the influence of changes in the length of arc shaped magnets (Figure 6a) on the value of parameters obtained by ERPMSM.  Table 4 shows the effect of changes in the radius of curvature of the air gap facing surface of the lenticular magnets (Figure 6b) on the value of parameters obtained by ERPMSM. With the increase of the radius curvature of the magnet surface, the thickness of the magnet increases up to the value when the magnet takes the form of flat (prismatic shaped) magnet.  Tables 5 and 6 present the influence of length and thickness of prismatic magnets (Figure 6c) on the value of parameters obtained by ERPMSM. Based on the obtained results, it was found that the optimal solution (cost of magnets relative to obtained performance figures of ERPMSM) for the construction of ERPMSM requires the selection of prismatic (flat) magnets. For this reason, this type of magnets was chosen for further analysis. Table 7 presents the effect of fixing flat magnets on the performance obtained by ERPMSM. The description in the first details how the magnets are attached to the rotor, as shown in Figure 7. Table 8 shows the impact of the use of various ferromagnetic material grades for construction of the stator on the parameters obtained by ERPMSM. Similarly, Table 9 demonstrates the effect of using various ferromagnetic materials for the construction of the rotor on the performance obtained by ERPMSM. Table 10 presents the outcome of changing the grade of permanent magnet material on the calculated ERPMSM parameters.  Table 10 shows the effect of using magnets made of various magnetic materials on the value of parameters obtained by ERPMSM. Table 11 shows the effect of skewing the rotor magnets along the shaft axis by the amount of mechanical degrees on the value of parameters obtained by ERPMSM. Similarly, Table 12 shows the effect of twisting the stator coils in the same manner on the obtained ERPMSM parameters.

Discussion
This section discusses the influence of various methods of attaching neodymium magnets on the rotor to the quality of the obtained ERPMSM parameters. The research was aimed at selecting the method of mounting magnets on the surface of the rotor, which would guarantee stable maintenance of magnets in various operating conditions, while ensuring the assumed torque and power.
Four variants of magnets used in ERPMSM electric machine were proposed for initial testing ( Figure 6): arc shaped, lenticular, rectangular prismatic (flat) and flat arranged in the Halbach array. Considering the road conditions influence on the motor installed in the wheel of the vehicle, in which the motor is to be operated, it would seem optimal to use rectangular prismatic shaped magnets. The choice of flat magnets for further analysis was mainly influenced by the reduced cost of manufacture of flat magnets in relation to other magnet types, and the method of their assembly, ensuring resistance to temperature changes as well as vibrations and shocks during operation.
Looking back at the assumed ERPMSM target parameters related to the vehicle power demand, which requires the motor power of about 50 (kW), 340 (Nm) of torque and a rotational speed of 1500 (RPM), and taking into account the manufacture costs of magnets with specific shape, and the method of their attachment to the rotor, rectangular prismatic magnets mounted on the rotor by means of paramagnetic holders (Figure 7g) were chosen as the optimal solution for the adopted dimensions and assumptions. In addition to the magnets' shape, it is proposed to select the N38UH permanent magnet material, the M235-35A non grain oriented electrical steel material for the stator, and the ARMCO pure iron material for the rotor. The length of rectangular prismatic magnets was assumed at 66.7% of the total available space for the magnet, which equals 120 electrical degrees. For reduction of the cogging torque, the optimal results were obtained for skewing the magnets on the rotor by 3.75°. Table 13 presents the optimal results of the tests obtained during computer simulations for the construction assumptions and materials presented above.

Discussion
This section discusses the influence of various methods of attaching neodymium magnets on the rotor to the quality of the obtained ERPMSM parameters. The research was aimed at selecting the method of mounting magnets on the surface of the rotor, which would guarantee stable maintenance of magnets in various operating conditions, while ensuring the assumed torque and power.
Four variants of magnets used in ERPMSM electric machine were proposed for initial testing ( Figure 6): arc shaped, lenticular, rectangular prismatic (flat) and flat arranged in the Halbach array. Considering the road conditions influence on the motor installed in the wheel of the vehicle, in which the motor is to be operated, it would seem optimal to use rectangular prismatic shaped magnets. The choice of flat magnets for further analysis was mainly influenced by the reduced cost of manufacture of flat magnets in relation to other magnet types, and the method of their assembly, ensuring resistance to temperature changes as well as vibrations and shocks during operation.
Looking back at the assumed ERPMSM target parameters related to the vehicle power demand, which requires the motor power of about 50 (kW), 340 (Nm) of torque and a rotational speed of 1500 (RPM), and taking into account the manufacture costs of magnets with specific shape, and the method of their attachment to the rotor, rectangular prismatic magnets mounted on the rotor by means of paramagnetic holders (Figure 7g) were chosen as the optimal solution for the adopted dimensions and assumptions. In addition to the magnets' shape, it is proposed to select the N38UH permanent magnet material, the M235-35A non grain oriented electrical steel material for the stator, and the ARMCO pure iron material for the rotor. The length of rectangular prismatic magnets was assumed at 66.7% of the total available space for the magnet, which equals 120 electrical degrees. For reduction of the cogging torque, the optimal results were obtained for skewing the magnets on the rotor by 3.75 • . Table 13 presents the optimal results of the tests obtained during computer simulations for the construction assumptions and materials presented above.
Tables 1-13 present the largest loss values associated with the operation of an electric machine, i.e. theoretical losses in copper loss and core loss. The theoretical values of the maximum efficiency of ERPMSM given in Tables 1-13 will in fact be reduced by many other types of losses, of which the most common are bearing losses, winding losses, hysteresis losses, cross-slot losses, stray losses, dielectric losses and other losses. Even if we were able to precisely model all kinds of listed losses, the maximum efficiency parameter is used as a reference parameter, based on which we evaluate properties in the same way for all modeled structures.
Thanks to the adopted methodology of motor design, a high mass power to weight ratio was obtained in ERPMSM at the level of 2.29 kW/kg, with a total active weight of the electric machine components at 25.03 kg, of which individual masses are: rotor at 5.98 kg; stator at 9.29 kg; windings at 6.32 kg; and magnets at 3.44 kg. Figure 11 presents the waveforms of the obtained parameters by numerical simulations of such quantities as: motor power, torque, efficiency, RMS phase voltage, torque ripple and cogging torque.  Tables 1-13 present the largest loss values associated with the operation of an electric machine, i.e. theoretical losses in copper loss and core loss. The theoretical values of the maximum efficiency of ERPMSM given in Tables 2-14 will in fact be reduced by many other types of losses, of which the most common are bearing losses, winding losses, hysteresis losses, cross-slot losses, stray losses, dielectric losses and other losses. Even if we were able to precisely model all kinds of listed losses, the maximum efficiency parameter is used as a reference parameter, based on which we evaluate properties in the same way for all modeled structures.
Thanks to the adopted methodology of motor design, a high mass power to weight ratio was obtained in ERPMSM at the level of 2.29 kW/kg, with a total active weight of the electric machine components at 25.03 kg, of which individual masses are: rotor at 5.98 kg; stator at 9.29 kg; windings at 6.32 kg; and magnets at 3.44 kg. Figure 11 presents the waveforms of the obtained parameters by numerical simulations of such quantities as: motor power, torque, efficiency, RMS phase voltage, torque ripple and cogging torque.   Based on the conducted research, it is not possible to clearly indicate a specific dependence (e.g., the ratio of arc fill of the rotor with magnets), the observance of which would guarantee obtaining optimal parameters regardless of the dimensions of a given electric machine.
Designing an electric machine requires special care and considering all motor parameters, especially when the dimensions change. The conducted research confirmed the convergence of the obtained results with other works on similar topics presented in the Introduction [11,12,35,36,[38][39][40]43,44]. In the scope of changes in geometric dimensions, shapes and construction of magnets and coils, and the application of materials with different magnetic properties, very similar results were obtained. In the presented works, the subject of verification, in terms of the electromechanical parameters obtained, were geometrical dimensions, machine mass, and materials from which magnets were made. The construction solutions regarding the method of fixing magnets of the same type and shape have not been investigated in any way.
No information was found in the literature related to the effect of magnet assembly and fixing methods on the performance obtained by the electric motor. Against the background of the Based on the conducted research, it is not possible to clearly indicate a specific dependence (e.g., the ratio of arc fill of the rotor with magnets), the observance of which would guarantee obtaining optimal parameters regardless of the dimensions of a given electric machine.
Designing an electric machine requires special care and considering all motor parameters, especially when the dimensions change. The conducted research confirmed the convergence of the obtained results with other works on similar topics presented in the Introduction [11,12,35,36,[38][39][40]43,44]. In the scope of changes in geometric dimensions, shapes and construction of magnets and coils, and the application of materials with different magnetic properties, very similar results were obtained. In the presented works, the subject of verification, in terms of the electromechanical parameters obtained, were geometrical dimensions, machine mass, and materials from which magnets were made. The construction solutions regarding the method of fixing magnets of the same type and shape have not been investigated in any way.
No information was found in the literature related to the effect of magnet assembly and fixing methods on the performance obtained by the electric motor. Against the background of the presented publications, this article presents new unique solutions that affect the quality of parameters obtained by the designed electric machine.
To properly design an electrical machine with the desired parameters, several criteria should be considered to obtain synergistic effect.

Conclusions
In this paper, various methods of mounting neodymium magnets for External Rotor Permanent Magnet Synchronous Machine have been presented and analyzed.
The motor design methodology for in-wheel direct drive motors using the FEM 2D method was presented, thanks to which the shape of neodymium magnets and their assembly method were correctly selected.
Thanks to the demonstrated methodology, considering the method of mounting magnets on the rotor, environmental working conditions, materials for magnets, rotor and stator were also selected, which allowed for the optimize the use of space inside the wheel to obtain maximum power, torque and efficiency, while maintaining the minimum value of cogging torque and torque ripple.
The proposed design methodology External Rotor Permanent Magnet Synchronous Machine\provides for reduced mass, reduced leakage flux, and high flux densities to improve performance of the parameters achieved.
ERPMSM machine design is a multicriteria and multistage task, aimed at determining the optimal dimensions and materials used for motor construction, including their production costs and manufacturing possibilities.
Thanks to the presented design methodology, External Rotor Permanent Magnet Synchronous Machine obtained a synergistic effect of cooperation of all electrical machine elements expressed by a high coefficient of developed maximum power from a mass unit of 2.29 [kW/kg].
Funding: This research received no external funding.