3-156F8000 Motor Control Daughter Card and 56F8013 Demonstration Board . . . . . . . . 3-1
Freescale Semiconductoriii
Preliminary
List of Figures, Rev. 1
Page 6
iv Freescale Semiconductor
3-Phase BLDC Motor Control, Rev. 1
Preliminary
Page 7
About This Book
This manual describes the applications for 3-Phase BLDC motor control with Hall sensors using
the 56F8013 device.
Audience
This document targets software developers using 3-Phase BLDC motor control for the 56F8013
processor.
Organization
•Chapter 1, Introduction—provides a brief overview of this document
•Chapter 2, System Description—describes the theory of BLDC motor control with Hall
sensors for the 56F8013 processor
•Chapter 3, Setting Up the Application—explains how to set up the application
•Chapter 4, Running the Application—describes how the BLDC with Hall Sensor
application operates
Suggested Reading
We recommend that you have a copy of the following references:
•56F8013 Technical Data, MC56F8013
•56F8013 Motor Control Demonstration System using the 56F8013 Demonstration Board User Guide, 56F8013MCSUG
•3-Phase BLDC Motor Control with Hall Sensors using 56800/E Digital Signal Controllers,
AN1916
•56F8000 Peripheral Reference Manual, MC56F8000RM
•Inside CodeWarrior: Core Tools, Metrowerks Corp.
Preface, Rev. 1
Freescale Semiconductorv
Preliminary
Page 8
Conventions
This document uses the following notational conventions:
Typeface,
Symbol or Term
Courier
Monospaced
Type
ItalicDirectory names,
Code examples//Process command for line flash
project names,
calls,
functions,
statements,
procedures,
routines,
arguments,
file names,
applications,
variables,
directives,
code snippets
in text
BoldReference sources,
paths,
emphasis
MeaningExamples
...and contains these core directories:
applications contains applications software...
...CodeWarrior project, 3des.mcp is...
...the pConfig argument....
...defined in the C header file, aec.h....
...refer to the Targeting DSP56F80x Platform
manual....
...see: C:\Program Files\Motorola\help\tutorials
Blue TextLinkable on-line...refer to Chapter 7, License....
NumberAny number is consid-
ered a positive value,
unless preceded by a
3V
-10
DES
-1
minus symbol to signify
a negative value
ALL CAPITAL
LETTERS
# defines/
defined constants
# define INCLUDE_STACK_CHECK
Brackets [...]Function keys...by pressing function key [F7]
Quotation
Returned messages...the message, “Test Passed” is displayed....
marks, “...”
...if unsuccessful for any reason, it will return
“NULL”...
vi Freescale Semiconductor
3-Phase BLDC Motor Control, Rev. 1
Preliminary
Page 9
Definitions, Acronyms, and Abbreviations
The following list defines the acronyms and abbreviations used in this document. As this template
develops, this list will be generated from the document. As we develop more group resources, these
acronyms will be easily defined from a common acronym dictionary. Please note that while the acronyms
are in solid caps, terms in the definition should be initial capped ONLY IF they are trademarked names or
proper nouns.
BLDCBrushless DC Motor
PIProportional-Integral
PWMPulse Width Modulation
References
The following sources were used to produce this book:
1. 56F8000 Peripheral Reference Manual, MC56F8000RM, Freescale Semiconductor, Inc.
2. 56F8013 Demonstration Board User Guide, MC56F8013DBUG, Freescale Semiconductor, Inc.
3. 56F8000 Motor Control Board User Guide, 56F8000MCBUG, Freescale Semiconductor, Inc.
4. DSP56800E Reference Manual, DSP56F800ERM, Freescale Semiconductor, Inc.
5. 56F8013 Technical Data, MC56F8013, Freescale Semiconductor, Inc.
6. 3-Phase BLDC Motor Control with Hall Sensors using 56800/E Digital Signal Controllers,
AN1916, Freescale Semiconductor, Inc.
7. 56800/E Accelerated Development System Resource Pak CD-ROM, CD342, Freescale
Semiconductor, Inc. (available from the Literature Distribution Center)
Freescale Semiconductorvii
Preliminary
Preface, Rev. 1
Page 10
viii Freescale Semiconductor
3-Phase BLDC Motor Control, Rev. 1
Preliminary
Page 11
Chapter 1
Introduction
1.1 Application Benefits
This document describes the design of a 3-phase BLDC (Brushless DC) motor control applciation
with Hall Sensors, and explains how it is targeted for Freescale’s 56F8013 dedicated motor
control device. The software design takes advantage of the Processor Expert
included with CodeWarrior.
The theoretical concepts of this application are explained in an application note 3-Phase BLDC Motor Control with Hall Sensors using 56800/E Digital Signal Controllers, found on the
Freescale Semiconductor web site:
www.freescale.com
TM
(PE) tool,
Freescale Semiconductor1-1
Preliminary
Introduction, Rev. 1
Page 12
Introduction
1-2 Freescale Semiconductor
3-Phase BLDC Motor Control, Rev. 1
Preliminary
Page 13
Chapter 2
System Description
The system is designed to drive a 3-phase BLDC motor. The application meets the following performance
specifications:
•Speed/Voltage control of BLDC motor using Hall sensors
•Torque/Current control
•Start from any motor position without rotor alignment
•DCBus undervoltage fault protection
•Real-time application monitoring via the PC master software application
The BLDC drive introduced in this manual is designed to power a low-voltage BLDC motor equipped
with Hall sensors, which is supplied with the Motor Control Daughter Card. The motor has the following
specifications:
Table 2-1. Motor Information
M1
CharacteristicTypical ValueUnits
Power Rating6W
Nominal Voltage9.0Volt
No-Load Speed8600rpm
Stall Torque20mNm
Speed / Torque Gradient479.0rpm / mNm
No-Load Current110mA
Terminal Resistance
Phase-to-Phase
Maximum Permissable Speed12000rpm
Maximum Continuous Current at 5000rpm1.03A
Maximum Continuous Torque at 5000rpm8.70mNm
Maximum Efficiency60.0%
Torque Constant9.5mNm / A
Speed Constant1007rpm / v
System Description, Rev. 1
4.50Ohm
Freescale Semiconductor2-1
Preliminary
Page 14
System Description
Table 2-1. Motor Information (Continued)
M1
CharacteristicTypical ValueUnits
Mechanical Time Constant70.0ms
Rotor Inertia13.9
Terminal Inductance
Phase-to-Phase
Thermal Resistance Housing
Ambient
Thermal Resistance
Winding-Housing
Thermal Time Constant
Windings
Thermal Time Constant
Stator
1.070mH
6.8K / W
7.4K / W
3.7s
16.1s
gcm
2
2.1 Application Description
A standard system concept is chosen for the drive; see Figure 2-2. The system incorporates the following
hardware:
•9V DC Power Supply
•56F8000 Motor Control Daughter Card (Part #APMOTOR56F8000)
•Demostration board for MC56F8013 (Part #DEMO56F8013 or DEMO56F8013-E)
The 56F8013 runs the main control algorithm and generates 3-phase PWM output signals for a 3-phase
inverter according to the user interface and feedback signals.
3-Phase BLDC Motor Control, Rev. 1
2-2 Freescale Semiconductor
Preliminary
Page 15
DEMO56F8013
DEMO56F8013
PC Remote
PC Remote
Monitoring
Monitoring
Fault
Fault
LED
LED
Speed
Speed
Control
Control
56F8013
56F8013
S
S
C
C
I
I
G
G
P
P
I
I
O
O
PI (Torque)
PI (Torque)
Controller
Controller
PI (Speed)
PI (Speed)
Controller
Controller
Ω
Ω
Duty Cycle
Duty Cycle
Ω
Ω
Act
Act
Req
Req
Commutation
Commutation
Handler
Handler
Under-Voltage
Under-Voltage
Fault Detection
Fault Detection
Speed
Speed
Calculation
Calculation
Application Description
9V DC
9V DC
PWM1-6
PWM1-6
P
P
W
W
M
M
DC Bus Voltage
DC Bus Voltage
A
A
D
D
C
C
T
T
I
I
M
M
E
E
R
R
DC Bus Current
DC Bus Current
Hall Sensors
Hall Sensors
APMOTOR56F8000
APMOTOR56F8000
Motor Control
Motor Control
Daughter Card
Daughter Card
BLDC
BLDC
motor
motor
Figure 2-2. System Concept
The control process is as follows:
The state of the user interface is periodically scanned, while the speed of the motor is measured with each
new edge from the Hall sensors; only one phase is used for speed measurement. The speed command is
calculated according to the state of the control signals. The comparison between the actual speed
command and the measured speed generates a speed error, which is input to the PI Speed controller that
acts as an input to the PI Torque controller. Together with measured current, it forces the PI Torque
controller to generate a new corrected duty cycle. The duty cycle value, together with the commutation
algorithm, creates the PWM output signals for the BLDC power stage.
The Hall sensor signals are scanned independently of speed and torque controls. Each new coming edge
of any Hall sensor signal calls the interrupt routine, which executes the commutation algorithm.
If undervoltage occurs, the PWM outputs are disabled and the fault state is displayed.
Freescale Semiconductor2-3
Preliminary
System Description, Rev. 1
Page 16
System Description
2.2 Hardware Design
This application utilizes the following HW modules:
•56F8000 Motor Control Daughter Card (Part #APMOTOR56F8000)
•Demostration board for 56F8013 (Part #DEMO56F8013 or DEMO56F8013-E)
Refer to corresponding User Manual for more information on these boards.
2.3 Software Design
This section descibes the design of software blocks.
2-4 Freescale Semiconductor
3-Phase BLDC Motor Control, Rev. 1
Preliminary
Page 17
Software Design
2.3.1 Data Flow
The control algorithm of a closed-loop BLDC drive is described in Figure 2-3. The individual processes are
described in the following sections.
DCBus
Current
ADC Conversion
Interrupt
Calculate Moving
Average
ADCAvg
Speed
Setting
via
Button
Calculate Desired
Speed
DesiredVoltageFraction
PI Speed Controller
PI Speed Controller
Calculate Actual
Speed
MeasuredVoltageFraction
Hall
Sensors
Capture Interrupt
SensorState
Mask and Swap
Calculation
DCBus
Voltage
ADC Conversion
Interrupt
Calculate Moving
Average
DCBusAvg
Overvoltage
Fault?
PI Torque
Controller
Calculate Duty
Cycle
Figure 2-3. Main Data Flow
The main data flow can be divided into five parts:
•Speed control
•Torque control
•Velocity calculation
•Rotor commutation
•DCBus voltage measurement
System Description, Rev. 1
DutyCycle
Yes
Shutdown PWM
PWM
Generation
Freescale Semiconductor2-5
Preliminary
Page 18
System Description
Speed control starts with the DesiredVoltageFraction variable, which is set by the user button. This
variable is used as one of the inputs to a Speed PI controller. The second input to the Speed PI controller
is the MeasuredVoltageFraction variable, which is derived from the Velocity Calculation algorithm.
Velocity calculation is done by counting CPU clocks between the edges on one of the Hall Sensor phases
(phase A). With a 4-pole motor, there are eight speed captures per one mechanical revolution, as shown in
Figure 2-4:
Speed
Capture
Hall Sensor
Phase A
Hall Sensor
Phase B
Hall Sensor
Phase C
Commutation
1
1
2
3
1 Electrical Rev.
2
4
3
1
5
6
4
2
3
4
5
1 Electrical Rev.
1 Mechanical Revolution
5
6
1
6
2
3
4
5
1 Electrical Rev.
7
6
1
8
2
3
4
5
1 Electrical Rev.
6
At a maximum speed of 8600rpm, each timer capture should have a count of 218, calculated as follows:
9V = 8600rpm or 143.3 revolutions per second
By performing eight speed captures per revolution, there are 1146.6 captures per second, which translates
to 872µsec per capture.
Since the capture timer is running at 250KHz or 32MHz / 128, a maximum rate of 8600 rpm will translate
to 218 timer ticks for each capture.
To find the actual voltage fraction, divide 218 by the measured timer ticks. For example, if 218 timer
ticks are measured, the voltage fraction is 1, or 100% (9V). If 436 timer ticks are measured, the voltage
fraction is 0.5, or 50% (4.5V)
2-6 Freescale Semiconductor
Figure 2-4. Speed Capture
3-Phase BLDC Motor Control, Rev. 1
Preliminary
Page 19
Software Design
The output from the Speed PI controller is used as one of the inputs to a Torque PI controller. The second
input to the Torque PI controller is the ADCAvg variable, which is derived from the DCBus current’s
moving average algorithm. The Torque PI controller’s output determines the duty cycle of the generated
PWM output signals.
The rotor commutation process performs mask and swap calculations’ control. The proper PWM output
can be generated by changing the PWM value (duty cycle) registers only. This has two disadvantages:
The first is that the speed controller, which changes the duty cycle, affects the commutation algorithm
(performed by changing the duty cycle). The second disadvantage is that a change in the duty cycle is
synchronized with PWM reload, which may cause a delay between a proper commutation moment and
the PWM reload. This is especially pronounced at high speed when the commutation period is very short.
The 56F801x device has two features dedicated to BLDC motor control: the ability to swap odd and even
PWM generator outputs and the ability to mask (disable) any PWM generator outputs. These two features
allow creation of a rotational field without changing the contents of the PWM value registers. The
commutation algorithms calculate PWM mask and swap values based on the SensorState variable and the ClockWiseCommTable look-up table. The mask and swap values are written into the PWM Channel
Control Register.
The DCBus voltage measurement acts as a fault detection, which disables PWM if voltage drops below
7V.
Freescale Semiconductor2-7
Preliminary
System Description, Rev. 1
Page 20
System Description
2-8 Freescale Semiconductor
3-Phase BLDC Motor Control, Rev. 1
Preliminary
Page 21
Chapter 3
Setting Up the Application
3.1 Required Parts and Instructions
To run this application, the user will need the 56F8013 Demonstration Board (DEMO56F8013 or
DEMO56F8013-E) and the 56F8000 Motor Control Daughter Card (APMOTOR56F8000). These parts
can be ordered through the Freescale website.
Please follow the instructions printed in the kit installation guide included in each kit to install and
connect both boards, as well as to install CodeWarrior development tools.
The final set up should look like in the picture in Figure 3-1. Please the use default settings shown in the
56F8013 Demonstration Board User Guide.
Figure 3-1. 56F8000 Motor Control Daughter Card and 56F8013 Demonstration Board
Freescale Semiconductor3-1
Preliminary
Apply power here
Setting Up the Application, Rev. 1
Page 22
Setting Up the Application
3-2 Freescale Semiconductor
3-Phase BLDC Motor Control, Rev. 1
Preliminary
Page 23
Chapter 4
Running the Application
4.1 BLDC with Hall Sensor Demonstration
Once this demonstration application is downloaded into the 56F8013 Demonstration Board,
(DEMO56F8013), the user can control the speed of the BLDC motor by pressing and releasing the IRQ
#2 button (S2) located on the demonstration board. Button control works as follows:
•Initially pressing and releasing the IRQ #2 button increases rotation speed
•Motor speed increases each time the IRQ #2 button is pressed, until the motor reaches maximum
speed
•Once maximum speed is reached, motor speed decreases each time the IRQ #2 button is pressed,
until the motor stops
Freescale Semiconductor4-1
Preliminary
Running the Application, Rev. 1
Page 24
Running the Application
4-2 Freescale Semiconductor
3-Phase BLDC Motor Control, Rev. 1
Preliminary
Page 25
INDEX
Numerics
3-Phase BLDC Motor Control with Hall Sensors using
56800/E Digital Signal Controllers
56800/E Accelerated Development System Resource
Pak CD-ROM
56F8000 Motor Control Board User GuidePreface-vii
56F8000 Peripheral Reference ManualPreface-vii
56F8013 Demonstration Board User ManualPreface-vii
56F8013 Technical DataPreface-vii
Preface-vii
B
BLDCPreface-vii, 1-1
Brushless DC Motor
BLDCPreface-vii, 1-1
D
DSP56800E Reference ManualPreface-vii
Preface-vii
P
PIPreface-vii
Proportional-Integral
PIPreface-vii
Pulse Width Modulation
PWMPreface-vii
PWMPreface-vii
Freescale SemiconductorIndex-1
Preliminary
Index, Rev. 1
Page 26
Freescale SemiconductorIndex-2
Preliminary
Index, Rev. 1
Page 27
Page 28
How to Reach Us:
Home Page:
www.freescale.com
E-mail:
support@freescale.com
USA/Europe or Locations Not Listed:
Freescale Semiconductor
Technical Information Center, CH370
1300 N. Alma School Road
Chandler, Arizona 85224
+1-800-521-6274 or +1-480-768-2130
support@freescale.com
Freescale Semiconductor Japan Ltd.
Headquarters
ARCO Tower 15F
1-8-1, Shimo-Meguro, Meguro-ku,
Tokyo 153-0064, Japan
0120 191014 or +81 3 5437 9125
support.japan@freescale.com
Asia/Pacific:
Freescale Semiconductor Hong Kong Ltd.
Technical Information Center
2 Dai King Street
Tai Po Industrial Estate
Tai Po, N.T., Hong Kong
+800 2666 8080
support.asia@freescale.com
For Literature Requests Only:
Freescale Semiconductor Literature Distribution Center
P.O. Box 5405
Denver, Colorado 80217
1-800-441-2447 or 303-675-2140
Fax: 303-675-2150
LDCForFreescaleSemiconductor@hibbertgroup.com
Information in this document is provided solely to enable system and
software implementers to use Freescale Semiconductor products. There are
no express or implied copyright licenses granted hereunder to design or
fabricate any integrated circuits or integrated circuits based on the
information in this document.
Freescale Semiconductor reserves the right to make changes without further
notice to any products herein. Freescale Semiconductor makes no warranty,
representation or guarantee regarding the suitability of its products for any
particular purpose, nor does Freescale Semiconductor assume any liability
arising out of the application or use of any product or circuit, and specifically
disclaims any and all liability, including without limitation consequential or
incidental damages. “Typical” parameters that may be provided in Freescale
Semiconductor data sheets and/or specifications can and do vary in different
applications and actual perform ance may vary over time. All operating
parameters, including “Typicals”, must be validated for each customer
application by customer’s technical experts. Freescale Semiconductor does
not convey any license under its patent rights nor the rights of others.
Freescale Semiconductor products are not designed, intended, or authorized
for use as components in systems intended for surgical implant into the body,
or other applications intended to support or sustain life, or for any other
application in which the failure of the Freescale Semiconductor product could
create a situation where personal injury or death may occur. Should Buyer
purchase or use Freescale Semiconductor products for any such unintended
or unauthorized application, Buyer shall indemnify and hold Freescale
Semiconductor and its officers, employees, subsidiaries, affiliates, and
distributors harmless against all claims, costs, damages, and expenses, and
reasonable attorney fees arising out of, directly or indirectly, any claim of
personal injury or death associated with such unintended or unauthorized
use, even if such claim alleges that Freescale Semiconductor was negligent
regarding the design or manufacture of the part.
Freescale™ and the Freescale logo are trademarks of Freescale Semiconductor,
Inc. All other product or service names are the property of their respective owners.
This product incorporates SuperFlash® technology licensed from SST.