## Tuesday, August 8, 2017

### Fun with Interior Permanent Magnet Motors

We are all taught as wee seedlings that motors, brushed or brushless, are governed by the following equations: $$\begin{array}{lcl} \tau=K_t I\\ \omega=K_v V\\ K_t = 1/K_v \end{array}$$ To a very rough approximation, these equations are true, and for hobby motors they work quite well. RC vendors usually quote $$K_v$$ as the RPM per DC link voltage under trapezoidal commutation.

The above equations model the motor as a speed-dependent voltage source. However, a motor has both inductance and resistance as well. Taking a moment to blatantly ignore the definitions of 'inductance' and 'resistance' (there are several, depending on your conventions), a more accurate voltage equation might be: $$V = \omega/K_v+IR+n_p \omega L$$ Note the intentional lack of subscripts on $$R$$ and $$L$$; this equation is meant to be heuristic and should not be used to actually compute back EMF.

Saliency and Reluctance Torque

The brushless motors we typically see on the mass market are "surface PM" machines. In this configuration, the permanent magnets (PM's) are glued to the surface of a steel rotor. Torque is generated by rotating the magnetic field in the stator electronically, which in effect continuously "pulls" the PM's on the rotor towards the coils on the stator.

Surface PM motors have relatively low inductance. This may seem somewhat counterintuitive, but remember, the relative permeability of a PM is about 1, so the air gap in the stator magnetic circuit is very large (the thickness of the PM). Furthermore, because the rotor geometry is rotationally symmetric, even within a pole pair, the stator inductance of a surface PM motor is constant within an electrical cycle.

Current mass-produced electric cars not made by Tesla all use "interior PM" motors (IPM's). In an IPM, the magnets are inset inside the steel rotor. This seems rather counterproductive at first - moving the PM's further into the rotor would slightly decrease the PM flux seen by the stator. However, because the depth of the back iron changes within an electrical cycle as the rotor turns, IPM's have a property called saliency; the minimum inductance ($$L_d$$) and maximum inductance ($$L_q$$) are different from each other, sometimes significantly. One typically assumes that inductance varies sinusoidally with electrical position between these two extremes (there's no reason why this should be true, but everything is sinusoidal if you look at it from far away enough!).

Saliency is useful because it generates torque. To put it one way, the rotor field tries to attract the largest mass of steel. Looking at it another way, the varying inductance results in a position-varying amount of stored energy, and the system will try to settle into a state of lowest energy (torque is the angular-position derivative of the co-energy).

The motor equations

Taking into account inductance, resistance, and saliency, the complete equations describing a sinusoidally-varying motor with sinusoidal commutation are: $$\begin{array}{lcl} \tau=\frac{3}{2}n_p(\lambda I_q+(L_d-L_q)I_d I_q)\\ V_d=R_s I_d-\omega L_q I_q\\ V_q=R_s I_q+\omega L_d I_d+\omega\lambda\\ V_s=\sqrt{V_d^2+V_q^2} \end{array}$$ Some extremely important notation: $$R_s, L_d$$ and $$L_q$$ are the resistance and inductance of one phase, $$V_s$$ is the peak AC stator voltage across one phase (which for standard SVM is equal to half the DC link voltage), $$\lambda$$ is the PM flux linkage, and $$n_p$$ is the number of pole pairs. $$I_d$$ and $$I_q$$ are the usual FOC axis currents.

These equations tell us many things:

1. The importance of $$I_d$$

On an IPM, torque is generated by both $$I_d$$ and $$I_q$$. On some IPM's, the reluctance component ($$(L_d-L_q)I_d I_q$$) is significant; e.g. for the Hyundai HSG we have $$\lambda=0.053$$, $$L_d=0.6 mH$$, and $$L_q=1.47 mH$$. For high currents, reluctance torque is a huge fraction of the resulting torque...

...as evidenced by this stall test plot, where phase is practically equal to $$3\pi/4$$ (the point of highest reluctance torque for a given stator current) at very high currents. This is because reluctance torque grows as the square of current, but PM torque grows only linearly. Yes, the inductances do saturate, but the flux linkage also decreases as current increases, and in the end, the order of magnitude faster growth in torque favors reluctance torque at high currents.

2. Field weakening exists...

...and the equations tell us precisely what to do. We have to be careful as to what we call "field weakening" here. For a surface PM machine it's easy - as $$I_d$$ generates no additional torque, any current applied to the d-axis exists solely to cancel out the PM flux: $$V_q=R_s I_q+\omega L_d I_d+\omega\lambda$$ so applying a negative $$I_d$$ reduces $$V_q$$.

For an IPM the situation is trickier; under normal operation, even at zero speed, there is some current on the d-axis already. At stall, the optimum operating point for a given stator current $$I_s$$ is given by the $$(I_d,I_q)$$ that maximizes $$\lambda I_q+(L_d-L_q)I_d I_q$$ subject to $$I_d^2+I_q^2=I_s^2$$. However, the maximum-torque-per-amp operating point becomes unattainable at high speeds because of the high stator inductances, which serve to limit the achievable currents at high electrical frequencies. Field weakening on an IPM starts at the speeds for which we can no longer operate at the MTPA setpoint.

In fact, for commonly available IPM's, field weakening is extremely important for running at reasonable bus voltages. A 300V motor rated for 10,000RPM can only achieve that with significant d-axis current; the "base speed" (above which there are insufficient volts to run at the MTPA operating point) could be as low as 3000RPM.

3. IPM's have a broader speed range than SPM's

This is oft-quoted in papers and design articles, and the equations make it easy to see why. There are two ways to think about it:
1. Field weakening current (on the d-axis) generates useful torque on an IPM, but only generates heat on a SPM. Furthermore, SPM's are double screwed by the fact that they have a high flux linkage and low inductance, which results in huge $$I_d's$$ needed to cancel the PM flux.
2. On an IPM, torque grows as the square of current, but back EMF only grows linearly. This means that for a given required torque, the controller runs out of volts more slowly. Alas, saturation comes into play at high currents, so the speed range of most IPM's is not infinite.
In fact, for most of their operating range, IPM's are constant power, not constant torque, devices:

 Power curve of a simplified HSG model, disregarding saturation
Note how the 8,000RPM HSG (at the simulated bus voltage of 160V) is able to reach peak power at 2000RPM, and levels off to high-speed powers not much below the peak achieved value. For traction applications, this has the obvious (and huge!) benefit of removing the need for a gearbox.

4. SPM's have better performance at a single operating point

For a given stator current, an SPM produces constant torque and linearly increasing power up to base speed. Achievable torque falls off rapidly after base speed. However, for static loads, SPM's have the highest torque per unit volume, since they have the highest flux linkage and the smallest airgap. For such loads (turbines, propellers, fans), a surface magnet machine is the correct choice. The quest to maximize the flux linkage per unit volume (which, in turn, minimizes the stator resistance required to achieve a certain $$K_v$$) leads to designs like the Emrax and Yasa, both of which are double sided, axial-flux outrunners with split stators for the largest possible airgap per kg/liter of motor. This is crucial for airborne applications, where the weight penalty inflicted by a speed-reduction system is unacceptable.

The Curse of Saturation

Saturation is a terrible thing. It reduces your field-weakening capabilities and limits your reluctance torque, and is what fundamentally limits the instantaneous torque capabilities of any motor. In addition to reducing $$L_d-L_q$$, saturation also reduces flux linkage, so even surface PM motors are not immune to it.

Saturation is what makes IPM's notoriously hard to model. On a surface PM machine, saturation doesn't affect the optimum operating point - up to base speed, saturation only reduces torque-per-amp, but doesn't change that fact that all the stator current should be on the q-axis. In the field weakening regime, saturation affects how much d-axis current is needed to generate a given torque at a given speed, but this inductance is not position dependent and is easily measured with a stall test.

In contrast, on an IPM, where much of the torque is reluctance torque and most of the operating range involves some amount of field weakening, correctly characterizing saturation is extremely important. To further salt the wound, the entire concept of $$L_d$$ and $$L_q$$ becomes somewhat tenuous as the motor saturates, as even a motor carefully designed to have sinusoidal inductance variation ceases to be sinusoidal when saturated.

The best way to tune a saturated IPM is probably to put it on a dyno (or simulate it, if it is your design). That being said, there will be a few posts here in the future on trying to model saturation.