Spansion Math and Motor Control Library Introduction

Math and Motor Control Library
2014-09-04
1
© 2013 Spansion Inc.
Contents
Overview
 Features
 Structure
Details
 Component Library
− Universal math operation library – UMOLIB
 Module Library
− Universal math function library – UMFLIB
− Basic function library – BFLIB
− Universal digital filter library - UDFLIB
− Basic motor control library – BMCLIB
 Function Library
− Advanced Motor Control Library - AMCLIB
Demo brief
 Hardware
 Diagram
2
© 2013 Spansion Inc.
Overview
3
© 2013 Spansion Inc.
Overview
 Library Features
− Layered architecture
− Assembly code to do works which C language cannot do
− Some functions are written in assembly language and offer a C language
interface
− Offer complete components to make a motor control system
− IAR EWARM is required
− Support full range of FM3 MCU
− Independent of the hardware platform
− Data format: fixed point
− A demo is shown as example which is to drive a low voltage BLDC motor
4
© 2013 Spansion Inc.
Overview
 Structure
− Motor control library is specially designed for the application of motor control.
It includes several sub-libraries. Some basic components are put in the lower
layers, and some advanced modules are put in the higher layers (shown in
below figure). All the functions in low and high layers can be called by users
to build your own motor control system.
BMCLIB
UMFLIB
AMCLIB
BFLIB
UMOLIB
5
© 2013 Spansion Inc.
High layer Function Library
UDFLIB
Middle layer –
Module Library
Low layer –
Component Library
Details
6
© 2013 Spansion Inc.
UMOLIB Feature
Component Library
 Universal math operation library - UMOLIB
− Including the following operations
 Addition, subtraction, multiplication, division
 Absolute value, opposite value, rounding value, reciprocal value
 Logic shift, rotational shift
 Qn format transformation
− Do the operations that cannot done by C language
 Saturation operation
 Logic and rotational shift
7
© 2013 Spansion Inc.
UMFLIB Feature
Module Library
 Universal math function library - UMFLIB
− Including the following operations
 Sine, cosine, tangent
 Arc-sine, arc-cosine, arc-tangent
 Square root, linear interpolation, sign
8
© 2013 Spansion Inc.
BFLIB Feature
Module Library
 Basic function library - BFLIB
− Including the following operations
 Limit value to a given scope
 Ramp output
 Hysteresis function
 Integration
− Saturation is applied in the following function
 Integration
9
© 2013 Spansion Inc.
UDFLIB Feature
Module Library
 Universal digital filter library - UDFLIB
− Including the following operations
 Average filter
 Sliding average filter
 Fast 1-order filter
10
© 2013 Spansion Inc.
BMCLIB Feature
Module Library
 Basic motor control library - BMCLIB
− Including the following operations
 Clark, Park, inverse Clark, inverse Park transformation
 PID regulator
 SVPWM initialization and calculation
 Over-SVPWM initialization and calculation
11
© 2013 Spansion Inc.
AMCLIB Feature
Function Library
 Advanced Motor Control Library - AMCLIB
− Including the following operations
 Calculating delta angle by encoder
 Detecting hall position by look-up
 Detecting hall position and calculating rotor speed by interrupt
 Sensor-less estimator
12
© 2013 Spansion Inc.
Demo Brief
13
© 2013 Spansion Inc.
Demo Hardware Feature
Hardware
 The demo hardware is composed of the following parts:
− Bottom control board
 24V dc-bus voltage input
 Three-phase full-bridge inverter with discrete component
 Sampling by three shunts
 One three-phase motor driving socket
 One hall sensor socket
 One encoder socket
 One MCU control board socket
− MCU control board
 One bottom control board socket
 One system reset key
14
© 2013 Spansion Inc.
Demo Hardware Feature
Hardware
 One tunable resistor
 Two serial communication sockets
Bottom control board
 One 20-pin J-Link socket
 One 6-pin SPI socket
− BLDC motor (24V)
15
© 2013 Spansion Inc.
MCU control board
Demo Software Block Diagram
Diagram
Firmware
Basic
Protect
Motor
Startup
BMC_Pid
ωref
PI
BMC_ParkInvTrans
BMC_Pid
Iqref
PI
Vq
Idref
PI
Vα
d,q
Park-1
BMC_Pid
0
Hardware
Vd
α,β
BMC_SvmCalc
Ovm_Calc
Over-PWM
SVPWM
Vβ
3-Phase
Bridge
Field
weaken
Iq
Isα
d,q
α,β
BMC_ClarkeTrans
θestim
Sensor-less Observer
ωmR
Hall Capture
QPRC
Rotor Position and Speed
MMCL Block
Other Block
16
© 2013 Spansion Inc.
Ia
A
B
Clarke
Park
Id
α,β
Isβ
Ib
a,b,c
BMC_ParkTrans
Isβ
Isα
Vαr
Vβr
M
Hall or QPRC signal
C
www.spansion.com
Spansion®, the Spansion logo, MirrorBit®, MirrorBit® Eclipse™ and combinations thereof are trademarks and registered
trademarks of Spansion LLC in the United States and other countries. Other names used are for informational purposes
only and may be trademarks of their respective owners.
This document is for informational purposes only and subject to change without notice. Spansion does not represent that
it is complete, accurate or up-to-date; it is provided “AS IS.” To the maximum extent permitted by law, Spansion disclaims
any liability for loss or damages arising from use of or reliance on this document.
17
© 2013 Spansion Inc.