TI Motor Control Solutions
2011 August
Why C2000 for Motor Control• References
– Quick to Spin
– TI Control + Drive + Analog
– High Performance Features
– Connectivity (USB & ENET)
• Software
– Libraries
• Motor & Safety
– IQMath
– Real-Time Debug
– FREE, MCU Common IDE
– GUI – easy out of box
– Best Abstraction & Simulation Support
• Portfolio of Silicon
– <$1 to Highest Performance, 32-bit engines, premium analog and PWM
3
TI Motor Solutions
common motor SW
commondriveBOARDs
commoncontrolCARDs
commonGUI
commonabstraction
DeveloperNetwork
Training
Motor DIN Support
Analog, Isolation &
Power
Agenda
• Hardware
• Software
• Key MCUs & Peripherals
Low Voltage (24-36V) PMSM + PFC
2012-4-25
No external emulator required!
TMDS2MTRPFCKIT(2 motors)TMDS1MTRPFCKIT(1 motor)
Piccolo F28035 controlCARD
Sensorless FOC
Single or Dual Axis Operation
Integrated Digital Power Factor Correction
Hardware Features
100W 2 phase interleaved power factor correction stage
2 x 60 W motor driver stages based on TI DRV8402 IMD
On board isolated XDS100 JTAG emulation
Software Lab Projects
Dual Axis in controlSUITE
Motor Control Workshop + Self Paced Lab in controlSUITE
Motor + PFC solutions in non-controlSUITE CCSv3.3 format
$399 Motor Control and PFC Kit
DRV8402 is NRND
will Rev in Q3 with
DRV83x2
• DRV8402 3-Phase IMD• 24-36V and 3A continuous• Includes Piccolo F28035 in controlCARD slot• controlSUITE SW and GUI• Sensorless FOC of 1 or 2 axis• 50KHz Digital PFC• BOM, Schematic, Gerbers• CCStudio MCU IDE
PMSM Low Voltage Gen 1
TMDS2MTRPFCKIT $399TMDS1MTRPFCKIT $369
• DRV8412/32 2x H-Bridge IPM • 50V and 6A continuous• Includes ISOLATED PiccoloF28035 in controlCARD slot• controlSUITE SW and GUI for 2x Brushed DC and Stepper• Current, Speed, 1/256 microsteps• BOM, Schematics, Gerbers• CCStudio MCU development environment
DRV8412-C2-KIT - $259DRV8412-C2-KIT $299
Brushed / Stepper
• DRV8301 or 02 3-Phase IPD • 8-60V and 60A continuous• Includes ISOLATED PiccoloF28035 in controlCARD slot• controlSUITE SW and GUI• InstaSPIN-BLDC• Sensorless FOC• Isolated CAN, SPI, UART• BOM, Schematics, Gerbers• CCStudio MCU IDE• SPIN YOUR MOTOR
DRV8412-C2-KIT - $259
• DRV8312 3-Phase IMD• 8-50V and 3.5A continuous• Includes ISOLATED PiccoloF28035 in controlCARD slot• controlSUITE SW and GUI• Sensored/Less BLDC• InstaSPIN-BLDC•Sensorless FOC• Isolated CAN, SPI, UART• BOM, Schematic, Gerbers• CCStudio MCU IDE• SPIN YOUR MOTOR
DRV8312-C2-KIT - $259
BLDCPMAC
MCU controlCARD
Modular DMCLib
GUI
DRV8301-HC-C2-KITDRV8302-HC-C2-KIT
$299 (9/1 RTM)
DRV8312-C2-KIT $299
BLDC/PMSM Low Voltage Gen 2 3-phase InverterBLDC & PMSM
3-phase InverterBLDC & PMSM
High Voltage (350V) BLDC, PMSM, ACI + PFC
• controlCARDs included: Piccolo & Delfino
• High voltage PFC and single axis motor control
board
• 1.5KW, 350V, 20A three phase motor driver stage
• 750W 110-220 Vac PFC stage
• Can control most common motor types
• ACI, PMAC, and BLDC
• Motors available directly from TI
• Isolated CAN and UART interfaces
• CCS V4, GUI
• Onboard isolated XDS100 USB JTAG emulation
Hardware
Fully controlSUITE compatible
Sensor/Less FOC for ACI, PMAC
Piccolo & Delfino
Sensored V/f for ACI
Sensor/Less Trapezoidal for BLDC
Sensorless FOC for ACI + PFC on CLA
Software
No external emulator required!
Price: $599Part number: TMDSHVMTRPFCKIT
Hardware
Software
• Why?– Fixed point is actually more precise in a given range
– Floating point is MUCH easier to deal with
• Library and Compiler Intrinsic– Move your decimal point to where you need it
– Write in floating point, compiler does all the work
• Start-up, tuning, and debug effort are reduced– Change numerical range on the fly, global or local
– Tune for best resolution and dynamic range
– Remove quantization, scaling and saturation burden
– Better integration with simulation and code gen tools
– Single source set to move between fixed and floating point processors (C2000 today, M3 M4F soon!)
– Easy re-use and re-tuning for new systems
IQMath
GLOBAL_Q Max Val Min Val Resolution
28 7.999 999 996 -8.000 000 000 0.000 000 004
24 127.999 999 94 -128.000 000 00 0.000 000 06
20 2047.999 999 -2048.000 000 0.000 001
#define GLOBAL_Q 24 // set in “IQmathLib.h” file
_iq Y, M, X, B;
Y = _IQmpy(M,X) + B; // all values are in I8Q24
The user selects a “Global Q” value for the entire application:
Based On The Required Dynamic Range Or Resolution
The user can also explicitly specify the IQ value to use:
_iq20 Y, M, X, B;
Y = _IQ20mpy(M,X) + B; // all values are in I12Q20
IQMath: Choose your decimalRange or Resolution?
S I I I I I I I I I I I I I I I I . Q Q Q Q Q Q Q Q Q Q Q Q Q Q Q (Q15)
31 0
IDE CCStudio v4FREE with C2000/430 XDS100 Emulators or 32KB Version
Eclipse IDE
Resources:
Real-Time Mode on wiki
Chapter 7.4 in the C28x CPU Reference Guide
Traditional debugging (Stop Mode)
– stops all threads and prevents interrupts from being handled
– makes debugging real-time systems extremely difficult
C2000 Real-time Mode:
- real-time, non-intrusive, continuous
- Does not require use of target memory, special interrupts, or SW intrusiveness
- Allows time critical interrupts to be marked for special treatment (high priority)
- Allows time-critical interrupts to be serviced while background program execution is suspended
- Included on all C2000 devices and integrated with Code Composer Studio
Real-time Debug
controlSUITE motor_lib
Motor Control
Peripheral Blocks
- SVPWM Gen
- BLDC PWM
- PWM Full Compare
- HALL CAP
- HALL GPIO
- QEP
- ADC Conversions
- PWM DAC
- Data Log
• C SOURCE Provided for all
• Modular structures or macros with variable inputs and variable outputs
• At initialization all variables are defined and outputs of one block are set as inputs to the next
• At run-time the structures or macro functions are called
• Complete documentation – including equations and theory – is provided for every module
Ex: Using “Park” from DMC Library
//initialization code, define macro per library#define PARK_MACRO(v)\v.Ds = _IQmpy(v.Alpha,v.Cosine) + _IQmpy(v.Beta,v.Sine);\v.Qs = _IQmpy(v.Beta,v.Cosine) - _IQmpy(v.Alpha,v.Sine);
//incremental build code, connect outputs and inputspark1.Alpha = clarke1.Alpha;park1.Beta = clarke1.Beta;
//run-time code, call the functionPARK_MACRO(park1)
Control Blocks
- PID
- Speed Estimators
- Speed Freq/Period
- Clarke / iClarke
- Park / iPark
- Commutation Trig
- Impulse
- Mod6 Counter
- Phase Voltage Calc
- Ramp Controllers
- Sin/Cos Table Calls
- Sliding Mode Observer
- ACI Flux/Speed
Estimators
- CLA Versions in works
You will see Stellaris support later this year
Metatools
Visual Solutions
VisSimwww.vissim.com/c2000
(C2000 & 430, Stellaris soon)
The Mathworks
Embedded Targetwww.mathworks.com/products/tic2000
(C2000, working on 570)
-DMC and Peripheral Blocks
-Simulation and Modeling
-Auto-Tuning
-Code Generation
-Interface to CCStudio IDE
-Works with controlKITs
Development NetworkAbstraction, Rapid Prototyping, Simulation, Graphical Development & Auto Code Gen
Multiple Local Consultants & Design Houses
Telephone: +47 73512852
crosshairsembedded.com
Interface Designer v1.5• Provides specialized interfaces for visualizing system parameters.
• Infinite design possibilities allow the closest match for your
system.
• High definition, scalable graphics for easy assimilation and
user interaction.
• Operates in real-time.
• Seamless remote, non-intrusive operation.
• Streamlined deployment and one-click re-use of interfaces.
• Branded interfaces for highly effective sales and marketing
customer relationships.
• Powerful, feature-rich and competitively adaptable.
• Supports C2000/MSP430/C6000. (Stellaris/570 in works)
Telephone: +47 73512852
crosshairsembedded.com
Embedded Real-Time Functional Debugger v2.0• Embedded real time functional debugger.
• Covers program development, maintenance,
testing and verification.
• Remote testing and monitoring from multiple
locations, simultaneously.
• Non-intrusive testing while embedded systems
are still running.
• Highly reliable even in electronically noisy
environments.
• Internal flash programming.
• Real-time on-chip data-logger with
configurable triggers.
• Variables are automatically extracted from
your embedded target applications.
• Advanced memory inspection functionality.
• Supports multiple concurrent connections
via any port or interface.
• Configurable alarms with SMS/e-mail delivery.
• Supports C2000/MSP430/C6000.
• Working on Stellaris/570
C2000 32-bit Real-time MCU
Perf
orm
an
ce &
Mem
ory
100+ Code Compatible Devices
Fixed Pt
Low Cost
DelfinoTM
(176-256 Pins)
$9 - $16
Fixed Pt w/
Co-Processor
Options
Floating Pt
Performance
C2834x F2833x
Upto 600 MFLOPS
196-516kB SRAM
External ADC
Low Active Power
Upto 300 MFLOPS
128-512kB Flash
52-68kB SRAM
F2803x
60MHz – CLA Optional,
64-128kB Flash,
20KB RAM
40
100
150
300
MIPS
60
80
All Pricing is to be considered budgetary and subject to change . Pricing is 1KU SRP -40 to 105C
Production
Sampling Future
Development
F2801x
F280x
F281x
F2823x
F2802x
F2833x
C2834x CAN
CAN
NEXT
Performance
Connectivity
Safety Enhancements
Next
F2802x Next
40-60MHz,
32-64kB Flash,
6-12KB RAM
Low Power
Small Packaging
More AnalogNext
Connectivity
TI Confidential NDA Restrictions
Floating Pt
Low Cost
Piccolo™(38-144 Pins)
$<2 - $8
Sampling!
F2806x USB Host
CAN
F2803x CAN
F2806x
80MHz FPU – CLA and VCU Optional
128 – 256 kB Flash,
100 kB RAM,
USB Host/Device, DMA, McBSP
C2000 Public Roadmap
Unique combination of performance and integration for real-time control
45+ configurations
bring a wide range of
performance, package,
and memory
Best mix of control peripherals Robust software libraries Code compatibility across C2000 platform ranging from 40MHz to
300MHz Increased on-chip analog integration
Serial Interfaces
Memory
16 - 256 KB
Flash
Debug
Real-Time JTAG
6-100 KB RAM
Boot ROM
Power & Clocking
• Dual Osc 10 MHz
• On-Chip Osc
• Dynamic PLL Ratio
Changes
• POR
• BOR
16 ch, 2SH, 12-bit, 5 MSPS ADC
ADC
2x SPI, 1x McBSP
1x I2C
2x SCI
1x CAN
3x Comparator
Missing Clock Detection Circuitry
128-Bit Security Key/Lock
C28x 32-bit CPU80MHz
32 x 32 bit MultiplierRMW Atomic ALU
Peripherals Timer Modules
3x 32-bit CPU Timers
Watchdog Timer
2 x 32-bit eQEP
3 x 32-bit eCAP
8x ePWM Modules:
(8x 150ps high-res)
16x PWM outputs
DMA-6CH
FPU
CLA
USB 2.0 FS
High-Performance
C28x™ CPU
• Up to 80-MHz
performance
• Single-cycle 32-bit MAC
• Fast interrupt response
and minimal latency
• Floating-Point on F2806x
VCU• Complex Math Unit: 3x
faster FFT Butterfly
• Viterbi Unit: Up to 7.5x
faster Viterbi operations
• CRC Unit: 2x faster than
software implementation
Enhanced Architecture
• High accuracy on-chip
oscillators (10 MHz)
• Single 3.3-V supply with
BOR/POR supervision
• 6-ch Direct Memory Access
Intelligent Peripherals• 150ps resolution on PWM
frequency and duty cycle
• 12-bit radio-metric ADC with
individual channel triggers
• Up to 3x analog comparators
with 10-bit reference
• New High Resolution Capture
• Enhanced CAN bus unit, USB
2.0 with Host
Control Law Accelerator
• 32-bit floating-point math
accelerator
• Operates independent of
C28x CPU
• Up to 5x performance
boost
4 x HRCAP
VCU
$1 - $8
38 pin – 100 pin
16 – 256 KB FlashPiccolo
12-bit Pipeline/SAR Hybrid ADC
Start of Conversion (SOC) Configuration and Logic Block
Dual Sample and Hold
12-bit Analog-Digital Converter
Result Registers
• 16 SOC triggers from Software, CPU timers, ePWMs, and GPIOs
• Allows easy creation of conversion sequences
• Multiple conversions processed in Round Robin or Priority Modes
• 9 flexible interrupts
• Dual sample/hold enable simultaneous sampling or sequencing sampling modes
• Adjustable acquisition window ensures proper sampling
• Fast conversion rate: Up to 5MSPS
• Just-in-time interrupts (early interrupts) eliminates context switch latency by calling interrupts before conversion finishes
• Sixteen result registers (individually addressable) to store conversion values
Analog Mux• Uses SOC input to select which channels will be processed
Up to 16 Analog Inputs• 16 channel, multiplexed analog inputs.
• Supports both 0-3.3V fixed range and ratio-metric input range
8 ADC Inputs
Sample/HoldA
12-bitADC Module
8 ADC Inputs
SOC
Co
nfigu
ration
s and
Logic
Sample/HoldB
Analog MUX Analog MUX
Start of Conversion
Piccolo’s hybrid ADC allows even more flexible creation of conversion sequences.
Result Register16 Words
Time-Base
TripZone
EventTrigger& Interrupt
EPWMxA
EPWMxB
System Input*
ADC Triggers
PIE
Action Qualifier
Counter Comparator
PWM Chopper
Dead-Band Generator
Dedicated 16-bit Time Base• Uses pre-scaled CPU system clock; Registers are shadowed
• Up, Up-Down, Down-Up; Events: Zero, Period
Counter Comparator (CC)
Programmable Dead-Band Generator
PWM Chopper
Programmable Trip Zone Generator
• Registers and comparators eliminate the need to interrupt the CPU in PWM generation
• Events: CMPA (rising & falling), CMPB (rising & falling)
• Programmable rising-edge and falling-edge delay
• Allows a high-frequency carrier signal to modulate PWM waveforms
• Programmable chopping frequency, duty cycle, first pulse width
• Quickly overrides PWM signals to Hi, Low, or Hi-Z
• One-shot or cycle-by-cycle (current limiting) operation
• Can generate events, filtered events, or trip conditions
Action Qualifier• At any Event: Set PWMxA/B (High, Low, Toggle, Do Nothing); Trigger a programmable Event or Interrupt
Each ePWM module has two outputs, EPWMxA and EPWMxB (same frequency, independent duty)Each module is independent frequency, but can be synched or phase delayed
Enhanced PWM
22
VSSA
Comparators
DAC
COMPx
Sync/Qual
EPWM module, GPIO Mux,
PIE
Analog Comparator
Sync/Qualification
EPWM and GPIO Mux Outputs
• True analog voltage comparator in VDDA domain
• 30ns response time to PWM Trip Zone
• Comparator output can be passed directly or synchronized with the system clock
• Qualification logic can delay output for multiple clock cycles
• Output can be routed to ePWM Trip Zone Module as well as GPIO output
10-bit DAC
• Analog DAC can provide input to comparator
Analog Comparators on Piccolo devices bring instant protection
Input Pin A
Input Pin B
VDDA
+
-
COMPACOMPB
External
Trip LogicSelect Trip EventPWMAPWMB
PWM Action
1. Trip A/B Output2. Generate CPU Interrupt3. Start of Conversion4. PWM Sync.
Comparator 1-3
• Trip Zones operate even if the clocks go missing!• Each trip pin/event can map to any combination of PWM outputs, Interrupt,
SOC, or PWM Synchronization • Trip event can be synchronous or asynchronous• User can block trip action for a given offset and window after start of PWM
period• Automatically records counter value in case of trip • One Shot (Fault) or Continuous (Cycle By Cycle Control)
PWM Trip Zones
GPIO/XCLKIN
CLKIN SYSCLK
WDCLK
Device ResetOr Interrupt
CPU
CPU Timer 2
CPU Timer 0
CPU Timer 1
Watchdog
InternalOscillator 2
10MHz
OSC2CLK
ExternalOscillator5-20MHz
X1
X2
EXTCLKCPUTMR2CLK
PLLx1x2x3..
x10
NMI Watchdog
CLKFAILClockFail
Detect
GPIO/XCLKOUT
/1/2/4
Oscillator Accuracy~3% (85C to 125C)
Can be compensated over temperature to improve and enable
CAN off of OSC only!
InternalOscillator 1
10MHz
OSC1CLK
/1/2/4/8
/16
/1/2/4
Piccolo’s clocking system provides two zero-pin on-chip oscillators to eliminate the need for external clock circuitry. The high accuracy, high speed internal clocks are also a part of an extensive clock protection system
Lower System Cost
• No external clock circuitry or crystal required
• Includes secondary internal oscillator for backup or alternate clock source
Increased System Reliability
• Back-up internal oscillator automatically triggered in case of error
• Configurable clock sources allows independent CPU, CPU Timer 2 and Watchdog clocks
• Watchdog support standards such as IEC-60730
• Automatic PWM trip in case of clock failure
• If clock failure is detected, CLKIN and WDCLK automatically switches to backup oscillator
• Two internal high-speed oscillators
• If both internal clocks fail, PLL clock automatically goes into “limp mode” to facilitate shut-down procedures. (5 MHz only)
3-tier Clock Protection
Clocking System
Lower System Cost / Increased System Reliability
Piccolo Analog Integration
• On-Chip Voltage Regulation– On-chip regulator eliminates
requirement for external 1.8V rail
– BOR/POR protection eliminates requirement for external supervisor
– Eliminates start-up glitches on PWM outputs
• Dual On-Chip Oscillators– No external clock circuitry required
– Independent time bases for main CPU and Watchdog for IEC-60730
– Auto PWM Trip on Fail
– Temperature Compensation
• Analog Comparators– Trip PWM Outputs, Generate Interrupts,
Sync PWM Outputs, Generate ADC SOC, Route to GPIO Pins
• Analog-to-Digital Converter– Continuous sampling up to 5
MSPS– Ratio metric across full 3.3V
input range– No support pins
• High Resolution PWM– High Resolution Duty Cycle
Modulation with 150ps Steps
– High Resolution Frequency Modulation with 150ps Steps
• GPIO Input Digital Filters– Removes Noise
– No external filters saves cost
Utilities
controlSUITE:Content + Content Management
C2000 Device
Piccolo F2802x
Piccolo F2803x
Delfino C2834x
Delfino F2833x
Device Support
Bit Fields
API Drivers
Examples
Library Repository
Math
IQMath
DSP
APPS
Development Kits
Hardware
Software
System Framework
Graphical User
Interfaces
Debug and Software Tools
IDE
RTOS
Real-time Debug
F2823x
3rd Party Tools
Kits
Docs
Quickstart Guide 8 pages- Quick HW
- Quick Sys
- GUI
- Next Steps
Hardware Guide 14 pages- Everything about the HW
How To Run 15 pages- Getting Started
- Out of Box
- HW connections
- CCStudio Set-Up
Systems 20-60 pages- Motor, control, theory background
- System Overview, Memory & CPU Usage
- Peripheral to HW Map
- Software Flowchart
- Hardware Set-Up
- Running the Software
-Step-by-step incremental build with screen
shots, verification, explanations, and tuning
procedures
“C2000 Motor Control Primer”
Google: sprugi6
GUIImage already in
Piccolo Flash
GUI Source Provided
Drag and drop from
Memory Map
Low Cost License
from Crosshairs
QSG 8 pages
- Quick HW
- Quick Sys
- GUI
- Next Steps
Hardware Developer’s Package
Hardware Developer’s Package includes:
• Bill of Materials
• PCB layout
• Schematics
• Gerbers
We provide you with all the necessary files to recreate the hardware. The PCB layout and
schematics are broken up into modules that can be interconnected or implanted into a new design.
controlCARDs and controlKITs
1A) verify 120° SV-PWM outputs
1B) verify PWM-DACs used for analysis
1C) Verify SV-PWM Gen PWM Outputs / Inverter Inputs
Incremental Build
Incremental Build
2A) Check ADC calc of Voltage using watch window (WW)
2B) Check Clarke (Phase Currents) in WW
2C) Calibrate phase current off-set to enable low load sensorless
Incremental Build
3A) Tune current PIDs (Id, Iq)
3B) Verify QEP speed value in WW
Incremental Build
4) Tune SMO and Speed Estimator to Measured
Incremental Build
5A) Tune Speed PID loop
Incremental Build
5B) Alternative: Tune Speed PID loop w/o SMO
Incremental Build
6) Close all loops – Full Sensorless FOC CL Speed/Current
controlSUITE DMC Benchmarks
* Modules run as Macros
** Not including the Optional Early Build Level Modules
*** FOC Benchmarks at 10 KHz control loop, BLDC at 20 KHz
Dual Axis FOC + PFC Benchmarks (10 KHz + 50 KHz)
MCU Mapping - Single Inverter
3 phase Inverter topology suitable for:• ACI• PMSM• BLDC
1B
1A
2B
2A
V-dcBus
3B
3A
DC
Link
IL-2IL-1
IPH-1 IPH-2
AC
Motor
(optional)
VA VB VC
PWM1
Piccolo-A
ADC
12 bit
3.75 MSPS
I2C
SPI
UART
Comms
CPU
32 bit
DSP core
40 MHz
Vref
1A
PWM4
1B
PWM22A
2B
4A
4B
3V3
PWM33A
3B
V-dcBus
IL-1
IL-2
VA
VB
VC
Dual Inverter + PFC Boost
1B
1A
2B
2A
V-dcBus
3B
3A
IL-2IL-1
IPH-1 IPH-2
Motor 1
(optional)
4A
4B
V-batt
I-boost
I-boost1 I-boost2
DC link
V-dcBus
5B
5A
6B
6A
V-dcBus
7B
7A
IL-2IL-1
IPH-1 IPH-2
Motor 2
Piccolo-B
3V3
PWM1(HR)
ADC
12 bit
5 MSPS
I2C
SPI
UART
CAN
Comms
CPU
32 bit
DSP core
60 MHz
MCLA32 bit
FPU
60 MHz
PWM2(HR)
PWM3(HR)
PWM4(HR)
PWM5(HR)
1A/1B
2A/2B
3A/3B
4A/4B
5A/5B
Vref
6A/6B
7A/7B
PWM6
PWM7
V-dcBus
IL-1(1)
IL-2(1)
V-batt
I-boost1
I-boost2
I-boost
IL-1(2)
IL-2(2)
Benchmarks for Motors & PFCon 60 MIPS Piccolo
Piccolo
F2803x
Piccolo
F2802x or
F2803x
PFC or FOC can be done on 28x CPU or CLA
FOC Sensorless SMO 10KHz 16 MIPS 28x
FOC Sensorless FA3ST 10KHz 30 MIPS 28x
PFC 50KHz 12 MIPS 28x
PFC 100KHz 22 MIPS CLA
2x FOC SMO + PFC(50KHz) 44 MIPS 28x
PFC
Piccolo
F2803x
PFC
Top Related