Thesis

Fazer download em pdf ou txt
Fazer download em pdf ou txt
Você está na página 1de 98

Design and prototyping of an inverter for Dahlander motors

Rúben André Soeiro Marques

Thesis to obtain the Master of Science Degree in

Engineering Physics

Supervisor: Prof. Horácio João Matos Fernandes

Examination Committee
Chairperson: Prof. Luís Filipe Moreira Mendes
Supervisor: Prof. Horácio João Matos Fernandes
Member of the Committee: Prof. Paulo José da Costa Branco

April 2016
ii
Acknowledgments

I would like to express my gratitude to Prof. Horácio Fernandes for guiding me through this work and
for all the networking between parties without whom this work would be impossible.
A genuine thanks to IPFN and its personnel for their support, availability and practical advice.
I want to thank Delta Sintra for the availability and enthusiasm with this project, to which they con-
tributed with the free rewinding of two induction motors into Dahlander configuration.
A cheerful thank you to the staff of DEEC’s Electrical Machines laboratory for the good mood, for all
the support with their equipment and for believing in my skills and allowing me to work with it without
supervision, which in turn greatly increased the speed at which I collected new data.
I would like to share my gratitude with Deltrain for the availability and support of their personnel and
for allowing us to use their prototype chassis in the field tests of the inverter.
A special word to Clara Barreto for the unconditional support, motivation and companionship during
this journey and to my parents Lino and Paula that always believed in me.

iii
iv
Resumo

Este trabalho foca-se no desenvolvimento de um acionamento elétrico eficiente de um motor de in-


dução trifásico em configuração Dahlander, no âmbito dos veículos elétricos. Este tipo de motor não
necessita de uma caixa de velocidades mecânica para alterar o regime de velocidades uma vez que o
número de pólos ativos pode ser mudado dependendo de como as ligações das fases são realizadas.
Foi projetado e construído um protótipo funcional para um accionamento elétrico deste tipo. O desen-
volvimento completo deste inversor permite um grau de controlo, personalização e expansibilidade que
não se encontra disponível numa solução comercial.
O desenvolvimento do hardware do inversor passou pelo desenho dos circuitos de controlo dos
transístores e de proteção, da comutação entre regimes de velocidade, do monitor do nível de bateria
e da sequência de alimentação do inversor. Foi programado um microcontrolador dsPIC30F4011 para
controlar o inversor e proporcionar um maior grau de personalização que dispensa reprogramação do
firmware.
Um aparato experimental foi desenhado para avaliar a eficiência elétrica do conjunto inversor-motor
sob várias velocidades e cargas, usando diferentes lookup tables que definem a temporização das
ativações dos transístores de potência. O motor foi também alimentado por um auto-transformador
para comparar a eficiência elétrica obtida com aquela do conjunto inversor-motor.
Este inversor foi capaz de travar regenerativamente ao impor um campo magnético mais lento em re-
lação ao rotor do motor, recarregando as baterias ao travar, o que é indispensável em veículos elétricos
eficientes.

Palavras-chave: motor de indução, configuração Dahlander, veículo elétrico, inversor eletró-


nico, travagem regenerativa.

v
vi
Abstract

This work is focused on the development of an efficient electric drive to power a three phase induc-
tion motor in Dahlander setting, to be used in electric vehicles. This kind of motor does not require a
mechanical gearbox to switch speeds because its number of active poles can be switched depending
on how the connections are made externally. A functional and low cost prototype was designed and
constructed for such electric drive. Having designed the inverter from scratch allows a degree of control,
customization and expansion that is not achievable with an off the shelf solution.
The development of the inverter’s hardware involved the design of the transistor control and protec-
tion circuits, the commutation between the two speed regimes, the battery monitor and the power-up
sequence. A dsPIC30F4011 microcontroller was programmed to control the inverter and provide a big-
ger degree of on-the-fly customization.
An experimental apparatus was designed to evaluate the electric efficiency of the inverter-motor
set under a number of speeds and loads, using different lookup tables that time the activation of the
power transistors. The motor is also powered with an auto-transformer to compare the obtained electric
efficiency with that of the inverter-motor set.
This inverter was capable of regenerative braking when imposing a slower moving magnetic field
in respect to the motor’s rotor, recharging the batteries when braking, which is paramount in efficient
electric vehicles.

Keywords: induction motor, Dahlander setting, electric vehicle, electronic inverter, regenerative
braking.

vii
viii
Contents

Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . iii
Resumo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . v
Abstract . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . vii
List of Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xi
List of Figures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xiii
Nomenclature . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Glossary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1

1 Introduction 1
1.1 Motivation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.2 State-of-the-art . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.3 Torque requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.4 Objectives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.5 Thesis layout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6

2 Induction motor 7
2.1 Validation of the rewinding process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
2.2 Experimental characterization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11

3 Design and construction of a three phase inverter 19


3.1 Choosing a semiconductor technology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
3.2 Transistor control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
3.2.1 Control of the lower transistors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
3.2.2 Control of the upper transistors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
3.3 Changing the number of active pole pairs . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
3.4 Battery level monitor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
3.5 Surge protection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31

4 Motor control 37
4.1 Field Oriented Control - Sensorless . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
4.2 Sensored speed control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
4.3 Firmware . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45

ix
4.4 Strategies of command and results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
4.4.1 8kHz asymmetric switching . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
4.4.2 4kHz symmetric switching . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
4.5 Regenerative braking . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54

5 Conclusions 59
5.1 Achievements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
5.2 Future Work . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61

Bibliography 63

A Inverter’s PCB 65

B Inverter’s complete schematic 67

C Bill of materials 71

D Source code 75

x
List of Tables

2.1 Relevant information in the motor nameplate . . . . . . . . . . . . . . . . . . . . . . . . . 7


2.2 Resistance and inductance values of the windings
of both motors in ∆ configuration of 2 active pole pairs . . . . . . . . . . . . . . . . . . . . 10
2.3 Resistance and inductance values of the windings
of both motors in YY configuration of 1 active pole pair . . . . . . . . . . . . . . . . . . . . 10
2.4 Motor in ∆ configuration - 2 active pole pairs - variable transformer . . . . . . . . . . . . . 13
2.5 Motor in YY configuration - 1 active pole pair - variable transformer . . . . . . . . . . . . . 13
2.6 Results obtained from the zero slip test . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
2.7 Results obtained from the blocked rotor test . . . . . . . . . . . . . . . . . . . . . . . . . . 17

3.1 Logical values for transistor activation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26

4.1 Interrupt timings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47


4.2 Performance tests of the inverter-motor set using a commutation frequency of 8 kHz and
a look up table with an inserted 50% dutycycle attenuation when 2 of the 3 top transistors
are on at the same time. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
4.3 Performance tests of the inverter-motor set using a commutation frequency of 8 kHz and
the original look up table corrected with the addition of a 3rd harmonic . . . . . . . . . . . 54
4.4 Performance tests of the inverter-motor set with 8kHz and 3rd harmonic correction . . . . 54

C.1 Bill of materials a) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71


C.2 Bill of materials b) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
C.3 Bill of materials c) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73

xi
xii
List of Figures

1.1 Typical induction electric machine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3


1.2 ∆/YY Dahlander configuration connections . . . . . . . . . . . . . . . . . . . . . . . . . . 4

2.1 Nameplate of the induction motor with the information of the original configuration . . . . 7
2.2 Winding diagram of a 2-4 poles Dahlander motor . . . . . . . . . . . . . . . . . . . . . . . 9
2.3 Induction motor used in this work without cover . . . . . . . . . . . . . . . . . . . . . . . . 9
2.4 Schematic for the characterization of the induction motor. The two intersecting circles with
an arrow on top represent a variable transformer. AM is the asynchronous machine, i.e.,
the induction motor, g is the armature of the DC machine and Labec is the excitation coil
of the DC machine. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
2.5 Experimental apparatus for the characterization of the induction motor . . . . . . . . . . . 12
2.6 Steinmetz equivalent circuit of the induction motor . . . . . . . . . . . . . . . . . . . . . . 14
2.7 Steinmetz equivalent circuit of the induction motor when powered with zero slip . . . . . . 14
2.8 Steinmetz equivalent circuit of the induction motor when powered with its rotor blocked . . 16

3.1 Simplified schematic of a three phase inverter. . . . . . . . . . . . . . . . . . . . . . . . . 19


3.2 Schematic of a MOSFET triple half bridge. . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
3.3 Schematic of the gate driver of one of the bottom transistors including two cd4050 gates. 21
3.4 Schematic used in the current simulation of two of the gates of the cd4050 being repre-
sented by source V1 and V2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
3.5 Current in one of the gates of the cd4050 over 2 periods of 4kHz switching (red) and its
average over time (blue), represented more clearly in Fig. 3.6 . . . . . . . . . . . . . . . . 22
3.6 The time average of the absolute value of current in one of the CD4050’s gates is pre-
sented in blue over 2 periods of 4kHz switching in a more adequate window for clarity.
The current from which this time average was taken is also shown in red at the same scale. 23
3.7 Schematic of the gate driver of one of the bottom transistors including two cd4050 gates
and one optocopler circuit. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
3.8 Schematic of the gate driver of one of the top transistors showing the pulse transformer
and the voltage doubler rectifier circuit. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
3.9 Simplified schematic of the logical nand gate and the logical not gates that drive the pulse
transformer in the gate driver of Fig. 3.8. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25

xiii
3.10 Schematic of paralleled CD4049 gates for higher current handling and durability driving
the pulse transformer of one top transistor’s gate driver. . . . . . . . . . . . . . . . . . . . 26

3.11 Schematic of the the top transistor’s gate driver circuit used in the simulation of MOSFET
gate charge and discharge. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27

3.12 Simulation: A commutation from ON to OFF state is represented in this figure without
the discharge transistor. VGS is constant until VP W M comes to rest at 0V, decreasing
afterwards. Current stays constant until VGS reaches ∼4V, decreasing afterwards as VGS
falls and the MOSFET turns off. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28

3.13 Simulation: A commutation from ON to OFF state is represented in this figure using the
discharge transistor. VGS is constant until VP W M comes to rest at 0V, decreasing after-
wards. Current stays constant until VGS reaches ∼4V, decreasing afterwards as VGS falls
and the MOSFET turns off. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28

3.14 Data obtained experimentally using the circuit of Fig. 3.8 (discharge transistor Q7 in-
cluded). MOSFET gate voltage VGS is acquired with CH1 and represented in yellow.
Voltage drop between Drain and Source, VDS , is acquired with CH2 and represented in
blue. using the discharge transistor. VDS increasing means the MOSFET is turning off . . 29

3.15 Two experiments are represented together in this figure. CH1, in yellow, still represents
the turn off curve VGS with the discharge transistor. On the other hand, the discharge
curve without the discharge transistor is represented in white, presenting a noticeable
delay in respect to the yellow curve. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29

3.16 Commutation of the connections to the motor to change the number of active poles of the
motor. UVW are the 3 phases of the inverter. Relays U$1, U$3, and U$5 connect UVW
to 1U-1V-1W or 2U-2V-2W; Relays U$2 and U$4 short circuit 1U-1V and 1V-1W respec-
tively. All the windings are powered with the unregulated voltage of the microcontroller
development board and "RELAYS" pin connects to an open collector pin of the ULN2803. 30

3.17 Schematic of a voltage level monitor for a 48V battery using an NE555 powered from the
full stack battery itself and isolated from the microcontroller using an optocoupler. . . . . . 31

3.18 Overshoot and ringing effects observed in the upper transistors’ VDS when switching. . . 32

3.19 Snubber network and FET . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33

3.20 Top transistor VDS when switching with the snubber circuit in parallel, showing an attenu-
ated overshoot peak voltage and faster dumping of the excess energy. . . . . . . . . . . . 34

3.21 LC filter at the power input pins of the CD4050 . . . . . . . . . . . . . . . . . . . . . . . . 34

3.22 Power supply surge protection schematic . . . . . . . . . . . . . . . . . . . . . . . . . . . 35

4.1 Sensorless FOC control diagram. Blocks: A Direct Clarke transform; B Direct Park trans-
form; C Estimates rotor speed and flux angle; D Flux weakening; E Inverse Park trans-
form; F Space Vector Modulation (SVM) or equivalent modulation technique. . . . . . . . 38

4.2 Motor currents represented in a three axis referential and vector summation result . . . . 38

xiv
4.3 Current vector resultant from the summation of the three current space vectors being
projected into the two new axis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
4.4 New reference frame rotated by the angle of the rotor flux and projection of the current
vector in its axis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
4.5 SVM hexagon representing the 6 states in which the inverter can be. . . . . . . . . . . . . 41
4.6 Relation between magnetic field and rotor speed in RPM . . . . . . . . . . . . . . . . . . 43
4.7 Relation between the percentage of maximum RMS voltage applied, the frequency of the
electric cycle and the synchronous speed. . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
4.8 Configured slopes for the V(f) relation represented with full lines and constant V/f ratio
with a dashed line. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
4.9 Representation of the setup of a start-up torque experiment. . . . . . . . . . . . . . . . . . 44
4.10 Representation of the percentage of the dutycycle stored in the look up table depending
on the electric cycle frequency and the position of the potentiometer. The 4 example sets
correspond to 25%, 50%, 75% and 100% of the dutycycle obtained with the position of
the potentiometer’s cursor after setting the electric cycle frequency, but the percentage is
continuous. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
4.11 No load experiment: MCPWM 1H switching at electric cycle frequency acquired using
CH3 in purple, 1L switching at 8 kHz using CH2 in blue, and phase current 1 using CH1
in yellow. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
4.12 No load experiment conducted at 8 kHz asymmetric switching with added tweak to the
look up table: MCPWM 1H, 2H, 3H acquired using CH2, CH3 and CH4 respectively and
phase current 1 using CH1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
4.13 MCPWM 1H and 1L, 2H and 2L, 3H and 3L and current in phase 1, with time marks for
text referencing. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
4.14 Experimental apparatus for the characterization of the inverter-motor set. . . . . . . . . . 51
4.15 Close-up of the electronic inverter. The microcontroller devolopment board is shown in
the right hand side and and inverter in the left hand side. The transistors are located in
the middle of the inverter board, screwed to a copper sheet with an added cooler with
fans. To the right hand side of the transistors are their drive circuits and the connections
to the microcontroller. To the left are the relays, current probe and connections to the motor. 51
4.16 Look up table graphical representation, resultant of wave correction with 3rd harmonic,
minimizing DC current standard deviation. Positive values indicate dutycycle of top tran-
sistors, negative values indicate negative values of bottom transistors. . . . . . . . . . . . 53
4.17 CH2, in blue, represents the current on one phase after correction with the 3rd harmonic,
while CH1 represents the VGS of the corresponding top transistor of the branch to which
that phase is connected. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
4.18 CH2, in blue, represents the current on one phase with symmetric 4kHz switching, while
CH1 represents the VGS of the corresponding top transistor of the branch to which that
phase is connected. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54

xv
4.19 Regenerative braking test undergone at a rotor speed of 1540 RPM, -180 RPM slip, with
4 kHz symmetric switching. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
4.20 Regenerative braking test undergone at a rotor speed of 1380 RPM, -180 RPM slip, with
4 kHz symmetric switching. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
4.21 Three phase current waveforms of the induction machine working as a motor represented
in yellow, blue and purple and DC current in green using FOC. . . . . . . . . . . . . . . . 56
4.22 Three phase current waveforms of the induction machine working as a generator repre-
sented in yellow, blue and purple and inversion of the DC current in green using FOC. . . 57

5.1 Efficiency of the motor when using the auto-transformer and the inverter with different look
up tables. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60

A.1 PCB of the inverter described in this work. Modifications to the circuit are not included,
only one board was assembled and this is the PCB of the original. . . . . . . . . . . . . . 65

B.1 Connections between microcontroller and inverter board are represented in the top left
hand corner with the direct connections to the encoder in the right. The NAND array and
level shifter are represented in the bottom. . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
B.2 The three gate drivers for the transistors in the top half of the inverter’s bridge, with the
power connections of each cd4049 in the top. . . . . . . . . . . . . . . . . . . . . . . . . . 68
B.3 Array of gate drivers for the transistors in the bottom half of the inverter’s bridge and
current probe. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
B.4 555 timer circuit for voltage level measurement represented in the top, relay array for
dahlander switching in the bottom left and terminal connections to the motor in the bottom
right. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70

xvi
Chapter 1

Introduction

1.1 Motivation

The most challenging requirement that electric vehicles have still to meet is a reasonable range, the
majority of them being able to cover less than 150 km on one charge. Hybrid vehicles (fuel+electric)
and electrified railways are obvious exceptions. The reason behind this challenge is the lower energy
density of batteries when compared with fossil fuels. However, unlike a fuel powered vehicle, an electric
vehicle can restore its kinetic energy back into its batteries by regenerative braking and recharge them
anywhere using solar panels.
Technologies such as energy storage, solar panels and lightweight structures depend on break-
throughs in the areas of chemistry, materials and industry, which will not be targeted in this work. This
means that the effort must be focused in the powertrain, as the process of its development are still within
the reach of a master thesis.
This dissertation is thus centred in the development of a power inverter for a pole switching (Dahlander)
induction motor that is meant to be used in a fully electric solar train for tourists interested in sight seeing.
This train can be used to explore new markets as environmental laws start to prohibit diesel vehicles
in certain places. The lower speeds and greater weight and volume tolerances in this kind of vehicle
also represent an advantage, as the friction forces with the atmosphere are smaller and the mass and
volume of batteries can increase favouring autonomy.
The prototype of the power converter documented in this thesis has the particularity of being capable
of switching the number of active pole pairs of the induction motor using two speed motor regimes as a
gearbox, but without the added complexity and ageing susceptibility of switchable mechanical gears.

1.2 State-of-the-art

The inverter documented in this work is designed mainly with electric vehicles in mind, so the state
of the art is presented taking this into account. Many types of motors can be chosen and are indeed
used in different electric vehicles.

1
The DC motor is the easiest to control. A DC voltage is applied to the armature windings and more
voltage means more torque. They are known for their ability to achieve high torque at low speeds,
having already been used in electric vehicles. However they have a bulky construction, low efficiency
and reliability [1] and need regular maintenance due to the presence of brushes that eventually have
to be replaced, but not before thousands of hours in working condition if properly set [2]. Furthermore,
the commutator that interfaces with them has to be cleaned periodically to avoid accumulation of debris
between contacts which may damage the motor by flashover [2], a short circuit between brushes over a
conducting arc in the surface of the commutator.

Some DC electric motors create a constant magnetic field using permanent magnets on the stator
and windings on the rotor interfaced with brushes. If the magnets are placed in the surface of the rotor
and the windings in the stator, brushes become unnecessary because the rotor is not wound. Once an
alternating current passes through the stator windings, a rotating magnetic field is created, forcing the
magnets on the rotor to align with this field, turning the shaft. This is a more reliable and robust motor
as it does not need brushes. However, since the rotor is not wound, the rotor excitation is fixed by the
magnets’ magnetic field and power has to be finely controlled in the stator.

The majority of neodymium veins on the planet are located on China that manufacturers about 80%
of the world’s magnets [3], which makes it difficult for a competitive market to exist and get lower prices.
A cheaper alternative consists on a variable frequency current excitation in the stator and a fine control
of the DC current in a wound rotor, but this way the advantage of low maintenance and high reliability
is lost with the return to brushed motor technology. Synchronous PM motors are others that offer the
advantage of easy regenerative braking, as the rotor has its magnetic field configuration independent of
that created with the stator windings. This may be one of the main reasons to why PMSMs are the most
used in EV industry; a master thesis [4] listed EVs produced in 2015 and counted 15 among 22 that
use PMSMs for their traction. These motors still have disadvantages, namely, the magnetic flux density
produced by the magnets is fixed and lower than a wound rotor of the same size and the magnets are
susceptible to demagnetization due to high temperatures and high magnetic field produces by the motor
coils.

The squirrel-cage induction motor is the most simple electric machine, as it does not need either
magnets or brushes, which leads to a longer operating life. Its stator is interchangeable with the previous
kind of motor, the difference being in the rotor. Its rotor is composed of a series of bars longitudinal to
its surface, all connected to each other at the end.

An alternating current passes in the stator windings, generating a rotating magnetic field, analogous
to that of synchronous machines. The changing magnetic flux inside the motor passes through the
rotor bars, which in turn conduct inducted currents. A current inside a magnetic field results in a force
executed in the conductor, named Laplace force and is quantified as:


− →
− → −
F =I l ×B (1.1)



Where I is the current in the conductor, l is a vector which has the direction of current and magni-

2
Figure 1.1: Typical induction electric machine



tude of the length of the conductor and B is the magnetic field vector. The combined action of the forces
on the rotor bars result in torque that makes the shaft rotate.
For greater efficiency, the magnetic field created in the coils should have values within the linear
characteristic of the B-H curve of the nucleus material, if not, there will be losses due to magnetic satu-
ration of the material [5]. Assuming a sinusoidal excitation, the voltage dependent of time is described
as

u(t) = U cos ωt (1.2)

that relates with magnetic flux φ by


u(t) = N (1.3)
dt

where N is the number of windings that generate the flux. Joining these two last equations, integrat-
ing in time and solving in order of the flux:

U
φ(t) = sin ωt (1.4)

The magnetic field is just the flux by unit of area S so:

φ U
B= = sin ωt = Bmax sin ωt (1.5)
S SN ω

Which means

U V
Bmax ∝ ≡ . (1.6)
ω f

The maximum value of the magnetic field is proportional to the voltage between coil terminals V
and inversely proportional to the frequency of the excitation f . When the induction machine is running

3
as a motor, the speed of the shaft is always smaller than the speed of the rotating magnetic field.
Furthermore, the maximum voltage that can be applied to the coils is the DC battery voltage. f is
gradually increased until the maximum V is achieved, after that point, increasing f will result in lower
magnetic field and consequently torque.
In 1897, Robert Dahlander invented a pole changing motor, that had two speeds for the same fre-
quency of excitation, depending on how the motor was connected [6]. This invention came 50 years
before the transistor but can now be used to solve the previous problem. The number of pole pairs p of a
motor relates with synchronous speed NRP M (the speed of the rotating magnetic field) and rotor speed
by the following equation:

60 × f
NRP M = (1.7)
p

Figure 1.2: ∆/YY Dahlander configuration connections

Using an array of relays or a contactor, the connections to the motor can be rearranged while it is
running (see Fig. 1.2) and the operating speed can be extended beyond that allowed by a single number
of active pole pairs configuration. The Dahlander setting presents yet another advantage for the project
due to a 60% torque increase in demanding scenarios, creating a non-mechanical electrical gearbox of
two speeds, lowering weight and removing another mechanical part subject to friction and consequent
ageing. It is important to note that despite the age of this technology and its advantages it is surprising
that no reference was found of its use in electric cars. This kind of motor winding is typically found in
industrial three-phase powered circuits such as cranes (higher speed for transport and lower speed for
precision placement), fans (to choose their speed and consequently flux) and drilling machines (lower
speed for larger drill bits and higher speed for smaller drill bits).
Every motor that requires an alternating current to work needs an additional component when used
in a battery powered vehicle. An electronic inverter provides the pulsed voltage modulation for a pseudo

4
sinusoidal current waveform. The power train cost is increased but the inverter allows a fine control of
frequency and current magnitude, resulting in an efficient control of speed and torque. The technologies
behind electronic inverters are not particularly new, however the companies that design and build them
protect their technology and it is difficult to find documentation on how to properly build one.

1.3 Torque requirements

In a touristic train, the starting torque should be enough to propel the train in a 15% uphill slope.
For a 10 metric ton vehicle, the required force to match the train weight in a 15% uphill slope is:

F = Fg sin (arctan (0.15)) = mg sin (arctan (0.15)) = 10000 × 9.8 × 0.148 = 14.5kN (1.8)

A forward acceleration of 0.5ms2 would require an additional force of

F = ma = 10000 × 0.5 = 5kN. (1.9)

The total force would then be ∼20kN.


If the wheels measure 40cm in diameter, the required torque is

0.40
T = F d = 20000 = 4000N m. (1.10)
2

If 2 motors are considered to drive the train and a 1:20 reduction gearbox is used inline with each of
them, the torque that each motor has to develop from standstill is T = 2000/20 = 100Nm.

1.4 Objectives

The objectives of this work are listed below in the order that they have to be accomplished:
•The characterization of the induction motor using an auto-transformer, therefore with a fixed fre-
quency of 50Hz and varying load. The set of experiments will be done with 1 and 2 active pole pairs.
•Choose the power switching devices (transistors, thyristors, relays, etc) that are more adequate to
the demands of the application.
•Design and validate a set of circuits that activate the switching devices.
•Design and validate a voltage sensing circuit to evaluate the state of the battery.
•Design and build a PCB that includes all the needed components for the working inverter.
•Elaborate a control scheme for the inverter-motor set that is capable of switching the number of
active poles of the motor and to execute regenerative braking.
•Program the firmware of the microcontroller to reflect the control scheme chosen.
•Characterize the inverter at different speeds and loads, measure its efficiency and iterate along the
way to increase its performance regarding efficiency and safety (robustness of the board and code).

5
1.5 Thesis layout

This thesis is organized as follows:


•In Chapter 2 the importance of the rewinding of the original motors into a Dahlander setting of lower
voltage is discussed and the motors are evaluated experimentally after being rewound.
•In Chapter 3 the design steps of the inverter’s hardware are described in detail, presenting the
choices that had to be made and the problems that had to be overcome.
•In Chapter 4 different motor control strategies are explained and implemented in the inverter’s
firmware and the efficiency of each strategy is evaluated.
•In Chapter 5 a conclusion to this thesis is drawn, describing all the achievements and pointing out
suggestions for future work.

6
Chapter 2

Induction motor

Two identical induction motors with 2 pole pairs in ∆/Y connection were rewound into a Dahlander
configuration of 2-1 pole pairs to be used in the experimentation of the inverter. One of the nameplates
is depicted in Fig. 2.1, showing the original informations of the motors.

Figure 2.1: Nameplate of the induction motor with the information of the original configuration

The most relevant fields of the nameplate are collected in the form of Table 2.1 for clearer display.

Table 2.1: Relevant information in the motor nameplate

Nr. of phases 3
Setting ∆/Y
Voltage 220/380 V
Current 4.7/2.7 A
cos φ 0.8
Power 1.1kW
Frequency 50Hz
Speed 1430 RPM
Design B

The first thing to have in mind is that 220Vrms is too high to provide safely with a battery to an
electronic inverter under development in a test bench. Furthermore, in an electric vehicle that carries
passengers it is best to keep voltages low unless all safety measures are taken to avoid electrocution
of the occupants or explosion of the battery in accidents. Since the motors have to be rewound into
Dahlander setting anyway, a change in the voltage rating can be applied at the same time. The number

7
of turns of each winding are reduced and the cross section of the wires increased for bigger currents, in
a way that keeps the amplitude of the magnetic field constant.
Approximating each winding to a long solenoid, the magnetic field B they create when a current I
passes through the wires is:

B = µnI (2.1)

where µ is the medium magnetic permeability and n is the number of turns of the solenoid. Since
n is reduced and I is increased in the same proportion, B stays the same. For the same power rating,
voltage is reduced in the same proportion as the increase in current. In other words, if the number of
turns of each winding is reduced to 1/4th of the original, the voltage rating of the motor becomes 1/4th
of the original, 55V, which is acceptable.
The open motor revealed that it had 36 slots and 2 sets of windings in each slot, each winding made
of 28 turns with a wire cross section of 0.63mm2 . For the reduction to 55V, each winding has to have a
new configuration of 7 turns and a wire cross section of 2.52mm2 . A wire this thick is hard to settle in
the slots, so the same cross section was used, 0.63mm2 and each of the 7 turns is in fact a parallel of 4
wires with this cross section.

2.1 Validation of the rewinding process

The rewinding of the two motors was done offsite in a portuguese rewinding company following
these guidelines of 7 turns per winding with a wire cross section of 2.52mm2 and a winding diagram of
a Dahlander setting of 1-2 pole pairs that is depicted in Fig. 2.2.
This diagram shows the 36 slots of the stator, each of them housing 2 sets of windings. The slots
are numbered from 1 to 36, each top-most winding in its slot steps 9 slots further in the stator and rests
as the bottom-most winding in that slot. From that position the winding returns 7 slots back into the top
position of that slot and continues cyclically. The windings can also be seen in groups of 6, connected
to one of the terminals of the motor in the lowest slot number of the winding group located in the top slot
positions and connected to the other terminal in the highest slot number of the winding group located in
the bottom slot positions.
The configuration of 1 active pole pair can be achieved connecting terminals UVW to three phase
power and short-circuiting terminals XYZ. The configuration of 2 active pole pairs is achieved connecting
terminals XYZ to three phase power with UVW left open.
One of the motors is shown with its cover off in Fig. 2.3 after being rewound.
To validate the rewinding process, the resistance and inductance of the windings of the motors were
measured in ∆ and YY configurations. Resistance was calculated from the measurement of voltage and
current applied on two motor terminals using a DC power supply, making use of Ohm’s law. Inductance
was measured using an inductance meter that applies a 1V 1kHz sinusoidal wave between terminals
and calculates inductance automatically. The results are represented in Tables 2.2 and 2.3 for both

8
Figure 2.2: Winding diagram of a 2-4 poles Dahlander motor

Figure 2.3: Induction motor used in this work without cover

motors. 1U-1V-1W and 2U-2V-2W are the points represented in Fig. 1.2.

Notice that the inductance values are only indications of the order of magnitude. Few conclusions,
if any, can be taken from measuring inductances in a complex geometry setup as a motor stator, since

9
the magnetic field created by one winding is interfering with that of other windings being measured
simultaneously in series and in other locations and orientations in the stator.

Table 2.2: Resistance and inductance values of the windings


of both motors in ∆ configuration of 2 active pole pairs

Motor A Motor B
∆ R(Ω) L(µH) R(Ω) L(µH)
1U-1V 0.44 887 0.26 1360
1U-1W 0.45 882 0.27 1400
1V-1W 0.43 911 0.27 1470
2U-2V 0.45 580 0.27 1340
2U-2W 0.44 592 0.26 1150
2V-2W 0.44 590 0.27 1270
1U-2U 0.32 462 0.17 1450
1U-2V 0.47 473 0.18 656
1U-2W 0.31 910 0.30 813
1V-2U 0.49 476 0.17 821
1V-2V 0.31 931 0.30 821
1V-2W 0.31 496 0.17 1380
1W-2U 0.32 915 0.31 650
1W-2V 0.31 459 0.18 1500
1W-2W 0.47 467 0.18 720

Table 2.3: Resistance and inductance values of the windings


of both motors in YY configuration of 1 active pole pair

Motor A Motor B
YY R(Ω) L(µH) R(Ω) L(µH)
2U-YY 0.23 249 0.10 386
2V-YY 0.22 250 0.11 390
2W-YY 0.22 247 0.10 411
2U-2V 0.36 335 0.21 851
2U-2W 0.36 339 0.20 886
2V-2W 0.35 342 0.20 922

As expected, in ∆ configuration the resistance and inductance are very similar between any pair of
phases (lines 1,2,3 of Table 2.2) and between the middle points of the triangle (lines 4,5,6 of Table 2.2)
for both motors. From Fig. 1.2, lines 1 to 6 of Table 2.2 correspond to the resistance of 2 series windings
in parallel with another 4 series windings. Assuming the 6 windings all have the same resistance value,
the measured resistance R2||4 depends on the individual winding resistance R by Eq. 2.2.

2R × 4R 4
R2||4 = = R (2.2)
2R + 4R 3

Which means that for motor A R is 0.33Ω while for motor B R is 0.2Ω.

Lines 7 to 15 of Table 2.2 correspond either to a parallel of 1 winding with 5 series windings or a
parallel of 3 series windings with another 3 series windings. The equations for the expected resistance
values are obtained through Eqs. 2.3 and 2.4.

10
1R × 5R 5
R1||5 = = R (2.3)
1R + 5R 6

3R × 3R 3
R3||3 = = R (2.4)
3R + 3R 2

Meaning that the expected resistance values for lines 7 to 15 of motor A are R1||5 =0.275Ω and
R3||3 =0.495Ω. For motor B expected resistance values are R1||5 =0.167Ω and R3||3 =0.300Ω. While
motor B seems to deviate only 10 mΩ from the expected values, motor A is off by as much as 40 mΩ in
some measurements.
Lines 1,2,3 of Table 2.2 show the measurements taken from phase to YY, meaning two windings are
put in parallel and the expected resistance of the set is just R/2 =0.165Ω for motor A and R/2 =0.1Ω for
motor B. Lines 4,5,6 are the series of two of these sets, meaning their resistance value is doubled from
that of lines 1,2,3. From the results of this last analysis, the resistance values of motor A do not match
the expected values. Motor B on the other hand performs perfectly in these perliminary tests.
Motor A did not pass the validation tests and was discarded. Motor B was used in the rest of this
work.

2.2 Experimental characterization

It is important to do some measurements of the motor when it is powered by a sinusoidal voltage


to be able to compare and evaluate the quality of the electronic inverter. The experimental apparatus
consists of induction motor, three phase variable transformer, DC machine, variable DC power source
and power resistors, as represented in Fig. 2.4. The actual experimental aparatus is depicted in Fig. 2.5.

Figure 2.4: Schematic for the characterization of the induction motor. The two intersecting circles with
an arrow on top represent a variable transformer. AM is the asynchronous machine, i.e., the induction
motor, g is the armature of the DC machine and Labec is the excitation coil of the DC machine.

Using the three phase variable transformer connected to mains at 50Hz 380V, one can lower the
voltage at the motor phases to a chosen voltage value while maintaining the frequency. These tests are
undergone in both ∆ and YY configuration at the same voltage value, as the Dahlander configuration
was designed to be powered by the same power source independently of the number of active pole
pairs. The variable transformer that could source the most current available in the lab had a current limit
of 30A, and the experiment pushed beyond this limit in a couple tests using an inter-phase voltage of

11
Figure 2.5: Experimental apparatus for the characterization of the induction motor

48V.

The DC power source powers up the excitation field of the DC machine. The shaft of the induction
motor is connected to that of the DC machine and when it rotates, an electromotive force is created at
the terminals of the DC machine’s armature. If a resistor is connected between such terminals, current
can flow, and power can be dissipated.

The efficiency of the set is obtained from the active power consumed by the induction motor and from
the power being dissipated on the resistor load.

The active power in ∆ and YY is calculated from Eq. 2.5.


Pelec = 3VRM S IRM S cos φ (2.5)

V being the inter-phase voltage and cos φ being 0.8 for this motor, as the nameplate informs (see
Fig. 2.1).

The power dissipated in the resistor is obtained simply from Eq. 2.6.

Pload = V I (2.6)

The efficiency is just the ratio between the last two as shown by Eq. 2.7.

Pload
η= (2.7)
Pelec

Efficiency of the set accounts for losses in the induction motor and the generator. Assuming con-
servatively that the efficiency of the DC generator is approximately 80%, one can obtain a more exact

12
efficiency of the induction motor.

η = ηACmot × ηDCgen
1 Pload
ηACmot = (2.8)
0.80 Pelec

Finally, one can relate the efficiency of the motor with the slip to find the optimal operating conditions.
Two data sets were obtained for ∆ and YY configuration. The results are represented in Tables 2.4
and 2.5. To clarify, V is the inter-phase voltage and I is the current in one phase.

Table 2.4: Motor in ∆ configuration - 2 active pole pairs - variable transformer

N(RPM) s(RPM) V(V) I(A) Vload (V) Iload (A) Pelec (W) Pload (W) η(%)
1488 12 48.0 9.5 57.8 0.9 631.9 52.0 10.3%
1483 17 48.0 9.5 56.0 1.7 631.9 95.2 18.8%
1473 27 48.2 9.5 52.0 3.0 634.5 156.0 30.7%
1463 37 48.0 9.8 50.0 4.3 651.8 215.0 41.2%
1454 46 48.0 10.5 47.0 5.5 698.4 258.5 46.3%
1444 56 47.6 11.0 44.0 6.5 725.5 286.0 49.3%
1435 65 47.4 11.6 42.0 7.3 761.9 306.6 50.3%

Table 2.5: Motor in YY configuration - 1 active pole pair - variable transformer

N(RPM) s(RPM) V(V) I(A) Vload (V) Iload (A) Pelec (W) Pload (W) η(%)
2951 49 47.6 10.9 119.0 1.8 718.9 208.3 36.2%
2925 75 47.6 13.1 114.0 3.4 864.0 381.9 55.2%
2887 113 47.6 15.3 111.0 4.8 1009.1 536.1 66.4%
2841 159 47.6 17.6 106.0 6.2 1160.8 654.0 70.4%
2813 187 47.6 19.7 102.0 7.3 1299.3 740.5 71.2%
2745 255 46.6 23.7 97.5 8.6 1530.3 833.6 68.1%
2691 309 49.3 26.4 90.0 10.0 1803.4 900.0 62.4%
2586 414 48.5 31.0 80.0 11.3 2083.3 904.0 54.2%
2453 547 47.7 35.7 70.0 12.0 2359.6 840.0 44.5%

There is a clear increase in power dissipation from Table 2.4 to Table 2.5. At higher speeds the
voltage at the armature terminals of the DC generator is higher and so is power for the same resistance.
To increase power dissipation at the same speed and voltage, one has to lower the resistance adding
more resistors in parallel. At the time of the experiment there were no more resistors available, so the
motor nominal speed of 1430 RPM and 1.1kW power were not achieved in the ∆ configuration. Still,
it can be seen that as slip and power increases, so does the efficiency. In Table 2.5 though, there is a
calculated efficiency maximum of 71.2% when slip is 187RPM, or 3.1Hz. This will be a good indicator of
the reference slip that the power inverter has to maintain to save energy.
A final examination can be executed to extract the induction motor parameters for the construction
of the Steinmetz equivalent circuit depicted in Fig. 2.6. These are useful to establish relations between
voltage, current, power factor and torque and for advanced control techniques like vector control. Two
tests are executed in a setup very similar to the previous one, with 2 active pole pairs.
One of the tests consists in powering the induction motor with close to nominal phase voltage or as

13
Figure 2.6: Steinmetz equivalent circuit of the induction motor

high as the auto-transformer can go without surpassing its current limit, forcing the synchronous speed
with the DC motor. Therefore, the slip is zero and the right hand side of Fig. 2.6 equivalent circuit
becomes a high impedance, simplifying into the one in Fig. 2.7.

Figure 2.7: Steinmetz equivalent circuit of the induction motor when powered with zero slip

This makes it very easy to calculate the equivalent core resistance Rc and reactance Xm , assum-
ing that these last two are much greater than the resistance of the stator coils R1 and stator leakage
reactance X1 . In this case, there is approximately no voltage drop over R1 and X1 . Considering the
power factor cos φ and the input current in one phase IS , in this case equal to I0 , one can extrapolate
the current that passes in the core resistance Iw and in the core reactance Im . Regardless of whether
the motor is connected in ∆ or in YY configuration, the phase current IS is the phase current of the
transformer and the phase voltage V is the phase to neutral voltage of the transformer.

I0 = IRM S (2.9)

Iw = I0 cos φ (2.10)

14
Im = I0 sin φ (2.11)

To obtain cos φ, one has to use the relation between active and apparent power using Eq. 2.12.

Pactive = Papp cos φ (2.12)

Papp (t) = V (t)I(t) (2.13)

But Pactive is also the time average of Papp over an arbitrary number of periods, so finally:

Pactive =< Papp >t (2.14)

Pactive
cos φ = (2.15)
Papp

Using the assumption of zero voltage drop in R1 and X1 :

V
Rc = (2.16)
Iw

V
Xm = (2.17)
Im

Xm
Lm = (2.18)
2πf

This test yields the results summarized in Table 2.6.

Table 2.6: Results obtained from the zero slip test

VRM S 20.67 V
IRM S 12.75 A
Papp 263.58 VA
< Papp >t 24.36 W
cos φ 0.09241
φ 84.698o
I0 12.75 A
Iw 1.18 A
Im 12.70 A
Rc 17.54 Ω
Xm 1.63 Ω
Lm 5.18 mH

The other test consists in blocking the rotor by hand and applying a sinusoidal voltage between
phases using the auto-transformer, in a way that the current does not exceed the nominal value because
a blocked rotor does not have the cooling capabilities of a rotating one. Again, this test was limited at
the current limitation of the auto-transformer.

15
Since the slip is one, the total rotor resistance seen by the stator R20 is much lower. This leads to
Rc and Xm becoming the largest quantities involved by at least a factor of 10 meaning they can be
seen approximately as open circuits. This transforms the equivalent circuit of Fig. 2.6 into the equivalent
circuit of Fig. 2.8.

Figure 2.8: Steinmetz equivalent circuit of the induction motor when powered with its rotor blocked

As previously, using Eqs. 2.12-2.15 one can calculate the power factor cos φ. The relation between
R = R1 + R20 and XL = X1 + X20 can be calculated from the phase angle φ using Eq. 2.19.

XL
tan φ = (2.19)
R

The magnitude of the complex impedance Z = R + XL is represented in Eq. 2.20.

VRM S
q
|Z| = R2 + XL2 = (2.20)
IRM S

Combining Eqs. 2.19 and 2.20 and using trigonometry, R and XL can be determined.

R = Z cos φ (2.21)

XL = Z sin φ (2.22)

R1 represents the resistance of the stator windings of one phase. This was in part already measured
in Tables 2.3 and 2.3. R1 is simply the measured resistance value between the phases of motor B in ∆
configuration.
R20 is calculated from the difference of the estimated R value and R1 :

R20 = R − R1 (2.23)

With XL determined, X1 and X20 can be obtained using the standard relation between stator and
rotor inductances in design B motors [7]:

16
X1
= 0.67 (2.24)
X20

This test yields the results summarized in Table 2.7.

Table 2.7: Results obtained from the blocked rotor test

VRM S 5.42 V
IRM S 14.45 A
Papp 78.37 VA
< Papp >t 56.26 W
cos φ 0.71786
φ 44.122o
tan φ 0.96982
Z 0.375 Ω
R 0.269 Ω
XL 0.261 Ω
R1 0.267 Ω
R20 0.003 Ω
X1 0.105 Ω
L1 0.33 mH
X20 0.156 Ω
L02 0.49 mH

17
18
Chapter 3

Design and construction of a three


phase inverter

An AC induction motor requires an AC current flowing in the stator windings to create a rotating
magnetic field inside, but in an electric vehicle the only practical way to store energy is in a battery which
has DC voltage. Therefore, a three phase electronic inverter is needed to generate such AC current
on each phase of the motor. The main part of the inverter is a triple half bridge composed of power
semiconductors, controlled to rapidly switch voltage on each phase, thus letting current flow in and out
of that phase. These semiconductor components can be thyristors, BJT, MOSFET or IGBT, depending
on the voltage input, current and type of control. A simplified schematic of the inverter is shown in
Fig. 3.1

Figure 3.1: Simplified schematic of a three phase inverter.

3.1 Choosing a semiconductor technology

Thyristors are mainly used in soft starter applications [8], where an increasing fraction of the three
phase power is allowed into the motor over the time it takes to reach nominal speed. The synchronous
speed cannot be controlled using this scheme, as it is dictated by the frequency of the three phase

19
power.
BJT are mainly used in lower voltage applications mostly to control DC motors. The most common
setup is a full H-bridge employing a pair of PNP BJT in the top half of the bridge and a pair of NPN BJT
in the bottom half. It is intrinsic to this technology that a small current has to be flowing into or out of the
base of these transistors for them to be active, which increases the complexity of the protection circuits.
In contrast, MOSFET and IGBT need only to be "charged" and "discharged" once per switching period,
which makes them more efficient and safer in higher power applications.
International Rectifier released a document about the choices between IGBT and MOSFET technolo-
gies [9]. MOSFET are prefered in applications of lower power (<500W) and voltage (<200V) and higher
frequency switching (>200kHz). IGBT are preferred in higher power (>5kW) and voltage (>1000V) and
lower frequency switching (<20kHz). This inverter is designed to be able to drive a 5kW three phase
motor with a voltage of 100V. As a proof of concept though, the motor that was used was the 1.1kW one
previously characterized and was powered with a 48V stack of four 12V batteries and a 4kHz switch-
ing frequency. The power requirements and voltage used in the proof of concept fall into the realm of
application of MOSFET, though switching frequency suggests IGBT.
Mouser Electronics also gives some insight into this dilemma [10]. MOSFET has a voltage drop
between Drain and Source that comes from the resistance between those terminals when the transistor
is on, which can be in the order of tens of milliohms. While small, this resistance can be an issue when
switching high currents, and the transistor will certainly heat up. With an increased temperature, this
resistance will rise, and so will the voltage drop and the power that is dissipated in the transistor. IGBT
on the other hand, have a diode-like voltage drop, that increases with the log of current and is relatively
independent of temperature. Both references [9][10] identify MOSFET as having a greater tolerance to
current and voltage combinations (referred to as safe operating area or SOA) in relation to IGBT for the
same packaging type.
It seems that as power requirements and voltage increases IGBT become more addequate as long
as the switching frequency stays low, which is the case of this inverter, but a final decision cannot be
made without actually testing the efficiencies of both technologies in this application. For the proof of
concept MOSFET were used, specifically the FDA75N28 [11], only because the laboratory already had
them in stock and they satisfied the requirements.

3.2 Transistor control

Beyond the timing of the activation of each phase there is the concern of transistor control and even
another layer of safety when switching the high currents.
The triple half bridge is represented with MOSFET’s in Fig. 3.2.
These particular transistors have a Gate threshold voltage of 3-5V and a maximum Gate-Source
voltage of ±30V, so any voltage between these values will turn them on. A voltage value of 5V is
accessible from one of the I/O pins, but higher values lead to faster gate charge. Furthermore, in
catastrophic transistor failure, a direct connection between the transistor and the microcontroller will

20
Figure 3.2: Schematic of a MOSFET triple half bridge.

most assuredly damage the I/O pin. A voltage value of 12V, on the other hand, is available from one of
the 12V batteries that are going to be used to power the vehicle and is comfortably in the middle of the
acceptable values. Some electronics will have to be used to switch this voltage though.

3.2.1 Control of the lower transistors

Q2, Q4 and Q6 have their Sources on the same net and the control is simpler, as the same voltage
referential can be used for the three transistors when applying voltage between Gate and Source. To
accomplish this, a CD4050 hex non-inverting buffer was used [12].
The nominal current output of this IC is rated at ∼10mA per gate when powered up with 12V. With
6 gates available, 2 can be assigned to each of these three transistors as in Fig. 3.3, which gives a
combined nominal output of ∼20mA. When parallelizing two gates, one resistor in series with each one
is preferred instead of only one with the double of the resistance value. This prevents momentary short
circuits between two parallel gates that have a marginally different turn on and off times.

Figure 3.3: Schematic of the gate driver of one of the bottom transistors including two cd4050 gates.

The gate of a MOSFET has a capacitor-like behavior, thus, the current that the gates of the IC have
to supply will be higher at the start of each commutation. To limit the inrush current into and from the
gate of the MOSFET, a resistor is used in each buffer gate. The value of this resistor is determined for
the worst case, the commutation, when VGS is 0 and VOU T is 12V. To limit the current to a 60mA peak
for each gate, one has to simply solve Ohm’s Law, Eq. 3.1.

V 12
R= = = 200Ω (3.1)
I 0.06

21
A 22kΩ resistor is put in parallel with the transistor’s gate to ensure its discharge even if the gates of
the IC become a high impedance in case of catastrophic failure.
A simulation is done in OrCAD PSpice 9.2 to confirm the possibility of using two 200Ω resistors as
shown in Fig. 3.4, without damaging the IC, by taking the time average of the absolute current output of
source V1 in Fig. 3.5. The capacitance value is obtained by reading the "input capacitance" value of the
MOSFET datasheet [11] which is approximately equal to the gate capacitance.

Figure 3.4: Schematic used in the current simulation of two of the gates of the cd4050 being
represented by source V1 and V2

Figure 3.5: Current in one of the gates of the cd4050 over 2 periods of 4kHz switching (red) and its
average over time (blue), represented more clearly in Fig. 3.6

The highest value of current in the simulation is as calculated before ∼60mA, rapidly decreasing to a
negligible value as the input capacitance of the MOSFET finishes charging and the voltage drop across

22
R1 and R2 becomes smaller.

Fig. 3.6 shows the same data as Fig. 3.5 but in a more adequate window for a clearer representation
of the time average, confirming that these resistors can be used for limiting the peak current without
putting too much strain in the gates, since the time average gives a result of 0.4mA, much lower than
the nominal value of 10mA.

Figure 3.6: The time average of the absolute value of current in one of the CD4050’s gates is presented
in blue over 2 periods of 4kHz switching in a more adequate window for clarity. The current from which
this time average was taken is also shown in red at the same scale.

Another conditioning factor is power dissipation in the IC, which is 700mW for the Plastic Dual In-
line Package (PDIP) [12] and limits the switching frequency. To evaluate this limit, the MOSFET gate
is once more modeled like a 5nF capacitor that is charged and discharged once per period. At each
commutation, some energy is used to charge the gate and some is dissipated in the IC. The switching
frequency is limited by the energy lost in each commutation, how frequent is the commutation and how
much power the IC can dissipate.

The energy transit in the charge of a capacitor is as follows:

Z Z Z
dQ
Echarge = P dt = V i(t)dt = V dt = V Q = V V C = V 2 C (3.2)
dt

The energy stored inside a capacitor is:

1 2
Estored = V C (3.3)
2

The rest is dissipated in the IC as:

23
1 2
Ediss = Echarge − Estored = V C (3.4)
2

Multiplying this energy by the transit frequency one can get the power dissipated inside the IC. The
frequency of excitation has to be multiplied by 2 when calculating the power dissipation because the IC
dissipates when charging and discharging the MOSFET.

P = 2f Ediss = f V 2 C (3.5)

Three MOSFET are controlled by a single IC, so the total power being dissipated is tripled, which
gives the following maximum switching frequency

P 0.7
fmax = = = 324kHz (3.6)
3V 2 C 3 × 122 × 5 × 10−9

Which is greatly above the planned frequency of operation, 4kHz.


It is important to physically separate signal and power circuitry, in order to protect the user and the
microcontroller from failures in the high voltage section of the board. PC851 optocouplers [13] are used
to isolate the control circuit of the lower end transistors of the bridge as depicted in Fig. 3.7.

Figure 3.7: Schematic of the gate driver of one of the bottom transistors including two cd4050 gates
and one optocopler circuit.

The absolute maximum input current of these optocouplers and collector current are both 50mA, so
resistors were chosen so that these currents are well below that limit. Furthermore the datasheet informs
that the forward voltage drop in the input LED is 1.2V and the collector-emitter saturation voltage is 0.3V.
A 200Ω resistor in the input with a 0-5V signal and 1.2V of forward voltage drop in the optocoupler
LED, results in a forward current of (5-1.2)/200=19mA.
A 500Ω resistor connected to 12V and collector with a saturation voltage of 0.3V results in a current
of (12-0.3)/500=23mA.

3.2.2 Control of the upper transistors

Q1, Q3 and Q5 have Sources on different nets with potentials that change, therefore a virtual ground
has to be established with each of them. This is accomplished using the circuit in Fig. 3.8.
Three signal transformers are used to separate grounds, one for each MOSFET. At the same time,

24
Figure 3.8: Schematic of the gate driver of one of the top transistors showing the pulse transformer and
the voltage doubler rectifier circuit.

these transformers serve as the physical separation between the signal and power areas of the board.
An alternating voltage is applied on the primary and a full wave voltage doubler rectifier on the secondary
charges the MOSFET gate through a resistor. When the alternating voltage on the primary is removed,
capacitors C4 and C5 discharge naturally through R29 and current flows from the gate of Q1 back into
R28 and R29. As the voltage increases at the terminals of R28, the voltage between base and emitter
of Q7 makes it conduct some current, discharging the gate and making Q1 turn off faster.
The AC voltage excitation is achieved with one CD4049 hex inverting buffer for the control of each of
the three transistor drives and a capacitor in series not only to turn a square wave into a more sinusoidal
one reducing the higher harmonic content of the magnetic field inside the transformer core, but also to
block DC currents and avoid a short circuit across the inductor in case of microcontroller failure. With an
hex inverting buffer, only one of the output pins of the microcontroller is enough to drive both ends of the
tranformer’s primary if the setup is as depicted in Fig. 3.9.

Figure 3.9: Simplified schematic of the logical nand gate and the logical not gates that drive the pulse
transformer in the gate driver of Fig. 3.8.

When the output of the NAND is logic High, pin 10 of Fig. 3.9 will be Low and pin 12 High due to
double negative. The input will be either a 500kHz excitation that can turn on the MOSFET or a constant
voltage that cannot.

25
A microcontroller peripheral called MCPWM (Motor Control PWM) is used to control the activation
states of each transistor (therefore 6 outputs) over time [14]. A logic High means the transistor will be
activated, logic Low means it will be deactivated. The activation signal for the top drive will have to be
intersected with a 500kHz square wave to have a resulting waveform as described in last paragraph.
This is achieved using a constant 500kHz PWM from the OC peripheral (Output Compare) [14], three
different MCPWM outputs each representing the state of a particular MOSFET and a quad NAND array
IC like the MC14011 [15], from which 3 NAND gates will be used to intersect both signals. The logic
values and the activation state of one transistor is represented in Table 3.1.

Table 3.1: Logical values for transistor activation

500kHz PWM1H FET


OFF LOW OFF
OFF HIGH OFF
ON LOW OFF
ON HIGH ON

Since CD4049 is a hex inverting buffer, 6 gates are available. If the schematic shown in Fig. 3.9
is followed, 3 gates are required for each MOSFET drive, which means a total of 9 gates have to be
used leading to a minimum requirement of 2 of these IC. If only 2 were used one of them would have
all the gates used and the other would have 3 gates disconnected, which would create an asymmetry
in the circuit, put more strain in one of them and probably turn the PCB layout design more difficult.
Instead, it was decided that 3 CD4049 would be used, one for each MOSFET drive, which leaves 3 free
gates per IC. The next logical step was to parallelize two of the gates of Fig. 3.9, similarly to what has
been documented in subsection 3.2.1. The end result of this design process is represented in Fig. 3.10
(NAND gate not shown).

Figure 3.10: Schematic of paralleled CD4049 gates for higher current handling and durability driving
the pulse transformer of one top transistor’s gate driver.

Simulations were done before testing a physical circuit. The schematic used in the simulations is
presented in Fig. 3.11.
To simulate the gates’ output, a .CSV file was created that contained the data points for an intermittent

26
Figure 3.11: Schematic of the the top transistor’s gate driver circuit used in the simulation of MOSFET
gate charge and discharge.

500kHz square wave between 7V and -7V. This voltage value was chosen to be able to create a 12V
potential between Gate and Source of the MOSFET. An additional 10Ω resistor was added in series
with the primary of the signal transformer and the capacitor. This resistor damps any natural oscillation
between the capacitor and the inductor if the voltage output goes to 0V (in this simulation, the voltage is
either changing between 7V and -7V or it is 0V). Furthermore, including this additional resistor does not
change significantly the impedance of the LC circuit. The inductance of the primary of the transformer
is 2.4mH and the capacitor has 1µF, so, for a 500kHz wave, the impedance of the series RLC is:

q
2
Z = R2 + (XL − XC ) = 7.54kΩ (3.7)

Where

XL = ωL (3.8)

1
XC = (3.9)
ωC

which proves the previous hypothesis of neglecting the 10Ω resistor in respect to a total impedance
value of 7.54kΩ.
The importance of the BC557 discharge transistor [16] is evaluated by measuring the time it takes for
the MOSFET to turn off, with and without the use of such transistor. This time is the interval between the
end of the PWM commutation until the nullification of the current flowing through the MOSFET. Fig. 3.12
shows the results of a simulation that did not consider the discharge transistor and Fig. 3.13 on the other
hand shows the results of a simulation in which the effect of the discharge transistor was considered.
In the simulation that considered the discharge transistor the turn off time was ∼20µs, as opposed to
∼60µs without the discharge transistor.
Experimental data has also been taken. A 1 Ω resistor was used as a load with a switching voltage
of 1.8 V, meaning that when the MOSFET was on the expected current value was 1.8 A. Since no
oscilloscope compatible current probes were available in the lab where this experiment was conducted,

27
Figure 3.12: Simulation: A commutation from ON to OFF state is represented in this figure without the
discharge transistor. VGS is constant until VP W M comes to rest at 0V, decreasing afterwards. Current
stays constant until VGS reaches ∼4V, decreasing afterwards as VGS falls and the MOSFET turns off.

Figure 3.13: Simulation: A commutation from ON to OFF state is represented in this figure using the
discharge transistor. VGS is constant until VP W M comes to rest at 0V, decreasing afterwards. Current
stays constant until VGS reaches ∼4V, decreasing afterwards as VGS falls and the MOSFET turns off.

the VGS value at which the MOSFET turns off was acquired measuring the voltage between Drain and
Source, VDS . When the MOSFET is turned on current flows and VDS is 0 V; when it is turned on current
is blocked and VDS is 1.8 V.

Fig. 3.14 shows that the specific instant when the MOSFET turns off, ie., the current stops flowing, is
when the VGS approaches ∼4.5 V, 17.6 µs after the command to turn off, which is similar to the results
of the previous simulation in Fig. 3.13.

The purpose of Fig. 3.15 is to emphasize the difference of the gate discharge curves obtained with
and without the discharge transistor and prove its importance. Time cursors were positioned at the
expected times of switching in both curves, indicating an increased switching off delay of 15.2 µs if the
discharge transistor is not used, which corresponds to a total switching off time of 33.8 µs.

28
Figure 3.14: Data obtained experimentally using the circuit of Fig. 3.8 (discharge transistor Q7
included). MOSFET gate voltage VGS is acquired with CH1 and represented in yellow. Voltage drop
between Drain and Source, VDS , is acquired with CH2 and represented in blue. using the discharge
transistor. VDS increasing means the MOSFET is turning off

Figure 3.15: Two experiments are represented together in this figure. CH1, in yellow, still represents the
turn off curve VGS with the discharge transistor. On the other hand, the discharge curve without the
discharge transistor is represented in white, presenting a noticeable delay in respect to the yellow
curve.

3.3 Changing the number of active pole pairs

This particular inverter was designed to be able to change the number of active pole pairs of a
Dahlander motor. Fig. 1.2 already gives a hint on how to implement the hardware for this commutation.

The 3 wires that carry power from the triple half bridge are switched by 3 DG20 automotive re-
lays [17] that select their output path, to the 1U-1V-1W motor connections in ∆ setting or 2U-2V-2W in
YY. A second set of 2 equal DG20 relays manage a short or open circuit between 1U-1V and 1V-1W,
effectively short circuiting the three wires in YY. Since all the relays have only two states that have to

29
be switched simultaneously, only one driver is enough to command the whole array, such driver being
the ULN2803 [18] conveniently available in the microcontroller development board used in this work.
Fig. 3.16 shows a representation of these connections.

Figure 3.16: Commutation of the connections to the motor to change the number of active poles of the
motor. UVW are the 3 phases of the inverter. Relays U$1, U$3, and U$5 connect UVW to 1U-1V-1W or
2U-2V-2W; Relays U$2 and U$4 short circuit 1U-1V and 1V-1W respectively. All the windings are
powered with the unregulated voltage of the microcontroller development board and "RELAYS" pin
connects to an open collector pin of the ULN2803.

3.4 Battery level monitor

A voltage level monitor is important to check the remaining charge and protect the battery from
discharging below a set point where, while still performing acceptably, greatly reduces the battery’s
remaining cycles. This set point may be adjusted in the firmware for a tradeoff between autonomy and
ageing speed of the battery.
An NE555 timer [19] was used as a voltage controlled oscillator (VCO) as the core of the voltage
monitor, isolated from the microcontroller using a PC851 optocoupler [13]. As the name suggests,
a VCO changes the frequency of the output wave depending on the input voltage. A microcontroller
measures this frequency and infers the input voltage. The full schematic of the monitor is shown in
Fig. 3.17.
The explanation of the different parts of the voltage monitor circuit follows:
•If VDD_PWR is 48V, the voltage divider composed of R34 and R35 puts 14.7V at the input of the
LM7805 regulator [20], which regulates to constant 5V the positive voltage of the NE555, which is fed to
pin 8 8V_REG.
•Pin 1 is simply ground.
•Capacitors C10 and C11 mitigate voltage surges in the input net of the LM7805 regulator.
•R36 and R37 make the voltage divider and the middle point is fed into Control pin 5 of the NE555,
which changes the RC time base of the IC and consequently changes the frequency of the output signal.

30
Figure 3.17: Schematic of a voltage level monitor for a 48V battery using an NE555 powered from the
full stack battery itself and isolated from the microcontroller using an optocoupler.

•Pin 4 is active low and restarts the 555 timing, which means that it is connected to 8V_REG so that
it is always inactive.
•Pin 3 is the output pin and starts high, charges C12 through R39 and when threshold pin 6 senses
a voltage level on C12 that is 2/3 of the supply voltage, output pin 3 goes to 0V.
•Pin 2 is the trigger pin and starts the operation of the 555 timer putting output pin 3 high whenever a
voltage lower than 1/3 of the supply is sensed in this pin, explaining its connection to C12 which voltage
is oscillating in time between 1/3 and 2/3 of the supply voltage.
•Pin 7 is the discharge pin and is an open collector, either putting out 0V when output pin 3 is low or
a high impedance when output pin 3 is high, effectively driving the LED in the optocoupler.
•On the right hand side of the optocoupler the pull down resistor R41 ensures that optocoupler pin 3
(BAT_LVL) has 0V when the LED is OFF and 5V when the LED is ON. The output of this pin is the end
result of the voltage monitor, corresponding to a variable frequency square wave of ∼50% dutycycle to
be acquired by an Input Capture pin of the microcontroller.
•D7 is an additional diode that is put between control pin 5 and 4/8 that clamps the voltage of control
pin 5 to a ∼6V maximum, but will not be forward biased if the circuit is operating normally.
This circuit was tested in a breadboard with R34, R35, R36 and R37 adjusted for a variable power
supply voltage of 10-15V performing as described but is not yet deployed in the present inverter. When
deployed, it will be subject to calibration for a relation between input voltage and output frequency.

3.5 Surge protection

Rapidly shifting high currents of ∼30A over inductive loads as motor windings creates strong back
electromotive forces in the circuit that has to be protected against it. Most power transistors already
have freewheeling diodes built-in to mitigate this issue.
This particular application tested switching at 4kHz and 8kHz. As the switching frequency increases,

31
the harmonic contents of the current in the motor decreases but the power being dissipated in the tran-
sistors increase. Also, when one of the transistors in one of the three half bridge closes, overshoot and
ringing are observed between drain and source terminals of the other transistor in the same half bridge
due to charge resonating back and forth between the inductance of the winding and the capacitance be-
tween drain and source pins. Fig. 3.18 shows this phenomenon happening in one of the top transistors
of the bridge.

Figure 3.18: Overshoot and ringing effects observed in the upper transistors’ VDS when switching.

Overshoot becomes an issue if the resulting voltage is higher than the absolute maximum refer-
enced in the transistor datasheet, in which case the device may fail completely becoming a fire hazard
if switching high power.
To tackle this problem, a snubber network can be devised so that the rate at which VDS changes is
limited, the voltage overshoot peak value is smaller and the energy that was previously being dissipated
in the transistor is now being dissipated in the snubber.
An RC filter in parallel with the Drain and Source terminals of the transistor can act as a simple
snubber. To aid the RC filter in dumping the excess energy, a schottky diode may also be mounted
in parallel. These diodes turn on much faster than the body diodes of the MOSFET which makes the
voltage overshoot smaller, lowering the energy being cycled through the capacitor and resistor. They
also provide a faster path for the current to flow back into the battery when electromagnetic braking is
active and the motor works as a generator. The described circuit is presented in Fig 3.19.
To determine the capacitor and resistor values there is a simple process to follow based on the
following rule of thumb [21]:
•To make sure there is no voltage overshoot on switch off, a resistor is chosen so that its resistance
value is smaller than the quotient V0 /I, where V0 is the voltage clamped by the transistor and I is the
expected maximum current that passes through it. In this application, V0 =48V and I=30A, which means
R≤1.6Ω.
•The maximum rate of voltage change is set choosing the capacitor as:

32
Figure 3.19: Snubber network and FET

dV V0
= (3.10)
dt max RC

48
48 × 106 = (3.11)
1.6C

1
C= = 625nF (3.12)
1.6 × 106

•The power rating of the resistor is based on the energy stored by the capacitor in each transition
and the switching rate.

1 1
Eswitch = CV02 = 625 × 10−9 × 482 = 0.00144J (3.13)
2 2

Etotal = f × Eswitch = 4000 × 0.00144 = 5.76W (3.14)

The resistance value used was 3.3Ω rated 2.5W and the capacitance 1µF, which still falls in the range
of applicability of the snubber. With these values, the maximum rate of voltage change is 15×106 V/s and
the dissipated power is 4.6W, not considering the schottky diode, which decreases the power require-
ment of the resistor. Tests were done in series of 2-3 minutes in full load during the characterization of
the inverter and no damage was observed in the chosen resistors, showing that the rating of 2.5W was
high enough for the power they were dissipating.
When the snubbers were mounted on the board, the characteristic VDS of the transistors changed to
what is observed in Fig. 3.20, showing a greatly attenuated overshoot voltage peak of ∼60V in compar-
ison to ∼80V registered without snubbers.
The stability of the 12V power rail is another concern. This inverter is tested with a power source
composed of 4×12V batteries. The one connected to ground also powers the CD4050 that controls

33
Figure 3.20: Top transistor VDS when switching with the snubber circuit in parallel, showing an
attenuated overshoot peak voltage and faster dumping of the excess energy.

the lower transistors. If voltage fluctuates too much, the output of the gates becomes ambiguous and
incorrect states may happen. In extreme cases, one branch of the bridge can be shorted and transistors
are destroyed. Using an LC filter this issue can be mitigated. The schematic of this application is
depicted in Fig. 3.21.

Figure 3.21: LC filter at the power input pins of the CD4050

Yet another limitation is the peak current the batteries can supply. When an excessive amount of
current is sourced from a battery, its voltage drops and with it, its performance. Also, excessive DC
ripple current can contribute to battery ageing due to cell heating [22]. DC bus current sensing capability
is available using an LTS 25-NP current probe [23] that is interfaced with the microcontroller to monitor
overcurrent. It also helps having a high value buffer capacitor to manage current surges, while the
battery sources DC current. In this particular case, a capacitor bank of 8.8mF (4×2.2mF capacitors in
parallel) was used in series with a 1.9 µH inductor to prevent sudden changes in the battery current
supply. The cut-off frequency is calculated with Eq. 3.15, giving 1231 Hz that is well below the lowest
switching frequency considered, 4000 Hz, but could be lower if a higher value inductor was used.

1 1
fc = √ = √ = 1231Hz (3.15)
2π LC 2π 1.9 × 10−6 8.8 × 10−3

Fig. 3.22 shows the circuit that was deployed, allowing to pre-charge the capacitor bank before

34
connecting the battery to the inverter power input and capacitor bank through the inductor.

Figure 3.22: Power supply surge protection schematic

Firstly, switches S1 and S2 are turned off, and C1 is discharged. The turn on procedure starts with
turning on S2 to charge C1. When C1 is charged, LED D1 emits light. Then S1 is turned on and the
inverter is finally powered. S1 and S2 are manually switched, but in the future, S2 should be switched
manually and S1 should be activated by the microcontroller when D1 forward voltage drop was detected
using the ADC and deactivated otherwise.
To turn the inverter off, firstly the switch S1 is turned off to eliminate the low impedance net between
L1 and C1 and then S2 is turned off to disconnect the charging net. R2 ensures that C1 is discharged
for safety. The LED starts dimming down until it completely shuts off, indicating that the capacitor has
now a very low voltage, ∼1V, which is the typical forward voltage drop of a diode.

35
36
Chapter 4

Motor control

Many control techniques can be chosen and applied in a custom made three phase inverter such as
this one. Some techniques use the back-EMF on the stator windings to determine the rotor position and
are categorized as sensorless control, although needing current sensors in at least 2 of the 3 phases.
Sensored control techniques on the other hand use additional sensors such as mechanical encoders or
hall sensors in the case of synchronous motors, to acquire the rotor speed and position. Section 4.1
presents a sensorless version of the Field Oriented Control technique, one of the most efficient form of
vector control and one of the most common control schemes in induction motor inverters. Section 4.2
presents an experimental sensored technique applied in this inverter based on monitoring and controlling
the motor’s slip. Appendix D contains the most relevant code snippets of this last technique.

4.1 Field Oriented Control - Sensorless

Field Oriented Control (FOC) is one of the most efficient vector control scheme [24] and has been
used in the industry since the 1980s, after the commercialization of microcontrollers. Since that time,
microcontrollers have become faster and cheaper, which in turn widens the range of applicability of the
method. It can be used in the control of synchronous and asynchronous machines alike.
This technique makes it possible to control flux and torque separately, much like in a DC machine
where one can adjust excitation current (flux) and armature current (torque) individually. The control
diagram is represented in Fig. 4.1 [25]
Firstly, the current in two motor phases are acquired. The current in the third phase can be calculated
from the other two since there is not a neutral connection available and:

ia + ib + ic = 0 (4.1)

The measurements of these two currents are fed into block A of the FOC in which a direct Clarke
transform is executed to represent three current phases in an αβ coordinate system. The inverse Clarke
transform may be used to get back from an orthogonal coordinate system into a three axis one.

37
Figure 4.1: Sensorless FOC control diagram. Blocks: A Direct Clarke transform; B Direct Park
transform; C Estimates rotor speed and flux angle; D Flux weakening; E Inverse Park transform; F
Space Vector Modulation (SVM) or equivalent modulation technique.

Still regarding the direct Clarke transform, based on Eq. 4.1, two variables are enough to describe
the three currents. The three currents are represented as vectors in a three axis referential as in Fig. 4.2.

Figure 4.2: Motor currents represented in a three axis referential and vector summation result



i is naturally the sum of the three currents in this referential and does a full rotation at the frequency

− →

of the phase currents. ib and ic can now be represented as space vectors rotated in respect to the a

− →

axis. ib is rotated positively 120o (2π/3) and ic 240o (4π/3), therefore:
i = ia + ib + ic
ia = ia
ib = aib
ic = a2 ic

38

3
a = ej(2π/3) = − 12 + j 2

3
a2 = ej(4π/3) = − 12 − j 2

i is written in 4.2 with the real and imaginary parts separated.


1 3
i = ia − (ib + ic ) + j (ib − ic ) (4.2)
2 2

Using 4.1, the previous equation simplifies further into:


3 3
i = ia + j (ib − ic ) (4.3)
2 2

It will be useful in following calculations to have 4.3 rescaled by a 2/3 factor, so:

2 1
iS = i = ia + j √ (ib − ic ) (4.4)
3 3
Now that the three phases are represented in the complex plane, it is a matter of projecting iS in the
real and imaginary axis, α and β respectively, as shown in Fig 4.3.

Figure 4.3: Current vector resultant from the summation of the three current space vectors being
projected into the two new axis

The results of these projections are described below.

iα = Re{iS } = ia (4.5)

ib − ic
iβ = Im{iS } = √ (4.6)
3
To summarize, block A yields a fixed reference frame of two axis (stator reference) in which the
current vector iS changes its direction and magnitude over time and is projected in two axis to output iα
and iβ .
Block B receives as inputs the currents iα and iβ and the estimated angle of the rotor flux (explained

39
further), to execute what is called a Park transformation. This transformation is the foundation of FOC
and creates a rotating reference frame, still with two axis, one of them commonly aligned with the rotor
flux. The result of one of these transformations is depicted in Fig. 4.4.

Figure 4.4: New reference frame rotated by the angle of the rotor flux and projection of the current
vector in its axis

θ is the angle of the rotor flux in respect to the α axis of the fixed reference frame. Therefore, it only
takes some trigonometry to obtain the projections in the d and q axis, like so:

iSd = iSα cos θ + iSβ sin θ (4.7)

iSq = −iSα sin θ + iSβ cos θ (4.8)

iSd is aligned with the rotor flux and may be changed for stronger or weaker field excitation. iSq
controls the torque magnitude.

Block C represents an estimator and is responsible for the calculation of the rotor flux angle and
speed. As inputs it receives the currents in the αβ reference frame and the voltages to be applied in the
same reference frame. The estimated motor speed is compared with the reference speed and its error
is processed with a PI controller a) that outputs the reference q current reference iSqref .

Normally a V/f relation is maintained more or less constant in most operating points of the motor
for a constant air-gap flux, but if in one hand the frequency can be increased beyond the motor rated
frequency, on the other there is a limitation in the voltage available from the battery and the rotor flux will
have a smaller magnitude. To avoid saturation of the PI controller c), this rescaling is applied in block
D whenever needed to generate a new reference iSdref . Then the error of iSd and iSq are fed into PI
controllers b) and c) which give the required voltages in the dq reference frame.

The inverse Park transform is applied to these voltages in block E to obtain them in the αβ reference
frame. The equations are obtained in a similar fashion to Eqs. 4.7 and 4.8.

Uα = Ud cos θ − Uq sin θ (4.9)

40
Uβ = Ud sin θ + Uq cos θ (4.10)

Finally, some modulation technique is used to control the voltages in the three phases, SVM (Space
Vector Modulation) being one of the most popular, being executed in block F.

SVM is based on the condition that a three phase inverter can only have 8 different states of transistor
activation and only 6 of them represent a state that actually allows current into the motor. These 6 states
are Vpnn , Vpnp , Vnnp , Vnpp , Vnpn and Vppn and represent the connection of each phase to the positive
p or negative n rail of the inverter, depending on the state of the 2 transistors of each phase. The
other two states Vppp and Vnnn represent zero power since there is no voltage drop between phase
terminals. A combination of states can be achieved by changing the dutycycle of each state during a
period. Furthermore, a zero power state can also be introduced to lower the resulting magnetic flux
magnitude. The moving average of states is represented by a reference vector Vr that circulates the
different states at the frequency of the electric cycle. Figure 4.5 illustrates the 6 states the inverter can
have.

Figure 4.5: SVM hexagon representing the 6 states in which the inverter can be.

As Vr changes sector, the states being combined also change. For example, if Vr is in sector I, then
the dutycycle of Vpnn (d1 ) and Vpnp (d2 ) and the dutycycle of zero power state Vppp (d0 ) are used to build
Vr as eq. 4.11 ilustrates.

Vr = d1 Vpnn + d2 Vpnp + d0 Vppp (4.11)

d0 + d1 + d2 = 1 (4.12)

41
4.2 Sensored speed control

As an alternative to the more abstract FOC control, a simpler sensored speed control can be imple-
mented using a custom made tachometer that was attached to the back end of the motor to measure
and control its speed.

This sensor was built using an optical sensor and a 24 teeth 3D printed dented wheel to block its opti-
cal path as it rotates. The sensor’s datasheet could not be found since it was a salvaged component from
a printer and these components often lack the markings that make the search possible. However, it was
assumed that its current ratings were similar to those of the PC851 optocoupler used in more sections of
the board and resistors were chosen accordingly. Its output is acquired using the microcontroller’s Input
Capture (Appendix D.1). If an off-the-shelf tachometer is used, the interface with the microcontroller can
still be a square wave that is read by the Input Capture, or change, needing an additional Input Capture
to detect the direction of rotation or a standard communication protocol such as I2 C, SPI or RS485.

In Chapter 2, the slip frequency of highest efficiency was determined to be around 3 Hz. This means
that, in principle, if the magnetic field created with the stator windings is always 3 Hz (180 RPM) faster
than the rotor, the motor will be as efficient as possible.

A dsPIC30F4011 microcontroller [26] was used to receive user commands and control the electronics
that power the motor, ultimately controlling the frequency and magnitude of the rotating magnetic field.
Specifically, when the speed of the rotor is between 0 and 300 RPM, the magnetic field in the air-
gap rotates at 480 RPM, so that the slip and consequently torque is higher and static friction forces
are overcome. At higher speeds, the magnetic field is always 180 RPM faster than the rotor, hence
3 Hz, as depicted in Fig. 4.6. When the calculated magnetic field speed is higher than 1500 RPM
there is no advantage in increasing it further without changing the number of pairs of poles, as the
voltage from the batteries is limited and increasing the frequency of the electric cycle would only reduce
the magnitude of the magnetic field (see equation 1.6). Instead, the onboard relays are activated to
change the configuration of the winding connections to the motor and the number of active poles from
4 to 2. When this happens, the frequency of the electric cycle has to be halved from 50 to 25 Hz
to maintain the speed of magnetic field close to 1500 RPM and is increased onward, as depicted in
Fig. 4.7. The microcontroller fully turns off all 6 MOSFET in the bridge 10 ms before acting on the relays
and waits another 10 ms after switching to give the relays some time to connect, only then the power is
reestablished.

A look up table stores the length of the ON states of the transistors in MCPWM time units for a
complete electric period and maximum RMS voltage. After inferring the frequency of the magnetic field
from the speed of the rotor (see Fig. 4.6), the values on the look up table are scaled down to lower RMS
voltage on the windings and consequently the magnetic field magnitude. The V/f ratio is not constant,
two slopes can be configured for higher torque at the cost of efficiency and vice-versa. A configuration
example is shown in Fig. 4.8 in full line, with the constant V/f ratio represented in dashed line.

The starting voltage level can be adjusted depending on the start up torque requirements (see sec-
tion 1.3 for example). To do so, the shaft of the motor can be connected to a rod with a weight attached.

42
Figure 4.6: Relation between magnetic field and rotor speed in RPM

Figure 4.7: Relation between the percentage of maximum RMS voltage applied, the frequency of the
electric cycle and the synchronous speed.

The weight of the rod can be represented in its center of mass and the additional mass where it is at-
tached. They can be viewed as one single center of mass located somewhere along a massless rod as
depicted in Fig. 4.9.
The motor develops its maximum torque when the rod is parallel to the ground, since the weights are
being pulled perpendicullarly in relation to the body of the rod. In this case the torque is calculated like
so:

T = F d = Fgrod drodcenter + Fgmass dmass (4.13)

Special care has to be taken to prevent the rod from exceeding this position and possibly injure the
experiment users with the swing of the rod. When the motor is able to keep a steady state in this position

43
Figure 4.8: Configured slopes for the V(f) relation represented with full lines and constant V/f ratio with
a dashed line.

Figure 4.9: Representation of the setup of a start-up torque experiment.

it is guaranteed that it can develop the specified torque.


The slopes of Fig. 4.8 were configured empirically for the acceleration of the machine under the
conditions of this apparatus. The configuration is based in a set of points which are used at the micro-
controller boot to calculate the slopes and can be reconfigured during operation if needed, if a new set is
given by serial port interface. This provides a framework that allows the vehicle (or other type of loads)
to change operating points and save energy since the slope configuration has to be more demanding in
uphill conditions than it has to be when in a flat terrain.
Above this configuration layer is the accelerator, a linear potentiometer that the operator uses to
rescale the dutycycle once more. This ranges from 0% to 100% of the percentage calculated from the
speed of the motor. In practice, the potentiometer just rescales the original V(f) plot shown in Fig. 4.8, as
depicted in Fig. 4.10. When the potentiometer’s cursor is in a range of 50-100% the inverter creates a
faster magnetic field relative to the rotor, i.e., the machine works as a motor. When its cursor is in a range
of 0-50% the inverter creates a slower magnetic field relative to the rotor, i.e., the machine works as a

44
generator. The edges of the scale (0 and 100%) correspond to the highest magnetic field amplitudes
and at 50% no field is generated.

Figure 4.10: Representation of the percentage of the dutycycle stored in the look up table depending
on the electric cycle frequency and the position of the potentiometer. The 4 example sets correspond to
25%, 50%, 75% and 100% of the dutycycle obtained with the position of the potentiometer’s cursor
after setting the electric cycle frequency, but the percentage is continuous.

4.3 Firmware

The electronic inverter was introduced in Chapter 3, requiring a 500kHz PWM square wave as the
input to the NAND gates for the drivers of the top transistors. This is achieved by using a single Output
Compare peripheral, that is running whenever the inverter is controlling the motor, being turned off if on
stand by to ensure that the transistors are off.
Three phase motors have to be powered by three waveforms that are shifted 120 degrees from
each other. The MCPWM peripheral is responsible for the timings in the activation of each transistor.
The HIGH and LOW states of the 6 MCPWM output pins directly represent the desired states of the 6
transistors, with the respective turn on and turn off times.
A pseudo sinusoidal 256 position look up table defines the PWM dutycycle of the transistors during
the electric cycle. The MCPWM peripheral interrupts every PWM period and iterates through the look
up table. Three pointer variables that are shifted 120 degrees from eachother are incremented cyclically,
i.e., when the counter reaches a value of 255, the next increment returns its value to 0. This array has
positive and negative values that configure which transistor will be activated, the top or bottom one. If
the PWM has a period counter of 100 and a specific position of the look up table has a -50 value, it
means the lower transistor in that bridge branch is turned on 50% of the time, and the top transistor will
be turned off during the complete period.
The three pointer variables have 16 bit precision and are initiated at values 0, 85 and 170 (shifted
120 degrees, or one third of a period, 256/3=85) before being shifted 8 bits to the left. In each interrupt

45
they are incremented and only the 8 most significant bits are considered for the look up table position,
in other words, the 8 least significant bits are precision bits and the 8 most significant are the effective
bits that specify the position on the look up table. How much they are incremented is determined by the
frequency of the PWM (4kHz-8kHz) and the electric cycle frequency (4.5Hz-70Hz). The most relevant
part of the code for this logic is available in Appendix D.3. To put it simply, the look up table has to be
cycled at the electric cycle frequency, incrementing the pointer variables at the PWM frequency, which
translates to increments of

felectric 16
inc = 2 (4.14)
fP W M

each time an interrupt happens. The described counting algorithm was largely based in Application
Note GS004 from Microchip [27].

This array is built taking into consideration the turn on and turn off times of the transistors so that
no activation is executed at all if the dutycycle is not long enough for the transistor to begin conducting
current. Also, to prevent shoot through, a short circuit across one branch of the bridge when the two
transistors are on, sufficient time is given in the sinusoidal node, for one transistor of the branch to stop
conducting before turning on the other.

The bottom transistors of the bridge for example take roughly 2µs to turn on, while the upper tran-
sistors take 10µs. The MCPWM has a timebase of TCY/2, which is, in this case, 17ns. In this case, a
minimum dutycycle of 2000/17∼118 timebases has to be provided to turn on the bottom transistors of
the bridge and 10000/17∼588 to turn on the upper transistors. If these minimum values are not achieved
when calculating the dutycycles, then the MCPWM will not even try to turn on the transistors. Further-
more, the upper transistors take roughly 20µs to turn off. For the worst case scenario, if the electric
cycle frequency is 70Hz and it is divided in 256 parts, each division will take 55µs, which means that
one position zeroed is more than enough for the top transistor to stop conducting before the bottom one
turns on.

In section 4.2, the function of the attenuation of the dutycycle was introduced. After the rescalling,
the lower values of the array might still fall into the previous conditions of no conduction despite the
command to turn the transistor on. The microcontroller is then configured to first verify if the dutycycle
is still larger than required to turn the transistor on, and if it is not, no activation will be executed.

The final step in the calculation of the dutycycle comes from the configuration of maximum current
admitted by the inverter from the battery into the motor. In this particular application, a maximum value of
30A was configured and in each MCPWM interrupt the current is acquired using the LTS 25-NP current
probe referred in section 3.5. If a reading gives 10% more current than the maximum value admitted,
the next dutycycle will have its value reduced by 10%. This part is shown between signaled comments
in Appendix D.3.

Peripheral interrupts are listed in Table 4.1

•Access to the microcontroller is done by serial port using a program like Putty or Minicom. If the
highest priority is not given to the receive interrupt of the UART, commands may be received incorrectly

46
Table 4.1: Interrupt timings

Interrupt Priority Frequency(Hz) Duration(µs)


U2RX 7 <10Hz 5.9
MCPWM 6 8000/4000 73.2
IC 5 <2000 17.7
Timer4 4 1000 6.4
U2TX 3
Timer3 2 <1Hz 0.7

or not received at all.

•MCPWM interrupt is responsible for the update of the dutycycle of the transistors and advancing
along the pseudo sinusoidal array. The interruption happens on the end of each commutation period. 16
bit variables are used to point to the desired position of the array. Having only 256 positions, 8 bits are
sufficient to represent the position of the array. At each interruption, these 16 bit variables are increased
by an amount that depends on the electric cycle frequency. The 8 most significant bits of these variables
are indeed used to map the dutycycle array, and the others are only used as decimal values for a fine
increment between interruptions. See Appendix D.3.

•IC (Input Capture) is used to measure the rotor speed. A 3D printed dented with 24 teeth is fixed
to the rotor shaft and a photointerruptor is positioned to deliver a varying frequency square wave to
the microcontroller when the rotor is spinning. On each descending edge the IC interrupts and the
microcontroller calculates the rotor speed based on the period registered by the IC. See Appendix D.1.

•Timer 4 interrupt updates the frequency of the electric cycle based on the rotor speed. The at-
tenuation factor of the dutycycle array is also calculated based on the electric cycle frequency and the
potentiometer position. See Appendix D.2. If rotor speed reaches 1550 RPM, the number of active pole
pairs are switched from 2 to 1, the electric cycle frequency is rescaled to match the rotating magnetic
field speed and the number of active poles is kept in 1 until the rotor decelerates to 1450 RPM. This
histeresis is inserted so that the motor stays powered at the interface of these two speeds. See also
Appendix D.4.

•The microcontroller monitors the speed of the motor and shows it in the serial port, together with the
speed of the rotating magnetic field, the attenuation percentage on the dutycycle array, the frequency
of the electric cycle and the current on the DC bus. This information can be shown only when the
microcontroller is waiting for the next event, alas this low priority value for the UART transmit interrupt.

•Lastly, the timer 3 is the time base for the IC and interrupts when the respective TMR value reaches
the maximum value 65535, which translates to 4 RPM. If the IC does not interrupt by then, timer 3 does
and the microcontroller assumes the rotor is stopped.

47
4.4 Strategies of command and results

4.4.1 8kHz asymmetric switching

Since the transistors on the top half of the bridge switch slower, the initial strategy was to switch them
slower, at the frequency of the electric cycle, while switching the bottom ones switch at high frequency,
namely 8 kHz. The initial experiments were done with no added load to the motor and the current was
measured with a current transducer probe with a transformation ratio of 100mA/V. Results of this strategy
are depicted in Figs. 4.11.

Figure 4.11: No load experiment: MCPWM 1H switching at electric cycle frequency acquired using
CH3 in purple, 1L switching at 8 kHz using CH2 in blue, and phase current 1 using CH1 in yellow.

Fig. 4.11 shows the voltage of MCPWM pins 1H and 1L and the current in that phase. The first
thing to note is the highly spiked characteristic of the current. This is mainly because with three phases
shifted 120 degrees and the top transistors activated during half of the electric cycle, there will be times
when 2 top transistors are conducting at the same time. Momentarily, this provides one more path for
current to flow, which decreases impedance. To mitigate this issue, a tweak in the dutycycle look up table
was tried, so that the duration of the on state of the bottom transition is halved in these instants. This
avoids current spikes that would otherwise increase saturation losses in the iron and overall decrease
the efficiency of the motor. Fig. 4.12 shows the MCPWM pins 1H, 2H and 3H and the current in phase
1 when applying this tweak.
This results in current peaks of only ∼10A, that could go up to ∼24A as in Fig. 4.11 if nothing was
done. When the motor is loaded, the current obviously reaches higher peak values. Nevertheless, the
current is still nowhere near sinusoidal. To find how to make it better, one must first understand the
current waveform.

48
Figure 4.12: No load experiment conducted at 8 kHz asymmetric switching with added tweak to the
look up table: MCPWM 1H, 2H, 3H acquired using CH2, CH3 and CH4 respectively and phase current
1 using CH1.

In Fig. 4.12, channels 2, 3 and 4 correspond respectively to the top transistors of phase 1, 2 and 3.
Channel 1 is the current in phase 1. To better illustrate this strategy and provide a qualitative analysis,
the averaged dutycycle of 1L, 2L and 3L dutycycles were added in Fig. 4.13 and are represented as
negative in respect to 1H, 2H and 3H rectangular functions.

The empirical fix that was inserted in the look up table "cuts" the peak between points 1 and 2 in
Fig. 4.13, but also between 3 and 4, as there is only one look up table and the tweak is shifted 120
degrees in the other phases, matching the next peak.

Furthermore, the phase current is positive in Fig. 4.13 when the inverter is sinking current from the
motor and negative when it is sourcing current into the motor. In point 2 for example, the current is
being sunk into the inverter and when one the top transistor of phase 1 stops conducting, current will still
be sourced from that phase into the motor, as it cannot stop abruptly because of the inductance of the
motor. The only way for that to happen safely is to flow through the free-wheeling diode of the bottom
MOSFET and the bottom snubbing diode of that branch. This happens as the ground rises in potential,
which also reduces the fall time of the current of phase 2, explaining the steep down slope observed in
point 2.

One important thing to remember is that during one period, the integral of the current has to be 0
(zero). This helps understanding how the negative part of the current would be respective to the positive
part if it were more sinusoidal. With this in mind, it can be seen that between point 2 and point 3 for
example, the absolute rise of the current is too steep. This should be solved by decreasing the overall
slope of one or both sides of the MCPWMxL, preventing current from rushing into to motor (left and right

49
Figure 4.13: MCPWM 1H and 1L, 2H and 2L, 3H and 3L and current in phase 1, with time marks for
text referencing.

sides with respect to the location of the so called "tweak").


The current between points 3 and 4 is a little low in the absolute scale (it should be more negative
by that time), which means that when two top transistors are activated, the dutycycle of the bottom one
should be a little higher. A second order adjustment can still be suggested that would decrease the
dutycycle of MCPWM1L gradually in time from point 1 to 2 for a softer transition from point 2 to 3. Since
there is only one look up table, not only would the current stop rising from the middle point of 1 and 2 to
2, but also from point 5 to 6.
This is a highly empirical process that may result in a better waveform when the motor is running
under a certain speed and slip (and consequently power), but may fail when under other conditions.
The performance of inverter-motor set was evaluated in ∆ configuration and under diferent loads,
using the look up table represented in Fig. 4.13. A DC electric machine was mechanically attached to
the induction motor and the resistive load used was the smallest in the lab, 5.5 Ω (6 33 Ω resistors in
parallel) in series with the armature. The opposing torque was adjusted selecting the voltage on the
excitation coils. The setup is represented in Fig. 4.14, with a close-up of the inverter in Fig. 4.15.
Since the voltage and current are far from sinusoidal, the same approach taken in Chapter 2 cannot
be taken this time to measure the input power. Instead, the battery voltage is acquired using a voltmeter
and the battery DC current is measured with a current probe. The DC machine’s armature voltage
and current are measured the same way. Total input and output power are calculated simply by the
multiplication of voltage and current. The DC machine’s efficiency is artificially fixed at 80% similarly to
what has been done in Chapter 2, to consider only the inverter+induction motor efficiency. For further
reference, the speed of the motor is also measured using the tachometer mounted in the motor and

50
Figure 4.14: Experimental apparatus for the characterization of the inverter-motor set.

Figure 4.15: Close-up of the electronic inverter. The microcontroller devolopment board is shown in the
right hand side and and inverter in the left hand side. The transistors are located in the middle of the
inverter board, screwed to a copper sheet with an added cooler with fans. To the right hand side of the
transistors are their drive circuits and the connections to the microcontroller. To the left are the relays,
current probe and connections to the motor.

printed in a serial console. The results of this method are presented in Table 4.2.

The efficiency of the conversion is generally quite small, lower than 45% in all samples. The best
efficiency of all samples was taken at 1426 RPM, the nearest to the nominal speed of the motor 1430
RPM. When comparing with the data from Table 2.4 however, the results are not that disappointing, since
the highest efficiency obtained with an auto-transformer is 50.3%, also near the nominal speed, 1435

51
Table 4.2: Performance tests of the inverter-motor set using a commutation frequency of 8 kHz and a
look up table with an inserted 50% dutycycle attenuation when 2 of the 3 top transistors are on at the
same time.

N(RPM) s(RPM) Vbat (V) Ibat (A) Vload (V) Iload (A) Pbat (W) Pload (W) eff(%)
1330 170 47.9 20.3 38.6 7.02 972.4 270.9 34.8%
1426 74 48.2 12.3 33.3 6.05 592.9 201.6 42.5%
1462 38 48.2 8.4 26.0 4.73 402.5 122.9 38.2%
1475 25 48.3 6.7 19.6 3.56 322.2 69.8 27.1%

RPM. The algorithm described previously in section 4.2 showed that the microcontroller sets the mag-
netic field 180 RPM faster than the rotor and switches to YY configuration if the speed of the magnetic
field is greater than 1500 RPM. However, these tests are evaluating the motor in ∆ and the opposing
torque executed by the DC machine is not enough to reach a slip value of 180 RPM. The motor could be
run faster in ∆ configuration, but the field would be weakened due to an increase of frequency without
increasing voltage, so the speed was temporarily capped to 1500 RPM in the firmware. A lower effi-
ciency is achieved at 1330 RPM however, corresponding to a slip of 170 RPM, near the expected slip
for highest efficiency, which is contradictory. This suggests that in ∆ configuration it might be better to
lower the configured slip that the inverter has to keep.
An additional look up table was tried to get a more sinusoidal phase current out of the inverter. If
the standard deviation of the DC current that comes from the battery is minimized it means that the
input power is more stable and the phase currents become more balanced, which in principle results in
more sinusoidal currents. To achieve this, an additional degree of freedom is given as a coefficient that
multiplies the third harmonic and adds it to the fundamental. This tweak still applies only to the half of
the look up table that corresponds to the dutycycle of the bottom transistors, which means that the other
half will still be forced to 1, following the strategy described previously. The windings are treated as 1Ω
resistors and the current is evaluated in each phase as:

2VU − (VV + VW )
IU = (4.15)
R

Notice that the value of R does not matter, form is the most important, whatever the amplitude.
The current is calculated using this algorithm for the three phases and then summed. The result is
the current in the DC bus. This is done during one full period and then a solver (in Microsoft Excel for
example) tries to minimize the standard deviation by changing the multiplicative coefficient that sets how
much of the third harmonic is present in the wave.
The resulting waveform for the voltage of the three phases is used as a template for the look up table
and is depicted in Fig. 4.16.
With the look up table obtained through this method, the resulting experimental current waveform is
the represented in Fig. 4.17.
Which is fairly closer to a sinusoidal waveform than the manual adjustment inserted before.
The efficiency was again evaluated using the setup of Fig. 4.14. Results are represented in Table 4.3.
A small improvement of 1.6 % is noticed in the efficiency around the nominal speed, 1429 RPM with

52
Figure 4.16: Look up table graphical representation, resultant of wave correction with 3rd harmonic,
minimizing DC current standard deviation. Positive values indicate dutycycle of top transistors, negative
values indicate negative values of bottom transistors.

Figure 4.17: CH2, in blue, represents the current on one phase after correction with the 3rd harmonic,
while CH1 represents the VGS of the corresponding top transistor of the branch to which that phase is
connected.

the 3rd harmonic correction in relation to the manual tweak. Once more, power being dissipated in the
load resistors is too low and consequently the opposing torque is not high enough to bring the rotor’s
speed down to a slip of 180 RPM, which means the synchronous speed is still 1500 RPM. The highest
efficiency, 45 %, is achieved at 1418 RPM, corresponding to a slip of 82 RPM.

4.4.2 4kHz symmetric switching

It was decided that without a proper simulation, probably in Matlab’s extension Simulink, the best
course of action would be to lower the frequency of the transistor commutation and switch the bottom
transistor of each branch during half of the period of the electric cycle and the top transistor during the
other. Since the look up table for the dutycycle of both transistors is intrinsically sinusoidal, it is expected
that it generates a more sinusoidal phase current relative to the last two strategies. The result is the
current waveform depicted in Fig. 4.18.
Which is the first result to have symmetrical currents, as was expected from a symmetrical activation

53
Table 4.3: Performance tests of the inverter-motor set using a commutation frequency of 8 kHz and the
original look up table corrected with the addition of a 3rd harmonic

N(RPM) s(RPM) Vbat (V) Ibat (A) Vload (V) Iload (A) Pbat (W) Pload (W) eff(%)
1418 82 48.0 18.3 41.7 7.58 878.4 316.2 45.0%
1429 71 48.0 16.0 38.6 7.02 768.0 270.9 44.1%
1450 50 48.1 12.6 33.3 6.05 606.1 201.6 41.6%
1470 30 48.2 9.6 26.0 4.73 462.7 122.9 33.2%
1480 20 48.2 7.7 19.6 3.56 370.2 69.8 23.6%

Figure 4.18: CH2, in blue, represents the current on one phase with symmetric 4kHz switching, while
CH1 represents the VGS of the corresponding top transistor of the branch to which that phase is
connected.

sequence of transistors. Still, 4kHz is a low commutation frequency, but the setup was tested once
again. Results in Table 4.4.

Table 4.4: Performance tests of the inverter-motor set with 8kHz and 3rd harmonic correction

N(RPM) s(RPM) Vbat (V) Ibat (A) Vload (V) Iload (A) Pbat (W) Pload (W) eff(%)
1480 20 48.2 11.4 42.4 4.05 549.5 171.7 39.1%
1470 30 48.1 13.0 41.5 5.31 625.3 220.4 44.1%
1460 40 48.0 14.8 39.2 6.24 710.4 244.6 43.0%
1440 60 48.0 16.8 37.0 7.04 806.4 260.5 40.4%

While having more sinusoidal phase currents, it is strange to observe a maximum efficiency point at
slip values 30-40 RPM. It was expected a maximum efficiency at speeds between 1430 and 1320 RPM,
at the nominal speed of the motor and at the expected slip for maximum efficiency respectively.

4.5 Regenerative braking

For regenerative braking to happen, the rotor has to move faster than the rotating magnetic field.
This is accomplished using the DC machine as the motor and the induction machine as the generator.

54
The same apparatus described previously in this section is used for these experiments but now the
armature of the DC machine is powered by a second DC power supply instead of being connected to
load resistors.
The asymmetric switching at 8 kHz did not perform well on creating sinusoidal currents so these
strategies were not considered when testing the regeneration.
The current in the DC bus is the most important variable, since it dictates how successful the inverter-
motor set is at regenerative braking.
The setup was tested with 4kHz symmetric switching, at a speed of 1540 RPM and a slip of -180
RPM. The battery voltage and current are depicted in Fig. 4.19. The current probe was oriented so that
positive current values indicate that the battery is sourcing power and negative current values indicate
that the battery is recharging. The power consumed by the DC motor to put the machines in motion
was 57W. Negative current spikes are observed in this test showing that regenerative braking is indeed
happening, but still the oscilloscope showing a mean current of 590 mA, meaning that the induction
machine is consuming more power from the battery that it is regenerating.

Figure 4.19: Regenerative braking test undergone at a rotor speed of 1540 RPM, -180 RPM slip, with 4
kHz symmetric switching.

Another test was done with 4kHz symmetric switching at a speed of 1380RPM, -180RPM slip and
DC motor power consumption of 82W. Resulting current in the DC bus is depicted in Fig. 4.20. In this
test there are no negative current spikes, meaning that no regeneration is happening.
The inability to execute a regenerative braking seriously cripples this inverter and the non-sinusoidal
waveforms shown in Section 4.4 also suggests that a proper control system must be applied to increase
its usefulness.
Stefan Schmitt is a german student that worked with this inverter for four months at IST and reworked
the firmware to implement FOC as described in the beginning of this Chapter. Two current probes have
been added to the original design to enable this method and the tachometer was discarded. Apart from
these modifications, from the hardware perspective the inverter was not altered.
The results of his work are presented here as proof of the hardware capabilities. The details of the

55
Figure 4.20: Regenerative braking test undergone at a rotor speed of 1380 RPM, -180 RPM slip, with 4
kHz symmetric switching.

development are outside the scope of this document and will not be described, however the control
algorithm follows a very similar approach to the already described FOC topology.
Fig. 4.21 shows an example of the currents when the induction motor working as a motor, with a
conventioned negative current on the DC bus showing that it is using power from the battery and that
the phase currents are much more sinusoidal, which reflects the characteristics of the FOC.

Figure 4.21: Three phase current waveforms of the induction machine working as a motor represented
in yellow, blue and purple and DC current in green using FOC.

Fig. 4.22 shows for the first time the motor running successfully as a generator, being able to invert
the normal direction of current in the DC bus and recharging the batteries, which proves the hardware
capabilities for regenerative braking. In this test, the average power being regenerated into the battery
was 264W, and the power delivered to the DC machine was 684W, which gives a total efficiency of
∼39% for the experimental setup.

56
Figure 4.22: Three phase current waveforms of the induction machine working as a generator
represented in yellow, blue and purple and inversion of the DC current in green using FOC.

57
58
Chapter 5

Conclusions

A three phase interter was designed taking into account the possible semiconductor technologies
available and designing the drive circuits for the chosen technology, MOSFET.
The inverter’s PCB was designed in OrCAD Layout 9.2 and printed using an LPKF miller available in
the lab. Surge protection circuits were included as modifications to the original board and were included
in a new schematic done in the more recent and more user friendly CadSoft EAGLE 7.2.0. PCB design
started from scratch due to the program change and is at the time of writing at ∼70 %.
This inverter has the ability of changing the motor’s number of active pole pairs switching the con-
nections of the inverter to the motor with an array of relays.
A rudimentary speed control technique was devised, coupled with configurable set points for voltage
dependent of frequency. This control could not execute regenerative braking, but it was made possible
using FOC.
The experimental apparatus for the testing of the inverter has to be reworked to make the testing of
the inverter in lower speeds possible, namely using a higher power DC machine or a lower value load
resistance.

5.1 Achievements

The most common types of electric motors were discussed in the scope of an electric vehicle, namely
an ultra light solar train, after which the induction motor was chosen.
2 induction motors that were wound in a ∆/Y configuration of 2 pole pairs were rewound offsite for
a Dahlander ∆/YY setting of 2 and 1 switchable active pole pairs. The two motors were put through a
validation process, after which one of them was discarded for poor performance. The other motor was
tested, being found that a slip of 180 RPM corresponded to the point of highest efficiency, giving insight
to what slip the inverter had to maintain.
The range of applicability of different types of semiconductor technology was studied in detail, leading
to MOSFET being implemented in this inverter.
Common isolated transistor drives use DC-DC converters which in this context are a sort of isolated

59
small power supplies that provide independent virtual grounds for the transistors, but tend to be relatively
expensive. An alternative dedicated circuit was developed with discrete components for transistor drive
which works properly and has the potential of becoming cheaper than using DC-DC converters.
Snubber circuits and voltage stabilizers were investigated for surge protections in many parts of the
circuit, being included most of the times after the printing of the PCB, resulting in many improvisations
in the present board and a list of changes for the next iteration.
A prototype of a voltage monitor was designed and tested in a breadboard with a reduced voltage
level of 10-15 V, performing correctly but not being yet included in the present version of the inverter.
A custom-made tachometer was adapted to the motor so that the microcontroller could have velocity
feedback.
A simple control scheme was applied to intuitively use a potentiometer as an accelerator, in a way
that the user requires torque instead of speed.
Many types of look up tables were tested at different frequencies in ∆ configuration of 2 active pole
pairs. The efficiency of the different strategies is represented in Fig. 5.1, together with the data obtained
in Chapter 2 with an auto-transformer.

Figure 5.1: Efficiency of the motor when using the auto-transformer and the inverter with different look
up tables.

While efficiency values of less than 50% are low for an induction motor, the relevant piece of in-
formation is extracted from the comparison between the efficiency when powering the motor using an
auto-transformer and the inverter. The nature of the experimental apparatus limited the experiment to
the highest velocities achievable in ∆ configuration, so that higher power could be dissipated in re-
sistors using a DC machine. From the preliminary results of Fig. 5.1, it can be seen that the inverter
does not perform as well as the auto-transformer at most speeds and with most look up tables, but still

60
presents a viable solution with a maximum efficiency of ∼45% in comparison to 50% achieved with the
auto-transformer.
No regenerative braking was achieved using the initial motor control strategy, however, after imple-
menting Field Oriented Control in the same hardware, it was proven that it was indeed possible with this
hardware.
This work provides the flexibility that no other commercially available inverter allows from an aca-
demic point of view. Since the work performed in the lab included both the microcontroller’s firmware
development and the research, choice and assembly of every part in the circuit of the inverter, any
kind of customization can be possible. The next iteration of this board can certainly be used in aca-
demic lab context to customize different regimes of operation and explain how the inverter itself works
deconstructing its complexity.
Specifically, the interface and customization that is available in the present inverter right from the
serial port interface includes:
•Setup of the Dutycycle percentage ceiling of the look up table in respect to speed (V/f).
•Choose the control strategy, either voltage control with 50Hz fixed frequency, V/f or slip control.
•Start and stop of the power routine.
•Speed of the magnetic field, rotor and slip are printed in the serial port monitor, together with
dutycycle percentage and current in the DC bus.
Using the firmware source code and the adequate programming hardware (PICkit2 or PICkit3 from
Microchip), it is easy to configure at what speeds the commutation between number of active pole pairs
happen, but this can also be upgraded to be configurable using the serial port interface. The slip that
the inverter has to maintain is also hardcoded but can easily be upgraded to be configurable using the
serial port.

5.2 Future Work

Despite the working state of the inverter, a new board has to be designed with the improvised mod-
ifications applied to the original one. These modifications include the snubbers, the LC filter for the
stabilization of the CMOS non-inverting IC and the inclusion of a level shifter IC to avoid the 8.5V mid
range voltage level in the board.
A thorough characterization of the inverter performance is still missing, mainly because so much time
was invested in repairing the inverter and iterating along the necessary modifications in the hardware
and software. Also, since the opposing torque is supplied by a DC machine that dissipates power in
resistors, the opposing torque is proportional to the speed unless the excitation voltage becomes higher
or the load resistance becomes lower. In the tests that were made, both were at the limit that was
available, so the tests were all made at the highest speed that was relevant using 2 active pole pairs,
∼1500 RPM. To test the inverter in lower speeds, the setup has to be changed. The inverter did drive
the motor in YY configuration under no-load, but loaded experiments were not considered until late in
the development phase when the inverter was prepared for those. By this time the experiments had

61
already stopped for the elaboration of this document.
The FOC algorithm that was implemented as a proof of concept by Stefan Schmitt has to be docu-
mented for future uses.
Since voltage and power will rise if this inverter is used in a real life situation, IGBT may be more
adequate that MOSFET, so this offers another degree of freedom and should be investigated.
In a real vehicle the temperature of the motor becomes a concern as does the temperature of the
inverter components, since these parts might not be as well ventilated as in a workbench, nor they have
a pulsed operation for momentary data acquisition and analysis.
In an electric vehicle with more than one motor, an electric differential is paramount to control the
speed of the wheels. Some form of communication between a master controller and the slave inverters
has to be used, RS485 being one of the most common options.

62
Bibliography

[1] X. Xue. Selection of electric motor drives for electric vehicles. In Power Engineering Conference,
2008. AUPEC ’08. Australasian Universities, 2008.

[2] A. Hughes. Electric Motors and Drives - Fundamentals, Types and Applications, chapter 3, page 86.
Elsevier, 2006.

[3] P. Christmann. The demand for rare earth materials in permanent magnets.

[4] T. Hlinovský. Optimal control of mathematical model of the electrovehicle. Master’s thesis, Czech
Technical University in Prague, 2015.

[5] P. Branco. Course notes on accionamentos e veículos elétricos. 2nd Sem. 2014/2015.

[6] Device for varying the number of poles in alternate-current motors. URL https://lens.org/
123-098-303-185-574. obtained 15th January 2016.

[7] IEEE Standard Test Procedure for Polyphase Induction Motors and Generators. IEEE Power Engi-
neering Society, 1996. IEEE Std 112TM -2004.

[8] High voltage thyristors for soft starters. Issue 7 2011 Power Electronics Europe.

[9] C. Blake and C. Bull. IGBT or MOSFET: Choose Wisely. International Rectifier.

[10] B. Schweber. Basics of mosfets and igbts for motor control. Mouser Electronics.

[11] FDA75N28 280V N-Channel MOSFET. Fairchild Semiconductor Corporation, 10 2006.

[12] CD4049UBC CD4050BC Hex Inverting Buffer Hex Non-Inverting Buffer. Fairchild Semiconductor
Corporation, 10 1987. Rev. 4 2002.

[13] PC851 High Collector-emitter Voltage Type Photocoupler. Sharp.

[14] dsPIC30F Family Reference Manual. Microchip Technology Inc., 2006.

[15] MC14001B Series. ON Semiconductor, 2 2005.

[16] BC556; BC557 PNP general purpose transistors. NXP, 10 2004.

[17] DG20 Ultraminiature automotive relays. Durakool.

63
[18] ULN2803A Darlington Transistor Arrays. Texas Instruments, 1 2015.

[19] xx555 Precision Timers. Texas Instruments, 9 1973. Rev. 9 2014.

[20] LM78XX/LM78XXA 3-Terminal 1 A Positive Voltage Regulator. Fairchild Semiconductor Corpora-


tion, 9 2014.

[21] R. Severns. Design of snubbers for power circuits.

[22] LEAD ACID BATTERY working - LIFETIME STUDY. POWERTHRU.

[23] LTS 25-NP Current Transducer. LEM.

[24] C. Blake and C. Bull. Field Orientated Control of 3-Phase AC-Motors. Texas Instruments, 2 1998.
Literature Number: BPRA073.

[25] J. Zambada. Sensorless field oriented (foc) control for ac induction motors, 01 2008. web semminar,
http://www.microchip.com/webinars.microchip.com/WebinarDetails.aspx?dDocName=en532365 ,
obtained 14th February 2016.

[26] dsPIC30F4011 Datasheet. Microchip Technology Inc., 2005.

[27] J. Zambada. GS004 - Driving an ACIM with the dsPIC


R DSC MCPWM Module. Microchip Tech-

nology Inc.

64
Appendix A

Inverter’s PCB

Figure A.1: PCB of the inverter described in this work. Modifications to the circuit are not included, only
one board was assembled and this is the PCB of the original.

65
66
Appendix B

Inverter’s complete schematic

The inverter’s schematic included in this appendix includes the modifications that were made to the
original inverter and upgrades that are suggested that while not changing functionality increase reliability,
like the added level shifter and paralleled CMOS IC output resistors.

Figure B.1: Connections between microcontroller and inverter board are represented in the top left
hand corner with the direct connections to the encoder in the right. The NAND array and level shifter
are represented in the bottom.

67
Figure B.2: The three gate drivers for the transistors in the top half of the inverter’s bridge, with the
power connections of each cd4049 in the top.

68
Figure B.3: Array of gate drivers for the transistors in the bottom half of the inverter’s bridge and current
probe.

69
Figure B.4: 555 timer circuit for voltage level measurement represented in the top, relay array for
dahlander switching in the bottom left and terminal connections to the motor in the bottom right.

70
Appendix C

Bill of materials

Table C.1: Bill of materials a)

Part Value Device Package Description


C1 1u C-EU050-024X044 C050-024X044 "CAPACITOR, European symbol"
C2 1u C-EU050-024X044 C050-024X044 "CAPACITOR, European symbol"
C3 1u C-EU050-024X044 C050-024X044 "CAPACITOR, European symbol"
C4 10n C-EUC0805 C0805 "CAPACITOR, European symbol"
C5 10n C-EUC0805 C0805 "CAPACITOR, European symbol"
C6 10n C-EUC0805 C0805 "CAPACITOR, European symbol"
C7 10n C-EUC0805 C0805 "CAPACITOR, European symbol"
C8 10n C-EUC0805 C0805 "CAPACITOR, European symbol"
C9 10n C-EUC0805 C0805 "CAPACITOR, European symbol"
C10 10n C-EUC0805 C0805 "CAPACITOR, European symbol"
C11 47u C-EU025-024X044 C025-024X044 "CAPACITOR, European symbol"
C12 100n C-EUC0805 C0805 "CAPACITOR, European symbol"
C13 100n C-EUC0805 C0805 "CAPACITOR, European symbol"
C14 100n C-EUC0805 C0805 "CAPACITOR, European symbol"
C15 100n C-EUC0805 C0805 "CAPACITOR, European symbol"
C16 100n C-EUC0805 C0805 "CAPACITOR, European symbol"
C17 100n C-EUC0805 C0805 "CAPACITOR, European symbol"
C18 100n C-EUC0805 C0805 "CAPACITOR, European symbol"
C19 100n C-EUC0805 C0805 "CAPACITOR, European symbol"
D1 1N4148DO35-7 1N4148DO35-7 DO35-7 DIODE
D2 1N4148DO35-7 1N4148DO35-7 DO35-7 DIODE
D3 1N4148DO35-7 1N4148DO35-7 DO35-7 DIODE
D4 1N4148DO35-7 1N4148DO35-7 DO35-7 DIODE
D5 1N4148DO35-7 1N4148DO35-7 DO35-7 DIODE
D6 1N4148DO35-7 1N4148DO35-7 DO35-7 DIODE
D7 1N4148DO35-7 1N4148DO35-7 DO35-7 DIODE
IC5 4011N 4011N DIL14 Quad 2-input NAND
IC6 NE555N NE555N DIL08 TIMER
IC7 7808L 7808L TO92 Positive VOLTAGE REGULATOR
OK1 PC817 PC817 DIL04 SHARP OPTO COUPLER
OK2 PC817 PC817 DIL04 SHARP OPTO COUPLER
OK3 PC817 PC817 DIL04 SHARP OPTO COUPLER
OK4 PC817 PC817 DIL04 SHARP OPTO COUPLER

71
Table C.2: Bill of materials b)

Part Value Device Package Description


Q1 IRFPC40 IRFPC40 TO247BV N-CHANNEL MOS FET
Q2 IRFPC40 IRFPC40 TO247BV N-CHANNEL MOS FET
Q3 IRFPC40 IRFPC40 TO247BV N-CHANNEL MOS FET
Q4 IRFPC40 IRFPC40 TO247BV N-CHANNEL MOS FET
Q5 IRFPC40 IRFPC40 TO247BV N-CHANNEL MOS FET
Q6 IRFPC40 IRFPC40 TO247BV N-CHANNEL MOS FET
Q7 BC557 BC557 TO92 PNP Transistor
Q8 BC557 BC557 TO92 PNP Transistor
Q9 BC557 BC557 TO92 PNP Transistor
R1 200 R-EU_R0805 R0805 "RESISTOR, European symbol"
R2 200 R-EU_R0805 R0805 "RESISTOR, European symbol"
R3 200 R-EU_R0805 R0805 "RESISTOR, European symbol"
R4 500 R-EU_R0805 R0805 "RESISTOR, European symbol"
R5 500 R-EU_R0805 R0805 "RESISTOR, European symbol"
R6 500 R-EU_R0805 R0805 "RESISTOR, European symbol"
R7 200 R-EU_R0805 R0805 "RESISTOR, European symbol"
R8 200 R-EU_R0805 R0805 "RESISTOR, European symbol"
R9 200 R-EU_R0805 R0805 "RESISTOR, European symbol"
R10 200 R-EU_R0805 R0805 "RESISTOR, European symbol"
R11 200 R-EU_R0805 R0805 "RESISTOR, European symbol"
R12 200 R-EU_R0805 R0805 "RESISTOR, European symbol"
R13 22k R-EU_R0805 R0805 "RESISTOR, European symbol"
R14 22k R-EU_R0805 R0805 "RESISTOR, European symbol"
R15 22k R-EU_R0805 R0805 "RESISTOR, European symbol"
R16 50 R-EU_R0805 R0805 "RESISTOR, European symbol"
R17 50 R-EU_R0805 R0805 "RESISTOR, European symbol"
R18 50 R-EU_R0805 R0805 "RESISTOR, European symbol"
R19 50 R-EU_R0805 R0805 "RESISTOR, European symbol"
R20 50 R-EU_R0805 R0805 "RESISTOR, European symbol"
R21 50 R-EU_R0805 R0805 "RESISTOR, European symbol"
R22 50 R-EU_R0805 R0805 "RESISTOR, European symbol"
R23 50 R-EU_R0805 R0805 "RESISTOR, European symbol"
R24 50 R-EU_R0805 R0805 "RESISTOR, European symbol"
R25 50 R-EU_R0805 R0805 "RESISTOR, European symbol"
R26 50 R-EU_R0805 R0805 "RESISTOR, European symbol"
R27 50 R-EU_R0805 R0805 "RESISTOR, European symbol"
R28 680 R-EU_R0805 R0805 "RESISTOR, European symbol"
R29 2k R-EU_R0805 R0805 "RESISTOR, European symbol"
R30 680 R-EU_R0805 R0805 "RESISTOR, European symbol"
R31 2k R-EU_R0805 R0805 "RESISTOR, European symbol"
R32 680 R-EU_R0805 R0805 "RESISTOR, European symbol"
R33 2k R-EU_R0805 R0805 "RESISTOR, European symbol"
R34 750 R-EU_R0805 R0805 "RESISTOR, European symbol"
R35 330 R-EU_R0805 R0805 "RESISTOR, European symbol"
R36 56k R-EU_R0805 R0805 "RESISTOR, European symbol"
R37 4k7 R-EU_R0805 R0805 "RESISTOR, European symbol"
R38 1k6 R-EU_R0805 R0805 "RESISTOR, European symbol"
R39 2k2 R-EU_R0805 R0805 "RESISTOR, European symbol"
R40 220 R-EU_R0805 R0805 "RESISTOR, European symbol"
R41 220 R-EU_R0805 R0805 "RESISTOR, European symbol"
R42 200 R-EU_R0805 R0805 "RESISTOR, European symbol"
TR1 SM-T4 SM-T4 TRANSFORMER

72
Table C.3: Bill of materials c)

Part Value Device Package Description


U$1 RELAY DG20-7011-35-1012 DG20-7011-35-1012
U$2 RELAY DG20-7011-35-1012 DG20-7011-35-1012
U$3 RELAY DG20-7011-35-1012 DG20-7011-35-1012
U$4 RELAY DG20-7011-35-1012 DG20-7011-35-1012
U$5 RELAY DG20-7011-35-1012 DG20-7011-35-1012
U$6 2WAY_6AWG 2WAY_6AWG 2WAY_6AWG
U$7 LTS25-NP LTS25-NP LTS25-NP
U$8 2WAY_6AWG 2WAY_6AWG 2WAY_6AWG
U$9 3PIN_HEADER 3PIN_HEADER 3PIN_HEADER
U$10 IT258 IT258 IT258
U$11 IT258 IT258 IT258
U$12 IT258 IT258 IT258
U$13 CD4050 CD4050 16_PIN_DIP_IC Hex non inverting buffer
U$14 CD4049 CD4049 16_PIN_DIP_IC Hex inverting buffer
U$15 CD4049 CD4049 16_PIN_DIP_IC Hex inverting buffer
U$16 14PIN_HEADER 14PIN_HEADER 14PIN_HEADER
U$17 2WAY_6AWG 2WAY_6AWG 2WAY_6AWG
U$18 2WAY_6AWG 2WAY_6AWG 2WAY_6AWG
U$19 2WAY_6AWG 2WAY_6AWG 2WAY_6AWG
U$20 2WAY_6AWG 2WAY_6AWG 2WAY_6AWG
U$21 2WAY_6AWG 2WAY_6AWG 2WAY_6AWG
U$22 2WAY_6AWG 2WAY_6AWG 2WAY_6AWG
U$23 2WAY_6AWG 2WAY_6AWG 2WAY_6AWG
U$24 CD4049 CD4049 16_PIN_DIP_IC Hex inverting buffer
U1 MC14504BCPG MC14504BCPG DIP254P762X444-16 Hex Level Shifter

73
74
Appendix D

Source code

This appendix includes the most relevant parts of the code to illustrate the logic of the slip control.
The configuration of the peripherals of the microcontroller is obviously important but is not the primary
focus here, thus will not be included.

Listing D.1: Input Capture. Presents a rough filter for the IC and a moveable average using an 8
positions FIFO. In each interrupt the FIFO contents are summed together and shifted right 3 bits, which
is the same as deviding by 8 but the fastest way possible. Finally outputs the speed of the rotor in RPM.

...
unsigned i n t c a p t u r e _ i n d e x = 0 ;
unsigned i n t c a p t u r e _ f i f o [ 8 ] ;
unsigned long i n t c a p t u r e _ c o u n t e r = 65535;
...
void _ _ a t t r i b u t e _ _ ( ( _ _ i n t e r r u p t _ _ , auto_psv ) ) _ I C 8 I n t e r r u p t ( void ) {
/ / LATDbits . LATD3 = 1 ;
TMR3 = 0 ;
_IC8IF = 0 ; / / r e s e t da i n t e r r u p t f l a g do i n p u t c a p t u r e

/ / IC rough f i l t e r . When motor speed i s 5000rpm , 5000/60=83Hz


/ / Encoder has 24 t e e t h , then maximum i n t e r r u p t i o n f r e q u e n c y i s 83∗24=2000Hz
/ / I n c r e m e n t i n g f r e q o f t i m e r 3 i s f c y / p r e s c a l e r = 29491000/64 = 460796Hz
/ / Minimum IC8BUF v a l u e f o r c o r r e c t r e a d i n g i s 460796/2000=230
/ / Only IC8BUF > 200 counts f o r a c q u i s i t i o n , o t h e r w i s e i s i g n o r e d
i f ( IC8BUF > 2 0 0 ) { / / Maximum measurable speed i s 5750RPM
c a p t u r e _ f i f o [ c a p t u r e _ i n d e x ] = IC8BUF ;
i f ( c a p t u r e _ i n d e x == 7 ) c a p t u r e _ i n d e x = 0 ;
else c a p t u r e _ i n d e x ++;
}
c a p t u r e _ c o u n t e r = ( long ) c a p t u r e _ f i f o [ 0 ] + c a p t u r e _ f i f o [ 1 ] + c a p t u r e _ f i f o [ 2 ] + c a p t u r e _ f i f

75
c a p t u r e _ c o u n t e r = c a p t u r e _ c o u n t e r >> 3 ;

RPM_ROTOR = ( long ) 1152000/ c a p t u r e _ c o u n t e r ;

/ / p r i n t f ("%u \ n " , c a p t u r e _ c o u n t e r ) ;
}

Listing D.2: Timer 4 Interrupt. Calculates the speed of the magnetic field based on the motor speed
and some hardcoded rules regarding slip. Can be upgraded substituting "180" by variable to be set
elsewhere, using the serial port. Generator and motor mode shown for two range of values of the
potentiometer.

...
i f ( adc_value0 <512){ / / Generator / Breaking
i f (RPM_ROTOR>180){
RPM_B_buf = RPM_ROTOR−180;
a t t e n _ b u f =(512− adc_value0 ) ∗ 0 . 2 ;
}
else {
RPM_B_buf = 0 ;
a t t e n _ b u f =0;
}
}
else { / / Motor
i f (RPM_ROTOR < 300) RPM_B_buf = 480;
else RPM_B_buf = RPM_ROTOR+180;

/ / p r i n t f ("%d \ n " ,RPM_B ) ;


i f ( RPM_B_buf > 1500) RPM_B_buf = 1500; / / Dahlander o f f l i n e

i f ( motor_pole_mode == 4 ) {
i f ( adc_value0 < 522) a t t e n _ b u f = 0 ;
else i f ( RPM_B_buf <= 300) a t t e n _ b u f = RPM_B_buf∗m0+b0 ;
else a t t e n _ b u f = RPM_B_buf∗m1+b1 ;
}
else i f ( motor_pole_mode == 2 ) a t t e n _ b u f = RPM_B_buf / 3 0 ;

a t t e n _ b u f = ( long ) a t t e n _ b u f ∗ ( adc_value0 −512)∗0.002;


}

76
/ / Finalizacao
i f ( a t t e n _ b u f <= 100) a t t e n = a t t e n _ b u f ∗ 0 . 0 1 ;
else a t t e n = 1 ;

RPM_B = RPM_B_buf ;

...

Listing D.3: MCPWM: Shows the symmetric look up table for 4 kHz switching. Incrementing the position
of the look up table using the increment calculated in D.4 and shifting the results to the right to get the 8
most significant bits. If the dutycycle is too low for PWMxH or PWMxL, that pin is overloaded to LOW.
Only PWM1H and PWM1L shown, since the other 4 pins have the same logic. Potentiometer value is
read each 8th interrupt.

...

i n t s i n u s o i d a l _ a r r a y [ 2 5 6 ] = {0 ,618 ,1235 ,1849 ,2459 ,3064 ,3662 ,4253 ,4834 ,5405 ,


5965 ,6513 ,7047 ,7566 ,8071 ,8559 ,9030 ,9484 ,9920 ,10337 ,10735 ,11113 ,11472 ,11810 ,
12128 ,12427 ,12705 ,12963 ,13201 ,13420 ,13619 ,13800 ,13963 ,14107 ,14235 ,14347 ,
14442 ,14523 ,14590 ,14644 ,14685 ,14715 ,14734 ,14744 ,14746 ,14739 ,14726 ,14708 ,
14684 ,14657 ,14627 ,14595 ,14562 ,14528 ,14494 ,14462 ,14431 ,14402 ,14376 ,14353 ,
14334 ,14319 ,14308 ,14301 ,14299 ,14301 ,14308 ,14319 ,14334 ,14353 ,14376 ,14402 ,
14431 ,14462 ,14494 ,14528 ,14562 ,14595 ,14627 ,14657 ,14684 ,14708 ,14726 ,14739 ,
14746 ,14744 ,14734 ,14715 ,14685 ,14644 ,14590 ,14523 ,14442 ,14347 ,14235 ,14107 ,
13963 ,13800 ,13619 ,13420 ,13201 ,12963 ,12705 ,12427 ,12128 ,11810 ,11472 ,11113 ,
10735 ,10337 ,9920 ,9484 ,9030 ,8559 ,8071 ,7566 ,7047 ,6513 ,5965 ,5405 ,4834 ,4253 ,
3662 ,3064 ,2459 ,1849 ,1235 ,618 ,0 , −618 , −1235 , −1849 , −2459 , −3064 , −3662 , −4253 ,
−4834,−5405,−5965,−6513,−7047,−7566,−8071,−8559,−9030,−9484,−9920,−10337,
−10735,−11113,−11472,−11810,−12128,−12427,−12705,−12963,−13201,−13420,−13619,
−13800,−13963,−14107,−14235,−14347,−14442,−14523,−14590,−14644,−14685,−14715,
−14734,−14744,−14746,−14739,−14726,−14708,−14684,−14657,−14627,−14595,−14562,
−14528,−14494,−14462,−14431,−14402,−14376,−14353,−14334,−14319,−14308,−14301,
−14299,−14301,−14308,−14319,−14334,−14353,−14376,−14402,−14431,−14462,−14494,
−14528,−14562,−14595,−14627,−14657,−14684,−14708,−14726,−14739,−14746,−14744,
−14734,−14715,−14685,−14644,−14590,−14523,−14442,−14347,−14235,−14107,−13963,
−13800,−13619,−13420,−13201,−12963,−12705,−12427,−12128,−11810,−11472,−11113,
−10735,−10337,−9920,−9484,−9030,−8559,−8071,−7566,−7047,−6513,−5965,−5405,
−4834,−4253,−3662,−3064,−2459,−1849,−1235,−618};

...

77
unsigned i n t s i n e _ p o i n t e r A = 0 ;
unsigned i n t s i n e _ p o i n t e r B = 85 << 8 ;
unsigned i n t s i n e _ p o i n t e r C = 170 << 8 ;

void _ _ a t t r i b u t e _ _ ( ( _ _ i n t e r r u p t _ _ , auto_psv ) ) _PWMInterrupt ( void )


{
_PWMIF = 0 ;
unsigned i n t p o i n t e r _ b u f f e r ;
i n t PDC_buffer ;

/ / i f ( a t t e n >0) p r i n t f ("%d \ n " ,RPM_B ) ;


i n t D e l t a = change_speed (RPM_B ) ;

s i n e _ p o i n t e r A += D e l t a ;
s i n e _ p o i n t e r B += D e l t a ;
s i n e _ p o i n t e r C += D e l t a ;

/ / ∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗//
/ / ∗∗∗ S t a r t o f C u r r e n t L i m i t i n g Algorythm ∗ ∗ ∗ / /
/ / ∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗//

adc_value1 = read_adc ( 1 ) ;
c u r r e n t = adc_value1 ∗1.955 −1000; / / hundreds o f miliamps
i f ( c u r r e n t >max_current ) {
a t t e n = a t t e n ∗(1 −( c u r r e n t −max_current ) / max_current ) ;
}
i f ( atten < 0) atten = 0;

/ / Summary : I f t h e c u r r e n t i s 25% h i g h e r than t h e maximum s e t value , then


/ / a t t e n w i l l have a 25% decrease

/ / ∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗//
/ / ∗∗∗End o f C u r r e n t L i m i t i n g Algorythm ∗ ∗ ∗ / /
/ / ∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗//

p o i n t e r _ b u f f e r = s i n e _ p o i n t e r A >> 8 ;

PDC_buffer = ( f l o a t ) s i n u s o i d a l _ a r r a y [ p o i n t e r _ b u f f e r ] ∗ a t t e n ;

78
i f ( PDC_buffer > 1 7 7 0 ) {
OVDCONbits . POUT1L = 0 ;
OVDCONbits . POVD1L = 0 ; / / O v e r r i d e s PWM1L w i t h POUT1L
PDC1 = PDC_buffer ;
OVDCONbits .POVD1H = 1 ; / /PWM1H commanded w i t h PDC
}
else i f ( PDC_buffer < −148){
OVDCONbits .POUT1H = 0 ;
OVDCONbits .POVD1H = 0 ; / / O v e r r i d e s PWM1H w i t h POUT1H
PDC1 = 14746+ PDC_buffer ;
OVDCONbits . POVD1L = 1 ; / / PWM1L commanded w i t h PDC
}
else {
OVDCONbits . POUT1L = 0 ;
OVDCONbits . POVD1L = 0 ; / / O v e r r i d e s PWM1L w i t h POUT1L
OVDCONbits .POUT1H = 0 ;
OVDCONbits .POVD1H = 0 ; / / O v e r r i d e s PWM1H w i t h POUT1H
}

p o i n t e r _ b u f f e r = s i n e _ p o i n t e r B >> 8 ;
...
p o i n t e r _ b u f f e r = s i n e _ p o i n t e r C >> 8 ;
...
i f ( mcpwm_interrupt_counter == 0 ) { / / User i n p u t
adc_value0 = read_adc ( 0 ) ; / / processed i n t i m e r 4 i n t e r r u p t i o n
}

i f ( mcpwm_interrupt_counter == 8 ) {
mcpwm_interrupt_counter =0;
}
else mcpwm_interrupt_counter ++;
}

Listing D.4: Obtaining the increment to the look up table’s position counters and changing the number
of active poles based on the motor’s RPM.

...

i n t change_speed ( i n t rpm ) {
i f ( motor_pole_mode == 4 ) {

79
i f ( rpm >= 0 && rpm <= 1550) r e t u r n rpm ∗0.546133;
else i f ( rpm > 1 5 5 0 ) {
PTCONbits . PTEN = 0 ;
delay_ms ( 1 0 ) ;
change_pole_number ( 2 ) ;
delay_ms ( 1 0 ) ;
PTCONbits . PTEN = 1 ;
/ / r e t u r n rpm ∗0.136533;
r e t u r n rpm ∗0.273067;
}
else r e t u r n 0 ;
}
else i f ( motor_pole_mode == 2 ) {
i f ( rpm >= 1450) r e t u r n rpm ∗0.273067;
else {
PTCONbits . PTEN = 0 ;
delay_ms ( 1 0 ) ;
change_pole_number ( 4 ) ;
delay_ms ( 1 0 ) ;
PTCONbits . PTEN = 1 ;
r e t u r n rpm ∗0.546133;
}
else r e t u r n 0 ;
}
else r e t u r n 0 ;
}

void change_pole_number ( i n t pole_number ) {


switch ( pole_number ) {
case 4 :
LATDbits . LATD0=0; / / C o n t r o l s OPEN3
motor_pole_mode = 4 ;
break ;
case 2 :
LATDbits . LATD0=1; / / C o n t r o l s OPEN3
motor_pole_mode = 2 ;
break ;
default :
break ;

80
}
}

81
82

Você também pode gostar