Unified Field Oriented Controlled Drive System for All Types of PMSMs Considering System Nonlinearities

Permanent Magnet Synchronous Machines (PMSM) have increasing popularity in recent years due to their extensive use in domestic appliances, electric/hybrid vehicles, wind power generation and more electric aircraft technologies. This paper proposes a unified drive system simulation for all types of PMSMs. Its unified structure achieves self controller tuning and decoupling compensation once a machine is replaced by another. Field oriented control based realistic drive is implemented with a much-simplified simulation. The proposed structure incorporates with parameter variations, inverter nonlinearities, and DC-link voltage variations as well as it simulates ideal system behavior. Each system nonlinearity can be simply studied for any machine by deliberately altering the corresponding parameter owing to its unified structure. Hence, the effect of that particular variation on harmonic distortions, torque ripples, torque production capability, battery utilization ratio, system efficiency, system response and so on can be analyzed in detail. Thus, the novel implementation strategy will not only be quite useful to analyze the system behavior under different evaluation metrics, but it will accelerate the research and developments on the promising topic. The effectiveness of the strategy has been verified by extensive simulations.


I. INTRODUCTION
The use of renewable and sustainable energy technologies plays a vital role to deal with environmental problems such as acid rains, global warming, climate changes and so on. Electric machines, for this reason, have increasing popularity as they facilitate the use of green energy technologies. PMSM machines are promising types of AC machines with their distinguished advantages such as high torque density, high power density, high efficiency and so on. Hence, PMSM machines are extensively employed in plenty of applications [1] in last few decades including aircraft, electric and hybrid vehicles (EV/HEV), wind power generation, servo drives and household appliances [2].
Broadly speaking, a variety of PMSM machine topologies have been developed to date. Depending on the location of permanent magnets (PM) and windings, the PMSM machines can be classified under Rotor-PM and Stator-PM machine categories. While Surface-mounted PM Machine, Interior-mounted PM Machine, Consequent Pole PM Machine, PM Claw Pole Machine are among the Rotor-PM type machine topologies [3,4], the Stator-PM type machine topologies include Flux Reversal Machine, Flux Mnemonic PM Machine, Flux Switching PM Machine, Doubly Salient PM Machine and so on [5,6]. Additionally, PM Assisted Synchronous Reluctance Machines (PMA-SynRM) are gaining attention in late years [7,8]. PMs are inserted into flux barriers of SynRM machines to produce alignment torque to 'assist' reluctance torque. By doing so, poor power factor, low torque density and high torque ripple issues of SynRM machines are alleviated, while the merits of simple and robust rotor structure are maintained [9]. The unified structure of the proposed control strategy in this paper facilitates to assess drive performance of all these machines regardless of their rotor/stator types/shapes, their slotted or slot-less structures and their number of slots/poles.
As is well known, operating temperatures in practical applications have significant influence on PM flux linkage and stator resistance, while magnetic saturation has also significant influence on PM flux linkage and stator inductances [2]. Besides, cross-coupling, material property variations and manufacture tolerance renders AC machines highly nonlinear. There are also power electronics based system nonlinearities and these may significantly deteriorate current waveforms increasing torque ripples [10]. If the source is battery such as in EVs or HEVs, the supply voltage may also vary typically between ±15% depending on the charge status. In short, taking power electronics and machine nonlinearities, and DC-link voltage variations into account is necessary to achieve optimized control performance in practical applications. Addressing all these variations in a drive system is a great challenge in the literature to achieve optimized control. The authors in [11], for example, treated machine parameters as constant but it is evident in [12] that torque production capability of a drive may significantly reduce when constant parameters are employed in the controller. Likewise, the authors have not considered inductance variations in [13][14][15], though PM flux linkage variations have been taken into consideration. The case is vice-versa in [16][17][18]. Namely, inductance variations have been considered, but PM flux linkage variations have been disregarded. Besides, power electronics based system nonlinearities have not been considered in recent studies [19][20][21][22].
Indeed, the influence of magnetic saturations may relatively be higher in high torque, low speed applications [23] since the inductance nonlinearity is mainly dependent on load torque. Similarly, the influence of operating temperatures may relatively be higher in low salient machines [10] since the dominancy of PM flux linkage on torque production is higher. Plus, inverter voltage drop may seriously deteriorate drive performance when speed approaches to zero [24] and the influence of resistance variation on a drive system increase when speed decreases and load increases. In short, how much these variations have influence on the performance of a particular machine and prior knowledge of the influence may become crucial to achieve optimized control. The proposed drive in this paper facilitates to study these operating conditions as well as a large number of different scenarios simply without a need to implement new drive systems for each evaluation criteria. Plus, new control strategies such as in [12,25] can also be adapted to the proposed drive.
Based on control frame, modern AC drives can be classified as field-oriented control (FOC), or direct flux vector control (DFVC). While the former regulates the electromagnetic torque through dqaxes current errors, regulation is realized by the errors of stator flux magnitude and its angle in the latter. DFVC schemes are commonly known as direct torque control (DTC) in the literature [26]. It has been validated that direct regulation of torque is not theoretically accurate in PMSM drives [27] and this leads to coupled control. Besides, linear controller design based on a fixed operating point leads to variable control bandwidth when operating points change. These lead deterioration of control performance in DTC drives.
In FOC drives, the dq-axes currents are obtained from measured currents and rotor position, and hence, the current commands can be tracked accurately. However, the accuracy is dependent on flux observer in DFVC drives and observer accuracy may much degrade at low speeds in practical applications [24]. Thus, [28] reports that FOC drives exhibit better performance in constant torque region. Therefore, this paper proposes a FOC based unified control structure for all types of PMSM and PMA-SynRM machines considering whole drive system nonlinearities. The simulations are performed in MATLAB/Simulink.

II. IMPLEMENTATION OF PROPOSED DRIVE SYSTEM
Schematic of the most common 3 phase AC drive system is illustrated in Fig. 1. The system consists of a controller, DC voltage source, inverter and PMSM machine (or PMA-SynRM). These components are implemented as separate subsystems in the proposed approach. Current transducers and position sensor are needed for feedback control.

A. MACHINE MODELLING AND PROPOSED IMPLEMENTATION STRATEGY
Since stationary frame variables are time variant in AC drives, coordinates are transformed into rotor reference frame to achieve time invariant field oriented control (Fig. 2). The well-known peak convention modelling is as follows [2]: T e = 3p 2 (Ψ m I q + I d I q (L d − L q )) = T e_m + T e_r where I dq , V dq , Ψ dq , L dq are the rotor frame currents in A, voltages in V, flux linkages in Wb, and inductances in H, respectively. Ψ m is PM flux linkage in Wb, p is number of pole-pairs, R s is phase resistance in Ω, ω e is electrical speed in rad/s, T e is electromagnetic torque in Nm. As evident in (3), there are PM based T e_m and reluctance T e_r torque components. Machine modelling is implemented under electrical and mechanical subsystems due to electro-mechanical energy conversion fact. For electrical modelling, (1) and (2) yields: A practical AC drive consists of voltage source inverter and once the inverter switches are triggered, discrete abc voltages are applied to the machine in real life. Hence, electrical modelling with abc input voltages and output torque can be implemented utilizing (3), (4), (5) as shown in Fig. 3. As will be seen, the abc voltages are transformed into the dq frame. Then, time derivatives of dq-axes flux linkages are obtained utilizing (4). Since the dqaxes currents in (5) are functions of dq-axes flux linkages, time derivatives of dq-axes flux linkages are integrated before being fed into (5) as depicted in Fig. 3. It is noteworthy that initial condition of Ψ d is the PM flux linkage in theory, since Ψ m is aligned with d-axis (Fig. 2). However, initial Ψ q is zero as evident in (2). Once dq-axes currents are obtained, abc current waveforms and the output torque can also be obtained by employing dq to abc transformation and (3), respectively. It should be noted that none of numerical values associated with machine parameters is defined in Fig. 3 including pole-pair number. Rather, receiving signals from a global sending route is employed. By doing so, the proposed approach can be achieved, and implementation becomes much simpler. In other words, once a parameter is deliberately altered in a global sending route, no further action will be required to implement the drive system again since the global sending route passes its input to each of its corresponding receiving ends. For example, once the pole-pair number and machine parameter values are altered to represent a different machine, the unified drive will still achieve stable operation without taking further actions including PI tuning. Machine behavior in simulation environment can be studied with nominal machine parameters as in Fig. 4 (a). Although this is quite common, actual parameters in real-world deviate from nominal values during operation. Nonlinear parameters are generally modelled as a function of dq-axes currents as shown in Fig. 4 (b). Alternatively, high fidelity modelling in Fig. 4 (c) represent parameter variations with high accuracy [29]. Both modelling in Fig. 4 (b) and (c) can either be stored as look-up tables (LUT) or defined as a function of dq-axes currents. The proposed approach facilitates to employ each modelling strategy in Fig. 4 including LUT and polynomial based models. It is important to note that one sample period delay with an initial condition is necessary before dq-axes currents are being fed into LUTs or polynomial based parameter functions. Otherwise, initial algebraic state in algebraic loop may not be a number. This causes an error while running the simulation and the simulation is terminated.
Stator resistance can also be defined as a constant with nominal value similar to Fig. 4 (a), but it can also be defined as a function of temperature to represent the nonlinearity in the proposed approach. Its visibility is also defined as global and hence it can be accessed by the controller for self-tuning of PI gains.
For mechanical modelling, rotational acceleration is; where is mechanical angular acceleration in rad/s 2 , ω m is mechanical speed in rad/s, J is inertia in kg.m 2 , T m is mechanical   load torque in Nm and B is viscous friction coefficient. Integration of rotational acceleration in Fig. 5 yields angular speed and its integration yields position angle. The speed in revolution per minute (rpm) is obtained by multiplying speed in rad/s by (60/2π) and inverse is true for vice versa. Also, electrical speed is number of pole-pair times higher than mechanical speed. Electrical frequency is obtained dividing electrical speed in rad/s by 2π. This is important because inverter switching frequency should be typically higher than five times the maximum electrical frequency of a machine for wide range operation.
The machine speed in real life experiments can either be loaded by an active dynamometer or the speed varies based on (6). While the former is common for research test rigs in laboratory environment, the latter is also common in commercial applications such as in electric vehicle tractions. The proposed approach facilitates to simulate both scenarios. When the switch state in Fig.  5 is 1, the drive is simulated as if the speed is loaded by an active dynamometer, or it simulates the other scenario when the switch is toggled.

B. CONTROLLER DESIGN
In FOC strategy, generally the dq-axes current errors are driven to zero as shown in Fig. 6. The outputs of the PI controllers are the dq-axes phase voltages. In fact, coupling terms exist in a real PMSM machine as evident in (1), and these terms need to be decoupled in the controller. Hence, decoupling compensation is added at the output of the PI controllers. It is noteworthy that this has no influence at steady states in theory but improves the transient performance. Thus, it may be important when speed changes rapidly since the speed is gain of coupling terms in (1). As evident in (1) and (2), knowledge of machine parameters is required in the controller for decoupling compensation. Similarly, dq-axes inductances and stator resistance values are also needed for PI tuning. Gains of PI controllers in the proposed drive are tuned based on technical optimum method (7) [30].
where ω c defines the controller cut-off frequency. The cut-off frequency can be selected as two times of machine's maximum speed [31]. It is noteworthy that L d , L q , and R s are the estimated parameters since the actual parameters can only be estimated. Mostly, deviations occur between actual and estimated parameters in practice depending on the operating conditions. Proposed drive facilitates to represent parameter deviations and its resultant influence on a system can be analysed.
PI controllers may generate voltage magnitude command greater than the maximum available voltage leading to stability issues. Therefore, the command must not exceed the limit. The most frequently used strategy is circle limitation where the machine operates in linear region. Hence, circle limit is adopted in the proposed drive. In Fig. 6, cartesian to polar conversion, the limitation of the magnitude vector and polar to cartesian conversion, sequentially, are employed to adopt overmodulation strategy. ∅ in Fig. 6 is the load angle shown in Fig. 2.
Space vector modulation (SVPWM) is the most employed strategy in machine drives as it has superior features over all other strategies such as having higher DC-link voltage utilization rate, less switching harmonics, less inverter losses, less current distortions, smoother output torque and so on. Hence, SVPWM with its maximum voltage utilization rate of V DC /√3, is adopted in the proposed drive. Its implementation strategy is common in the literature and further details regarding the strategy can be found in [32]. It should be noted that the modulation strategy determines the maximum voltage utilization rate. It should also be noted that dq-axes voltage commands are transformed into stationary αβ frame before being fed into SVPWM block.

C. NONLINEAR INVERTER MODELLING AND ITS IMPLEMENTATION
The most frequently used inverter has three legs, one for each phase and phase voltages in a balanced load are constraint by: Terminal voltages can be represented by phase voltages: Substituting (9) into (8) one obtains the neutral to center voltage.
Substituting (10) into (9) yields phase voltages: Once the terminal voltages are obtained, the phase voltages can also be obtained by (11). However, there is undesired and indispensable voltage drop on an active semiconductor device. This results in distorted current waveforms and increased torque ripples. Hence, inverter voltage drop is considered in the proposed approach. Considering voltage drop on the active switch and the freewheeling diode, the output of each leg can be obtained [33]. Table 1 presents the output of leg A with respect to neutral point of the DC bus. As will be seen, the output varies with current direction and the switching state.
V drop@S and V drop@D in Table 1 are defined as the voltage drops on the active switch and the freewheeling diode, respectively. In general, voltage drops on devices increase with the increasing current in normal operation. Hence, the voltage drops can be modelled as a function of phase current.  where V S0 and V D0 are threshold voltages of active switch and freewheeling diode, respectively, and r S and r D are their on-state slope resistances, respectively. It should be noted that threshold voltages of six controlled switches can be assumed to be the same for simplicity since identical devices are employed in power electronics circuit. The same is true for six freewheeling diodes as well.
On the other hand, there is a dead-time which is a deliberately inserted blanking time. High and low switches are switched off for a very short time to prevent shoot-through phenomenon. Otherwise, simultaneous conduction of high and low switches in a practical implementation will cause short circuit from supply to ground. The switches may be burnt out due to inrush current and even controller could be damaged either. Hence, dead-time implementation with a short on-delay is also considered in the proposed drive.
Nonlinear inverter is implemented in the proposed drive as shown in Fig. 7. Threshold voltages and on-state slope resistances can be obtained from manufacturer's datasheet in a practical system. Switching sequences are generated by SVPWM strategy and on-delay time is applied to each switching command to represent dead-time. Then, terminal voltages are obtained utilizing measured DC-bus voltage and phase currents. Last, phase voltages are obtained by adopting (11).

III. GLOBAL DEFINITIONS IN THE PROPOSED DRIVE
Pole-pair number of a machine is a constant and not a nonlinear variable. The number is employed in many equations in the controller as well as in the machine model including both electrical and mechanical modelling. Since it is unique for a certain machine and its prior knowledge is already available for each machine, its numerical value is defined with global visibility in the proposed approach. Once defined, the value should be received from the global sending route. Otherwise, the unified simulation cannot be achieved, and when p is deliberately altered to study a different machine, each corresponding pole-pair number must be found and updated. Thus, global definitions in the proposed drive are highly important to simplify sophisticated control algorithms and to achieve unified structure. Similarly, the inverter switching frequency (fSW), dead-time duration (tdead), and controller cut-off frequency (ω c ) are set in advance and their values are also employed in a number of places in a drive system. Hence, they are also defined with global visibility in the proposed approach. For example, triangular carrier signal generation and time period to obtain switching sequences per carrier cycle can be obtained from a global sending route for the switching frequency.
On the other hand, the machine parameters in a real-world machine (L d , L q , Ψ m , R s ) are not constant and they are significantly nonlinear depending on operating points and conditions. Hence, the study on a resultant influence of parameter variations in a drive system is highly important since the use of PMSM and PMA-SynRM machines is drastically increasing such as the new trend electric vehicle traction applications in transportation sector. In practice, there are two of each machine parameters. While one is the actual value of a parameter in the machine, the other is the one what controller thinks. The former is defined as (L d , L q , Ψ m , R s ), and the latter is defined as (L d , L q , Ψ m , R s ) in the proposed strategy each with global visibility. Similarly, if the voltage source is a battery in a practical implementation, the DC-link voltage may vary between ∓%15 depending on the charge status. The DC-link voltage is either be measured or a certain value can be employed in the controller. To facilitate implementation of both scenarios, V DC and V DC are defined in the proposed drive thus influence of any variations in a practical drive system can be analyzed in the proposed drive.
In short, stator resistance, d-and q-axes inductances, magnetic flux linkage, DC-link voltage, and their estimated/nominal values as well as the number of pole-pairs, inverter switching frequency, dead-time duration and the controller cutoff frequency are all defined with global visibility. Once any of them is reasonably altered, the proposed drive will still achieve stable operation with self PI tuning as well as self-modified decoupling compensation.

IV. VALIDATIONS OF THE PROPOSED APPROACH
The machines in [34][35][36][38][39][40][41][42][43] are only few examples to that the proposed drive facilitates simulating their behaviors by only updating globally defined parameters. Although, a large number of drive systems with different machine and inverter specifications have been validated with the proposed drive system setup, only the results with three different machines given in Table 2 will be discussed in the paper. In Table 2, Machine 1 is SPM with no reluctance torque and Machine 2 and Machine 3 are IPM with salient poles. The specifications of the machines, DC-link voltage levels, inverter switching frequencies and dead-time durations are presented in Table 2. As discussed, proposed system facilitates representing machine nonlinearities. Hence, ideal machine model, LUT based nonlinear machine model and polynomial based highfidelity machine model as in Fig. 4 (a), Fig. 4 (b), and Fig. 4 (c), respectively, is employed in the proposed structure for Machine 1, Machine 2, and Machine 3, respectively.
As has been discussed in the inverter nonlinearity modelling, threshold voltages and on-state slope resistances of the semiconductor devices can be obtained from manufacturer's datasheets in practical applications. In this study, threshold voltages of active switch and freewheeling diode are 0.85V and 0.8V, respectively, while their on-state slope resistances are 5mΩ and 4.5mΩ, respectively. The data for the case study is typical and it has been obtained from [36]. Fig. 8 illustrates the validation of the proposed unified drive with extensive simulations. Three different machines representing both ideal and nonlinear models are operated at wide range and input power, output power, torque production capability and efficiency of each drive is studied. Dead-time and inverter switching frequencies and machine specifications are listed in Table 2. The drives are operated at certain stator current magnitude while varying the current angle (γ). The behaviour of Machine 1, Machine 2, and Machine 3 is illustrated in Fig. 8 (a), (b), and (c), respectively, while the machines operate at 50krpm, 1krpm, and 1krpm speeds, respectively. It is seen from Fig. 8 (a) that torque is maximum when current angle is zero (γ = 0°). This is as expected since SPM machines do not produce reluctance torque thus the current angle and id current command is zero in constant torque region. There is only PM based torque production in Fig. 8 (a) and one can deduce from (3) that PM based torque production is maximized when d-axis current is kept at zero. On the other hand, when IPM machines are employed in the drive systems as shown in Fig. 8 (b), and (c), the optimum current angle varies with stator current magnitude for torque maximization. It is noteworthy that the optimum current angle is independent from speed since the point where torque is maximized is independent from speed as evident in (3). It is seen from Fig. 8 (b), and (c) that the maximum efficiency operation points can be obtained utilizing proposed drive with nonlinear machine models. The results also validate that the torque production capability increases with stator current magnitude, but the system efficiency reduces. This is also as expected since the copper losses increase with the increasing current magnitude. Torque versus d-axis current operation trajectories of each machine is also studied and illustrated in Fig.  8. As evident in (3), torque production approaches zero when qaxis current approaches zero. Hence, when current angle (γ) approaches 90° in Fig. 8, q-axis current, torque production, input/output powers, and efficiency of each drive all approaches zero. All in all, extensive simulations in Fig. 8 employing different machines with different pole numbers, saliency ratios, DC link voltage levels, stator resistances, torque production capabilities and speed characteristics validate unified structure of the proposed strategy.  Table 2 A

. VALIDATION OF NONLINEAR INVERTER
It is seen from Fig. 6 that dq-axes voltage commands are generated in the controller, and they are transformed into stationary αβ frame. Indeed, dqaxes voltage commands can directly be applied to the machine model shown in Fig. 3 without incorporating inverter model. By doing so, the influence of the power electronics can be studied in simulation environment. However, it is noteworthy that the voltage commands cannot be directly applied to the machine in a real-life experiment and power conversion thus an inverter is a must. Fig. 9 illustrates the produced electromagnetic torque and one of the phase current waveforms of the drive when there is no inverter, there is an ideal inverter and there is a nonlinear inverter with dead-time (as in reallife), respectively. Machine speed is step increased from 500 to 2000 rpm at 0.25s in each drive when the switch state is 1 in Fig.  5 and the operating current angle γ is ~34°. The fundamental sampling frequencies of the simulations are ten times higher than the inverter switching frequencies (each 8kHz). Total harmonic distortions (THD) have been obtained from 5 periods of the current waveforms before and after 0.25s. It is evident from Fig. 9 that employing even an ideal inverter (without dead-time and voltage drop) significantly increases the torque ripple due to switching based distortions on current waveforms. It can be deduced from Fig. 9 that increased THD increases the torque ripple as well. THDs of the current waveforms at 500 and 2000 rpm speeds, when nonlinear inverter with dead-time is employed as in real-life experiment, are both ~%21 higher than the drive where ideal inverter is employed. The results validate current distortions in a drive system and the resultant influence on the undesired torque ripples can be simply studied for different machine/inverter models at different operating points with the proposed drive.

B. VALIDATION OF DECOUPLING COMPENSATION
As has been discussed, the coupling terms in (1) needs to be decoupled in the controller to improve transient performance of a drive system. Its influence on the drive system has been studied VOLUME XX, 2022 with the proposed drive and the results are illustrated in Fig. 10. The machine operates at 10 Nm electromagnetic torque and speed is increased from 500 to 2000 rpm at second 5. The dq-axes current errors which are driven to zero and the produced electromagnetic torque is illustrated without compensation and with compensation in Fig. 10-a and in -b, respectively. It is evident that the influence of the coupling terms in (1) may much deteriorate drive performance when speed changes rapidly unless decoupling compensation is incorporated. Hence, it is evident that the study of decoupling effect can be simply handled for different machines and different operating points utilizing proposed simulation. It should be reminded that modifications in the proposed drive is not needed for decoupling compensation once a machine model is altered as the self-modification is achieved.

C. VALIDATION OF MECHANICAL MODELLING BASED ON DIFFERENT SCENARIOS
The machine speed can be loaded by an active dynamometer in a test system, or the speed may vary based on mechanical equation in (6). The proposed approach facilitates to simulate different scenarios. In Fig. 11-a, the drive is operated as if the 1500 rpm speed is loaded and kept constant by an active dynamometer while the Fig. 11-b and Fig. 11-c illustrate mechanical acceleration and deceleration, respectively, where the load torque is 1 Nm and 2.5 Nm, respectively. 2 Nm electromagnetic torque command is applied to the drives at second 10 when the initial speed is 1500 rpm. Electromagnetic torque waveforms, speed profiles and the modulation ratios (m: DC-link voltage utilization ratio) are illustrated in Fig. 11. It is seen that the speed and hence the average modulation ratio increases with the increasing speed when the electromagnetic torque is higher than the load torque and viceversa.

D. THE STUDY WITH VARYING SAMPLING TIME
Increasing the switching frequency not only improves the transient performance of a drive system but reduces the undesired torque ripples at steady states as well. However, the switching frequency can be increased to some extent as there are some constraints such as the increased switching losses thus reduced efficiency and the capacity of microprocessors. Typically, the inverter switching frequency is higher than five times the maximum electrical frequency of an AC machine. The influence of the switching frequency in a drive system can be studied with the proposed drive and hence the optimization of the switching frequency considering the above trade-off can be studied. Since the inverter switching frequency is altered from the global sending route in the proposed approach, no further modification is necessary to achieve stable operation due to self-modifications. The simulations have been carried out with Machine 2 while the fundamental sampling frequency and the machine electrical frequency are 100 kHz and 100 Hz, respectively. Fig. 12-a illustrates the phase currents, electromagnetic torque waveform and stator flux vector in αβ frame when the inverter switching frequency is 3 kHz. Fig. 12-b and Fig. 12-c illustrate the same waveforms when the inverter switching frequencies are 8 and 15 kHz, respectively. Drives are operated to produce 15 Nm electromagnetic torque. Total harmonic distortions of the current waveforms have been obtained from a hundred periods between 0.1 and 1.1 seconds. THD ratios are 3.64, 1.66, and 1.49 percent for 3, 8, and 15 kHz inverter switching frequencies, respectively. As evident, THDs of the current waveforms and the torque ripples have attenuated with the increasing switching frequency. In addition, increasing the switching frequency smooths out the stator flux vector. Hence, the phase currents, torque waveform, and stator flux vector can be improved to some extent in return for increased switching losses.

E. THE STUDY WITH VARYING MACHINE PARAMETERS
Based on high-fidelity machine modelling in [29], the parameters L d , L q and Ψ m , may reduce ~20%, ~35% and ~20%, respectively, from no load to full load operation. Effect of varied parameters on the drive performance can be studied by performing proposed simulation. The drive with Machine 2 has been operated at 1000 rpm mechanical speed and 40A constant stator current magnitude while varying the current angle (γ). Nonlinear inverter with 125 μs sampling time and 2μs dead time has been employed in the drive. Permanent magnet and reluctance-based torque as well as total electromagnetic torque production, dq-axes current waveforms, stator current magnitude and output power profile of the drive are illustrated in Fig. 13-a. Then, while the machine parameters employed in the controller remains the same, the parameters in electrical machine modelling in Fig. 4 have been deliberately reduced to study drive behavior under varied parameter operation. L d , L q and Ψ m , have been reduced at the rates of %20, %35, %20, respectively, and the results are illustrated in Fig. 13-b. It is evident that the torque production capacity of the machine reduces approximately %31.4 when parameters reduce. Plus, while the maximum torque is obtained when the current angle γ is 40.66° in Fig. 13-a, the maximum torque is achieved when the current angle γ is 37.53° in Fig. 13-b. In addition, the output power of the drive reduces from 0.82 kW to 0.56 kW. It is noteworthy that drive behavior at varying parameter conditions can be further studied for other machines with the proposed drive. For example, the drive performance from no-load to full-load at different current magnitude and angle values can be extensively studied.

V. CONCLUSIONS
A unified field oriented controlled drive system simulation for all types of PMSMs including SPM/IPM and PMA-SynRMs has been proposed in this paper. A realistic approach with much simplified implementation strategy has been achieved. Inverter voltage drop, dead-time, machine parameter variations and DC-link voltage variations all have been considered in the proposed approach. It has been validated that the study associated with the influence of a particular system nonlinearity on total harmonic distortions, torque ripples, torque production capability, battery utilization ratio, machine efficiency, system response, and optimum current angle can be simply handled for any machine. Regulator retuning and modified decoupling compensation is not needed since the proposed drive is tailored to different machines and adapts any parameter variations. Besides, the novel implementation strategy achieves representing different mechanical speed scenarios as in real-life experiments. Therefore, the proposed strategy is quite insightful to analyze and understand behavior of any practical drive under different evaluation metrics, and hence, it will accelerate the research and advancements on the promising topic.