1 Low Cost Brushless DC Motor Controller By Anish Varsani Department of Computer Science and Electrical Engineering Supervised by Dr. Geoffrey Walker Submitted for the degree of Bachelor of Engineering In the division of Computer Systems Engineering 29 th November 2003
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
1
Low Cost Brushless DC Motor Controller
By
Anish Varsani
Department of Computer Science and Electrical Engineering
Supervised by Dr. Geoffrey Walker
Submitted for the degree of Bachelor of Engineering
In the division of Computer Systems Engineering
29th November 2003
2
October 29, 2003
Professor Simon Kaplan,
Head of School of Information Technology and Electrical Engineering
University of Queensland
St. Lucia, QLD, 4072
Dear Sir,
In accordance with the requirements of the degree of Bachelor of Engineering in the
division of Electrical Engineering, I present the following thesis, entitled
Low Cost Brushless DC Motor Controller.
This work was performed under the supervision of Dr. Geoffrey Walker.
I declare that the work submitted in this thesis is my own, except as acknowledged in
the text, and has not been previously submitted for a degree at the University of
Queensland, or any other institution.
Yours Sincerely,
Anish Varsani
3
Abstract
With advances in 42-volt automotive systems, more mechanical loads are being
driven from the DC power bus. Such loads include power steering pumps and air
conditioning compressors.
A brushless DC (BLDC) motor has been chosen to drive the compressor in the Ultra
Commuter because of its superior output characteristics over induction and brushed
DC motors.
The cooling requirements demand 1kW peak power output. The air conditioning
system also requires pressure switches to protect the compressor from low-pressure
operation. Since space is precious, the controller needs to be as small as possible. As
such, large heat sinks are not an option, hence heat dissipation must be minimal. The
drive circuit must also be rugged to provide a long trouble free life.
The purpose of this thesis is to design, construct and evaluate the hardware and
software for a motor controller to meet the above requirements. These goals have
been met by careful component selection, rugged hardware design, space saving
layout techniques and reliable firmware.
4
Acknowledgements
I would like to thank the following people:
Dr Geoffrey Walker, my thesis supervisor for guidance and technical help throughout
the project.
Mr. Peer Allen, my lab supervisor for maintaining the thesis laboratory and providing
an excellent working environment.
Mr. Keith Bell and the rest of the EWS team for producing all of my PCBs.
Mr. Thommas Williams (Mechanical Engineer) for providing me with a test rig on
which to test my hardware.
Mr. David Finn (PHD student) for providing me with information on brushless DC
motors.
Mr. Paul Jones for his assistance in firmware development.
The thesis students of Axon 504 (Nino Johannson, Luke Billingham, Andrew Parker,
Brent Singer, Christopher Lister) for brightening up an otherwise dull work
1.1 42-volt Brushless DC Motor Controller ..............................................................6 1.2 Achieved Solution................................................................................................6 1.3 Document Overview ............................................................................................7
Chapter 2 Background Information and Product Review .............................................................................9
2.1 Brushless DC Motor Characteristics....................................................................9 2.2 Brushless DC Motor Construction.....................................................................10 2.3 Brushless DC motor Control..............................................................................12 2.4 Transistors..........................................................................................................14 2.5 Drive Topologies ...............................................................................................15 2.6 Existing Product Review...................................................................................16
Chapter 3 Derivation of Specifications ...................19 3.1 Air Conditioner Requirements...........................................................................19 3.2 Motor Requirements ..........................................................................................20 3.3 Controller Specifications ...................................................................................20
IR2101s Specs [13] ..............................................................................................27 4.4 Power Supply .....................................................................................................28 4.5 Current Sense Amplifiers...................................................................................30 4.6 Hall Effect Sensor Interface...............................................................................32 4.7 Pressure Switch Interface...................................................................................34 4.9 Temperature Sensor ...........................................................................................38
Chapter 6 Product Evaluation and Results ............43 6.1 Motor Truth table...............................................................................................43 6.2 Hardware............................................................................................................44 6.3 Efficiency and Performance...............................................................................45 6.4 Budget ................................................................................................................46
Chapter 1 Introduction 1.1 42-volt Brushless DC Motor Controller
Brushless DC (BLDC) motors find use in many applications ranging from printer
head motors to large conveyor belt drivers. With the upcoming 42-volt automotive
electrical system, more mechanical loads will be electrically driven. The electric
motors driving these loads may be brushed DC motors or brushless DC motors.
Brushless DC motors will find use in applications that are constantly running.
Examples of such applications include water pumps, oil pumps, fuel pumps, gearbox
hydraulic pumps, air compressors, variable valve actuators, power steering pumps, air
conditioning compressor and many more.
As the name suggests, Brushless DC motors dont have any brushes, as do their
brushed counter parts. As such, they require additional electronics to perform motor
commutation. The additional electronics is referred to as the motor drive or motor
controller.
The aim of this thesis project is to design and evaluate a low cost BLDC motor
controller. The motor controller is intended to drive the air conditioning compressor
of the Ultracommuter. It is expected that this thesis provide a solution suitable for the
requirements of the Ultracommuter.
1.2 Achieved Solution
The solution achieved as a result of this thesis project is a low cost micro controller
implementation. Smart component selection has been used to meet many of the
requirements set out by the project description. Though a prototype was available for
testing, more work is required to meet size constraints. This motor controller though
fulfils the project requirements, is not a universal design. It is application specific.
With further research and some hardware changes, a universal solution may evolve
from the current design.
7
1.3 Document Overview
The following pages document relevant background information, design processes,
product evaluation and results relating to the BLDC motor controller.
Chapter 2 Background information
This chapter contains background information on brushless DC motors, why
they are used, current applications, future applications, drive requirements, driver
topologies, and control methods.
Chapter 3 Derivation of motor controller specifications
This chapter examines the project descriptions and sets down a set of
requirements that the motor controller must fulfil. Specifications will be derived by
breaking down the motor controller into its subsystems and listing the requirements of
each subsystem. The process by which the subsystems were derived will also be
included.
Chapter 4 Hardware Implementation
This chapter details component selection for the different subsystems that
make up the motor controller.
Chapter 5 Firmware Implementation
The chapter outlines the requirements of the motor controller firmware as set
down in the controller specification. It also describes how the firmware was
implemented.
Chapter 6 Product Evaluation and Results
This chapter details the performance of the motor controller. It also compares
the actual product to the specifications of Chapter 3. Also discussed are the
procedures used to perform tests and how closely the results match theoretical
calculations. A table summarises the results.
8
Chapter 7 Future Developments
This chapter describes the improvements that could be made. Discussed are
aspects that would be implemented the same way and aspects that would be
implemented differently.
Chapter 8 Conclusion
This chapter provides a brief overview of the entire project. Is outlines the
intended goals and the achieved goals. A summary of performance is also included.
References
Appendices
The aim of this report is to provide a detailed and accurate summary of BLDC motor
drivers along with the relevant theory. It is hoped that the reader gains a firm
understanding of the BLDC motor controller and its capabilities.
9
Chapter 2 Background Information and Product Review This chapter provides the relevant background information required to understand the
hardware requirements, control strategies and software requirement of a BLDC motor
controller.
2.1 Brushless DC Motor Characteristics
Brushless DC motors first came about soon after the development of transistors and
other semiconductor switching devices. The principle reason for their existence was
to provide electronic commutation between phase windings. This gave rise to speed
control of motors where previously motors would have been designed specifically for
the desired operating speed. They also offer better efficiency over induction and
synchronous motors due to the lack of machine air gap loses. [Luo, F. L., Yeo, H. G.
(2000)] Also, brushless DC motors dont produce the levels of electromagnetic
radiation common to universal motors. [Bentouati, S.; Zhu, Z.Q.; Howe, D. (1999)]
A brushless DC motors characteristic is what makes them such a versatile drive
solution. BLDC motors have identical speed and torque characteristics to brushed DC
motors.
The torque produce by BLDC motors is given by:
( )22 g rms rmsT D r LB K K Iπ ϕ= =
From the equation, it is clear that the motor torque is directly proportional to motor
current, I.
The speed, ω, of a BLDC motor is given by:
speedV Kω = ×
where Kspeed is the motor speed constant in radians per volt.
It is clear that the motor speed is directly proportional to the applied voltage, V.
10
Figure 1 summarises the torque characteristics of a BLDC motor. The actual torque
drops slightly due to core saturation at higher currents. It should also be noted that
BLDC motors produce maximum torque from standstill. This is one of the main
reasons they are preferred over induction motors. Induction motors draw up to twice
their rated current on starting but product only typically 30 percent of their operating
torque from standstill. Synchronous motors product zero starting torque, as a result
they are usually started and brought to synchronous speed using a DC motor.
BLDC Motor Torque Current Curve
0
20
40
60
80
100
120
0 20 40 60 80 100
Current (%)
Torq
ue (%
)
Figure 1 BLDC motor torque speed curve
2.2 Brushless DC Motor Construction
A brushless DC motors internal construction is what gives it its characteristics.
Brushless DC motors are a variant of permanent magnet DC motors (PMDCM). PM
DC motors are simply synchronous motors in which the rotor field is driven with a
constant current. By driving the rotor winding with a constant current, a fix magnetic
flux is established within the motor. This can also be achieved by replacing the rotor
winding with a permanent magnet. Such motors are called brushless DC motors.
Brushless DC motors dont require slip rings so motor maintenance is reduced and
reliability is increased. Slip rings create dust as they wear. The dust needs to be
11
periodically cleaned from the motor housing. When slip rings wear past a certain
length, they need to be replaced.
Figure 2 3 phase synchronous motor internal diagram
Figure 3 3 phase brushless DC motor internal diagram
The stator windings of BLDC motors contain a multi-phase winding. Small cooling
fans are usually 2-phase, while medium and large power motors are 3-phase. Some
washing machine motors have 4 or 5 phase windings to reduce torque ripple. The
windings may be either wye connected or delta connected. Most motors have
ungrounded wye connections.
Brushless DC motors require that the motor controller perform the commutation
function. Commutation is a function of rotor position. The appropriate stator
windings of the motor need to be energised when the rotor pole lines up with winding.
It is possible to drive a BLDC motor by simply forcing the commutation intervals to a
12
preset value. The problem with this type of control is that the applied phase voltage
may not be proportional to the speed forced by the controllers commutation
sequence.
The generated stator flux interacts with the rotor flux, which is generated by a rotor
magnet, defines the torque and thus 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.
Most BLDC motors have internal sensors to provide position information. The most
common type of sensor is the Hall Effect sensors. When the rotor pole lines up with a
particular phase, the sensors output goes high and when the rotor has passed, the
output goes low. 3-phase motors typically have three hall sensors. The sensors are
placed in the centre of each phase winding. They may be spaced at 60 or 120
electrical degree intervals. 120-degree spacing common. Encoders may also be used.
They are used on servomotors. The encoders are usually mounted on the end of a
gearbox. It is also possible to drive a BLDC motor without sensors.
2.3 Brushless DC motor Control
The purpose of a BLDC motor controller is to provide speed and/or torque control to
the motor. Usually a controller will provide one of the two, either torque or speed
control. Speed control is achieved by monitoring motor speed and adjusting the
applied phase voltage to maintain the desired speed. Torque control is achieved by
monitoring motor current. The motor current can be controlled to hold a constant
value thus providing constant torque on the motor shaft.
It is possible to incorporate speed and torque control. Typically, speed may be
controlled but a hard current limit will also be enforced to stop the motor drawing
more than its rated current. Alternatively, current may be controlled with speed
limiting to prevent the motor from running faster than its rated speed. This is
13
particularly important when brushless DC motors are run from power supplies that
have a higher output voltage that what the motor is rated for.
An example where constant torque control is used is in grinding mills. Constant
speed operation is typically usually used for conveyor belt drives in process control
plants.
In addition to providing speed and torque control, motor controller must also generate
the required motor commutation sequences. Motor commutation is usually related to
Hall Effect sensor outputs.
Figure 4 Hall sensor outputs and stator phase voltage relationship [9]
Figure 4 shows the relationship between Hall Effect sensor outputs and phase back
EMF waveforms. This is usually referred to as a motors truth table as it determines
which phases need to be energised for each particular Hall Effect sensor transition.
The simplest BLDC motor controllers operate by providing a trapezoidal current
waveform to the motor. More complex controllers can generate sinusoidal currents.
14
Sinusoidal drive waveforms result is quieter motor operation and smoother torque
output. In order to product sinusoidal drive waveforms, current sensing is needed on
each phase. Trapezoidal current driver only required one current sensor, usually
placed on the power leads into or out of the motor controller.
2.4 Transistors
The output stage of motor controllers is made up of transistors. The transistor of
choice are metal oxide field effect transistors (MOSFETs). The theory of MOSFET
operation wont be discussed here. However, the relevant formula for calculating
losses will.
MOSFETs have a characteristic drain to source resistance, Rds. This is the resistance
when the transistor is turned to its on state, that is, there is current flowing through
the device. As with any resistor, if there is a current flowing through it, there will
power dissipated in the device. The heat dissipated by a MOSFET due to its
resistance is referred to as conduction loss. Conduction loss, Pon, is given by:
2onon on ds
s
tP I RT
=
where Ion is the current flowing through the transistor when it is fully switch on.
Since switching from off to on state does not occur instantaneously, there is also
power dissipation due to the finite switching time. This is referred to as switching
loss, Psw and is given by:
1 ( )2
on offsw d o s c cP V I f t T= +
MOSFETs with higher current capability typically have lower drain-source resistance,
resulting is low power dissipation. They do however have a large gate-source
capacitance that results in higher conduction losses and reduced switching frequency.
15
2.5 Drive Topologies
Two main drive topologies exist to drive BLDC motors, the full bridge and the half
bridge. The half bridge circuit shown in figure 5 consists of three transistors. The
drain of each transistor is connected to a motor phase winding. The advantage of the
half bridge is the lower part count. In the event that MOSFETs are used, the resulting
switching losses are also lower. For a given power output, P:
dd
PIV
=
so the conduction loss is: 2
2on onon on ds ds
s s d
t t PP I R RT T V
= =
and switching loss is given by:
1 1( ) ( )2 2
on off on offsw d o s c c d s c cd
PP V I f t T V f t TV = + = +
These power losses are on a per transistor basis.
Figure 5 Half bridge motor drive
The disadvantage of a half bridge driver is that current can only flow in one direction through a motor phase. Also, the motor must be a wye-connected motor with the star point brought out for external connection. Torque delivered by a half bridge drive and motor is given by:
( )2 123
g rms rms peakT D r LB K K I K Iπ ϕ ϕ= = =
16
A more flexible driver is the full bridge using six switches. Current in a full bridge can be driven through a motor phase winding in both directions. A full bridge and the associated motor connection is shown in figure 6.
Figure 6 Full bridge motor drive
Because of the way a motor is connected to a full bridge, current is driven in two
phase windings at any one time. This means that torque is produce by two phases at
any one time as opposed to the half bridge, where torque is only produced by one
phase at a time. The effective copper utilisation is doubled.
The torque of a full bridge driver and motor is given by:
( )2 223
g rms rms peakT D r LB K K I K Iπ ϕ ϕ= = =
Since two phases are excited together, the current density in the motor is higher. As a
result the torque produce by such a set up is also higher. The full bridge is able to
deliver 1.41 times the torque of a half bridge connected to the same motor.
2.6 Existing Product Review
There are several existing products that are available for 3-phase brushless DC motor
control. A list of controller chips is summarised in table 1.
17
Man
ufac
ture
rPa
rt n
umbe
r O
pera
ting
Volta
ge
Out
put
stag
e Po
wer
ou
tput
Feat
ures
Pr
ice
Com
men
ts
Alle
gro
IC
A393
2 50
ex
tern
al
Bu
ilt in
hig
h an
d lo
w s
ide
gate
dr
iver
9
requ
ires
addi
tiona
l com
pone
nts
for c
lose
d lo
op
cont
rol
Alle
gro
IC
A393
2 50
ex
tern
al
Bu
ilt in
hig
h an
d lo
w s
ide
gate
dr
iver
requ
ires
addi
tiona
l com
pone
nts
for c
lose
d lo
op
cont
rol
On
Sem
icon
duct
orM
C33
033
20
exte
rnal
Des
igne
d fo
r P-c
hann
el h
igh
side
sw
itche
s 17
re
quire
s ad
ditio
nal c
ompo
nent
s fo
r clo
sed
loop
co
ntro
l ST
Mic
ro
Elec
troni
cs
L6234
52
inte
rnal
13
0 W
co
nt
3 Ph
ase
MO
SFET
out
put s
tage
N
ot e
noug
h po
wer
for a
ir co
nditi
onin
g bu
t mor
e th
an e
noug
h fo
r coo
ling
fans
or p
umps
ST
Mic
ro
Elec
troni
cs
L623
5 52
in
tern
al
130
W
cont
3
Phas
e M
OSF
ET o
utpu
t sta
ge
Not
eno
ugh
pow
er fo
r air
cond
ition
ing
but m
ore
than
eno
ugh
for c
oolin
g fa
ns o
r pum
ps
Texa
s In
stru
men
ts
TMS3
20F2
406
3.3
exte
rnal
Dig
ital s
igna
l pro
cess
or
22
Libr
arie
s an
d ap
p. n
otes
ava
ilabl
e fo
r bru
shle
ss
DC
mot
or c
ontro
l At
mel
5 ex
tern
al
8-
bit m
icro
con
trolle
r 17
ST M
icro
El
ectro
nics
L6
287
20
inte
rnal
26
W
3 Ph
ase
MO
SFET
out
put s
tage
Sp
ecifi
cally
des
igne
d fo
r VC
R ta
pe d
rive
appl
icat
ion
ST M
icro
El
ectro
nics
L7
203
12
inte
rnal
24
W
3 ph
ase
sinu
soid
al v
olta
ge
outp
ut
Ve
ry v
ersa
tile
cont
rolle
r. O
nly
requ
ired
one
Hal
l ef
fect
sen
sor i
nput
ST
Mic
ro
Elec
troni
cs
L725
0 12
in
tern
al
15 W
co
nt
Dig
ital c
ontro
ller,
3 w
ire s
eria
l in
terfa
ce to
uP
Sp
indl
e m
otor
con
trolle
r. T
ypic
al a
pplic
atio
ns
incl
ude
com
pute
r har
d di
sk a
nd C
D-R
OM
driv
es
Fairc
hild
Se
mic
ondu
ctor
KA30
11BD
18
in
tern
al
20W
3 Ph
ase
MO
SFET
out
put s
tage
, 3.
3 or
5 v
olt i
nter
face
for D
SP
conn
ectio
n
Spin
dle
mot
or c
ontro
ller.
Typ
ical
app
licat
ions
in
clud
e co
mpu
ter h
ard
disk
and
CD
-RO
M d
rives
Ta
ble
1
Sum
mar
y of
ava
ilabl
e m
otor
con
trolle
rs
18
Most of these control ICs have integrated output transistors. They are intended to be
single chip solution for low power applications. The L6235 from ST
Microelectronics show incredible potential for automotive use. Its capable of
delivering 130 Watts continuous to a 3-phase motor. This chip would be particularly
useful for driving cooling fan motors, water, oil and fuel pump motors. Such pumps
would have the drive circuit integrated into the pump package to form a sealed unit
with only two wires coming out for power.
Another particular useful controller is the A3932 from Allegro IC. Its specifically
designed for automotive use. It features both high and low side gate drivers for N-
channel MOSFETs, over current protection, PWM input and tachometer output. The
PWM input allows the connection of an external micro controller or DSP to perform
the speed control loop. Another feature of this controller is the cost, only $9.00.
The MC33033 from On Semiconductor is an older controller. Its designed to run P-
channel high side switches. Also, it required additional hardware to provide closed
loop motor control. This controller can be used to drive N-channel transistors,
however, the parts could is greatly increased as a result. The main reason is that
signal inverters are required on the high side transistor outputs.
A commercially available motor controller is the Tritium Gold Controller.
19
Chapter 3 Derivation of Specifications The expected outcome of this thesis project is to produce a motor controller capable
of driving a BLDC motor, which in turn will drive an air conditioning compressor. In
order to fulfil the project requirements, a list of the requirements for the air
conditioning system must be made. From this, a set of specifications can be drawn up
and then the project can be broken down into separate subsystems.
3.1 Air Conditioner Requirements
The Ultracommuter air conditioner system has the following requirements:
" Electrically driven
" 42 Volt operation
" 1kW input power
" Temperature control
" Low internal gas pressure protection
The air conditioning compressor must be electrically driven to increase the overall
efficiency of the Ultracommuter vehicle. Since the Ultracommuter features a 42-volt
electrical system, the air conditioning system must operate from the 42-volt supply.
The cooling requirements of the Ultracommuter define that the input power to the
compressor must be 1kW peak and 500 to 700 watts continuous.
Temperature control is required to avoid running the air conditioner at full power.
Full power operation would result in uncomfortably low cabin temperatures. Once
the cabin temperature reaches a preset level, the air conditioner needs only to maintain
this temperature.
The air conditioning system must be prevented from operating in the event that
refrigerant leaks out of the system. This is required to protect the compressor.
20
3.2 Motor Requirements
The motor that will drive the air conditioning compressor has the following
specifications:
" 3 phase delta or ungrounded Wye connected brushless DC
" 3000 rpm at 110 Volts
" 3kW output at 110 volts
" 27 amp winding rating
" Built in open collector Hall Effect sensors
3.3 Controller Specifications
From the list of motor requirements and air conditioner requirements, the following
list of controller specifications has been made:
8 bit micro controller
3 Phase full bridge output capable of 1kW
Motor current limiter
Cabin temperature sensor
12-volt to 5-volt Hall Effect sensor interface
Pressure switch interface
Greater than 95% efficiency
An 8 bit micro controller has been chosen to reduce cost. A digital signal processor
increases the cost of the controller dramatically.
Since the motor will have either an ungrounded Wye or a delta internal phase
connection, a 3-phase full bridge output is required to drive the motor.
Motor current limiting is required to ensure that no more than 27 amps flows through
the motors stator windings.
A cabin temperature sensor is needed to provide information on when to reduce motor
speed.
21
A 12-volt to 5-volt Hall Effect sensor interface is needed to drop down the sensor
signal level to 5V, which is compatible with 5-volt logic of the micro controller. The
pressure switch interface needs to perform the same task as the Hall Effect interface.
A target efficiency of 95% has been set to keep heat-sinking requirements to a
minimum. As a direct result, the size of final design will be reduced.
22
Chapter 4 Hardware Implementation 4.1 Hardware design and component selection
The overall hardware design was broken down into the following subsystems:
• MOSFET bridge
• Gate drive circuit
• Power supply
• Current sense amplifier
• Hall Effect sensor interface
• Pressure switch interface
• Micro controller circuit
• Temperature sensor
A detailed description of the different subsystems is provided.
4.2 MOSFET Bridge
A 3-phase full bridge arrangement was chosen for the power interface between the
motor and controller. The full bridge was chosen for it higher torque output
capability over a half bridge arrangement. The purpose of the bridge circuit is to
enable each of the three motor phases to be switched on as required by the motor truth
table.
Due to the large currents each MOSFET has flowing through it, the potential exists to
have a very large power dissipation through the device. Figure 7 shows the
connection of the three-phase transistor bridge along with the series gate current
limiting resistors and current sense resistor.
23
Figure 7 MOSFET Bridge Schematic [2]
To provide stator current feed back to the motor controller, a series 0.005-ohm sense
resistor, Rsense1 was included in the circuit. At full load (Imax=23.8A), the voltage
across the sense resistor reaches 0.125 volts. The expected power dissipated across
the resistor was Imax2xRsense1 = 2.83 watts. The particular resistor value was chosen
purely to minimise the power dissipated in the device.
To provide reliable operation, the transistors in the three-phase bridge had to meet
certain specifications. The new 42V automotive standard dictated that MOSFETs be
capable of 75-volt operation. They also had to have low drain-source resistance to
minimise conduction losses. Additionally, N-channel transistors were required to
reduce the number of different part numbers in the design.
To achieve these requirements, a new 42-volt automotive MOSFET from
International Rectifier, the IRF3808 was chosen.
24
IRF3803 Specs [12]
N channel
75 volt
140 amps
0.007-ohm drain source resistance
$3.70 each
Expected conduction losses were calculated using the following formula:
2onon on ds
s
tP I RT
=
where Rds is the drain source resistance of the MOSFET, Ion the full load current, ton is
the time for which the switch is on and Ts is the switching period.
Worst case conduction losses occur when the converter is running at 100% duty cycle,
that is under full load. Under this condition, each transistor is switch on for 33% of
each electrical cycle. The power dissipated across the drain-source junction is 1.32
Watts per transistor.
Expected switching losses were calculated using the following formula:
1 ( )2
on offsw d o s c cP V I f t T= +
where Vd is the supply voltage, Io is the current flowing through the device prior to
turn off, fs is the switching frequency, tcon is the turn on time of the MOSFET and tcoff
is the turn off time of the MOSFET.
Using tcon and tcoff times obtained from the IRF3808 datasheet, the worst case
switching losses worked out to be 2.03 Watts per transistor. This occurred under full
load conditions.
Overall expected efficiency:
Pswtotal = 6 x 2.03 = 12.2 Watts
Pontotal = 6 x 1.32 = 7.9 Watts
25
Ploss total = 20.1 Watts this occurs when the motor controller is running at full power
output (1kW).
Therefore expected efficiency, _
out
out loss total
PP P
η =+
= 10001000 20.1
=+
= 98.2%
26
4.3 Gate Drive
The gate drive circuit forms the interface between the micro controller and the power
MOSFETs. The gate drive circuit has two purposes. Firstly, it buffers the gate
signals generated by the micro controller. The micro controller can only source a
maximum of 20mA from each pin. The peak charging current required to turn
MOSFETs may be as high as 2 amps. This is due to the high switching frequency
used along with the inherent gate capacitance of the MOSFET.
The second purpose of the gate drive circuit is to generate the gate voltages required
to activate the topside transistor. To turn on an N-channel FET, the gate source
voltage must be greater than the inherent threshold voltage i.e. Vgs>Vth. This implies
that in order to turn on transistors Q1 of figure2, the gate voltage would need to be
VphaseA+Vth. If the voltage across phase A is 42 volts, and 12 volts were required to
turn the transistor on, a gate voltage of 54 volts would be needed.
Since the supply voltage is only 42 volts, high side gate drivers incorporate
bootstrapping techniques to generate the required voltages. The effective high side
gate voltage generated by the gate driver is given by:
g phaseA d4V =V + 12V - V
where Vd4 is the forward voltage of diode, d4.
Figure 8 Gate Drive Schematic [2]
The gate driver chosen for the design was an International Rectifier IR2101. It has in
a single 8-pin package both a high and low side gate driver. As such, one IR2101 is
27
capable of driving one MOSFET pair. Since the motor controller is intended for a
three-phase motor, there are three identical gate driver circuits.
From figure 8, U4 is the IR2101 gate driver; diode D4 and capacitor C8 form the
bootstrapping arrangement for the high side gate driver. MOSFET Q1 is the topside
transistor and Q2 is the low side transistor. Resistors RG1 and RG2 are 15 ohm series
current limiting resistors. There sole purpose is to limit the initial gate inrush current
to protect the gate drivers.
Pulse width modulation (PWM) is applied to the low side transistors while the high
side switches are simply on or off.
IR2101s Specs [13]
Logic level inputs
Reverse voltage immune
Bootstrap operational up to +600 volts
10 to 20 volt supply
SOIC8 package
Up to 400 kHz switching frequency (thermal limitation)
$5.08 each
28
4.4 Power Supply
A power supply circuit was needed to provide power to logic level components as
well as other components that were unable to operate from the 42-volt supply rail.
The gate drive circuitry, signal amplifier, and Hall Effect sensors required 12 volts to
operate while all of the digital hardware needed 5V. It was decided to create a +12
volt rail from which the 5volt supply would be derived.
Linear regulators were out of the question for stepping 42 volts down to 12 volts. The
main reason was the large amount of power that would have been dissipated across
the linear regulator. Also, commonly and cheaply available regulators only supported
input voltages up to 36 volts. An estimated 300 mA was required from the +12-volt
rail. From a linear regulator the power dissipation Preg would be:
( ) ( )reg cc out outP = V -V I = 42-12 0.3 9watts× =
for a power output of 3.6 watts.
A switch mode regulator was the logical solution for the 12-volt supply. The
inexpensive LM2574HVN-adj buck regulator was chosen. The efficiency of this
regulator was 84%.
LM2547HVN-adj Specs
+60 volt input
Adjustable output
52kHz switching frequency
500 mA output
DIP-8 package
29
Figure 9 Power Supply Schematic [2]
From figure 9, diode D7 (1N4148), inductor L1 (330uH) and capacitor C4 (220uF)
form the output filter for the buck converter. Variable resistor R6 (500kΩ) provides
feedback to the regulator and enables the output voltage to be precisely set. Capacitor
C5 (0.1uF) is a bypass capacitor for high frequency noise.
The 5-volt supply was derived using a linear regulator running off the 12-volt rail. An
LM7805 regulator was used.
30
4.5 Current Sense Amplifiers
The current sense amplifiers were required to provide motor current information to
the micro controller. Current was sensed in both directions. Under normal operation,
the current flows from the +42 volt rail, through the motor and to ground through the
current sense resistor. When the motor under goes braking, current flows from
ground, through the motor and onto the +42 volt rail. The current needs to be limited
to 23.8 amps in both directions to prevent damage to the motors stator winding.
Taking direct current measurements from the sense resistor does not utilise the full
dynamic range of the analogue to digital converter (ADC) inside the micro controller.
Therefore, the current signal needs to be amplified. At full operating current the
voltage across Rsense is 0.119 volts. A gain of 39 provides the micro controller with
4.64 volts when the current limit is reached. The resistor values required to achieve
this gain are standard values. It also insures that if the current limit is exceeded, the
micro controller has enough headroom left to be able to detect the over current
condition.
Figure 10 Current Sense Amplifier Schematic [2]
31
A single supply, rail-to-rail opamp, the LMV324 was chosen. The opamp is supplied
from the +5V rail, ensuring that the micro controllers ADC doesnt see more than 5V
on its inputs. The current signal is amplified differentially to avoid any DC offset due
to opamp bias currents. The gain of the opamp circuits is determined by the following
formula:
14 1615 17
R RGR R
= =
R15=R17=1kΩ
and
R14=R16=39kΩ
were used.
32
4.6 Hall Effect Sensor Interface
Most brushless DC motors have incorporated in the stator several Hall Effect sensors.
These sensors provide rotor position information to the motor controller. Hall effect
sensors are open collector devices as shown in figure 6.
Figure 11 Open Collector Hall Effect Sensor [2]
These devices require a pull up resistor from the collector to a positive supply voltage.
In this case the sensor is pulled up to +12volts. The micro controller can only support
input voltages up to +5V. To clamp the output voltage, 5.1-volt zenner diodes are
connect in reverse bias between the output and ground. To minimise power
dissipation in the Hall Effect sensors by limiting current, 10kΩ pull up resistors are
used.
33
Figure 12 Hall Effect Sensor Interface Schematic [2]
34
4.7 Pressure Switch Interface
The pressure switch interface allows the connection of pressure switches to the micro
controller. Pressure switches are normally closed devices. When the pressure applied
to the switch falls below a certain level, the switch becomes open.
Figure 13 Pressure Switch Interface Schematic [2]
When the pressure switches are connected and the systems pressure is above the
minimum level, they are required to produce 0 volts at nodes Hpressure and
Lpressure. When the system pressure drops below a safe level the switches need to
create +5 volts.
Using resistor values:
R12=R13= 10kΩ
and R4=R5=100Ω
When one or both switches are closed (system pressure OK), the output voltage is:
1005 0.510000
outV volts = =
This will be read by the micro controller pin as logic low.
When one or both switches are open (system pressure low), the output voltage is:
5outV volts=
35
since there is no current path.
Diodes D8 and D9 are 5.1 volt zenner diodes which clamp the voltage on the micro
controller pins to +5.1 volts.
36
4.8 Micro Controller
An Atmel Mega8L, 8 Mhz micro controller was chosen for the task of performing the
logic operations required to commutate and control the motor. A micro controller was
chosen over a digital signal processor (DSP) to reduce cost and lower the complexity
of the associated hardware. Also, development tools and support were readily
available for the AVR processors.
Figure 14 Micro Controller Schematic [2]
From figure 14, switches, S1, S2 and S3 are input switches. They allow user control
of certain motor controller functions such as direction, mode, start/stop. Headers J5
and J6 are connection points for high side and low side pressure switches. Light
emitting diodes (LEDs) LED1, LED2 and LED3 serve as indicators to signal certain
conditions inside the motor controller.
37
Component, Y1 is an 8 MHz crystal. Capacitors C6 and C7 are crystal stabilizing
capacitors. Resistor, R7 is a pull up resistor for the micro controller reset pin.
The micro controllers ADC has a +5-volt reference. Pulse width modulation (PWM)
is provided from PORTB1, PORTB2 and PORTB3.
Atmel AVR Mega8L Specs [10]
8 MIPS at 8 MHz clock
3.3 to 5V operation
3 8-bit PWM channels
5 10-bit ADC channels
3 internal timer units
DIP-8 package
$7.38
38
4.9 Temperature Sensor
Temperature sensor information is used to control motor speed. When the desired
temperature has been reached, the motor can be run at lower speed. A national
instruments LM35 was chosen for the application since no further external
components are required. The temperature sensor is connected to PORTC3.
Figure 15 Temperature Sensor Schematic [2]
LM35 Specs
1mV per degree celcius
TO92 package
$
39
Chapter 5 Firmware Implementation Reliable firmware was critical to reliable motor operation. The micro controller is
required to manipulate three PWM channels and three IO channels appropriately to
commutate the motor and provide speed control.
The firmware was written in the C programming language using Codevision AVR
1.23.8c [11].
Ideally, the firmware was going to perform the task of a finite state machine.
However, the changes in Hall Effect transition was not seen by the controller quick
enough, resulting is skipped states and commutation error. The firmware had to be
purely combinatorial. The following body of code outlines commutation generation
and speed control: //Commutation code. Motor running with PWM if((S1==0) && (S2==1) /*&& (pressure==1) && (Imax==0)*/) if((H1==1)&&(H2==0)&&(H3==0)) if (!startedTiming && throughEnd) ++loops; /*if (loops >= CHECK_LOOPS) // Retrieve and reset the timer // (0xFF-TCNT0)*(1/7813) = Time For Revolution in seconds // 60/Rev Time = Revolutions/Second motorSpeed = (CHECK_LOOPS*7813*60/(timerTicks + (0xFF-TCNT0))); if (motorSpeed > MOTOR_RPM && PWM > 0) int diff; diff = motorSpeed-MOTOR_RPM; PWM -= (diff/CHANGE_DIVISOR) + 1; if (PWM < MIN_PWM) PWM = MIN_PWM; else if (motorSpeed < MOTOR_RPM && PWM < 0xFF) int diff; diff = MOTOR_RPM-motorSpeed; PWM += (diff/CHANGE_DIVISOR) + 1; if (PWM > MAX_PWM) PWM = MAX_PWM; TCNT0 = 0xFF; timerTicks = 0; loops = 0; */ startedTiming = 1; throughEnd = 0;
40
PORTB=t1; OCR1A=PWM; OCR1B=0x00; OCR2=0x00; if((H1==1)&&(H2==1)&&(H3==0)) PORTB=t2; OCR1A=PWM; OCR1B=0x00; OCR2=0x00; if((H1==0)&&(H2==1)&&(H3==0)) PORTB=t3; OCR2=PWM; OCR1A=0x00; OCR1B=0x00; if((H1==0)&&(H2==1)&&(H3==1)) PORTB=t4; OCR2=PWM; OCR1A=0x00; OCR1B=0x00; if((H1==0)&&(H2==0)&&(H3==1)) PORTB=t5; OCR1B=PWM; OCR2=0x00; OCR1A=0x00; if((H1==1)&&(H2==0)&&(H3==1)) throughEnd = 1; startedTiming = 0; PORTB=t6; OCR1B=PWM; OCR2=0x00; OCR1A=0x00; //remove this and try if((S1==1)&&(S2==1)) OCR1B=0x00; OCR1A=0x00; OCR2=0x00; PORTB=0x00; Speed control is achieved by clearing a timer in the first state and then reading it in the last state. The time taken for one electrical cycle is simply the timer value multiplied by the appropriate scaling factor. The timer values are averaged to reduce error. Averaging does however slow down the motor controllers response to load or supply voltage changes. If the motor speed is less than the desired speed, the pulse width modulator (PWM) duty cycle is increases. If speed is higher than desired, duty cycle is decreased. When a low-pressure condition occurs, the motor must be shut down. Monitoring the status of the pressure switches does this //Motor free wheel on pressure if (pressure ==0)
When a low-pressure condition is detected, the motor is free wheeled to a stop by
turning off all gate signal outputs.
Temperature control is provided by the following code: //temperature sensor code
if(temperature>20)
MOTOR_RPM=1300;
PORTD.3=1;
PORTD.4=0;
if(temperature<=20)
MOTOR_RPM=1000;
PORTD.3=0;
PORTD.4=1;
Once the cabin temperature reaches a preset temperature, the motor desired speed is
reduced.
Current limiting is implemented as follows: //current limit code limit to 25 amps
if(current>250)
Imax=1;
PORTD.5 = 1;
else
42
Imax=0;
PORTD.5 = 0;
If the motor current exceed 25 amps, a flag is set. This flags results in all outputs
being turned off. A variable was not used for the current limit as the limit is a hard
limit and should not be changed.
A copy of the micro controller code is available in appendix 3.
43
Chapter 6 Product Evaluation and Results 6.1 Motor Truth table
To drive the motor using Hall Effect sensor information, it was necessary to extract
the truth table from the motor. This was accomplished as follows:
1. Connect all three Hall sensor outputs to an oscilloscope. 2. Arbitrarily label the stator phase connections, phase A, phase B and phase C. 3. Connect the oscilloscope such as to measure phase voltage Vac. 4. Turn the rotor by hand, observe and record the state of each hall effect sensor
at the peak of the sinusoidal back EMF waveform. 5. Repeat steps 3 and 4 but change the phase voltage being measured. The
process is complete when all six states are known.
// Analog Comparator initialization // Analog Comparator: Off // Analog Comparator Input Capture by Timer/Counter 1: Off // Analog Comparator Output: Off ACSR=0x80; SFIOR=0x00; // ADC initialization // ADC Clock frequency: 62.500 kHz // ADC Voltage Reference: AREF pin // ADC High Speed Mode: Off // ADC Auto Trigger Source: None // Only the 8 most significant bits of // the AD conversion result are used ADMUX=FIRST_ADC_INPUT|ADC_VREF_TYPE; ADCSRA=0xCF; SFIOR&=0xEF; #asm("sei") while (1) //Commutation code. Motor running with PWM if((S1==0) && (S2==1)) if((H1==1)&&(H2==0)&&(H3==0)) if (!startedTiming && throughEnd) ++loops; if (loops >= CHECK_LOOPS) // Retrieve and reset the timer // (0xFF-TCNT0)*(1/7813) = Time For Revolution in seconds // 60/Rev Time = Revolutions/Second motorSpeed = (CHECK_LOOPS*7813*60/(timerTicks + (0xFF-TCNT0))); if (motorSpeed > MOTOR_RPM && PWM > 0) int diff; diff = motorSpeed-MOTOR_RPM; PWM -= (diff/CHANGE_DIVISOR) + 1; if (PWM < MIN_PWM) PWM = MIN_PWM; else if (motorSpeed < MOTOR_RPM && PWM < 0xFF)