Freescale Semiconductor, Inc. BLDC Motor Control Board for Industrial . . . and Appliance c n Applications I , r o t c u Designer Reference d Manual n o c M68HC08 i m e Microcontrollers S e l a DRM007/D c 2/2003 s e e r F MOTOROLA.COM/SEMICONDUCTORS For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc. . . . c n I , r o t c u d n o c i m e S e l a c s e e r F For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc. BLDC Motor Control Board for Industrial and Appliance . . . Applications Reference Design c n I , r o t By: Jorge Zambada c Email: [email protected] u Applications Engineer — Mexico Applications Lab d n Diego Garay o Email: [email protected] c Applications Engineer — Mexico Applications Lab i m Maurizio Acosta e Email: [email protected] S Applications Engineer — Mexico Applications Lab e l a c s e e r F Motorola and the Stylized M Logo are registered trademarks of Motorola, Inc. DigitalDNA is a trademark of Motorola, Inc. This product incorporates SuperFlash® technology licensed from SST. ©Motorola, Inc., 2003 BLDC Motor Control Board for Industrial and Appliance Applications DRM007 MOTOROLA 3 For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc. Revision History To provide the most up-to-date information, the revision of our documents on the World Wide Web will be the most current. Your printed copy may be an earlier revision. To verify you have the latest information available, refer to: http://motorola.com/semiconductors The following revision history table summarizes changes contained in this document. For your convenience, the page number designators have been linked to the appropriate location. . . . Revision History c n I Revision Page Date Description Level Number(s) , r o February, 2003 N/A Initial release N/A t c u d n o c i m e S e l a c s e e r F DRM007 BLDC Motor Control Board for Industrial and Appliance Applications 4 MOTOROLA For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc. Designer Reference Manual — BLDC Motor Control Board List of Sections Section 1. Introduction and Setup. . . . . . . . . . . . . . . . . .15 Section 2. Operational Description . . . . . . . . . . . . . . . . .37 . . . c Section 3. Schematics and Bill of Materials. . . . . . . . . .43 n I , Section 4. Hardware Design Considerations . . . . . . . . .55 r o t c Section 5. Software Design Considerations. . . . . . . . . .71 u d n Section 6. Practical Results. . . . . . . . . . . . . . . . . . . . . . .97 o c i Section 7. Source Code . . . . . . . . . . . . . . . . . . . . . . . . .103 m e S e l a c s e e r F BLDC Motor Control Board for Industrial and Appliance Applications DRM007 MOTOROLA List of Sections 5 For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc. List of Sections . . . c n I , r o t c u d n o c i m e S e l a c s e e r F DRM007 BLDC Motor Control Board for Industrial and Appliance Applications 6 List of Sections MOTOROLA For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc. Designer Reference Manual — BLDC Motor Control Board Table of Contents Section 1. Introduction and Setup 1.1 Contents. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .15 . 1.2 Introduction. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .16 . . c 1.3 MC68HC908MR8. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .17 n I 1.4 MC68HC908MR8 Pulse-Width Modulator . . . . . . . . . . . . . . . .21 , r 1.4.1 Fault Protection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .23 o 1.4.2 PWM Output Alignment . . . . . . . . . . . . . . . . . . . . . . . . . . . .23 t c 1.4.3 PWM Counter Timebase . . . . . . . . . . . . . . . . . . . . . . . . . . .24 u 1.4.4 PWM Load Operations. . . . . . . . . . . . . . . . . . . . . . . . . . . . .24 d n 1.4.5 Direct Output Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .24 o 1.4.6 Deadtime Insertion. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .24 c i 1.5 Brief Overview to Brushless DC Motors. . . . . . . . . . . . . . . . . .25 m e 1.6 Washing Machine Application’s Overview . . . . . . . . . . . . . . . .28 S 1.6.1 Movement Patterns of the Washer. . . . . . . . . . . . . . . . . . . .28 e 1.6.2 Agitator Hits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .29 al 1.6.3 Software. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .29 c 1.6.4 User’s Menu. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .29 s 1.6.5 Control Scheme . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .29 e e 1.6.6 Target Washer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .30 r F 1.7 System Concept. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .30 1.8 Warnings. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .32 1.9 Setup Guide . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .33 1.9.1 Programming Mode Setup . . . . . . . . . . . . . . . . . . . . . . . . . .33 1.9.2 Running Mode Setup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .35 BLDC Motor Control Board for Industrial and Appliance Applications DRM007 MOTOROLA Table of Contents 7 For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc. Table of Contents Section 2. Operational Description 2.1 Contents. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .37 2.2 Introduction. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .37 2.3 Electrical Characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . .38 2.4 User Interfaces. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .39 2.5 Connectors Pin Descriptions . . . . . . . . . . . . . . . . . . . . . . . . . .41 2.5.1 J1 — AC Jack. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .41 2.5.2 J2 — 3-Phase Motor Connector. . . . . . . . . . . . . . . . . . . . . .41 . . 2.5.3 J3 — Single Phase Motor 1 Connector . . . . . . . . . . . . . . . .41 . c 2.5.4 J4 — Temperature Sensor Connector . . . . . . . . . . . . . . . . .41 n 2.5.5 J5 — RS-232 Interface Connector. . . . . . . . . . . . . . . . . . . .42 I , 2.5.6 J6 — External 18 Vdc Source Connector. . . . . . . . . . . . . . .42 r o 2.5.7 J7 — Single Phase Motor 2 Connector . . . . . . . . . . . . . . . .42 t 2.5.8 J8 — Motor Hall Effect Sensor Connector . . . . . . . . . . . . . .42 c u d Section 3. Schematics and Bill of Materials n o 3.1 Contents. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .43 c mi 3.2 Schematics. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .43 e 3.3 Bill of Materials. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .49 S e Section 4. Hardware Design Considerations l a c 4.1 Contents. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .55 s 4.2 Introduction. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .56 e e 4.3 Power Supply . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .56 r F 4.4 RS-232 interface and MON08 Hardware Interface. . . . . . . . . .58 4.5 Clock Source . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .59 4.6 Hall-Effect Sensors Interface . . . . . . . . . . . . . . . . . . . . . . . . . .60 4.7 LCD Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .61 4.8 Reset Button. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .61 4.9 3-Phase H-Bridge. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .63 4.10 Current Feedback and Cycle-by-Cycle Limiting. . . . . . . . . . . .64 DRM007 BLDC Motor Control Board for Industrial and Appliance Applications 8 Table of Contents MOTOROLA For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc. Table of Contents 4.11 Voltage Feedback. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .67 4.12 Current and Voltage Limiter . . . . . . . . . . . . . . . . . . . . . . . . . . .68 4.13 Heat Sink Selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .68 Section 5. Software Design Considerations 5.1 Contents. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .71 5.2 Introduction. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .72 5.3 Controller Design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .73 . . . 5.4 Speed Control Algorithm. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .76 c n 5.4.1 Motor Stalled Protection. . . . . . . . . . . . . . . . . . . . . . . . . . . .79 I 5.5 Commutation Algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .80 , r o 5.6 Data Flow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .83 t c 5.6.1 Processes: Latest Position Capture, u Period Measuring, and Speed Calculation . . . . . . . . . . .84 d 5.6.2 Process Speed Controller . . . . . . . . . . . . . . . . . . . . . . . . . .84 n o 5.6.3 Process MOSFET Gating Selection. . . . . . . . . . . . . . . . . . .84 c 5.6.4 Process Washing Machine. . . . . . . . . . . . . . . . . . . . . . . . . .86 i m 5.7 Application State Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . .86 e S 5.8 Drive State Machine. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .88 e 5.9 Description of Routines. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .89 l a 5.9.1 Main(void). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .89 c 5.9.1.1 Stop Motor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .89 s e 5.9.1.2 Waiting for Command . . . . . . . . . . . . . . . . . . . . . . . . . . .89 e 5.9.1.3 Displaying Actual and Reference Speed . . . . . . . . . . . . .89 r F 5.9.1.4 Wash . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .89 5.9.1.5 Spin CW and Spin CCW . . . . . . . . . . . . . . . . . . . . . . . . .90 5.9.1.6 Fixed Reference Speed. . . . . . . . . . . . . . . . . . . . . . . . . .90 5.9.2 InitPLL(void). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .90 5.9.3 InitPWMMC(void). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .90 5.9.4 InitTimerA(void) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .90 5.9.5 InitTimerB(void) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .91 5.9.6 Byte ResolveButtons(void). . . . . . . . . . . . . . . . . . . . . . . . . .91 5.9.7 InitMotor(Byte Commanded_Operation) . . . . . . . . . . . . . . .91 5.9.8 TimerAOverflow_ISR(void). . . . . . . . . . . . . . . . . . . . . . . . . .91 BLDC Motor Control Board for Industrial and Appliance Applications DRM007 MOTOROLA Table of Contents 9 For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc. Table of Contents 5.9.9 Signed Word 16 PIController(void). . . . . . . . . . . . . . . . . . . .92 5.9.10 MotorStalledProtection(void) . . . . . . . . . . . . . . . . . . . . . . . .92 5.9.11 HALLA_ISR(void) and HALLB_ISR(void). . . . . . . . . . . . . . .92 5.9.12 HALLC_ISR(void). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .92 5.9.13 Fault1_ISR(void) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .92 5.9.14 NextSequence(void). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .92 5.9.15 InitLCD(void) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .93 5.9.16 CtrlLCD(Byte ctrl). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .93 5.9.17 Ctrl8LCD(Byte ctrl). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .93 5.9.18 MovCursorLCD(Byte places, Byte dir) . . . . . . . . . . . . . . . . .93 . . 5.9.19 DataLCD(Byte data). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .94 . c 5.9.20 StringLCD(Byte *msgLCD). . . . . . . . . . . . . . . . . . . . . . . . . .94 n 5.9.21 WaitMs(Byte milis) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .94 I , 5.9.22 Wait40ms(void) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .94 r o 5.10 MCU Usage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .95 t c u Section 6. Practical Results d n o Section 7. Source Code c i m 7.1 Contents. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .103 e 7.2 Include Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .104 S 7.2.1 MR8IO.H . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .104 e 7.2.2 START08.H . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .108 l a 7.2.3 MAIN.H. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .110 c 7.2.4 TIMER.H. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .111 s e 7.2.5 LCD.H. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .113 e 7.2.6 TABLES.H . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .115 r F 7.3 Source Code Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .116 7.3.1 START08.C . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .116 7.3.2 MAIN.C. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .122 7.3.3 TIMER.C. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .127 7.3.4 LCD.C. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .145 DRM007 BLDC Motor Control Board for Industrial and Appliance Applications 10 Table of Contents MOTOROLA For More Information On This Product, Go to: www.freescale.com
Description: