June 2014 DocID18458 Rev 6 1/162
UM1052
User manual
STM32F PMSM single/dual FOC SDK v4.0
Introduction
This manual describes the Motor Control Software Development Kit (STSW-STM32100)
designed for and to be used with STM32F MCUs microcontrollers. The software library
implements the Field Oriented Control (FOC) drive of 3-phase Permanent Magnet
Synchronous Motors (PMSM), both Surface Mounted (SM-PMSM) and Internal (I-PMSM).
The library exploit a new sensorless technique that, in conjunction with an I-PMSM motor, is
able to extend the range of allowed speed to zero. This newest sensorless algorithm take
benefit of the motor structure in order to detect the rotor angular position even when the
motor is at low speed or still. In this user manual we will refer to this technique as "High
Frequency Injection" also called HFI. This new algorithm take benefit of the floating point
unit of STM32F30x and STM32F4 series.
The STM32F family of 32-bit Flash microcontrollers is based on the breakthrough ARM®
Cortex®-M cores: the Cortex®-M0 for STM32F0, the Cortex®-M3 for STM32F1 and
STM32F2, and the Cortex®-M4 for STM32F3 and STM32F4, specifically developed for
embedded applications. These microcontrollers combine high performance with first-class
peripherals that make them suitable for performing three-phase motors FOC.
The PMSM FOC library can be used to quickly evaluate ST microcontrollers and complete
ST application platforms, and to save time when developing Motor Control algorithms to be
run on ST microcontrollers. It is written in C language, and implements the core Motor
Control algorithms as well as sensor reading/decoding algorithms and a sensorless
algorithm for rotor position reconstruction. The library can be easily configured to make use
of STM32F30x's embedded advanced analog peripheral set (fast comparators and
Programmable Gain Amplifiers, PGA) for current sensing and protection, thus simplifying
application board.
When deployed with STM32F103 (Flash memory from 256KBytes to 1MByte), STM32F2,
STM32F303 or STM32F4 devices, the library allows simultaneous dual FOC of two different
motors. The library can be customized to suit user application parameters (motor, sensors,
power stage, control stage, pin-out assignment) and provides a ready-to-use Application
Programming Interface (API). A user project has been implemented to demonstrate how to
interact with the Motor Control API.
This project provides LCD and UART User Interface, thus representing a convenient real-
time fine-tuning and remote control tool. A PC Graphical User Interface (GUI), the ST MC
Workbench, allows a complete and easy customization of the PMSM FOC library. In a very
short time the user can run a PMSM motor. A set of ready-to-use examples are provided to
explain the usage of the motor control API and it's most common features.
Microcontrollers supported:
– STM32F030C6/C8/K6/R8, STM32F050C6/G6/K6, STM32F051C6/C8/K6/K8/R6/R8,
– STM32F100, STM32F103,
– STM32F2 Series,
– STM32F302xB/C, STM32F303xB/C,
– STM32F4 Series.
www.st.com