The Automotive Math and Motor Control
Library (AMMCLib) set is a collection of
production-ready and easy-to-use software
libraries for rapid development of motor control
and other real-time embedded systems.
OVERVIEW
The AMMCLib set provides essential building blocks for
rapid development of automotive embedded applications
with high-performance arithmetic, trigonometric, and digital
signal processing math functions.
A significant portion of the library supports both sensor-
based and sensorless motor control application strategies,
while advanced motor control functions expand the speed
range of a permanent magnet synchronous motor (PMSM)
and allow on-the-fly startup of a sensorless control loop.
KEY BENEFITS
Enables rapid development of a wide range of sensor-
based and sensorless motor control applications
Goes beyond standard motor control—on-the-fly startup,
seamless PMSM field weakening
Saves development cost and time—years of research and
expert knowledge packed in one off-the-shelf, easy-to-use
software package
Offers long-term support of new and old MCUs—new
features regularly released for all supported platforms and
an active NXP community forum
Supports many NXP automotive MCU families, easy
migration between platforms
Provides common interface and CPU-specific internal
optimizations for maximum performance: SPE, LSP, Arm
®
Neon™, Arm DSP for Cortex
®
-M
Offers detailed user documentation providing usage
guide and code examples
Supported by application notes, motor control
development kits, tuning and debugging tools, and free
and premium compilers
AMMCLIB FEATURES
L
ayered architecture supporting fixed-point fractional 16-/32-bit
and single-precision floating-point arithmetic
Production-ready, pre-compiled o
bject code, and source code
variants
Developed according to SPICE Level 3, ISO 9001/TS 16949
Quality packs available for inclusion into automotive
processes
Supports free and premium compilers
Independent of target platform peripherals
MATLAB
®
Simulink
®
models for all functions
Model-based code generation w/ Simulink Embedded Coder
®
Integrates with NXP tools:
- S32 Design Studio (S32DS)
- Model-Based Design Toolbox (MBDT)
- Motor Control Application Tuning (MCAT) tool
AUTOMOTIVE MATH AND MOTOR
CONTROL LIBRARY (AMMCLib) SET
FACT SHEET
AMMCLib
www.nxp.com 2
GENERAL MOTOR CONTROL
FUNCTIONS (GMCLIB)
2D vector coordinate transforms,
scale, and rotation
Beta projection
Clark transformation
DQ decoupling for PMSM motors
Duty cycle calculation
Elimination of DC ripples
Park transformation
PWM spectrum spreading
6-phase space vector modulation
6-phase Clarke/Park transforms
Single shunt current
reconstruction
GENERAL TRIGONOMETRIC AND
CONTROLLER FUNCTIONS (GFLIB)
ADVANCED MOTOR CONTROL
FUNCTIONS (AMCLIB)
Cholesky decomposition + line
ar
solver
Dot product
Element-wise vector selector
Fast Fourier transform (FFT)
Generalized matrix/vector multiply-
accumulate
Linear Kalman filter
Radial basis function interpolation
Third-octave filter bank
Vector copy
Vector windowing
GENERAL DIGITAL FILTERS
FUNCTIONS (GDFLIB)
Base-10 logarithm: scalar + vector
Hysteresis function
Limitation functions
Linear interpolation
PI/PID controllers
Sign function
Signal integration function
Signal ramp function
Trigonometric functions
Vector minimum
ADVANCED DIGITAL FILTERS
FUNCTIONS (ADFLIB)
Exponential moving average filter
Finite impulse filter
First order infinite impulse filter
Second order infinite impulse filter
S
ATURATED ARITHMETIC AND
B
I
TWISE FUNCTIONS (MLIB)
2D dot product
Absolute value
Bitwise shifts
Fixed-point normalization
Format conversions
Fused multiply-add/subtract
Rounding
Saturated and modulo arithmetic
Vector scale
+
-
+
-
GMCLIB
GFLIB GDFLIB
General Motor Control Library
Advanced Motor Control Library
• Park/Clark transformation
• Inverse Park/Clark
• Space vector modulation
• DC bus ripple elimination
• PMSM decoupling
• BackEMF observer
• Tracking observer
Advanced Digital
Filter Library
• Vector/Matrix multiplication
• Kalman filter
• FFT
• Linear system solver
• Cholesky decomposition
• RBF interpolation
General Function Library
General Digital Filters Library
Sine, cosine, tangent
Inverse sine, cosine, tangent
Hysteresis
LUT, ramp, limitations
First, second order IIR filter
MLIB
Mathematical Library
Absolute value
Addition, subtraction
Multiplication, division
Right/Left shift
Type conversion
|X||X>>N|
F32toFloat (a*b)+(c*d)
AMCLIB ADFLIB
P
I
P
I
D
dt
AUTOMOTIVE MATH AND MOTOR CONTROL LIBRARY SET
AMMCLib HIERARCHY
BEMF observer
Tracking observer
FOC current
loop controllers
FOC speed loop controllers with
PMSM field weakening
Active windmilling:
PMSM speed/position detection
PMSM electrical parameters
estimator