Sensorless Field Oriented Control Using An 8-Bit Microcontroller

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

Bodo´s Power Systems

Systems Design Motion and Conversion Motion Control

Sensorless Field Oriented


Control using an 8-Bit
Microcontroller
The PWM unit directly triggers the AD-converter via hardware events
Field Oriented Control (FOC) is increasingly being used in consumer and industrial
motor control applications because it results in higher efficiency by running the motor at
optimum torque at all times; better dynamic response to enable very precise variable
speed control; and lower torque ripple to provide even and steady motor rotation at speed
and also during start and stop operation. Typically a 16- or 32-bit MCU or digital signal
processor (DSP) is required to handle the complex trigonometric equations.
By Arno Rabenstein, Infineon Technologies AG
Compared to current solutions on the mar- solutions offer the added benefit of software In order to determine the actual angle of the
ket, in which FOC execution engages almost reprogrammability to offer more versatile rotor, the flux vector Ψ can be calculated by
the whole central processing unit (CPU) application options. integrating dedicated voltages.
load, FOC execution on the Infineon 8-bit
microcontrollers XC886 and XC888 - e.g. Sensorless Field Oriented Control
with 15 kHz PWM frequency and 133 µs cur- A field oriented control algorithm requires
rent control response time - only requires 58 information about the rotor position. This can
percent of the CPU’s performance, providing be achieved by position sensors like an The voltage model is a simple model for
ample headroom for application specific encoder or resolver. Another approach is a rotating field motors which is based on dedi-
functionality. The execution of a sensorless sensorless FOC for BLDC motors, which is cated differential equations. The stator cur-
FOC on a standard 8-bit microcontroller is more suitable for cost critical applications. It rent vector is requires a precise measure-
enabled by the highly optimized PWM unit is based on the interaction between the per- ment of the phase currents. The integration
CAPCOM6E that triggers the AD-converter manent magnet of the rotor and the magnet- is simplified by replacing it by a lowpass filter
for measuring the DC-link current via a sin- ic field of the stator. with a very low cut-off frequency.
gle shunt resistor. The calculations of the
sensorless FOC algorithm in 16-bit arith-
metics can only be realized by a nested uti-
lization of the co-processors MDU and
CORDIC – called vector computer – and the
8051 compatible CPU itself. The MDU is a
16-bit multiply and divide unit, the CORDIC
is a 16-bit co-processor dedicated for vector
rotation and angular calculations.

Sensorless Field Oriented Control imple-


mented on 8-bit microcontrollers XC886 and
XC888 is the perfect answer to energy relat-
ed regulations and pricing pressure for appli-
ance manufacturers. Unlike most competitive
FOC implementations that are hard-coded, Figure 1: Space Vector Pulse Width Modulation: Three-phase inverter output signal and DC-
XC886 and XC888 microcontroller-based link current I_Dclink

www.bodospower.com Bodo´s Power Systems - May 2007 1


MOTION CONTROL

A sensorless field oriented control (FOC) The XC886/888C(L)M microcontrollers pattern. There are shadow registers for the
implemented on a standard implement the above requirement using an compare values implemented in the device
8-bit microcontroller offers the full benefits of event based hardware trigger from the PWM which allow a glitch-free operation. Start of
sinusoidal commutation at a minimum of unit CapCom6E towards the AD-converter. timer T13 is synchronized to the period
system cost. When using just a single shunt The green lightning symbols in the second match of timer T12 and is responsible for
in the PWM period in Figure 3 represent the hard- triggering the AD-converter. The compare
DC-link in order to acquire the phase cur- ware events which directly trigger the value and period value is adjusted suchlike
rents, there are demanding requirements on AD-converter sampling. The event based that the current is measured in the middle of
fast and accurate AD-conversion. The phase trigger eliminates any interrupt latency and the active states. Two AD-converter chan-
currents must be reconstructed out of the enables fast and accurate current measure- nels are used in parallel to sample the ampli-
DC-link current signal which is the response ment. After sampling of the signal, the con- fied shunt resistor signal. It is configured to
of a three phase space vector pulse width version phase does not require a valid signal store the results in two different result regis-
modulation. at the input, because the sampled voltage is ters. Hence the FOC calculations can direct-
stored internally. After conversion the result ly read the result registers and do not care
A space vector is a sinusoid whose center is is stored in one of four result registers. Two about triggering the measurement in time.
able to “float” in space. A three-phase space result registers are used to hold the appro-
vector is represented by a hexagon which priate DC-link current values IDClink. The Field Oriented Control Calculations
can be divided in six sectors. Any desired ADC sample time is as low as 250ns. As the From a control point of view, the field orient-
voltage-space vector will consist of a “real” current is measured in time slot (b) and (e) ed control is comparable with that of a dc
voltage from one of the phases and an of Figure 1, there is always enough time for motor. The basic concept is a cascade con-
“imaginary” right-angle voltage created from conversion available. trol with the important difference that the
the other two phases. The space-vector electrical variables (Vd, Id, Vq and Iq) are
algorithm will determine the time required at The moment of triggering is adjusted by the turning with the rotor. Thus the currents
a first active state, a second active state, compare and period values of the unit CAP- measured at the stator (Iα and Iβ) have to
and an inactive state to produce the desired COM6E. There are two timers implemented be transformed in the rotor coordinates (Id
magnitude and angle of the space vector. which can be synchronized against each and Iq). The controller for the currents is
other. Timer T12 is responsible for generat- realized in the rotating system as PI-con-
Figure 1 gives an example. The first active ing the space vector pulse width modulation troller, whereas the field exciting d-compo-
state (b&f) is TU, the second active state
(c&e) is T-W, the inactive state is T0 which
appears twice, first as (000) vector (a&f),
second as (111) vector (d).

In order to reconstruct the phase currents


out of the DC-link current, the AD-converter
has to be triggered during the active states.
A perfectly sinusoidal commutation will
require space vectors also pointing exactly
onto the corners of the hexagon. Then only
one phase current could be measured at the
DC-link and only one phase current could be
reconstructed. This is not tolerated by the
FOC algorithm itself. As a result, the corners
of the hexagon have to be blanked by the
Figure 2: Sensorless Field Oriented Control of PMSM motor
space vector pulse width modulation. This
blanking causes some ripple in the output
signals which have to be reduced to a mini-
mum.

Acquisition of Actual Values


Figure 2 shows the block diagram of the
sensorless FOC with speed control for a per-
manent magnet synchronous motor (PMSM).
In order to estimate the rotor position by a
single shunt measurement, the PWM pattern
generation and the triggering of the AD-con-
verter for current measurement must be very
fast and accurate. Any jitter in the trigger
point will influence the actual rotor’s angle
estimation. As a result, the total harmonic
distortion of the sinusoidal current signals
will increase.
Figure 3: Timing diagram of Space Vector Pulse Width Modulation and AD-Converter

2 Bodo´s Power Systems - May 2007 www.bodospower.com


MOTION CONTROL

nent and the torque exciting q-component is sensorless FOC source code with a compre-
Key Features of XC886 and XC888
controlled separately. The speed controller hensive documentation allows the users to
which enable Sensorless Field
adjusts - as for a dc motor - the reference jump start with FOC development.
Oriented Control:
value for the torque exciting current Iq. Due
to the permanent magnets at the rotor, the A CAN to USB bridge, built by using the
• High performance 16-bit vector comput-
reference value for the field exciting current XC886CM again, is available in the kit for
er (CORDIC + MDU)
Id is set to zero. hex code download and parameter adjust-
Vector rotation and transformations like
ments. A CAN message based user interface
Park transform
The outputs of the current controllers repre- enables the users to set and modify all
Normalizing and scaling
sent the reference voltages (Vd and Vq) in motor control parameters for speed and cur-
Interrupt based operation with minimum
the rotor coordinates. These values are rent control. The unique CAN based monitor-
CPU load
transformed into the stator coordinates (Vα ing offers real-time control of the motor con-
• PWM unit for advanced motor control
and Vβ) in order to calculate the polar coor- trol application. The 24V BLDC motor and a
(CapCom6E)
dinates (norm and angle). Using space vec- plug-in power supply make the kit ready-to-
16-bit resolution for high precision
tor pulse with modulation, the norm and use.
space vector
angle values are converted in three phase
PWM generation
currents by modulating the high-side and The pre-compiled demos provide a platform
Dead time control for minimum hard-
low-side switches of the power inverter for easy evaluation and performance meas-
ware effort (direct control of
accordingly. urement of the FOC algorithm. The complete
MOSFET/IGBT)
development environment including a free
CTRAP provides hardware overload
All calculations are executed step by step in tool chain allows the users to advance to the
protection
one interrupt service routine which is called next stage of application development and
• A fast 10-bit A/D Converter (sample
at timer T12 period match. The execution customization using the same application kit.
time of 0.25 µs)
takes more than one PWM cycle. As a
Hardware synchronization to PWM unit
result, the control loop time is twice a PWM For further details on Infineon’s Sensorless
reduce CPU load
period, e.g. at 20kHz PWM frequency, the FOC algorithm and the FOC Drive
Use of two out of four result registers to
control loop is calculated every 100µs. Application Kit, please refer to following web-
maximize
page: http://www.infineon.com/XC800-FOC.
sampling performance
FOC Drive Application Kit: CANmotion
Enables single shunt current measure-
The FOC Drive Application Kit provides a Internet Links:
ment
cost-effective method of evaluating and FOC Drive Application Kit
Fast ADC reduces torque ripple due to
developing sensorless brushless DC (BLDC) http://www.infineon.com/XC800-FOC
minimized blind angle in sensorless
motor control applications using the XC800 8-bit microcontroller
FOC
Sensorless Field Oriented Control technique. http://www.infineon.com/XC800
Datasheet and usermanual XC886
The kit is featuring the CANmotion evalua- http://www.infineon.com/XC886
tion board which integrates the XC886CM Datasheet and usermanual XC888 PCIM Booth 12/404
MCU (TQFP-48) and a 3-phase power http://www.infineon.com/XC888
www.infineon.com
inverter providing all the necessary functions
to control a 24V BLDC motor. The complete

Figure 4: Block diagram of the XC886/888 8-bit microcontrollers with vector computer.

www.bodospower.com Bodo´s Power Systems - May 2007 3

You might also like