79
© 2007 Microchip Technology Incorporated. All Rights Reserved. 11081 DIF Slide 1 11081 DIF Intelligent Motor Control: A Fan Application

11081 DIF - amoBBSd1.amobbs.com/bbs_upload782111/files_10/ourdev_287709.pdf · 11081 DIF Slide 2 Class objective OWhen ... 11081 DIF Slide 37 PWM Drive Position Sense Signal Conditioning

  • Upload
    vutu

  • View
    217

  • Download
    0

Embed Size (px)

Citation preview

Page 1: 11081 DIF - amoBBSd1.amobbs.com/bbs_upload782111/files_10/ourdev_287709.pdf · 11081 DIF Slide 2 Class objective OWhen ... 11081 DIF Slide 37 PWM Drive Position Sense Signal Conditioning

© 2007 Microchip Technology Incorporated. All Rights Reserved. 11081 DIF Slide 1

11081 DIFIntelligent Motor Control:

A Fan Application

Page 2: 11081 DIF - amoBBSd1.amobbs.com/bbs_upload782111/files_10/ourdev_287709.pdf · 11081 DIF Slide 2 Class objective OWhen ... 11081 DIF Slide 37 PWM Drive Position Sense Signal Conditioning

© 2007 Microchip Technology Incorporated. All Rights Reserved. 11081 DIF Slide 2

Class objectiveWhen you finish this class you will:− Describe how PIC® microcontrollers can

be used to control and monitor brushless DC fans

− Discuss different control loop techniques and their associated tradeoffs

− Provide information on fully utilizing the available microcontroller peripherals

Page 3: 11081 DIF - amoBBSd1.amobbs.com/bbs_upload782111/files_10/ourdev_287709.pdf · 11081 DIF Slide 2 Class objective OWhen ... 11081 DIF Slide 37 PWM Drive Position Sense Signal Conditioning

© 2007 Microchip Technology Incorporated. All Rights Reserved. 11081 DIF Slide 3

Agenda

Brushless motor basics (hardware background)

Interpreting inputs

Generating outputs

Control software

Page 4: 11081 DIF - amoBBSd1.amobbs.com/bbs_upload782111/files_10/ourdev_287709.pdf · 11081 DIF Slide 2 Class objective OWhen ... 11081 DIF Slide 37 PWM Drive Position Sense Signal Conditioning

© 2007 Microchip Technology Incorporated. All Rights Reserved. 11081 DIF Slide 4

Brushless MotorBasics

Page 5: 11081 DIF - amoBBSd1.amobbs.com/bbs_upload782111/files_10/ourdev_287709.pdf · 11081 DIF Slide 2 Class objective OWhen ... 11081 DIF Slide 37 PWM Drive Position Sense Signal Conditioning

© 2007 Microchip Technology Incorporated. All Rights Reserved. 11081 DIF Slide 5

Inside The FanFan

Windings

Magnetic Core

Hall-Effect Position Sensor

Permanent Ring

Magnet

Page 6: 11081 DIF - amoBBSd1.amobbs.com/bbs_upload782111/files_10/ourdev_287709.pdf · 11081 DIF Slide 2 Class objective OWhen ... 11081 DIF Slide 37 PWM Drive Position Sense Signal Conditioning

© 2007 Microchip Technology Incorporated. All Rights Reserved. 11081 DIF Slide 6

Two PhaseSupply Voltage

Current Always Flows in the Same

Direction

Page 7: 11081 DIF - amoBBSd1.amobbs.com/bbs_upload782111/files_10/ourdev_287709.pdf · 11081 DIF Slide 2 Class objective OWhen ... 11081 DIF Slide 37 PWM Drive Position Sense Signal Conditioning

© 2007 Microchip Technology Incorporated. All Rights Reserved. 11081 DIF Slide 7

Two Phase

N

N

S

S

N

N

S

S

Hall DeviceDetects Pole

Change

Page 8: 11081 DIF - amoBBSd1.amobbs.com/bbs_upload782111/files_10/ourdev_287709.pdf · 11081 DIF Slide 2 Class objective OWhen ... 11081 DIF Slide 37 PWM Drive Position Sense Signal Conditioning

© 2007 Microchip Technology Incorporated. All Rights Reserved. 11081 DIF Slide 8

Two Phase

N N

S

SHall Device

Detects PoleChange

N NSS

Page 9: 11081 DIF - amoBBSd1.amobbs.com/bbs_upload782111/files_10/ourdev_287709.pdf · 11081 DIF Slide 2 Class objective OWhen ... 11081 DIF Slide 37 PWM Drive Position Sense Signal Conditioning

© 2007 Microchip Technology Incorporated. All Rights Reserved. 11081 DIF Slide 9

Single PhaseSupply Voltage

Page 10: 11081 DIF - amoBBSd1.amobbs.com/bbs_upload782111/files_10/ourdev_287709.pdf · 11081 DIF Slide 2 Class objective OWhen ... 11081 DIF Slide 37 PWM Drive Position Sense Signal Conditioning

© 2007 Microchip Technology Incorporated. All Rights Reserved. 11081 DIF Slide 10

Single Phase

N

N

S

S

N

N

S

S

NS N S

Page 11: 11081 DIF - amoBBSd1.amobbs.com/bbs_upload782111/files_10/ourdev_287709.pdf · 11081 DIF Slide 2 Class objective OWhen ... 11081 DIF Slide 37 PWM Drive Position Sense Signal Conditioning

© 2007 Microchip Technology Incorporated. All Rights Reserved. 11081 DIF Slide 11

Single Phase

N N

S

SS

S

N

N

SN S N

Page 12: 11081 DIF - amoBBSd1.amobbs.com/bbs_upload782111/files_10/ourdev_287709.pdf · 11081 DIF Slide 2 Class objective OWhen ... 11081 DIF Slide 37 PWM Drive Position Sense Signal Conditioning

© 2007 Microchip Technology Incorporated. All Rights Reserved. 11081 DIF Slide 12

What Are Intelligent Fans?

Page 13: 11081 DIF - amoBBSd1.amobbs.com/bbs_upload782111/files_10/ourdev_287709.pdf · 11081 DIF Slide 2 Class objective OWhen ... 11081 DIF Slide 37 PWM Drive Position Sense Signal Conditioning

© 2007 Microchip Technology Incorporated. All Rights Reserved. 11081 DIF Slide 13

Why Use Intelligent Fans?Allow the fan to control its own speed

Incorporate other safety features

Can compensate for dynamic load conditions

Desire non-audible control loop

Page 14: 11081 DIF - amoBBSd1.amobbs.com/bbs_upload782111/files_10/ourdev_287709.pdf · 11081 DIF Slide 2 Class objective OWhen ... 11081 DIF Slide 37 PWM Drive Position Sense Signal Conditioning

© 2007 Microchip Technology Incorporated. All Rights Reserved. 11081 DIF Slide 14

Intelligent Fan Block Diagram

Controller

Position Sense

Signal Conditioning

Voltage Regulator

Speed Input

Signal Conditioning

Speed Feedback

PWM Drives for Coils

Current Sense

Page 15: 11081 DIF - amoBBSd1.amobbs.com/bbs_upload782111/files_10/ourdev_287709.pdf · 11081 DIF Slide 2 Class objective OWhen ... 11081 DIF Slide 37 PWM Drive Position Sense Signal Conditioning

© 2007 Microchip Technology Incorporated. All Rights Reserved. 11081 DIF Slide 15

Introducing…PIC12F615 PIC12HV615

PIC16F616 PIC16HV616

Program Memory

Data Memory

Comparators

ECCP PWM

Package

Timers

1024 words

64 bytes

Single

Half-bridge

8 pin

2 8-bit / 1 16-bit

2048 words

128 bytes

Dual

Full-Bridge

14 pin

2 8-bit / 1 16-bit

Page 16: 11081 DIF - amoBBSd1.amobbs.com/bbs_upload782111/files_10/ourdev_287709.pdf · 11081 DIF Slide 2 Class objective OWhen ... 11081 DIF Slide 37 PWM Drive Position Sense Signal Conditioning

© 2007 Microchip Technology Incorporated. All Rights Reserved. 11081 DIF Slide 16

Position SensePosition Sense

Signal Conditioning

Voltage Regulator

Speed Input

Signal Conditioning

Speed Feedback

PWM Drives for Coils

Current Sense

Controller

Page 17: 11081 DIF - amoBBSd1.amobbs.com/bbs_upload782111/files_10/ourdev_287709.pdf · 11081 DIF Slide 2 Class objective OWhen ... 11081 DIF Slide 37 PWM Drive Position Sense Signal Conditioning

© 2007 Microchip Technology Incorporated. All Rights Reserved. 11081 DIF Slide 17

Hall Element

Power

Power

Output Output

Symmetrical deviceUn-buffered outputUsed with a current sourceOutput voltage

Page 18: 11081 DIF - amoBBSd1.amobbs.com/bbs_upload782111/files_10/ourdev_287709.pdf · 11081 DIF Slide 2 Class objective OWhen ... 11081 DIF Slide 37 PWM Drive Position Sense Signal Conditioning

© 2007 Microchip Technology Incorporated. All Rights Reserved. 11081 DIF Slide 18

Hall-Element Schematic

CxINx+

1k

Supply Voltage

CxINx-

Page 19: 11081 DIF - amoBBSd1.amobbs.com/bbs_upload782111/files_10/ourdev_287709.pdf · 11081 DIF Slide 2 Class objective OWhen ... 11081 DIF Slide 37 PWM Drive Position Sense Signal Conditioning

© 2007 Microchip Technology Incorporated. All Rights Reserved. 11081 DIF Slide 19

Hall Element

time

Voltage

Comp.Output

No Hysteresis

Comp.Output

Hysteresis

Page 20: 11081 DIF - amoBBSd1.amobbs.com/bbs_upload782111/files_10/ourdev_287709.pdf · 11081 DIF Slide 2 Class objective OWhen ... 11081 DIF Slide 37 PWM Drive Position Sense Signal Conditioning

© 2007 Microchip Technology Incorporated. All Rights Reserved. 11081 DIF Slide 20

Hall Sensor

Digital deviceSeveral output types:− Logic level / open collector− Latching / non-latchingIntegrated power supplyIntegrated signal conditioning

Page 21: 11081 DIF - amoBBSd1.amobbs.com/bbs_upload782111/files_10/ourdev_287709.pdf · 11081 DIF Slide 2 Class objective OWhen ... 11081 DIF Slide 37 PWM Drive Position Sense Signal Conditioning

© 2007 Microchip Technology Incorporated. All Rights Reserved. 11081 DIF Slide 21

Hall Sensor Diagram

+-

+V Output

Ground

Page 22: 11081 DIF - amoBBSd1.amobbs.com/bbs_upload782111/files_10/ourdev_287709.pdf · 11081 DIF Slide 2 Class objective OWhen ... 11081 DIF Slide 37 PWM Drive Position Sense Signal Conditioning

© 2007 Microchip Technology Incorporated. All Rights Reserved. 11081 DIF Slide 22

Hall Device Mounting

Above Board On Board

Page 23: 11081 DIF - amoBBSd1.amobbs.com/bbs_upload782111/files_10/ourdev_287709.pdf · 11081 DIF Slide 2 Class objective OWhen ... 11081 DIF Slide 37 PWM Drive Position Sense Signal Conditioning

© 2007 Microchip Technology Incorporated. All Rights Reserved. 11081 DIF Slide 23

Position Sense Resources

Hall element: Requires a comparator (CxINx- pin and CxINx+ pin)

Digital hall sensor: Any available interrupt-on-change pin

Page 24: 11081 DIF - amoBBSd1.amobbs.com/bbs_upload782111/files_10/ourdev_287709.pdf · 11081 DIF Slide 2 Class objective OWhen ... 11081 DIF Slide 37 PWM Drive Position Sense Signal Conditioning

© 2007 Microchip Technology Incorporated. All Rights Reserved. 11081 DIF Slide 24

Voltage RegulatorPosition Sense

Signal Conditioning

Voltage Regulator

Speed Input

Signal Conditioning

Speed Feedback

PWM Drives for Coils

Current Sense

Controller

Page 25: 11081 DIF - amoBBSd1.amobbs.com/bbs_upload782111/files_10/ourdev_287709.pdf · 11081 DIF Slide 2 Class objective OWhen ... 11081 DIF Slide 37 PWM Drive Position Sense Signal Conditioning

© 2007 Microchip Technology Incorporated. All Rights Reserved. 11081 DIF Slide 25

Integrated Shunt RegulatorCan operate from almost any voltage

Supply regulated voltage to other components

Much cheaper than other types of regulators

CPU

+12V

PIC MCU

Page 26: 11081 DIF - amoBBSd1.amobbs.com/bbs_upload782111/files_10/ourdev_287709.pdf · 11081 DIF Slide 2 Class objective OWhen ... 11081 DIF Slide 37 PWM Drive Position Sense Signal Conditioning

© 2007 Microchip Technology Incorporated. All Rights Reserved. 11081 DIF Slide 26

Considerations

More difficult to accommodate…− Wide input voltage ranges (i.e. 12V –

96V)− Wide required current ranges (4mA –

50mA)

Some cases are impossible to accommodate without additional effort

Page 27: 11081 DIF - amoBBSd1.amobbs.com/bbs_upload782111/files_10/ourdev_287709.pdf · 11081 DIF Slide 2 Class objective OWhen ... 11081 DIF Slide 37 PWM Drive Position Sense Signal Conditioning

© 2007 Microchip Technology Incorporated. All Rights Reserved. 11081 DIF Slide 27

Shunt Regulator Resources

External resistor

Need to choose a microcontroller with the HV option

Application note AN1035

Page 28: 11081 DIF - amoBBSd1.amobbs.com/bbs_upload782111/files_10/ourdev_287709.pdf · 11081 DIF Slide 2 Class objective OWhen ... 11081 DIF Slide 37 PWM Drive Position Sense Signal Conditioning

© 2007 Microchip Technology Incorporated. All Rights Reserved. 11081 DIF Slide 28

Speed InputPosition Sense

Signal Conditioning

Voltage Regulator

Speed Input

Signal Conditioning

Speed Feedback

PWM Drives for Coils

Current Sense

Controller

Speed Input

Signal Conditioning

Page 29: 11081 DIF - amoBBSd1.amobbs.com/bbs_upload782111/files_10/ourdev_287709.pdf · 11081 DIF Slide 2 Class objective OWhen ... 11081 DIF Slide 37 PWM Drive Position Sense Signal Conditioning

© 2007 Microchip Technology Incorporated. All Rights Reserved. 11081 DIF Slide 29

Speed Input Choices

Commanded speed PWM− kHz range (Intel and AMD specs use

25kHz)

Analog− RC filtered PWM− Thermistor

Page 30: 11081 DIF - amoBBSd1.amobbs.com/bbs_upload782111/files_10/ourdev_287709.pdf · 11081 DIF Slide 2 Class objective OWhen ... 11081 DIF Slide 37 PWM Drive Position Sense Signal Conditioning

© 2007 Microchip Technology Incorporated. All Rights Reserved. 11081 DIF Slide 30

Timer1 Gate

Timer1 will increment when gate is active

Timer1Clock Source

Timer1Counter

Gate source can be an I/O or a comparator output

Timer 1 Gate

Page 31: 11081 DIF - amoBBSd1.amobbs.com/bbs_upload782111/files_10/ourdev_287709.pdf · 11081 DIF Slide 2 Class objective OWhen ... 11081 DIF Slide 37 PWM Drive Position Sense Signal Conditioning

© 2007 Microchip Technology Incorporated. All Rights Reserved. 11081 DIF Slide 31

Timer1 Gate

Timer1 will increment when gate is active

Timer1Clock Source

Timer1Counter

Timer1 Gate can be active-high or active-low

PWM Input

Page 32: 11081 DIF - amoBBSd1.amobbs.com/bbs_upload782111/files_10/ourdev_287709.pdf · 11081 DIF Slide 2 Class objective OWhen ... 11081 DIF Slide 37 PWM Drive Position Sense Signal Conditioning

© 2007 Microchip Technology Incorporated. All Rights Reserved. 11081 DIF Slide 32

Duty Cycle Measurement

Measurement period = (low + high)Duty cycle = high / (low + high)Math is performed as unsigned 24-bit by 16-bit division

Measure Low Measure High

Page 33: 11081 DIF - amoBBSd1.amobbs.com/bbs_upload782111/files_10/ourdev_287709.pdf · 11081 DIF Slide 2 Class objective OWhen ... 11081 DIF Slide 37 PWM Drive Position Sense Signal Conditioning

© 2007 Microchip Technology Incorporated. All Rights Reserved. 11081 DIF Slide 33

Considerations…

Measurement period needs to be much larger than period of signal− Higher input PWM frequency means less

time to measure

Possible to approximate:− Measurement Period = (Low + High)

Timer1 can not overflow

Page 34: 11081 DIF - amoBBSd1.amobbs.com/bbs_upload782111/files_10/ourdev_287709.pdf · 11081 DIF Slide 2 Class objective OWhen ... 11081 DIF Slide 37 PWM Drive Position Sense Signal Conditioning

© 2007 Microchip Technology Incorporated. All Rights Reserved. 11081 DIF Slide 34

Slow PWM Inputs

Possible to measure directly using interrupt-on-change pins

Need to account for the extremes: 0% and 100%

Page 35: 11081 DIF - amoBBSd1.amobbs.com/bbs_upload782111/files_10/ourdev_287709.pdf · 11081 DIF Slide 2 Class objective OWhen ... 11081 DIF Slide 37 PWM Drive Position Sense Signal Conditioning

© 2007 Microchip Technology Incorporated. All Rights Reserved. 11081 DIF Slide 35

Analog Speed Choices

Why use analog filtered PWM?− PWM frequency range too wide for

direct measurement− Incoming PWM at a lower voltageTemperature control using a thermistorDirect analog input control

Page 36: 11081 DIF - amoBBSd1.amobbs.com/bbs_upload782111/files_10/ourdev_287709.pdf · 11081 DIF Slide 2 Class objective OWhen ... 11081 DIF Slide 37 PWM Drive Position Sense Signal Conditioning

© 2007 Microchip Technology Incorporated. All Rights Reserved. 11081 DIF Slide 36

Speed Input Resources

Digital measurement: need a microcontroller with Timer1 Gate (use the T1G pin)

Analog measurement: any available ADC channel

Page 37: 11081 DIF - amoBBSd1.amobbs.com/bbs_upload782111/files_10/ourdev_287709.pdf · 11081 DIF Slide 2 Class objective OWhen ... 11081 DIF Slide 37 PWM Drive Position Sense Signal Conditioning

© 2007 Microchip Technology Incorporated. All Rights Reserved. 11081 DIF Slide 37

PWM DrivePosition Sense

Signal Conditioning

Voltage Regulator

Speed Input

Signal Conditioning

Speed Feedback

PWM Drives for Coils

Current Sense

Controller

Speed Input

Signal Conditioning

Page 38: 11081 DIF - amoBBSd1.amobbs.com/bbs_upload782111/files_10/ourdev_287709.pdf · 11081 DIF Slide 2 Class objective OWhen ... 11081 DIF Slide 37 PWM Drive Position Sense Signal Conditioning

© 2007 Microchip Technology Incorporated. All Rights Reserved. 11081 DIF Slide 38

Full Bridge ForwardSupply Voltage

H

L

H

LH

L

H

L

P1B

P1A

P1D

P1C

Page 39: 11081 DIF - amoBBSd1.amobbs.com/bbs_upload782111/files_10/ourdev_287709.pdf · 11081 DIF Slide 2 Class objective OWhen ... 11081 DIF Slide 37 PWM Drive Position Sense Signal Conditioning

© 2007 Microchip Technology Incorporated. All Rights Reserved. 11081 DIF Slide 39

Full Bridge ReverseSupply Voltage

H

L

H

LH

L

H

L

P1B

P1A

P1D

P1C

Page 40: 11081 DIF - amoBBSd1.amobbs.com/bbs_upload782111/files_10/ourdev_287709.pdf · 11081 DIF Slide 2 Class objective OWhen ... 11081 DIF Slide 37 PWM Drive Position Sense Signal Conditioning

© 2007 Microchip Technology Incorporated. All Rights Reserved. 11081 DIF Slide 40

Two Phase DriveSupply Voltage

P1B P1DH

L

H

L

Page 41: 11081 DIF - amoBBSd1.amobbs.com/bbs_upload782111/files_10/ourdev_287709.pdf · 11081 DIF Slide 2 Class objective OWhen ... 11081 DIF Slide 37 PWM Drive Position Sense Signal Conditioning

© 2007 Microchip Technology Incorporated. All Rights Reserved. 11081 DIF Slide 41

Other ECCP Pins

Enhanced Capture Compare PWM (ECCP)

P1A, P1C− Free tachometer output− Pin can be configured as an input

Page 42: 11081 DIF - amoBBSd1.amobbs.com/bbs_upload782111/files_10/ourdev_287709.pdf · 11081 DIF Slide 2 Class objective OWhen ... 11081 DIF Slide 37 PWM Drive Position Sense Signal Conditioning

© 2007 Microchip Technology Incorporated. All Rights Reserved. 11081 DIF Slide 42

Using Single PWM Output

Pin steering− Steer a single PWM output to

multiple pinsNeed to ensure idle pin is in idle state

VDDP1A(1)P1B(1)GP3

VSSP1BGP1P1A

PIC12HV615

Page 43: 11081 DIF - amoBBSd1.amobbs.com/bbs_upload782111/files_10/ourdev_287709.pdf · 11081 DIF Slide 2 Class objective OWhen ... 11081 DIF Slide 37 PWM Drive Position Sense Signal Conditioning

© 2007 Microchip Technology Incorporated. All Rights Reserved. 11081 DIF Slide 43

Extending PWM Resolution

Software dithering:

Based off of TMR2 interrupts (can use the post-scaler)

Dither Offset + Accumulator

OverflowFlag

Page 44: 11081 DIF - amoBBSd1.amobbs.com/bbs_upload782111/files_10/ourdev_287709.pdf · 11081 DIF Slide 2 Class objective OWhen ... 11081 DIF Slide 37 PWM Drive Position Sense Signal Conditioning

© 2007 Microchip Technology Incorporated. All Rights Reserved. 11081 DIF Slide 44

Dithering Considerations

System needs to act in a low-pass manner

Dither frequency may be audible

Resource intensive

Page 45: 11081 DIF - amoBBSd1.amobbs.com/bbs_upload782111/files_10/ourdev_287709.pdf · 11081 DIF Slide 2 Class objective OWhen ... 11081 DIF Slide 37 PWM Drive Position Sense Signal Conditioning

© 2007 Microchip Technology Incorporated. All Rights Reserved. 11081 DIF Slide 45

PWM Drive Resources

Timer2 used as the ECCP time base

ECCP in full-bridge mode, or a CCP with pin steering

Page 46: 11081 DIF - amoBBSd1.amobbs.com/bbs_upload782111/files_10/ourdev_287709.pdf · 11081 DIF Slide 2 Class objective OWhen ... 11081 DIF Slide 37 PWM Drive Position Sense Signal Conditioning

© 2007 Microchip Technology Incorporated. All Rights Reserved. 11081 DIF Slide 46

PWM DrivePosition Sense

Signal Conditioning

Voltage Regulator

Speed Input

Signal Conditioning

Speed Feedback

PWM Drives for Coils

Current Sense

Controller

Speed Input

Signal Conditioning

Page 47: 11081 DIF - amoBBSd1.amobbs.com/bbs_upload782111/files_10/ourdev_287709.pdf · 11081 DIF Slide 2 Class objective OWhen ... 11081 DIF Slide 37 PWM Drive Position Sense Signal Conditioning

© 2007 Microchip Technology Incorporated. All Rights Reserved. 11081 DIF Slide 47

Speed Feedback

Tachometer signal− Generated using the ECCP module− Toggling an output pin

Alarm output− Generated if the fan speed is too low

for too long

Page 48: 11081 DIF - amoBBSd1.amobbs.com/bbs_upload782111/files_10/ourdev_287709.pdf · 11081 DIF Slide 2 Class objective OWhen ... 11081 DIF Slide 37 PWM Drive Position Sense Signal Conditioning

© 2007 Microchip Technology Incorporated. All Rights Reserved. 11081 DIF Slide 48

Alarm Signal

Commanded Speed +

Scaling Factor

Threshold

Clear Counter

YesIncrement Counter

Counter Maxed?

No

No

Alarm!Yes

Current Speed >

Threshold

ExitRoutine

Page 49: 11081 DIF - amoBBSd1.amobbs.com/bbs_upload782111/files_10/ourdev_287709.pdf · 11081 DIF Slide 2 Class objective OWhen ... 11081 DIF Slide 37 PWM Drive Position Sense Signal Conditioning

© 2007 Microchip Technology Incorporated. All Rights Reserved. 11081 DIF Slide 49

Speed Feedback Resources

Any available I/O pin

Page 50: 11081 DIF - amoBBSd1.amobbs.com/bbs_upload782111/files_10/ourdev_287709.pdf · 11081 DIF Slide 2 Class objective OWhen ... 11081 DIF Slide 37 PWM Drive Position Sense Signal Conditioning

© 2007 Microchip Technology Incorporated. All Rights Reserved. 11081 DIF Slide 50

Current SensePosition Sense

Signal Conditioning

Voltage Regulator

Speed Input

Signal Conditioning

Speed Feedback

PWM Drives for Coils

Current Sense

Controller

Speed Input

Signal Conditioning

Page 51: 11081 DIF - amoBBSd1.amobbs.com/bbs_upload782111/files_10/ourdev_287709.pdf · 11081 DIF Slide 2 Class objective OWhen ... 11081 DIF Slide 37 PWM Drive Position Sense Signal Conditioning

© 2007 Microchip Technology Incorporated. All Rights Reserved. 11081 DIF Slide 51

Current Sense

Protect fan / host from drawing too much current

Hardware feature – no software required

Cycle-by-cycle

Page 52: 11081 DIF - amoBBSd1.amobbs.com/bbs_upload782111/files_10/ourdev_287709.pdf · 11081 DIF Slide 2 Class objective OWhen ... 11081 DIF Slide 37 PWM Drive Position Sense Signal Conditioning

© 2007 Microchip Technology Incorporated. All Rights Reserved. 11081 DIF Slide 52

Current Limiting

+ 0.6 VoltReference

ShutdownEvent

Page 53: 11081 DIF - amoBBSd1.amobbs.com/bbs_upload782111/files_10/ourdev_287709.pdf · 11081 DIF Slide 2 Class objective OWhen ... 11081 DIF Slide 37 PWM Drive Position Sense Signal Conditioning

© 2007 Microchip Technology Incorporated. All Rights Reserved. 11081 DIF Slide 53

Current Limiting

Current

PWM

0.6 Volt

Page 54: 11081 DIF - amoBBSd1.amobbs.com/bbs_upload782111/files_10/ourdev_287709.pdf · 11081 DIF Slide 2 Class objective OWhen ... 11081 DIF Slide 37 PWM Drive Position Sense Signal Conditioning

© 2007 Microchip Technology Incorporated. All Rights Reserved. 11081 DIF Slide 54

Current Sense Resources

Inverting input of available comparator (can use the internal reference)

ECCP with auto-shutdown capability

Page 55: 11081 DIF - amoBBSd1.amobbs.com/bbs_upload782111/files_10/ourdev_287709.pdf · 11081 DIF Slide 2 Class objective OWhen ... 11081 DIF Slide 37 PWM Drive Position Sense Signal Conditioning

© 2007 Microchip Technology Incorporated. All Rights Reserved. 11081 DIF Slide 55

Actual Speed MonitoringPosition Sense

Signal Conditioning

Voltage Regulator

Speed Input

Signal Conditioning

Speed Feedback

PWM Drives for Coils

Current Sense

Controller

Speed Input

Signal Conditioning

Page 56: 11081 DIF - amoBBSd1.amobbs.com/bbs_upload782111/files_10/ourdev_287709.pdf · 11081 DIF Slide 2 Class objective OWhen ... 11081 DIF Slide 37 PWM Drive Position Sense Signal Conditioning

© 2007 Microchip Technology Incorporated. All Rights Reserved. 11081 DIF Slide 56

Measuring Actual Speed

Can measure hall period

Need output from 0 to 255 corresponding to minimum and maximum speed

Page 57: 11081 DIF - amoBBSd1.amobbs.com/bbs_upload782111/files_10/ourdev_287709.pdf · 11081 DIF Slide 2 Class objective OWhen ... 11081 DIF Slide 37 PWM Drive Position Sense Signal Conditioning

© 2007 Microchip Technology Incorporated. All Rights Reserved. 11081 DIF Slide 57

How to Monitor Actual Speed

y = 76117x-0.9977

R2 = 0.9998

0

50

100

150

200

250

300

0 200 400 600 800 1000 1200 1400Hall Period (in counts)

Rou

tine

Out

put

Page 58: 11081 DIF - amoBBSd1.amobbs.com/bbs_upload782111/files_10/ourdev_287709.pdf · 11081 DIF Slide 2 Class objective OWhen ... 11081 DIF Slide 37 PWM Drive Position Sense Signal Conditioning

© 2007 Microchip Technology Incorporated. All Rights Reserved. 11081 DIF Slide 58

Speed Monitoring Equation

From Excel:

Better written as:

Constant:

9977.076117 −⋅ period

176117 −⋅ period

(Full Scale Value) Rotations 60 seconds(MaxRPM) (Tcount) (# Hall Periods) minute

Page 59: 11081 DIF - amoBBSd1.amobbs.com/bbs_upload782111/files_10/ourdev_287709.pdf · 11081 DIF Slide 2 Class objective OWhen ... 11081 DIF Slide 37 PWM Drive Position Sense Signal Conditioning

© 2007 Microchip Technology Incorporated. All Rights Reserved. 11081 DIF Slide 59

Division NecessaryPerform division as unsigned 24-bit by 16-bit division, use lower byte out of output

periodoutput 76117

=

Three byte result:00 00 (0 – 255)

Page 60: 11081 DIF - amoBBSd1.amobbs.com/bbs_upload782111/files_10/ourdev_287709.pdf · 11081 DIF Slide 2 Class objective OWhen ... 11081 DIF Slide 37 PWM Drive Position Sense Signal Conditioning

© 2007 Microchip Technology Incorporated. All Rights Reserved. 11081 DIF Slide 60

Consideration…

What if fan spins above the “maximum” speed?

Fan will attempt to speed up

periodoutput 76117

=

Three byte result:00 01 (small)

Page 61: 11081 DIF - amoBBSd1.amobbs.com/bbs_upload782111/files_10/ourdev_287709.pdf · 11081 DIF Slide 2 Class objective OWhen ... 11081 DIF Slide 37 PWM Drive Position Sense Signal Conditioning

© 2007 Microchip Technology Incorporated. All Rights Reserved. 11081 DIF Slide 61

Resources Required

Time base− Possible to use Timer0 or Timer2

Reuse same division routine from duty cycle measurement

Page 62: 11081 DIF - amoBBSd1.amobbs.com/bbs_upload782111/files_10/ourdev_287709.pdf · 11081 DIF Slide 2 Class objective OWhen ... 11081 DIF Slide 37 PWM Drive Position Sense Signal Conditioning

© 2007 Microchip Technology Incorporated. All Rights Reserved. 11081 DIF Slide 62

Control SoftwarePosition Sense

Signal Conditioning

Voltage Regulator

Speed Input

Signal Conditioning

Speed Feedback

PWM Drives for Coils

Current Sense

Controller

Speed Input

Signal Conditioning

Page 63: 11081 DIF - amoBBSd1.amobbs.com/bbs_upload782111/files_10/ourdev_287709.pdf · 11081 DIF Slide 2 Class objective OWhen ... 11081 DIF Slide 37 PWM Drive Position Sense Signal Conditioning

© 2007 Microchip Technology Incorporated. All Rights Reserved. 11081 DIF Slide 63

Fan SoftwareHardware

initializationSet point

measurement

Measure actual speed

Controlroutine

Set new duty cycle

TimingControl

Page 64: 11081 DIF - amoBBSd1.amobbs.com/bbs_upload782111/files_10/ourdev_287709.pdf · 11081 DIF Slide 2 Class objective OWhen ... 11081 DIF Slide 37 PWM Drive Position Sense Signal Conditioning

© 2007 Microchip Technology Incorporated. All Rights Reserved. 11081 DIF Slide 64

Control Routine

PID Controller− Existing routines− MASTERs class

Limitations− Single set of control parameters

Page 65: 11081 DIF - amoBBSd1.amobbs.com/bbs_upload782111/files_10/ourdev_287709.pdf · 11081 DIF Slide 2 Class objective OWhen ... 11081 DIF Slide 37 PWM Drive Position Sense Signal Conditioning

© 2007 Microchip Technology Incorporated. All Rights Reserved. 11081 DIF Slide 65

Control Routine

Integral Controller− Multiple control constants− Inherently stable to “DC” input

commands

Limitations− Slow response time

Page 66: 11081 DIF - amoBBSd1.amobbs.com/bbs_upload782111/files_10/ourdev_287709.pdf · 11081 DIF Slide 2 Class objective OWhen ... 11081 DIF Slide 37 PWM Drive Position Sense Signal Conditioning

© 2007 Microchip Technology Incorporated. All Rights Reserved. 11081 DIF Slide 66

Multiple Control Constants

Control ConstantSpeed << set point

Speed close to set point

Speed >> set point

Large KI

Normal KI

Small KI

Condition

Page 67: 11081 DIF - amoBBSd1.amobbs.com/bbs_upload782111/files_10/ourdev_287709.pdf · 11081 DIF Slide 2 Class objective OWhen ... 11081 DIF Slide 37 PWM Drive Position Sense Signal Conditioning

© 2007 Microchip Technology Incorporated. All Rights Reserved. 11081 DIF Slide 67

Transient Response

0

500

1,000

1,500

2,000

2,500

3,000

0 100 200 300 400 500

Sample

RPM

Page 68: 11081 DIF - amoBBSd1.amobbs.com/bbs_upload782111/files_10/ourdev_287709.pdf · 11081 DIF Slide 2 Class objective OWhen ... 11081 DIF Slide 37 PWM Drive Position Sense Signal Conditioning

© 2007 Microchip Technology Incorporated. All Rights Reserved. 11081 DIF Slide 68

Demonstration

Page 69: 11081 DIF - amoBBSd1.amobbs.com/bbs_upload782111/files_10/ourdev_287709.pdf · 11081 DIF Slide 2 Class objective OWhen ... 11081 DIF Slide 37 PWM Drive Position Sense Signal Conditioning

© 2007 Microchip Technology Incorporated. All Rights Reserved. 11081 DIF Slide 69

Quantifyingthe Results

Page 70: 11081 DIF - amoBBSd1.amobbs.com/bbs_upload782111/files_10/ourdev_287709.pdf · 11081 DIF Slide 2 Class objective OWhen ... 11081 DIF Slide 37 PWM Drive Position Sense Signal Conditioning

© 2007 Microchip Technology Incorporated. All Rights Reserved. 11081 DIF Slide 70

Closed Loop Response

0500

1000150020002500300035004000

0.0% 20.0% 40.0% 60.0% 80.0% 100.0%Duty Cycle

RPM

Specification Limits

Page 71: 11081 DIF - amoBBSd1.amobbs.com/bbs_upload782111/files_10/ourdev_287709.pdf · 11081 DIF Slide 2 Class objective OWhen ... 11081 DIF Slide 37 PWM Drive Position Sense Signal Conditioning

© 2007 Microchip Technology Incorporated. All Rights Reserved. 11081 DIF Slide 71

Transient Response

-500

0

500

1000

1500

2000

2500

3000

3500

0 100 200 300 400 500 600

Sample

RPM

Page 72: 11081 DIF - amoBBSd1.amobbs.com/bbs_upload782111/files_10/ourdev_287709.pdf · 11081 DIF Slide 2 Class objective OWhen ... 11081 DIF Slide 37 PWM Drive Position Sense Signal Conditioning

© 2007 Microchip Technology Incorporated. All Rights Reserved. 11081 DIF Slide 72

PotentialPin-out Configurations

Page 73: 11081 DIF - amoBBSd1.amobbs.com/bbs_upload782111/files_10/ourdev_287709.pdf · 11081 DIF Slide 2 Class objective OWhen ... 11081 DIF Slide 37 PWM Drive Position Sense Signal Conditioning

© 2007 Microchip Technology Incorporated. All Rights Reserved. 11081 DIF Slide 73

PIC12F615 – Hall Element

4-Wire Input

1234

0.1uF

100

+12

P1A

PIC12HV615

VddP1A-2GP4T1G

VssCIN+CIN-P1A

+12+5

10k10k

10k

2.2uF

100

100

+12

1.2k

+5

P1A

P1A-2

470

P1A-2 Hall Element

2.2uF

+5

1k

Page 74: 11081 DIF - amoBBSd1.amobbs.com/bbs_upload782111/files_10/ourdev_287709.pdf · 11081 DIF Slide 2 Class objective OWhen ... 11081 DIF Slide 37 PWM Drive Position Sense Signal Conditioning

© 2007 Microchip Technology Incorporated. All Rights Reserved. 11081 DIF Slide 74

PIC12F615 – Hall Sensor

10k

0.1uF

+12

Hall Sensor

100

100

PIC12HV615

VddP1A-2GP4T1G

VssCIN+CIN-P1A

+5

10k

2

100

2.2uF

470

10k

P1A-2P1A

+5

2.2uF

P1A-2

+12

1k

+5

4-Wire Input

1234

+12

P1A

Page 75: 11081 DIF - amoBBSd1.amobbs.com/bbs_upload782111/files_10/ourdev_287709.pdf · 11081 DIF Slide 2 Class objective OWhen ... 11081 DIF Slide 37 PWM Drive Position Sense Signal Conditioning

© 2007 Microchip Technology Incorporated. All Rights Reserved. 11081 DIF Slide 75

PIC16F616

2.2uF

+5

100

1004-Wire Input

1234

10k

1.2kPIC16F616

VddRA5T1G/AN3RA3P1AP1BP1C

VssC1IN+

C12IN0-RA2RC0

C12IN1-P1D

P1B100

+5

2

1k

+12

Hall Element

10k

+12

P1D

P1D

10k

2.2uF

P1B

0.1uF

+12

+5470

Page 76: 11081 DIF - amoBBSd1.amobbs.com/bbs_upload782111/files_10/ourdev_287709.pdf · 11081 DIF Slide 2 Class objective OWhen ... 11081 DIF Slide 37 PWM Drive Position Sense Signal Conditioning

© 2007 Microchip Technology Incorporated. All Rights Reserved. 11081 DIF Slide 76

Intelligent Fan Overview

Controller is built directly into the fan

Closed loop control with good audible properties

Additional safety features

Page 77: 11081 DIF - amoBBSd1.amobbs.com/bbs_upload782111/files_10/ourdev_287709.pdf · 11081 DIF Slide 2 Class objective OWhen ... 11081 DIF Slide 37 PWM Drive Position Sense Signal Conditioning

© 2007 Microchip Technology Incorporated. All Rights Reserved. 11081 DIF Slide 77

Summary

Brushless motor basics (hardware background)

Interpreting inputs

Generating outputs

Control software

Page 78: 11081 DIF - amoBBSd1.amobbs.com/bbs_upload782111/files_10/ourdev_287709.pdf · 11081 DIF Slide 2 Class objective OWhen ... 11081 DIF Slide 37 PWM Drive Position Sense Signal Conditioning

© 2007 Microchip Technology Incorporated. All Rights Reserved. 11081 DIF Slide 78

ReferencesApplication Note:− AN1035 – Designing with HV

Microcontrollers

Page 79: 11081 DIF - amoBBSd1.amobbs.com/bbs_upload782111/files_10/ourdev_287709.pdf · 11081 DIF Slide 2 Class objective OWhen ... 11081 DIF Slide 37 PWM Drive Position Sense Signal Conditioning

© 2007 Microchip Technology Incorporated. All Rights Reserved. 11081 DIF Slide 79

TrademarksThe Microchip name and logo, the Microchip logo, Accuron, dsPIC,

KeeLoq, KeeLoq logo, microID, MPLAB, PIC, PICmicro, PICSTART, PRO MATE, rfPIC and SmartShunt are registered trademarks of Microchip Technology Incorporated in the U.S.A. and other countries.

AmpLab, FilterLab, Linear Active Thermistor, Migratable Memory, MXDEV, MXLAB, SEEVAL, SmartSensor and The Embedded Control Solutions Company are registered trademarks of Microchip Technology Incorporated in the U.S.A.

Analog-for-the-Digital Age, Application Maestro, CodeGuard, dsPICDEM, dsPICDEM.net, dsPICworks, ECAN, ECONOMONITOR, FanSense, FlexROM, fuzzyLAB, In-Circuit Serial Programming, ICSP, ICEPIC, Mindi, MiWi, MPASM, MPLAB Certified logo, MPLIB, MPLINK, PICkit, PICDEM, PICDEM.net, PICLAB, PICtail, PowerCal, PowerInfo, PowerMate, PowerTool, REAL ICE, rfLAB, Select Mode, Smart Serial, SmartTel, Total Endurance, UNI/O, WiperLock and ZENA are trademarks of Microchip Technology Incorporated in the U.S.A. and other countries.

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.