Freescale Semiconductor DRM079 User Manual

Variable Speed DC Fan Control using the MC9RS08KA2
Designer Reference Manual
RS08 Microcontrollers
DRM079 Rev. 0 5/2006
freescale.com
Variable Speed DC Fan Control using the MC9RS08KA2
Designer Reference Manual
by: Vincent Ko
Freescale Semiconductor, Inc. Hong Kong
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 that you have the latest information available, refer to http://www.freescale.com
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
Date
05/2006 0 Initial release N/A
Freescale Semiconductor 3
Revision
Level
Description
Variable Speed DC Fan Control using the MC9RS08KA2, Rev. 0
Page
Number(s)
Revision History
Variable Speed DC Fan Control using the MC9RS08KA2, Rev. 0
4 Freescale Semiconductor
Table of Contents
Chapter 1
Introduction
1.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
1.2 Freescale’s New Generation Ultra Low Cost MCU . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
1.3 DC Fan Reference Design Targets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
1.4 Bi-Phase BLDC Motor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
Chapter 2
Motor Control
2.1 Commutation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
2.2 Rotor Position Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
2.3 Commutation Waveforms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
2.4 Speed Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
2.5 Motor Startup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
2.6 Fault Detection. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
Chapter 3
Implementation
3.1 Block Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
3.2 Hardware Resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
3.3 Control Loop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
3.4 Temperature Sensor Measurement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
3.4.1 Temperature Conversion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
Appendix A.
Schematic
Appendix B.
Program Listing
Variable Speed DC Fan Control using the MC9RS08KA2, Rev. 0
Freescale Semiconductor 5
Table of Contents
Variable Speed DC Fan Control using the MC9RS08KA2, Rev. 0
6 Freescale Semiconductor

Chapter 1 Introduction

1.1 Introduction

This document describes the implementation of a DC brushless fan controller using the Freescale ultra low cost MC9RS08KA2 8-bit microcontroller (MCU). The design contains a temperature sensor the MCU reads with control on fan speed against the ambient temperature. Complete coding and schematic are included.
VARIABLE RESISTOR (TO EMULATE A TEMPERATURE SENSOR)
MC9RS08KA2 MCU IN 8-PIN NARROW BODY SOIC PACKAGE
BUZZER
Figure 1-1. The MC9RS08KA2 DC Fan Reference Design
The DC fan used is a brushless DC motor fan. It is widely used in chip cooling or system ventilation applications. In the market, most of the DC fans are of the constant air flow design. As the high performance electronic products continue to increase, cooling requirement becomes more and more sophisticated. MCU approach provides a cost effective solution to this application. There are several advantages of a MCU based design over traditional solutions.
1. Instead of having a constant air flow the MCU provides enough processing power to modify the fan speed according to environment changes such as the temperature of the target system.
2. Fault detection can easily be implemented by the MCU. For example, the MCU can detect for the air flow blocking or motor jam, the motor driver can be stopped completely to avoid further damage.
3. Buzzer alarm or digital output acknowledgement can be generated under the faulty situation.
The MCU chosen for this purpose must be low cost and it must provide small geometry package to integrate into the fan controller printed circuit board (PCB). The MC9RS08KA2 is ideal for this application.
Variable Speed DC Fan Control using the MC9RS08KA2, Rev. 0
Freescale Semiconductor 7
Introduction

1.2 Freescale’s New Generation Ultra Low Cost MCU

The MC9RS08KA2 microcontroller unit (MCU) is an extremely low cost, small pin count device for home appliances, toys, and small geometry applications, such as a DC fan controller. This device is composed of standard on-chip modules including a very small and highly efficient RS08 CPU core, 62 bytes RAM, 2K bytes FLASH, an 8-bit modulo timer, keyboard interrupt, and analog comparator. The device is available in small 6- and 8-pin packages.
Features of the MC9RS08KA2 include:
8-bit RS08 core – Up to 10 MHz (bus frequency) at 1.8V for 100 ns minimum instruction time – RS08 instruction set – Supports tiny/short address mode – 14-byte fast-access RAM – Allows emulation of HC08/HCS08 zero-offset index addressing mode instructions
Third-generation Flash and RAM (extremely fast, byte writable programming) – 63 Byte RAM – 2K Byte Flash
Flexible clock options
4 Bidirectional I/O lines with software selectable pull-up (eliminates need for external resistors)
Analog comparator
Real time interrupt
8-bit timer with 8-bit prescale
System protection – Resets in instance of runaways or corrupted code – Low voltage detection – Illegal opcode and illegal address detection – Flash security feature
Single wire debugging and emulation interface; eliminates need for expensive emulation tools or development hardware

1.3 DC Fan Reference Design Targets

Table 1-1. Design Targets
Item Requirement
Motor Type Bi-phase BLDC motor
Fan Dimensions 60mm x 60mm x 25mm
Operating Voltage 12V
Current Rating 0.18A (max.)
Speed 1000 to 4000 RPM
Temperature Feedback Yes
Fault Detection Air flow blocking (motor jam)
Fault Notification Buzzer alarm
Variable Speed DC Fan Control using the MC9RS08KA2, Rev. 0
8 Freescale Semiconductor
Bi-Phase BLDC Motor

1.4 Bi-Phase BLDC Motor

The brushless DC motor (BLDC) design for DC fan is commonly consist of a permanent magnet attached on the rotor and the stator phase coil windings are mounted on the motor shaft as illustrated in Figure 1-2. The BLDC has no brushes on the rotor and the commutation is performed electronically at certain rotor positions.
Hall Effect Sensor
Stator Coil
Fan Hub
Axle
Permanent Magnets
Figure 1-2. Bi-Phase BLDC Motor Diagram
Variable Speed DC Fan Control using the MC9RS08KA2, Rev. 0
Freescale Semiconductor 9
Introduction
Variable Speed DC Fan Control using the MC9RS08KA2, Rev. 0
10 Freescale Semiconductor
Commutation

Chapter 2 Motor Control

2.1 Commutation

The typical bi-phase BLDC has one pole-pair per phase. Each commutation rotates the rotor by 90 degrees and four commutation steps complete a mechanical revolution. Each pole-pair is implemented by two coils, with four coils in total for a bi-phase motor. Energizing a pair of coils, either coil A & C or coil B & D as shown in Figure 2-1, induces magnetic fields that push the equal polarity rotor magnets away from the energized coils and at the same time the opposite polarity rotor magnets are pulled toward the coils. Rotation starts and this is called a commutation step. When the rotor magnetic pole is aligned with the energized coils, the coils are deactivated and the previously un-energized pair of coils are then energized. As the magnetic field switches to the next motor position or pole, the inertia of the rotor keeps the motor running. As a result, two commutation steps moves the rotor by 180 degrees or one motor phase. One mechanical revolution is contributed by four commutation steps.
To avoid conflict to the magnetic field, adjacent coils cannot be energized at the same time. Dead-time, where all coils are un-energized must be added between each commutation step.
N
L2
S
L1
HALL
Coil A
Coil D
Coil B
L1
Coil C
S
L2
N
Figure 2-1. Bi-phase BLDC Motor Schematic

2.2 Rotor Position Control

The key idea to prevent a motor lockup concerns rotor position detection. The time to switch the commutation is critical. Energizing coil-pair for too long will kill the rotor inertia and the motor stops running. This is called motor lockup. Switching the commutation too soon will lose control to the rotor and eventually stall the motor. The rotor position in this design is determined by a hall sensor which will respond to the change in magnetic field. Hall sensor output toggles when the magnetic field changes its polarity. Positioning the hall sensor between the coils at 45 degree to the stator coils, as shown in
Figure 2-1, can effectively detect the rotor position. In this case the hall sensor output toggles when the
rotor magnets is aligned to the coils. Commutation should switch at this time from one coil-pair to the next coil-pair.
Variable Speed DC Fan Control using the MC9RS08KA2, Rev. 0
Freescale Semiconductor 11
Loading...
+ 23 hidden pages