– A multilevel ant algorithm is developed to optimize the design process of a surface mounted permanent magnet synchronous motor. The motor properties are calculated using an exact magnetic equivalent circuit based analytical model. This model takes into account the iron saturation, the slot stray fluxes and the spatial harmonics of rotor and stator fluxes. The effectiveness of the proposed analytical model is verified in comparison with measurement of a handmade prototype. Based on this analytical model the air gap flux density, torque and induced voltage of the prototype motor are predicted. For an effective selection of motor parameters, a multipurpose optimization algorithm is developed, which is based on the distributed multilevel ant-stigmergy algorithm. The analytical model together with the optimization algorithm represents a very effective tool for design of permanent magnet synchronous motor without any need for time consuming finite element programs. Keywords – permanent magnet synchronous motor, analytical model, prototyping, optimization algorithms I. INTRODUCTION Design of efficient and customized motors which are destined to present specific behavior and reach predefined characteristics, depends on the selection of the best possible combination of motor parameters. Since there are too many parameters which influence the motor’s static and dynamic performances, choice of an optimal pattern of parameters could be really complicated and time consuming [1], [2], [3]. The first step of an optimized design of an electrical motor is a proper description of its electric and magnetic characteristics. In other word, dependency of specified motor properties such as torque pulsation, weight or efficiency on different parameters such as slot opening, length and diameter of the motor has to be analyzed. Traditionally the Finite Element Method (FEM) is used to analyze the motor behavior [4]. Several parameters of motor are varied step by step and the electromagnetic properties of motor are observed and optimized. Such an optimization process is totally time consuming and complex. It should also be considered that the computation of some motor properties such as induced voltage and cogging torque requires much more iterations in FEM and can be even more time consuming. Therefore, an analytical based motor optimization is an absolutely important aspect in design of electrical machineries [5], [6]. It should also be mentioned that optimization is not a pure electromagnetic calculation but rather a Multiphysics study of motor characteristics such as thermal and mechanical behavior of motor [7], [8]. Analytical models which are used for optimization process should totally agree with the experimental results of the prototype which is going to be constructed. However, this aspect is usually missed in the previous works. In this paper a modified analytical model is presented and its effectiveness is verified numerically and experimentally. Since motor parameters should be considered in a wide range of acceptable values, the proposed analytical model is also verified on different simulated motors, which makes it possible to be used for an optimization process. An effective optimization algorithm based on the ant colony optimization is used to handle with a multipurpose optimization process. This optimization algorithm together with an exact analytical model of the motor presents a very useful platform for an optimized design of Permanent Magnet Synchronous Motor (PMSM). In the first section of this paper the analytical model is discussed and in the second part the implementation of the ant colony optimization and its results are presented. II. ANALYTICAL MODEL OF PMSM A. Magnetic Equivalent Circuit As it is mentioned in the previous section, an analytical model which is going to be used in an optimization process should be necessarily valid for a wide range of motor geometric and magnetic parameters and it should also agree with the experimental measurements. In this section such an analytical model will be discussed. The proposed model is developed based on the construction of a modified reluctance network which delivers the time and position dependent flux density distribution in the air gap, in the rotor and in different parts of the stator. Based on these flux density distributions it is possible to calculate all of the other motor properties such as induced voltage with its entire harmonics, torque and its pulsation, efficiency and inductances. Since the analytical model consists of time and position dependent functions of all motor geometric, material and electric properties, it is possible to implement an optimization algorithm for a proper selection of these motor parameters for achieving a predefined performance. Another advantage of the proposed reluctance based model is the consideration of saturation and © 2018 IEEE. Personal use of this material is permitted. Permission from IEEE must be obtained for all other uses, in any current or future media, including reprinting /republishing this material for advertising or promotional purposes, creating new collective works, for resale or redistribution to servers or lists, or reuse of any copyrighted component of this work in other works. This article is accepted and will published on the IEEE eXplore. All rights reserved. consequently the motor non-linearity characteristics. The reluctance model is simulated with the help of the PLECS toolbox and all the flux densities are calculated in MATLAB/SIMULINK. An approximation of the constructed reluctance network is shown in Figure 1. There are different flux paths under tooth and slot which should be considered separately [9]. Permanent magnets and windings are modeled as magnetic voltage sources and series resistances. In order to achieve a good approach of flux density distribution, the modified flux paths should be used particularly under slots. Figure 1. Approximation of reluctance network of a PMSM; a) motor cross section, b) Tooth parametrization The goal of the motor modelling is to find the value of the reluctances assigned to the different flux paths as a function of the motor parameters. The difficulty of modeling the reluctances in air (air gap and slots) is based on the fact that the flux path through air is often not trivial especially in a saturated motor. At the beginning all of the magnetic reluctances of on pole are calculated analytically based on the magnetic voltage and flux formulation. After that, the mathematical descriptions of these reluctances are optimized using a FEM based parameter sensibility analysis. In this method, all the motor parameters are changed step by step in FEM and their effect on the flux density is studied. Finally, the analytical formulation of reluctances are mathematically described and modified. Figure 2 shows the reluctance network of a complete pole pair [9]. The main path reluctances, pole stray flux and slot stray flux reluctances are modeled and modified. Moreover, the effect of the stator three phase windings is described using the same strategy. There are altogether four reluctance networks. One for the rotor as it is indicated in Figure 2 and further three networks for the stator three phase winding. These three networks are almost the same as the Rotor circuit. Hence, it is possible to calculate the rotor and stator flux densities in each part of the motor. For example the formulation of the 𝑅ଵ indicated in the Figure 2 is given by: 𝑅ଵ=ଶቀ௛భିమ್బ యቁ ఓబఓ౨౟௟ౣ(௕౪ି௕౰)௖௢௦ቂ௔௥௖௧௔௡ቀ್౪ష್౰ మ೓మቁቃ (1) And 𝑅ଶ is described as follows: 𝑅ଶ=గ௥యቈଷቀ್బ రା௟ౝቁିටቀయ್బ రା௟ౝቁቀଷ௟ౝା್బ రቁ቉ ఓబ௕బ௟ౣ൫ଶ௥మାଶ௟ౌ౉ା௟ౝ൯ (2) Figure 2. The reluctance network for a pole pair of the PMSM indicated in Figure 1. The main and stray flux reluctances are indicated in blue and red respectively. Where 𝑙୔୑, 𝑙୥, 𝑙୫, 𝑟ଶ, 𝑟ଷ are the lenght of PM, air gap, active length of the motor and rotor radius as indicated in Figure 1(b). ℎଵ, 𝑏୲, 𝑏୸, 𝑏଴, 𝜇଴, 𝜇୰୧ are the height and width of the tooth, slot width and permeabilities of the air and iron respectively. All the reluctances are modeled in PLECS. The saturation effect is also considered using an iterative algorithm shown in Figure 3. The first value of the permeability of each reluctance is guessed and the new permeabilities are calculated using magnetizing. This calculation is repeated so long till the minimum difference of permeability of two steps is reached [10]. The reluctance network and the permeability calculator are modeled in MATLAB. In the first step all motor parameters are fed into the model. At the second step the flux densities in all part of the motor are calculated using the reluctance network. The iron permeabilities are optimized iteratively and the final value of the flux densities are estimated. Figure 3. The principal of saturation modeling in reluctance network B. Calculation of the air gap flux density distribution Based on the flux calculation method explained in the previous section, one can anticipate the other motor parameters such as torque, induced voltage, cogging torque etc. These motor parameters can be calculated using the air gap flux density distribution. In order to calculate the torque ripples and the harmonics of induced voltage the effect of stator teeth should be considered. The air gap flux density distribution is indicated in the Figure 4. The distribution of flux density in the slot is modeled using Gaussian function and the general form of the flux density in the air gap is developed using Fourier i ii iAB iB i ii Geometry data of PMSM Trial-Error-MethodeAnalytical model of PMSM in Matlab transformation. The values of 𝐵0, 𝐵min, and 𝐵T are calculated from the analytical model described in the previous section. It can be shown that the flux density in the air gap has the following form: 𝐵୥(𝑥) =𝑓ୱ୪୭୲(𝑥) ∑ଵ ௡గஶ ௡ୀଵ(−cos(௡గ ௅౦(௞౦ ଶ+𝜏୮))+cos(௡గ ௅౦௞౦ ଶ)+ cos(௡గ ௅౦(ଷ௞౦ ଶ+2𝜏୮))−cos(௡గ ௅౦(ଷ௞౦ ଶ+𝜏୮)))sin(௡గ ௅౦𝑥) (3) Where 𝜏୮ is the pole pitch and 𝐿୮ and 𝑘୮ are given by: 𝐿୮=గ௥య ௣ ,𝑘୮=𝐿୮−𝜏୮ (4) 𝑟ଷ is the interior radius of the motor and is indicated in Figure 1(b). The result is obtained by multiplying the slot function 𝑓ୱ୪୭୲(𝑥) into the Fourier transform representation of one pole flux density. 𝑓ୱ୪୭୲(𝑥) can be defined as the Fourier transform of the Gaussian function representing the bell form of the flux density under slot: 𝑓௦௟௢௧(𝑥)=𝑟ଷ(𝐵଴−𝐵୘) 𝑏଴+𝑏୲+𝑟ଷ√2𝜋 𝑏଴+𝑏୲(𝐵୫୧୬−𝐵୘) ∑𝑒ିర√మഏ೙మഏమ (್బశ್౪)మಳౣ౟౤షಳ౐ ಳబషಳ౐ ஶ ௡ୀଵ 𝑐𝑜𝑠ଶ௡గ ௕బା௕౪ቀ𝑥−௕౪ ଶቁ (5) Where 𝑏0and 𝑏t are the width of the slot and tooth respectively which are indicated in Figure 1. The analytical calculation are compared to the FEM results and verified for different PMSMs with different geometries [9], [10]. Based on the air gap flux density distribution the induced voltage and torque can be estimated. Since these motor properties are fully described analytically based on the motor parameters, they can be optimized to achieve a desired motor functionality. Figure 4. Air gap flux density distribution of one pole of the PMSM indicated in figure 1 C. Electromotive force and torque The shape of the EMF depends not only on the magnets but also on the distribution and position of the windings. The induced voltage is a result of the rotation and is actually the time derivation of the flux which flows through the winding. Therefore, the induced voltage can be calculated as the result of a convolution between flux density in the air gap B(θ) and the equation which describes the winding C(θ) which is usually simplified with the winding factor [11]. So it is possible to calculate the induced voltage of each coil separately. 𝑈ind=𝑛dథ(ఏ) d௧=𝑛dథ(ఏ) ௗఏdఏ d௧=𝑛𝜔𝑙m𝑅gd dఏ(𝐵(𝜃)∙𝐶(𝜃)) (6) Where 𝑛 is the number of turns of the winding, and 𝑙m and 𝑅g are the length and radius of the motor respectively. 𝜔 is the motor speed. Once the induced voltage is calculated the torque can be described as follows: 𝜔𝑇=𝑈u𝐼u+𝑈v𝐼v+𝑈w𝐼w (7) Where Uuvw and Iuvw are the induced voltages and currents in three phases. The cogging torque can also be calculated analytically based on the motor parameters [8]. To verify the analytical model a prototype is constructed which is indicated in Figure 5. The stator consists of 168 laminated silicium iron sheet with the cross section indicated in Figure 1(a) with thickness of 0.5 millimeter. The stator has 24 slots which hold the stator 3 phase windings. The magnets are NdFeB type N35 with maximum working temperature of 80 Celsius. There are four poles at rotor with 60 degree pole pitch. Each pole realized using 9 pieces of cubic magnets with parallel magnetization to reduce construction price. The magnets are stuck to the rotor using two components metal glue. The rotor is also indicated in Figure 5. To compare the results of the analytical model with measurements, a set of different tests are accomplished using the experimental test bench which is shown in Figure 6. The control and data acquisition are done using a dSPACE 1104 system [10]. Figure 5. The PMSM Prototype for the validation of the analytical model Figure 6. The electromechanical test bench III. MULTILEVEL ANT ALGORITHM A. Ant Colony optimization Once an effective analytical model is developed and verified it is possible to apply an optimization process to design a PMSM which can satisfies a set of predefined characteristics. There are usually several parameters that should be optimized simultaneously like for example efficiency, minimum weight of motor, cost and minimum torque pulsation etc. Hence, using a multipurpose optimization algorithm is necessary. As it is presented before, there are too many parameters in an electrical motor which influence a certain property of the motor. Some of these parameters are selected in the phase of concept designing. For example the length of the air gap should be selected based on the mechanical stability. The rest of the parameters can be optimized. Goal of optimization is finding the best set of these free selectable parameters. As the number of parameters increase, the complexity and time consumption increase, too. Therefore, applying an effective optimization algorithm which is able to find a suitable set of parameters in very short time, makes it possible to tune more parameters and, by this, to meet more requirements on the motor to be designed. Hence, the ant colony algorithm (ACO) which is a type of swarm intelligent algorithm is used for multilevel optimization [12], [13]. In these systems the search mechanism is usually simple without any need of central control structure. The global optimization will be done by the local, indirect exchange of certain communication medium. The ACO was developed by the observation of behavior of an ant colony in nature. The search algorithm uses Stigmergy which is an indirect type of communication based on the modification of a communication medium in the local environment. However, it is a local type of information which is used just by the elements (ants) that belong to the environment [12]. Each ant which leaves the nest to find the food source lays the communication medium ‘’Pheromone’’ in the path. The pheromone evaporates as a function of time, means that frequently used paths which are naturally the shortest ways also, are occupying more pheromone because they are updated more often. The probability of a way to be taken by an ant depends on the amount of pheromone on that way: 𝑃௜௝௞(𝑡)=ቐൣఛ೔ೕ(௧)൧ഀൣఎ೔ೕ൧ഁ ∑(ൣఛ೔ೕ൧ഀൣఎ೔ೕ൧ഁ)೗∈ೕ೔ೖ 𝑗∈𝐽௜௞ 0 o.w (8) Where 𝜂௜௝ is the heuristic desirability and 𝜏௜௝ is the amount of pheromone which exists on the route between two nodes 𝑖 and 𝑗. 𝛼 and 𝛽 are the amplification factors. The actualization of probabilities in the route 𝑖𝑗 will be done as follows: 𝜏௜௝=(1−𝜌)𝜏௜௝+∑Δτ୧୨୩௠ ௞ୀଵ (9) The update of 𝜏 depends on the quality of the selected way: Δ𝜏௜௝௞(𝑡)=ቊொ ௅ೖ(௧) if ant 𝑘 takes route 𝑖𝑗 0 o.w (10) 𝑄 is constant and 𝐿௞(𝑡) is the length of route 𝑖𝑗. However, to insure finding the global optimum, there are mechanisms such as Max-Min Ant systems which update the global shortest route with a new portion of pheromone [14]. This means that the actualization of pheromone depends on the last amount: 𝜏௜௝=ൣ(1−𝜌)𝜏௜௝+Δ𝜏௜௝best൧𝜏max 𝜏min (11) Where 𝜏max and 𝜏min are the global maximum and minimum values of pheromone. For the optimization of design of PMSM the Multilevel Ant Stigmergy Algorithm (MASA) is applied. B. Multilevel Ant Stigmergy Algorithm MASA is based on the ACO and developed to be applicable on multi-parameters industrial optimization [15]. The parameters and properties of PMSM can be continuous such as radius of rotor or discrete such as number of windings. In MASA, at first, a search graph should be developed to be searched by the artificial ants and hence the parameters should be quantized which is shown in Figure 7. The Ant stigmergy algorithm can be summarized as follows. And the local optimization algorithm is described as follows. ANT-Stigmergy Algorithm SearchGraph= initialization (Parameters) SearchGraph initialization (initialization of pheromone) while the end of condition is not fulfilled for all ants do: Path=FindPath (SearchGraph) Evalution(Path) endfor updatePheromon (ALL Ants route Matrix) DaemonAktion (the best Route) Evaporation of Pheromons (all Matrixs) endWhile Local Optimization X*=[x1,…xi,…xD] Changing=True While changing do Changing=false For i=1 to D do If Evaluation (x 1,…,xi+ xistep ,…xD) < Evaluation (X*) do Changing=True While Evaluation (x 1,…,xi+ xistep ,…xD) < Evaluation (X*) do X*={ x1,…,xi+ xistep ,…xD} x i=xi+xistep endwhile else if Evaluation (x 1,…,xi- xistep ,…xD}<Evaluation (X*) do Changing=True While Evaluation (x 1,…,xi+ xistep ,…xD) < Evaluation (X*) do X*={ x1,…,xi- xistep ,…xD} x i=xi-xistep endwhile endif endfor endwhile Each parameter x includes a series of acceptable and selectable values which should not be necessarily congruent. Each element of parameter x is connected to all other elements of next parameter. To be optimized properties are described as optimization functions which include some or all of the parameters in search graph. The result of optimization is the set of parameters or the route which is illustrated with red color in Figure 7. The MASA is divided into two steps; ASA (Ant Stigmergy Algorithm) and LO (local optimization). Figure 7. Multi level Ant Stigmergy algorithm; Search graph, Coarsen The core of the optimization is like ACO; first of all, the search graph is constructed and then the pheromones are initialized. After that, the search process would be done in a loop based on the evaporation of pheromone and the quality of the best found route. At the end, the LO would be applied to find the best set of parameters. This modification process results in a better solution but increases the search time. Additionally, there are another two steps which are applied to multilevel multi parameters optimization; Coarsen which is applied between the construction of search graph and initialization of pheromone and Refine which is applied after the actualization of pheromone by the transition from level 𝑙 to 𝑙−1. In coarsen, defined elements of parameter 𝑥௜ of level 𝑙 are combined to the element 𝑥௟௞ at the level 𝑙+1. The optimization starts after coarsen. Therefore, it is possible to find the zone that includes the best solution in fewer iteration steps. To find the exact solution in the refine phase the element 𝑥௟௞ at level 𝑙+1 are replaced with the elements at level 𝑙 and each element receives the pheromone amount equivalent to the original node 𝑥௟௞. C. Implementation The implementation of MASA is realized in MATLAB and makes it possible to combine the optimization with the proposed analytical model. The reluctance network is calculated in PLECS/MATLAB, the flux values are delivered to SIMULINK for iteration algorithm of permeability calculation and the computed flux densities can be used to calculate the motor properties to be optimized. In the first step the search graph should be constructed using D different parameters 𝑋∗={𝑥ଵ,…,𝑥௜,…𝑥஽} to be optimized. Each parameter should be quantized 𝑥ௗ=൛𝑥〈ௗ,ଵ〉,𝑥〈ௗ,ଶ〉,…𝑥〈ௗ,௡೏〉ൟ so that the total number of parameters of 𝑥d is: 𝑛d=ቂ୫ୟ୶(ଡ଼ౚ)ି୫୧୬ (ଡ଼ౚ) கౚቃ+1 (12) Where εୢ is the incremental step of parameter 𝑥d. The amount of pheromone is calculated using the current value 𝜏 and solution quality dependent value Δ𝜏. These parameters are initialized at the beginning and updated in each iteration using ACO update algorithm. The probability function which is used by an ant that goes from parameter 𝑥d to parameter 𝑥d+1 is just the same as ACO as mentioned in the previous section. In order to prevent a stagnation of the problem or only local optimization a boundary limit ( 𝑃max) is applied. So if the probability of a node increases this maximum value, it would be replaced with 𝑃max and then is compared with other parameters. The process is continued until all ants reach the end point. As it is mentioned before, the two extra steps coarsen and refine are used for problems with parameters that include a wide range of elements. Let 𝑥ௗ௟ be the parameter of row d from overall D parameters at level 𝑙 (𝑙= 0 is the original graph) and let 𝑛ௗଵ be the number of matrices in 𝑥d at the first level and 𝑠ௗ௟ is the number of matrices which are combined together at level 𝑙 then: 𝑋ௗ௟=ቄ𝑥〈ௗ,ଵ〉௟,…𝑥〈ௗ,௦೏೗〉௟ ,𝑥〈ௗ,௦೏೗ାଵ〉௟,…𝑥〈ௗ,ଶ௦೏೗〉௟ ,𝑥〈ௗ,(௡೏೗శభିଵ).௦೏೗ାଵ〉௟,…𝑥〈ௗ,௡೏೗〉௟ቅ 𝑋ௗ௟ାଵ=ቄ𝑥〈ௗ,ଵ〉௟ାଵ,𝑥〈ௗ,ଶ〉௟ାଵ,…,𝑥〈ௗ,(௡೏೗శభ〉௟ାଵቅ (13) After the optimization process with new elements of which each of them is a matrix, in refine level from each matrix, the original elements are recreated and receive the pheromone value of the corresponding matrix. The MASA algorithm is also implemented in MATLAB as it is illustrated in Figure 8. Now it is possible to perform an optimized design of PMSM. Coarsen Searching SolutionLevel 0 Level 1 Level 2 1X 2X dX DX 1,0 dX 3,0 dX 1,1 dX 1,2 dX Multilevel Ant Stigmergy Algorithm 1. Construction of Search-Graphs with all parameters 2. Coarsen in 𝑙 levels 3. Intilalization of matrix by the initialization of pheromones 4. For all levels from 𝑙 to 1 do 4.1. While on the current level the stop condition is not fulfilled a) Find the shortest route for all ants b) Update the amount of pheromone on the visited nodes c) Place more pheromone at the current best route d) Reduction of pheromones as a result of evaporation 4.2. Refine to one level 5. Local optimization Figure 8. Graphical illustration of the complete optimization process The variable motor parameters are discretized in adjustable steps. The constants should be defined before the execution of the algorithm. The different combinations of parameters are selected by MASA and forwarded to the AM. The MEC is constructed using updated motor parameters. Now, the motor characteristic can be calculated depending on the optimization goals. To verify the effectiveness of the algorithm and optimization process for a PMSM, the whole approach was utilized to optimize the following 7 motor parameters: the residual flux density of PM ( Br), length of PM ( lm), length of air gap (lg), rotor radius ( rd), width of tooth ( bz), number of windings ( n) and length of motor ( lm). The saturation of flux density in a tooth and the volume of the motor are defined as limiting functions which should be in a predefined range and torque is the property to be optimized. The optimization is done using a 32 bit Microsoft Windows XP with 2 GB RAM and Intel processor Core ™ 2 Duo 2.53 GHz. Comparison between MASA and a normal searching algorithm which tries all possible values of parameters is shown in table 1. The quality of proposed motor is verified using FEM. Simplified, a set of parameters is selected by an optimization algorithm, the MEC will be constructed and new values of reluctances are estimated. Table 1. Comparison between normal optimization and MASA IV. CONCLUSION An effective analytical model is developed and verified with a prototype. To optimize the design process of motor in a very short period of time and also without any need of FEM an intelligent optimization algorithm is fully implemented and described. The result of optimization shows the efficiency of the entire approach. The analytical model and the optimization program are both implemented using MATLAB which makes it easier to use. To validate if the suggested motor truly meets the requirements and boundaries, results are verified using FEM which is also controlled via MATLAB and will be initiated automatically after optimization. The entire package is a very powerful tool for optimized design of a permanent magnet synchronous motor.