Drives & Control June 2003 A. Jansen 1 Brushless DC Motor Control with C868 and CAPCOM6
Drives & Control
June 2003
A. Jansen
1
Brushless DC Motor Control
withC868
and CAPCOM6
Drives & Control
June 2003
A. Jansen
2
Agenda
Basics of a BLDC MotorTopologyBLDC Motor with Hall SensorsBLDC Motor with Hardware
BEMF-DetectionBLDC Motor Sensor less Control
Switching Pattern for Driving a BLDC
How to use the CAPCOM6E for a BLDC
Introduction CAPCOM6E for BLDC purpose
CAPCOM6E & ADC
Drives & Control
June 2003
A. Jansen
3
Electrical Motor Types
ElectricMotor types
ElectricMotor types
ACAC
AsynchronousAsynchronous SynchronousSynchronous
InductionInduction
StepperStepperSynchronousSynchronousPMSMPMSM Switched Rel.Switched Rel.
DCDC
Drives & Control
June 2003
A. Jansen
4
BLDCBasics
Drives & Control
June 2003
A. Jansen
5
Basics of a BLDC Motor
DC Motor with 3 Brushes
VW
UU
VW
+
-
3-Phase Brush-less DC Motor
According to the theory of DC machine, the motor rotational speed can be written as follows:
N = ( Ud - I R ) / (Ke )While,
“N” stands for the motor rotational speed“Ud” stands for the DC voltage applied to the motor windings“R” is the pure resistance of the winding while “I” stands for the winding current “Ke” is the magnet coefficient while “” stands for the motor magnetic flux
From the above formula, there are two methods to change the speed of DC motor: One is to change the DC voltage of the motor windings (Ud), the other one is to change the magnetic flux of the motor (). As the BLDC motor has permanent magnet rotor, only the first method can be used in practical application. The principal of generating variable DC voltage is to use PWM for chopping: change the duty cycle of the PWM voltage, proportionally change the DC voltage.
N
S
Drives & Control
June 2003
A. Jansen
6
How an Inverter Turns a BLDC (1)
C+
B-
11
0
A’
B’
B C
C’
A
NS
Drives & Control
June 2003
A. Jansen
7
How an Inverter Turns a BLDC (2)
C+
B-
11
0
A’
B’
B C
C’
A
NS
Drives & Control
June 2003
A. Jansen
8
How an Inverter Turns a BLDC (3)
C+
B-
A’
B’
B C
C’
A
11>>0
0
N
S
Drives & Control
June 2003
A. Jansen
9
How an Inverter Turns a BLDC (4)
C+
A-
10
0
A’
B’
B C
C’
A
N
S
Drives & Control
June 2003
A. Jansen
10
How an Inverter Turns a BLDC (5)
B+
A-
A’
B’
B C
C’
A
N
S
1>>00
0
Drives & Control
June 2003
A. Jansen
11
How an Inverter Turns a BLDC (6)
B+
A-
A’
B’
B C
C’
A
NS
1>>00
0
Drives & Control
June 2003
A. Jansen
12
BLDC with Hall Sensors – Switching Pattern
Typical Switching Pattern for a BLDC Hall Sequence depends on motor construction Output pattern levels depends on inverter topology
Drives & Control
June 2003
A. Jansen
13
BLDC withHall Sensors
Drives & Control
June 2003
A. Jansen
14
BLDC with Hall Sensors -- Topology
Typical Circuit Block Diagram Hall Sensors detect the position Over current protection and control via ADC
Hall Sensor
C868
+-
HV
Driver
V+
MotorCC60COUT60
CC61COUT61
CC62COUT62C
TR
AP
CC
PO
S2
CC
PO
S1
CC
PO
S0
Drives & Control
June 2003
A. Jansen
15
Block Diagram CAPCOM6E for BLDC Usage
channel 0
channel 1
channel 2
T12
capture/compare input / output control
CC
62
CO
UT
62
CC
61
CO
UT
61
CC
60
CO
UT
60
CT
RA
P
channel 3T13
CC
PO
S0
222
compare
capture
trapcontrol
1
port control
CC
PO
S1
CC
PO
S2
3
noisefilter
compare multi-channel control
compare
Drives & Control
June 2003
A. Jansen
16
H ardware N oiseSuppression
ch0 ge ts capturedva lue fo r act. speed
ch1 com parefor phase de lay
ch2 com parefor tim eout
CC6x
act. speedCC60
phase delayCC61
timeoutCC62
COUT6y
110001CCPOS2
CCPOS0 1 1 1 0 0 0
CCPOS1 0 0 1 1 1 1
C aptureEvent
R esets T12
Usage of CAPCOM6E to Control a BLDC (1)
BEMF-Detection/Hall Signals
HW-noise filter on CCPOSx inputs (BEMF-signals)
Drives & Control
June 2003
A. Jansen
17
H ardware N oiseSuppression
ch0 ge ts capturedva lue fo r act. speed
ch1 com parefor phase de lay
ch2 com parefor tim eout
CC6x
act. speedCC60
phase delayCC61
timeoutCC62
COUT6y
110001CCPOS2
CCPOS0 1 1 1 0 0 0
CCPOS1 0 0 1 1 1 1
C aptureEvent
R esets T12
Usage of CAPCOM6E to Control a BLDC (2)
BEMF-Detection/Hall Signals
HW-noise filter on CCPOSx inputs (BEMF-signals)
automatic reset of T12 with interrupt
actual speed by capture ch0
Drives & Control
June 2003
A. Jansen
18
H ardware N oiseSuppression
ch0 ge ts capturedva lue fo r act. speed
ch1 com parefor phase de lay
ch2 com parefor tim eout
CC6x
act. speedCC60
phase delayCC61
timeoutCC62
COUT6y
110001CCPOS2
CCPOS0 1 1 1 0 0 0
CCPOS1 0 0 1 1 1 1
C aptureEvent
R esets T12
Usage of CAPCOM6E to Control a BLDC (3)
BEMF-Detection/Hall Signals
HW-noise filter on CCPOSx inputs (BEMF-signals)
automatic reset of T12 with interrupt
actual speed by capture ch0
phase delay function on ch1
Drives & Control
June 2003
A. Jansen
19
H ardware N oiseSuppression
ch0 ge ts capturedva lue fo r act. speed
ch1 com parefor phase de lay
ch2 com parefor tim eout
CC6x
act. speedCC60
phase delayCC61
timeoutCC62
COUT6y
110001CCPOS2
CCPOS0 1 1 1 0 0 0
CCPOS1 0 0 1 1 1 1
C aptureEvent
R esets T12
Usage of CAPCOM6E to Control a BLDC (4)
BEMF-Detection/Hall Signals
HW-noise filter on CCPOSx inputs (BEMF-signals)
automatic reset of T12 with interrupt
actual speed by capture ch0
phase delay function on ch1
time out function on ch2
Drives & Control
June 2003
A. Jansen
20
Usage of CAPCOM6E – Hall Sensor Mode (1)
Hall n n+1
Hall n+1 n+2
0 0
0 0
1
1
0
1 0H2
H1
H0
? ?startDead Time Counterafter edge detection
CCPOSx Inputs for Hallsensor Interface
MCMOUTSH / MCMOUTSL SW programmable state machine
Drives & Control
June 2003
A. Jansen
21
Usage of CAPCOM6E – Hall Sensor Mode (2)
Hall n n+1
Hall n+1 n+2
0 0
0 0
1
1
0
1 0H2
H1
H0
? ?noise Correct
expectedHall Event
comparevalid level
afterDTC count down
CCPOSx Inputs edge detection triggers Dead Time
Counter
MCMOUTSH / MCMOUTSL compare CCPOSx level with programmed
value
Drives & Control
June 2003
A. Jansen
22
Usage of CAPCOM6E – Hall Sensor Mode (2)
Hall n+1 n+2
Hall n+1 n+2
0 0
0 0
1
1
0
1 0H2
H1
H0
? !noise Correct
expectedHall Event
setCHE-flag
CCPOSx Inputs MCMOUTSH / MCMOUTSL switch to next state on valid edge by
hardware
Drives & Control
June 2003
A. Jansen
23
Usage of CAPCOM6E – Hall Sensor Mode (3)
prepare next state
Hall n+1 n+2
Hall n+2 n+3
0 0
0 0
1
1
0
1 0H2
H1
H0
? ?
wait onedge
CCPOSx Inputs wait on edge
MCMOUTSH / MCMOUTSL prepare next state by software
Drives & Control
June 2003
A. Jansen
24
Usage of CAPCOM6E – Modulation Control (some Choices)
T12.COUT0
MODT13out
MCMOUTH.1
CTRAP#
1
1
1
A-1
T12.COUT0
MODT13out
MCMOUTH.1
CTRAP#
1
1
1
A-
T12.COUT0
MODT13out
MCMOUTH.1
CTRAP#
1
0
1
A-
T12.COUT0
MODT13out
MCMOUTH.1
CTRAP#
1
1
A-
T12.COUT0
MODT13out
MCMOUTH.1
CTRAP#
1
1
0
A-1
Drives & Control
June 2003
A. Jansen
25
Usage of CAPCOM6E – Generate the PWM Pattern for BLDC
T12.COUT2
MODT13out
MCMOUTH.5
CTRAP#
1
0>0>0>1>1>0>0
1
T12.CC2
MODT13out
MCMOUTH.4
CTRAP#
1
1>1>0>0>0>0>1
1
T12.COUT1
MODT13out
MCMOUTH.3
CTRAP#
1
1>0>0>0>0>1>1
1
T12.CC1
MODT13out
MCMOUTH.2
CTRAP#
1
0>0>1>1>0>0>0
1
T12.COUT0
MODT13out
MCMOUTH.1
CTRAP#
1
0>1>1>0>0>0>0
1
T12.CC0
MODT13out
MCMOUTH.0
CTRAP#
1
0>0>0>0>1>1>0
1
1
1
C+
B-
C-
B+
A+
A-
H2
H1
H0
1
Drives & Control
June 2003
A. Jansen
26
Usage of CAPCOM6E – Generate the PWM Pattern for BLDC
T12.COUT2
MODT13out
MCMOUTH.5
CTRAP#
1
0>0>0>1>1>0>0
1
T12.CC2
MODT13out
MCMOUTH.4
CTRAP#
1
1>1>0>0>0>0>1
1
T12.COUT1
MODT13out
MCMOUTH.3
CTRAP#
1
1>0>0>0>0>1>1
1
T12.CC1
MODT13out
MCMOUTH.2
CTRAP#
1
0>0>1>1>0>0>0
1
T12.COUT0
MODT13out
MCMOUTH.1
CTRAP#
1
0>1>1>0>0>0>0
1
T12.CC0
MODT13out
MCMOUTH.0
CTRAP#
1
0>0>0>0>1>1>0
1
1
1
C+
B-
C-
B+
A+
A-
H2
H1
H0
1
Drives & Control
June 2003
A. Jansen
27
Usage of CAPCOM6E – Generate the PWM Pattern for BLDC
T12.COUT2
MODT13out
MCMOUTH.5
CTRAP#
1
0>0>0>1>1>0>0
1
T12.CC2
MODT13out
MCMOUTH.4
CTRAP#
1
1>1>0>0>0>0>1
1
T12.COUT1
MODT13out
MCMOUTH.3
CTRAP#
1
1>0>0>0>0>1>1
1
T12.CC1
MODT13out
MCMOUTH.2
CTRAP#
1
0>0>1>1>0>0>0
1
T12.COUT0
MODT13out
MCMOUTH.1
CTRAP#
1
0>1>1>0>0>0>0
1
T12.CC0
MODT13out
MCMOUTH.0
CTRAP#
1
0>0>0>0>1>1>0
1
1
1
C+
B-
C-
B+
A+
A-
H2
H1
H0
1
Drives & Control
June 2003
A. Jansen
28
Usage of CAPCOM6E – Generate the PWM Pattern for BLDC
T12.COUT2
MODT13out
MCMOUTH.5
CTRAP#
1
0>0>0>1>1>0>0
1
T12.CC2
MODT13out
MCMOUTH.4
CTRAP#
1
1>1>0>0>0>0>1
1
T12.COUT1
MODT13out
MCMOUTH.3
CTRAP#
1
1>0>0>0>0>1>1
1
T12.CC1
MODT13out
MCMOUTH.2
CTRAP#
1
0>0>1>1>0>0>0
1
T12.COUT0
MODT13out
MCMOUTH.1
CTRAP#
1
0>1>1>0>0>0>0
1
T12.CC0
MODT13out
MCMOUTH.0
CTRAP#
1
0>0>0>0>1>1>0
1
1
1
C+
B-
C-
B+
A+
A-
H2
H1
H0
1
Drives & Control
June 2003
A. Jansen
29
Usage of CAPCOM6E – Generate the PWM Pattern for BLDC
T12.COUT2
MODT13out
MCMOUTH.5
CTRAP#
1
0>0>0>1>1>0>0
1
T12.CC2
MODT13out
MCMOUTH.4
CTRAP#
1
1
T12.COUT1
MODT13out
MCMOUTH.3
CTRAP#
1
1>0>0>0>0>1>1
1
T12.CC1
MODT13out
MCMOUTH.2
CTRAP#
1
0>0>1>1>0>0>0
1
T12.COUT0
MODT13out
MCMOUTH.1
CTRAP#
1
0>1>1>0>0>0>0
1
T12.CC0
MODT13out
MCMOUTH.0
CTRAP#
1
0>0>0>0>1>1>0
1
1
1
C+
B-
C-
B+
A+
A-
H2
H1
H0
1
1>1>0>0>0>0>1
Drives & Control
June 2003
A. Jansen
30
Usage of CAPCOM6E – Generate the PWM Pattern for BLDC
T12.COUT2
MODT13out
MCMOUTH.5
CTRAP#
1
0>0>0>1>1>0>0
1
T12.CC2
MODT13out
MCMOUTH.4
CTRAP#
1
1
T12.COUT1
MODT13out
MCMOUTH.3
CTRAP#
1
1>0>0>0>0>1>1
1
T12.CC1
MODT13out
MCMOUTH.2
CTRAP#
1
0>0>1>1>0>0>0
1
T12.COUT0
MODT13out
MCMOUTH.1
CTRAP#
1
0>1>1>0>0>0>0
1
T12.CC0
MODT13out
MCMOUTH.0
CTRAP#
1
0>0>0>0>1>1>0
1
1
1
C+
B-
C-
B+
A+
A-
H2
H1
H0
1
1>1>0>0>0>0>1
Drives & Control
June 2003
A. Jansen
31
Usage of CAPCOM6E – Modulation and Synchronization
CorrectHall Event
MCMP
MCMPS
to modulationselection
6
write by software
6T12pm
T13pm
T12c1cm
T13zm
Flag
T12zm
direct
T12om
SW-Triggerno action
Reset
MCMOUTSL
MCMOUTL
Drives & Control
June 2003
A. Jansen
32
Usage of CAPCOM6E – Modulation and Synchronization
CorrectHall Event
MCMP
MCMPS
to modulationselection
6
write by software
6T12pm
T13pm
T12c1cm
T13zm
Flag
T12zm
direct
T12om
SW-Triggerno action
Reset
MCMOUTSL
MCMOUTL
Drives & Control
June 2003
A. Jansen
33
Usage of CAPCOM6E – Modulation and Synchronization
CorrectHall Event
MCMP
MCMPS
to modulationselection
6
write by software
6T12pm
T13pm
T12c1cm
T13zm
Flag
T12zm
direct
T12om
SW-Triggerno action
Reset
MCMOUTSL
MCMOUTL
Drives & Control
June 2003
A. Jansen
34
Usage of CAPCOM6E – Modulation and Synchronization
CorrectHall Event
MCMP
MCMPS
to modulationselection
6
write by software
6T12pm
T13pm
T12c1cm
T13zm
Flag
T12zm
direct
T12om
SW-Triggerno action
Reset
MCMOUTSL
MCMOUTL
Drives & Control
June 2003
A. Jansen
35
Usage of CAPCOM6E to Control a BLDC (5)
0 0 0
1 1 0 1 0 0
1 0 00 1 0
0 1 1 0 0 0
0 1 0
MCMOUTSL
MCMOUTL
MCMOUTSH
MCMOUTH
C+
B-
11
0
A’
B’
B C
C’
A
N
S
Drives & Control
June 2003
A. Jansen
36
Usage of CAPCOM6E to Control a BLDC (6)
0 0 0
1 0 0 0 0 0
1 0 00 1 0
0 1 1 0 0 0
0 1 0
MCMOUTSL
MCMOUTL
MCMOUTSH
MCMOUTH
C+
B-
A’
B’
B C
C’
A
11>>0
0
N
S
Drives & Control
June 2003
A. Jansen
37
Usage of CAPCOM6E to Control a BLDC (7)
0 0 1
1 0 0 0 0 0
0 0 00 1 0
0 1 0 0 1 0
0 1 0
MCMOUTSL
MCMOUTL
MCMOUTSH
MCMOUTH
C+
A-
10
0
A’
B’
B C
C’
A
N
S
Drives & Control
June 2003
A. Jansen
38
Usage of CAPCOM6E to Control a BLDC (8)
0 0 1
0 0 0 0 0 1
0 0 00 0 0
0 1 0 0 1 0
0 1 1
MCMOUTSL
MCMOUTL
MCMOUTSH
MCMOUTH
B+
A-
A’
B’
B C
C’
A
N
S
1>>00
0
Drives & Control
June 2003
A. Jansen
39
BLDCSensor
less
Drives & Control
June 2003
A. Jansen
40
BLDC in Theory – Back Electro Magnetic Force
Theory UP = (R x i) + (L x di/dt) + eP
where"UP" stands for phase voltage"R" stands for winding resistance"i" stands for actual phase current"L" stands for phase inductance"di/dt" stands for changment of phase current over time"eP" stands for electromagnetic voltage caused by
magnet
whilei = 0 and di/dt = 0:UP = eP
by measuring UP
a position detectionis possible
iavai
30°
ibvbi
120°
Drives & Control
June 2003
A. Jansen
41
BLDC in Reality (1) – BEMF vs. Current
iav
ai
Real BEMF Voltage and Current: shape depends on magnets, motor speed, voltage
Drives & Control
June 2003
A. Jansen
42
BLDC in Reality (2a) – BEMF vs. Current
Zoom In: BEMF is only visible at active switching
PhaseCurrent
BEMFVoltage
Drives & Control
June 2003
A. Jansen
43
BLDC in Reality (2b) – BEMF vs. Current
Current Commutation in a Coil Freewheeling diode conducts
PhaseCurrent
BEMFVoltage
V+
GND
CurrentFlow
Motor
V+
GND
Current FlowFreewheeling
Diode
Motor
Drives & Control
June 2003
A. Jansen
44
BLDC in Reality (3) – All Important Signals
PhaseCurrent
BEMFVoltage
Drives & Control
June 2003
A. Jansen
45
BLDC Sensor less with Hardware BEMF-Detection
Typical Circuit Block Diagram Comparators and RC-Filter detect the BEMF zero crossing
for position detection
C868
RCFilter
virtualStar
-+
-+
-+
+-
HV
Driver
V+
MotorCC60COUT60
CC61COUT61
CC62COUT62C
TR
AP
CC
PO
S2
CC
PO
S1
CC
PO
S0
Drives & Control
June 2003
A. Jansen
46
BLDC Sensor less Using ADC
Typical Circuit Block DiagramUse simple resistor divider and ADC for position detection
C868
+-
HV
Driver
V+
MotorCC60COUT60
CC61COUT61
CC62COUT62C
TR
AP
AN
2
AN
1
AN
0
BEMFDetection
Drives & Control
June 2003
A. Jansen
47
CAPCOM6E & ADC
Synchronize ADC on T13 T13 period match can trigger the ADC equidistant sampling of analog signals exact timing guaranteed by hardware no timing jitter due to software delays
f(n-1)f(n) f(n+1)
f(n+2)
conversionchannel 0
T13
analogsignal
ADC
start samplingby hardware
Drives & Control
June 2003
A. Jansen
48
CAPCOM6E & ADC
Synchronize T13 on T12 T13 performs delay for
stable measurement T13 period match
triggers ADC Useful for Current
Measurement E.g. induction machine
Compare value
T12
T13
CC6x
PhaseCurrent x
synchronizeT13 on T12cm
Start ADC whensignal is stable after aprogrammable delay
Drives & Control
June 2003
A. Jansen
49
CAPCOM6E & ADC
T13PM triggers ADC Delay between T13PM
and high voltage switching event due to driving circuit
Useful for Voltage or Current Measurement E.g. BEMF detection Sample shortly before
power device is switched off (BEMF is noise free)
BEMFsignal
IGBTdrainvolt.
CC6x
T13
Modulation forBlock-Commutation
Delay due toIGBT driving circuit
IGBT’s gate signal
Voltage signal atcurrentless phase
for position detection
Start ADC sampling
Drives & Control
June 2003
A. Jansen
50
CAPCOM6E & ADC
T13PM triggers ADC Delay between T13PM and
high voltage switching event due to driving circuit
Useful for Voltage or Current Measurement E.g. Current in DC link
path Sample shortly before
power device is switched off (current is noise free) IGBT
drainvolt.
CC6x
T13
Modulation forBlock-Commutation
Delay due toIGBT driving circuit
IGBT’s gate signal
DC LinkCurrent
Start ADC sampling
Drives & Control
June 2003
A. Jansen
51
BLDC Sensor less Using ADC
T13 used forModulationADC trigger
T12 used for Phase delay
Software (for 60° sector)
With every T13PMthe BEMF voltage is sampled and compared to a BEMF-wave table
When crossing a limit the software generates a CHE-event (1)
Speed reference is captured and phase delay for T12ch1 is calculated
At T12ch1 the pattern for the next sector is switched (2)
BEMFVoltagePhase
C
T13
T12
CurrentPhase C
CurrentPhase A
MeasureBEMF-Voltage
(Phase C)
MeasureDC-Link Current
(Phase A)
MeasureVoltage(Phase
B)
1 2
AnalogCompareValue
CompareValueT12_ch1
Drives & Control
June 2003
A. Jansen
52
BLDC Sensor less with Current Control
T13 used forModulationADC trigger
T12 used for Phase delay
Software (for 60° sector)
With every T13PM the ADC alternatively samples BEMF voltage Phase current
The current set value can be controlled by adjusting the PWM duty cycle
BEMFVoltagePhase
C
T13
T12
CurrentPhase C
CurrentPhase A
MeasureDC-LinkCurrent
(Phase A)
MeasureBEMF
Voltage(Phase C)
MeasureDC-Link Current
(Phase A)
MeasureBEMF
Voltage(Phase
B)
MeasureDC-LinkCurrent
(Phase C)
1 2
CompareValueT12_ch1
AnalogCompareValue
ControlCurrent Value
Drives & Control
June 2003
A. Jansen
53
BLDC Sensor less Scope Shots
Port pin toggles when BEMF is below limit
BEMFVoltage
PhaseCurrent
Drives & Control
June 2003
A. Jansen
54
Application: Line powered Industrial Drives Power: 750 W Current: max. 5 A AC Input Voltage: 110 to 264 VAC
Features: 8-bit MCU: C868 with on-chip 8 kB SRAM, with 8-
bit ADC and powerful PWM module CoolSet: TDA61831G instead of a transformer
for 12V supply 6 rugged IGBT DuoPacks EEPROM: 8 kB to store program + stand alone
boot option Optically Isolated Serial Interface to PC for SW
development + boot from PC option Protection: shut down protection for over current
and over temperature Extension for alternative MCU like XC164 or
TC1775 SW environment: Keil Compiler + Debugger or
Mini Debugger (free software) Board can be used for current/torque or speed
control Supports Hall-Effect sensors or sensor-less
control
High Voltage 3-Phase Brushless DC / Induction MotorReference Design and Development Kit
Drives & Control
June 2003
A. Jansen
55
Low Voltage 3-Phase Brushless DC / Induction MotorReference Design and Development Kit
Application: Industrial & Automotive Drives Power: 1.2 kW Current: max. 50 A Voltage: 12 - 24 V DC
Features: 8-bit MCU: C868 with on-chip 8 kB SRAM, with 8-
bit ADC and powerful PWM module 3-Phase Bridge Driver: TLE6280G 6 OptiMOS MOSFETs EEPROM: 8 kB to store program + stand alone
boot option RS232: Interface to PC for SW development +
boot from PC option Protection: shut down protection for over current
and over temperature Extension for alternative MCU like XC164 SW environment: Keil Compiler + Debugger or
Mini Debugger (free software) Board can be used for current/torque or speed
control Supports Hall-Effect sensors or sensor-less
control