# Make Field-oriented Motor Control Affordable

Shaft sensors and their wiring make field-oriented motor control pricey, but sensorless alternatives are available.

Field-oriented control has permanently changed the way engineers think about motor control. But in order to work, it needs to know the angle of the rotor flux axis. If you are willing to pay the high cost of a motor shaft sensor, painstakingly mount that sensor on said motor shaft, connect the long cable between the sensor and the control electronics, and deal with the noise susceptibility and intermittent connections of said cable, then there’s no problem. But, if like most people you prefer a more economical and robust solution, then we need to find another way to get flux angle information.

Most techniques to eliminate the shaft sensor depend on measuring *other* signals within the motor that are related to the flux signal. In some cases, these signals just naturally occur in a spinning motor and all we have to do is *listen* for them. Such algorithms fall into the category of *passive* techniques. Other signals only become visible if we *actively* stimulate the motor with higher-frequency signals.

Regardless of which technique you use, the signals of interest are often buried deep inside the motor and cannot be directly measured at the motor terminals. In such cases, we must employ a special algorithm called an *observer* to extract the desired signal(s) from other signals that we *can* observe outside the motor. There are far too many sensorless techniques to cover in one article, but we can investigate one of the most popular algorithms to provide an example of how sensorless control works. This technique is based on recreating the back-EMF signals inside the motor.

Consider the three-phase permanent magnet motor shown in Figure 1. If we perform a forward Clarke transform on the three windings and write the voltage equations for the resulting alpha and beta windings, we get the equations in Figure 1. This is simply the result of summing up the voltage drops across the windings’ parametric elements and equating them to the applied voltage at the motor’s terminals.

From the expression in Figure 1, can you find the angle information? Sure enough, it’s hiding in the *back-EMF* signals. It would be great if we could somehow stick two voltage probes down inside the motor to measure these signals. Unfortunately, the back-EMF signals do not exist in a specific location within the motor. These signals are distributed throughout the stator coils and only appear on the motor terminals when the motor current is zero and isn’t changing.

Using the differential voltage equations in Figure 1, we can create block diagrams for calculating *i _{alpha}* and

*i*, as shown in Figure 2. The required inputs are the applied motor voltage, the back-EMF voltage, the stator resistance (R

_{beta}_{s}) and the stator inductance (L

_{s}).

Unfortunately, we don’t have the back-EMF voltages. But we *can* measure the motor phase currents! Let’s try to leverage this information to extract the missing back-EMF signals.
Initially we will just assume the back-EMF voltages in Figure 2 are zero. As a result, the estimates of *i _{alpha}* and

*i*will likely be wrong. To determine the quality of these estimates, we compare them to the

_{beta}*actual*measurements of

*i*and

_{alpha}*i*, and generate error signals, as shown in Figure 3.

_{beta}

Now what we do with these error signals borders on magic! If there was a “Motor Control Wizard’s Book of Spells,” this neat little trick would certainly be in it. In Figure 4, we supply the error signals to PI controllers and wrap the controller outputs around to the Back-EMF inputs.

This may not be intuitive at first, but consider this. If we take any closed-loop system utilizing negative feedback, we can drive the error signal to nearly zero if we have high enough loop gain. In this case, an error of zero means the phase current estimate is equal to the measured value of phase current. But this can only be true if the signal at the back-EMF input actually equals the missing back-EMF voltage (assuming Ls and Rs estimates are accurate). In other words, the PI controller's high gain servos the error signal to zero by forcing the controller's output to become the back-EMF signal.

Figure 5 shows a Spice simulation of a single-phase back-EMF observer running at 10 kHz. The back-EMF signal inside of the motor block is unknown to the observer. But once the simulation starts, the observer output quickly converges on the back-EMF signal as shown in Figure 6. Even when you change the back-EMF waveform to different wave shapes, the observer morphs its output to match it!

From Figure 4, we can create the back-EMF waveforms for the alpha and beta coils, but just having the back-EMF signals doesn’t mean we are done. The angle information is still embedded in these sinusoidal waveforms, and we have to figure out how to extract it. One way is to use the *arc tan* function:

Besides requiring floating point capability to calculate this value, you will also need to trap for the singularity when EMF_{alpha}(t) = 0. But consider another technique (borrowed from the world of resolvers) shown in Figure 7. Not only does it solve the problems associated with the *arc tan* function, it offers another very nice perk: a filtered speed signal! A free Spice simulation of an entire three-phase back-EMF sensorless algorithm based on Figure 7 can be downloaded here.

Now that we have solved for the angle, I need to tell you that we solved for the wrong angle. What we wanted was the angle of the rotor flux vector. What we get is the angle of the back-EMF vector.

Before you close your browser in disgust, you should also know that the back-EMF vector *always* lies on the quadrature axis, so we are *very* close! All that remains is to determine the *polarity* of the back-EMF vector on the q-axis in order to know exactly where the rotor flux vector is. This is where the frequency signal from Figure 7 can help. If the frequency is positive, we subtract 90 degrees from the back-EMF angle. If it is negative, we add 90 degrees instead. Now that we have the angle of the rotor flux, we can proceed with the four steps of FOC presented in my previous series.

Wow! All these calculations, just to find the angle of the rotor flux vector! But considering the low cost of embedded MIPS compared to the high cost of a motor shaft sensor, it is still *way* worth the effort in most cases.

In my next article, I will conclude this series by introducing a new sensorless FOC algorithm, which is available in ROM on select TI C2000 microcontroller products. If you are new to sensorless motor control, or are just tired of writing your own sensorless algorithm every time, then you will definitely want to stay tuned for my next article!

**Related posts:**