Documente Academic
Documente Profesional
Documente Cultură
STMicroelectronics
www.st.com/mcu
Vector control made simple
STMicroelectronics’ STM32 offers the performance of the industry‑standard Cortex™‑M3 core at the service
of vector (or field‑oriented) control algorithms. Vector‑control algorithms are widely used in high‑performance
drives. They provide precise and responsive torque and speed control, and guarantee optimized efficiency
during transient operations. Practically, they also have the advantage of using the same framework to control
an asynchronous or synchronous motor. This is interesting for development teams that have to deal with
various applications and motor types. Finally, the sensorless algorithms for rotor speed and position detection
are also of interest when trying to reduce the cost of the drive. The benefits of the ARM architecture combined
with motor‑control dedicated peripherals makes the STM32 MCU family ideally suited to optimize the overall
performance of execution while reducing the overall system cost.
Abbreviations:
AWU: Auto wake up from halt PDR: Power down reset RTC: Real time clock
BOR: Brown out reset POR: Power on reset SPI: Serial peripheral interface
Motor control
I²C: Inter integrated circuit PVD: Programmable voltage detector USART: Universal sync/async receiver transmitter
QQ The STM32 embeds features that QQ Free motor control firmware libraries QQ Run your motor in just a few steps:
are perfectly suited to three‑phase supporting AC induction motor QQ STM3210B‑MCKIT full developer
brushless motors: (sensored) and PMSM motor kit for vector drives
QQ Powerful Cortex‑M3 core (sensorless, Hall‑sensor or encoder) QQ In the Performance line, for devices
QQ 6 PWM advanced control timers vector control starting at 256 Kbytes of Flash, two
with embedded deadtime QQ Less than 21 µs for sensorless advanced control PWM timers and
generation vector control loop three ADCs are on board for dual
QQ Numerous PWM outputs allowing QQ Class B compliancy with the motor control,
multiple DC‑brush, stepper or EN/IEC60335‑1 norm: triple sample
universal motor drives QQ Pre‑certified full set of self‑test and hold
QQ Single/dual sample and hold routines capabilities.
ADC, 12‑bit resolution, 1 µs
conversion time
2
Field‑orientation in sensorless torque control – PMSM
Vector control drive STM32 safety features for greater control robustness
QQ Theory Features Benefits
QQ Changing reference coordinates QQ Safety critical registers can be QQ Strengthens control algorithm
from fixed stator coils to the locked to prevent power stage to protect motor operation from
moving rotor frame greatly damage (software runaway) external disturbance
simplifies the equation describing QQ Deadtime, PWM output polarity, QQ Protects safety‑critical registers in
the motor emergency input enable case of system hang
QQ Method QQ All target registers are read/write QQ Quick error diagnosis and fault
QQ Clarke and Park transformations until lock activation (and then management
convert variables with fixed read‑only if protected) QQ Hardware protection of power
3‑axis, 120º shifted coordinates QQ Once the two lock bits are stage whatever the status of MCU
into 2‑axis orthogonal rotating written, they cannot be modified oscillator
coordinates until next MCU reset (write‑once QQ Safety hardware features to comply
QQ These last variables are DC, or bits) with IEC 60335‑1 norm
slowly varying values, which QQ If main clock fails, an internal RC
can be regulated by means of oscillator (FREEOSC, ~5 MHz
simple PID controllers and then average frequency) starts
transformed back to the fixed immediately
stator windings frame using QQ Interrupt can be generated
reverse transforms, as shown in for shut‑down or safe restart
the diagram above sequences
QQ Requirements QQ Dual watchdog architecture with
QQ Intensive math computations
independent clock sources
(trigonometric functions, multiple
QQ Embedded reset circuitry (power‑on
PID regulators, speed calculation)
reset, power‑down reset,
QQ Minimum
resolution of 16 bits for programmable voltage detector)
the main control variables, with
QQ Emergency stop dedicated input
a need for 32‑bit intermediate
pin with programmable state
results, such as integral terms
QQ Free
CPU load must be kept for
the remaining applicative tasks,
such as communication and
user interface
θrel
iqs
iaβ s iabcs Current
ids Park Clarke
reading
θrel
Sensorless
rotor position
observer
Notes:
SVPWM: Space vector PWM
* Target setting
3
Vector control with STM32
STM32 dedicated peripherals for 3‑phase brushless motor control
PWM timer features ADC features Speed feedback
QQ Motor control timer clock QQ Single/dual/triple ADC with QQ Handled by the general‑purpose
QQ Maximum input clock is simultaneous conversion mode timers
72 MHz to provide 13.9 ns edge QQ 12‑bit resolution QQ Direct interface with incremental
resolution (12‑bit @ 16 kHz QQ Down to 1 µs conversion time encoder and 1 to 3 Hall sensor logic
edge‑aligned PWM) QQ Up to 21 channels, plus internal outputs
QQ Double‑update mode temperature sensor and Vref
QQ No loss of resolution in
QQ External and internal trigger
center‑aligned mode (including PWM timer)
QQ Done using an additional
QQ Versatile channel sequencer
interrupt per PWM cycle or DMA
QQ DMA capable
transfers
QQ Programmable sampling rate
QQ Burst mode
QQ Possibility to update several Benefits
registers of the peripheral using a QQ Suitable for three‑phase brushless
single DMA stream PMSM or AC induction motors
QQ Programmable reload rate QQ Sensor and sensorless
QQ Versatile PWM output management configurations
QQ Individually selectable polarities
drives
QQ Programmable hardware deadtime
generation
QQ 8‑bit register with 13.9 ns
resolution at 72 MHz
Vα Va 6x PWM
d,q
Vb Fault
SV 6-channel
PWM PWM timer
Vβ Vc Inverter
α,β
r s Ia
Iα Ia
d,q r α,β Dual/triple
Ib
Iβ Ib
12-bit 1 µs
A/D converter
α,β a,b Vbus
θr
ωm
θr T Motor
Speed/position
feedback timer
Sensorless
estimation E
θr
Legend: H
Software T: Tachogenerator
Hardware E: Encoder
H: Hall sensors
4
STM3210B‑MCKIT
Run your motor in just a few steps
In just a few minutes, you can QQ Bus‑voltage and power‑stage you just open the libraries, develop
run the kit’s PMSM synchronous temperature monitoring the application, fine tune the code
motor with the standalone demo, in QQ Selection of variables to put on and parameters and compile. You can
torque‑control or speed‑control mode, output for DAC functionality fine tune the application while running
using the LCD and the joystick on the implementation the motor thanks to the real‑time
STM3210B‑EVAL control board. You can apply changes to real‑time debugging capability of the Segger
You can then fine tune or change settings to tune the drive parameters J‑Link.
many parameters using the LCD user on‑the‑fly and get feedback values
interface (as shown on LCD screen from the changed settings. Application‑specific
captures below) and run the PM Once familiar with the demo, you requirements
synchronous motor, or an induction will be able to explore our motor Using the same hardware and
motor: control library that supports FOC firmware platform, you may
QQ Real‑time tuning of torque, flux and (field‑oriented control) drive of PMSM incorporate application‑specific
speed PIDs and induction motors. requirements by taking advantage of
QQ B‑EMF observer gain tuning (for The library sources are free upon the STM3210B‑EVAL control board
sensorless control) request, and help speed up and the inverter board extension
QQ Variation of target speed (speed development of motor control features (USART/LIN port, standalone
control) or target torque and flux applications. With the free 32‑Kbyte operation potentiometer, wrapping
(torque control) evaluation version of IAR’s EWARM, area).
Start LCD menu – speed control demo Speed control can be modified during run‑time using joystick
Torque control demo – Iq and Id parameters can be adjusted PID regulators can be adjusted during run‑time
Inverter board
STM32
controller board Induction motor
Debugger/programmer ST7MC-MOT/IND
Isolation board
PMSM
motor
(Included)
AI-JTAG/OPTO-1
STM3210B-MCKIT STM3210B-EVAL
5
STM3210B‑MCKIT
STM32 motor control tool ordering information
Part number Description
Optimized, documented C firmware libraries for control of 3‑phase PMSM or AC induction brushless motors. In torque or speed
STM3210B MC library
control with STM32, sensor mode, sensorless for PMSM. These are the standalone libraries of the STM3210B‑MCKIT.
The isolation board included in the STM3210B‑MCKIT can also be ordered separately. It provides galvanic isolation between
AI‑JTAG/OPTO‑1 the J‑Link from Segger and any high‑voltage target board. The isolation board has two JTAG connectors (in/out). Available from
distributors and ST sales offices.
Demonstration, evaluation and development kit for STM32 includes firmware, LCD user interface, STM3210B‑EVAL board (control
STM3210B‑MCKIT* board), 7 A three‑phase inverter board, isolation board (AI‑JTAG/OPTO‑1), Segger J‑Link debugger/programmer and 24 VDC Shinano
PMSM motor. Available from distributors and ST sales offices.
240 V/800 W Selni 3‑phase induction motor for use with STM3210B‑MCKIT, or with the ST7MC‑KIT using induction motor default
ST7MC‑MOT/IND
values (for evaluation purposes).
Note:
* Dedicated motor-control documents are available upon request. Contact your ST sales office.
6
Vector control library
Motor control development tools: what’s new Class B compliancy – how
A new motor control software library V3.0 will be released late Q4 2010. we help
QQ Based on the ARM’s CMSIS compliant STM32 peripheral library Two key features help compliance
QQ Offering extended customizability with the EN/IEC 60335‑1 norm:
QQ Supporting latest members of the STM32 product line the dual watchdog architecture
QQ Full support of dual motor control drives (using STMF103x high‑density devices) and the internal clock circuitry. In
QQ Including application example based on FreeRTOS order to make certification even
simpler with the STM32, a set
of self‑test routines has been
A field‑oriented control dedicated GUI (FOCGUI) provides help when configuring developed to fulfill most of table
the motor control software library by means of: H11.12.7 requirements. These
QQ Clear configuration windows for the various items (including power stage, routines have been certified by the
motor, speed and current feedbacks) VDE, a worldwide recognized test
QQ Direct electrical‑parameter entry, without need for conversion to fixed‑point institute, and do not need to be
format re‑evaluated if left unchanged.
QQ Configuration header‑file generation
7
Dual motor control and PFC
Digital power factor correction (PFC)
Why PFC? Active or passive PFC?
For all motor‑control applications, While passive PFC is cheaper, active PFC can reach higher power factors (>98%).
electric power efficiency increases the Passive PFC is also heavier and larger in size compared to active PFC.
profitability of the application, and is a
selling factor. Active PFC implementation with STM32
A low power factor means poor
L D
electrical efficiency: PFC is an
environment friendly technology, +
reducing the harmonics that create Q
VDC
- PI regulator x VAC - I AC PI regulator
VDCREF VERR V PI I ERR
Voltage error Current error
+
compensator x IACREF +
compensator
A demonstration software running a digital PFC and a dual FOC drive with the
STM32F103ZE using the STEVAL‑IHM022V1 STM32 board and
STEVAL‑ISF002V1 driver board is available upon request at ST sales offices.
Order code: BRSTM32MC0910 For more information on ST products and solutions, visit www.st.com