July 2009 Doc ID 15783 Rev 1 1/85
UM0712
User manual
STM8S three-phase AC induction motor control
software library V1.0
Introduction
This user manual describes the alternate current induction motor (ACIM) scalar software
library developed for STM8S microcontrollers.
These 8-bit, ST microcontrollers (STM8S) come with a set of peripherals that make them
suitable for performing both PM and AC induction motor scalar control.
The present document describes the STM8S software library developed to control induction
motors in open loop or speed-closed loop depending whether they are equipped with a
tachogenerator speed sensor or not. The control of the brushless direct current (BLDC)
motor, equipped with three Hall sensors or sensorless, in six-step mode is described in
UM0708.
The ACIM motor software library is made of several C modules and is fitted with STVD
workspaces. It is used to quickly evaluate both the MCU and the available tools. When it is
used with the STM8/128-MCKIT motor control starter kit and an AC induction motor, a motor
can be made to run in a very short time. The ACIM library also eliminates the need for time-
consuming development of low-level drive and speed regulation algorithms by providing
ready-to-use functions that allow the user to concentrate on the application layer.
A prerequisite for using this library is basic knowledge of C programming, AC motor drives
and power inverter hardware. In-depth know-how of STM8S functions is only required for
customizing existing modules and for adding new ones for a complete application
development.
www.st.com
Contents UM0712
2/85 Doc ID 15783 Rev 1
Contents
1 Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
1.1 Performance line STM8S features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
1.2 Access line STM8S features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
1.3 ACIM software library V1.0 features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
1.4 Development tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
1.4.1 Toolchains . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
1.4.2 Programming tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
1.5 Reference documents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
2 Introduction to STM8S ACIM scalar control . . . . . . . . . . . . . . . . . . . . . 14
2.1 Introduction to ACIM theory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
2.2 ACIM steady state electrical circuit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
2.3 Electromagnetic torque characteristic curve . . . . . . . . . . . . . . . . . . . . . . 17
2.4 Speed closed loop control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
2.4.1 V/f control and slip regulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
2.4.2 Maximum torque per ampere (MTPA) control . . . . . . . . . . . . . . . . . . . . 22
2.5 Speed open loop control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
2.5.1 Load compensation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
2.6 Startup strategy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
2.7 Three-phase PWM sine wave and third harmonic generation . . . . . . . . . 28
2.8 Bus voltage ripple cancellation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
3 Running the demonstration program . . . . . . . . . . . . . . . . . . . . . . . . . . 31
3.1 ACIM user interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
3.2 Getting started with the ACIM user interface . . . . . . . . . . . . . . . . . . . . . . 32
3.2.1 Welcome message . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
3.2.2 Help menus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
3.2.3 Main menu: Changing the target and measured rotor speed . . . . . . . . 33
3.3 Using the ACIM user interface sub-menus for motor control . . . . . . . . . . 34
3.3.1 ACIM user interface sub-menus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
3.3.2 Speed regulator parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
3.3.3 Drive strategy parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
3.3.4 Startup parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36