Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Digital Signal
Signal Controller
Controller (DSC)
(DSC)
BLDC
Slide 1
WIB Agenda
O
Microchip
dsPIC DSC
dsPIC DSC
BLDC
Slide 2
WIB Agenda
LAB Sessions:
O Lab 1
: PICDEM MC LV Board (dsPIC DSC )
O Lab 2 Forced Commutation
: BLDC
O Lab 3 GPIO(OVDCON) BLDC
O Lab 4 MCPWM BLDC
O Lab 5 Closed-Loop (PID ) BLDC
O Lab 6 Sinusoidal BLDC
O Lab 7 Phase Advance BLDC
O Lab 8 Sensorless BLDC
Sensored Method : Lab 3/4/5/6/7
Sensorless Method : Lab 8
2007 Microchip Technology Incorporated
Slide 3
Overview
dsPIC DSC
O
O
O
Architecture
Motor Control Family
Motor Control
Motor Theory
BLDC Motor
Position Sensing
Slide 4
Overview (continued)
BLDC :
O Forced
O
O
O Six
O
O
O Six
Commutation Operation ( )
What is Commutation?
Commutating a BLDC with no position feedback
Slide 5
Overview (continued)
BLDC :
O
Open Loop
O
O
MCPWM
Override Control
Closed Loop
O
O
DSP PID
BLDC Motor
Slide 6
Overview (continued)
BLDC :
O
Slide 7
Overview (continued)
BLDC
O
Why Sensorless?
BEMF Zero Crossing Detection Technique
Hardware Implementations for Detecting BEMF
Implementing Sensorless BLDC with dsPIC DSC
Introduction to SMTI for Tuning Parameters
Parameter Tuning Exercise using SMTI
Slide 8
Microchip
s Corporate
Microchips
Overview
Slide 9
Microchip
O
O
O
O
O
O
O
of high-performance, field-programmable,
8-bit & 16-bit RISC Microcontrollers
of Analog & Interface products
of related Memory products
for high-volume embedded control applications
O
O
Slide 10
Sensors
Digital
Pot
Precision
Voltage
Reference
Amplifiers
Filters
Power
Serial NV
Memory
RF
Xmit/
receive
High
Voltage
I/Os
IR
Communications
Power
Drivers
A/D
Power
Management
Telecom
DTMF
Codec
Microcontrollers/
Digital Signal
Controllers
Motors
Relays
Print-heads
D/A
LCD
Drivers
SRAM
Xceivers
- RS232/485
- CAN bus
- USB
Offered by Microchip
Bus
Comm.
- CAN bus
- USB
- LinBus
Digital
Peripherals
PWM
RTC
LED
Drivers
Slide 11
dsPIC
DSC Overview
Slide 12
What is DSC ?
PERFORMANCE
e
h
T
dsPIC33F
dsPIC30F
P
S
D
e
c
a
p
S
32-bit MCU
16-bit MCU
5 - 15 MIPS
dsPIC DSC
The 16-bit MCU with
the power of DSP
8-bit MCU
1 - 10 MIPS
PRICE
2007 Microchip Technology Incorporated
Slide 13
O
O
O
O
Slide 14
Control
Control Centric
Centric Benchmarks
Benchmarks
Relative Code Size
16-bit Applications
(~ 40KB code)
152%
153%
32-bit Applications
(~ 50KB code)
153%
157%
188%
180%
156%
136%
129%
113%
114%
114%
Infineon C16X
TI 320C24x
Hitachi H8S
Motorola HC12
FS 56F8367
Mitsubishi M16C
Infineon C16X
FS 56F8367
TI 320C24x
Hitachi H8S
Motorola HC12
Mitsubishi M16C
dsPIC DSC
dsPIC DSC
100%
100%
Slide 15
dsPIC30F Products
Power Conversion & Motor Control Family
Product
dsPIC DSC
A/D
Output
Motor
Flash SRAM EE Timer Input Comp/
10-bit Quad
UART SPITM I2CTM CAN
Cntrl
Pins
Enc
KB Bytes Bytes 16-bit Cap
1.0
Std
PWM
Msps
PWM
dsPIC30F2010
28
12
dsPIC30F3010
28
dsPIC30F4012
1024
6 ch
Yes
24
1024 1024
6 ch
Yes
28
48
2048 1024
6 ch
Yes
dsPIC30F3011
40
24
1024 1024
9 ch
Yes
dsPIC30F4011
40
48
2048 1024
9 ch
Yes
dsPIC30F5015
64
66
2048 1024
16 ch
Yes
dsPIC30F5016
80
66
2048 1024
16 ch
Yes
dsPIC30F6010
80
144
8192 4096
16 ch
Yes
O
O
O
O
512
O
O
O
O
Appliances
Power Tools
Automotive
Industrial
Slide 16
dsPIC33F Products
Power Conversion & Motor Control Family
T
I
M
E
R
M
10-bit ADC
C
I
1.1 Msps
OC
P
C PWM
W
# ADC, # Ch
M
U
A
R
T
PINS
Flash
(KB)
RAM
(KB)
Dual
Port
RAM
(KB)
dsPIC33FJ64MC506
64
64
8 1 ADC, 16 Ch
dsPIC33FJ64MC508
80
64
dsPIC33FJ64MC510
100
64
dsPIC33FJ64MC706
64
64
14
dsPIC33FJ64MC710
100
64
14
dsPIC33FJ128MC506
64
128
dsPIC33FJ128MC510
100
128
dsPIC33FJ128MC706
64
dsPIC33FJ128MC708
S I
2
P
C
I
C
A
N
Q
E
I
8 1 ADC, 18 Ch
8 1 ADC, 24 Ch
8 2 ADC, 16 ch
8 2 ADC, 24 ch
8 1 ADC, 16 Ch
8 1 ADC, 24 Ch
128
14
8 2 ADC, 16 ch
80
128
14
8 2 ADC, 18 Ch
dsPIC33FJ128MC710
100
128
14
8 2 ADC, 24 ch
dsPIC33FJ256MC510
100
256
14
8 1 ADC, 16 ch
dsPIC33FJ256MC710
100
256
28
8 2 ADC, 24 ch
Product
Slide 17
dsPIC
DSC Architecture
Summary
Slide 18
O
O
O
O
O
O
O
O
MCU + DSP
Harvard Architecture
(Separate data & memory Bus)
16-bit (Data or RAM)
24-bit (Program or ROM)
12MB (no paging)
64kB (no banking : RAM)
DSP (fixed point/ 2 40-bit accumulators)
Slide 19
()
O 16 x 16-bit working register
O
O
O
O
O
Software stack
Fast, deterministic interrupt response
Three operand instructions: C = A + B
8 SRAM
DMAC
Slide 20
dsPIC30F
dsPIC33F
DC to 30 MIPS
DC to 40 MIPS
VDD(VDC):
2.5 to 5.5
3.0 to 3.6
-40C to +125C
-40C to +85C
Flash
Flash
SRAM, EEPROM
Package sizes
O
18-pin SO & SP
O
Slide 21
2 KB
Dual Port
RAM
Selected
Peripherals
DMAC
8 chan.
Instruction
Pre-fetch & Decode
DSP
16 x 16
MCU
ALU
Address Path
MCU/DSP Data Path
2007 Microchip Technology Incorporated
TABLE
Access Cntrl
W Array
X AGU
Y AGU
Engine
23-bit PC
Control
Program
Memory
256 KB
Programmers Model
15
Divide Quotient
Divide Remainder
W0
W1
W2
W3
W4
W5
W6
W7
W8
W9
W10
W11
W12
W13
W14
W15
W Registers
General Purpose
Data Registers
or
Address Pointers
DSP OPERAND
Registers
DSP ADDRESS
Registers
Frame Pointer
Stack Pointer
15
Stack Pointer Limit
DSP Accumulators
(40-bit)
SPLIM
ACCA
ACCB
39
32 31
0
0
16 15
N OV
Status Register
Slide 23
dsPIC
Interrupt Subsystem
Slide 24
Interrupt Vector
Table (IVT)
Alternate
Interrupt Vector
Table (AIVT)
Interrupt Vector 53
Reserved
Reserved
Reserved
Oscillator Fail Trap
Interrupt Vector 53
0x000000
0x000004
0x00007E
0x000084
0x0000FE
Slide 25
Traps
O
O
Divide by Zero
Unsaturated Accumulator Overflow (A or B)
Catastrophic Accumulator Overflow (either)
Accumulator Shift Overflow
Slide 26
dsPIC
Slide 27
dsPIC DSC PIC MCU
Power-On-Reset
- 0, 4, 16, 64 ms Delay
Brown-out Reset :
-
Slide 28
Clock sources
Low Pwr RC 512KHz
Fast RC 8.0 MHz
PLL
4x,
8x,
16x
or bypass
EC Clock
OSCI
XTL, XT, HS
Primary
Xtal OSC
Clock Divide
By
1, 4, 16, 64
System
Clock
OSCO
SOSCI
32KHz
Timer1 Xtal
OSC
SOSCO
Includes 2 Internal RC
Oscillators
Slide 29
Fail
-Safe Operation
Fail-Safe
O
Device Resets
Slide 30
Slide 31
dsPIC Peripherals
MCU / DSP CORE
16-bit ALU
16 x 16 MAC
Dual 40-bit ACC
Output Compare
Standard PWM
ADC
12-bit 200 ksps
10-bit 1.0 Msps
(8 ch / 16-bit)
Input Capture
TIMER1
Quadrature Encoder
(TIMER6)
SPI 2
4 KB
SPI 1
Data Memory
EEPROM
UART 2
32 KB
16-bit, 6-8 ch
16 / 32 bit Timers
TIMER4 / TIMER5
UART 1
Data Memory
SRAM
Slide 32
CAN 2
16 / 32 bit Timers
TIMER2 / TIMER3
CAN 1
256 KB
DCI
(8 ch / 16-bit)
I2C
Program Memory
Flash
A/D Converter
O
Slide 33
10
-bit A/D Converter
10-bit
VREF+
Conversion
Control
VREFAN0
S/H
Input Muxes
S/H
ADC
10 bit
1.0 Msps
Data
Format
BUFFER
16 deep
S/H
Bus Interface
AN1
S/H
AN15
Sample
Sequence
Control
Slide 34
Sampling Options
AN0
AN1
AN2
AN3
SIMULTANEOUS
SAMPLING
SEQUENTIAL
SAMPLING
Slide 35
Q
uadrature E
ncoder IInterface
nterface
Quadrature
Encoder
O
O 3
O
O
O
Phase A
Phase B
INDEX signals
AN1
AN7
dsPIC30F4011
O 16-bit
120 - 240
VAC
PWM3H
PWM3L
PWM2H
PWM2L
PWM1H
PWM1L
FLTA
Rectifier
IBUS
VBUS
BLDC Motor
3-ph
Inverter
Fault
AN6
AN0
QEA
QEB
INDEX
Incremental
Encoder
Slide 36
Quadrature Timing
Diagram
O
PHASE A
PHASE B
COUNT
+1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1
+1
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
Slide 37
Clock
Divider
INDEX
Digital Filter
Logic
QEB/UP_ DN
Digital Filter
Logic
Quadrature
Decoder
Logic
DIR
Tcy
Prescaler and
Sync. Logic
Reset
Timer mode
Digital Filter
Logic
QEA/TQCKI
GATE
Clock
16-Bit Up/Down
Counter
Timer mode
Comparator
TQCS
Max. Count
Register
UP/DOWN
Slide 38
P
ulse W
idth M
odulation
Pulse
Width
Modulation
O
DC () AC
: PWM
PWM
Sine-wave
50%
(Carrier Ripple)
O
2%
50%
Slide 39
98%
O
O
O
O High
AC Motors
DC motors
Power supplies
frequency @ more
bits
= better control of motor
operation
O Fault
120 - 240
VAC
AN1
AN7
dsPIC30F4011
O 4 PWM
O
PWM
PWM3H
PWM3L
PWM2H
PWM2L
PWM1H
PWM1L
FLTA
Rectifier
IBUS
VBUS
BLDC Motor
3-ph
Inverter
Fault
AN6
AN0
QEA
QEB
INDEX
Incremental
Encoder
Slide 40
PWM
O
O
Carrier Frequency
Duty Cycle
+V
PWM1H
PWM2H
PWM1L
PWM2L
PWM3H
3 Phase
BLDC
PWM3L
Slide 41
Duty Cycle
Generator #4
Duty Cycle
Generator #3
PWM3H
Dead Time Unit
PWM Override
Logic
Duty Cycle
Generator #2
A/D Conversion
Trigger
PWM2H
Duty Cycle
Generator #1
PWM3L
Slide 42
PTCON register
O
O
O
O
O
R/W-0
PTEN
bit15
R/W-0
bit7
U-0
14
R/W-0
PTSIDL
13
R/W-0
R/W-0
PTOPS<3:0>
6
U-0
12
R/W-0
4
U-0
11
U-0
10
R/W-0
R/W-0
PTCKPS<1:0>
3
U-0
9
U-0
bit8
R/W-0
R/W-0
PTMOD<1:0>
1
Slide 43
bit0
PDC3
PDC2
PDC1
PWM1
PWM2
PWM3
Slide 44
duty
cycle
changed
buffer
update
PTPER
PDCx
PWM
Slide 45
1
PDCx
16-bit Compare
PTDIR
PTMR
15 14
D
0
Tcy/2
Tcy
Slide 46
Slide 47
Slide 48
Dead Time
O
Shoot Through
DT = Dead Time / (Tcy *Prescaler)
Dead Time
PWM1H
PWM1H
PWM1L
PWM1L
Slide 49
MCPWM A/D
O
O
O
PWM1H
PWM1L
To A/D
PWM1L
T
Slide 50
SEVTCMP Register
Slide 51
Current
Limit
Motor
Current
LATCHED
PWM1H
PWM
PWM1L
Current
Limit
Motor
Current
FLTA
Current
Limit
AUTOMATIC
PWM
Slide 52
Commutation
I/O pin : PWM, Active, Inactive
POVD = 0 : I/O pin
POUT :
, PWM pins OFF
R/W-1
POVD4H
bit15
R/W-1
POVD4L
14
R/W-1
POVD3H
R/W-1
POVD3L
13
12
R/W-1
POVD2H
11
R/W-1
POVD2L
R/W-1
POVD1H
R/W-1
POVD1L
10
bit8
R/W-0
POUT4H
R/W-0
POUT4L
R/W-0
POUT3H
R/W-0
POUT3L
R/W-0
POUT2H
R/W-0
POUT2L
R/W-0
POUT1H
R/W-0
POUT1L
bit7
bit0
Slide 53
R/W-1
POVD4L
14
bit15
R/W-1
POVD3H
R/W-1
POVD3L
13
12
R/W-1
POVD2H
11
R/W-1
POVD2L
R/W-1
POVD1H
R/W-1
POVD1L
10
bit8
R/W-0
POUT4H
R/W-0
POUT4L
R/W-0
POUT3H
R/W-0
POUT3L
R/W-0
POUT2H
R/W-0
POUT2L
R/W-0
POUT1H
R/W-0
POUT1L
bit7
bit0
0
0
1
0
POVDxx
POUTxx
0
1
0
0
1
x
PWMxx
Slide 54
Lab 1.
dsPIC DSC
(PICDEM
MCLV Board)
(PICDEM
Slide 55
Lab1 :
O
O
LV MC Board
Lab ?
O
O
O
O
C:\..\Lab1\Lab1.mcw
Lab1.mcw or Lab1.mcp
dsPIC DSC
Slide 56
1) MPLAB IDE V7.20 or higher installed
2) MPLAB ICD 2
- R20 or Latest Rev.
Power (4 wires 4 )
Hall sensor (5 wires 8 )
Slide 57
LAB 1
O
Mission:
O
O
O
O
O
Board
MPLAB IDE workspace
MPLAB IDE build
compile
MPLAB ICD 2
MPLAB ICD 2
Slide 58
Training board
28-pin MC dsPIC30F
3-Phase
Inverter
Power
Reset
Pot
S2
Motor
connector
DIP Switch
Serial connector
2007 Microchip Technology Incorporated
MPLAB ICD 2
connector
Jumpers
J7, J8, J11, J12, J13, J14
Slide 59
Block Diagram
Slide 60
Schematic
Slide 61
Schematic
Slide 62
Jumper
O
Board Jumper
!!!
Slide 63
J7
NC
J8
NC
J11
NC
J12
NC
J13
NC
J14
NC
J15
NC
J10
NC
J16
1-2
J17
1-2
J19
1-2
Vref
Cbemf
LED
Slide 64
dsPIC30F3010
PGC
UART Rx
PGD
UART Tx
EMUC2
ICD 2 Clock
EMUD2
ICD 2 Data
S2
Position
Function
Closed
PRGM
Open
DEBUG
: PRGM
: DEBUG
Slide 65
Lab1
O
Lab1 :
O PICDEM MCLV B/D DIP
PRGM
O Board (24V/2A)
O MPLAB IDE
O File -> Open Workspace
O C:\...\Lab1\Lab1.mcw
O Lab1.mcw
O Workspace
O
64 , Character
!!!
Continued...
2007 Microchip Technology Incorporated
Slide 66
Lab1 (()
)
O
Lab1 :
O
O
O
O
O
O
O
Slide 67
Lab1
O
:
O
O
Workspace
Slide 68
ADPCFG Register
Slide 69
PWMCON1 Register
Slide 70
Lab1
-2
Lab1-2
O
O
O
O
Slide 71
Lab1
-2
Lab1-2
Slide 72
Lab 1
-2 (contd.)
1-2
O
Slide 73
Lab1
-2
Lab1-2
Slide 74
Lab1
-2 Result
Lab1-2
Slide 75
Peripheral Hands
-On
Hands-On
10
-bit A/D Converter
10-bit
Slide 76
dsPIC
10
-bit A/D Converter
dsPIC
10-bit
O
Feature Summary
O 10-bit Resolution with +/- 1 bit accuracy
O 1M Samples/Sec conversion rate
O Up to 16 input channels, 4 S/H Amplifiers
O Unipolar differential measurements
O External VREF+ and VREFO Many sampling sequences can be programmed
O Multiple conversion trigger sources
Slide 77
10
-bit A/D Block Diagram
10-bit
VREF+
Conversion
Control
VREFVREFAN0
SH0
AN1
16-word
buffer
Data
Formatting
SH2
Bus Interface
Input Muxes
SH1
ADC
10 bit
500 ksps
SH3
AN15
Sample
Sequence
Control
Slide 78
10
-bit A/D Converter
10-bit
O
Slide 79
10
-bit A/D Converter
10-bit
O
Slide 80
10
-bit A/D Converter
10-bit
O
Slide 81
10
-bit A/D Converter
10-bit
O
Slide 82
10
-bit A/D Converter
10-bit
O
Slide 83
Sampling Options
AN0
AN1
AN2
AN3
SIMULTANEOUS
SAMPLING
SEQUENTIAL
SAMPLING
Slide 84
10
-bit A/D Converter
10-bit
O
Slide 85
10
-bit A/D Converter
10-bit
O
ADPCFG Register
O
Slide 86
Slide 87
O
O
O
O
O
Slide 88
In Windows:
O
O
Slide 89
PLab1 Result
Slide 90
10
-bit A/D Converter
10-bit
O
ADCHS Register
R/W-0
R/W-0
CHXNB<1:0>
bit15
14
R/W-0
R/W-0
CHXNA<1:0>
bit7
R/W-0
CHXSB
R/W-0
CH0NB
R/W-0
13
12
11
R/W-0
CHXSA
R/W-0
CH0NA
R/W-0
R/W-0
R/W-0
CH0SB<3:0>
10
R/W-0
R/W-0
CH0SA<3:0>
2
Slide 91
R/W-0
bit8
R/W-0
bit0
10
-bit A/D Converter
10-bit
O
AN0
AN1
+
CH 1
-
AN3
AN6
AN9
AN2
+
AN4
CH 2
-
AN7
+
CH 3
-
AN5
AN8
AN10
AN11
VREF-
VREF-
VREF-
ADCHS Register
R/W -0
R/W -0
CHXNB<1:0>
bit15
14
R/W-0
R/W-0
CHXNA<1:0>
bit7
R/W -0
CHXSB
R/W -0
CH0NB
13
12
R/W-0
CHXSA
R/W-0
CH0NA
R/W-0
R/W -0
11
R/W -0
R/W -0
CH0SB<3:0>
10
R/W-0
R/W-0
CH0SA<3:0>
2
Slide 92
R/W-0
bit8
R/W-0
bit0
PWM1H
PWM1H
PWM1L
To A/D
PWM1L
T
Slide 93
PLab 2 Objectives
O
O
O
O
Slide 94
PLab 2 Hardware
+V
1H
2H
3H
AN5
PWM3
1L
2L
3L
AN4
PWM2
PWM1
AN3
Slide 95
O
O
Slide 96
PLab 2 Objectives
O
Slide 97
PLab2 Setup
O
Slide 98
Slide 99
PLab 2 General:
O
O
Slide 100
PLab2 Result
Slide 101
BLDC
Slide 102
I. Motor
O
What is a Motor?
How?
(I) (B) (F)
F=IxB
2007 Microchip Technology Incorporated
Slide 103
B
F
Slide 104
Motor Torque
T=F * D
F
D
B
S
I
F
B
F
Slide 105
DC Motor Torque
O
O
Summary
Torque = Force * Distance
O
F=IxB
T=(IxB)*D
B,D : T = * A
O
O
: B = K * IF
DC (T), (B)
Slide 106
DC Motor
O
O
O
O
O
N :
S :
(Rotor) N S
, (commutator)
Spark
Slide 107
DC Motor Control
O
DC
S/W
PWM
Armature
Vin
Armature
Vin
Slide 108
Unidirectional
DC Motor Control
Low side switch
Armature
PWM
A
Vin
Armature
Vin
PWM
Slide 109
Bi
-directional
Bi-directional
DC Motor Control H
-bridge
H-bridge
Reverse
Forward
PWM
Vin
PWM
A
PWM
PWM
H-bridge
2007 Microchip Technology Incorporated
Slide 110
Resources Required
O
PWMs: H-bridge
O
ADCs: /
O
O
O
1 ~ 2 (8/10-bit )
PIC16FXXX C
Slide 111
DC
DC
: (Rotor)
O
O
(Loss)
or
Armature : (Stator)
z
z
(Loss)
Slide 112
vs
DC Motor
PERMANENT MAGNET BRUSHED DC
MOTOR
Permanent
Brushes
Magnet
Stator
Windings
2007 Microchip Technology Incorporated
Rotor
Rotor
Windings
Slide 113
Brushless DC Motor
Energization
100
101
com
110
com
g
g
B
SS
001
b
G
r
com
010
G
011
Slide 114
BLDC
O
O
O
O
O
O
No Brushes / No
No Commutator
O
/ No Arcing - No Commutator
Slide 115
BLDC Control
BLDC =
, (Rotor/)
!!!
Slide 116
Slide 117
O
O
Sector 5 ,
= 24V
= 0V
= OFF
(6)
Red Winding
60o
Green Winding
Blue Winding
Sector
Slide 118
Six
-Step Commutation with
Six-Step
Inverter
+V
PWM1H
PWM2H
PWM3H
PWM1L
PWM2L
PWM3L
Sector
3 Phase
BLDC
Slide 119
Six
-Step Commutation with
Six-Step
Inverter
+V
PWM1H
PWM2H
PWM3H
PWM1L
PWM2L
PWM3L
Sector
3 Phase
BLDC
Slide 120
Six
-Step Commutation with
Six-Step
Inverter
+V
PWM1H
PWM2H
PWM3H
PWM1L
PWM2L
PWM3L
Sector
3 Phase
BLDC
Slide 121
Six
-Step Commutation with
Six-Step
Inverter
+V
PWM1H
PWM2H
PWM3H
PWM1L
PWM2L
PWM3L
Sector
3 Phase
BLDC
Slide 122
1 Electrical Revolution
Sector
OVDCON Value
POVD<7:0> POUT<7:0>
Sector
PWM1H
00000000
00100001
00000000
00100100
00000000
00000110
00000000
00010010
PWM2L
00000000
00011000
PWM3H
00000000
00001001
PWM3L
PWM1L
PWM2H
Slide 123
Start /
Stop
3-Phase
Voltages
Main State
Machine
Periodic
ISR
6-Step
Generation
GPIO
GPIO
dsPIC30F
3-Phase
Inverter
BLDC
Peripheral Block
Software Block
Slide 124
M1
M2
M3
5V
G
Slide 125
workspace
O
C:\...\Lab2\Lab2.mcw
Coding / / :
O
O
O
O
Continued...
2007 Microchip Technology Incorporated
Slide 126
O
O
O
S2
O !!!
???
O rough and loud (almost screeching)
WHY?
S2
O
Slide 127
Fixed Speed
1000 RPM
4 Amps Peak
Slide 128
Details of Program
O
Slide 129
Lab2
O
BLDC
Six-Step Commutation
O
BLDC
(4 Amps /
Position Feedback
Slide 130
BLDC
Rotor Angular Position
Resolver
360
O
(, 1 1024)
A/D +
()
180
0
Resolver Output
Sine
Cosine
Slide 131
BLDC
Rotor Angular Position
Optical Encoder
360
O
180
(, 500 )
QEI +
()
Slide 132
BLDC
Rotor Angular Position
Hall Effect
360
O
O
O
O
(, 1 30
Ext.
1~3 Hall
( )
180
0
Slide 133
BLDC
O
50%
,
3 - ,
120
- ,
Slide 134
BLDC Motor
Rotor magnets
Stator winding
Hall sensors
2007 Microchip Technology Incorporated
Slide 135
Red Winding
M1
Q1
HALL B
Q2
Green Winding
M2
Q4
HALL A
Q5
Q3
G
Q6
Blue Winding
M3
+TORQUE FIRING Q3,Q5 Q1,Q5 Q1,Q6 Q2,Q6 Q2,Q4 Q3,Q4 Q3,Q5 Q1,Q5 Q1,Q6
Sector
Hall States
Tr. On State :
W /V U /V U /W V /W V /U W /U W /V U /V U /W
0x24 0x06 0x12 0x18 0x09 0x21 0x24 0x06 0x12
Slide 136
HALL A / M1
60
HALL B / M3
HALL C / M2
+TORQUE FIRING
Q3,Q5
Sector
Q1,Q6
Q2,Q6
Q2,Q4
Q3,Q4
Q3,Q5
Q1,Q5
Q1,Q6
W /V
U /V
U /W
V /W
V /U
W /U
W /V
U /V
U /W
0x24
0x06
0x12
0x18
0x09
0x21
0x24
0x06
0x12
Hall States
Tr. On State :
Q1,Q5
Slide 137
HALL A / M3
60
HALL B / M2
HALL C / M1
+TORQUE FIRING
Q3,Q5
Sector
Q1,Q6
Q2,Q6
Q2,Q4
Q3,Q4
Q3,Q5
Q1,Q5
Q1,Q6
W /V
U /V
U /W
V /W
V /U
W /U
W /V
U /V
U /W
0x24
0x06
0x12
0x18
0x09
0x21
0x24
0x06
0x12
Hall States
Tr. On State :
Q1,Q5
Slide 138
-
-
Slide 139
Lab 3. OVDCON
OVDCON
BLDC
Slide 140
6 2(000,111)
6 60
Slide 141
Lab 3 Jumper
O
REF(R14) R60
- ( )
( )
Slide 142
OVDCON
BLDC
Start /
Stop
Main State
Machine
6-Step
Generation
OVDCON
GPIO
dsPIC30F
Angular
Position
3-Phase
Voltages
3-Phase
Inverter
BLDC
GPIO
Hall
Sensors
Slide 143
OVDCON
BLDC
:
Start
New Commutation
: PWM ,
Slide 144
Lab3 OVDCON
BLDC
O
Lab3 :
O
O
Workspace : C:\WIB\Lab3\Lab3.mcw
Lab 3 :
O
O
O
O
O
HallValue SixStepTable
HallValue Read & Mask & Shift OVDCON
dsPIC
(Run)
...
Slide 145
Lab 3 - OVDCON
BLDC
O
: S2
WHY?
: S2
Slide 146
Lab 3 - OVDCON
BLDC
?
O
O
O
O
-
Jumper
- dsPIC DSC Sensored
, S2 , DIP
PRGM DEBUG
MPLAB IDE
S2 ?
Slide 147
Lab 3 - OVDCON
BLDC
Maximum Speed
3800 RPM
200 mA Peak
Slide 148
Details of Program
O
MPLAB IDE
!
Slide 149
Lab3
O
O
-
BLDC
, OVDCON OFF
- H/W
With no PWM we have fixed motor speed.
Slide 150
Lab 4. MCPWM
BLDC
Slide 151
dsPIC DSC CN :
O
pin
- A,B,C CN5,6,7
CNxInterrupt , 3 -
, Lookup Table
BLDC
Slide 152
Hall Sensors
100
R
b
101
S
com
110
N
Hall A
CN or IC
N
com
Hall B
g
B
N
001
G
CN or IC
010
Hall C
CN or IC
com
011
Slide 153
Halls
C|B|A
OVDCON Value
C|B|A
100
110
010
011
001
101
POVD<7:0> POUT<7:0>
Sector
000
00000000
00000000
001
00100000
010
00001000
00010000 0x0810
011
00001000
PWM2H
00000001 0x0801
100
00000010
101
00100000
00000100 0x2004
110
00000010
PWM3H
00010000 0x0210
111
00000000
00000000
PWM1H
PWM3L
Slide 154
MCPWM
BLDC
Duty
Cycles
10-bit ADC
+5V
Voltage
6-Step
Generation
MCPWM
dsPIC30F
Start /
Stop
Main State
Machine
3-Phase
Inverter
BLDC
Hall
Sensors
CN
GPIO
Angular
Position
3-Phase
Voltages
Slide 155
MCPWM
BLDC
Hall Change ISR
:
Read new Hall values
New Commutation
Return
See Ch-15.3 & 15.4
Slide 156
Lab4
MCPWM
O
Lab4 :
O
O
C:\..\Lab4\Lab4.mcw Workspace
Lab 1 :
O
Code
dsPIC DSC
Slide 157
Lab4
MCPWM
O
O
O
S2 :
:
?
WHY?
S2 :
Slide 158
Lab4
MCPWM
O
O
: S2
3
LED Table
LED
Why?
O
O
Slide 159
Lab4
MCPWM
Hall Effect
Sensors
PWM1H
PWM1L
Slide 160
Lab4
O
MCPWM
3800 RPM
Slide 161
Lab 5. BLDC
Slide 162
PI(D) Loop
O
Proportional-Integral-Differential
CV = Pe + I e dt + D de/dt
Slide 163
Closed Loop
Desired Speed
Speed Error
PID
+-
Measured
Speed
Voltage
Speed
Calculation
Motor
Hall Sensor
Period
Slide 164
Digital PID
Up
Kp * Error
Speed Error
Desired Speed
+-
Ui
Measured Speed
dError
Kd *
Ki * Error dt
Voltage
Ud
dt
Slide 165
Digital PID
O
Up(T) = Kp * Error(T)
Kp * Error
Ki * Error dt
dError
Kd *
dt
Slide 166
Ki
Ki * Error dt
dError
Kd
Kp * Error
+
+
+
-1 * Error
1-Z
-1
Kd * (1 Z ) * Error
dt
Slide 167
Ki
-1
* Error
1-Z
+
+
+
Error *
Kp +
-1
Ki
-1
+ Kd (1 Z )
1-Z
-1
Kd * (1 Z ) * Error
Slide 168
-1
Ki
Kp +
-1
+ Kd (1 Z )
= Controller Output
1-Z
-1
Error *
Kp (1 Z )
-1 2
+ Ki +
Kd (1 Z )
= Controller Output
-1
1-Z
-1
-1
-2
= Controller Output
1-Z
Slide 169
-1
-2
= Controller Output
1-Z
-1
Slide 170
-1
-2
= Controller Output
1-Z
Slide 171
Sample Instruction
O MAC
W4*W5, A, [W8]+=2, W4, [W10]-=6, W5, W13
Source
operand
registers
Y
prefetch
source
Destination
accumulator
X
prefetch
source
Basic Syntax
2007 Microchip Technology Incorporated
Y
prefetch
destination
X
prefetch
destination
Other Acc.
Write-back
destination
Optional Arguments
Slide 172
Round Logic
40-bit Accumulator A
40-bit Accumulator B
Saturate
Saturate
Enable
40
Adder
Negate
16
X Data Bus
40
40
Barrel
Shifter
40
Zero-backfill
Sign Extend
32
33
17-bit
Multiplier/Scaler
16
16
16
Operand Pre-Processing
From W Array
2007 Microchip Technology Incorporated
To W Array
Slide 173
ADC
Fractional Data Format
ADC
O
-32768 ~ +32767
-1.0+1
.
Word
Value
0x8000
0xA000
0xC000
0xE000
0x0000
0x2000
0x4000
0x6000
0x7FFF
Integer
Value
-32768
-24576
-16384
-8192
0
8192
16384
24576
32767
Fractional
Value
-1.0
-0.75
-0.5
-0.25
0.0
+0.25
+0.5
+0.75
+0.999969
Slide 174
dsPIC DSC IC :
O
O
O
O
IC
-
3 - IC
ICxInterrupt , IC
IC
Slide 175
dsPIC Engine
Measured
Speed
Speed
Calculation
Measured
= (Fractional Divide)
Speed
O
O
Hall Sensor
Period
Minimum Period
IC Period
Slide 176
Lab5 BLDC
10-bit ADC
+5V
Required
Speed
+
Duty
Cycles
Voltage
Error
6-Step
Generation
PID
Measured
Speed
MCPWM
dsPIC30F
Angular
Position
3-Phase
Voltages
3-Phase
Inverter
BLDC
CN
Hall
Sensors
Start /
Stop
IC Period
Main State
Machine
IC
GPIO
Speed
Calculation
Slide 177
Lab5 BLDC
Hall Change ISR
Periodic ISR
Calculate Speed
Process PID
Return
New Commutation
Return
Slide 178
Lab5 BLDC
O
Lab5 :
O
O
C:\..\Lab5\Lab5.mcw Workspace
Lab 1 :
O
dsPIC DSC
...
2007 Microchip Technology Incorporated
Slide 179
Lab5 BLDC
O
O
O
O
: S2
:
Duty Cycle
WHY?
: S2
Slide 180
Lab5 BLDC
O
BLDC motor
Slide 181
Lab 6. BLDC
Slide 182
Lab 6. BLDC
O
Ripple
BLDC AC
- Update
(Amplitude)
Slide 183
Lab 6. BLDC
Q1
HALL A
Q2
Q3
60o
Red Winding
Q4
Q5
Q6
HALL B
Green Winding
50%
HALL C
Blue Winding
Sine Phase
Sector
Hall States
60
120
180
240
300
60
120
2%
Slide 184
50% 98%
Lab 6. BLDC
Operation
1
s
Executed
1
2
3
HALL A
Red Winding
1
2
3
1
2
3
60o
HALL C
Blue Winding
Sector
Hall States
60
120
5
5
0
4
1
6
180
240
300
2
2
3
3
4
1
0
5
5
Hall A,B,C :
60
Hall
Hall B :
IC (Input Capture)
-
Hall B :
-
HALL B
Green Winding
Sine Phase
60
120
0
4
1
6
Slide 185
Lab 6. BLDC
Amplitude
10-bit ADC
+5V
Required
Speed
+
Error
Duty
Cycles
Sine Waves
PID
Generation
Measured
Speed
MCPWM
dsPIC30F
Angular
Position
3-Phase
Voltages
3-Phase
Inverter
BLDC
CN
Hall
Sensors
Start /
Stop
IC Period
Main State
Machine
IC
GPIO
Speed
Calculation
Slide 186
Lab 6. BLDC
Control Technique:
Hall Change ISR
PWM ISR
Periodic ISR
Calculate Speed
Process PID
Return
Return
Return
Slide 187
Lab 6. BLDC
O
Lab6 :
O
O
C:\...\Lab6\Lab6.mcw
Lab 1 :
O
dsPIC DSC
...
2007 Microchip Technology Incorporated
Slide 188
Lab 6. BLDC
O
: S2
(Lab 5) ?
: S2
Slide 189
Lab 6. BLDC
Six-Step Control
Trapezoidal Phase Voltage
Slide 190
Lab6
O
BLDC
(Ripple)
Slide 191
Slide 192
(Phase advanced)
Phase advance ,
, Phase Advance
, (full) ,
,
Slide 193
-
(commutation)
,
- (commutation)
Phase advance
-
Slide 194
Phase Advance
Advance
NO ADVANCE
0
SECTOR
2007 Microchip Technology Incorporated
15 ADVANCE
2
Slide 195
Duty
Cycles
10-bit ADC
Required
Voltage
6-Step
Generation
MCPWM
dsPIC30F
3-Phase
Voltages
3-Phase
Inverter
BLDC
Start /
Stop
Hall
Sensors
Angular
Position
Main State
Machine
CN
GPIO
Phase
Advance
Slide 196
Scheduled ISR
Calculate Speed
Load saved Hall values
Duty Cycle = ADC
Predict new Hall values
Save Hall values
New Commutation,
Actual Sector + 1
Schedule ISR Based on
Actual Speed
Return
Return
Slide 197
Lab7 :
O
C:\..\Lab7\Lab7.mcw
Lab 1 :
O
dsPIC DSC
...
2007 Microchip Technology Incorporated
Slide 198
O
O
O
: S2
:
Phase Advance
WHY?
: S2
Slide 199
Extended Speed:
6500 RPM
1 A Peak
Slide 200
Program
O
MPLAB IDE
Slide 201
Lab7
O
Phase advance
70% (
)
Slide 202
Slide 203
Why sensorless?
O
O
O
O
O
O
Slide 204
Reliable
Varies linearly with speed
Works over a wide range of BLDC Motors
Relatively easy to implement
Works well for applications like Fan or
pump speed control
Slide 205
What is BEMF?
O
Motor
BEMF
O
O
O
Slide 206
DC+
A
Back EMF
DC- C
B
O
CN1
dsPIC30F3010
CN3
CN2
Slide 208
CN1
dsPIC30F3010
CN3
CN2
Slide 209
dsPIC30F3010
Signal Conditioning
Slide 210
0
T30
T60
0
SECTOR
5
Slide 211
1
Digital Signal Controller
O
O
O
O
Slide 212
Back EMF
Hall sensor
Slide 213
How to Start
Start Spinning
Spinning
O
O
O
Slide 214
Starting Algorithm
Parameters used in AN901
O
Slide 215
Starting Algorithm
Parameters used in AN901
O
Slide 216
Starting Algorithm
Parameters used in AN901
O
Slide 217
Slide 218
Slide 219
J7
2-3
J8
NC
J11
2-3
J12
NC
J13
2-3
J14
NC
J15
NC
J10
NC
J16
1-2
J17
1-2
J19
NC
Slide 220
Duty
Cycles
Voltage
Error
6-Step
Generation
PID
Angular
Position
Measured
Speed
Speed
Calculation
ZX
Period
ZX
Detect
3-Phase
Voltages
3-Phase
Inverter
BLDC
VBUS
Feedback
10-bit ADC
10-bit ADC
+5V
MCPWM
dsPIC30F
GPIO
3-Phase
Voltage Feedback
Start /
Stop
Main State
Machine
Slide 221
O
O
Slide 222
Use workspace
C:\WIB\Lab8\Lab8.mcw
Follow Lab 1 instructions to:
O
O
O
Compile code
Program dsPIC
Run code
Continued...
2007 Microchip Technology Incorporated
Slide 223
Slide 224
Slide 225
Slide 226
Slide 227
Slide 228
Slide 229
Slide 230
Slide 231
Slide 232
Slide 233
Slide 234
O
O
O
O
O
Slide 235
Phase PWM
Voltage
BEMF Zero
Crossing
Slide 236
Summary
O
O
O
O
O
O
O
O
O
Slide 237
Slide 238
Slide 239
The Microchip name and logo, the Microchip logo, Accuron, dsPIC, KeeLoq, MPLAB, PIC, PICmicro, PICSTART,
PRO MATE, PowerSmart and rfPIC are registered trademarks of Microchip Technology Incorporated in the U.S.A. and other countries.
AmpLab, FilterLab, microID, MXDEV, MXLAB, PICMASTER, SEEVAL, SmartShunt and The Embedded Control Solutions Company are registered
trademarks of Microchip Technology Incorporated in the U.S.A.
Application Maestro, dsPICDEM, dsPICDEM.net, dsPICworks, ECAN, ECONOMONITOR, FanSense, FlexROM, fuzzyLAB, In-Circuit Serial Programming,
ICSP, ICEPIC, Migratable Memory, MPASM, MPLIB, MPLINK, MPSIM, PICkit, PICDEM, PICDEM.net, PICtail, PowerCal, PowerInfo, PowerMate,
PowerTool, rfLAB, Select Mode, SmartSensor, SmartTel and Total Endurance are trademarks of Microchip Technology Incorporated in the U.S.A. and other
countries.
Serialized Quick Turn Programming (SQTP) is a service mark of Microchip Technology Incorporated in the U.S.A.
All other trademarks mentioned herein are property of their respective companies.
Slide 240