Motorola M68HC08 User manual

Type
User manual
MOTOROLA.COM/SEMICONDUCTORS
M68HC08
Microcontrollers
DRM046
Rev. 0, 09/2003
Low Power BLDC
Designer Reference
Reference Design
Manual
Drive for Fans using
the MC68HC908QY4
Frees
cale Semiconductor,
I
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
nc...
Frees
cale Semiconductor,
I
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
nc...
DRM046 — Rev 0 Designer Reference Manual
MOTOROLA 3
Low Power BLDC Drive for
Fans using the
MC68HC908QY4 Reference
Design
Designer Reference Manual — Rev 0
by: Radim Visinka, MCSL, Roznov
BLDC Motor Theory by: Pavel Grasblum, MCSL, Roznov
Metrowerks and the Metrowerks logo are registered trademarks of
Metrowerks, Inc., a wholly owned subsidiary of Motorola, Inc.
CodeWarrior is a registered trademark of Metrowerks, Inc., a wholly
owned subsidiary of Motorola, Inc.
Frees
cale Semiconductor,
I
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
nc...
Designer Reference Manual DRM046 — Rev 0
4 MOTOROLA
Frees
cale Semiconductor,
I
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
nc...
DRM046 — Rev 0 Designer Reference Manual
MOTOROLA List of Sections 5
Designer Reference Manual — DRM046
List of Sections
Section 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
Section 2. MC68HC908QY Family Advantages and
Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
Section 3. BLDC Motor Theory . . . . . . . . . . . . . . . . . . . . 17
Section 4. 3-Phase BLDC Low Voltage Reference
Design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .25
Section 5. Hardware Design. . . . . . . . . . . . . . . . . . . . . . . 31
Section 6. Software Design . . . . . . . . . . . . . . . . . . . . . . . 45
Section 7. References. . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
Section 8. Appendix A — Schematics and Parts List . .63
Section 9. Appendix B — System Set-up . . . . . . . . . . . . 71
Frees
cale Semiconductor,
I
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
nc...
List of Sections
Designer Reference Manual DRM046 — Rev 0
6 List of Sections MOTOROLA
Frees
cale Semiconductor,
I
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
nc...
DRM046 — Rev 0 Designer Reference Manual
MOTOROLA Table of Contents 7
Designer Reference Manual — DRM046
Table of Contents
Section 1. Introduction
Section 2. MC68HC908QY Family Advantages and
Features
Section 3. BLDC Motor Theory
3.1 Digital Control of a BLDC Motor . . . . . . . . . . . . . . . . . . . . . . . .18
3.2 Independent Switching of Power Transistors . . . . . . . . . . . . . .19
3.3 Complementary Switching of Power Transistors . . . . . . . . . . .20
3.4 Commutation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .21
Section 4. 3-Phase BLDC Low Voltage Reference Design
4.1 Application Outline . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .25
4.2 Application Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .26
Section 5. Hardware Design
5.1 Pin-by-Pin Descriptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .33
5.2 Detailed Design Description . . . . . . . . . . . . . . . . . . . . . . . . . . .36
Section 6. Software Design
6.1 Data Flow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .45
6.2 Software Implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . .49
6.3 Application Porting for the Customer Specific BLDC Motor . . .52
6.4 Software Listing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .57
Frees
cale Semiconductor,
I
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
nc...
Table of Contents
Designer Reference Manual DRM046 — Rev 0
8 Table of Contents MOTOROLA
6.5 Microcontroller Memory and Peripheral Usage . . . . . . . . . . . .58
Section 7. References
Section 8. Appendix A — Schematics and Parts List
8.1 Schematics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .63
8.2 Parts Lists. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .67
Section 9. Appendix B — System Set-up
9.1 Contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .71
9.2 Hardware Setup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .71
9.3 Jumper Settings for Controller Board . . . . . . . . . . . . . . . . . . . .72
9.4 Required Software Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . .74
9.5 Building and Uploading the Application . . . . . . . . . . . . . . . . . .74
9.6 Executing the Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . .75
Frees
cale Semiconductor,
I
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
nc...
DRM046 — Rev 0 Designer Reference Manual
MOTOROLA List of Figures 9
Designer Reference Manual — DRM046
List of Figures
Figure Title Page
1-1 Low Power BLDC Drive for Fan . . . . . . . . . . . . . . . . . . . . . . . .13
3-1 BLDC Motor - Cross Section . . . . . . . . . . . . . . . . . . . . . . . . . .17
3-2 Voltage Strokes Applied to the 3-ph BLDC Motor . . . . . . . . . .18
3-3 3-phase BLDC Power Stage. . . . . . . . . . . . . . . . . . . . . . . . . . .19
3-4 Independent Switching of Power Transistors . . . . . . . . . . . . . .20
3-5 Complementary Switching of Power Transistors . . . . . . . . . . .21
3-6 Stator Flux Vectors at Six-Step Control . . . . . . . . . . . . . . . . . .22
3-7 Situation Right Before Commutation . . . . . . . . . . . . . . . . . . . .23
3-8 Situation Right After Commutation . . . . . . . . . . . . . . . . . . . . . .23
4-1 System Concept . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .27
5-1 Three-Phase BLDC Drive. . . . . . . . . . . . . . . . . . . . . . . . . . . . .32
5-2 Block Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .33
5-3 Microcontroller with Logic . . . . . . . . . . . . . . . . . . . . . . . . . . . . .38
5-4 Hall Sensor Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .39
5-5 User’s Interface. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .40
5-6 3-Phase H Bridge (Phase A Shown) . . . . . . . . . . . . . . . . . . . .42
5-7 Current Sensing - Detail . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .43
6-1 Algorithm Data Flow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .46
6-2 Closed Loop Speed Control . . . . . . . . . . . . . . . . . . . . . . . . . . .48
6-3 Software Implementation - General Overview . . . . . . . . . . . . .50
6-4 Stator Flux Vectors with Sectors. . . . . . . . . . . . . . . . . . . . . . . .53
8-1 Microcontroller with Hall Sensor Input and User’s Interface. . .64
8-2 Power Stage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .65
8-3 Power Supply . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .66
9-1 Setup of the Application with BLDC Motor . . . . . . . . . . . . . . . . 72
9-2 Jumper Reference of BLDC Drive Board . . . . . . . . . . . . . . . . .73
Frees
cale Semiconductor,
I
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
nc...
List of Figures
Designer Reference Manual DRM046 — Rev 0
10 List of Figures MOTOROLA
Frees
cale Semiconductor,
I
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
nc...
DRM046 — Rev 0 Designer Reference Manual
MOTOROLA List of Tables 11
Designer Reference Manual — DRM046
List of Tables
Table Title Page
2-1 Summary of Device Variations . . . . . . . . . . . . . . . . . . . . . . . . .15
3-1 Commutation Sequence for Counterclockwise Rotation . . . . .24
3-2 Commutation Sequence for Clockwise Rotation . . . . . . . . . . .24
5-1 Connector J4 Signal Descriptions. . . . . . . . . . . . . . . . . . . . . . .34
5-2 Jack Connector J2 Signal Descriptions . . . . . . . . . . . . . . . . . .34
5-3 Connector J5 Signal Descriptions. . . . . . . . . . . . . . . . . . . . . . .34
5-4 Jack Connector J1 Signal Descriptions . . . . . . . . . . . . . . . . . .35
5-5 Jack Connector J3 Signal Descriptions . . . . . . . . . . . . . . . . . .36
5-6 Connection of Signals to MCU . . . . . . . . . . . . . . . . . . . . . . . . .37
6-1 Determination of Hall Sensor Pattern . . . . . . . . . . . . . . . . . . . .53
6-2 Determination of Commutation Vector for CCW. . . . . . . . . . . .54
6-3 Determination of Commutation Vector for CW . . . . . . . . . . . . .55
6-4 Commutation Table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .56
6-5 Memory Usage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .58
6-6 MC68HC908QY4 Modules Usage . . . . . . . . . . . . . . . . . . . . . .58
8-1 Parts List. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .67
9-1 BLDC Drive Board Jumper Settings . . . . . . . . . . . . . . . . . . . . .73
Frees
cale Semiconductor,
I
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
nc...
List of Tables
Designer Reference Manual DRM046 — Rev 0
12 List of Tables MOTOROLA
Frees
cale Semiconductor,
I
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
nc...
DRM046 — Rev 0 Designer Reference Manual
MOTOROLA Introduction 13
Designer Reference Manual — DRM046
Section 1. Introduction
This Application Note describes the design of a low power 3-phase
BLDC (Brushless DC) motor drive with Hall Sensors, based on
Motorola’s MC68HC908QY4 microcontroller.
Figure 1-1. Low Power BLDC Drive for Fan
BLDC motors are very popular in a wide application area. Compared
with a DC motor, the BLDC motor uses an electric commutator
(replacing the mechanical commutator), and so is more reliable than the
DC motor. In BLDC motors, rotor magnets generate the rotor’s magnetic
flux so that they achieve higher efficiency. Therefore, BLDC motors may
be used in white goods, high-end pumps, fans and in other appliances
which require high reliability and efficiency.
Frees
cale Semiconductor,
I
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
nc...
Introduction
Designer Reference Manual DRM046 — Rev 0
14 Introduction MOTOROLA
The concept of the application is a speed-closed loop BLDC drive using
a Hall position sensor. It serves as a reference design of a BLDC motor
control system for a low voltage fan application. The power stage is
designed for 48V DC line voltage and 400W output power. The
application is based on the low-cost MC68HC908QY4 “Nitron“
microcontroller. The design is focused on minimal cost and maximal
component integration for low cost applications.
This Application Note includes the basic motor theory, system design
concept, hardware and software design, hardware schematics, and s/w
listing. The design can be used as a reference design for developing
customer specific applications.
Frees
cale Semiconductor,
I
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
nc...
DRM046 — Rev 0 Designer Reference Manual
MOTOROLA MC68HC908QY Family Advantages and Features 15
Designer Reference Manual — DRM046
Section 2. MC68HC908QY Family Advantages and Features
The MC68HC908QY4 is a member of the low-cost, high-performance
M68HC08 Family of 8-bit microcontroller units (MCUs). All MCUs in the
family use the enhanced M68HC08 central processor unit (CPU08) and
are available with a variety of modules, memory sizes and types, and
package types.
Features include:
High-performance M68HC08 CPU core
5-V and 3-V operating voltages (V
DD)
8-MHz internal bus operation at 5 V, 4-MHz at 3 V
Trimmable internal oscillator
3.2 MHz internal bus operation
8-bit trim capability (± 25% untrimmed, ± 5% trimmed)
Auto wake-up from STOP capability
Table 2-1. Summary of Device Variations
Device FLASH Memory Size RAM Memory Size
Analog-to-Digital
Converter
Pin
Count
MC68HC908QT1 1536 bytes 128 Bytes - 8 pins
MC68HC908QT2 1536 bytes 128 Bytes 4 ch, 8 bit 8 pins
MC68HC908QT4 4096 bytes 128 Bytes 4 ch, 8 bit 8 pins
MC68HC908QY1 1536 bytes 128 Bytes - 16 pins
MC68HC908QY2 1536 bytes 128 Bytes 4 ch, 8 bit 16 pins
MC68HC908QY4 4096 bytes 128 Bytes 4 ch, 8 bit 16 pins
Frees
cale Semiconductor,
I
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
nc...
MC68HC908QY Family Advantages and Features
Designer Reference Manual DRM046 — Rev 0
16 MC68HC908QY Family Advantages and Features MOTOROLA
On-chip in-application programmable FLASH memory
On-chip random-access memory (RAM)
• 2-channel, 16-bit timer interface module (TIM)
• 4-channel, 8-bit analog-to-digital converter (ADC) on
MC68HC908QY2, MC68HC908QY4, MC68HC908QT2, and
MC68HC908QT4
5 or 13 bidirectional input/output (I/O) lines, and one input only
6-bit keyboard interrupt with walk-up feature (KBI)
Low-voltage inhibit (LVI) module
System protection features
External asynchronous interrupt pin with internal pull-up (IRQ)
shared with general-purpose input pin
Master asynchronous reset pin (RST) shared with
general-purpose input/output (I/O) pin
Power-on reset
Power saving stop and wait modes
MC68HC908QY4, MC68HC908QY2, and MC68HC908QY1 are
available in these packages:
16-pin plastic dual in-line package (PDIP)
16-pin small outline integrated circuit (SOIC) package
16-pin thin shrink small outline package (TSSOP)
• MC68HC908QT4, MC68HC908QT2, and MC68HC908QT1 are
available in these packages:
8-pin PDIP
8-pin SOIC
8-pin dual flat no lead (DFN) package
The BLDC motor control application requires six PWM outputs, three
Hall position sensor inputs and an ADC channel for voltage
measurements as a minimum. Therefore 16-pin MC68HC908QY2 or
MC68HC908QY4, that accommodate ADC, are the right choice.
Frees
cale Semiconductor,
I
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
nc...
DRM046 — Rev 0 Designer Reference Manual
MOTOROLA BLDC Motor Theory 17
Designer Reference Manual — DRM046
Section 3. BLDC Motor Theory
A brushless DC (BLDC) motor is a rotating electric machine where the
stator is a classic three-phase stator like that of an induction motor, and
the rotor has surface-mounted permanent magnets (see Figure
3-1. BLDC Motor - Cross Section).
In this respect, the BLDC motor is equivalent to a reversed DC
commutator motor, in which the magnet rotates while the conductors
remain stationary. In the DC commutator motor, the current polarity is
altered by the commutator and brushes. On the other hand, in the
brushless DC motor, the polarity reversal is performed by power
transistors switching in synchronization with the rotor position.
Therefore, BLDC motors often incorporate either internal or external
position sensors to sense the actual rotor position, or the position can be
detected without sensors.
Figure 3-1. BLDC Motor - Cross Section
Stator
Stator winding
(in slots)
Shaft
Rotor
Air gap
Permanent magnets
Frees
cale Semiconductor,
I
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
nc...
BLDC Motor Theory
Designer Reference Manual DRM046 — Rev 0
18 BLDC Motor Theory MOTOROLA
3.1 Digital Control of a BLDC Motor
The BLDC motor is driven by rectangular voltage strokes coupled with
the given rotor position (see Figure 3-2. Voltage Strokes Applied to
the 3-ph BLDC Motor). The generated stator flux interacts with the rotor
flux, which is generated by a rotor magnet, defines the torque and thus
the speed of the motor. The voltage strokes must be properly applied to
the two phases of the three-phase winding system so that the angle
between the stator flux and the rotor flux is kept close to 90°, to get the
maximum generated torque. Due to this fact, the motor requires
electronic control for proper operation.
Figure 3-2. Voltage Strokes Applied to the 3-ph BLDC Motor
For the common 3-phase BLDC motor a standard 3-phase power stage
is used, as is illustrated in Figure 3-3. 3-phase BLDC Power Stage.
The power stage utilizes six power transistors with switching in either the
independent mode or complementary mode.
30º 60º 90º 120º 150º 180º 210º 240º 270º 300º 330º
Electrical
angle
Voltage
Phase A
Phase B
Phase C
+U
DCB
-U
DCB
+U
DCB
-U
DCB
+U
DCB
-U
DCB
Frees
cale Semiconductor,
I
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
nc...
BLDC Motor Theory
Independent Switching of Power Transistors
DRM046 — Rev 0 Designer Reference Manual
MOTOROLA BLDC Motor Theory 19
Figure 3-3. 3-phase BLDC Power Stage
In both modes the 3-phase power stage energizes two motor phases
concurrently. The third phase is unpowered (see Figure 3-2. Voltage
Strokes Applied to the 3-ph BLDC Motor). Thus, we get six possible
voltage vectors that are applied to the BLDC motor using a PWM
technique. There are two basic types of power transistor switching:
independent switching, and complementary switching.
3.2 Independent Switching of Power Transistors
With independent switching, only two transistors are switched on when
current is conducted from the power supply to the phase of the BLDC
motor. In one phase, the top transistor is switched on; in the second
phase, the bottom transistor is switched on and the third phase is not
powered. During freewheeling all transistors are switched off (see
Figure 3-4. Independent Switching of Power Transistors).
Q1
PWM_Q5
Q6
Q4
C1
Phase_
C
PWM_Q1
PWM_Q4
PWM_Q3
Phase_B
GND
Q2
U
DCB
PWM_Q2
Phase_A
Q3
PWM_Q6
Q5
Frees
cale Semiconductor,
I
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
nc...
BLDC Motor Theory
Designer Reference Manual DRM046 — Rev 0
20 BLDC Motor Theory MOTOROLA
Figure 3-4. Independent Switching of Power Transistors
3.3 Complementary Switching of Power Transistors
With complementary switching, two transistors are switched on when the
phase of the BLDC motor is connected to the power supply. But there is
a difference during freewheeling. With independent switching, all the
transistors are switched off. The current continues to flow in the same
direction through freewheeling diodes until it falls to zero. Contrary to
this, with complementary switching, the complementary transistors are
switched on during freewheeling. Thus the current may be able to flow
in the opposite direction. Figure 3-5. Complementary Switching of
Power Transistors depicts the complementary switching.
10º 20º
30º
40º 50º 60º 70º 80º 90º
Electrical
angle
PWM Q1
PWM Q2
PWM Q3
PWM Q4
PWM Q5
PWM Q6
PWM
switching
ON
OFF
ON
OFF
OFF
ON
ON
OFF
OFF
OFF
ON
ON
Frees
cale Semiconductor,
I
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
nc...
  • Page 1 1
  • Page 2 2
  • Page 3 3
  • Page 4 4
  • Page 5 5
  • Page 6 6
  • Page 7 7
  • Page 8 8
  • Page 9 9
  • Page 10 10
  • Page 11 11
  • Page 12 12
  • Page 13 13
  • Page 14 14
  • Page 15 15
  • Page 16 16
  • Page 17 17
  • Page 18 18
  • Page 19 19
  • Page 20 20
  • Page 21 21
  • Page 22 22
  • Page 23 23
  • Page 24 24
  • Page 25 25
  • Page 26 26
  • Page 27 27
  • Page 28 28
  • Page 29 29
  • Page 30 30
  • Page 31 31
  • Page 32 32
  • Page 33 33
  • Page 34 34
  • Page 35 35
  • Page 36 36
  • Page 37 37
  • Page 38 38
  • Page 39 39
  • Page 40 40
  • Page 41 41
  • Page 42 42
  • Page 43 43
  • Page 44 44
  • Page 45 45
  • Page 46 46
  • Page 47 47
  • Page 48 48
  • Page 49 49
  • Page 50 50
  • Page 51 51
  • Page 52 52
  • Page 53 53
  • Page 54 54
  • Page 55 55
  • Page 56 56
  • Page 57 57
  • Page 58 58
  • Page 59 59
  • Page 60 60
  • Page 61 61
  • Page 62 62
  • Page 63 63
  • Page 64 64
  • Page 65 65
  • Page 66 66
  • Page 67 67
  • Page 68 68
  • Page 69 69
  • Page 70 70
  • Page 71 71
  • Page 72 72
  • Page 73 73
  • Page 74 74
  • Page 75 75
  • Page 76 76
  • Page 77 77
  • Page 78 78

Motorola M68HC08 User manual

Type
User manual

Ask a question and I''ll find the answer in the document

Finding information in a document is now easier with AI