Professional Documents
Culture Documents
W
hen used in an appliance, a permanent with PWM modules enables inexpensive current-sensing
magnet synchronous motor (PMSM) circuitry, by sensing inputs at specific times where switching
provides very good efficiency because of transistors allow current to flow through the current-sense
its constant rotor magnetic field, which is resistors.
produced by a permanent magnet on the
rotor. In addition, its stator magnetic field is generated by Development Tools
sinusoidal distribution of the windings. Compared to induc- The FOC motor-control firmware discussed in this article
tion motors, PMSMs have a very high power/size ratio. They was developed based on Microchip’s dsPICDEM MC1 Mo-
also produce less electrical noise compared to dc motors tor Control Development Board.[1] Microchip’s data moni-
since brushes are not used. tor and control interface (DMCI) tool, which is a module
In PMSM-based appliances, field-oriented control (FOC) within the MPLAB Integrated Development Environment
offers a great cost benefit because it eliminates the position (IDE), was used to test and debug the FOC algorithm. The
sensors. The sensorless FOC technique also overcomes re- DMCI tool provides a quick and dynamic IDE, which allows
strictions placed on some applications that cannot deploy designers to graphically represent the application feedback.
position or speed sensors, such as those in which the motor For instance, DMCI’s IDE provides project-aware naviga-
is immersed in oil. Although proprietary FOC designs using tion of program symbols (variables) that can be dynami-
ASICs are available, a new generation of digital signal con- cally assigned to any combination of slider, direct input or
trollers (DSCs) offer a low-cost alternative for implementing Boolean controls. These controls can be used interactively
the FOC algorithm. to change the values of program variables within the DMCI
DSCs are suitable for appliances like washing machines IDE. Further, the graphs can be dynamically configured for
because they feature peripherals tailored for motor control viewing program-generated data.
such as pulse width modulators (PWMs), analog-to-digital In the system overview block diagram (Fig. 1), it can be
converters (ADCs) and quadrature encoder interfaces. When seen that no position sensors are attached to the motor shaft.
executing controller routines and implementing digital fil- However, there are some sensors used for current measure-
ters, DSCs help designers optimize code execution by being ments on the motor. These sensors feature low-inductance
able to carry out the multiply-accumulate instructions and resistors that are part of the inverter function block. A three-
fractional operations in a single cycle. Also, for operations phase inverter stage drives the motor windings (Fig. 2).
requiring saturation capabilities, DSCs help designers avoid
overflows by offering hardware saturation protection. The FOC Algorithm
DSCs need fast and flexible ADCs for current sensing, The following is a step-by-step summary of the FOC (or
a crucial function in motor control. For example, the Mi- vector-control) algorithm:
crochip dsPIC DSC family features ADCs capable of con- 1. Measure the stator currents phase currents iA and iB.
verting inputs at a 1-Msample/sec rate and handling up to Calculate iC from the fact that iA + iB + iC = 0 and calculate
four inputs simultaneously. Multiple trigger options on the the currents from the two current sensors.
ADCs enable the use of inexpensive current-sense resistors 2. Convert the set of these three-phase currents onto
to measure motor phase-winding currents. Triggering ADCs a two-axis system. This conversion provides the variables
�����������
called the Park Transformation.
����� 4. Error signals are formed using iD,
����� � iQ and reference values for each. The
��
iD reference controls rotor-magnetiz-
���� ing flux. The iQ reference controls the
��� torque output of the motor. The error
��
��� signals are input to proportional and
�� integral (PI) controllers. Then, the PI
�������������
���
������������ controller’s output provides VD and
���� VQ , which is a voltage vector that will
��� be sent to the motor.
���������������
��� ������ 5. Estimate the new coordinate
��� transformation angle, where V, V, i
��� ������������ and i are the inputs. The new angle
���������� �� guides the FOC algorithm as to where
���
to place the next voltage vector.
��� 6. Rotate the VD and VQ output val-
���
��� ues from the PI controllers back into
���
���
���
��� the stationary reference frame, using
���� ��� the new angle. This calculation pro-
�� vides new quadrature voltage values,
���
�� V and V.
���
��� 7. Transform the V and V values
���
back to three-phase values VA, VB and
VC. The three-phase voltage values are
Fig. 1. In this basic implementation of a field-oriented-control-based PMSM driver, one advan-
tage that is immediately apparent is the absence of position or speed sensors. used to calculate new PWM duty-cycle
values that generate the desired voltage
�������������������� vector. The entire process of trans-
forming, PI iteration, transforming
back and generating PWM is shown
����� ����� ����� ����
������� in Fig. 3.
�� �����
�������
����� ����� ����� Sensorless FOC for PMSMs
The sensorless control technique
implements the FOC algorithm by
estimating the position of the motor
�������� without using speed or position sen-
�����
������������� sors. Fig. 4 shows a simplified block
�� diagram of the position-estimator
��
function. The FOC algorithm is ex-
ecuted at the same rate as that of the
�� PWM duty-cycle algorithm. In the
FOC algorithm, the PWM triggers two
Fig. 2. A three-phase inverter drives the PMSM windings. The figure shows the three-phase respective ADC conversions for the
windings, along with the current-sensing and fault-generation circuitry built into the power two winding-current shunt resistors.
inverter, to protect the system against excessive currents.
Then a potentiometer is used to set the
i and i from the measured iA, iB and 3. Rotate the two-axis coordinate reference speed of the motor. The ADC
iC values; i and i are time-varying system to align with the rotor flux, us- interrupts generate the data samples
quadrature current values, as viewed ing the transformation angle calculated needed to execute the algorithm.
from the stator’s perspective. This step at the last iteration of the control loop. From the motor model in Fig. 5, the
is called Clarke Transformation. This conversion provides the iD and iQ input voltage can be obtained:
���� ����� �� ��
� �� � �� ���� ������ � ����
� ��� ����� � ���
� � �� ������ �
�� ����
�����
� ��
� �����
� �
�
���� �� ��
����
��
�� �� Fig. 5. The PMSM can be approximated by an
�� �����
���� electrical model, comprising the winding
resistance, winding inductance and back EMF,
����
����� which is dependent on the motor speed.
�������� �������� ��
����� ���������
��������� �� either a positive feedback gain (K) or
a negative feedback gain (-K) to get
Fig. 3. In the field-oriented-control (or vector-control) algorithm, the three-phase voltage values the estimated current to match the
are used to calculate new PWM duty-cycle values to generate the desired voltage vector. measured current. Because the input
voltages are the same for both the mo-
tor and its model, the back EMF can
���������
��� ������� be calculated when the estimated and
���� measured currents match.
���
����
���
��� � ��������
������� �����
Back-EMF Estimation
����� Once the input currents and volt-
� �
ages of the model and the actual motor
�������� ��
��������� � match, the correction factor z from
���
���������� ��
the motor model can be filtered to get
the back EMF. For this step, we use a
first-order digital low-pass filter, with
Fig. 4. The position estimator is based on the currents and voltages of the motor, and uses a the equation:
motor model to measure the motor position indirectly via a current observer model. The motor
position can be estimated by assuming that the PMSM’s motor model above is the same as y[n] = y[n − 1]]+
+ T × 2πfC × (x[n]
n] − y[n]).
n
that of a dc motor, shown in Fig. 5.
To filter z to get eSESTIMATED , we sub-
v S = Ri
d
Ri S + L i S + e S . Current Observer Model stitute the value of fPWM in the equation
dt A current observer model enables below:
And solving for iS gives the motor the indirect measure of the back EMF 1
e[n] = e[n − 1] +
current: by ensuring that the input to the system f PWM
d R 1 (motor) is equal to the input to the mo-
i S = − i S + (v S − e S ), ×2πfC × (z[n] − e[n]),
dt L L tor model. Here is how it works: The
where iS equals motor current vec- motor and motor model are fed with where e[n] equals the next estimat-
tor, vS equals input voltage, eS equals the same input, but the motor model ed back-EMF value, e[n-1] equals the
back-EMF vector, R equals wind- has a closed-loop controller to ensure last estimated back-EMF value, fPWM
ing resistance and L equals winding that the estimated value matches the equals the PWM frequency at which
inductance. measured value. For example, at any the digital filter is being calculated,
In the digital domain, this equation given time, if the actual motor input fC equals the cutoff frequency of the
becomes: voltage and current are the same as the filter and z[n] equals the unfiltered
i S[n + 1] − i S[n] model, then we can “observe” the back back EMF, which is output from the
= EMF by solving for eS. sliding-mode controller
TS
For the observer model compensa- Solving this equation for e[n]
R 1 tion, a sliding-mode controller can yields the updated back-EMF value.
− × i S[n] + × (v S[n]
n] − e S[n]).
n
L L track the input reference and force the The value of the cutoff frequency
Again, solving for iS yields: error to zero between the measured can be determined through trial and
i S[n + 1] = current iS and the estimated current error, depending on the selection of the
iSESTIMATED. Depending on the error sign, sliding-mode controller gain. The re-
R TS
1 − TS × i S[n] + × (v S[n]
n] − e S[n]).
n the sliding-mode controller will apply lationship between back EMF and the
L L
www.powerelectronics.com 37 Power Electronics Technology March 2007
DIGITAL SIGNAL CONTROLLERS
���������
��
��� ������ ��
��������
����
��
������������
����������
�����������
����������������� ��
�����������
��
���������������������
Fig. 6. The motor model’s closed-loop controller works to ensure that the estimated value
matches the measured value, which yields the back EMF by solving for eS .
�����
of compensation. The speed can be button, the system enters the initial-
calculated by summing θROTOR values ization state where all variables are set
���������� over M samples, and then multiplying
the summed values by a constant. This
to their initial value. Then, the startup
subroutine is executed. The current
is given by: components for torque (iQ) and flux
ω ROTOR [n] = production (iD) are being controlled by
M the FOC, and commutation angle (θ) is
∑ (θROTO
ROTORR [n] − θ ROTOR [n − 1]) × K ,
being generated in a ramp fashion, to
n=0
get the motor spinning and reaching
where ROTER [n] equals angular the minimum speed required to run
velocity of the motor, θROTOR[n] equals the estimator.
current rotor position value, θROTOR[n- After going through the startup
����������������������������������� 1] equals previous rotor position value subroutine, the system switches over
����������������������� and K equals amplification factor for to sensorless FOC control, where the
����������������������������� desired speed range. speed controller is added to the ex-
ecution thread, and the sliding-mode
����������������������������
Motor Startup controller (SMC) starts estimating θ,
�������������������������������������� Because the sensorless FOC algo- as previously explained.
rithm is based on the back-EMF calcu- Upon entering the sensorless FOC
��������������������� lation, the motor needs to run at a min-
imum speed to get the back-EMF value.
control state, the reference speed is
continuously read from an externally
���������������������� Therefore, energizing motor windings connected potentiometer, and the
������������ with the appropriate estimated angle start/stop button is also monitored to
������������������������ is required. To handle this, a motor determine whether or not to stop the
startup subroutine was developed and motor.
�������
������� �����������
���������� ������� ���������
������ ��������
�������
���������� ���� ����������
����� ������������� ��������� �����������
������� ������� ����������� �������������
���������� ����� ��� ���
������������� ���������
�����������
��� ���������
������������� �����
������ ������� �������� �������
PwrBlade® Power Distribution �����
����������
����������
���������� ������� ������������ �������
���
Connector System
����������������� �������������
Ideal for servers, storage systems, fault-tolerant ���������������� �������
���
computers, uninterruptible power systems, and ���� �����������������
���������������� ���������
����� �����
redundant power distribution systems. The one-piece ������� ����
����������
PwrBlade connector mixes power and signal contacts ������� ���
���������
����������� ����������
for a variety of custom design configurations. ��������� ���
www.fciconnect.com/pwrblade
�������
������� �������
�������������� ��������
����������
���������
�������
���������� �����������
������� ���������
�������� ��������
��������� �������
����� ���
Fig. 7. This state-machine diagram shows the different states of a sensorless FOC control
for PMSM, as well as the conditions that make the system transition to a different state.