Vous êtes sur la page 1sur 14

Field-oriented control by the numbers

Dave Wilson, Senior Industrial Systems Engineer, Texas Instruments - April 08, 2015

{Editor's note: This article originally appeared as a series of blogs in EE Times. It is replicated here
in its entirety for the convenience of the EDN community.}

Motors are all around us, and an important part of many system designs. Field oriented control
(FOC) is a high-performance technique for motor control that is becoming increasingly attractive for
all kinds of applications. It's worthwhile, therefore, for developers to have a basic understanding of
FOC.

Let's start by briefly comparing FOC to the more traditional trapezoidal commutation on brushless
DC (BLDC) motors. But first, let’s address the misnomer that BLDC motors are DC motors. They are
in fact AC motors. If you look at the voltages and currents on a BLDC motor, they alternate back and
forth just like any other AC motor.

So, which works better on BLDC motors—FOC or commutated control? This is a more complicated
question to answer than you might think.

If torque ripple or audible noise is a concern, then the shape of the back-EMF waveform of the BLDC
motor becomes very important. Most BLDC motors in fact have a sinusoidal back-EMF waveform. If
you employ trapezoidal commutation on a motor like this, torque ripple will occur which is
synchronous to the commutation process, as illustrated in Figure 1. To achieve low-torque ripple
with trapezoidal commutation (especially at lower speeds), the back-EMF waveform should be
trapezoidal in shape. But this back-EMF shape is harder to achieve in motor design than sinusoidal
back-EMF since the airgap flux would need to be held constant. Most BLDC motors in fact have a
sinusoidal back-EMF waveform, and trapezoidal commutation yields significant torque ripple. You
can reduce the torque ripple on these motors by driving them with sinusoidal currents, like those
produced by FOC.
Figure 1. Torque Ripple Resulting from Trapezoidal Commutation

Another design consideration is efficiency. In most cases, a BLDC motor with sinusoidal back-EMF
will run more efficiently with FOC than with trapezoidal commutation. This is because the higher
harmonics in the trapezoidal current waveform do not have corresponding equals in the back-EMF
waveform, and therefore don’t contribute to airgap power. Instead, they simply increase the heat in
the motor windings. On the other hand, trapezoidal commutated control at full speed can be
achieved without PWM, which significantly reduces switching losses in the inverter. So with FOC,
the motor usually runs more efficiently; but with trapezoidal commutation at full speed, the inverter
runs more efficiently. Which is best depends on your particular motor and inverter.

Bus utilization is another concern. The fundamental harmonic of the voltage waveform resulting
from trapezoidal commutation is larger than the highest voltage sinewave possible with FOC, which
allows the motor to achieve higher speeds. You can increase the FOC voltage using modulation
enhancements such as third harmonic injection and space vector modulation, increasing the FOC
voltage amplitude 15% by dynamically shifting the common-mode voltage of the output waveforms.
But this is still not equal to the fundamental voltage harmonic with trapezoidal commutation. More
advanced FOC systems (such as InstaSPIN motor control technology from Texas Instruments) allow
you to over-modulate the voltage waveform until it gradually morphs into a trapezoidal form. This
increases the modulation index by 33% compared to sinusoidal modulation alone.

Finally, let’s consider cost. If you need a shaft sensor for your design, then trapezoidal commutation
is going to be less expensive. This is because it can be achieved with very low shaft angle resolution
made possible by simple Hall Effect sensors.

But FOC requires a more sophisticated shaft sensor, such as a resolver or encoder. The high cost of
this sensor is one of the main reasons why more and more designs are migrating to sensorless
control. If you can eliminate the shaft sensor, sensorless trapezoidal commutation is still less
expensive than sensorless FOC because the processor requirements are lower. But the total system
cost is almost identical. This is because in a sensorless system, most of the cost is in your power
devices and bus capacitor(s), which is determined by the motor horsepower.

Considering the enhanced performance and flexibility possible with FOC, it may very well turn out to
be the most cost-effective solution for your application. This is why many low-cost, high-volume
applications (such as appliances) are abandoning trapezoidal control altogether and embracing FOC
faster than ever before.

Four Steps to Field-Oriented Control

Four Steps to Field-Oriented Control

Field-oriented control (FOC) is more than just a set of vector equations; it is a treatise on how all AC
motors fundamentally work. By its basic definition, FOC simply means controlling the orientation of
a motor’s field(s) to achieve a desired result. From that definition, all motors do field-oriented
control in one form or another. Even brush DC motors do FOC; they just accomplish it mechanically
by using brushes and a commutator.

Vector control was born out of the desire to control AC motors as we can brush DC motors.
Controlling the torque on a brush DC motor is fairly easy to understand, so let’s start with that.
Remember, to control torque, we must control current. Control of current can be divided into four
discrete steps as shown in Figure 2.

Figure 2. Current control of a brush DC motor

1 -- Measure the current already flowing in the motor. There are many ways to accomplish this,
such as using a strategically placed shunt resistor, or some form of inline current sensor. But the
goal is the same. If we want to control the current, we first have to measure it.

2 -- Compare the measured current to the desired current, and generate an error signal.

3 -- Amplify the error signal to create a correction voltage. To regulate the current, we either
increase or decrease the voltage on the motor’s terminals. Due to the frequency poles in a typical
closed-loop current controlled motor winding, this amplifier often takes the form of a P-I controller.

4 -- Modulate the correction voltage on to the motor terminals. This is usually done with some
type of power switching technique, such as PWM.

When viewed as discrete operations, these four steps represent how you would accomplish torque
control on a microcontroller (as an Interrupt Service Routine), where they would be executed
thousands, or perhaps tens of thousands of times per second in a sequential fashion.

But this process only controls the magnitude of the motor current. The brushes and commutator on
the DC motor mechanically perform field orientation. They keep the rotor current vector always
oriented by 90° with respect to the stator flux vector, to achieve maximum torque per amp (MTPA).

If you understand the process outlined in Figure 2, then you are well on your way to understanding
field-oriented control. In fact, these same four steps are also used to do FOC on an AC motor. The
main difference is that, since AC motors do not have brushes and a commutator, the process must
also include the orientation part of the job.

Now, let's go through the FOC process in the context of these four steps. The process is simpler to
understand if we first consider a three-phase permanent magnet motor, so let’s start with that.
Later, we can extrapolate the technique to induction machines.

Measure the current already flowing in the motor. In the case of a three-phase permanent
magnet synchronous motor (PMSM), we have three currents to control instead of just one. But for
the purpose of the FOC algorithm, we only need to measure two of these currents. Can you guess
why? Because the windings are not connected to any other nodes, the sum of the two currents
flowing into two of the windings MUST equal the current flowing out of the third winding. Many
FOC systems actually do utilize three current sensors anyway, however, so as to detect winding to
frame shorts, or because three shunts are required in order to measure two currents when the
voltage modulation reaches 100%.

Figure 3. Current orientation to achieve maximum torque per amp (MTPA)

As a sidebar to this step: if the three scalar current measurements are reflected along the respective
magnetic axes for each phase on a space vector diagram, a net current vector (blue) can be
visualized as shown in Figure 3. Assuming we want to achieve MTPA, this vector should be at right
angles to the rotor flux vector. To achieve this, we could simply control the three currents to equal
the sinusoidal values shown in Figure 3 with three separate P-I controllers. But this is rarely done in
reality, for reasons we will soon see.
Step 2

Compare the measured currents to the desired currents, and generate error signals. While
this comparison step is very straightforward for a brush DC motor, there are a few more operations
required for an AC motor. But please, don’t get lost in the minutia. Remember the end goal of what
we are trying to do here.

First, let’s simplify our three-phase system to an equivalent two-phase system. One way to visualize
this conversion is to realize that we have three axes of current, which combine to create a current
vector in two-dimensional space. But for two dimensions we only need two axes to define any vector.

This issue was first addressed by Edith Clarke during her career at General Electric (1922-46).
(Incidentally, she was the first woman to receive a Master’s Degree in Electrical Engineering from
MIT, and also the first female professor of electrical engineering in the United States at the
University of Texas, Austin.) Her famous set of equations convert a three-phase system into an
equivalent two-phase system without any loss of information.

Equation 1. Amplitude invariant form of the Clarke transform

This set of equations is referred to mathematically as the αβγ transform, but it is more widely known
by power engineers as the Clarke transform.

Another way to think of the Clarke transform is that it takes three coils evenly spaced 120° apart,
and turns them into two equivalent coils, one at 0° and one at 90°. The equations shown are
amplitude invariant, which means the outputs are scaled so that the resulting two-phase waveforms
have the same amplitude as the original three-phase waveforms. The last equation accounts for any
common-mode currents. But for three-phase motors, ia(t) + ib(t) + ic(t) = 0, so the last equation is
often omitted in FOC current calculations. This results in the net current vector being resolved into x
and y components on a standard rectangular coordinate system, as shown in Figure 4.
Figure 4. Graphical representation of the Clarke transform

Using the Clarke transform, we can design an FOC system as shown in Figure 5. But this design is
rarely used. While the system in Figure 5 will work okay at low speeds, at high speeds the
bandwidth limitation of the P-I controllers will make it harder to follow the reference current
waveforms.
Figure 5. Stationary frame current regulator FOC system

To illustrate this point, Figure 6 shows on the left a picture I took of my granddaughter on a merry-
go-round. Her position represents the reference waveform, and I represent the P-I controller trying
to make the camera track her position. But as her speed approached 5000 RPM, it became very
difficult for me to lock on to her position, as evidenced by the blurry image. My wife (who I might
add is a very wise woman) suggested that I join our granddaughter and she would take the next
picture. But to my surprise, she then jumped up on the merry-go-round with us! As a result, it was
very easy for her to track our position at any speed because she was spinning at exactly the same
speed, as shown in the image on the right. All of the relative sinusoidal motion that existed earlier
between my granddaughter and the photographer was gone.

Figure 6. Images taken from different reference frames a) Stationary frame b) Synchronous frame

The merry-go-round example suggests a strategy for how to improve our FOC design. Let’s move the
current regulation problem to a rotating reference frame that is synchronous with the rotor (or more
specifically, synchronous to the rotor flux). That’s exactly what the following set of equations allows
us to do.
Equation 2. Jump up on the rotor reference frame using Park transform

These equations are better known as the Park transform, named after their inventor Robert Park,
who first proposed this concept in 1929 while working at General Electric during the same time
Edith Clarke was there. Notice that the two sinusoidal currents are translated into two steady-state
DC values. The d-axis current is aligned directly with the rotor flux, while the q-axis current is
quadrature to the d-axis. The angle in these equations (Θλ ) is that of the rotor flux with respect to
the stationary magnetic axis of an arbitrary stator phase (which is usually referred to as “Phase A”).
For a permanent magnet synchronous motor (PMSM), the rotor flux does not move with respect to
the rotor. So by accurately measuring the angle of the rotor with an encoder or a resolver, we can
accurately determine the angle of the rotor flux.

Further steps

The graphical representation of the Park transform is shown in Figure 7. As with the Clarke
transform, the current stator vector (Im) is resolved onto two orthogonal axes. But unlike the alpha-
beta axes, the d-q axes are rotating synchronously with the rotor flux vector.
Figure 7. Graphical interpretation of the Park transform for a spinning rotor

In addition to solving the bandwidth problem of the stationary frame P-I controllers, the Park
transform also provides another distinct advantage for FOC. By referencing the direct or “d” axis to
the rotor’s flux axis, the two resulting DC currents have very significant meaning for motor control
engineers. The d-axis current (because it is pointing directly at the rotor flux at all times) allows us
to adjust the effect of the rotor flux on the stator winding. By adjusting the d-axis current to be
either positive or negative, we can either boost rotor flux's effect, or weaken its effect (i.e., field
weakening at high speeds). But as long as the PMSM is running at normal speed, we usually just set
the d-axis current to zero.

The quadrature or “q” axis is where all the action takes place. Because this axis is quadrature to the
rotor flux axis at all times, any stator current component that lies on this axis is directly responsible
for producing motor torque! For example, if you are designing an electric vehicle using FOC, when
you push down harder on the accelerator pedal, you are commanding more positive q-axis current.
Conversely, when you push down harder on the brake pedal, you are commanding more negative q-
axis current.

Figure 8. Comparing measured DC currents to their desired values.

It is literally that simple! We compare the measured values of d and q axis current to their respective
commanded values, and generate error signals as shown in Figure 8. Finally, we are done with step
2.

Congratulations! You are now 50% done with the FOC process. Now that we have our error signals,
what do we do with them?

Amplify the error signals to create correction voltages. Now that you’ve made it this far, you
can relax a bit; these last two steps are super easy. Just like with brush DC motor torque control, we
turn to our old friend the P-I controller to take the current error signals and amplify them to create
the motor voltages. The only difference with this step compared to a brush DC motor is that we now
have two P-I controllers: one for the d-axis and one for the q-axis. And since they exist on a rotating
reference frame synchronous to the rotor flux axis, both d and q currents are DC VALUES when the
motor is operating under steady-state conditions, regardless of speed! Figure 9 shows the two P-I
controllers along with recommended tuning coefficient values.

Figure 9. Synchronous frame P-I controllers with tuning values

Modulate the correction voltages onto the motor windings. Combining Vd and Vq using vector
math results in a voltage vector which we need to apply to the stator windings. But Vd and Vq exist
on the rotating reference frame. The stator windings exist on the stationary reference frame. (You
can probably see where I am going with this.) In order to put these voltages onto the motor
windings, we first need to jump off of the rotor, and translate Vd and Vq into equivalent waveforms
in the stationary frame. So we take the Park transform (which is what got us up on the rotor to begin
with), and rearrange the terms to solve Vα and Vβ.

Equation 3: Inverse Park transform

When finished with this step, we now have two voltage waveforms: one on the α axis, and one on the
β axis. When plotted as a function of rotor angle over time, the result will be a cosine wave and a
sine wave, respectively. These waveforms simply represent the magnitude of the net voltage vector
(which is spinning) when it is reflected onto the stationary α axis and β axis. This is graphically
represented in Figure 10.
Figure 10. Graphical representation of the inverse Park transform for a spinning rotor

Inductive motors

If we had a two-phase motor, we would be done. All we would have to do is drop the scaled
instantaneous values of Vα(t) and Vβ(t) into the PWM module, and congratulate ourselves for our
motor control prowess. But since we have a three-phase machine, we have to convert Vα and Vβ into
three voltage values (Va, Vb, and Vc), which can be directly applied to the three motor windings. To
do this, Edith Clarke once again rides to the rescue by providing the inverse Clarke transform.
Because the zero-sequence (common mode) voltage term is zero, the inverse Clarke transform takes
the following form:

Equation 4. Inverse Clarke transform

We now have our three voltage values! Put them in the PWM module and then exit the Interrupt
Service Routine. By the time we get our next interrupt, the three voltages should have done their
work on the motor to hopefully drive the motor currents closer to their desired values. We then do
the whole process over again. On a microcontroller such as TI’s C2000 TMS320F28069, all of these
calculations can be done in less than 12 µS! The entire FOC process is summarized in Figure 11.

Figure 11. Overview of FOC Control

Control Torque on Induction Motors

Now that you now understand how to do FOC on a permanent magnet machine, it only takes one
small step intellectually to understand how it works with an induction machine. In fact, the
procedure is almost identical with just a few tiny exceptions.

To determine the angle of the rotor flux vector on a permanent magnet machine, we simply used an
encoder that measured the angle of the rotor itself. This was sufficient because the rotor flux angle
never changes with respect to the rotor angle. But on an induction machine, knowing the rotor angle
does NOT mean we know the rotor flux angle!

On an induction motor, the rotor flux slides across the face of the rotor at a frequency called the slip
frequency. So if we can accurately calculate the slip frequency, we can combine this knowledge with
our measurement of the rotor angle to figure out the angle of the rotor flux. This is called indirect
FOC because we are measuring something else that is related to rotor flux and using it to estimate
the rotor flux angle.

It turns out that on an induction machine, the slip frequency can be calculated as follows:

Equation 5 -- Slip frequency calculation, with τr = rotor electrical time constant = Lr / Rr

So we can use this equation to determine the rotor flux angle in real time as shown in Figure 12.
Figure 12. Rotor flux angle estimator for AC induction machines

Once we have the flux angle, we can then proceed with the remaining steps exactly as outlined for a
permanent magnet machine.

The other difference when applying FOC to an induction motor is that FOC gives us the ability to
directly control the motor’s flux. Recall that as the motor has no permanent magnets, it has no
inherent flux. All of the rotor flux must be induced from the stator coils. This means that part of the
stator current vector must produce motor flux in addition to producing motor torque.

In other words, we no longer want to set the desired value for d-axis current to zero. During normal
speed operation, d-axis current should be set to a constant value defined by equation 6, where Vrated
is the RMS line-to-line voltage rating of the motor, frated is the rated motor frequency in Hz, and L>s is
the stator inductance in Henries

Equation 6 -- Determining rated d-axis current for an induction machine

By reducing the d-axis current, we essentially weaken the rotor flux. This weakening enables higher
speed operation for a given bus voltage. Adjusting the d-axis current also provides a handle to adjust
motor efficiency and power-factor. So we see that with an induction motor, being able to directly
control the rotor flux results in some nice advantages that were not possible with Volts-Per-Hz
control. Plus, don’t forget that we get nearly instantaneous torque response by adjusting the q-axis
current.

But this is only a starting point for FOC. Incorporating an encoder or other sensor on the motor shaft
to measure rotor angle has been an integral part of FOC designs for years, but shaft sensors with the
resolution required by FOC are very expensive, and they are not experiencing the same cost
reduction curve over time as other drive components, especially the processor. In order for FOC to
achieve its full economic impact on the motor world, then, something had to happen. And it has.
There is a second wave of the FOC revolution, which is being fueled by powerful new “sensorless”
control techniques, that is the next thing developers should be investigating.

Also see:
● ARM Cortex-M4F-based MCUs target consumer and industrial motor control
● Testing your motor control algorithms
● 12-V motor driver family simplifies tuning
● Enhancing Industrial Motor Control Performance Utilizing Digital Isolator Technology

Dave Wilson is a senior industrial systems engineer in the C2000 microcontroller group, where he
focuses on motor control applications. In his current assignment, Dave focuses on algorithm
development and motor control systems simulation. He has 35 years of experience working on
projects ranging from nuclear pulse processing to artificial intelligence pattern recognition. He has
designed motor control systems as simple as trigger controls for power tools, and as complex as a
six-axis DSP servo stage controller for a scanning electron microscope. He is the author of several
articles, patents and conference papers related to motor control. Dave holds a Master of Science in
electrical engineering from the University of Wisconsin and a Bachelor of Science in electrical
engineering from John Brown University. His passions include hiking, camping, photography, guitar,
target shooting, and, of course, rotating metal.

Vous aimerez peut-être aussi