Vous êtes sur la page 1sur 62

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

1
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

2
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.

3
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 PCB’s.

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
environment.

4
Contents
Chapter 1 – Introduction...............................................6
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
Chapter 4 – Hardware Implementation ....................22
4.1 Hardware design and component selection.......................................................22
4.2 MOSFET Bridge................................................................................................22
IRF3803 Specs [12] .............................................................................................24
4.3 Gate Drive.........................................................................................................26
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 5 – Firmware Implementation.....................39
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 7 – Future Developments..............................49
Chapter 8 – Conclusion ...............................................50
References.....................................................................51
Appendix ...............................................................53
Appendix 1...............................................................................................................54
Appendix 2...............................................................................................................55
Appendix 3...............................................................................................................56

5
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 don’t 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.

6
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.

7
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 it’s capabilities.

8
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 don’t produce the levels of electromagnetic
radiation common to universal motors. [Bentouati, S.; Zhu, Z.Q.; Howe, D. (1999)]

A brushless DC motor’s 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:

T = D ( 2π r 2 LBgKrms ) = Krmsϕ 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:

ω = V × Kspeed
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.

9
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

120

100

80
Torque (%)

60

40

20

0
0 20 40 60 80 100
Current (%)

Figure 1 – BLDC motor torque speed curve

2.2 Brushless DC Motor Construction


A brushless DC motor’s 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 don’t require slip rings so motor maintenance is reduced and
reliability is increased. Slip rings create dust as they wear. The dust needs to be

10
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

11
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 controller’s 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 sensor’s 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 it’s rated current. Alternatively, current may be controlled with speed
limiting to prevent the motor from running faster than its rated speed. This is

12
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 motor’s 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.

13
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 won’t 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 it’s “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 it’s
resistance is referred to as conduction loss. Conduction loss, Pon, is given by:
ton 2
Pon = Ion Rds
Ts
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
Psw = VdIofs (tcon + Tcoff )
2

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.

14
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:

P
Id =
Vd
so the conduction loss is:
2
ton ton  P 
Pon = Ion 2 Rds =   Rds
Ts Ts  Vd 
and switching loss is given by:

1 1 P
Psw = VdIofs (tcon + Tcoff ) = Vd   fs (tcon + Tcoff )
2 2  Vd 
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:
1
T = D ( 2π r 2 LBgKrms ) = Krmsϕ I = Kpeakϕ I
3

15
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
T = D ( 2π r 2 LBgKrms ) = Krmsϕ I = Kpeakϕ I
3
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.

16
Operating Output Power
Manufacturer Part number Voltage stage output Features Price Comments
Built in high and low side gate requires additional components for closed loop
Allegro IC A3932 50 external driver 9 control
Built in high and low side gate requires additional components for closed loop
Allegro IC A3932 50 external driver control
On Designed for P-channel high requires additional components for closed loop
Semiconductor MC33033 20 external side switches 17 control
ST Micro 130 W Not enough power for air conditioning but more
Electronics L6234 52 internal cont 3 Phase MOSFET output stage than enough for cooling fans or pumps
ST Micro 130 W Not enough power for air conditioning but more
Electronics L6235 52 internal cont 3 Phase MOSFET output stage than enough for cooling fans or pumps
Texas Libraries and app. notes available for brushless
Instruments TMS320F2406 3.3 external Digital signal processor 22 DC motor control
Atmel 5 external 8-bit micro controller 17
ST Micro Specifically designed for VCR tape drive
Electronics L6287 20 internal 26 W 3 Phase MOSFET output stage application
ST Micro 3 phase sinusoidal voltage Very versatile controller. Only required one Hall
Electronics L7203 12 internal 24 W output effect sensor input
ST Micro 15 W Digital controller, 3 wire serial Spindle motor controller. Typical applications
Electronics L7250 12 internal cont interface to uP include computer hard disk and CD-ROM drives
3 Phase MOSFET output stage,
Fairchild 3.3 or 5 volt interface for DSP Spindle motor controller. Typical applications
Semiconductor KA3011BD 18 internal 20W connection include computer hard disk and CD-ROM drives
Table 1 – Summary of available motor controllers

17
Most of these control IC’s 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. It’s 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. It’s 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. It’s 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.

18
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.

19
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 motor’s stator windings.

A cabin temperature sensor is needed to provide information on when to reduce motor


speed.

20
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.

21
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.

22
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.

23
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:

ton 2
Pon = Ion Rds
Ts

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
Psw = VdIofs (tcon + Tcoff )
2
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

24
Ploss total = 20.1 Watts – this occurs when the motor controller is running at full power
output (1kW).

Pout 1000
Therefore expected efficiency, η = = = = 98.2%
Pout + Ploss _ total 1000 + 20.1

25
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:

Vg=VphaseA + 12V - Vd4


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

26
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

27
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:

Preg= ( Vcc-Vout ) Iout= ( 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

28
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.

29
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 motor’s 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]

30
A single supply, rail-to-rail opamp, the LMV324 was chosen. The opamp is supplied
from the +5V rail, ensuring that the micro controller’s ADC doesn’t 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:
R14 R16
G= =
R15 R17
R15=R17=1kΩ
and
R14=R16=39kΩ
were used.

31
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.

32
Figure 12 – Hall Effect Sensor Interface Schematic [2]

33
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:
 100 
Vout = 5   = 0.5volts
 10000 
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:
Vout = 5volts

34
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.

35
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. Header’s J5
and J6 are connection points for high side and low side pressure switches. Light
emitting diodes (LED’s) LED1, LED2 and LED3 serve as indicators to signal certain
conditions inside the motor controller.

36
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 controller’s 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

37
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
$

38
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;
}

39
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 controller’s 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)
{

40
PORTB=0x00;
OCR1B=0x00;
OCR1A=0x00;
OCR2=0x00;
PORTB=0x00;
}

//pressure switch code


if((PIND.6==1)&&(PIND.7==1))
{
pressure=1;
}
if((PIND.6==1)&&(PIND.7==0))
{
pressure=0;
}
if((PIND.6==0)&&(PIND.7==1))
{
pressure=0;
}
if((PIND.6==0)&&(PIND.7==0))
{
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

41
{
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.

42
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.

Clockwise Phase Hall 1 Hall 2 Hall 3 Switch


Vac 1 0 0 1,6
Vbc 1 1 0 3,6
Vba 0 1 0 3,2
Vca 0 1 1 5,2
Vcb 0 0 1 5,4
Vab 1 0 1 1,4

Counter
clockwise Vca 0 1 1 5,2
Vcb 0 0 1 5,4
Vab 1 0 1 1,4
Vac 1 0 0 1,6
Vbc 1 1 0 3,6
Vba 0 1 0 3,2
Table 2 – Motor truth table

Table 2 summarises the motor truth table. Also included is the transistor pair that
must be switched to energise the required phases. Both the forward and reverse truth
table has been included in the event that the motor is geared or if the load is coupled
to the flywheel as opposed to the shaft.

43
6.2 Hardware
A prototype circuit was built and results were obtained.

Figure 16 – Motor controller circuit board

Figure 1 shows the motor controller circuit board. A ground plane was placed under
the lower power part of the circuit to reduce noise effects and increase the heat
spreading area. Reducing noise effect is particularly important to avoid false gate
triggering. False gate triggering would lead to cross conduction, which in turn would
lead to large amounts of dissipated power. MOSFET failure may or may not occur
depending of the temperature of the devices.

State machine coding was not possible due to limitation of the micro controller. The
changes in Hall Effect sensor states were not detected fast enough for the state
machine to be effective. As a result, at high motor speeds, some states were skipped.
This defeated the purpose of having a state machine. The state machine code was
written in such a manner that if an invalid state was detected, the motor controller
would cease to operate until reset. This resulted in proper operation at low speeds up
to 400 rpm but resulted in a fault condition for higher speeds.

44
An alternate approach would have been to use a micro controller with three input
capture units, or a digital signal processor (DSP). The interrupt associated with the
input capture units would have served as the trigger for a change of state. A field
programmable gate array (FPGA) may also have been used to produce an application
specific IC (ASIC), however, cost would also have been increased.

6.3 Efficiency and Performance


Efficiency measurements were taken with surprising results. The efficiency was
measured by measuring the power supply line current and voltage. The measured
power was compared with motor current and motor supply voltage. The motor
current was measured by measuring the voltage across the current sense resistor. The
exact resistance of the sense resistor was determined by driving a constant current (1
amp) through the resistor and measuring the resulting voltage across it. The exact
resistance was calculated to be 0.0053 ohms. The motor supply voltage was used as
the input voltage since during efficiency testing the motor was run with a pulse width
of 100%. This meant the motor would be energised with the full supply voltage of 42
volts.

The mechanical power was not measured at the motor shaft. It was not required as
the project specification defined outputting 1kW from the controller, not the motor.

Motor Phase Power Supply


Measurements MOSFET Measurements Measurements

Phase Duty Motor Pcond Total Conduction Switching


Current Cycle Power Vds(on) per FET loss loss Line Vin Pin Efficiency
20.9 100 501.6 0.165 1.15 6.90 5.103 21.4 24 513.6 97.14
20.9 100 627 0.161 1.12 6.73 17.2702 21.7 30 651 95.88
21.2 100 763.2 0.191 1.35 8.10 13.5016 21.8 36 784.8 96.89
19.4 100 814.8 0.14 0.91 5.43 7.168 19.7 42 827.4 98.16
Table 3 – Summary of efficiency [1]

Switching loss was deduced by subtracting all of the measurable losses and output
power from the input power. A maximum theoretical efficiency of 98.2% was
calculated. An efficiency of 98.16% was recorded for an 827-watt output. The motor
controller couldn’t be tested at 1kW output due to the lack of power supplies from

45
which to run the circuit. The 42-volt test was conducted by running the motor from
30 volts to cool down the test room. This reduced the load on the compressor slightly.
Then 42 volts was applied.

Conduction losses were determined by measuring the drain to source voltage and
multiplying it by the motor current. The losses were calculated on a per FET basis
then multiplied to get a total power dissipation.

Time didn’t permit attaching heat sinks to the transistors. The circuit board was
placed in the cold air stream of the air conditioner for cooling. Due to the small
surface area of the TO-220 transistor packages, the MOSFETs did get hot. The heat
was transferred through the transistor legs to the printed circuit board (PCB) tracks.
After 30 minutes of operation, the copper tracks were discoloured. Some tracks had
begun to lift off the board. Appropriate heat sinking would have avoided this
problem.

In trying to keep the controller compact, tracks could not be made as wide as required.
Instead, copper braid was soldered onto high current tracks. The tracks where then
flooded with solder.

6.4 Budget
One of the purposes of this project was to produce a low cost solution. This part of
specification was comfortably met. Table 4 lists all parts used in the evaluation
board. The total bill of materials was $92.90. The printed circuit board measured
150mm x 100mm. At $2.20 per square inch, the total board cost was $52.80. The
board was a large part of the overall cost. This was unavoidable since a plated
through board was required due to the number of surface mount components. The
overall cost of the hardware was $145.70.

Part Type Designator Footprint Description Value Supplier Order Code Price
C1 rb.3/.6 Capacitor 1000uF Farnell 345-1343 2.92
C10 Rad-0.2 Capacitor 0.47uF Farnell 218-522 0.82
C11 Rad-0.1 Capacitor 0.1uF Farnell 303-896 0.34
C12 Rad-0.1 Capacitor 0.1uF Farnell 303-896 0.34
C14 Rad-0.1 Capacitor 0.1uF Farnell 303-896 0.34
C2 rb.3/.6 Capacitor 1000uF Farnell 345-1343 2.92

46
C3 rb-.2/.4 Capacitor 220uF Farnell 580-480 0.69
C4 rb-.2/.4 Capacitor 220uF Farnell 580-480 0.69
C5 Rad-0.2 Capacitor 0.1uF Farnell 303-896 0.34
C6 805 Capacitor 22pF Farnell 301-9184 0.13
C7 805 Capacitor 22pF Farnell 301-9184 0.13
C8 Rad-0.2 Capacitor 0.47uF Farnell 218-522 0.82
C9 Rad-0.2 Capacitor 0.47uF Farnell 218-522 0.82
D1 axial-0.3 Zener Diode 5.1V Farnell 316-2412 0.08
D10 axial-0.3 Zener Diode 5.1V Farnell 316-2412 0.08
1N4148 D11 axial-0.3 Schottky Diode Farnell 368-106 0.03
D2 axial-0.3 Zener Diode 5.1V Farnell 316-2412 0.08
D3 axial-0.3 Zener Diode 5.1V Farnell 316-2412 0.08
1N4148 D4 axial-0.3 Schottky Diode Farnell 368-106 0.03
1N4148 D5 axial-0.3 Schottky Diode Farnell 368-106 0.03
1N4148 D6 axial-0.3 Schottky Diode Farnell 368-106 0.03
1N4148 D7 axial-0.4 Schottky Diode Farnell 368-106 0.03
D8 axial-0.4 Zener Diode 5.1V Farnell 316-2412 0.08
D9 axial-0.4 Zener Diode 5.1V Farnell 316-2412 0.08
Fuse F1 pctb2n Fuse connector EWS 1
Halls J1 sip-5 Hall Connector EWS 0
Hi J5 pctb2n Switch Connector EWS 1
Lo J6 pctb2n Switch Connector EWS 1
L1 inductor 0.5 A inductor 330uH Farnell 322-7340 1.61
LED1 LED EWS 0.3
LED2 led EWS 0.3
LED3 led EWS 0.3
IRF3710 Q1 to220a N-Channel MOSFET Polykom 3.7
IRF3710 Q2 to220a N-Channel MOSFET Polykom 3.7
IRF3710 Q3 to220a N-Channel MOSFET Polykom 3.7
IRF3710 Q4 to220a N-Channel MOSFET Polykom 3.7
IRF3710 Q5 to220a N-Channel MOSFET Polykom 3.7
IRF3710 Q6 to220a N-Channel MOSFET Polykom 3.7
R1 805 10k Farnell 911-975 0.08
R12 805 10k Farnell 911-975 0.08
R13 805 10k Farnell 911-975 0.08
R14 805 39k Farnell 912-049 0.08
R15 805 1k Farnell 911-859 0.08
R16 805 39k Farnell 912-049 0.08
R17 805 1k Farnell 911-859 0.08
R2 805 10k Farnell 911-975 0.08
R3 805 10k Farnell 911-975 0.08
R4 805 100 Farnell 911-732 0.08
R5 805 100 Farnell 911-732 0.08
R6 vr-5 Potentiometer 500k Farnell 349-318 3.15
R7 805 1k Farnell 911-859 0.08
R8 805 100 Farnell 911-732 0.08
RG1 1206 Gate resistor 15 Farnell 308-7566 0.05
RG2 1206 Gate resistor 15 Farnell 308-7566 0.05
RG3 1206 Gate resistor 15 Farnell 308-7566 0.05
RG4 1206 Gate resistor 15 Farnell 308-7566 0.05
RG5 1206 Gate resistor 15 Farnell 308-7566 0.05

47
RG6 1206 Gate resistor 15 Farnell 308-7566 0.05
Rnet1 sip-5 Connector 10k Farnell 911-975 0.08
0.005 Ohm Rsense1 Cshunt Sense resistor 0.005 Farnell 327-4780 2.45
S1 sip-2 EWS 0
S2 sip-2 EWS 0
S3 sip-2 EWS 0
LM7805 U1 to220a Linear regulator 5V Farnell 701-853 1.09
LM2574HVN U2 DIP8 Switching regulator adjustable Farnell 412-5708 7.39
ATMEGA8 U3 dip28s Micro controller Farnell 391-7940 14.33
IR2101 U4 dip-8 Gate driver Farnell 360-7010 6.3
IR2101 U5 dip-8 Gate driver Farnell 360-7010 6.3
IR2101 U6 dip-8 Gate driver Farnell 360-7010 6.3
LM358 U7 dip-8 Op amp Farnell 301-2748 0.55
LM35 U8 TO92/E Temp. sensor NSC samples 0
Y1 xtal-1 Crystal 8 Mhz Farnell 103-914 3.98
Total 92.9
Table 4 – Bill of materials

The IR2101 gate drivers were one of the most expensive components since three parts
were required. The IRF3808 transistors were extremely well priced. They were the
only 75-volt automotive rated transistors available at design time. They also meet all
of the required specifications for drain-source resistance.

48
Chapter 7 – Future Developments

Future improvements to the motor controller design may be made to make the
controller more flexible. For it’s intended application, the current design is
satisfactory. However, to run motors at higher speeds, a faster controller would be an
option. The best way to make a universal controller would be using a field
programmable gate array (FPGA) to produce an application specific controller.

Though the MOSFET bridge, gate driver, power supplies and sensor interfaces
worked as required, a redesign of the digital controller would provide a significant
improvement to the overall motor controller. A digital signal processor would be the
logical choice. Alternatively, a dedicated, off the shelf controller IC could be used
along with a small micro controller to perform the control loop calculations. This
would alleviate the need for external gate drivers, reducing the cost of the solution
along with the problem of slow controllers. A possible solution would be using the
Allegro A3932 coupled to an 8 bit micro controller.

A further size reduction may be possible by using a MOSFET pack rather than
discrete transistors. However, finding a FET pack with the required characteristics
may prove difficult while the 42 volt automotive standard is still in it’s early days.
Currently available transistor packs would reduce the overall efficiency of motor
controller due to there higher drain to source resistance.

A suitable enclosure for the motor controller would add to it’s appeal and practicality.
Integrating the heat sinks into the package would reduce the size of the overall
solution. Aluminium would ideally be used.

49
Chapter 8 – Conclusion

Though this project resulted in a successful prototype, the potential exist for
improvement to certain parts of the design. Most parts of the design functioned
perfectly, while others could have been improved. The power interface, made up of
the MOSFET bridge, gate driver and current sensing amplifier performed well. The
digital part of the motor controller, though performed well for low speed, could have
been improved. A redesign of the digital hardware would have been required.

The results obtained outlined the success of the prototype circuit for its intended
application. The measured efficiencies were very close to the calculated efficiency.
At 42-volt operation, an efficiency of 98.16 was measured. The calculated maximum
efficiency was 98.2%.

Design factors, heat sinking in particular needed more attention. The effects of heat
sinking didn’t become evident until the controller was tested under full load. Also
made evident was the need to modify the printed circuit board to carry the required
currents without resulting in board stress and damage.

50
References

[1] Advanced PM brushless DC motor control and system for electric vehicles
Fang Lin Luo; Hock Guan Yeo;
Industry Applications Conference, 2000. Conference Record of the 2000 IEEE ,
Volume: 2 , 2000
Page(s): 1336 -1343 vol.2

[2] Permanent magnet brushless DC motors for consumer products


Bentouati, S.; Zhu, Z.Q.; Howe, D.;
Electrical Machines and Drives, 1999. Ninth International Conference on (Conf. Publ.
No. 468) , 1999
Page(s): 118 –122

[3] Electric drives for pump, fan, and compressor loads in automotive applications
McCleer, P.J.;
Industrial Electronics, 1995. ISIE '95., Proceedings of the IEEE International
Symposium on , Volume: 1 , 10-14 Jul1995
Page(s): 80 -85 vol.1

[4] Automotive electrically driven air conditioner system


Oldenkamp, J.L.; Erdman, D.M.;
Automotive Power Electronics, 1989 , 28-29 Aug 1989
Page(s): 71 –72

[5] Design of an integrated motor/controller drive for an automotive water pump


application
Harris, N.C.; Jahns, T.M.; Surong Huang;
Industry Applications Conference, 2002. 37th IAS Annual Meeting. Conference
Record of the , Volume: 3 , 2002
Page(s): 2028 -2035 vol.3

51
[6] A novel based-based sensorless brushless DC (BLDC) motor drive for automotive
fuel pumps
Jianwen Shao; Nolan, D.; Teissier, M.; Swanson, D.;
Industry Applications Conference, 2002. 37th IAS Annual Meeting. Conference
Record of the , Volume: 4 , 2002
Page(s): 2386 -2392 vol.4

[7] Texas Instruments Appl Note SPRU469

[8] Electrical Machines for Drives


Slemon, G. R.;
Power Electronics and Variable Frequency Drives, 1996, p62 – 65. IEEE Press

[9] “MC33035, NCV33035 Datasheet,” On Semiconductor, 2003

[10] “Atmel AVR Atmega8 Datasheet,” Atmel Corporation, 2003

[11] HP InfoTech. Codevision AVR. 2003 (v1.23.8c) Available:


http://www.hpinfotech.ro/html/cvavr.htm

[12] “IRF3808 Datasheet,” International Rectifier, 2003

[13] “IR2101 Datahseet,” International Recifier, 2003

52
Appendix

53
Appendix 1

Motor Phase Power Supply


Measurements MOSFET Measurements Measurements

Phase A Duty Motor Pcond Total Conduction Switching


Current Cycle Power Vds(on) per FET loss loss Line Vin Pin Efficiency
20.9 100 501.6 0.165 1.15 6.90 5.103 21.4 24 513.6 97.14
20.9 100 627 0.161 1.12 6.73 17.2702 21.7 30 651 95.88
21.2 100 763.2 0.191 1.35 8.10 13.5016 21.8 36 784.8 96.89
19.4 100 814.8 0.14 0.91 5.43 7.168 19.7 42 827.4 98.16

54
Appendix 2
1 2 3 4 5 6
U1 U2
+12V +12V LM7805 +5V
+12V 1 3 1 8

GND
IN OUT Vfb FB NC
+12V +12V
C3 2 7 L1
Sig GND Output
R1

2
J1 R2 3 6 +
On/Off NC
R3 R6 C5
5 +12v D7 C4
4 5
4 PWR GND Vin Vfb
3 H1
D D
2 H2 D11
1 D1 H3
Halls D2
D3

J2 F1
4
3 FUSE2
+ C1 + C2 +12V D4
2
1
+5V
PWR U4
1 8
Vcc Vboot C8
2 7
Hin1 Hin HO
R7 3 6 Q1 Q3 Q5
Lin Vs PhaseA
4 5 IRF3710 IRF3710 IRF3710
COM LO RG1
U3 D5
1 28
RST PC6 PC5 Vsense2 +12V
2 27 RG3 RG5
PD0 PD0 PC4 Vsense1
3 26 U5
PD1 PD1 PC3 TEMP
4 25 1 8
PD2 PD2 PC2 H3 Vcc Vboot C9
5 24 2 7
C PD3 PD3 PC1 H2 Hin2 Hin HO Output C
C6 6 23 3 6
PD4 PD4 PC0 H1 Lin Vs PhaseB PhaseA 1
7 22 4 5
+5V Vcc GND COM LO 2
8 21
Gnd ARef +5V PhaseA PhaseB PhaseC PhaseB 3
9 20
Y1 PB6 (XTAL) AVcc +5V 4
10 19
PB7 (XTAL) PB5 Hin2
SCK D6 PhaseC 5
11 18 +12V
PD5 PD5 PB4 MISO
Hin1 6
C7 12 17

MOSI
Hpressure PD6 PB3
13 16 J3
Lpressure PD7 PB2
14 15 U6
Hin3 PB0 PB1
1 8
Vcc Vboot C10
ATMEGA8 2 7
Hin3 Hin HO
3 6
Lin Vs PhaseC
4 5
COM LO

RG4 RG6

Rnet1 Q2 Q4 Q6
U8 IRF3710 IRF3710 IRF3710
5 RG2
S3 LM35
4
S2 2 1
3 +5V TEMP Vout VCC VCC Rsense1
2 S1 +5V
0.005 Ohm

GND
1 +5V
B B

PD2
PD1
Rsense

PD0
3
+5V
D10

Vsense1
R8
LED1
R12
PD3
LED2
R4
J5 D8
PD4
2
1 LED3
R14
Hi U7 +12V
PD5
1 8
Out1 +Vcc

Hpressure
2 7 C12
In1- Out2 R15
3 6
In1+ In2-
+5V 4 5
-Vcc In2+ Rsense
LM358 R17
R16
R13

A C11 A
J6 D9 C14
R5 Title
2
1
Lo Size Number Revision
B

Lpressure
Date: 29-Oct-2003 Sheet of
File: E:\Protel\mega8.ddb Drawn By:
1 2 3 4 5 6

55
Appendix 3
#include <mega8.h>
#include <math.h>

#define H1 PINC.0
#define H2 PINC.1
#define H3 PINC.2

#define S1 PIND.0
#define S2 PIND.1
#define S3 PIND.2

#define t1 0x12
#define t2 0x22
#define t3 0x28
#define t4 0x09
#define t5 0x05
#define t6 0x14

int PWM=150;

int temperature=0;
int current=0;
//char pressure=1;
char Imax=0;

volatile long timerTicks = 0;

int startedTiming = 0;
int throughEnd = 1;
long motorSpeed;
int loops = 0;
int MOTOR_RPM=900;

#define CHECK_LOOPS 5
//#define MOTOR_RPM 1500
#define CHANGE_DIVISOR50

#define FIRST_ADC_INPUT 3
#define LAST_ADC_INPUT 5
unsigned char adc_data[LAST_ADC_INPUT-FIRST_ADC_INPUT+1];
#define ADC_VREF_TYPE 0x20
// ADC interrupt service routine
// with auto input scanning

56
#pragma savereg-
interrupt [ADC_INT] void adc_isr(void)
{
#asm
push r26
push r27
push r30
push r31
in r30,sreg
push r30
#endasm
register static unsigned char input_index=0;
// Read the 8 most significant bits
// of the AD conversion result
adc_data[input_index]=ADCH;
// Select next ADC input
if (++input_index > (LAST_ADC_INPUT-FIRST_ADC_INPUT))
input_index=0;
ADMUX=(FIRST_ADC_INPUT|ADC_VREF_TYPE)+input_index;
// Start the AD conversion
ADCSRA|=0x40;
#asm
pop r30
out sreg,r30
pop r31
pop r30
pop r27
pop r26
#endasm
temperature=(char) ((int) adc_data[0]*100)/256;
current=adc_data[1];
}
#pragma savereg+

// Timer 0 overflow interrupt service routine


interrupt [TIM0_OVF] void timer0_ovf_isr(void)
{
timerTicks += 0xFF;
}

void main(void)
{
PORTB=0x00;
DDRB=0x3F;
PORTC=0x00;
DDRC=0x00;
PORTD=0x00;
DDRD=0x38;

57
// Timer/Counter 0 initialization
// Clock source: System Clock
// Clock value: 7.813 kHz
TCCR0=0x05;
TCNT0=0x00;

// Timer/Counter 1 initialization
// Clock source: System Clock
// Clock value: 8000.000 kHz
// Mode: Ph. correct PWM top=00FFh
// OC1A output: Non-Inv.
// OC1B output: Non-Inv.
// Noise Canceler: Off
// Input Capture on Falling Edge
TCCR1A=0xA1;
TCCR1B=0x01;
TCNT1H=0x00;
TCNT1L=0x00;
OCR1AH=0x00;
OCR1AL=0x00;
OCR1BH=0x00;
OCR1BL=0x00;
TCCR2=0x61;
ASSR=0x00;
TCNT2=0x00;
OCR2=0x00;
TCNT0=0xff;

// Timer/Counter 2 initialization
// Clock source: System Clock
// Clock value: 8000.000 kHz
// Mode: Phase correct PWM top=FFh
// OC2 output: Non-Inverted PWM
ASSR=0x00;
TCCR2=0x61;
TCNT2=0x00;
OCR2=0x00;

// External Interrupt(s) initialization


// INT0: Off
// INT1: Off
GICR|=0x00;
MCUCR=0x00;

// Timer(s)/Counter(s) Interrupt(s) initialization


TIMSK=0x00 | 0x01;

58
// 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)

59
{
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;
}

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;

60
}
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;
}
*/
}
/*
//free wheel the motor code
//Motor free wheel on pressure and current
else
{
PORTB=0x00;
OCR1B=0x00;
OCR1A=0x00;
OCR2=0x00;
PORTB=0x00;
}
*/
//pressure switch code
/*if((PIND.6==1)&&(PIND.7==1))
{
pressure=1;
}
if((PIND.6==1)&&(PIND.7==0))
{
pressure=0;
}
if((PIND.6==0)&&(PIND.7==1))
{
pressure=0;
}
if((PIND.6==0)&&(PIND.7==0))
{
pressure=0;

61
}*/

//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;
}*/
//current limit code limit to 19.5 amps
/*if(current>250)
{
Imax=1;
PORTD.5 = 1;
}
else
{
Imax=0;
PORTD.5 = 0;
}*/

};
}

62

Vous aimerez peut-être aussi