You are on page 1of 198

UPC

UNIVERSITAT POLITÈCNICA DE CATALUNYA
DEPARTAMENT D’ENGINYERIA ELECTRÒNICA
IMPROVEMENTS IN DIRECT TORQUE CONTROL
OF INDUCTION MOTORS
Tesi doctoral presentada per a
l’obtenció del títol de doctor
Antoni Arias Pujol
Director: José Luis Romeral Martinez
Terrassa, Novembre 2000
IN.1
INDEX.
Abstract AB.1
Index IN.1
Acknowledgements AC.1
Symbols S.1
Introduction
I.1 - Historical review I.1
I.2 - Structure of the thesis I.6
I.3 - Aims of the thesis I.8
Chapter 1 - Induction Motor Model. Generalities.
1.1 - Equations of the induction motor model 1.1
1.1.1 - Introduction 1.1
1.1.2 - Voltage equations 1.2
1.1.3 - Applying Park's transform 1.4
1.1.4 - Voltage matrix equations 1.5
1.1.4.1 - Fixed to the stator 1.5
1.1.4.2 - Fixed to the rotor 1.5
1.1.4.3 - Fixed to the synchronism 1.5
1.2 - Space phasor notation 1.6
1.2.1 - Introduction 1.6
1.2.2 - Current space phasors 1.7
1.2.3 - Flux linkage space phasor 1.9
1.2.3.1 - Stator flux-linkage space phasor in the stationary reference frame
fixed to the stator 1.9
1.2.3.2 - Rotor flux-linkage space phasor in the rotating reference frame
fixed to the rotor 1.10
1.2.3.3 - Rotor flux-linkage space phasor in the stationary reference frame
fixed to the stator 1.11
1.2.3.4 - Stator flux-linkage space phasor in the rotating reference frame
fixed to the rotor 1.12
1.2.4 - The space phasors of stator and rotor voltages 1.12
1.2.5 - Space-phasor form of the motor equations 1.13
1.2.5.1 - Space-phasor voltage equations in the general reference frame 1.13
1.2.5.2 - Space-phasor voltage equations in the stationary reference frame
fixed to the stator 1.14
1.2.5.3 - Space-phasor voltage equations in the rotating reference frame
fixed to the rotor 1.15
1.2.5.4 - Space-phasor voltage equations in the rotating reference frame at
synchronous speed 1.15
1.3 - Torque expressions 1.17
Index.
IN.2
1.3.1 - Introduction 1.17
1.3.2 - Deduction of the torque expression by means of energy considerations 1.17
1.3.3 - Torque constant 1.18
1.4 - Simulink model 1.19
1.4.1 - Equations used in the model 1.19
1.4.1.1 - Stator reference 1.19
1.4.1.2 - Rotor reference 1.19
1.4.1.3 - Synchronous reference 1.20
1.4.1.4 - Motion equation 1.20
1.4.2 - Simulated results 1.21
1.5 - Steady state analysis 1.23
1.5.1 - Steady state conditions 1.23
1.5.2 - Steady state equations 1.23
1.5.3 - Steady state equivalent circuit 1.24
1.6 - Interim conclusions 1.25
Chapter 2 - Direct Torque Control. Principles and Generalities.
2.1 - Induction motor controllers 2.1
2.1.1 - Voltage/frequency 2.1
2.1.2 - Vector controls 2.2
2.1.3 - Field Acceleration method 2.2
2.1.4 - Direct Torque Control 2.2
2.2 - Principles of Direct Torque Control 2.4
2.2.1 - Introduction 2.4
2.2.2 - DTC Controller 2.4
2.2.3 - DTC Schematic 2.7
2.2.3.1 - Stator flux and torque estimator using w
m
, i
sA
and i
sB
magnitudes 2.8
2.2.3.2 - Stator flux and torque estimator using V
dc
, i
sA
and i
sB
magnitudes 2.9
2.2.4 - Parameter detuning effects 2.10
2.3 - Improvements in Direct Torque Control 2.11
2.3.1 - Introduction 2.11
2.3.2 - Different tables 2.11
2.3.2.1 - First approach 2.11
2.3.2.1.1 - Six sector table but different zones 2.11
2.3.2.1.2 - Twelve sector table 2.13
2.3.2.1.3 - Simulations, results and conclusions 2.15
2.3.2.2 - Second approach 2.18
2.3.2.3 - Third approach 2.19
2.3.2.4 - Conclusions 2.20
2.3.3 - Predictive methods 2.21
2.3.4 - Fuzzy logic based systems 2.22
2.3.5 - Regulating the flux 2.23
2.4 - Interim conclusions 2.25
Index.
IN.3
Chapter 3 - Fuzzy Logic Direct Torque Control.
3.1 - Introduction 3.1
3.2 - Fuzzy Logic Direct Torque Control 3.3
3.2.1 - Fuzzy Logic controller 1 3.3
3.2.1.1 - Objectives 3.3
3.2.1.2 - Inputs and output membership functions. 3.3
3.2.1.3 - Rules 3.5
3.2.2 - Fuzzy Logic controller 2 3.6
3.2.2.1 - Objectives 3.6
3.2.2.2 - Inputs and output membership functions. 3.6
3.2.2.3 - Rules 3.7
3.2.3 - Fuzzy Logic DTC schema 3.8
3.2.4 - Stator Flux Reference Optimum Controller 3.9
3.3 - Simulated results 3.10
3.4 - Interim conclusions 3.15
Chapter 4 - Design of Experimental Induction Motor Drive System.
4.1 - Introduction 4.1
4.2 - Induction motor drive architecture 4.3
4.3 - Implementing DTC and FLDTC 4.8
4.3.1 - Task distribution 4.8
4.3.2 - Programming the system 4.8
4.3.3 - Timing of the real implementation 4.9
4.4 - Simulation of the real plant 4.11
4.5 - Interim conclusions 4.14
Chapter 5 - Experimental Results.
5.1 - Corroborating the real implementation 5.1
5.1.1 - Classical DTC 5.1
5.1.2 - Fuzzy Logic DTC 5.8
5.2 - FLDTC and DTC comparison 5.10
5.3 - Interim conclusions 5.16
Chapter 6 - Conclusions. Further work.
6.1 - Conclusions 6.1
6.1.1 - Direct Torque Control 6.1
6.1.2 - Fuzzy Logic Direct Torque Control 6.2
6.1.3 - Experimental motor drive system 6.3
6.1.4 - Real implementation 6.4
6.2 - Further work 6.5
Index.
IN.4
References. R.1
Appendixes.
A.1 - Programs A.1
A.1.1 - TH1_5c.c A.2
A.1.2 - PCTH1_5c.c A.22
A.1.3 - TH1_9.c A.29
A.1.4 - PCTH1_9.c A.55
A.2 - Fuzzy rules A.65
A.2.1 - FLC 1 A.65
A.2.1.1 - Flux increase, Wpc < Tpc A.66
A.2.1.2 - Flux increase, Wpc > Tpc A.67
A.2.1.3 - Flux decrease, Wpc < Tpc A.68
A.2.1.4 - Flux decrease, Wpc > Tpc A.69
A.2.2 - FLC 2 A.70
A.3 - Experimental motor drive pictures A.71
A.3.1 - Workbench. Induction motor_1.5kW. DC motor A.71
A.3.2 - Resistors A.73
A.3.3 - Voltage Source Inverter A.75
A.3.4 - Workstation A.75
AC.1
ACKNOWLEDGEMENTS.
I am most grateful to my Director of Studies Dr. José Luis Romeral for his continuous help,
guidance, support and advice throughout the period of research to which this thesis relates.
I also like to thank Dr. Marcel Jayne for his support and advice especially during my stay in
the University of Glamorgan, and also for initiating and maintaining the collaboration
between the University of Glamorgan and the "Universitat Politècnica de Catalunya".
I would also like to acknowledge "Departament d'Enginyeria Electrònica" staff for providing
enjoyable and educational atmosphere.
Also, I would like to thank the economic support received from the "Comisión
Interministerial de Ciencia y Tecnología de España", CICYT, for realising this work, under
the TIC98-1092 Project.
Last but not least, I like to thank my parents and my sister for their patience and support.
Also, I like to thank Anna for her encouragement and comprehension especially during my
stay in the University of Glamorgan.
S.1
SYMBOLS.
a 120º operator.
i
ri
(t) Rotor current per phase.
r i
Space phasor of the rotor current expressed in the rotor reference frame.
'
r i
Space phasor of the rotor current expressed in the stator reference frame.
i
si
(t) Stator current per phase.
s i
Space phasor of the stator current expressed in the stator reference frame.
'
s i
Space phasor of the stator current expressed in the rotor reference frame.
L
m
Three phase magnetising inductance.
L
r
Total three phase rotor inductance.
r L
Rotor self-inductance.
L
r1
Leakage rotor inductance.
L
rm
Rotor magnetising inductance.
L
s
Total three phase stator inductance.
s L
Stator self-inductance.
L
sm
Stator magnetising inductance.
L
s1
Leakage stator inductance.
r M
Mutual inductance between rotor windings.
s M
Mutual inductance between stator windings.
sr M
Maximal value of the stator- rotor mutual inductance.
p Derivation operator.
P Pair of poles.
R
r
Rotor Resistance.
R
s
Stator Resistance.
s Slip.
1/s Integration operator.
Te Instantaneous value of the electromagnetic torque.
T
pc
Instant torque referred to the nominal torque and in percentage.
Ts = Tz Sampling time.
u
ri
(t) Rotor voltage per phase.
r u
Space phasor of the rotor voltage expressed in the rotor reference frame.
'
r u
Space phasor of the rotor voltage expressed in the stator reference frame.
u
si
(t) Stator voltage per phase.
s u
Space phasor of the stator voltage expressed in the stator reference frame.
'
s u
Space phasor of the stator voltage expressed in the rotor reference frame.
wm Mechanical speed.
w
pc
Instant torque referred to the nominal torque and in percentage.
wr Rotor pulsation.
ws Stator pulsation.
Symbols.
S.2
ρr Phase angle of the rotor flux linkage space phasor with respect to the direct-axis
of the stator reference frame.
ρs Phase angle of the stator flux linkage space phasor with respect to the direct-axis
of the stator reference frame.
θm
Stator to rotor angle.
θr Rotor angle.
θs Stator angle.
Ψ
ri
(t) Flux linkage per rotor winding.
r
ψ
Space phasor of the rotor flux linkage expressed in the rotor reference frame.
'
r
ψ
Space phasor of the rotor flux linkage expressed in the stator reference frame.
Ψ
si
(t) Flux linkage per stator winding.
s
ψ
Space phasor of the stator flux linkage expressed in the stator reference frame.
'
s
ψ
Space phasor of the stator flux linkage expressed in the rotor reference frame.
Subscripts.
α/β Direct- and quadrature-axis components in the rotor reference frame.
d/q Rotor direct- and quadrature-axis components in the stator reference frame.
D/Q Stator direct and quadrature-axis components in the stator reference frame.
g General reference frame.
m Magnetizing.
r Rotor.
ra, rb, rc Rotor phases.
Ref Reference.
s Stator.
sA, sB, sC Stator phases.
x/y Direct- and quadrature-axis components in general reference frame or in
special reference frames.
Mathematical symbols.
x Cross vector product.
* Complex conjugate.
I.1
INTRODUCTION.
I.1 - Historical review.
The history of electrical motors goes back as far as 1820, when Hans Christian Oersted
discovered the magnetic effect of an electric current. One year later, Michael Faraday
discovered the electromagnetic rotation and built the first primitive D.C. motor. Faraday went
on to discover electromagnetic induction in 1831, but it was not until 1883 that Tesla invented
the A.C asynchronous motor [MAR 1].
Currently, the main types of electric motors are still the same, DC, AC asynchronous and
synchronous, all based on Oersted, Faraday and Tesla's theories developed and discovered
more than a hundred years ago.
Introduction.
I.2
Since its invention, the AC asynchronous motor, also named induction motor, has become the
most widespread electrical motor in use today.
At present, 67% of all the electrical energy generated in the UK is converted to
mechanical energy for utilisation. In Europe the electrical drives business is worth
approximately $1.0 Billion/ Annum.
These facts are due to the induction motors advantages over the rest of motors. The main
advantage is that induction motors do not require an electrical connection between stationary
and rotating parts of the motor. Therefore, they do not need any mechanical commutator
(brushes), leading to the fact that they are maintenance free motors. Induction motors also
have low weight and inertia, high efficiency and a high overload capability. Therefore, they
are cheaper and more robust, and less prove to any failure at high speeds. Furthermore, the
motor can work in explosive environments because no sparks are produced.
Taking into account all the advantages outlined above, induction motors must be considered
the perfect electrical to mechanical energy converter. However, mechanical energy is more
than often required at variable speeds, where the speed control system is not a trivial matter.
The only effective way of producing an infinitely variable induction motor speed drive is to
supply the induction motor with three phase voltages of variable frequency and variable
amplitude. A variable frequency is required because the rotor speed depends on the speed of
the rotating magnetic field provided by the stator. A variable voltage is required because the
motor impedance reduces at low frequencies and consequently the current has to be limited by
means of reducing the supply voltages [VAS 1] [MOH 1].
Before the days of power electronics, a limited speed control of induction motor was achieved
by switching the three-stator windings from delta connection to star connection, allowing the
voltage at the motor windings to be reduced. Induction motors are also available with more
than three stator windings to allow a change of the number of pole pairs. However, a motor
with several windings is more expensive because more than three connections to the motor
are needed and only certain discrete speeds are available. Another alternative method of speed
control can be realised by means of a wound rotor induction motor, where the rotor winding
ends are brought out to slip rings. However, this method obviously removes most of the
Introduction.
I.3
advantages of induction motors and it also introduces additional losses. By connecting
resistors or reactances in series with the stator windings of the induction motors, poor
performance is achieved.
At that time the above described methods were the only ones available to control the speed of
induction motors, whereas infinitely variable speed drives with good performances for DC
motors already existed. These drives not only permitted the operation in four quadrants but
also covered a wide power range. Moreover, they had a good efficiency, and with a suitable
control even a good dynamic response. However, its main drawback was the compulsory
requirement of brushes [MAR 1] [MOH 1].
With the enormous advances made in semiconductor technology during the last 20 years, the
required conditions for developing a proper induction motor drive are present. These
conditions can be divided mainly in two groups:
§ The decreasing cost and improved performance in power electronic switching devices.
§ The possibility of implementing complex algorithms in the new microprocessors.
However, one precondition had to be made, which was the development of suitable methods
to control the speed of induction motors, because in contrast to its mechanical simplicity their
complexity regarding their mathematical structure (multivariable and non-linear) is not a
trivial matter.
It is in this field, that considerable research effort is devoted. The aim being to find even
simpler methods of speed control for induction machines. One method, which is popular at
the moment, is Direct Torque Control [VAS 2].
Historically, several general controllers has been developed:
§ Scalar controllers: Despite the fact that "Voltage-Frequency" (V/f) is the simplest
controller, it is the most widespread, being in the majority of the industrial applications. It
is known as a scalar control and acts by imposing a constant relation between voltage and
frequency. The structure is very simple and it is normally used without speed feedback.
However, this controller doesn’t achieve a good accuracy in both speed and torque
Introduction.
I.4
responses, mainly due to the fact that the stator flux and the torque are not directly
controlled. Even though, as long as the parameters are identified, the accuracy in the speed
can be 2% (except in a very low speed), and the dynamic response can be approximately
around 50ms [LEO 1] [LUD 2].
§ Vector Controllers: In these types of controllers, there are control loops for
controlling both the torque and the flux [BOS 1]. The most widespread controllers
of this type are the ones that use vector transform such as either Park or Ku. Its
accuracy can reach values such as 0.5% regarding the speed and 2% regarding the
torque, even when at stand still. The main disadvantages are the huge
computational capability required and the compulsory good identification of the
motor parameters [ROM 1] .
§ Field Acceleration method: This method is based on maintaining the amplitude
and the phase of the stator current constant, whilst avoiding electromagnetic
transients. Therefore, the equations used can be simplified saving the vector
transformation, which occurs in vector controllers. This technique has achieved
some computational reduction, thus overcoming the main problem with vector
controllers and allowing this method to become an important alternative to vector
controllers [BED 5] [ROM 1] [YAM 1].
Direct Torque Control (DTC) has emerged over the last decade to become one possible
alternative to the well-known Vector Control of Induction Machines. Its main characteristic is
the good performance, obtaining results as good as the classical vector control but with
several advantages based on its simpler structure and control diagram.
DTC is said to be one of the future ways of controlling the induction machine in four
quadrants [LUD 1] [VAS 2]. In DTC it is possible to control directly the stator flux and the
torque by selecting the appropriate inverter state. This method still requires further
research in order to improve the motor’s performance, as well as achieve a better
behaviour regarding environmental compatibility (Electro Magnetic Interference and
energy), that is desired nowadays for all industrial applications.
Introduction.
I.5
DTC main features are as follows:
§ Direct control of flux and torque.
§ Indirect control of stator currents and voltages.
§ Approximately sinusoidal stator fluxes and stator currents.
§ High dynamic performance even at stand still.
The main advantages of DTC are:
§ Absence of co-ordinate transform.
§ Absence of voltage modulator block, as well as other controllers such as PID for
motor flux and torque.
§ Minimal torque response time, even better than the vector controllers.
However, some disadvantages are also present such as:
§ Possible problems during starting.
§ Requirement of torque and flux estimators, implying the consequent parameters
identification.
§ Inherent torque and stator flux ripple.
Introduction.
I.6
I.2 - Structure of the thesis.
The work presented in this thesis is organised in six main chapters. Theses six chapters are
structured as follows.
Chapter 1 is entitled " Induction Motor Model. Generalities.". It introduces a mathematical
model of cage rotor induction motors. Different ways of implementing these models are
presented as well as some simulations corroborating its validity. It must be said that all
simulations are obtained from MATLAB/Simulink. The elements of space phasor notation are
also introduced and used to develop a compact notation.
Chapter 2 is entitled " Direct Torque Control. Principles and Generalities.". It is devoted to
introduce different Direct Torque Control (DTC) strategies. However, firstly it is summarised
different induction motor controllers, such as the very well known vector control and "V/f".
Once DTC is placed in this general classification, it is fully and deeply described. Finally,
different methods for improving the main DTC drawbacks are introduced and studied. These
methods are classified as follows:
§ Different look up tables.
§ Predictive methods.
§ Fuzzy logic based systems.
Moreover, a method for regulating the stator flux to its optimum value it is presented.
Chapter 3 is entitled " Fuzzy Direct Torque Control". It covers a full and deep description of a
Fuzzy Logic Direct Torque Controller (FLDTC) which improves its performance. At the end
of the chapter simulated results are presented, which compare the classical DTC with FLDTC.
Chapter 4 is entitled " Design of Experimental Induction Motor Drive System". This chapter
describes the designed workbench drive. Real simulations of DTC and FLDTC are presented
taking into account all the non ideal behaviour and delays of the real drive. A way to
overcome the mentioned limitations is presented.
Introduction.
I.7
Chapter 5 is named " Experimental Results". This chapter is focused on the real
implementation of the classical DTC and FLDTC. Experimental results corroborate the
correct behaviour of both controllers. An experimental comparison between both controllers
is shown. Obviously, all experimental results obtained are from the workbench described in
chapter 4.
In Chapter 6, entitled "Conclusions", all achievements are summarised and appropriate
conclusions are drawn.
Finally, all PC/DSP programs used in the real implementation are listed in the appendixes.
Rules used in the Fuzzy Controllers are also listed. Also, some pictures of the workbench are
shown in the appendixes.
Introduction.
I.8
I.3 - Aims of the thesis.
The present thesis deals with the development of a Fuzzy Logic Direct Torque Controller that
has improved performance compared to the classical DTC system. The main improvement
has been the torque ripple reduction. Also, a stator flux optimum controller allows the FLDTC
to consume the right energy from the mains, keeping the power consumption to a minimum,
when again compared to the classical DTC system.
This new FLDTC system is firstly designed and proved by means of simulations. Later in the
thesis, experimental implementation is discussed and the results are presented.
Therefore, the development of this novel induction motor controller can be separated into the
following steps:
§ Point out the DTC disadvantages. Study the possible ways to overcome them, choosing
the best one (Fuzzy Logic).
§ Develop and mathematically describe the chosen Fuzzy Logic system. Corroboration of
its proper performance by means of simulation.
§ Development of a suitable "research workbench drive". Implementation of the FLDTC to
prove its proper functionality.
1.1
CHAPTER 1.
INDUCTION MOTOR MODEL. GENERALITIES.
1.1 - Equations of the induction motor model.
1.1.1 – Introduction.
A dynamic model of the machine subjected to control must be known in order to understand
and design vector controlled drives. Due to the fact that every good control has to face any
possible change of the plant, it could be said that the dynamic model of the machine could be
just a good approximation of the real plant. Nevertheless, the model should incorporate all the
important dynamic effects occurring during both steady-state and transient operations.
Furthermore, it should be valid for any changes in the inverter’s supply such as voltages or
currents [ROM 1].
Such a model can be obtained by means of either the space vector phasor theory or two-axis
theory of electrical machines. Despite the compactness and the simplicity of the space phasor
theory, both methods are actually close and both methods will be explained.
Induction motor model. Generalities.
1.2
For simplicity, the induction motor considered will have the following assumptions:
§ Symmetrical two-pole, three phases windings.
§ The slotting effects are neglected.
§ The permeability of the iron parts is infinite.
§ The flux density is radial in the air gap.
§ Iron losses are neglected.
§ The stator and the rotor windings are simplified as a single, multi-turn full pitch coil
situated on the two sides of the air gap.
Figure 1.1. Cross-section of an elementary symmetrical three-phase machine.
1.1.2 – Voltage equations.
The stator voltages will be formulated in this section from the motor natural frame, which is
the stationary reference frame fixed to the stator. In a similar way, the rotor voltages will be
formulated to the rotating frame fixed to the rotor.
In the stationary reference frame, the equations can be expressed as follows:
dt
(t) d
+ (t) i R = (t) u
sA
sA s sA
ψ (1.1)
dt
(t) d
+ (t) i R = (t) u
sB
sB s sB
ψ (1.2)
dt
(t) d
+ (t) i R = (t) u
sC
sC s sC
ψ (1.3)
sA'
ra'
rb
rc'
ra
rc
rb'
sC
sC'
sB
sB'
sA
Induction motor model. Generalities.
1.3
Similar expressions can be obtained for the rotor:
dt
(t) d
+ (t) i R = (t) u
ra
ra r ra
ψ (1.4)
dt
(t) d
+ (t) i R = (t) u
rb
rb r rb
ψ (1.5)
dt
(t) d
+ (t) i R = (t) u
rc
rc r rc
ψ (1.6)
The instantaneous stator flux linkage values per phase can be expressed as:
rc 3
4
m
sr
rb 3
2
m
sr
ra m
sr
sC
s
sB
s
sA
s
sA
)i + cos( M + )i + cos( M i cos M i M + i M + i L
π π
θ θ + θ + · ψ
(1.7)
rc 3
2
m
sr
rb m
sr
ra 3
4
m
sr
sC
s
sB
s
sA
s
sB
)i + cos( M + i cos M )i + cos( M i M + i L + i M
π π
θ θ + θ + · ψ
(1.8)
rc m
sr
rb 3
4
m
sr
ra 3
2
m
sr
sC
s
sB
s
sA
s
sC
i cos M + )i + cos( M )i + cos( M + i L i M + i M θ θ + θ + · ψ
π π (1.9)
In a similar way, the rotor flux linkages can be expressed as follows:
( ) ( ) ( )
rc
r
rb
r
ra
r
sC 3
4
m
sr
sB 3
2
m
sr
sA m
sr
ra
i M + i M i L i + - cos M + i + - cos M + i - cos M + + θ θ θ · ψ
π π (1.10)
( ) ( ) ( )
rc
r
rb
r
ra
r
sC 3
2
m
sr
sB m
sr
sA 3
4
m
sr
b r
i M + i L i M i - cos M + i - cos M + i - cos M + + + θ θ + θ · ψ
π π (1.11)
( ) ( ) ( )
rc
r
rb
r
ra
r
sC m
sr
sB 3
4
m
sr
sA 3
2
m
sr
rc
i M + i L i M i - cos M + i cos M + i - cos M + + θ + θ − + θ · ψ
π π
(1.12)
Taking into account all the previous equations, and using the matrix notation in order to
compact all the expressions, the following expression is obtained:
]
]
]
]
]
]
]
]
]
]


]
]
]
]
]
]
]
]
]
]

+ θ θ θ
+ θ θ θ
+ θ θ θ
θ θ θ +
θ θ θ +
θ θ θ +
·
]
]
]
]
]
]
]
]
]
]

rc
rb
ra
sC
sB
sA
r
r
r r
m
sr
m2
sr
m1
sr
r r
r
r
m1
sr
m
sr
m2
sr
r r r
r m2
sr
m1
sr
m
sr
m
sr
m2
sr
m1
sr s
s
s s
m1
sr
m
sr
m2
sr s s
s
s
m2
sr
m1
sr
m
sr s s s
s
rc
rb
ra
sC
sB
sA
i
i
i
i
i
i
L p R M p M p cos M p cos M p cos M p
M p L p R M p cos M p cos M p cos M p
M p M p L p R cos M p cos M p cos M p
cos M p cos M p cos M p L p R M p M p
cos M p cos M p cos M p M p L p R M p
cos M p cos M p cos M p M p M p L p R
u
u
u
u
u
u
(1.13)
Induction motor model. Generalities.
1.4
1.1.3 – Applying Park’s transform.
In order to reduce the expressions of the induction motor equation voltages given in equation
1.1 to equation 1.6 and obtain constant coefficients in the differential equations, the Park’s
transform will be applied. Physically, it can be understood as transforming the three windings
of the induction motor to just two windings, as it is shown in figure 1.2 [VAS 1].
Figure 1.2 Schema of the equivalence physics transformation.
In the symmetrical three-phase machine, the direct- and the quadrature-axis stator magnitudes
are fictitious. The equivalencies for these direct (D) and quadrature (Q) magnitudes with the
magnitudes per phase are as follows:
( ) ( )
( ) ( )

u
u
u
sin sin sin
cos cos cos c
u
u
u
sC
sB
sA
3
2
3
2
3
2
3
2
2
1
2
1
2
1
sQ
sD
0 s
]
]
]
]
]


]
]
]
]
]

+ θ − − θ − θ −
+ θ − θ θ ⋅ ·
]
]
]
]
]

π π
π π
(1.14)
( ) ( )
( ) ( )
]
]
]
]
]


]
]
]
]
]

+ θ − + θ
− θ − − θ
θ − θ
⋅ ·
]
]
]
]
]

π π
π π
sQ
sD
0 s
3
2
3
2
2
1
3
2
3
2
2
1
2
1
sC
sB
sA
u
u
u
sin cos
sin cos
sin cos
c
u
u
u
(1.15)
Where "c" is a constant that can take either the values 2/3 or 1 for the so-called non-power
invariant form or the value
2
3
for the power-invariant form as it is explained in section
1.3.3. These previous equations can be applied as well for any other magnitudes such as
currents and fluxes.
Notice how the expression 1.13 can be simplified into a much smaller expression in 1.16 by
means of applying the mentioned Park's transform.
sA
sC
sB
ra
rb
rc
Wm
sD
sQ


Wm
Induction motor model. Generalities.
1.5
( )
( )
( )
( )
u
u
u
u
R pL - L p pL - L P w + p
L p R pL L P w + p pL
pL - L p - P w R pL - L p
L p - P w pL L p R pL
i
i
i
i
sD
sQ
r
r
s s s m m m r
s s s m m r m
m m s m r r r
m s m m r r r
sD
sQ
r
r
α
β
α
β
θ θ
θ θ
θ θ
θ θ

]
]
]
]
]
]
]
·
+ ⋅
+ ⋅
⋅ +
⋅ +

]
]
]
]
]
]
]

]
]
]
s
s
r
r
]
]
]
]
(1.16)
Where L L M
s
s s
· − , L L M
r
r r
· − and L M
m
sr
·
3
2
.
1.1.4 – Voltage matrix equations.
If the matrix expression 1.16 is simplified, new matrixes are obtained as shown in equations
1.17, 1.18 and 1.19 [VAS 1].
1.1.4.1 – Fixed to the stator.
It means that ws = 0 and consequently wr = -wm.
u
u
u
u
R pL 0 pL
0 R pL pL
pL P w L R pL P w L
- P w L pL - P w L R pL
i
i
i
i
sD
sQ
rd
rq
s s m
s s m
m m m r r m r
m m m m r r r
sD
sQ
rd
rq

]
]
]
]
]
]
]
·
+
+
⋅ + ⋅
⋅ ⋅ +

]
]
]
]
]
]

]
]
]
]
]
]
]
0
0
(1.17)
1.1.4.2 – Fixed to the rotor.
It means that wr = 0 and consequently ws = wm.
u
u
u
u
R pL - L P w pL L P w
L P w R pL L P w pL
pL R pL
pL R pL
i
i
i
i
sD
sQ
rd
rq
s s s m m m m
s m s s m m m
m r r
m r r
sD
sQ
rd
rq

]
]
]
]
]
]
]
·
+ −
+
+
+

]
]
]
]
]
]

]
]
]
]
]
]
]
0 0
0 0
(1.18)
1.1.4.3 – Fixed to the synchronism.
It means that wr = sws.
u
u
u
u
R pL - L w pL L w
L w R pL L w pL
pL L sw R pL L sw
L sw pL L sw R pL
i
i
i
i
sD
sQ
rd
rq
s s s s m m s
s s s s m s m
m m s r r r s
m s m r s r r
sD
sQ
rd
rq

]
]
]
]
]
]
]
·
+ −
+
− + −
+

]
]
]
]
]
]

]
]
]
]
]
]
]
(1.19)
Induction motor model. Generalities.
1.6
1.2 – Space phasor notation.
1.2.1 – Introduction.
Space phasor notation allows the transformation of the natural instantaneous values of a three-
phase system onto a complex plane located in the cross section of the motor. In this plane, the
space phasor rotate with an angular speed equal to the angular frequency of the three phase
supply system. A space phasor rotating with the same angular speed, for example, can
describe the rotating magnetic field. Moreover, in the special case of the steady state, where
the supply voltage is sinusoidal and symmetric, the space phasor become equal to three-phase
voltage phasors, allowing the analysis in terms of complex algebra. It is shown in figure 1.3
the equivalent schematic for this new model.
sA
sC
sB
ra
rb
rc
Wm
s
r
Wr
Ws
Figure 1.3. On the right the equivalent two rotating windings induction motor.
In order to transform the induction motor model, in natural co-ordinates, into its equivalent
space phasor form, the 120º operator is introduced:
a e
j
·
2
3
π
, a e
j 2
4
3
·
π
(1.20)
Thus, the current stator space phasor can be expressed as follows:
( ) ( ) ( ) [ ] t i a t i a t i 1 c i
sC
2
sB sA
s ⋅ + ⋅ + ⋅ ⋅ ·
(1.21)
The factor "c", takes usually one of two different values either
2
3
or
2
3
. The factor
2
3
makes the amplitude of any space phasor, which represents a three phase balanced system,
equal to the amplitudes of one phase of the three-phase system. The factor
2
3
may also be
used to define the power invariance of a three-phase system with its equivalent two-phase
system (see section 1.3.3).
Induction motor model. Generalities.
1.7
1.2.2 – Current space phasors.
During this section the induction machine assumptions introduced in the section 1.1.1 will be
further considered.
It is represented in figure 1.4 the model of the induction machine with two different frames,
the D-Q axis which represent the stationary frame fixed to the stator, and the α-β axis which
represent rotating frame fixed to the rotor.
Figure 1.4. Cross-section of an elementary symmetrical three-phase machine, with
two different frames, the D-Q axis which represent the stationary frame fixed to the
stator, and α-β axis which represent rotating frame fixed to the rotor.
The stator current space phasor can be expressed as follows:
( ) ( ) ( ) [ ]
θ
· + + ·
j
s sC
2
sB sA 3
2
s
e i t i a t ai t i i
(1.22)
Expressed in the reference frame fixed to the stator, the real-axis of this reference frame is
denoted by sD and its imaginary-axis by sQ.
The equivalence between the stator phasor and the D-Q two-axis components is as follows:
( ) ( ) i i t j i t
s sD sQ
· + ⋅
(1.23)
or:
( ) ( ) [ ]
( ) ( )
[ ]
Re Re
Im Im
i i ai a i i
i i ai a i i
s sA sB sC sD
s sA sB sC sQ
· + + ·
· + + ·
2
3
2
2
3
2
(1.24)
sD
sQ
sD
sQ
r α

θm
sA'
ra'
rb
rc'
ra
rc
rb'
sC
sC'
sB
sB'
sA
θ
α wm
Induction motor model. Generalities.
1.8
The relationship between the space phasor current and the real stator phase currents can be
expressed as follows:
( ) ( ) [ ]
( ) ( ) [ ]
( ) ( )
[ ]
Re Re
Re Re
Re Re
i i ai a i i
a i a i i ai i
ai ai a i i i
s sA sB sC sA
s sA sB sC sB
s sA sB sC sC
· + + ·
· + + ·
· + + ·
2
3
2
2 2
3
2
2
3
2
(1.25)
In a similar way, the space phasor of the rotor current can be written as follows:
( ) ( ) ( )
[ ]
i i t ai t a i t i e
r ra rb rc r
j
· + + ·
2
3
2 α (1.26)
Expressed in the reference frame fixed to the rotor, the real-axis of this reference frame is
denoted by rα and its imaginary-axis by rβ.
The space phasor of the rotor current expressed in the stationary reference frame fixed to the
stator can be expressed as follows:
( )
i i e i e r
r
j
r
j
m
'
· ·
+
θ
α θ
(1.27)
The equivalence between the current rotor space phasor and the α-β two-axis is as follows:
( ) ( ) i i t j i t
r r r
· + ⋅
α β
(1.28)
or:
( ) ( ) [ ]
( ) ( )
[ ]
Re Re
Im Im
i i ai a i i
i i ai a i i
r ra rb rc r
r ra rb rc r
· + + ·
· + + ·
2
3
2
2
3
2
α
β
(1.29)
The relationship between the space phasor current and the real stator currents can be
expressed as follows:
( ) ( ) [ ]
( ) ( ) [ ]
( ) ( )
[ ]
Re Re
Re Re
Re Re
i i ai a i i
a i a i i ai i
ai ai a i i i
r ra rb rc ra
r ra rb rc rb
r ra rb rc rc
· + + ·
· + + ·
· + + ·
2
3
2
2 2
3
2
2
3
2
(1.30)
The magnetising current space-phasor expressed in the stationary reference frame fixed to the
stator can be obtained as follows:
( ) i i i
m s
N
N
r
re
se
· +
'
(1.31)
Induction motor model. Generalities.
1.9
1.2.3 – Flux linkage space phasor.
In this section the flux linkages will be formulated in the stator phasor notation according to
different reference frames.
1.2.3.1- Stator flux-linkage space phasor in the stationary reference frame fixed to the stator.
Similarly to the definitions of the stator current and rotor current space phasors, it is possible
to define a space phasor for the flux linkage as follows:
( ) ψ ψ ψ ψ
s sA sB sC
a a · + +
2
3
2
(1.32)
If the flux linkage equations 1.7, 1.8, 1.9 are substituted in equation 1.32, the space phasor for
the stator flux linkage can be expressed as follows:
( ) ( ) ( )
( ) ( ) ( )
( ) ( ) ( )
( ) ( ) ( )
ψ
θ θ θ
θ θ θ
θ θ θ
π π
π π
π π
s
sA s
s s
sB
s
s
s
sC
s s
s
ra
sr
m
sr
m
sr
m
rb
sr
m
sr
m
sr
m
rc
sr
m
sr
m
sr
m
i L a M a M i M aL a M i M a M a L
i M a M a M
i M a M a M
i M a M a M
·
+ + + + + + + + +
+ + + + + +
+ + + + + +
+ + + + +

2
3
2 2 2
4
3
2
2
3
2
3
2
4
3
4
3
2
3
2
cos cos cos
cos cos cos
cos cos cos
]
]
]
]
]
]
]
]
]
(1.33)
Developing the previous expression 1.33, it is obtained the following expression:
( ) ( ) ( )
( ) ( ) ( )
( ) ( ) ( )
( ) ( ) ( )
ψ
θ θ θ
θ θ θ
θ θ θ
π π
π π
π π
s
sA s
s s
sB
s
s
s
sC
s s
s
ra
sr
m
sr
m
sr
m
rb
sr
m
sr
m
sr
m
rc
sr
m
sr
m
sr
m
i L a M a M a i a M L a M a i a M a M L
i M a M a M
a i a M M a M
a i a M a M M
·
+ + + ⋅ + + + + + +
+ + + + + +
+ ⋅ + + + + +
+ ⋅ + + + +
2
3
2 2 2 2
4
3
2
2
3
2
2
3
4
3
2
4
3
2
2
3
cos cos cos
cos cos cos
cos cos cos

]
]
]
]
]
]
]
]
]
(1.34)
And finally, expression 1.34 can be represented as follows:
( ) ( ) ( ) ( )
( ) ( ) ( )
ψ θ θ θ
θ
π π
θ
s s
s s s sr
m
sr
m
sr
m
r
s
s s
m
sr r
s
s s sr r
j
s
s s sr r
s
s
m
r
L a M a M i M a M a M i
L M i M i L M i M i e L M i M i
L i L i
m
· + + + + + + + ·
· − + · − + · − + ·
+
2
4
3
2
2
3
15 15 15
cos cos cos
. cos . .
'
'

=
(1.35)
Where Ls is the total three-phase stator inductance and Lm is the so-called three-phase
magnetising inductance. Finally, the space phasor of the flux linkage in the stator depends on
two components, being the stator currents and the rotor currents.
Once more, the flux linkage magnitude can be expressed in two-axis as follows:
ψ ψ ψ
s sD sQ
j · +
(1.36)
Induction motor model. Generalities.
1.10
Where its direct component is equal to:
ψ
sD s sD m rd
L i L i · + (1.37)
And its quadrature component is expressed as:
ψ
sQ s sQ m rq
L i L i · + (1.38)
The relationship between the components i
rd
and i

and i
rq
and i

may be introduced as
follows:
i i ji i e r
rd rq
r
j
m
'
· + ·
θ (1.39)
The compactness of the notation in the space phasor nomenclature compared to the two-axis
notation in 1.1. is noticeable.
1.2.3.2- Rotor flux-linkage space phasor in the rotating reference frame fixed to the rotor.
The rotor flux linkage space phasor, fixed to the rotor natural frame can be defined as follows:
( ) ψ ψ ψ ψ
r ra rb rc
a a · + +
2
3
2
(1.40)
If the flux linkage equations 1.10, 1.11, 1.12 are substituted in equation 1.40, the space phasor
for the rotor flux linkage can be expressed as follows:
( ) ( ) ( )
( ) ( ) ( )
( ) ( ) ( )
( ) ( ) ( )
ψ
θ θ θ
θ θ θ
θ θ θ
π π
π π
π π
r
ra r
r r
sB
r
r
r
sc
r r
r
sA
sr
m
sr
m
sr
m
sB
sr
m
sr
m
sr
m
sC
sr
m
sr
m
sr
m
i L a M a M i M aL a M i M a M a L
i M a M a M
i M a M a M
i M a M a M
·
+ + + + + + + + +
+ + + + + +
+ + + + + +
+ + + + +

2
3
2 2 2
2
3
2
4
3
4
3
2
2
3
2
3
4
3
2
cos cos cos
cos cos cos
cos cos cos
]
]
]
]
]
]
]
]
]
(1.41)
By re-arranging the previous expression 1.41, it can be expressed as:
( ) ( ) ( )
( ) ( ) ( )
( ) ( ) ( )
( ) ( ) ( )
ψ
θ θ θ
θ θ θ
θ θ θ
π π
π π
π π
r
ra r
r r
rb
r
r
r
rc
r r
r
sa
sr
m
sr
m
sr
m
sb
sr
m
sr
m
sr
m
sc
sr
m
sr
m
sr
m
i L a M a M a i a M L a M a i a M a M L
i M a M a M
a i a M M a M
a i a M a M M
·
+ + + ⋅ + + + + + +
+ + + + + +
+ ⋅ + + + + +
+ ⋅ + + + +
2
3
2 2 2 2
2
3
2
4
3
2
4
3
2
3
2
2
3
2
4
3
cos cos cos
cos cos cos
cos cos cos

]
]
]
]
]
]
]
]
]
(1.42)
And finally:
( )
( ) ( )
( )
( )
( )
( ) ( )
ψ θ θ θ
θ
π π
θ
r r
r r r sr
m
sr
m
sr
m
s
r
r r
m
sr s
r
r r sr s
j
r
r r sr s
r
r
m
s
L aM a M i M a M a M i
L M i M i L M i M i e L M i M i
L i L i
m
· + + + + + + + ·
· − + − · − + · − + ·
+

2
2
3
2
4
3
15 15 15
cos cos cos
. cos . .
'
'

=
(1.43)
Induction motor model. Generalities.
1.11
Where L
r
is the total three-phase rotor inductance and Lm is the so-called three-phase
magnetising inductance. i s
'
is the stator current space phasor expressed in the frame fixed to
the rotor.
Once more the flux linkage magnitude can be expressed in the two-axis form as follows:
ψ ψ ψ
α β r r r
j · +
(1.44)
Where its direct component is equal to:
ψ
α α α r r r m s
L i L i · + (1.45)
And its quadrature component is expressed as:
ψ
β β β r r r m s
L i L i · + (1.46)
1.2.3.3- Rotor flux-linkage space phasor in the stationary reference frame fixed to the stator.
The rotor flux linkage can also be expressed in the stationary reference frame using the
previously introduced transformation e
jθm
, and can be written as:
( )
ψ ψ ψ ψ ψ ψ
θ
α β
θ
'
r
rd rq r
j
r r
j
j e j e
m m
· + · · +
(1.47)
The space phasor of the rotor flux linkage can be expressed according to the fixed co-
ordinates as follows:
ψ
θ
' ' ' '
r
r
r
m
s
j
r
r
m
s L i L i e L i L i
m
· + · +
(1.48)
The relationship between the stator current referred to the stationary frame fixed to the stator
and the rotational frame fixed to the rotor is as follows:
i i e
i e i
s s
j
s
j
s
m
m
·
·

'
'
θ
θ
(1.49)
Where
i i ji
i i ji
s
sD sQ
s
s s
· +
· +
'
α β
(1.50)
From figure 1.5, the following equivalencies can be deduced:
( )
m m
j
s
j
'
s
j
'
s
'
s
j
s s
e i e i e i i
e i i
θ − θ − θ α
θ
· · ·
·
(1.51)
Induction motor model. Generalities.
1.12
sD


θm
is,is'
α
θ
sQ
wm
Figure 1.5. Stator-current space phasor expressed in accordance with the rotational
frame fixed to the rotor and the stationary frame fixed to the stator.
1.2.3.4- Stator flux-linkage space phasor in the rotating reference frame fixed to the rotor.
Similarly than 1.2.3.3 section, it can be deduced the following expression:
ψ ψ
θ θ
s s
j
s
s
m
r
j
s
s
m
r e L i L i e L i L i
m m
' ' '
· · +
|
.

`
,

· +
− − (1.52)
1.2.4. – The space phasors of stator and rotor voltages.
The space phasors for the stator and rotor voltages can be defined in a similar way like the
one used for other magnitudes.
( ) ( ) ( )
[ ] ( ) ( )
( ) ( ) ( )
[ ] ( ) ( )
u u t au t a u t u ju u u u j u u
u u t au t a u t u ju u u u j u u
s
sA sB sC sD sQ sA sB sC sB sC
r
ra rb rc r r ra rb rc rb rc
· + + · + · − − + −
· + + · + · − − + −
2
3
2 2
3
1
2
1
2
1
3
2
3
2 2
3
1
2
1
2
1
3 α β
(1.53)
Where the stator voltage space phasor is referred to the stator stationary frame and the rotor
voltage space phasor is referred to the rotating frame fixed to the rotor.
Provided the zero component is zero [VAS 1], it can also be said that:
( )
( )
( )
u u
u a u
u au
sA
s
sB
s
sC
s
·
·
·
Re
Re
Re
2
(1.54)
Equivalent expressions can also be obtained for the rotor.
Induction motor model. Generalities.
1.13
1.2.5 - Space-phasor form of the motor equations.
The space phasor forms of the voltage equations of the three-phase and quadrature-phase
smooth air-gap machines will be presented. Firstly, the equations will be expressed in a
general rotating reference frame, which rotates at a general speed w
g
, and then to the
references frames fixed to the stator, rotor and synchronous speed.
1.2.5.1 - Space-phasor voltage equations in the general reference frame.
If the vector in the figure 1.6 is the stator current, then its formulation in the space phasor
form is as follows:
i i e i ji sg s
j
sx sy
g
· · +
− θ
(1.55)
sD
θg
αs
sQ


wm
x
y
wg
θm
αr
Figure 1.6. It is shown a magnitude represented by means of the vector, and its angle
referred to the three different axis. The three different axis are: sD-sQ fixed to the
stator, rα-rβ fixed to the rotor whose speed is w
m
, and finally the general frame
represented by means of the axis x-y whose speed

is equal to w
g
.
In a similar way and for other magnitudes, it can be written the following equations:
u u e u ju
e j
sg s
j
sx sy
sg s
j
sx sy
g
g
· · +
· · +


θ
θ
ψ ψ ψ ψ
(1.56)
Where the magnitudes are the voltage space phasor and the stator flux linkage respectively.
However, if the magnitude in the figure 1.6 is for instance the rotor current, its space phasor
notation will be:
( )
i i e i ji rg r
j
rx ry
g m
· · +
− − θ θ
(1.57)
Induction motor model. Generalities.
1.14
and for other magnitudes:
( )
( )
u u e u ju
e j
rg r
j
rx ry
rg r
j
rx ry
g m
g m
· · +
· · +
− −
− −
θ θ
θ θ
ψ ψ ψ ψ
(1.58)
Manipulating the previous equations yields the following stator and rotor space phasor
voltage equations in the general reference frame.
( )
( ) ( )
( )
( ) ( ) ( )
( )
u e R i e
d e
dt
R i e e
d
dt
je w
u e R i e
d e
dt
R i e e
d
dt
je w P w
sg
j
s
sg
j
sg
j
s
sg
j j sg j
g sg
rg
j
r
rg
j
r
j
r
rg
j j rg j
g m rg
g g
g
g g g
g m g m
g m
g m g m g m
θ θ
θ
θ θ θ
θ θ θ θ
θ θ
θ θ θ θ θ θ
ψ
ψ
ψ
ψ
ψ
ψ
· + · + +
· +
|
.

`
,

· + + − ⋅
− −

− − −
(1.59)
Simplifying equation 1.59, it is obtained equation 1.60.
( )
u R i
d
dt
jw
u R i
d
dt
j w P w
sg
s
sg
sg
g sg
rg
r
rg
rg
g m rg
· + +
· + + − ⋅
ψ
ψ
ψ
ψ
(1.60)
Where, the flux linkage space phasors are:
ψ
ψ
sg
s
sg
m
rg
rg r
rg
m
sg
L i L i
L i L i
· +
· +
(1.61)
Using the two-axis notation and the matrix form, the voltage equations can be represented by:
( ) ( )
( ) ( )
u
u
u
u
R pL - w L pL - w L
w L R pL w L pL
pL P w - w L R pL P w - w L
w - P w L pL w - P w L R pL
i
i
i
i
sx
sy
rx
ry
s s g s m g m
g s s s g m m
m m g m r r m g r
g m m m g m r r r
sx
sy
rx
ry

]
]
]
]
]
]
]
·
+
+
⋅ + ⋅
⋅ ⋅ +

]
]
]
]
]
]
]

]
]
]
]
]
]
]
(1.62)
1.2.5.2 - Space-phasor voltage equations in the stationary reference frame fixed to the stator.
If wg = 0, the matrix expression obtained is 1.63, being equal to the expression 1.17.
u
u
u
u
R pL 0 pL
0 R pL pL
pL P w L R pL P w L
- P w L pL - P w L R pL
i
i
i
i
sD
sQ
rd
rq
s s m
s s m
m m m r r m r
m m m m r r r
sD
sQ
rd
rq

]
]
]
]
]
]
]
·
+
+
⋅ + ⋅
⋅ ⋅ +

]
]
]
]
]
]

]
]
]
]
]
]
]
0
0
(1.63)
The stator voltage space phasor can be expressed as follows:
u R i
d
dt
s
s
s
s
· +
ψ (1.64)
Induction motor model. Generalities.
1.15
The rotor voltage space phasor can be written as:
u e R i e
d e
dt
u R i
d
dt
j P w
r
j
r
r
j
r
j
r
r
r
r
m r
m m
m
' '
'
' '
'
'
− −

· +
|
.

`
,

· + − ⋅ ⋅
θ θ
θ
ψ
ψ
ψ
(1.65)
And the flux linkage space phasors can be expressed as follows
ψ
ψ
s s
s
m
r
r r
r
m
s
L i L i
L i L i
· +
· +
'
' '
(1.66)
1.2.5.3 - Space-phasor voltage equations in the rotating reference frame fixed to the rotor.
If wg = wm, the matrix expression obtained is 1.67, being equal to the expression 1.18.
u
u
u
u
R pL - L P w pL L P w
L P w R pL L P w pL
pL R pL
pL R pL
i
i
i
i
sD
sQ
rd
rq
s s s m m m m
s m s s m m m
m r r
m r r
sD
sQ
rd
rq

]
]
]
]
]
]
]
·
+ −
+
+
+

]
]
]
]
]
]

]
]
]
]
]
]
]
0 0
0 0
(1.67)
The stator voltage space phasor can be expressed as follows:
u R i
d
dt
j P w s
s
s
s
s m
' '
'
'
· + + ⋅ ⋅
ψ
ψ
(1.68)
The rotor voltage space phasor can be written as:
u R i
d
dt
r
r
r
r
· +
ψ
(1.69)
And the flux linkage space phasors can be expressed as follows
ψ
ψ
s s
s
m
r
r r r m
s
L i L i
L i L i
' '
'
· +
· +
(1.70)
1.2.5.4 - Space-phasor voltage equations in the rotating reference frame at synchronous speed.
If wg = ws, the matrix expression obtained is 1.71, being equal to expression 1.19.
u
u
u
u
R pL - L w pL L w
L w R pL L w pL
pL L sw R pL L sw
L sw pL L sw R pL
i
i
i
i
sD
sQ
rd
rq
s s s s m m s
s s s s m s m
m m s r r r s
m s m r s r r
sD
sQ
rd
rq

]
]
]
]
]
]
]
·
+ −
+
− + −
+

]
]
]
]
]
]

]
]
]
]
]
]
]
(1.71)
Induction motor model. Generalities.
1.16
The stator voltage space phasor can be expressed as follows:
u R i
d
dt
j w sg
s
sg
sg
sg s
· + +
ψ
ψ
(1.72)
The rotor voltage space phasor can be written as:
( ) u R i
d
dt
j w P w rg
r
rg
rg
rg s m
· + + − ⋅
ψ
ψ
(1.73)
And the flux linkage space phasors can be expressed as follows
ψ
ψ
sg s
sg
m
rg
rg r
rg
m
sg
L i L i
L i L i
· +
· +
(1.74)
Induction motor model. Generalities.
1.17
1.3 – Torque expressions.
1.3.1 - Introduction.
The general expression for the torque is as follows:
'
r
s e
i c t × ψ ·
(1.75)
Where the “c” is a constant, ψ
s
and i r
'
are the space phasors of the stator flux and rotor
current respectively, both referred to the stationary reference frame fixed to the stator.
The expression given above can also be expressed as follows:
t c i
e s
r · ⋅ ψ γ sin
(1.76)
Where γ is the angle existing between the stator flux linkage and the rotor current. It follows
that when γ=90
o
the torque obtained is the maximum and its expression is exactly equal to the
one for the DC machines. Nevertheless, in DC machines the space distribution of both
magnitudes is fixed in space, thus producing the maximum torque for all different magnitude
values. Furthermore, both magnitudes can be controlled independently or separately. In an
AC machine, however, it is much more difficult to realise this principle because both
quantities are coupled and their position in space depends on both the stator and rotor
positions. It is a further complication that in squirrel-cage machines, it is not possible to
monitor the rotor current, unless the motor is specially prepared for this purpose in a special
laboratory. It is impossible to find them in a real application. The search for a simple control
scheme similar to the one for DC machines has led to the development of the so-called vector-
control schemes, where the point of obtaining two different currents, one for controlling the
flux and the other one for the rotor current, is achieved [VAS 1].
1.3.2 - Deduction of the torque expression by means of energy considerations.
Torque equation is being deduced by means of energy considerations. Therefore, the starting
equation is as follows:
P P P P
mechanic electric loss field
· − − (1.77)
Induction motor model. Generalities.
1.18
Substituting the previous powers for its values, the equation can be expressed as follows:
( ) ( )
t w u i R i
d
dt
i u i R i
d
dt
i
e r
s s
s s
s
s r r
r r
r
r
⋅ · ⋅ − −
|
.

`
,

|
.

`
,

+ ⋅ − −
|
.

`
,

|
.

`
,

]
]
]
]
3
2
2 2
Re Re Re Re
* * ' '*
'
'
'*
ψ ψ
(1.78)
Since in the stationary reference frame, the stator voltage space phasor us can only be
balanced by the stator ohmic drop, plus the rate of change of the stator flux linkage, the
previous expression can be expressed as follows:
( ) ( )
t w jw i w j i w i
e r r r
r
r r
r
r r
r ⋅ · − · − · − ×
3
2
3
2
3
2
Re Re
' '* ' '* ' '
ψ ψ ψ
(1.79)
Expressing the equation in a general way for any number of pair of poles gives:
t P i
e r
r · − ×
3
2
ψ
' '
(1.80)
If equations 1.66 and 1.35 are substituted in equation 1.80, it is obtained the following
expression for the torque:
s
s 2
3
e
i P t × ψ ·
(1.81)
If the product is developed, expression 1.81 is as follows:
( )
sD sQ sQ sD
2
3
e
i i P t ⋅ ψ − ⋅ ψ ·
(1.82)
Finally, different expressions for the torque can be obtained as follows:
'
r s
2
m r s
m
'
r
s
s
m
'
r s
s
'
r
m
s
m
2
3
e
r
'
s
m 2
3
'
r s
m 2
3
'
r s
m
'
r
r 2
3
e
L L L
L
P
2
3
i
L 2
L 3
P i i L i L
L
L
P t
i i PL i i PL i i L i L P t
ψ × ψ

− · × ψ − · ×
,
`

.
|
+ − ·
× − · × − · ×
,
`

.
|
+ − ·
(1.83)
1.3.3 – Torque constant.
The value of the torque constant can take two different values. These depend on the constant
used in the space phasor. Both possibilities are shown in table I.I.
Non power invariant Power invariant
Torque constant
3
2
1
3→2 2→3 3→2 2→3 Space phasor
constant
2
3
1
2
3
2
3
Table I.I. Torque constant values.
"3→2" means the change from three axis to either two axis or space phasor notation,
and "2→3" either two axis or space phasor notation to three axis.
Induction motor model. Generalities.
1.19
1.4 – Simulink model.
1.4.1 - Equations used in the model.
The final expressions used in the implemented models are obtained from all the previously
introduced expressions.
All equations have been re-arranged in order to use the operator 1/s instead of the operator p
because the “Simulink” deals with the integrator better than with the derivation.
1.4.1.1 – Stator reference.
Stator and rotor fluxes can be expressed as follows:
( )
( )
( ) ( )
( ) ( )
ψ
ψ
ψ ψ ψ
ψ ψ ψ
sD s sD s sD
sQ s sQ s sQ
rd
s
rd r
rd
m rq
s
r
rd
m rq
rq
s
rq r
rq
m rd
s
r
rq
m rd
u R i
u R i
u R i P w R i P w
u R i P w R i P w
· −
· −
· − − ⋅ · − − ⋅
· − + ⋅ · − + ⋅
1
1
1 1
1 1
' ' ' ' ' '
' ' ' ' ' '
(1.84)
Stator and rotor currents can be expressed as follows:
i
L
L
L
L
i
L
L
L
L
i
L
L
L
L
i
L
L
L
L
L L L L
sD sD
r
x
rd
m
x
sQ sQ
r
x
rq
m
x
rd rd
s
x
sD
m
x
rq rq
s
x
sQ
m
x
x s r m
· −
· −
· −
· −
· −
ψ ψ
ψ ψ
ψ ψ
ψ ψ
'
'
' '
' '
where
2
(1.85)
1.4.1.2 - Rotor reference.
Stator and rotor fluxes can be expressed as follows:
( )
( )
( )
( )
ψ
ψ
ψ ψ
ψ ψ
rd
s
rd r rd
rq s rq r rq
sd
s
sd s sd m sq
sq s sq r sq m sd
u R i
u R i
u R i P w
u R i P w
· − ·
· − ·
· − + ⋅
· − − ⋅
1
1
1
1
0
0
' ' ' '
' ' ' '
(1.86)
Induction motor model. Generalities.
1.20
Stator and rotor currents can be expressed as follows:
i
L
L
L
L
i
L
L
L
L
i
L
L
L
L
i
L
L
L
L
L L L L
sD
sD
r
x
rd
m
x
sQ
sQ
r
x
rq
m
x
rd rd
s
x
sD
m
x
rq rq
s
x
sQ
m
x
x s r m
· −
· −
· −
· −
· −
ψ ψ
ψ ψ
ψ ψ
ψ ψ
' '
' '
'
'
where
2
(1.87)
1.4.1.3 - Synchronous reference.
Stator and rotor fluxes can be expressed as follows:
( )
( )
( ) ( ) ( ) ( )
( ) ( ) ( ) ( )
ψ ψ
ψ ψ
ψ ψ ψ
ψ ψ ψ
sx
s
sx s sx s sy
sy
s
sy r sy s sx
rx
s
rx r rx ry s m
s
r rx ry s m
ry
s
ry r ry rx s m
s
r ry rx s m
u R i w
u R i w
u R i w P w R i w P w
u R i w P w R i w P w
· − +
· − −
· − + − ⋅ · − + − ⋅
· − − − ⋅ · − − − ⋅
1
1
1 1
1 1 (1.88)
Stator and rotor currents can be expressed as follows:
i
L
L
L
L
i
L
L
L
L
i
L
L
L
L
i
L
L
L
L
L L L L
sx
sx
r
x
rx
m
x
sy
sy
r
x
ry
m
x
rx rx
s
x
sx
m
x
ry ry
s
x
sy
m
x
x s r m
· −
· −
· −
· −
· −
ψ ψ
ψ ψ
ψ ψ
ψ ψ
where
2
(1.89)
1.4.1.4 – Motion equation.
The motion equation is as follows:
m
m
L e
Dw
dt
dw
J t t + · −
(1.90)
Where, t
e
is the electromagnetic torque, t
L
is load torque, J is the inertia of the rotor, and
finally the D is the damping constant.
Induction motor model. Generalities.
1.21
Using the torque expressions 1.82, the previous motion equation can be expressed as follows:
( ) ( )
( )
Js D
t i i c P
w
Js D w t i i c P
L sD sQ sQ sD
r
m L sD sQ sQ sD
+
− ⋅ ψ − ⋅ ψ ⋅ ⋅
·
+ + · ⋅ ψ − ⋅ ψ ⋅ ⋅
(1.91)
Where P is the number of pair of poles and the torque constant take the values either 1 or 2/3
according to the table I.I shown in the previous section 1.3.3.
1.4.2 – Simulated results.
Figures 1.7 and 1.8 show the torque and speed responses obtained from equation 1.84 to
equation 1.91. It must be said that all three different references (stator, rotor and synchronous)
gave the same simulated results shown in figures 1.7 and 1.8. The validity of the motor model
is corroborated.
All simulations are done in Matlab/Simulink. Motor characteristics are listed in section 4.2.
0 0.2 0.4 0.6 0.8 1 1.2
-10
0
10
20
30
40
50
60


t
o
r
q
u
e

(
N
m
)
time (s)


t
o
r
q
u
e

(
N
m
)
time (s)
0 0.2 0.4 0.6 0.8 1 1.2
-10
0
10
20
30
40
50
60
Figure 1.7. Torque response without load. Left: Motor_1kW. Right: Motor_1.5kW.
Te= 0Nm, J=0.08Kgm2. Notice the transient at the beginning and the steady state
torque value, being 0Nm for this ideal case.
Induction motor model. Generalities.
1.22
0 0.2 0.4 0.6 0.8 1 1.2 1.4
0
20
40
60
80
100
120
140
160
w
m


(
r
d
/
s
)
time (s)
w
m


(
r
d
/
s
)
time (s)
0 0.2 0.4 0.6 0.8 1 1.2 1.4
0
20
40
60
80
100
120
140
160
Figure 1.8. Speed response without load. Left: Motor_1kW. Right: Motor_1.5kW.
Te=0Nm, J=0.08Kgm2. Notice the small ripple at the beginning due to the transient.
The final speed value is 157 rd/s, as expected from this ideal case, where Te=0Nm.
Induction motor model. Generalities.
1.23
1.5 – Steady state analysis.
1.5.1 - Steady state conditions.
This section deals with the conditions under which, induction motor operates in steady state.
When an induction motor operates in steady state and is supplied by symmetrical and
sinusoidal waveforms, the space vectors become identical to its phasors. Therefore, the
following assumptions expressed in 1.92, can be taken into account:
' '
'
'
'
r m r r
r
s s
s
j
r
r
s
s
I w P j I jw
dt
i d
I jw
dt
i d
e V u
V u
⋅ ⋅ + ·
·
·
·
θ
(1.92)
1.5.2 - Steady state equations.
From the expressions 1.64, 1.65 and 1.66, referred to the stationary reference frame fixed to
the stator, can be written the equations 1.93 for the stator and 1.94 for the rotor, valid in both
transient and steady state:
( )
dt
i d
L
dt
i d
L L i R u
r
rm
s
sm s
s
s
s
'
2
3
2
3
1
+ + + ·
(1.93)
( ) ( )
,
`

.
|
+ + ⋅ ⋅ − + + + · s
sm
r
rm r m
s
sm
r
rm r
r
r
r i L i L L w P j
dt
i d
L
dt
i d
L L i R u
2
3
'
2
3
1 2
3
'
2
3
1
' '
(1.94)
Once the conditions described above in equations 1.92 are applied to the stator 1.93 and rotor
1.94 equations, stator 1.95 and rotor 1.96 steady state equations are obtained:
( )
'
2
3
2
3
1 r sm s s sm s s s s s
I L jw I L L jw I R V + + + ·
(1.95)
( )
s sm s r sm r s r s
R
I L jw I L L jw I
r
2
3
'
2
3
1
'
0 + + + ·
(1.96)
Induction motor model. Generalities.
1.24
1.5.3 - Steady state equivalent circuit.
From the equations 1.95 and 1.96, the well-known equivalent circuit for an induction motor
can be drawn as shown in figure 1.9:
Rs Rr/s wsLr1
3/2wsLsm
wsLs1
Is Ir
'
Figure 1.9. Steady state equivalent circuit of Induction motor.
From the previous steady state induction motor model the following expressions for the
torque, stator current and stator flux can be obtained:
2
'
1
2
3
r w s
R
P
I T
s
r
·
(1.97)
( )
'
2
3
2
3
1
r
sm s
sm r s s
R
s
I
L jw
L L jw
I
r

+ +
·
(1.98)
( )
'
2
3
2
3
1 r sm s sm s s
I L I L L + + · ψ
(1.99)
Induction motor model. Generalities.
1.25
1.6 – Interim conclusions.
In the present chapter has been deduced the motor model. The model has been formulated by
means of the two-axis theory equations and the space phasor notation. Despite the fact that
both nomenclatures are valid, it has been proved that the space phasor notation is much more
compact and easier to work with. The model has been developed in both nomenclatures for
the stator, rotor and synchronous references. In further chapters, the motor model with stator
reference, introduced in section 1.4.1.1, will be the one most used.
Different torque expressions have been deduced.
The final concrete equations used in the Matlab/Simulink motor model have been presented
by the three different references. Some simulations are shown to prove the validity of the
model, being equal for the previously mentioned three references. Two different motors have
been used in the model.
Finally the steady state motor analysis has been introduced.
2.1
CHAPTER 2.
DIRECT TORQUE CONTROL.
PRINCIPLES and GENERALITIES.
2.1 - Induction motor controllers.
2.1.1 – Voltage/frequency.
There are many different ways to drive an induction motor. The main differences
between them are the motor’s performance and the viability and cost in its real
implementation.
Despite the fact that "Voltage/frequency" (V/f) is the simplest controller, it is the
most widespread, being in the majority of the industrial applications. It is known as a
scalar control and acts imposing a constant relation between voltage and frequency.
The structure is very simple and it is normally used without speed feedback.
However, this controller doesn't achieve a good accuracy in both speed and torque
Direct Torque Control. Principles and Generalities.
2.2
responses mainly due to the fact that the stator flux and the torque are not directly
controlled. Even though, as long as the parameters are identified, the accuracy in the
speed can be 2% (except in a very low speed) and the dynamic response can be
approximately around 50ms [LEO 1][LUD 2].
2.1.2 – Vector controls.
In these types of controllers, there are control loops for controlling both the torque
and the flux [BOS 1]. The most widespread controllers are the ones that use vector
transform such as either Park or Ku. Its accuracy can reach values such as 0.5%
regarding the speed and 2% regarding the torque, even in stand still.
The main disadvantages are the huge computational capability required and the
compulsory good identification of the motor parameters [ROM 1].
2.1.3 – Field Acceleration method.
This method is based on avoiding the electromagnetic transients in the stator
currents, keeping its phase continuous. Therefore, the equations used can be
simplified saving the vector transformation in the controllers.
It is achieved some computational reduction, overcoming the main problem in the
vector controllers and then becoming an important alternative for the vector
controllers [BED 5] [ROM 1] [YAM 1].
2.1.4 - Direct Torque Control.
In Direct Torque Control it is possible to control directly the stator flux and the torque by
selecting the appropriate inverter state.
Its main features are as follows [LUD 1] [VAS 2]:
§ Direct torque control and direct stator flux control.
§ Indirect control of stator currents and voltages.
§ Approximately sinusoidal stator fluxes and stator currents.
§ High dynamic performance even at locked rotor.
Direct Torque Control. Principles and Generalities.
2.3
This method presents the following advantages:
§ Absence of co-ordinate transform.
§ Absence of voltage modulator block, as well as other controllers such as PID for
flux and torque.
§ Minimal torque response time, even better than the vector controllers.
Although, some disadvantages are present:
§ Possible problems during starting.
§ Requirement of torque and flux estimators, implying the consequent parameters
identification.
§ Inherent torque and flux ripples.
Direct Torque Control. Principles and Generalities.
2.4
2.2 - Principles of Direct Torque Control.
2.2.1 - Introduction.
As it has been introduced in expression 1.81, the electromagnetic torque in the three-
phase induction machines can be expressed as follows [BOL 1][VAS 2]:
s
s 2
3
e
i P t × ψ =
(2.1)
Where ψ
s
is the stator flux, i s is the stator current (both fixed to the stationary
reference frame fixed to the stator) and P the number of pairs of poles. The previous
equation can be modified and expressed as follows:
( )
s s
s
s 2
3
e
sin i P t ρ − α ⋅ ⋅ ψ =
(2.2)
Where ρ
s
is the stator flux angle and α
s
is the stator current one, both referred to the
horizontal axis of the stationary frame fixed to the stator.
If the stator flux modulus is kept constant and the angle ρ
s
is changed quickly, then
the electromagnetic torque is directly controlled.
The same conclusion can be obtained using another expression for the
electromagnetic torque. From equation 1.83, next equation can be written:
( ) t P
L
L L L
e
m
s r m
r s s r
=

× ⋅ −
3
2
2
ψ ψ ρ ρ
'
sin
(2.3)
Because of the rotor time constant is larger than the stator one, the rotor flux changes
slowly compared to the stator flux; in fact, the rotor flux can be assumed constant.
(The fact that the rotor flux can be assumed constant is true as long as the response
time of the control is much faster than the rotor time constant). As long as the stator
flux modulus is kept constant, then the electromagnetic torque can be rapidly
changed and controlled by means of changing the angle ρ ρ
s r
− [TAK 2] [VAS 2].
2.2.2 - DTC Controller.
The way to impose the required stator flux is by means of choosing the most suitable
Voltage Source Inverter state. If the ohmic drops are neglected for simplicity, then
Direct Torque Control. Principles and Generalities.
2.5
the stator voltage impresses directly the stator flux in accordance with the following
equation:
d
dt
u
s
s
ψ
=
(2.4)
Or:
∆ ∆ ψ
s
s u t =
(2.5)
Decoupled control of the stator flux modulus and torque is achieved by acting on the
radial and tangential components respectively of the stator flux-linkage space vector
in its locus. These two components are directly proportional (Rs=0) to the
components of the same voltage space vector in the same directions.
Figure 2.1 shows the possible dynamic locus of the stator flux, and its different
variation depending on the VSI states chosen. The possible global locus is divided
into six different sectors signalled by the discontinuous line.
v1(100)
v4(011)
v3(010) v2(110)
v5(001) v6(101)
v3(FD,TI)
v2 (FI,TI)
1
6 5
4
3
2
v6(FI,TD)
v5(FD,TD)
Figure 2.1. Stator flux vector locus and different possible switching
voltage vectors. FD: flux decrease. FI: flux increase. TD: torque decrease.
TI: torque increase.
In Accordance with figure 2.1, the general table II.I can be written. It can be seen
from table II.I, that the states V
k
and V
k+3
, are not considered in the torque because
they can both increase (first 30 degrees) or decrease (second 30 degrees) the torque
at the same sector depending on the stator flux position. The usage of these states for
Direct Torque Control. Principles and Generalities.
2.6
controlling the torque is considered one of the aims to develop in the present thesis,
dividing the total locus into twelve sectors instead of just six [LUD 1].
VOLTAGE VECTOR INCREASE DECREASE
Stator Flux V
k
,V
k+1
,V
k-1
V
k+2
,V
k-2
,V
k+3
Torque V
k+1
,V
k+2
V
k- 1
,V
k- 2
Table II.I: General Selection Table for Direct Torque Control, being "k"
the sector number.
Finally, the DTC classical look up table is as follows:
Φ τ S
1
S
2
S
3
S
4
S
5
S
6
TI V
2
V
3
V
4
V
5
V
6
V
1
T= V
0
V
7
V
0
V
7
V
0
V
7
FI
TD V
6
V
1
V
2
V
3
V
4
V
5
TI V
3
V
4
V
5
V
6
V
1
V
2
T= V
7
V
0
V
7
V
0
V
7
V
0
FD
TD V
5
V
6
V
1
V
2
V
3
V
4
Table II.II. Look up table for Direct Torque Control.
FD/FI: flux decrease/increase. TD/=/I: torque decrease/equal/increase.
S
x
: stator flux sector. Φ: stator flux modulus error after the hysteresis block.
τ: torque error after the hysteresis block.
The sectors of the stator flux space vector are denoted from S
1
to S
6
. Stator flux
modulus error after the hysteresis block (Φ) can take just two values. Torque error
after the hysteresis block (τ) can take three different values. The zero voltage vectors
V
0
and V
7
are selected when the torque error is within the given hysteresis limits, and
must remain unchanged.
Direct Torque Control. Principles and Generalities.
2.7
2.2.3 - DTC Schematic.
In figure 2.2 a possible schematic of Direct Torque Control is shown. As it can be
seen, there are two different loops corresponding to the magnitudes of the stator flux
and torque. The reference values for the flux stator modulus and the torque are
compared with the actual values, and the resulting error values are fed into the two-
level and three-level hysteresis blocks respectively. The outputs of the stator flux
error and torque error hysteresis blocks, together with the position of the stator flux
are used as inputs of the look up table (see table II.II). The position of the stator flux
is divided into six different sectors. In accordance with the figure 2.2, the stator flux
modulus and torque errors tend to be restricted within its respective hysteresis bands.
It can be proved that the flux hysteresis band affects basically to the stator-current
distortion in terms of low order harmonics and the torque hysteresis band affects the
switching frequency [VAS 2].
The DTC requires the flux and torque estimations, which can be performed as it is
proposed in figure 2.2 schematic, by means of two different phase currents and the
state of the inverter.
Selection
Table
Torque ref
Flux ref
+
-
+
-
VSI
stator flux
torque
estimators
induction
motor
flux sector
VSI state
Figure 2.2. Direct Torque Control schematic.
However, flux and torque estimations can be performed using other magnitudes such as two
stator currents and the mechanical speed, or two stator currents again and the shaft position
[LUD 1] [TAK 2].
Direct Torque Control. Principles and Generalities.
2.8
2.2.3.1 - Stator flux and torque estimator using w
m
, i
sA
and i
sB
magnitudes.
This estimator does not require co-ordinate transform. It is used the motor model
fixed to the stationary reference frame fixed to the stator.
Firstly, all three-phase currents must be converted into its D and Q components. By
means of the Park transformation defined in equation 1.14, it can be said:
( )
sA sB 2
3
sQ
sA sD
i i 2 c i
i 5 . 1 c i
+ ⋅ ⋅ ⋅ =
⋅ ⋅ =
(2.6)
If rotor current is isolated from equation 1.65 and substituted into 1.66 it can be said:
( ) s
m R
wm P L
R
L
'
r
i L j p 1
r
r
r
r
= − ⋅ + ⋅ ψ
⋅ ⋅ (2.7)
And if the expression 2.7 is rearranged:
( ) wm P L j i R L L p R
r
'
r
s
r m r r
'
r
⋅ ⋅ ⋅ ψ ⋅ + ⋅ = ⋅ + ⋅ ψ
(2.8)
Expanding the previous equation into its D and Q components, is obtained:
( ) wm P L i R L L p R
r
'
rQ
sD
r m r r
'
rD
⋅ ⋅ ⋅ ψ − ⋅ = ⋅ + ⋅ ψ
(2.9)
( ) wm P L i R L L p R
r
'
rD
sQ
r m r r
'
rQ
⋅ ⋅ ⋅ ψ + ⋅ = ⋅ + ⋅ ψ
(2.10)
And taking into account that this expression will be evaluated in a computer it should
be expressed in z operator instead of p one. Therefore doing the z transform of
equations 2.9 and 2.10 the following equation are obtained:






⋅ ⋅ ⋅ ψ ⋅ − ⋅

=








− ⋅ ψ














wm P L i R L
R
e 1
e z
r
'
rQ
sD
r m
r
Tz
L
R
Tz
L
R
'
rD
r
r
r
r
(2.11)






⋅ ⋅ ⋅ ψ ⋅ + ⋅

=








− ⋅ ψ














wm P L i R L
R
e 1
e z
r
'
rD
sQ
r m
r
Tz
L
R
Tz
L
R
'
rQ
r
r
r
r
(2.12)
And in time variable:
( ) ( ) ( ) ( ) ( ) ( ) 1 k wm 1 k P L 1 k i R L
R
e 1
e 1 k k
'
rQ r sD r m
r
Tz
L
R
Tz
L
R
'
rD
'
rD
r
r
r
r
− ⋅ − ψ ⋅ ⋅ − −

+ ⋅ − ψ = ψ














(2.13)
( ) ( ) ( ) ( ) ( ) ( ) 1 k wm 1 k P L 1 k i R L
R
e 1
e 1 k k
'
rD r sQ r m
r
Tz
L
R
Tz
L
R
'
rQ
'
rQ
r
r
r
r
− ⋅ − ψ ⋅ ⋅ + −

+ ⋅ − ψ = ψ














(2.14)
Direct Torque Control. Principles and Generalities.
2.9
Finally, stator flux can be obtained as follows:
( ) ( ) ( )
r
m
m
x
L
L '
rD L
L
sD sD
k k i k ⋅ ψ + ⋅ = ψ
(2.15)
( ) ( ) ( )
r
m
m
x
L
L '
rQ L
L
sQ sQ
k k i k ⋅ ψ + ⋅ = ψ
(2.16)
Torque is obtained using equation 1.82.
2.2.3.2 - Stator flux and torque estimator using V
dc
, i
sA
and i
sB
magnitudes.
In case that sensor-less direct torque control is desired, neither rotor speed nor rotor
position are available. In order to obtain an estimation of the stator flux space vector,
two possible methods may be applied:
§ An estimation that does not require speed or position signals may be used.
§ The motor speed may be estimated and fed into a flux estimator.
Stator flux and torque estimation based on the stator voltage equation does not
require speed or position information when stationary co-ordinates are applied. Thus,
from the VSI state and having the instantaneous value of the V
dc
, it can be deduced
the voltages in each phase. Once the voltage and the current values are calculated
and measured respectively, they are transformed in D and Q components by means of
Park transformations.
Finally from equation 1.64 it can be said:
( )dt i R u s
s
s
s

⋅ − = ψ
(2.17)
And expressing this equation in z operator by means of the z transform:
( ) s
s
s
1
1
s
i R u Ts
z 1
z
⋅ − ⋅ ⋅

= ψ


(2.18)
Expressing the previous equation in time and in its D and Q components:
( ) ( ) ( ) ( ) 1 k i R Ts 1 k u Ts 1 k k
sD s sD sD sD
− ⋅ ⋅ − − ⋅ = − ψ − ψ
( ) ( ) ( ) ( ) 1 k i R Ts 1 k u Ts 1 k k
sQ s sQ sQ sQ
− ⋅ ⋅ − − ⋅ = − ψ − ψ (2.19)
It may be deduced that the stator voltage space vector components are derived from the
inverter internal switch settings. This fact avoids the measurement of the stator voltage pulses.
In practice, the D.C. link voltage is measured, thus the D and Q components of the stator
voltage space phasor can be derived. It should be noted that a co-ordinate transform is not
Direct Torque Control. Principles and Generalities.
2.10
required. However, the accuracy of the estimation is limited due to the open loop integration
that can lead to large flux estimation errors [LUD 1].
2.2.4 - Parameter detuning effects.
Stator flux and torque estimators DTC based systems, shown in sections 2.2.3.1 and 2.2.3.2,
depart from their ideal behaviour when the motor model parameters used are not different
from the true motor model parameters. It can be proved that estimators that uses either
position or speed have similar characteristics, which are good enough, as long as the
estimated parameters have an error lower than 10%. However, the estimator that uses V
dc
performs very poorly when just small errors of its parameters are present [LUD 1].
In further chapters will be used the estimator introduced in section 2.2.3.1.
Direct Torque Control. Principles and Generalities.
2.11
2.3 - Improvements in Direct Torque Control.
2.3.1 - Introduction.
In the classical DTC, there are several drawbacks. Some of them can be summarised as
follows:
§ Sluggish response (slow response) in both start up and changes in either flux or torque.
§ Large and small errors in flux and torque are not distinguished. In other words, the same
vectors are used during start up and step changes and during steady state.
In order to overcome the mentioned drawbacks, there are different solutions, which can be
classified as follows:
§ Non artificial intelligence methods, mainly "sophisticated tables".
§ Predictive algorithms, used to determine the switching voltage vectors. A mathematical
model of the induction motor is needed. Electromagnetic torque and stator flux, are
estimated for sampling period for all possible inverter sates. Then, the predictive
algorithm selects the inverter switching states to give minimum deviation between the
predicted value of the electromagnetic torque and the reference torque.
§ Fuzzy logic based systems.
Next sections deal with all these methods, achieving a good knowledge of all them in order to
realise the best DTC improvement.
2.3.2 – Different tables.
2.3.2.1- First approach.
2.3.2.1.1 - Six sector table but different zones.
First idea that comes up, when it is tried to improve the DTC by means of changing the tables,
is to use six sectors, as in classical DTC, but changing the zones. Hence, instead of having as
a first sector the zone from -30º up to 30º, it will be from 0º up to 60º. It can be observed that
in this case, the states not used in the first zone will be V
3
and V
6
instead of V
1
and V
4
. This
novel sector division is shown in figure 2.3.
Direct Torque Control. Principles and Generalities.
2.12
Figure 2.3. Left: Classical DTC and its six sectors.
Right: Modified DTC and its new six sectors.
In Accordance with the figure 2.3, the general table II.III can be written.
CLASSICAL DTC
-30º → 30º
MODIFIED DTC
0º → 60º
V
1
30º → -30º
Torque ambiguity
0º → -60º
TD, FI
V
2
90º → 30º
TI, FI
60º → 0º
TI, FI
V
3
150º → 90º
TI, FD
120º → 60º
Flux ambiguity
V
4
-150º → 150º
Torque ambiguity
180º → 120º
TI, FD
V
5
-90º → -150º
TD, FD
-120º → -180º
TD, FD
V
6 -30º → -90º
TD, FI
-60º → -120º
Flux ambiguity
Table II.III: Behaviour of each state just in the first zone for the classical
DTC (left) and the modified DTC (right). It is shown the angle of the
voltage vector in the sector with reference to the normal and tangential
axis. TI/TD: Torque Increase/Decrease. FI/FD: Flux Increase/Decrease
It can be seen that the states V
1
and V
4
, are not used in the classical DTC (c_DTC)
because they can increase or decrease the torque at the same sector depending on if
the position is in its first 30 degrees or in its second ones. In the modified DTC
(m_DTC), V
3
and V
6
are the states not used. However, now the reason is the
v1(100)
v4(011)
v3(010) v2(110)
v5(001) v6(101)
v3(FD,TI)
v2 (FI,TI)
1
6 5
4
3
2
v6(FI,TD) v5(FD,TD)
v1(100)
v4(011)
v3(010) v2(110)
v5(001) v6(101)
v4(FD,TI)
v2 (FI,TI)
1
6
5
4
3
2
v1(FI,TD)
v5(FD,TD)
n
tg
n
tg
Direct Torque Control. Principles and Generalities.
2.13
ambiguity in flux instead of torque, as it was in the c_DTC. This is considered to be
an advantage in favour of the m_DTC as long as the main point is to control the
torque. Therefore, it is better to loose the usage of two states for flux ambiguity that
for torque one.
Table II.IV shows the m_DTC look up table for all its six sectors.
Φ τ S
1
S
2
S
3
S
4
S
5
S
6
TI V
2
V
3
V
4
V
5
V
6
V
1
T= V
0
V
7
V
0
V
7
V
0
V
7
FI
TD V
1
V
2
V
3
V
4
V
5
V
6
TI V
4
V
5
V
6
V
1
V
2
V
3
T= V
7
V
0
V
7
V
0
V
7
V
0
FD
TD V
5
V
6
V
1
V
2
V
3
V
4
Table II.IV. Look up table for Modified DTC. FD/FI: flux decrease/increase.
TD/=/I: torque decrease/equal/increase.
S
x
: stator flux sector. Φ: stator flux modulus error after the hysteresis block.
τ: torque error after the hysteresis block.
2.3.2.1.2 - Twelve sector table.
In classical DTC there are two states per sector that present a torque ambiguity. Therefore,
they are never used. In a similar way, in the modified DTC there are two states per sector that
introduce flux ambiguity, so they are never used either.
It seems a good idea that if the stator flux locus is divided into twelve sectors instead of just
six, all six active states will be used per sector. Consequently, it is arisen the idea of the
twelve sector modified DTC (12_DTC). This novel stator flux locus is introduced in figure
2.4. Notice how all six voltage vectors can be used in all twelve sectors. However, it has to be
introduced the idea of small torque increase instead of torque increase, mainly due to the fact
that the tangential voltage vector component is very small and consequently its torque
variation will be small as well.
Direct Torque Control. Principles and Generalities.
2.14
V4(FD, TsI)
V2 (FI,TI)
V1(FI, TsD)
V5(FD,TD)
V3(FD,TI)
V6(FI,TD)
1
12
2
3 4
5
6
7
8
9
11
10
V3 V2
V3 V2
V4
V4(FD, TsD)
V2 (FI,TI)
V1(FI, TsI)
V5(FD,TD)
V3(FD,TI)
V6(FI,TD)
Figure 2.4. Twelve sector modified DTC (12_DTC) and its sectors.
FD/FI: flux decrease/increase. TD/TI: torque decrease/increase. TsD/TsI: torque
small decrease/increase. Notice how all six voltage vectors can be used in all twelve
sectors, disappearing all ambiguities.
Table II.V can be written when a twelve-sector locus is used.
S
12
INCREASE DECREASE
Stator Flux V
1
, V
2
, V
6
V
3
, V
4
, V
5
Torque V
1
, V
2
, V
3
V
4
, V
5
, V
6
S
1
INCREASE DECREASE
Stator Flux V
1
, V
2
, V
6
V
3
, V
4
, V
5
Torque V
2
, V
3
, V
4
V
5
, V
6
, V
1
Table II.V: Table for sectors 12 and 1 in the 12_DTC. Notice how all six
voltage vectors can be used in all sectors disappearing all ambiguities.
As it has been mentioned in the previous paragraph, it is necessary to define small and large
variations. It is obvious that V
1
will produce a large increase in flux and a small increase in
torque in sector S
12
. On the contrary, V
2
will increase the torque in large proportion and the
flux in a small one.
Direct Torque Control. Principles and Generalities.
2.15
It is reasonable to deduce that the torque error should be divided in the number of intervals
that later on will be measured. Therefore, the hysteresis block should have four hysteresis
levels at is suggested in table II.VI.
If the flux and torque effects are divided into eight groups, it can be drawn figure 2.5.
tg torque
n
flux
150º
-150º
-30º
30º
TsI FI
TI FI TI FD
TD FD TD FI
TsD FI
TsI FD
TsD FD
Figure 2.5. Eight levels of flux and torque variation for the flux stator locus in the
12_DTC. FD/FI: flux decrease/increase. TD/TI: torque decrease/increase. TsD/TsI:
torque small decrease/increase. Notice how all six active voltage vectors can be used
in all twelve sectors, disappearing all ambiguities.
Finally, the look up table is presented in table II.VI.
Φ τ
S
1
S
2
S
3
S
4
S
5
S
6
S
7
S
8
S
9
S
10
S
11
S
12
TI V
2
V
3
V
3
V
4
V
4
V
5
V
5
V
6
V
6
V
1
V
1
V
2
TsI *V
2
V
2
*V
3
V
3
*V
4
V
4
*V
5
V
5
*V
6
V
6
*V
1
V
1
TsD V
1
*V
1
V
2
*V
2
V
3
*V
3
V
4
*V
4
V
5
*V
5
V
6
*V
6
FI
TD V
6
V
1
V
1
V
2
V
2
V
3
V
3
V
4
V
4
V
5
V
5
V
6
TI V
3
V
4
V
4
V
5
V
5
V
6
V
6
V
1
V
1
V
2
V
2
V
3
TsI V
4
*V
4
V
5
*V
5
V
6
*V
6
V
1
*V
1
V
2
*V
2
V
3
*V
3
TsD V
7
V
5
V
0
V
6
V
7
V
1
V
0
V
2
V
7
V
3
V
0
V
4
FD
TD V
5
V
6
V
6
V
1
V
1
V
2
V
2
V
3
V
3
V
4
V
4
V
5
Table II.VI: Switching table for the 12_DTC.
FD/FI: flux decrease/increase. TD/=/I: torque decrease/equal/increase.
S
x
: stator flux sector. Φ: stator flux modulus error after the hysteresis block.
τ: torque error after the hysteresis block.
(* there is no suitable state. It has been chosen the second most suitable).
2.3.2.1.3 - Simulations, results and conclusions.
In order to compare the responses, it is needed an index error. The one that is used is IE2,
which is the integral of the square error. It should be noted the fact that the index is computed
Direct Torque Control. Principles and Generalities.
2.16
by means of the square error instead of just the error; therefore, the more error is produced the
more emphasis it is given in the index.
The torque reference value is described in figure 2.6.
Te
t
6.7
-6.7
-13.4
1.5 0.25 0.05
Figure 2.6. Input torque reference value.
Stator flux set point was set to its nominal value. All simulations have been done just for the
Motor_1kW (see chapter 4).
The torque load was proportional to the motor speed, and it was equal to the nominal motor
torque at nominal speed.
The simulated results for first approach modified DTC are shown in table II.VII. Results are
not as good as expected.
IE2 Flux Torque
c_DTC 0.003161 1.019
m_DTC -- --
12_DTC 0.002869 1.3509
Table II.VII: IE2 values after the simulations. The reference torque value is shown
in figure 2.6, and the stator reference flux value was the nominal one.
( -- meaning that it didn't work).
Conclusions:
§ At the beginning and end of each sector, the flux locus is worse in both c_DTC and
m_DTC. It was believed that 12_DTC would solve this problem but it didn't.
§ It is observed that c_DTC performs better in steady state flux and worse in transient flux.
However, it performs worse in steady state torque and better in transient torque.
§ It is observed that m_DTC performs worse in steady state flux and better in transient flux.
However, it performs better in steady state torque and worse in transient torque.
Direct Torque Control. Principles and Generalities.
2.17
§ If the stator flux locus is observed the evolution is as shown in figure 2.7.
m_DTC
c_DTC
Figure 2.7. Evolution of the flux stator locus in the classical DTC and modified
DTC. It can be seen how the flux ripple is higher in the m_DTC than in the c_DTC.
§ According to the definition given in figure 2.5, it can be said that all the states in m_DTC
produce large variation in flux, meanwhile the ones in c_DTC produce large variation in
torque. Table II.VIII can be written. This fact explains both, the locus in figure 2.7 in the
previous conclusion and why the m_DTC is unable to reach nominal conditions. It can be
concluded that depending on the voltage vector angle referred to the normal reference
axis, the variation in flux and torque will be either small or large.
S
1
c_DTC
-30º → → 30º
m_DTC
0º → → 60º
V
1
30º → -30º
Not used
0º → -60º
Flux large
V
2
90º → 30º
Torque large
60º → 0º
Flux large
V
3
150º → 90º
Torque large
120º → 60º
Not used
V
4
-150º → 150º
Not used
180º → 120º
Flux large
V
5 -90º → -150º
Torque large
-120º → -180º
Flux large
V
6
-30º → -90º
Torque large
-60º → -120º
Not used
Table II.VIII. Behaviour of each state just in the sector 1 for the classical DTC (left)
and the modified DTC (right). It is shown the angle of the voltage vector in the
sector with reference to the normal axis. Large flux and large torque variations.
§ States, which are supposed to increase the torque in a small way (because they are either
between 0º and 30º or 150º and 180º), don't increase the torque at all. Instead they do
decrease the torque.
§ If index error flux (IE2) improves, the torque one becomes worse and the other way
round. It seems almost impossible to improve both at the same time.
Direct Torque Control. Principles and Generalities.
2.18
2.3.2.2 - Second approach.
After the bad previous results regarding c_DTC, m_DTC and 12_DTC; it is done a further
investigation in order to find out why the expectations were not achieved.
m_DTC
c_DTC
TI / FI TI / FD TI / FI TI / FD
Stator
Flux angle

120º
60º
120º 60º
15º
75º
45º
30º
150º
90º /º30º 150º / 90º 30º
45º
45º 105º 15º
60º / 0º
180º / 120º 60º
120º 0º
15º
75º
-15º
30º
150º 90º / 30º 150º / 90º -30º
45º
165º 45º 105º -45º
60º
180º 60º 120º -60º
V2
V1
V3
V3
V2
V4
V4
V3
V2
V1
135º
165º
135º
135º
135º
small torque medium torque large torque
Table II. IX. It is shown different possibilities for choosing the appropriate states
attending the criteria of the level of torque variation required. Just for the stator flux
angle from -60º up to 60º. It is shown the angles of each voltage vector referred to
the tangential and normal reference axis.
From table II.IX seems evident that for nominal torque the best table is the c_DTC because
large torque variation must be available. However, for small torque m_DTC is more
appropriate because small torque variations are needed. On the other hand, 12_DTC has got
plenty of sense when medium torque is required. This fact gives the idea that could be worthy
use different tables depending on the working point, which means depending on both the
speed and torque. Hence, four general working points are distinguished:
wm
Te
10%
100%
30%
100%
2 4
3 1
Figure 2.8. It is shown the typical torque-speed induction motor characteristic. It is
defined four working points.
Direct Torque Control. Principles and Generalities.
2.19
Simulations have done during 1.5s. Torque and flux reference values have been set to its
nominal values for the motor 1_kW (see chapter4).
IE2 c_DTC m_DTC
Work point Flux Torque Flux Torque
1 0.0177 0.3383 0.0023447 0.25697
2 0.00304 0.6084 0.0018883 0.56425
3 0.01592 0.5748 --- ---
4 0.03161 1.019 --- ---
Table II.X. IE2 simulated values. ( --- meaning that it didn't work).
Conclusions:
§ It is born the idea of the working point, due to the fact that each working point has
different most suitable look up table.
§ It is proved why in nominal conditions the best was c_DTC.
2.3.2.3 - Third approach.
It has been observed that some states don't behave, as they should, regarding torque. It should
be remembered that if its tangential component in the flux locus is positive the state is
supposed to increase the torque and the other way round. However, a more accurate study of
the torque expression gives the idea that the torque just depends on the "sin(ρs-ρr)", as it is
introduced in expression 2.3.
Once the speed is high, then the angle of the stator flux increases fast. Under these
circumstances, states that are supposed to increase the torque do it in a very small quantity.
Null states, which are supposed to keep the torque in the same level, decrease it in a notable
way. Finally, the voltage states which are supposed to decrease the torque do it but in a very
strong way, producing a big ripple in the torque response. Once one of the decreasing states is
applied, it is needed several increasing states to recuperate the set point value again.
This fact leads to the idea of modifying the c_DTC table once the working point is near to
nominal conditions; that is to say, always than both magnitudes are higher than 50% of the
nominal conditions. In this new table, the decreasing states are not used and the null states are
Direct Torque Control. Principles and Generalities.
2.20
used instead. The states that are used for maintaining the torque value, are the increasing ones.
Hence, another modified DTC (m2_DTC) is created and its table is shown in table II.XI.
Φ τ S
1
S
2
S
3
S
4
S
5
S
6
TI V
2
V
3
V
4
V
5
V
6
V
1
T= V
2
V
3
V
4
V
5
V
6
V
1
FI
TD V
0
V
7
V
0
V
7
V
0
V
7
TI V
3
V
4
V
5
V
6
V
1
V
2
T= V
3
V
4
V
5
V
6
V
1
V
2
FD
TD V
7
V
0
V
7
V
0
V
7
V
0
Table II.XI. Look up table for m2_DTC.
FD/FI: flux decrease/increase. TD/=/I: torque decrease/equal/increase.
S
x
: stator flux sector. Φ: stator flux modulus error after the hysteresis block.
τ: torque error after the hysteresis block.
Simulation results for working point 4, which were performed in the same conditions as in
2.3.2.2, have been as follows:
IE2 Flux Torque
c_DTC 0.003161 1.019
m2_DTC 0.003171 0.6731
Table II.XII. IE2 simulated values for the classical DTC and the second modified
DTC.
From this third approach can be concluded that when the working point is near to the nominal
conditions, it is a good idea do not use the torque decreasing states and use the null ones
instead. Under the same circumstances, for torque maintaining states is better use the increase
states instead of the null ones.
2.3.2.4 - Conclusions.
Several conclusions from, all this different look up tables study, have been obtained:
§ There is not a remarkable improvement in the motor performance changing the look up
tables. However, some little improvements can be achieved.
Direct Torque Control. Principles and Generalities.
2.21
§ The working point determines the most suitable voltage state. In other words, the most
suitable state not only depends on flux and torque error values and on the sector, but also
on the working point (torque and speed values).
§ The voltage vector angle referred to the normal reference axis implies a small or large
variation in stator flux and torque.
§ If the working point is high, the torque decreasing states are forbidden because they
introduce a high ripple. Instead of them, it is much better to use the null states.
2.3.3 – Predictive methods.
The point of this method is to choose the switching vectors that are in accordance with the
range of flux and torque errors, overcoming therefore, one of the main drawbacks of the
classical DTC. For this purpose a suitable mathematical model of the induction machine is
used and the electromagnetic torque is estimated for each sampling period for all possible
inverter modes. The predictive algorithm then selects the inverter switching states to give
minimum deviation between the predicted electromagnetic torque and the reference torque.
It is obtained a reference voltage value; therefore Space Vector Modulation has to be applied
[ARI 1]. If the machine is not in steady state, the probability of obtaining a reference voltage
decreases. In this case, the classical DTC will be applied.
The main problems for this solution are the procedure for calculating the voltage reference
and the following decomposition by means of SVM. The calculation of the voltage reference
value and the SVM need a high computation capability, loosing one of the best advantages of
DTC, which is its simplicity in calculus. Moreover, in any transient this predictive method
won't work properly being compulsory the usage the classical DTC instead.
A brief summary of the mathematical expression for implementing this method is introduced
in equations (2.20) and (2.21) [CAS 1] [HAB1] [VAS 2].
Equations (2.20) and (2.21) show the fact that this method increases the calculus of the drive
in a considerable way. Moreover, a good machine model is needed in order to know all the
parameters that appears in equation (2.20). Therefore, the mentioned method is not considered
a good solution for improving the DTC.
In order to obtain the voltage reference value, equations (2.20) must be solved.
Direct Torque Control. Principles and Generalities.
2.22
( )
sD sQ sQ sD
T P 3
L t 2
2
ref _ s
2
sQ
2
sD
2
z
T
sD z
2
T
sQ
2
T
2
z
D _ ref
2
D _ ref
e e
T 2 c
2 T 2 2 b
T a
0 c u b u a
z
s e
sD
sQ
sD
z
2
sQ
sD
2
z
sD
z sQ
⋅ ψ − ⋅ ψ + = α
ψ − ψ + ψ + 





⋅ ⋅ α ⋅ =
⋅ + ψ ⋅ ⋅ + ⋅ ψ ⋅ α ⋅ =






+ =
= + ⋅ + ⋅
⋅ ⋅
⋅ ∆ ⋅
ψ
ψ
ψ
⋅ ψ
ψ
ψ
⋅ ψ
(2.20)
Once the reference voltage value is obtained, it must be added the stator resistance drops.
s
s
ref ref i R u v ⋅ + =
(2.21)
This thesis, after being studied this predictive method, will be focused on the Fuzzy Logic
controllers, because it is thought that they can improve in a better way the classical DTC
without increasing the complexity in calculus that much.
2.3.4 - Fuzzy logic based systems.
In the classical DTC induction motor drive there are torque and flux ripples because none of
the inverter switching vectors is able to produce the desired changes in both torque and stator
flux. However, using various techniques can be reduced the ripples in the electromagnetic
torque and stator flux. Some of these techniques involve the usage of high switching
frequencies or the change in inverter topology, but it is also possible to use schemes which do
not involve any of the mentioned techniques, such as the duty ratio control [BIR 1] [VAS 3].
In DTC induction motor drive, the increase of switching frequency is desirable since it
reduces the harmonic content of the stator currents, and also leads to reduce torque harmonics.
However, if high switching frequency is used, it will result in an increment of switching
losses (leading to an efficiency reduction). It also will increase the stress of the semiconductor
devices of the inverter. Furthermore, in case of high switching frequency, a fast processor is
required since the control processing time becomes small. This increases the cost.
When changed the inverter topology is used, it is possible to use an increased number of
switches, but this will also increase the costs [MAR 2].
However, it is also possible to use schemes, such as duty ratio control, which do not involve
using inverters with a higher number of switches.
Direct Torque Control. Principles and Generalities.
2.23
In the classical DTC induction motor drive a voltage vector is applied for the entire period,
and this causes the stator current and electromagnetic torque exceeds its reference value early
during the cycle, causing a high torque ripple. Switching cycles then follows this, in which the
zero switching vectors are applied in order to reduce the electromagnetic torque to reference
value.
The suggested technique is based on applying to the inverter the selected active states just
enough time to achieve the torque and flux references values. The rest of the switching period
a null state is selected which won't almost change both the torque and the flux. Therefore, a
duty ratio (δ) has to be determined each switching time. By means of varying the duty ratio
between its extreme values (0 up to 1) it is possible to apply any voltage to the motor.
The optimum duty ratio per sampling period is a non-linear function of the electromagnetic
torque error, the stator flux position and the working point, which is determined by the motor
speed and the electromagnetic torque. It is obvious that it is extremely difficult to model such
an expression since it is a different non-linear function per working point. Thus, it is believed
that by using a Fuzzy Logic based DTC system it is possible to perform a fuzzy-logic-based
duty-ratio controller, where the optimum duty ratio is determined every switching period
[BIR 1][VAS 3].
The mentioned Fuzzy Logic method is considered a good solution for improving the DTC.
This thesis after being studied this method will be focused on the Fuzzy Logic controllers,
because it is thought that they can improve in a better way the classical DTC without
increasing the complexity in calculus that much.
2.3.5 - Regulating the flux.
As it has been explained in the previous sections, the ripples in the electromagnetic torque and
stator flux are extremely reduced by using controllers based on Fuzzy Logic systems or
predictive methods. However, in order to obtain even a better reduction, stator flux reference
value has to be adapted to an optimum value, which should be just large enough to produce
the desired torque. The reason is that with this optimum value the increase in the active state
is just large enough and the slight reduction in the null states is lower. Moreover, it is
achieved a reduction in the power reactive consumption taken from the mains supply.
Direct Torque Control. Principles and Generalities.
2.24
The optimum expression, which gives the just large enough stator flux for the desired torque
is obtained from expressions 1.97, 1.98 and 1.99. Re-arranging the mentioned expressions, the
final expression, which relates the stator flux and the torque, is given in 2.22
( ) [ ] ( ) ( ) [ ]
( )
T
L w
L L L L L w L L
sm s w s
R
P
s sm sm s r s sm s s
R
s
s
r
r
2
2
3 1
2
2
1 2
3
2
3
1 1
2
2
3
1
3
+ + + +
= ψ
(2.22)
Equation 2.22 can be presented as in equation 2.23.
( ) [ ] ( ) ( ) [ ]
( )
2
sm 2
3
sn
sn
w
1
s
r
R
2
P
2
1 s sm 2
3
sm 2
3
1 s 1 r sn
2
sm 2
3
1 s s
r
R
L w 3
L L L L L w L L
s
cte
T cte
+ + + +
=
⋅ = ψ
(2.23)
Finally the schematic of the DTC based on fuzzy controllers and optimising its reference
stator flux value is as follows:
Selection
Table
Torque ref VSI
stator flux
torque
estimators
induction
motor
flux sector
VSI state
+
-
sqr
+
-
cte
Flux ref optimized
Figure 2.9. Flux reference optimised controller in a classical DTC.
It should be noted that this optimised stator flux value it is not only valid in DTC but also in
any drive.
Direct Torque Control. Principles and Generalities.
2.25
2.4 - Interim conclusions.
It has been explained the basic concepts of the Classical Direct Torque Control. Two different
estimators for the stator flux and torque have been fully developed. However, just the
estimator from section 2.2.3.1 has been used in further chapters and has been implemented for
the further experimental results.
Despite the fact that the aim of this thesis is not the parameters detuning effects, it has been
studied its main effects and has been shortly summarised in section 2.2.4.
Four different methods for improving the classical DTC, which is the aim of the thesis, have
been studied and deeply discussed:
§ The first method is the search of a better look up table. After the research done in this
field, it can be concluded that by means of changing the table can not be remarkably
improved the DTC performance. However, some little improvements can be achieved.
Many conclusions have been obtained in this study, being the fundamental ideas for the
development of the most suitable Fuzzy Logic controller, as it is explained in next section
3.2.1.1.
§ The second method is the predictive one. It has been concluded that it is too complicated
regarding its real implementation because of its calculus, eliminating one of the DTC
advantages, which is its simplicity.
§ The application of the Fuzzy Logic for implementing a simple modulation between the
selected active state and a null one, is the third method. It can be concluded that this
method is very promising and this thesis will be focused on that in the following chapters.
§ Finally, the fourth method is the regulation of the stator flux reference value. This method
can be applied in any motor drive. Not only it reduces the torque ripple improving the
motor performance, but also reduces the power reactive consumption taken from the
mains supply. Therefore, this method will be considered in further sections as well.
3.1
CHAPTER 3.
FUZZY LOGIC DIRECT TORQUE CONTROL.
3.1 - Introduction.
In DTC induction motor drive there are torque and flux ripples because none of the VSI states
is able to generate the exact voltage value required to make zero both the torque
electromagnetic error and the stator flux error.
The suggested technique is based on applying to the inverter the selected active states just
enough time to achieve the torque and flux references values. A null state is selected for the
remaining switching period, which won't almost change both the torque and the flux.
Therefore, a duty ratio (δ) has to be determined each switching time. By means of varying the
duty ratio between its extreme values (0 up to 1), it is possible to apply any voltage to the
Fuzzy Logic Direct Torque Control.
3.2
motor. Therefore, this technique is based on a two-state modulation. These two states are the
active one and a null one.
The optimum duty ratio per sampling period is a non-linear function of the electromagnetic
torque error, the stator flux position and the working point, which is determined by the motor
speed and the electromagnetic torque. It is obvious that it is extremely difficult to model such
an expression since it is a different non-linear function per working point. Thus, it is believed
that by using a Fuzzy Logic based DTC system it is possible to perform a Fuzzy Logic based
duty-ratio controller, where the optimum duty ratio is determined every switching period
[BIR 1] [VAS 3].
The suggested Fuzzy Logic system is divided into two different Fuzzy Logic controllers. The
first one will act each time that the selected active VSI state has changed, being different to
the previous one. The second controller will act in the opposite situation, which is when the
active VSI selected state is the same as the previous one. These Fuzzy Logic controllers and
its functionality are explained deeper in section 3.2.
Both fuzzy logic controllers use the Centroid defuzzification method. The relation between
different conditions in the same rule is done by means of "and" operator. On the other hand,
the relationship between different rules is done by means of "or" operator.
Fuzzy Logic Direct Torque Control.
3.3
3.2 - Fuzzy Logic Direct Torque Control.
3.2.1 - Fuzzy Logic controller 1.
3.2.1.1- Objectives.
From the section entitled "first approach" (2.3.2.1) was lead the idea of small and large torque
increases or decreases (see figure 2.5). This idea will be taken into account by means of the
stator flux position as input of the Fuzzy Logic system.
From the section entitled "second approach" (2.3.2.2) was born the idea of the working point.
It does seem obvious that if the working point increases, then the duty cycle must tend to one
and in the opposite case the duty cycle must tend to zero. This idea is considered by means of
the working point membership input and its consequent distribution in the working plane.
Finally from the section entitled "third approach" (2.3.2.3) were born two main ideas. The
first one is that the higher the working point is, the more torque is decreased by the null states
(instead of keeping it constant). The second idea is that the torque decrease states decreases
the torque too much. As a solution, once a small decrease in torque is required, it will be
generated by means of modulating a torque increase state and a null one, being the result after
the entire period a small reduction in torque. The torque maintaining state will be generated
by means of a torque increase state, (which almost do not increase the torque under these
conditions), instead of a null one. In this Fuzzy Logic controller these ideas from the third
approach will be implemented by means of the working point and torque error inputs.
3.2.1.2- Inputs and output membership functions.
In such a Fuzzy Logic system, there are three inputs, stator flux position, electromagnetic
torque error and the motor working point i.e. speed and torque. The output is the duty ratio.
Fuzzy logic
controller 1
duty ratio
Stator flux
position
torque error
f(wm,T)
Figure 3.1. Fuzzy Logic duty ratio estimator
Fuzzy Logic Direct Torque Control.
3.4
The fuzzy system comprises four groups of rules. Two of them are used when the stator flux
is smaller than its reference value (Flux increase) and the other two in the opposite case (Flux
decrease). The working point is firstly divided into two different cases. These two cases are
speed w
pc
higher than torque T
pc
(both in percent) and the opposite case.
In any case just one fuzzy system is used per iteration, and it depends on the working point.
FI wpc>Tpc
FI wpc<Tpc
FD wpc<Tpc
FD wpc>Tpc
duty ratio
Fuzzy controller 1
Stator flux
position
torque error
f(wm,T)
Figure 3.2. Fuzzy logic duty ratio estimator. It can be seen its four different groups
of rules. Just one group of rules is used per iteration.
Stator flux position membership function is decomposed in three fuzzy sets as it is shown in
figure 3.3.
0º 30º 60º
Stator flux
position
s l m
Figure 3.3. Stator flux position membership input.
The torque error membership function is decomposed in six fuzzy sets. The "tei" values are as
follows: te1=5%Tn, te2=10%Tn, te3=20%Tn, where Tn is the nominal torque value. The
absolute values will depend on the nominal values of each electrical machine.
te1 te2 te3 -te3 -te2 -te1
s n-s l m n-m n-l
torque error
Figure 3.4. Torque error membership input.
The motor working point membership function is decomposed in just three fuzzy sets.
However they are different depending on the working point position. The "wTi" values are as
follows: wT1=120, wT2=200, wT3=275, wT4=100, wT5=160, wT6=270.
The different zones in the working plane T,w can be seen in figure 3.5.
Fuzzy Logic Direct Torque Control.
3.5
It should be noted from figure 3.5 that the working plane behaviour can not be described by
means of three lines in his entire plane. Therefore, the working plane is divided into two
zones and the fuzzyfication of these two zones is as well different.
Wpc>Tpc Wpc<Tpc
wp c =Tpc
100%
100%
wpc
Tpc
Tpc +2wp c =wT3
Tpc +2wpc =wT2
Tpc +2wpc =wT1
wT1 wT2 wT3
s l m
Tpc +2wpc
wT4 wT5 wT6
s l m
2Tpc +wpc
wp c =Tpc
100%
100%
wpc
Tpc
2Tp c +wp c =wT6
2Tp c +wp c=wT5
2Tp c +wp c=wT4
Figure 3.5. Working point membership inputs and the three different zones in the
T,w plane. Left w
pc
<T
pc
. Right w
pc
>T
pc
.
Duty ratio membership function is decomposed in five fuzzy sets. Notice that its membership
values are single tone to simplify the calculation. The "dci" values are as follows: dc1=0.15,
dc2=0.50, dc3=0.75.
1
duty ratio
dc1
s
dc2
m
dc3
l
1
vl
0
z
Figure 3.6. Duty ratio membership.
3.2.1.3- Rules:
The fuzzy system comprises four groups of rules, each of which contains 46 rules. Two of
them are used when the stator flux is smaller than its reference value (Flux increase) and the
other two in the opposite case (Flux decrease). In any case just one fuzzy system is used per
iteration, and it depends on the working point.
All four groups of 46 rules are listed in section A.2.1.
Fuzzy Logic Direct Torque Control.
3.6
3.2.2 - Fuzzy Logic controller 2.
3.2.2.1- Objectives.
The objective is to create an adaptive system. As long as the selected state is not changed,
then taking into account the last evolution is possible to predict next duty ratio increment to
reduce the torque error. Two examples are shown in figure 3.7.

n-l
l
m
s
n-s
n-m
Te*

n-l
l
m
s
n-s
n-m
Te*
Figure 3.7. It can be seen the evolution of the torque during one Tz. Left: if the
torque increment is negative medium, and the error in the previous iteration was
negative large, the duty ratio increment has to be small. This case corresponds to the
second rule (see section A.2.2). Right: if the torque increment is zero, and the error
in the previous state was small, the increment in duty ratio has to be zero. This case
corresponds to the seventeenth rule (see section A.2.2).
From figure 3.7 can be seen the adaptive characteristic of the Fuzzy Logic controller. On the
left of figure 3.7, it is obvious that next iteration should not decrease the duty ratio because
the torque value would take a value under the reference torque value. Therefore, the action
must be to increase a bit the duty cycle in order to place next torque value a bit above than the
torque reference value. However, on the right of figure 3.7, it is obvious that the torque
response has been excellent; therefore, it must continue with the same duty cycle value.
3.2.2.2- Inputs and output membership functions.
In such a Fuzzy Logic system, there are two inputs, torque increment and electromagnetic
torque error in the previous iteration. The output is the increment in duty ratio.
Fuzzy Logic Direct Torque Control.
3.7
Fuzzy logic
controller 2
∆δ
torque error (i-1)
∆ torque
Figure 3.8. Fuzzy logic controller increment_duty ratio estimator.
The torque increment membership function is decomposed in seven fuzzy sets, and the torque
error in the previous iteration membership function is decomposed in six as shown in figure
3.9.
te1 te2 te3 -te3 -te2 -te1
s n-s l m n-m n-l
torque error(i-1)
te1 te2 te3 -te3 -te2 -te1
s n-s l m n-m n-l
∆ torque
z
Figure 3.9. Torque increment and torque error in the previous iteration membership
inputs.
The "tei" values in both cases are as follows: te1=1%Tn, te2=5%Tn, te3=10%Tn, where Tn is
the torque nominal value. The absolute values will depend on the nominal values of each
machine.
The increment duty ratio membership function is decomposed in nine fuzzy sets. Notice that
its membership values are again single tone to simplify the calculation. The "∆δi" values are
as follows: ∆δ1=0.08, ∆δ2=0.15, ∆δ3=0.35 and ∆δ4=0.5.
∆δ
∆δ1
s
∆δ2
m
∆δ3
l
∆δ4
vl
0
z
−∆δ4
n-vl
−∆δ3
n-l
−∆δ2
n-m
−∆δ1
n-s
Figure 3.10. Increment duty ratio membership.
3.2.2.3- Rules:
The fuzzy system contains 37 rules. The rules number two and seventeen are explained in
figure 3.7.
All 37 rules are listed in section A.2.2.
Fuzzy Logic Direct Torque Control.
3.8
3.2.3 - Fuzzy Logic DTC schema.
Finally the schematic of the DTC based on fuzzy controllers is as shown in figure 3.11.
+
-
+
-
T ref wm
FLC
2
∆δ
VSI δ
+
-
δ
'
+
+
δ
FLC
1
2T + w
T+2w
model
DT
Table
induction
motor
z
-1
z
-1
z
-1
Flux ref
Figure 3.11. Schematic of the Fuzzy Logic DTC. In dashed line is separated the
novel fuzzy controller part.
It should be clear that despite the fact that there are two Fuzzy Logic controllers, just one
fuzzy controller is used per iteration. Therefore, the computation capability of the real system
won't be necessarily that much.
It should be noted as well, that the schematic in figure 3.11 is pretty similar to the classical
DTC one in figure 2.2, including the motor model, which will calculate the torque, stator flux
modulus values and its position. However, the torque error is just given in two levels instead
of three. It means that from the classical DTC table II.II just four rows are used, being
discharged the null states. However, null states are introduced by means of the duty cycle.
Obviously, there is a novel part that corresponds to the novel Fuzzy Logic controller already
described. Finally this new controller will give a duty ratio value, which can be obtained by
means of two different ways. The first way is through the FLC1 (Fuzzy Logic controller 1).
This way will be the least used. The second way corresponds to the adaptive controller
thought to track the reference values. This other way gives an increment of the duty ratio,
which will be added to the previous duty ratio value.
The full system will work first as the classical DTC obtaining the active state through the
classical table. Then the fuzzy controller will give the duty ratio.
Fuzzy Logic Direct Torque Control.
3.9
3.2.4 - Stator Flux Reference Optimum Controller.
As it has been explained in the previous sections, the ripples in the electromagnetic torque and
stator flux are extremely reduced by using controllers based on Fuzzy Logic systems or
predictive methods. However, in order to obtain even a better reduction, stator flux reference
value has to be adapted to an optimum value, which should be just large enough to produce
the desired torque. The reason is that with this optimum value both the increase in the active
state is just large enough and the slight reduction in the null states is lower. Moreover, it is
achieved a reduction in the reactive power consumption taken from the mains supply.
The optimum expression, which gives the just large enough stator flux for the desired torque
is given in equation 2.23 from section 2.3.5.
In figure 3.12 can be seen the final Fuzzy Logic DTC schema with the stator flux reference
optimum controller. Notice how the optimum stator flux value is calculated from the torque
set point value.
+
-
+
-
optimum
flux
T ref wm
FLC
2
∆δ
VSI δ
+
-
δ
'
+
+
δ
FLC
1
2T + w
T+2w
model
DT
Table
induction
motor
z
-1
z
-1
z
-1
Figure 3.12. Flux reference optimised controller in a Fuzzy Logic DTC.
Fuzzy Logic Direct Torque Control.
3.10
3.3 - Simulated results.
It is shown the simulation results per different working points, comparing the classical DTC
and the Fuzzy Logic DTC (FLDTC). More simulations than the ones shown have been done,
and the obtained results have been summarised in table III.I and table III.II.
In all simulations presented, it can be observed a much better behaviour of the FLDTC
performance, achieving one of the main objectives of the present work, which was to reduce
the torque ripple and consequently improve the motor performance.
A good adaptation of the FLC to any motor is proved since the simulation results are done for
two different motors, achieving in both cases a good response. These motors are the
"motor_1kW" and "motor_1.5kW". (All motors' details can be found in chapter 4).
An index error has been used to quantify the error in both the stator flux and torque responses.
This index is the integral of the square error (IE2), which is computed by means of the square
error instead of just the error; therefore, the more error is produced the more emphasis it is
given in the index.
All simulations have been realised with an ideal induction motor drive with no delays and the
sampling time (Tz) has been fixed to 100µs.
Fuzzy Logic Direct Torque Control.
3.11
Figure 3.13 A. Stator flux, torque and speed motor_1.5kW responses in Fuzzy Logic
DTC (left) and classical DTC (right). T=100%T
n
. w
m
=100%w
mn
. Notice the IE2 flux
and torque error indexes values.
Figure 3.13 B. Stator flux, torque and speed motor_1kW responses in Fuzzy Logic
DTC (left) and classical DTC (right). T=100%T
n
. w
m
=100%w
mn
. Notice the IE2 flux
and torque error indexes values.
0 0.02 0.04 0.06 0.08 0.1
-2
0
2
4
6
8
10
12
14
16
time (s)
w
m
T* T
ψ∗ ψ
IE2
ψ
=2.49e-3 IE2
T
=0.380
s
p
e
e
d
/
1
0

(
r
d
/
s
)



t
o
r
q
u
e

(
N
m
)





f
l
u
x

x
5

(
W
b
)
0 0.02 0.04 0.06 0.08 0.1
-2
0
2
4
6
8
10
12
14
16
s
p
e
e
d
/
1
0

(
r
d
/
s
)



t
o
r
q
u
e

(
N
m
)





f
l
u
x

x
5

(
W
b
)
IE2
ψ
=2.57e-3 IE2
T
=0.738
ψ∗ ψ
T* T
w
m
time (s)
0 0.02 0.04 0.06 0.08 0.1
-2
0
2
4
6
8
10
12
14
16
s
p
e
e
d
/
1
0

(
r
d
/
s
)



t
o
r
q
u
e

(
N
m
)





f
l
u
x

x
1
0

(
W
b
)
IE2
ψ
=2.55e-3 IE2
T
=0.251
w
m
T* T
ψ∗ ψ
time (s)
0 0.02 0.04 0.06 0.08 0.1
-2
0
2
4
6
8
10
12
14
16
IE2
ψ
=2.46e-3 IE2
T
=0.297
s
p
e
e
d
/
1
0

(
r
d
/
s
)



t
o
r
q
u
e

(
N
m
)





f
l
u
x

x
1
0

(
W
b
)
time (s)
ψ∗ ψ
T* T
w
m
Fuzzy Logic Direct Torque Control.
3.12
Figure 3.14 A. Stator flux, torque and speed motor_1.5kW responses in Fuzzy Logic
DTC (left) and classical DTC (right). T=10%T
n
. w
m
=10%w
mn
. Notice the IE2 flux
and torque error indexes values.
Figure 3.14 B. Stator flux, torque and speed motor_1kW responses in Fuzzy Logic
DTC (left) and classical DTC (right). T=10%T
n
. w
m
=10%w
mn
. Notice the IE2 flux
and torque error indexes values.
0 0.02 0.04 0.06 0.08 0.1
-2
0
2
4
6
8
10
12
14
16
s
p
e
e
d

(
r
d
/
s
)



t
o
r
q
u
e

(
N
m
)





f
l
u
x

x
1
0

(
W
b
)
IE2
ψ
=0.14e-3 IE2
T
=0.002
ψ∗ ψ
T* T
w
m
time (s)
0 0.02 0.04 0.06 0.08 0.1
-4
-2
0
2
4
6
8
10
12
14
16
IE2
ψ
=6.46e-3 IE2
T
=0.160
T* T
w
m
time (s)
ψ∗ ψ
s
p
e
e
d

(
r
d
/
s
)



t
o
r
q
u
e

(
N
m
)





f
l
u
x

x
1
0

(
W
b
)
0 0.02 0.04 0.06 0.08 0.1
-2
0
2
4
6
8
10
s
p
e
e
d
/
1
0

(
r
d
/
s
)



t
o
r
q
u
e

(
N
m
)





f
l
u
x

x
1
0

(
W
b
)
IE2
ψ
=0.14e-3 IE2
T
=1.35e-3
time (s)
T* T
ψ∗ ψ
w
m
0 0.02 0.04 0.06 0.08 0.1
-2
0
2
4
6
8
10
s
p
e
e
d
/
1
0

(
r
d
/
s
)



t
o
r
q
u
e

(
N
m
)





f
l
u
x

x
1
0

(
W
b
)
IE2
ψ
=7.46e-3 IE2
T
=0.0367
w
m
ψ∗ ψ
T* T
time (s)
Fuzzy Logic Direct Torque Control.
3.13
Figure 3.15 A. Stator flux, torque and speed motor_1.5kW responses in Fuzzy Logic
DTC (left) and classical DTC (right). T=100%T
n
. w
m
=10%w
mn
. Notice the IE2 flux
and torque error indexes values.
Figure 3.15 B. Stator flux, torque and speed motor_1kW responses in Fuzzy Logic
DTC (left) and classical DTC (right). T=100%T
n
. w
m
=10%w
mn
. Notice the IE2 flux
and torque error indexes values.
0 0.02 0.04 0.06 0.08 0.1
-2
0
2
4
6
8
10
12
14
16
time (s)
w
m
IE2
ψ
=3.14e-3 IE2
T
=0.304
T* T
ψ∗ ψ
s
p
e
e
d

(
r
d
/
s
)



t
o
r
q
u
e

(
N
m
)





f
l
u
x

x
5

(
W
b
)
0 0.02 0.04 0.06 0.08 0.1
-2
0
2
4
6
8
10
12
14
16
s
p
e
e
d

(
r
d
/
s
)



t
o
r
q
u
e

(
N
m
)





f
l
u
x

x
5

(
W
b
)
w
m
ψ∗ ψ
T* T
time (s)
IE2
ψ
=2.88e-3 IE2
T
=0.418
0 0.02 0.04 0.06 0.08 0.1
0
1
2
3
4
5
6
7
8
9
10
s
p
e
e
d
/
1
0

(
r
d
/
s
)



t
o
r
q
u
e

(
N
m
)





f
l
u
x

x
1
0

(
W
b
)
IE2
ψ
=2.53e-3 IE2
T
=0.189
time (s)
T* T
ψ∗ ψ
w
m
0 0.02 0.04 0.06 0.08 0.1
0
1
2
3
4
5
6
7
8
9
10
s
p
e
e
d
/
1
0

(
r
d
/
s
)



t
o
r
q
u
e

(
N
m
)





f
l
u
x

x
1
0

(
W
b
)
T* T
ψ∗ ψ
w
m
time (s)
IE2
ψ
=2.74e-3 IE2
T
=0.169
Fuzzy Logic Direct Torque Control.
3.14
Figure 3.16 A. Stator flux, torque and speed motor_1.5kW responses in Fuzzy Logic
DTC (left) and classical DTC (right). T=50%T
n
. w
m
=50%w
mn
. Notice the IE2 flux
and torque error indexes values.
Figure 3.16 B. Stator flux, torque and speed motor_1kW responses in Fuzzy Logic
DTC (left) and classical DTC (right). T=50%T
n
. w
m
=50%w
mn
. Notice the IE2 flux
and torque error indexes values.
0 0.02 0.04 0.06 0.08 0.1
0
1
2
3
4
5
6
7
8
9
10
w
m
time (s)
s
p
e
e
d
/
1
0

(
r
d
/
s
)



t
o
r
q
u
e

(
N
m
)





f
l
u
x

x
1
0

(
W
b
)
ψ∗ ψ
T* T
IE2
ψ
=3.08e-3 IE2
T
=0.224
0 0.02 0.04 0.06 0.08 0.1
0
1
2
3
4
5
6
7
8
9
10
s
p
e
e
d
/
1
0

(
r
d
/
s
)



t
o
r
q
u
e

(
N
m
)





f
l
u
x

x
1
0

(
W
b
)
time (s)
IE2
ψ
=0.882e-3 IE2
T
=0.060
T* T
ψ∗ ψ
w
m
0 0.02 0.04 0.06 0.08 0.1
0
1
2
3
4
5
6
7
8
9
10
s
p
e
e
d
/
1
0

(
r
d
/
s
)



t
o
r
q
u
e

(
N
m
)





f
l
u
x

x
1
0

(
W
b
)
IE2
ψ
=2.57e-3 IE2
T
=0.068
time (s)
w
m
T* T
ψ∗ ψ
0 0.02 0.04 0.06 0.08 0.1
0
1
2
3
4
5
6
7
8
9
10
s
p
e
e
d
/
1
0

(
r
d
/
s
)



t
o
r
q
u
e

(
N
m
)





f
l
u
x

x
1
0

(
W
b
)
time (s)
ψ∗ ψ
T* T
w
m
IE2
ψ
=0.88e-3 IE2
T
=0.033
Fuzzy Logic Direct Torque Control.
3.15
3.4 - Interim conclusions.
After all the research done in section 2.3, this thesis is focused on introducing a modulation in
the DTC. A Fuzzy Logic controller controls this modulation, between the selected active state
and a null one. Therefore, it has been suggested and deeply described the Fuzzy Logic
controller, which together with the DTC will create the Fuzzy Logic DTC. The Fuzzy Logic
controller designed is adaptive, improving even more the whole FLDTC.
Simulation results show the validity of the FLDTC method not only achieving a considerable
reduction in torque ripple, but also reducing the reactive power consumption taken from the
mains supply.
Simulated results corroborate all the presented work. Moreover, the simulations correspond to
two different motors being proved the validity of the FLDTC for any motor. It has been used
just one switching period (100µs) in all simulations, and no delays have been considered.
In table III.I is shown the error value index (IE2) obtained in the simulations per different
working points for the motor_1.5kW.
In table III.II is shown the error value index (IE2) obtained in the simulations per different
working points for the motor_1kW.
In both motors the results are pretty similar. Therefore, the first conclusion is that the Fuzzy
Logic controller works properly in any motor, thus the FLDTC is a good control method for
any motor.
From the tables III.I and III.II, it can be concluded:
§ IE2 in torque is always smaller in FLDTC than in classical DTC. Therefore, the validity
of FLDTC is corroborated.
§ IE2 in flux is nearly always smaller in FLDTC than in classical DTC. The smaller the
torque set point is the smaller flux FLDTC IE2 value is. However, there are just a few
exceptions when the torque set point is near to the nominal one. Under these
circumstances, both flux error indexes are pretty similar. The reason is that the stator flux
ripple is reduced by means of the stator flux reference optimum controller introduced in
section 2.3.5, that always works but when the torque set point is near to the nominal value.
Fuzzy Logic Direct Torque Control.
3.16
IE2 FLDTC c_DTC
Tpc Wpc Flux Torque Flux Torque
100% 10% 3.14e-3 0.30441 2.88e-3 0.4184
50% 50% 0.882e-3 0.06047 3.08e-3 0.2248
10% 10% 0.1494e-3 0.002641 6.46e-3 0.16093
100% 100% 2.49e-3 0.3806 2.57e-3 0.7385
100% 50% 2.61e-3 0.322 2.61e-3 0.499
50% 100% 0.86e-3 0.06832 2.60e-3 0.2557
75% 75% 1.635e-3 0.171 2.61e-3 0.383
Table III.I: Error index values (IE2) obtained form the motor_1.5kW
simulations per different working points. A comparison between the
classical DTC and the Fuzzy Logic DTC is done, not only for the torque
error values but also for the stator flux ones.
IE2 FLDTC c_DTC
Tpc Wpc Flux Torque Flux Torque
100% 10% 2.74e-3 0.169 2.53e-3 0.189
50% 50% 0.88e-3 0.033 2.57e-3 0.068
10% 10% 0.14e-3 0.00135 7.46e-3 0.0367
100% 100% 2.55e-3 0.251 2.46e-3 0.297
Table III.II: Error index values (IE2) obtained form the motor_1kW
simulations per different working points. A comparison between the
classical DTC and the Fuzzy Logic DTC is done, not only for the torque
error values but also for the stator flux ones.
4.1
CHAPTER 4.
DESIGN of EXPERIMENTAL INDUCTION MOTOR DRIVE
SYSTEM.
4.1 - Introduction.
In previous chapters it has been introduced the theoretical study of both the DTC and the
FLDTC. Also, these studies have been verified by means of simulations. Next chapter deals
with the implementation of both versions of Direct Torque Control. Previously, a drive
system has been firstly design and then used.
This chapter is focused on the architecture of the full drive system and the motor workbench,
being entirely described in detail its main features. Also, the present chapter deals with the
program tools and the organisation of the different tasks. (All programs are listed in section
A2).
Design of experimental induction motor drive system.
4.2
A brief description of the real implemented programs and its main routines are explained.
Finally, some DTC and FLDTC real simulations, which have been realised taking into
account the real drive with all its delays and the finally used sampling period (166µs), are
shown.
Design of experimental induction motor drive system.
4.3
4.2 - Induction motor drive architecture.
Figure 4.1 shows the workbench, which has been fully set up for the present thesis. All the
system drive has been specially developed not only for this thesis but also for any
implementation of further research in the topic of motor drives. Therefore, this workstation is
supposed to be very versatile as well as powerful [BED 2] [BED 3].
PC
DPRAM
( 1K X 32 )
PC MEMORY
INTERFACE
CONTROL
AND STATUS
REGISTERS
PC I/O
INTERFACE
ISA
ISA
DSP
TMS320C32
DAUGTHER
MODULE
(A/D 4X16)
DIO 32
DSP
LINK
PORT
8bits
PC/C32
VSI
induction
motor
DC
generator
Tl
wm
DT
Figure 4.1. Experimental workbench. Its processors are PC and DSP. Communications
between the drive and the PC/DSP are solved by means of 32 digital I/O lines and 4 ADC.
DC generator is used as a load.
The experimental workbench is formed by the following described elements:
§ Digital Signal Processor (DSP) TMS320C32. It is one of the processors that execute most
of the programs of the control algorithm. It has got a self called "daughter module" that is
composed by four analogue to digital converters of 16 bits, being its sampling frequency
50kHz. The processor has got as well an input/output board TTL of 32 bits. These two
boards make possible and easier the communication between the induction motor drive
and the DSP based processor system [LSI 1] [LSI 2] [LSI 3].
§ Personal Computer (PC). This is the other processor that executes program code as well. It
works as a host, not only due to the fact that it has inside all the DSP based boards, but
also because it allows the edition and compilation of DSP and PC programs, keeping all
the reference values and results in its memory.
§ Voltage Source Inverter based on Isolated Gate Bipolar Transistors. This device supplies
the induction motor generating a three phase voltage with variable both frequency and
Design of experimental induction motor drive system.
4.4
amplitude. Its main characteristics are its power that is 25kW and its maximum current
50A. It can be supplied in either 220 V or 380 V. There are the necessary protections such
as current limit, over temperature, over DC link voltage, and IGBT saturation.
§ Three-phase Induction motor_1kW. This machine was used for all the simulated results.
Its main characteristics are as follows:
Star: 380V/2.8A
Delta: 220V/4.7A
Nominal mechanical power: P
n
= 1.35 CV = 993.6 W
Nominal angular speed: ω
mn
= 1420 r.p.m. = 148.6 rd/s
Pair of poles: P = 2
Efficency = 72%
cos(φ) = 0.75
T
T
2.2
START
nom
=
T
T
2.4
MAX
nom
=
Inertia moment: J = 0.006 kg·m
2
In this section is being presented the values per phase obtained performing both no
load and locked rotor tests for the "T" induction steady state model.
Stator resistance: R
1
= 7.13 Ω
Rotor resistance: R
2
= 8.18 Ω
Magnetising inductance: L
m
= 0.6040 H
Leakage inductance: L
1
= L
2
= 0.0301 H
Maximum and nominal values calculated using the identified parameters:
Nominal torque: T
n
= 6.7 N·m
Shaft angular speed: ω
mn
= 1378.4 r.p.m. = 144.35 rd/s
Nominal slip: s = 8.1·10
-2
RMS nominal magnetising current: I
mn
= 1.05 A
Start torque: T
START
= 12.46 N·m
Design of experimental induction motor drive system.
4.5
Maximum torque: T
MAX
= 16 N·m (at ω
mMAX
= 851.94 r.p.m.)
Maximum slip speed: sω
sMAX
= 135.73 rad/s
RMS maximum stator current: I
1
= 6.87 A
§ Three-phase Induction motor_1.5kW. This machine not only has been used in all the
simulation results but also in the experimental ones. Therefore, all the control strategies
have been proved in this machine. This motor is mechanically jointed to the DC
servomotor. Its main characteristics are as follows:
Star: 380V / 3.5A
Delta: 220V / 6A
Nominal mechanical power: P
n
= 1.5kW
Nominal angular speed: ω
mn
= 1450 r.p.m. = 151.8 rd/s
Pair of poles: P = 2
Efficency = 76.9%
cos(φ) = 0.8
In this section is being presented the values per phase obtained performing both no
load and locked rotor tests for the "T" steady state induction motor model.
Stator resistance: R
1
= 4.3 Ω
Rotor resistance: R
2
= 5.05 Ω
Magnetising inductance: L
m
= 0.3056 H
Leakage inductance: L
1
= L
2
= 0.0146 H
Maximum and nominal values calculated using the identified parameters:
Nominal torque: T
n
= 9.9 Nm
Shaft angular speed: ω
mn
= 1400 r.p.m. = 146.62 rd/s
Nominal slip: s = 6.67·10
-2
§ Permanent magnet DC servomotor. Its shaft is mechanically jointed to the Induction
motor's one. Its function is to act as a mechanical load, changing the load torque to the
Induction motor. Its main characteristics are as follows:
Manufacturer: Control Techniques.
Design of experimental induction motor drive system.
4.6
Type: Matador DCM 9B 30/20.
Armature voltage: 200V.
Maximum stable armature current: 20A.
Maximum peak armature current: 90A.
Armature resistance (at 25
o
C): 0.31W.
Armature inductance: 2.3mH.
Number of poles: 4.
Type of isolation: F (100
o
C temperature increment ).
Thermal time constant: 80minutes.
Maximum speed: 3000rpm.
Maximum stable torque: 11Nm.
Induced armature voltage: 57V/Krpm.
Torque constant at 25
o
C: 0.55Nm/A( for ω
m
= 0 rd/s).
Rotor inertia: 10⋅10
-3
kgm
2
.
Weight: 22kg
§ Power Resistances. These resistances are electrically connected to the DC Generator
absorbing different currents and consequently changing the load torque.
§ Dynamometer. It gives a voltage proportional to the shaft speed. Its main characteristics
are as follows:
Manufacturer: Radio-Energie.
Model: RE.0444 N1S 0.06 EG
Induced voltage: 0.06V/rpm
Maximum current: 0.18A.
Maximum angular speed: 10000rpm.
§ Encoder. It is together with the DC motor. It supplies three signals and its complementary
ones. Two of them are a square signals with one quarter of period delay. The third one
gives one impulse each turn.
§ Adaptive Signal Board. These circuits adapt the motor currents and the speed signals to
the Analogue to Digital converters. There are some filters in order to reduce the noise
keeping its delay as small as possible [LSI 3].
Design of experimental induction motor drive system.
4.7
The system architecture based on two processors (see figure 4.1) allows the implementation
of complex algorithms and the modular programming of the system being possible to change
one processor program keeping the other. Both processors can perform the programs
independently, exchanging the data by means of a DPRAM, which is a Dual Port Random
Access Memory. One processor can interrupt the other. The PC can monitor the DSP by
means of the interface based in the ISA bus. [LSI 1]
Design of experimental induction motor drive system.
4.8
4.3 - Implementing DTC and FLDTC.
4.3.1 - Task distribution.
As it has been said previously, the system architecture allows the system to be reprogrammed
easily. Therefore, many tasks were changed and proved without modifying the others.
Figure 4.2 shows the full schematic of the FLDTC. All blocks inside the dashed line are the
ones corresponding to the fuzzy logic controllers. The PC performs some of these blocks. The
rest of the tasks are performed by the DSP, which are mainly the DTC itself including the
motor model and the consequent control of the real time.
+
-
+
-
Flux ref
T ref
wm
FLC 2
∆δ
VSI δ
z
-1
+
-
δ'
z
-1
+
+
δ
FLC 1
2T + w
T + 2w
motor model
DT
Selection
Table
induction
motor
Figure 4.2. Schematic of the Fuzzy logic DTC. In dashed line is separated the novel fuzzy
controller part, which is partially performed by the PC. The DSP performs the rest of the
tasks controlling the real time.
It should be clear that despite the fact that there are two fuzzy logic controllers, just one fuzzy
controller is used per iteration. Therefore, the computation capability of the real system won't
be necessarily that much.
4.3.2 - Programming the system.
The DSP has been programmed using both C language and assembler. All the tasks, which its
execution time was critical, have been programmed in assembler. Also, tasks that configure
the DSP hardware and interfaces have been programmed in assembler.
Design of experimental induction motor drive system.
4.9
The compiler allows mixed C and assembler code. [TII 2] [TII 3] [TII 4].
PC has been programmed in C language, due to the fact that its tasks are not critical regarding
time [MAT 1]. The real time is performed by the DSP.
The DTC and the FLDTC close the loop each 166µs.
4.3.3 - Timing of the real implementation.
Once the real system is implemented, the first idea that must be taken into account is the delay
due to the non ideal behaviour of the whole system. The most significant delays are
introduced by the Analogue to Digital Converter (ADC) and the control algorithm. The ADC
sampling frequency has been set to 20kHz, being the period 50µs. In the c_DTC, as it can be
seen in figure 4.3, the control algorithm is divided into three routines. These three routines are
firstly attending the ADC interruption processing all the data, secondly the estimation of the
torque and flux values and finally the DTC itself. All these routines take around 30µs to be
executed. Therefore, there is a total delay of 80 µs from the sampled data to the action of
sending the new VSI state. Finally the data is saved in order to obtain the experimental
results.
Figure 4.3. DTC timing. The DTC is executed each 166µs. There is a delay of 80µs
from the sampled data until the active state is sent.
In the FLDTC the timing, shown in figure 4.4, is pretty similar to the classical DTC, already
shown in figure 4.3. However, some differences are present, mainly due to the FLC. Then,
once the active new state is sent, the FLC starts being executed. Because some parts of this
controller are executed in the PC, the DSP waits until they are finished obtaining the duty
cycle. Once the duty cycle is obtained, the timer is programmed. All this process takes 50µs.
i+1 i
ADC Est DTC send
save
data
sample
50us 30us
166us
Design of experimental induction motor drive system.
4.10
Therefore, any duty cycle, which needs to change the active state before this time, is ignored.
Therefore, not all the duty cycles are possible, being the minimum duty cycle 50% and the
maximum 100%.
Figure 4.4 . FLDTC timing. The FLDTC is executed each 166µs. There is a delay of
80µs from the sampled data until the active state is sent. The Fuzzy Logic Controller
needs 50µs to be calculated.
Seeing figures 4.3 and 4.4 the idea that both systems have the same delays in order to validate
the comparison should be clear.
i+1 i
ADC Est DTC send FLC
save
data
wait ρ timer
sample
50us 30us 50us
166us
Design of experimental induction motor drive system.
4.11
4.4 - Simulation of the real plant.
As it has been said in section 4.3.3, there are some limitations in the real plant. These
limitations were not taken into account in the whole theoretical study realised in chapter 3.
These limitations can be summarised as follows:
§ The sample time can not be as small as wanted. In the real plant it is 166µs.
§ There is a delay of 30µs due to the software time execution.
§ There is a delay of 50µs in the worst case due to the Analogue to digital conversion.
§ The duty cycle values are limited due to the delay in the FLC execution. The real values
are in the range of 50% up to 100%.
First three limitations are taken into account into the real simulation. It will be considered that
its effect is similar to having a sample time of 166µs+30µs+50µs, being equal to 246µs.
Therefore, the torque ripple is higher; in concrete is 246/100 times higher; that is to say 2.46.
All magnitudes related to the torque ripple should be pre scaled according to this factor.
Therefore, 2.46 will divide all torque error FLC inputs and the torque hysteresis value will be
2.46 times bigger.
Simulations shown from figure 4.5 to 4.9 are done under these real conditions. All them
should be compared with the experimental results obtained in chapter 5.
Figure 4.5. Stator flux, torque and speed motor_1.5kW responses in Fuzzy Logic
DTC (left) and classical DTC (right). Torque reference value is 9.8Nm, i.e.
T=100%T
n
. Torque load is being fixed by connecting a 4 ohms resistor to the DC
generator. All real system limitations are taken into account.
0 0.01 0.02 0.03 0.04 0.05
-15
-10
-5
0
5
10
15
s
p
e
e
d
/
(
-
1
0
)

(
r
d
/
s
)



t
o
r
q
u
e

(
N
m
)


f
l
u
x
x
(
-
1
)

(
W
b
)
time (s)
T* T
ψ ψ∗
w
m
0 0.01 0.02 0.03 0.04 0.05
-15
-10
-5
0
5
10
15
w
m
time (s)
T* T
ψ ψ∗
s
p
e
e
d
/
(
-
1
0
)

(
r
d
/
s
)



t
o
r
q
u
e

(
N
m
)


f
l
u
x
x
(
-
1
)

(
W
b
)
Design of experimental induction motor drive system.
4.12
Figure 4.6. Stator flux, torque and speed motor_1.5kW responses in Fuzzy Logic
DTC (left) and classical DTC (right). Torque reference value is 4.9Nm, i.e.
T=50%T
n
. Torque load is being fixed by connecting a 4 ohms resistor to the DC
generator. All real system limitations are taken into account.
Figure 4.7. Stator flux, torque and speed motor_1.5kW responses in Fuzzy Logic
DTC (left) and classical DTC (right). Torque reference value is 2.45Nm, i.e.
T=25%T
n
. Torque load is being fixed by connecting a 4 ohms resistor to the DC
generator. All real system limitations are taken into account.
From now on, all real simulations and all experimental results are just done or obtained from
motor_1.5kW. From figures 4.5, 4.6 and 4.7 can be concluded that the FLDTC is still
working better than the classical DTC. Therefore, it is proved that the FLC can be adapted to
any plant with its own characteristics and limitations, keeping its good performance.
However, due to the limitations of the real system, both systems work worse when comparing
these results with the one obtained in section 3.3.
0 0.01 0.02 0.03 0.04 0.05
-10
-8
-6
-4
-2
0
2
4
6
8
10
s
p
e
e
d
/
(
-
1
0
)

(
r
d
/
s
)



t
o
r
q
u
e

(
N
m
)


f
l
u
x
x
(
-
1
)

(
W
b
)
ψ ψ∗
T* T
time (s)
w
m
0 0.01 0.02 0.03 0.04 0.05
-10
-8
-6
-4
-2
0
2
4
6
8
10
w
m
time (s)
T* T
ψ ψ∗
s
p
e
e
d
/
(
-
1
0
)

(
r
d
/
s
)



t
o
r
q
u
e

(
N
m
)


f
l
u
x
x
(
-
1
)

(
W
b
)
0 0.01 0.02 0.03 0.04 0.05
-6
-4
-2
0
2
4
6
8
s
p
e
e
d
/
(
-
1
0
)

(
r
d
/
s
)



t
o
r
q
u
e

(
N
m
)


f
l
u
x
x
(
-
1
)

(
W
b
)
ψ ψ∗
T* T
time (s)
w
m
0.05 0.06 0.07 0.08 0.09 0.1
-6
-4
-2
0
2
4
6
8
w
m
time (s)
T* T
ψ ψ∗
s
p
e
e
d
/
(
-
1
0
)

(
r
d
/
s
)



t
o
r
q
u
e

(
N
m
)


f
l
u
x
x
(
-
1
)

(
W
b
)
Design of experimental induction motor drive system.
4.13
Figure 4.8 . D and Q current components. D and Q flux components and its module.
All magnitudes correspond to the simulation realised in figure 4.6 right. That is to
say, classical DTC, Torque reference value 4.9Nm, i.e. T=50%T
n
.
Figure 4.9. Figure 4.8 vertical zoom.
D and Q stator flux components and its modulus value. Notice how once one
component is zero, the other is equal to the modulus
0.02 0.04 0.06 0.1 0.12 0.14
-10
-8
-6
-4
-2
0
2
4
6
8
10
isD isQ
ψsD ψsQ ψ
i
s
D

(
A
)



i
s
Q

(
A
)



ψ

s
D

(
W
b
)



ψ

s
Q

(
W
b
)



ψ

(
W
b
)
time (s)
0 0.02 0.04 0.06 0.1 0.12 0.14 0.16
-1.5
-1
-0.5
0
0.5
1
1.5
time (s)
ψ

s
D

(
W
b
)



ψ

s
Q

(
W
b
)



ψ

(
W
b
)
ψsD ψsQ ψ
Design of experimental induction motor drive system.
4.14
4.5 - Interim conclusions.
This chapter has summarised the development of the equipment used for the experimental
three phase induction motor drive.
It has been presented a parallel processing architecture with two processors (PC, DSP)
running simultaneously. The DSP is based in the PC ISA bus, which gives a high immunity to
conducted and radiated interference. This architecture solves the data exchange between
processors and allows the experimentation of an AC motor control system with two
processors that can execute two different programs in parallel. Reprogramming the system is
considered to be one of the advantages of the system, because the changes in one processor
program do not affect to the other. Also, the system is capable of acquiring external signals
and of generating digital outputs signals [BED 2] [BED 3].
Finally, it has been pointed out the main problems due to the limitations of the real systems. It
has been suggested a way to overcome the mentioned limitations keeping the proper
performance of the system. Simulated results are shown to validate the work.
5.1
CHAPTER 5.
EXPERIMENTAL RESULTS.
5.1 - Corroborating the real implementation.
5.1.1 - Classical DTC.
All graphics of the present chapter correspond to the experimental results obtained from the
real plant just using the induction motor_1.5kW. In all cases, the reference values were as
follows:
§ Torque reference value = 4.9Nm. Torque hysteresis value = 1.3Nm.
§ Flux reference value = 1.15Wb. Flux hysteresis value =0.05Wb.
§ Sample time = Ts = Tz = 166µs.
All graphics try to show the correct behaviour of the classical DTC.
Experimental results
5.2
Figure 5.1. D and Q current components. Electromagnetic torque plus 10Nm.
Figure 5.2 should be compared with its simulated equivalent in figure 4.8. It can be said that
the simulation matches perfectly with the experimentation.
Figure 5.2. D and Q current components. D and Q flux components and its module.
0 100 200 300 400 500 600 700 800 900
-10
-5
0
5
10
15
20
T i sD isQ
i
s
D


(
A
)




i
s
Q


(
A
)




t
o
r
q
u
e

+

1
0


(
N
m
)
n x Ts. Ts=166us
0 100 200 300 400 500 600 700 800 900
-10
-8
-6
-4
-2
0
2
4
6
8
10
n x Ts. Ts=166us
i sD i sQ
ψsD ψsQ ψ
i
s
D

(
A
)



i
s
Q

(
A
)



ψ

s
D

(
W
b
)



ψ

s
Q

(
W
b
)



ψ

(
W
b
)
Experimental results
5.3
Figure 5.3 should be compared with its simulated equivalent in figure 4.9. Again the
simulated results are equal to the experimental ones.
Figure 5.3. Figure 5.2 horizontal zoom of the samples 300 to 550.
D and Q stator flux components and its modulus value. Notice how once one
component is zero, the other is equal to the modulus.
Figure 5.4. Stator flux. Notice how it follows a circular shape.
0 50 100 150 200 250
-1.5
-1
-0.5
0
0.5
1
1.5
ψsD ψsQ ψ
n x Ts. Ts=166us
ψ

s
D

(
W
b
)



ψ

s
Q

(
W
b
)



ψ

(
W
b
)
-1.5 -1 -0.5 0 0.5 1 1.5
-1.5
-1
-0.5
0
0.5
1
1.5
ψ sD (Wb)
ψ
s
Q
(
W
b
)
Experimental results
5.4
Figure 5.5 Flux and torque errors signals. Flux sector. Selected state and all the
inputs in its look up table, which are flux and torque errors signals and flux sector.
Moreover, it is shown D, Q, modulus and hysteresis limits, all magnitudes for the
stator flux.
Figure 5.6. Figure 5.5 horizontal zoom of the samples 0 to100.
0 50 100 150 200 250 300 350 400
-6
-5
-4
-3
-2
-1
0
1
2
n x Ts. Ts=166us
sect state T_e
ψsQ ψ ψsD ψ_e ψ+hst ψ−hst
f
l
u
x
_
h
s
t
_
e
r
r
o
r



t
o
r
q
u
e
_
h
s
t
_
e
r
r
o
r
ψ
(
W
b
)
s
e
c
t
o
r
*
(
-
1
)



s
t
a
t
e
*
(
-
1
)
0 10 20 30 40 50 60 70 80 90 100
-6
-5
-4
-3
-2
-1
0
1
2
sect state T_e
ψsQ ψ ψsD ψ_e ψ+hst ψ−hst
n x Ts. Ts=166us
f
l
u
x
_
h
s
t
_
e
r
r
o
r



t
o
r
q
u
e
_
h
s
t
_
e
r
r
o
r
ψ
(
W
b
)
s
e
c
t
o
r
*
(
-
1
)



s
t
a
t
e
*
(
-
1
)
Experimental results
5.5
Figure 5.7. Figure 5.6 horizontal zoom of the samples 0 to10.
It can be deduced the correct behaviour of the look up table according to its inputs.
For instance, in the third sample the look up table inputs are: torque increase, flux
decrease and first sector. Therefore, the selected sate is the third.
Figure 5.8. Figure 5.7 vertical zoom. It is shown the correct behaviour of flux
hysteresis error value. For example, from samples 4 to 5, once the modulus
decreases under the negative hysteresis value, its error value changes from 0 to 1.
1 2 3 4 5 6 7 8 9 10
-6
-5
-4
-3
-2
-1
0
1
2
sect state T_e
ψsQ ψ ψsD ψ_e ψ+hst ψ−hst
n x Ts. Ts=166us
f
l
u
x
_
h
s
t
_
e
r
r
o
r



t
o
r
q
u
e
_
h
s
t
_
e
r
r
o
r
ψ
(
W
b
)
s
e
c
t
o
r
*
(
-
1
)



s
t
a
t
e
*
(
-
1
)
1 2 3 4 5 6 7 8 9 10
0
0.2
0.4
0.6
0.8
1
1.2
1.4
1.6
1.8
2
n x Ts. Ts=166us
f
l
u
x
_
h
s
t
_
e
r
r
o
r



t
o
r
q
u
e
_
h
s
t
_
e
r
r
o
r
ψ
(
W
b
)
T_e ψ ψ_e ψ−hst ψ+hst
Experimental results
5.6
Figure 5.9. Selected state, all look up table inputs (being flux and torque errors
signals and flux sector) and torque value plus 5 and its hysteresis limits plus 5.
Figure 5.10. Figure 5.9 horizontal zoom of the samples 20 to 30.
It can be deduced the correct behaviour of the look up table according to its inputs
and the torque hysteresis error signal. For example, from samples 2 to 4 the torque
increases crossing both hysteresis limits, changing from 2 to 1 and finally to 0 the
torque hysteresis error values. Of course, all selected states are the correct ones.
0 50 100 150 200 250 300 350 400
-10
-5
0
5
10
15
ψ_e state sect T T-hst T+hst T_e
n x Ts. Ts=166us
t
o
r
q
u
e
+
5

(
N
m
)



f
l
u
x
_
h
s
t
_
e
r
r
o
r



t
o
r
q
u
e
_
h
s
t
_
e
r
r
o
r
s
e
c
t
o
r
*
(
-
1
)



s
t
a
t
e
*
(
-
1
)
1 2 3 4 5 6 7 8 9 10
-6
-4
-2
0
2
4
6
8
10
12
14
ψ_e state sect T T-hst T+hst T_e
n x Ts. Ts=166us
t
o
r
q
u
e
+
5

(
N
m
)



f
l
u
x
_
h
s
t
_
e
r
r
o
r



t
o
r
q
u
e
_
h
s
t
_
e
r
r
o
r
s
e
c
t
o
r
*
(
-
1
)



s
t
a
t
e
*
(
-
1
)
Experimental results
5.7
Figures 5.11 and 5.12 are shown in order to justify the validity of the torque values. If it is
considered the particular moment that the Q flux component is equal to zero, then the torque
expression is simplified as it is shown in equation 5.1.
( )
sQ sD sD sQ sQ sD
i 6 . 1 i i c P T ⋅ ψ ⋅ ≅ ⋅ ψ − ⋅ ψ ⋅ ⋅ = (5.1)
Figure 5.11. D, Q flux and current components and torque value.
Figure 5.12. Left: figure 5.11 horizontal zoom of the samples 20 to 30.
Right: figure 5.11 horizontal zoom of the samples 205 to 215.
In both cases Q flux component tends to zero. Therefore, the torque value is equal to
1.6 times the product of D flux component and Q current component. Considering
that the flux modulus is 1.15, the torque value is 1.84 the Q current component.
1 2 3 4 5 6 7 8 9 10
-2
-1
0
1
2
3
4
5
6
7
8
n x Ts. Ts=166us
T
i sD isQ
ψsD ψsQ
i
s
D

(
A
)



i
s
Q

(
A
)

ψ
s
D

(
W
b
)
ψ
s
Q
(
W
b
)
t
o
r
q
u
e

(
N
m
)
1 2 3 4 5 6 7 8 9 10
-8
-6
-4
-2
0
2
4
6
8
T
isD isQ
ψsD ψsQ
n x Ts. Ts=166us
i
s
D

(
A
)



i
s
Q

(
A
)

ψ
s
D

(
W
b
)
ψ
s
Q
(
W
b
)
t
o
r
q
u
e

(
N
m
)
0 50 100 150 200 250 300
-10
-8
-6
-4
-2
0
2
4
6
8
10
T
isD isQ
ψsD ψsQ
n x Ts. Ts=166us
i
s
D

(
A
)



i
s
Q

(
A
)

ψ
s
D

(
W
b
)
ψ
s
Q
(
W
b
)
t
o
r
q
u
e

(
N
m
)
Experimental results
5.8
5.1.2 - Fuzzy Logic DTC.
All graphics of the present chapter correspond to the experimental results obtained from the
real plant. In all cases, the reference values were as follows:
Torque reference value = 1.9Nm. Torque hysteresis value = 1.3Nm
Flux hysteresis value = 0.05Wb
Sample time = Ts = Tz = 166µs.
The flux reference value is the optimum one obtained from equation 2.23.
All graphics show the correct behaviour of the FLDTC.
Figure 5.13. This graphic shows the excellent behaviour FLDTC. Notice how during
almost all sectors the active selected state is almost always the same, keeping the
torque ripple into a good value.
0 50 100 150 200 250 300
-6
-5
-4
-3
-2
-1
0
1
2
3
4
state sect EQ δ T
n x Ts. Ts=166us
t
o
r
q
u
e

(
N
m
)


e
q
u
a
l


d
u
t
y
_
c
y
c
l
e


s
e
c
t
o
r
*
(
-
1
)


s
t
a
t
e
*
(
-
1
)
Experimental results
5.9
Figure 5.14. Figure 5.13 horizontal zoom of the samples 35 to 55.
The sector is always the third and the selected state is the fourth except in the sample
nine being the second. Once the selected state changes, the equal value changes
from one to zero switching the FLC from the adaptive to the non-adaptive one.
Figure 5.15. Figure 5.13 horizontal and vertical zoom of the samples 51 to 60.
It is shown the excellent behaviour of the adaptive FLC, modulating the duty cycle
value in order to keep the torque among its reference value.
1 2 3 4 5 6 7 8 9 10
0.5
1
1.5
2
EQ δ T
n x Ts. Ts=166us
t
o
r
q
u
e

(
N
m
)


e
q
u
a
l


d
u
t
y
_
c
y
c
l
e
0 2 4 6 8 10 12 14 16 18 20
-4
-3
-2
-1
0
1
2
3
4
state sect EQ δ T
t
o
r
q
u
e

(
N
m
)


e
q
u
a
l


d
u
t
y
_
c
y
c
l
e


s
e
c
t
o
r
*
(
-
1
)


s
t
a
t
e
*
(
-
1
)
n x Ts. Ts=166us
Experimental results
5.10
5.2 - FLDTC and DTC comparison.
Results obtained from the reported investigation, when comparing the classical DTC drive
system with the novel FLDTC drive system, are illustrated from figure 5.16 to 5.25. Each
torque reference value has been applied to two different load conditions, being the resistance
values connected to the DC generator equal to 4 ohms and 8 ohms.
When the torque response characteristic for the two drive systems is compared, it can be seen
that the ripple in the torque characteristics is very much less for the novel FLDTC system than
for the classical DTC system for any torque reference value.
The torque ripple compared to the simulated results from chapter 3 is much bigger. This is
due to the following different reasons:
§ Simulations were done with a sample time equal to 100µs, meanwhile the real system
works at 166µs.
§ The real system has got an inherent delay of 80µs, meanwhile the simulations were done
without taking into account any delay.
§ Despite the fact that the controller should work properly for any sample time value, the
implemented controller was the optimum for 100µs as a sampling time and no delay,
being possible finding a more optimised FLC for the real plant conditions.
§ Due to the delays in executing the fuzzy controllers, the duty cycle can not take all the
possible values, being higher than 50%, as it is explain deeper in 4.3.3.
However, some simulations were done in section 4.4 taking into account all the previously
mentioned real limitations. These simulated results matches completely with the experimental
ones.
Experimental results
5.11
Figure 5.16 should be compared with its simulated equivalent in figure 4.5. It can be said that
the simulation matches perfectly with the experimentation due to the fact that the simulated
results did take into account all the real limitations.
Figure 5.16. Stator flux, torque and speed motor_1.5kW responses in Fuzzy Logic
DTC (left) and classical DTC (right).
Load resistance is 4Ω. Torque reference value is 9.8Nm, i.e. T=100%T
n
.
Figure 5.17. Stator flux, torque and speed motor_1.5kW responses in Fuzzy Logic
DTC (left) and classical DTC (right).
Load resistance is 8Ω. Torque reference value is 9.8Nm, i.e. T=100%T
n
.
0 50 100 150 200 250 300
-15
-10
-5
0
5
10
15
s
p
e
e
d
/
(
-
1
0
)

(
r
d
/
s
)



t
o
r
q
u
e

(
N
m
)


f
l
u
x
x
(
-
1
)

(
W
b
)
w
m
ψ ψ∗
T* T
n x Ts. Ts=166us
0 50 100 150 200 250 300
-15
-10
-5
0
5
10
15
T* T
ψ ψ∗
w
m
s
p
e
e
d
/
(
-
1
0
)

(
r
d
/
s
)



t
o
r
q
u
e

(
N
m
)


f
l
u
x
x
(
-
1
)

(
W
b
)
n x Ts. Ts=166us
0 50 100 150 200 250 300
-15
-10
-5
0
5
10
15
s
p
e
e
d
/
(
-
1
0
)

(
r
d
/
s
)



t
o
r
q
u
e

(
N
m
)


f
l
u
x
x
(
-
1
)

(
W
b
)
T* T
ψ ψ∗
w
m
n x Ts. Ts=166us
0 50 100 150 200 250 300
-15
-10
-5
0
5
10
15
T* T
ψ ψ∗
w
m
n x Ts. Ts=166us
s
p
e
e
d
/
(
-
1
0
)

(
r
d
/
s
)



t
o
r
q
u
e

(
N
m
)


f
l
u
x
x
(
-
1
)

(
W
b
)
Experimental results
5.12
Figure 5.18. Stator flux, torque and speed motor_1.5kW responses in Fuzzy Logic
DTC (left) and classical DTC (right).
Load resistance is 4Ω. Torque reference value is 7.35Nm, i.e. T=75%T
n
.
Figure 5.19. Stator flux, torque and speed motor_1.5kW responses in Fuzzy Logic
DTC (left) and classical DTC (right).
Load resistance is 8Ω. Torque reference value is 9.8Nm, i.e. T=75%T
n
.
0 50 100 150 200 250 300
-15
-10
-5
0
5
10
15
s
p
e
e
d
/
(
-
1
0
)

(
r
d
/
s
)



t
o
r
q
u
e

(
N
m
)


f
l
u
x
x
(
-
1
)

(
W
b
)
w
m
ψ ψ∗
T* T
n x Ts. Ts=166us
0 50 100 150 200 250 300
-15
-10
-5
0
5
10
15
T* T
ψ ψ∗
w
m
n x Ts. Ts=166us
s
p
e
e
d
/
(
-
1
0
)

(
r
d
/
s
)



t
o
r
q
u
e

(
N
m
)


f
l
u
x
x
(
-
1
)

(
W
b
)
0 50 100 150 200 250 300
-15
-10
-5
0
5
10
15
T* T
ψ ψ∗
w
m
n x Ts. Ts=166us
s
p
e
e
d
/
(
-
1
0
)

(
r
d
/
s
)



t
o
r
q
u
e

(
N
m
)


f
l
u
x
x
(
-
1
)

(
W
b
)
0 50 100 150 200 250 300
-15
-10
-5
0
5
10
15
T* T
ψ ψ∗
s
p
e
e
d
/
(
-
1
0
)

(
r
d
/
s
)



t
o
r
q
u
e

(
N
m
)


f
l
u
x
x
(
-
1
)

(
W
b
)
w
m
n x Ts. Ts=166us
Experimental results
5.13
Figure 5.20 should be compared with its simulated equivalent in figure 4.6. Again, the
simulated results match perfectly with the experimental ones.
Figure 5.20. Stator flux, torque and speed motor_1.5kW responses in Fuzzy Logic
DTC (left) and classical DTC (right).
Load resistance is 4Ω. Torque reference value is 4.9Nm, i.e. T=50%T
n
.
Figure 5.21. Stator flux, torque and speed motor_1.5kW responses in Fuzzy Logic
DTC (left) and classical DTC (right).
Load resistance is 8Ω. Torque reference value is 4.9Nm, i.e. T=50%T
n
.
0 50 100 150 200 250 300
-10
-8
-6
-4
-2
0
2
4
6
8
10
s
p
e
e
d
/
(
-
1
0
)

(
r
d
/
s
)



t
o
r
q
u
e

(
N
m
)


f
l
u
x
x
(
-
1
)

(
W
b
)
w
m
ψ ψ∗
T* T
n x Ts. Ts=166us
0 50 100 150 200 250 300
-10
-8
-6
-4
-2
0
2
4
6
8
10
s
p
e
e
d
/
(
-
1
0
)

(
r
d
/
s
)



t
o
r
q
u
e

(
N
m
)


f
l
u
x
x
(
-
1
)

(
W
b
)
w
m
ψ ψ∗
T* T
n x Ts. Ts=166us
0 50 100 150 200 250 300
-10
-8
-6
-4
-2
0
2
4
6
8
10
T* T
ψ ψ∗
s
p
e
e
d
/
(
-
1
0
)

(
r
d
/
s
)



t
o
r
q
u
e

(
N
m
)


f
l
u
x
x
(
-
1
)

(
W
b
)
w
m
n x Ts. Ts=166us
0 50 100 150 200 250 300
-10
-8
-6
-4
-2
0
2
4
6
8
10
T* T
ψ ψ∗
w
m
n x Ts. Ts=166us
s
p
e
e
d
/
(
-
1
0
)

(
r
d
/
s
)



t
o
r
q
u
e

(
N
m
)


f
l
u
x
x
(
-
1
)

(
W
b
)
Experimental results
5.14
Figure 5.22 should be compared with its simulated equivalent in figure 4.7. It can be said that
the simulation matches perfectly with the experimentation due to the fact that the simulated
results took into account all the non-ideal limitations.
Figure 5.22. Stator flux, torque and speed motor_1.5kW responses in Fuzzy Logic
DTC (left) and classical DTC (right).
Load resistance is 4Ω. Torque reference value is 2.45Nm, i.e. T=25%T
n
.
Figure 5.23. Stator flux, torque and speed motor_1.5kW responses in Fuzzy Logic
DTC (left) and classical DTC (right).
Load resistance is 8Ω. Torque reference value is 2.45Nm, i.e. T=25%T
n
.
0 50 100 150 200 250 300
-6
-4
-2
0
2
4
6
8
s
p
e
e
d
/
(
-
1
0
)

(
r
d
/
s
)



t
o
r
q
u
e

(
N
m
)


f
l
u
x
x
(
-
1
)

(
W
b
)
w
m
ψ ψ∗
T* T
n x Ts. Ts=166us
0 50 100 150 200 250 300
-6
-4
-2
0
2
4
6
8
s
p
e
e
d
/
(
-
1
0
)

(
r
d
/
s
)



t
o
r
q
u
e

(
N
m
)


f
l
u
x
x
(
-
1
)

(
W
b
)
w
m
ψ ψ∗
T* T
n x Ts. Ts=166us
0 50 100 150 200 250 300
-8
-6
-4
-2
0
2
4
6
8
s
p
e
e
d
/
(
-
1
0
)

(
r
d
/
s
)



t
o
r
q
u
e

(
N
m
)


f
l
u
x
x
(
-
1
)

(
W
b
)
w
m
ψ ψ∗
T* T
n x Ts. Ts=166us
0 50 100 150 200 250 300
-8
-6
-4
-2
0
2
4
6
8
s
p
e
e
d
/
(
-
1
0
)

(
r
d
/
s
)



t
o
r
q
u
e

(
N
m
)


f
l
u
x
x
(
-
1
)

(
W
b
)
w
m
ψ ψ∗
T* T
n x Ts. Ts=166us
Experimental results
5.15
Figure 5.24. Stator flux, torque and speed motor_1.5kW responses in Fuzzy Logic
DTC (left) and classical DTC (right).
Load resistance is 4Ω. Torque reference value is 1.9Nm, i.e. T=19%T
n
.
Figure 5.25. Stator flux, torque and speed motor_1.5kW responses in Fuzzy Logic
DTC (left) and classical DTC (right).
Load resistance is 8Ω. Torque reference value is 1.9Nm, i.e. T=19%T
n
.
0 50 100 150 200 250 300
-6
-4
-2
0
2
4
6
8
s
p
e
e
d
/
(
-
1
0
)

(
r
d
/
s
)



t
o
r
q
u
e

(
N
m
)


f
l
u
x
x
(
-
1
)

(
W
b
)
w
m
ψ ψ∗
T* T
n x Ts. Ts=166us
0 50 100 150 200 250 300
-6
-4
-2
0
2
4
6
8
s
p
e
e
d
/
(
-
1
0
)

(
r
d
/
s
)



t
o
r
q
u
e

(
N
m
)


f
l
u
x
x
(
-
1
)

(
W
b
)
w
m ψ ψ∗
T* T
n x Ts. Ts=166us
0 50 100 150 200 250 300
-6
-4
-2
0
2
4
6
8
s
p
e
e
d
/
(
-
1
0
)

(
r
d
/
s
)



t
o
r
q
u
e

(
N
m
)


f
l
u
x
x
(
-
1
)

(
W
b
)
w
m
ψ ψ∗
T* T
n x Ts. Ts=166us
0 50 100 150 200 250 300
-6
-4
-2
0
2
4
6
8
s
p
e
e
d
/
(
-
1
0
)

(
r
d
/
s
)



t
o
r
q
u
e

(
N
m
)


f
l
u
x
x
(
-
1
)

(
W
b
)
w
m ψ ψ∗
T* T
n x Ts. Ts=166us
Experimental results
5.16
5.3 - Interim conclusions.
In this chapter, the implementation of two high performance control strategies for three cage
rotor induction motors has been described. Being the first classical DTC and the second the
FLDTC, both with stator flux and torque estimation.
Experimental results are shown to analyse in detail the correct behaviour of both
implementations. All magnitudes evolution are analysed and justified.
Also, the main research point of the present thesis, which is the torque ripple reduction, has
been experimentally proved by means of the torque, flux and speed real experimental results.
Moreover, the adaptation of the ideal FLC not only to any motor but also to the limitations of
the real systems is corroborated.
6.1
CHAPTER 6.
CONCLUSIONS. FURTHER WORK.
6.1 - Conclusions.
6.1.1 - Direct Torque Control.
Direct Torque Control is supposed to be one of the best controllers for driving any induction
motor. Its main principles have been introduced and deeply explained. It is also demonstrated
in this thesis that the method of DTC also allows the independent and decoupled control of
motor torque and motor stator flux.
Two different estimators for the stator flux and torque have been fully developed.
It is also apparent from the investigation reported that DTC strategy is simpler to implement
than the flux vector control method because voltage modulators, and co-ordinate
Conclusions. Further work.
6.2
transformations are not required. Although, it introduces some disadvantages, being the
torque ripple one of the worst.
Four different methods for improving the classical DTC, which is the aim of the thesis, have
been studied and deeply discussed:
§ The first method is the search of a better look up table. After the research done in this
field, it can be concluded that by means of changing the table can not be remarkably
improved the DTC performance. However, some little improvements can be achieved.
Many conclusions have been obtained in this study, being the fundamental ideas for the
development of the most suitable Fuzzy Logic Controller.
§ The second method is the predictive one. It implies, not only the usage of Space Vector
Modulation, but also the calculation of the proper voltage reference. It has been concluded
that it is too complicated regarding its real implementation because of its calculus,
eliminating one of the DTC advantages, which is its simplicity.
§ The application of the Fuzzy Logic for implementing a simple modulation between the
selected active state and a null one, is the third method. It can be concluded that this
method is very promising. Therefore, the present thesis has been focused on that.
§ Finally, the fourth method is the regulation of the stator flux reference value. This method
can be applied in any motor drive. Not only it reduces the torque ripple improving the
motor performance, but also reduces the power reactive consumption taken from the
mains supply. Therefore, this method will be further considered.
6.1.2 - Fuzzy Logic Direct Torque Control.
After all the research done, this thesis is focused on introducing a modulation in the DTC. A
Fuzzy Logic Controller is in charge of controlling this modulation between the selected active
state and a null one. Therefore, it has been suggested and deeply described the Fuzzy Logic
Controller, which together with the DTC will create the Fuzzy Logic DTC. The FLC designed
is adaptive, improving even further the whole FLDTC. It has been deeply described and
justified its way of working, making emphasis on the fact that not only its inputs had to be the
torque errors and flux locus, but also the motor operating point. Moreover, the idea that this
fuzzy controller has to be adaptive has been taken into account.
Conclusions. Further work.
6.3
Simulation results show the validity of the FLDTC method not only achieving a considerable
reduction in torque ripple, but also reducing the energy consumption taken from the mains
supply.
Moreover, the simulations correspond to two different motors being proved the validity of the
FLDTC for any motor.
Firstly, all simulations have been obtained for an ideal generic plant, with sampling time
equal to 100µs and no delays. Once the experimental workbench was set up, its particular
parameters of sampling time and delay had been taken into account adapting the FLC. New
simulated results with the real plant have been obtained and presented, proving the adaptation
of the FLC to any plant, maintaining its good performance.
6.1.3 - Experimental motor drive system.
It has been set up versatile experimental equipment based on two processors, a PC and a DSP.
Its main characteristics are as follows:
§ The DSP is based in the ISA PC bus, being a good architecture to avoid any electro
magnetic interference.
§ Both processors can work independently. Therefore the system allows the parallel
processing. This parallel architecture has the following advantages:
§ It is a high computational capability system. DSP boards can be added, working all
them in parallel.
§ This architecture is currently quite common in industrial applications, giving the
possibility of testing the future real prototypes.
§ Communication between both processors is achieved easily through the Dual Port RAM.
Both processors can access this memory simultaneously, without interrupting the other.
§ Its program process can be modular, allowing the addition of new algorithms without
changing the other ones. It allows the possibility of an easy experimentation of new
algorithms.
§ The DSP can be easily programmed in both C language and assembler. Assembler has
been used in the critical real time tasks. All PC tasks have been programmed in C
language, due to the fact that they are not critical regarding the execution time.
Conclusions. Further work.
6.4
§ All experimental results are based in ASCII files, allowing the exportation to any
computer or workstation.
6.1.4 - Real implementation.
Experimental results, which match perfectly with the real simulations, have been obtained
showing the validity of the entire research. Therefore, the idea of reducing the torque ripple,
which is supposed to be one of the disadvantages of the classical DTC, by means of a fuzzy
logic modulation, has been experimentally corroborated.
The experimental results are divided into two groups. The first group shows the proper
behaviour of the classical DTC and FLDTC. In these graphics, it has been shown the
evolution of all magnitudes, even with a resolution equal to the sampling time (166µs). Using
the second group of experimental results, it has been done the comparison between the
classical DTC and the FLDTC for different motor working points. It has been proved how the
torque ripple is much lower in the FLDTC than in the classical DTC for any working points.
Moreover, the adaptation of the ideal FLC not only to any motor but also to the limitations of
the real system has been corroborated.
Conclusions. Further work.
6.5
6.2 - Further work.
All further work is summarised schematically in the following ideas:
§ Developments of new fuzzy controllers to achieve better performance. This new fuzzy
controller should, at least, take into account the following ideas:
§ Develop a completely auto adaptive controller.
§ The controller must be adaptive to any motor.
§ Try to overcome the electrical noises, which appears in any power drive.
§ Study the torque ripple reduction not only with fuzzy modulators but also with multilevel
converters.
§ Find optimum controllers, not only for torque ripple reductions, but also for reducing EMI
and for increasing energy savings form the mains.
§ Quantify the real savings of reactive power obtained from the optimised stator flux
reference value.
§ Sensorless FLDTC implementation, just sensing two currents and the DC voltage and by
means of either Kalman filter techniques or observers.
§ Study and apply different FLDTCs, not only to induction motors as it has been done in the
present thesis, but also to any electrical motor.
R.1
REFERENCES.
[ABB 1] ABB Sistemas Industriales, S.A. " Control Directo de Par", Technical Guide.
[ALF 1] Alfonso, D.; Gianluca, G.; Ignazio,M. ; Aldo, P. "An improved Look-up table for
Zero Speed Control in DTC Drives", Proceedings EPE'99, 8
th
European
Conference on Power Electronics and Applications. Lausanne. September /1999.
[ARI 1] Arias, A.; Romeral, J.L.; Bedford, D.; Aldabas, E "Hard-less Dead-time
Compensator for PWM Voltage Inverters", Proceedings IECON'98, 24
th
Annual
Conference of the IEEE Industrial Electronics Society. Aachen. Germany.
September 1998. Pages 780 - 785.
[ARI 2] Arias, A.; Romeral, J.L.; Aldabas, E.; Jayne, M.G. "Improving Direct Torque
Control by means of Fuzzy Logic". SAAEI'00, Seminario Anual de Automática,
Electrónica Industrial e Instrumentación, 2000. ISBN: 84-699-2994-1. September
2000. Pages 197 - 200.
[ARI 3] Arias, A.; Romeral, J.L.; Aldabas, E.; Jayne, M.G. "Fuzzy Logic Direct Torque
Control". ISIE'00. IEEE International Sypmposium on Industrial Electronics.
December 2000. Puebla. Mexico.
[ATT 1] Attaianese, C.; Nardi, V.; Prefetto, A.; Tomasso, G. "Vectorial Torque Control: A
Novel Approach to Torque and Flux Control of Induction Motor Drives" IEEE
Trans. on Industry Applications, Vol. 35, No. 6; November/December 1999,
pages 1399 - 1405.
[BED 1] Bedford, D.; Arias, A.; Aldabas, E.; Romeral, J. L." Sistema de Control Vectorial
Adaptativo de -Motores de Inducción basado en DSP ". SAAEI'97, Seminario
Anual de Automática, Electrónica Industrial e Instrumentación, 1997. ISBN: 84-
8498-451-6. Copiformes S.L./J.Dede. September 1997.
[BED 2] Bedford, D.; Arias, A.; Aldabas, E.; Romeral, J. L. “Parallel Processing AC Motor
Adaptive Vector Control System”. SAAEI'98, Seminario Anual de Automática,
Electrónica Industrial e Instrumentación, 1998. ISBN: 84-89654-11-5.
IBERDROLA INS. TEC. September 1998.
[BED 3] Bedford, D.; Arias, A.; Aldabas, E.; Romeral, J. L.” PC and DSP based AC motor
Adaptive Vector Control System”. Proceedings VECPAR'98, 3
rd
. International
Meeting on Vector and Parallel Processing. Porto (Portugal). June 1998.
References.
R.2
[BED 4] Bedford, D.; Romeral, J. L.; Arias, A.; Aldabas, E." Fuzzy Adaptive Speed
Controller without Reference Model". Proceedings EPE'99. 8
th
European
Conference on Power Electronics and Applications. ISBN: 90-75815-04-2.
September 1999. Lausanne (Switzerland).
[BED 5] Bedford, D.; "Control Vectorial Adaptativo de Motores Asíncronos de
Inducción". Doctoral Thesis. Univeritat Politècnica de Catalunya. October 1999.
[BIR 1] Bird, I. G,; Zelaya, H. " Fuzzy logic torque ripple reduction for DTC based AC
drives". Electronics Letters. 14
th
August 1997. Vol. 33. No.17.
[BLA 1] Blaschke, F. "The principle of Field Orientation applied to the new
TRANSVECTOR Close Loop Control Systems for rotating field machines";
Siemens Review, vol. 34, May 1972; pages 217 - 220
[BOL 1] Boldea, I.; Nasar, S.A. “Vector Control of AC Drives” CRC Press Inc., 1992.
[BOS 1] Bose, B. K.; "Power Electronics and AC Drives". Prentice-Hall. 1986.
[BOS 2] Bose, B. K.; Patel, N. P.; Rajashekara, K.; "A Neuro-Fuzzy based On-Line
Efficiency Optimization Control of a Stator Flux-Oriented Direct-Vector
Controlled Induction Motor Drive"; IEEE Trans. on Ind. Electronics, Vol. 44, vol.
2; Abril 1997, pages 270 – 273.
[BUJ 1] Buja, G.; Casadei, D.; Serra, G. "Direct Torque Control of Induction Motor
Drives". ISIE 97. Guimaraes. Portugal. IEEE Catalog Number: 97TH8280.
[BUJ 2] Buja, Giuseppe. "A New Control Strategy of the Induction Motor Drives: The
Direct Flux and Torque Control". IEEE Industrial Electronics Society Newsletter.
December 1998.
[CAS 1] Casadei, D.; Serra G.; Tani A.; "Improvement of Direct Torque Control
Performance by using a Discrete SVM Technique". ISBN 0-7803-4489-8. 1998
IEEE, pages 997 - 1003.
[CAS 2] Casadei, D.; Serra G.; Tani A.; "Implementation of a Direct Torque Control
Algorithm for Induction Motors Based on Discrete Space Vector Modulation";
IEEE Trans. on Power Electronics, Vol. 15, No. 4; July 2000, pages 769 – 777.
[GON 1] Gonzalez, D.; Llaquet, J.; Arias, A.; Bedford, D.; Romeral, J.L. Balcells, J.
"Improvement possibilities of PWM Voltage Inverter EMI effects using different
Modulations Methods". Proceedings EPE'99, 8
th
European Conference on Power
Electronics and Applications. ISBN: 90-75815-04-2. Lausanne. Switzerland.
September 1999.
References.
R.3
[HAB 1] Habelter, G.; Profumo, F.; Pastorelli, M.; Tolbert, L. "Direct Torque Control of
Induction Machines Using Space Vector Modulation"; IEEE Trans. on Industry
Applications, Vol. 28, No. 5; September/October 1992, pages 1045 – 1053.
[HIT 1] S. Hiti, ‘Modeling and Control of Three-Phase PWM Converters,’ Ph.D.
Dissertation, VPEC- Virginia Polytechnic Institute & State University, 1995.
[HOL 1] Holtz, J.; "Pulse width modulation - A survey"; IEEE Trans. on Industrial
Electronics, vol. 39. December 1992; pages 410 - 420.
[KAN 1] Kang, J.; Sul, S.; "New Direct Torque Control of Induction Motor for Minimum
Torque Ripple and Constant Switching Frequency" IEEE Trans. on Industry
Applications, Vol. 35, No. 5; September/October 1999, pages 1076 - 1082.
[KER 1] Kerkman, R. J.; Seibel, B. J.; Rowan, T. M.; Schlegel, D. W.; " A new flux and
stator resistance identifier for AC drive systems", IEEE Trans. on Industry
Applications, Vol. 32, No. 3; May/June 1996, pages 585 - 593.
[LAS 1] Lascu, C.; Boldea, I.; Blaabjerg, F. “A Modified Direct Torque Control for
Induction Motor Sensorless Drive", IEEE Trans. on Industry Applications, Vol.
36, No. 1; January/February 2000, pages 122-130.
[LEG 1] Leggate, D.; Kerkman, R. J.; “Pulse-Based Dead Time Compensator for PWM
Voltage Inverters", IEEE Trans. on Ind. Electronics, Vol. 44, No. 2; April 1997,
pages 191-197.
[LEO 1] Leonhard, W.; "Control of Electrical Drives". Springler-Verlag. 1990.
[LLA 1] LLaquet, J.; Arias, A.; Romeral, J.L.; Bedford, D. "EMI effects of Hard-less
Dead-time compensated PWM Voltage Inverter". Proceedings ICHQP'98. 8
th
International Conference on Harmonics and Quality of Power October 1998,
pages 516 - 520.
[LSI 1] Loughborough Sound Images plc." PC/C32 Technical Reference Manual". Ver
1.03. August 1996.
[LSI 2] Loughborough Sound Images plc." PC/32 DIO. 32 Channel Digital I/O Board.
User Manual" Ver 1.01. December 1994.
[LSI 3] Loughborough Sound Images plc." AM/D16QS. Quad Channel ADC Daughter
Module. User Manual". Ver 1.00. June 1995.
[LUD 1] Ludtke, I. “ The Direct Control of Induction Motors”. Thesis. Department of
Electronics and Information Technology. University of Glamorgan. May 1998.
References.
R.4
[LUD 2] Ludtke, I.; Jayne M.G. “A comparative study of high performance speed control
strategies for voltage sourced PWM inverter fed induction motor drives”, Seventh
International Conference on electrical Machines and Drives, 11-13 September
1995, University of Durham, UK.
[LUD 3] Ludtke, I.; Arias, A.; Jayne M.G. “Improvement Direct Torque Control of
Induction Motors”, 8
th
European Conference on Power Electronics and
Applications. EPE'99. ISBN: 90-75815-04-2. September 1999. Lausanne.
Switzerland
[MAR 1] Martinez, L. " Historia de las máquinas eléctricas". Edicions UPC. Universitat
Politècnica de Catalunya. 1994.
[MAR 2] Martins, C. A.; Meynard, T. A.; Roboam, X.; Carvalho, A. S. “A predictive
sampling scale model for direct torque control of the induction machine fed by
multilevel voltage-source inverters”,The European Physical Journal Applied
Physics. EDP Sciences 1999.
[MAT 1] Mata, A. " Turbo C. Iniciación y programación avanzada". Paraninfo. Second
edition. 1991.
[MOH 1] Mohan, Undeland, Robbins. " Power Electronics". Wiley. Second edition. 1989.
[NAS 1] Nash, J.; "Direct Torque Control, Induction Motor Vector Control without an
Encoder", IEEE Trans. on Ind. Applications, Vol. 33, No. 2; March/April 1997,
pages 333 - 341.
[NIE 1] Niemelä, M.; Pyrhönen, J.; Pyrhönen, O.; Luukko J. "Drift correction methods of
the stator flux linkage in DTC synchronous motor drives", Proceedings EPE'99,
8
th
European Conference on Power Electronics and Applications. Lausanne.
September/1999.
[NOG 1] Noguchi, T.; Yamamoto, M.; Kondo, S.; Takahashi, I. " Enlarging Switching
Frequency in Direct Torque-Controlled Inverter by Means of Dithering". IEEE
Trans. on Industry. Applications, Vol. 35, No. 6; November/December 1999;
pages 1358 - 1366.
[PYR 1] Pyrhönen, J.; Pyrhönen, O.; Niemelä, M.; Luukko J. "A Direct Torque Controlled
synchronous motor drive concept for dynamically demanding applications",
Proceedings EPE'99, 8
th
European Conference on Power Electronics and
Applications. Lausanne. September/1999.
[RAH 1] Rahman, M. A.; Radwan, T. S.; Osheiba, A. M.; Lashine, A. E.; "Analysis of
Current Controllers for Voltage Source Inverters", IEEE Trans. on Ind.
Electronics, Vol. 44, No 4; August 1997; pages 477 - 485
References.
R.5
[ROM 1] Romeral, J. L.; "Optimización de Modelos de Control Digital para Motores AC",
Doctoral Thesis, Universitat Politècnica de Catalunya. June 1995.
[ROM 2] Romeral, J. L.; Bordonau, J.; Bedford, D.; Aldabas, E.; "Adaptive fuzzy speed
controller for an AC drive", The 1
st
International Congress on Energy, Power &
Motion Control, Tel-Aviv; May 1997, pages 82 - 87.
[ROM 3] Romeral, J. L.; Aldabas, E.; Arias, A.; Llaquet, J. " Regulador Difuso Adaptativo
por variación de las Funciones de Pertenencia ", Actas SAAEI'00. Sem. Anual de
Automática, Electrónica Ind. e Instrumentación, 2000. ISBN: 84-699-2994-1.
Terrassa. September 2000, pages 273 - 276.
[ROM 4] Romeral, J.L.; Aldabas, E.; Arias, A.; LLaquet, J. "A Simple Self-Tuning PID
Speed Controller". ISIE'00. IEEE International Sypmposium on Industrial
Electronics. December 2000. Puebla. Mexico.
[SEP 1] Sepe, R. B.; Lang, J. H.; "Inverter non linearities and discrete Dead Time
Compensation", IEEE Trans. on Power Electronics. Vol. 8, Num. 4. October 1993.
[TAK 1] Takahashi, I and Nogushi, T. “A New Quick-Response and High-Efficiency
Control Strategy of an Induction Motor”, IEEE Trans. Industry Applications, Vol.
1A-22, pages 820-827, October 1986.
[TAK 2] Takahashi, I and Ohimori, Y. “High-Performance Direct Torque Control of an
Induction Motor”, IEEE Trans. Industry Applications, Vol. 25, pages 257-264,
March 1989.
[TII 1] Tiitine, P.; Pohjalainen, P.; Lalu, J.; "The next generation motor control method -
Direct Torque Control, DTC", Proc. EPE Chapter Symp., Lausanne, Switzerland,
1994.
[TII 2] Texas Instruments Incorporated." TMS320C3x User's Guide". October 1994.
[TII 3] Texas Instruments Incorporated." TMS320C3x Floating-Point DSP Optimizing C
Compiler, User's Guide ". February 1995.
[TII 4] Texas Instruments Incorporated." TMS320C3x Floating-Point DSP Assembly
Language Tools, User's Guide ". February 1995.
[VAS 1] Vas, P. " Electrical machines and drives: a space-vector theory approach". Oxford
University Press 1992.
[VAS 2] Vas, P. " Sensor less Vector and Direct Torque Control". Oxford University Press
1998.
References.
R.6
[VAS 3] Vas, P. "Artificial-Intelligence-Based Electrical Machines and Drives. Application
of Fuzzy, Neural, Fuzzy-Neural, and Genetic-Algorithm-Based Techniques".
Oxford University Press 1999.
[YAM 1] Yamamura, S.; " AC Motors for high-performance applications. Analysis and
Control". Ed. Marcel Dekka, Inc., 1986.
A.1
APPENDIXES.
A.1 - Programs.
In this section four programs are being listed:
§ TH1_5c.c. This program executes the classical DTC. It is sent to the DSP and executed by
it. Figure 4.3 in chapter 4 shows in detail its main functions.
§ PCTH1_5c.c. The PC executes this program. It sends the th1_5c.c file to the DSP in order
to perform the classical DTC. All data from the th1_5c.c is stored in the PC.
§ TH1_9.c. This program executes the Fuzzy Logic DTC. It is sent to the DSP and executed
by it. Figure 4.4 in chapter 4 shows in detail its main functions.
§ PCTH1_9.c. This program is executed by the PC. It sends the th1_9.c file to the DSP in
order to perform the Fuzzy Logic DTC. All data from the th1_9.c is stored in the PC.
Also, the PC helps in the execution of the Fuzzy Logic controllers.
Appendixes.
A.2
A.1.1 - TH1_5c.c.
/* File : TH1_5C.C */
/* Description: DSP program that performs:
1/program the adquisition boards AM/D16QS + AM/D16SA
2/run the flux and torque estimator each 166us saving the data in the DPRAM
3/ Classical DTC. ATN table.
/*_______________________________________________________________________*/
#include <c:\proves\math.h>
/* DPRAM Positions */
#define posicio_memoria_FLAG 0x0c00009 /*Flag*/
#define posicio_memoria_mfs_hst 0x0c0000b /* DTC references values */
#define posicio_memoria_te_hst 0x0c0000c /* " */
#define posicio_memoria_mfs_set 0x0c0000d /* " */
#define posicio_memoria_te_set 0x0c0000e /* " */
#define posicio_memoria_STOP 0x0c00012 /*Stop bit*/
#define posicio_memoria_f0 0x0c00048
#define posicio_memoria_f1 0x0c00049
#define posicio_memoria_f2 0x0c0004a
#define posicio_memoria_f3 0x0c0004b
#define posicio_memoria_f4 0x0c0004c
#define posicio_memoria_f5 0x0c0004d
#define posicio_memoria_f6 0x0c0004e
#define posicio_memoria_f7 0x0c0004f
#define posicio_memoria_f8 0x0c00050
#define posicio_memoria_f9 0x0c00051
/*10*/
#define posicio_memoria_fa 0x0c00052
#define posicio_memoria_fb 0x0c00053
#define posicio_memoria_fc 0x0c00054
#define posicio_memoria_fd 0x0c00055
#define posicio_memoria_fe 0x0c00056
#define posicio_memoria_ff 0x0c00057
#define posicio_memoria_f10 0x0c00058
#define posicio_memoria_f11 0x0c00059
#define posicio_memoria_f12 0x0c0005a
#define posicio_memoria_f13 0x0c0005b
/*20*/
#define posicio_memoria_f14 0x0c0005c
#define posicio_memoria_f15 0x0c0005d
#define posicio_memoria_f16 0x0c0005e
#define posicio_memoria_f17 0x0c0005f
#define posicio_memoria_f18 0x0c00060
#define posicio_memoria_f19 0x0c00061
#define posicio_memoria_f1a 0x0c00062
#define posicio_memoria_f1b 0x0c00063
#define posicio_memoria_f1c 0x0c00064
#define posicio_memoria_f1d 0x0c00065
Appendixes.
A.3
/*30*/
#define posicio_memoria_f1e 0x0c00066
#define posicio_memoria_f1f 0x0c00067
#define posicio_memoria_f20 0x0c00068
#define posicio_memoria_f21 0x0c00069
#define posicio_memoria_f22 0x0c0006a
#define posicio_memoria_f23 0x0c0006b
#define posicio_memoria_f24 0x0c0006c
#define posicio_memoria_f25 0x0c0006d
#define posicio_memoria_f26 0x0c0006e
#define posicio_memoria_f27 0x0c0006f
/*40*/
#define posicio_memoria_f28 0x0c00070
#define posicio_memoria_f29 0x0c00071
#define posicio_memoria_f2a 0x0c00072
#define posicio_memoria_f2b 0x0c00073
#define posicio_memoria_f2c 0x0c00074
#define posicio_memoria_f2d 0x0c00075
#define posicio_memoria_f2e 0x0c00076
#define posicio_memoria_f2f 0x0c00077
#define PI 3.141592654
asm(" .data");
/* DIO32 config. register */
asm("COUNTDPRAM .long 0c00016h");
/* 4 analog channels addresses*/
/* #define posicio_DIO 0828000 */
asm("posicio_DIO .long 00828000h");
asm("posicio_DIO2 .long 00828002h");
asm("posicio_DIO3 .long 00828004h");
asm("posicio_DIO4 .long 00828006h");
/* #define PORTREG 00828007 */
asm("PORTREG .long 00828007h");
/* DIO32 control register address */
/* #define CONTROL 00828005 */
asm("CONTROL .long 00828005h");
asm("dio1 .long 00ff0000h");
asm("pointerdio .long dio1");
asm("STR0A .word 00808064h");
asm("STR0D .word 004F0900h");
asm("STR1A .word 00808068h");
asm("STR1D .word 00070900h");
asm("IOSTRA .word 00808060h");
asm("IOSTRD .word 00000000h");
asm("AMELIA0 .word 0081A000h");
Appendixes.
A.4
asm("ITTP .word 06000000h");
asm("Mascara .word 0000ffffh");
/* Map AMELIA2 values / registers */
asm("DR3 .equ 01h");
asm("DR0 .equ 02h");
asm("DR2 .equ 03h");
asm("TMR0 .equ 04h");
asm("TMR1 .equ 05h");
asm("DR1 .equ 06h");
asm("IMR .equ 07h");
asm("CTR .equ 08h");
asm("ECTR .equ 09h");
asm("SMR .equ 0ah");
asm("CMR .equ 0ah");
asm("ISR .equ 0bh");
asm("DCR .equ 0ch");
asm("SDC .equ 0dh");
asm("ECFR .equ 0eh");
asm("CFR .equ 0fh");
/* Map AMELIA2 registers */
asm("TIMER1 .word 81B005h");
asm("UCR .word 81B008h");
asm("ACR .word 81B00Ah");
asm("CONFIG .word 81B00Fh");
asm("IMR1 .word 81B00Bh");
asm("DCR1 .word 81B00Ch");
asm("CH0 .word 81B002h");
asm("CH1 .word 81B006h");
/* Constants */
asm("IMR1_DEF .word 000010000h");
asm("DCR1_DEF .word 0001e0000h");
asm("TIMER1_DEF .word 0fd9b0000h");
asm("UCR_DEF .word 0a4000000h");
asm("ACR_DEF .word 000f20000h");
asm("CONFIG_DEF .word 08dff0000h");
/*Program section called 'int0X' where the interruprion vector is placed */
/*c_int0X is the name of the rotuine address */
asm(" .sect \".int01\"");
asm(" .word _c_int01");
asm(" .sect \".int02\"");
asm(" .word _c_int02");
asm(" .sect \".int05\"");
asm(" .word _c_int05");
Appendixes.
A.5
/* End int section */
asm(" .text");
/* pointers */
long * pointer_FLAG=(long *)posicio_memoria_FLAG;
float * pointer_mfs_set=(float *)posicio_memoria_mfs_set;
float * pointer_te_set=(float *)posicio_memoria_te_set;
float * pointer_mfs_hst=(float *)posicio_memoria_mfs_hst;
float * pointer_te_hst=(float *)posicio_memoria_te_hst;
long * pointerSTOP=(long *)posicio_memoria_STOP;
float * pointerf0=(float *)posicio_memoria_f0;
float * pointerf1=(float *)posicio_memoria_f1;
float * pointerf2=(float *)posicio_memoria_f2;
float * pointerf3=(float *)posicio_memoria_f3;
float * pointerf4=(float *)posicio_memoria_f4;
float * pointerf5=(float *)posicio_memoria_f5;
float * pointerf6=(float *)posicio_memoria_f6;
float * pointerf7=(float *)posicio_memoria_f7;
float * pointerf8=(float *)posicio_memoria_f8;
float * pointerf9=(float *)posicio_memoria_f9;
/*10*/
float * pointerfa=(float *)posicio_memoria_fa;
float * pointerfb=(float *)posicio_memoria_fb;
float * pointerfc=(float *)posicio_memoria_fc;
float * pointerfd=(float *)posicio_memoria_fd;
float * pointerfe=(float *)posicio_memoria_fe;
float * pointerff=(float *)posicio_memoria_ff;
float * pointerf10=(float *)posicio_memoria_f10;
float * pointerf11=(float *)posicio_memoria_f11;
float * pointerf12=(float *)posicio_memoria_f12;
float * pointerf13=(float *)posicio_memoria_f13;
/*20*/
float * pointerf14=(float *)posicio_memoria_f14;
float * pointerf15=(float *)posicio_memoria_f15;
float * pointerf16=(float *)posicio_memoria_f16;
float * pointerf17=(float *)posicio_memoria_f17;
float * pointerf18=(float *)posicio_memoria_f18;
float * pointerf19=(float *)posicio_memoria_f19;
float * pointerf1a=(float *)posicio_memoria_f1a;
float * pointerf1b=(float *)posicio_memoria_f1b;
float * pointerf1c=(float *)posicio_memoria_f1c;
float * pointerf1d=(float *)posicio_memoria_f1d;
/*30*/
float * pointerf1e=(float *)posicio_memoria_f1e;
float * pointerf1f=(float *)posicio_memoria_f1f;
float * pointerf20=(float *)posicio_memoria_f20;
float * pointerf21=(float *)posicio_memoria_f21;
float * pointerf22=(float *)posicio_memoria_f22;
float * pointerf23=(float *)posicio_memoria_f23;
float * pointerf24=(float *)posicio_memoria_f24;
float * pointerf25=(float *)posicio_memoria_f25;
float * pointerf26=(float *)posicio_memoria_f26;
float * pointerf27=(float *)posicio_memoria_f27;
Appendixes.
A.6
/*40*/
float * pointerf28=(float *)posicio_memoria_f28;
float * pointerf29=(float *)posicio_memoria_f29;
float * pointerf2a=(float *)posicio_memoria_f2a;
float * pointerf2b=(float *)posicio_memoria_f2b;
float * pointerf2c=(float *)posicio_memoria_f2c;
float * pointerf2d=(float *)posicio_memoria_f2d;
float * pointerf2e=(float *)posicio_memoria_f2e;
float * pointerf2f=(float *)posicio_memoria_f2f;
int d=0,STOP=0,FLAG=0;
/*DTC varialbes*/
int e1=0x95,e2=0x95,e7=0x95,e0=0xaa;
int e1_b=0;
int e_fi_ti=0xaa,e_fd_ti=0xaa,e_fi_td=0xaa,e_fd_td=0xaa;
int e_fd_td_b=0,e_fi_ti_b=0,e_fd_ti_b=0,e_fi_td_b=0;
int te_e=0,mfs_e=0;
float te_plim=0,te_nlim=0,mfs_plim=0,mfs_nlim=0,te_hst=0,mfs_hst=0;
float mfs_set=0,te_set=0;
/* adquisition variables*/
long int ch0=0,ch1=0,ch2=0;
long int *pch0=&ch0,*pch1=&ch1,*pch2=&ch2;
float ch0_float=0,ch1_float=1,ch2_float=0;
/* estimator zoh variables */
float isD=0,isQ=0,frD=0,frQ=0,fsD=0,fsQ=0,mfs=0,te=0,ang=0,sect=0;
float frD_1=0,frQ_1=0,isD_1=0,isQ_1=0;
float wrrds=0,wrrds_1=0,wrrds_2=0,wrrds_3=0,wrrds_4=0;
float sectbis_aux=0,angbisfloat=0;
int sectbis=0;
float etz2_5=0.9960652825,etz1_6=0.9973751317;
float Rr=5.05,Lm=0.30563,P=2,Lr=0.32023;
float Lx=0.0091376,c=0.816496,stz=0;
int x=0;
double angbis=0,table[402];
/* functions */
void c_int01(void); /* Amelia int */
void c_int02(void); /* Amelia int */
void c_int05(void); /* Control */
void set_amd16qs(void); /* ADC inizialization */
void set_amd16sa(void); /* ADC inizialization */
void dio32(void); /* DIO inizialization */
void atn_table (void); /* ATN table */
void get_ADC(void); /* read 2 currents + wm */
void flux_torque_est_zoh(void); /* Flux and torque estimation zoh
*/
void dtc(void); /* dtc */
void save_data_DPRAM(void);
/*void save_data_DPRAM_2(void);*/
void send_active_state(void); /* send the active state */
void save_active_state(void); /* save the active state */
void bit1(void);
void bit0(void);
Appendixes.
A.7
/************************************************************************/
/* Function : main
*/
/************************************************************************/
void main(void)
{
asm(" LDP STR0A,DP");
asm(" LDP @STR0A,AR0");
asm(" LDP @STR0D,R0");
asm(" STI R0,*AR0");
asm(" LDP STR1A,AR0");
asm(" LDP STR1D,R0");
asm(" STI R0,*AR0");
asm(" LDP IOSTRA,AR0");
asm(" LDP IOSTRD,R0");
asm(" STI R0,*AR0");
dio32();
/* null state to VSI */
do {
STOP=*pointerSTOP;
}
while (STOP==1);
if (STOP ==0)
{ atn_table();
/* getting the reference values */
mfs_set=*pointer_mfs_set;
te_set=*pointer_te_set;
mfs_hst=*pointer_mfs_hst;
te_hst=*pointer_te_hst;
mfs_plim=mfs_set+mfs_hst;
mfs_nlim=mfs_set-mfs_hst;
te_plim=te_set+te_hst;
te_nlim=te_set-te_hst;
set_amd16qs();
set_amd16sa();
asm(" LDI @ITTP,IF");
/* Enalbing interruptions INT0 +INT1 + INT5 of PC/C32 board */
asm(" LDI 0013h,IE");
/* Globals int enable */
asm(" OR 2000h,ST");
/* Start Cache */
asm(" OR 0800h,ST");
}
Appendixes.
A.8
do {
STOP=*pointerSTOP;
}
while (STOP==0);
/* Disable int */
asm(" AND 0000h,IE");
asm(" AND 0000h,ST");
asm(" LDI 00ffh,R1");
asm(" LSH 16,R1");
asm(" LDI @posicio_DIO,AR1");
asm(" STI R1,*AR1");
}
/************************************************************************/
/* End Function : main */
/************************************************************************/
/************************************************************************/
/* Function : c_int01 */
/* AMELIA2_A interruption */
/************************************************************************/
void c_int01(void)
{
asm(" PUSH AR0");
asm(" PUSH AR2");
asm(" PUSH R0");
/* disable int*/
asm(" ANDN 2000h,ST");
asm(" LDI @AMELIA0,AR0");
asm(" LDI *+AR0(ISR),R0");
asm(" LDI *+AR0(DR0),R0");
asm(" LDI *+AR0(DR1),R0");
asm(" LDI *+AR0(DR2),R0");
asm(" LDI *+AR0(DR3),R0");
asm(" LDI *+AR0(DR0),R0");
asm(" LDI *+AR0(DR1),R0");
asm(" LDI *+AR0(DR2),R0");
asm(" LDI *+AR0(DR3),R0");
asm(" LDI *+AR0(DR0),R0");
asm(" LDI *+AR0(DR1),R0");
asm(" LDI *+AR0(DR2),R0");
asm(" LDI *+AR0(DR3),R0");
asm(" LDI *+AR0(DR0),R0");
asm(" LDI *+AR0(DR1),R0");
asm(" LDI *+AR0(DR2),R0");
asm(" ASH -16,R0");
asm(" LDI @_pch2,AR2");
Appendixes.
A.9
asm(" STI R0,*AR2");
asm(" LDI *+AR0(DR3),R0");
/* int 05 is set*/
asm(" OR 010h,IF");
asm(" POP R0");
asm(" POP AR2");
asm(" POP AR0");
/* erase this interrupt flag */
asm(" ANDN 1h,IF");
}
/************************************************************************/
/* End Function : c_int01 */
/************************************************************************/
/************************************************************************/
/* Function : c_int02 */
/* AMELIA2_B int */
/************************************************************************/
void c_int02(void)
{
asm(" PUSH AR0");
asm(" PUSH AR1");
asm(" PUSH AR2");
asm(" PUSH R0");
asm(" PUSH R1");
/* disable int*/
asm(" ANDN 2000h,ST");
asm(" LDI @IMR1,AR0");
asm(" LDI *AR0,R0");
asm(" LDI @CH0,AR0");
asm(" LDI @CH1,AR1");
asm(" LDI *AR0,R0");
asm(" LDI *AR1,R1");
asm(" ASH -16,R0");
asm(" LDI @_pch0,AR2");
asm(" STI R0,*AR2");
asm(" ASH -16,R1");
asm(" LDI @_pch1,AR2");
asm(" STI R1,*AR2");
asm(" POP R1");
asm(" POP R0");
asm(" POP AR2");
asm(" POP AR1");
asm(" POP AR0");
/* erase this interrupt flag */
asm(" ANDN 2h,IF");
}
/************************************************************************/
Appendixes.
A.10
/* End Function : c_int02 */
/************************************************************************/
/************************************************************************/
/* Funcio : c_int05 (166us)
/************************************************************************/
void c_int05(void)
{
bit1();
get_ADC();
flux_torque_est_zoh();
dtc();
/* bit0();*/
/* for(d=0;d<215;d++)
{
}
d=0;*/
send_active_state();
bit0();
save_data_DPRAM();
/* save_data_DPRAM_2();*/
}
/************************************************************************/
/* End Function : c_int05 (166us)
*/
/************************************************************************/
/************************************************************************/
/* Function : get_ADC (estimator)
/************************************************************************/
void get_ADC (void)
{
/* disable int*/
asm(" ANDN 2000h,ST");
/* get isA,isB,wm */
/* 65535 / 6volts ; 1volt / 7.0922 amp */
/* ch0_float=-(1.0*ch0*9.155273438e-5*7.1*1.03*6.11/7)+3.5e-3;
ch1_float=-(1.0*ch1*9.155273438e-5*7.1*1.015*6.11/7)-3.0e-2;*/
/* 65535 / 6volts ; 1volt / 10 amp */
/* LEM probe */
ch0_float=-(1.0*ch0*9.155273438e-5*10*4.85/5.15);
/* Tektronic Probe */
ch1_float=-(1.0*ch1*9.155273438e-5*10);
/* 65535 / 4volts ; 6e-2volts / 1rpm */
ch2_float=-(1.0*(ch2-170.5)*6.103515625e-5/(1.10965*6e-4));
/* enalbe global int*/
asm(" OR 2000h,ST");
}
/************************************************************************/
/* Funcio : get_ADC (estimator) */
Appendixes.
A.11
/************************************************************************/
/************************************************************************/
/* Function : flux_torque_est_zoh */
/************************************************************************/
void flux_torque_est_zoh(void)
{ double sqr=0;
float aux=0;
int index=0;
frD_1=frD;
frQ_1=frQ;
wrrds_4=wrrds_3;
wrrds_3=wrrds_2;
wrrds_2=wrrds_1;
wrrds_1=wrrds;
isD_1=isD;
isQ_1=isQ;
isD=1.2247*ch0_float;
/* isQ=0.95*(1.4142135*ch1_float)+(0.7071067*ch0_float);*/
isQ=(1.3435028*ch1_float)+(0.7071067*ch0_float);
/* wrrds=(wrrds_4+wrrds_3+wrrds_2+wrrds_1+(2*PI/60*ch2_float))/5;*/
wrrds=(wrrds_4+wrrds_3+wrrds_2+wrrds_1+(0.104719*ch2_float))/5;
/*frD=(((1-etz2_5)*((Lm*isD_1)-((Lr/Rr)*P*wrrds_1*frQ_1)))+(etz2_5*frD_1));
frQ=(((1-etz2_5)*((Lm*isQ_1)+((Lr/Rr)*P*wrrds_1*frD_1)))+(etz2_5*frQ_1));*/
/*frD=(((1-etz1_6)*((Lm*isD_1)-((Lr/Rr)*P*wrrds_1*frQ_1)))+(etz1_6*frD_1));
frQ=(((1-etz1_6)*((Lm*isQ_1)+((Lr/Rr)*P*wrrds_1*frD_1)))+(etz1_6*frQ_1));*/
frD=(0.80223847e-3*isD_1)-(0.332895663e-3*wrrds_1*frQ_1)+(etz1_6*frD_1);
frQ=(0.80223847e-3*isQ_1)+(0.332895663e-3*wrrds_1*frD_1)+(etz1_6*frQ_1);
/* fsD=(isD*(Lx/Lm))+(frD*(Lm/Lr));
fsQ=(isQ*(Lx/Lm))+(frQ*(Lm/Lr));*/
fsD=(isD*0.0298975)+(frD*0.9544077);
fsQ=(isQ*0.0298975)+(frQ*0.9544077);
/* may be it could be just used the square value */
sqr=(fsD*fsD)+(fsQ*fsQ);
mfs=sqrt(sqr);
/* using the table */
aux=fsQ/fsD;
if (aux < 0)
{aux=aux*(-1);
}
if( aux < 1 )
{index=(int)(aux*100);
angbis=table[index];
angbisfloat=(float)angbis; }
else if ( aux >= 100)
{angbis=table[199];
angbisfloat=(float)angbis; }
else
Appendixes.
A.12
{index=(int)(aux+99);
angbis=table[index];
angbisfloat=(float)angbis; }
if ( fsD > 0)
{ if( fsQ < 0)
{angbisfloat=(float)((-1)*angbis);}
}
else
{
if( fsQ > 0)
{angbisfloat=PI+((-1)*angbisfloat);}
else
{angbisfloat=(angbisfloat-PI);}
}
if (-PI < angbisfloat ) sectbis=4;
if ((-5*PI/6) < angbisfloat ) sectbis=5;
if ((-PI/2) < angbisfloat) sectbis=6;
if (-PI/6 < angbisfloat) sectbis=1;
if (PI/6 < angbisfloat) sectbis=2;
if (PI/2 < angbisfloat) sectbis=3;
if ((5*PI/6) < angbisfloat) sectbis= 4;
/* te=P*c*((fsD*isQ)-(fsQ*isD));*/
te=1.632992*((fsD*isQ)-(fsQ*isD));
}
/************************************************************************/
/* End function: flux_torque_est_zoh */
/************************************************************************/
/************************************************************************/
/* Function: dtc */
/************************************************************************/
void dtc (void)
{
/* new reference values are read in savw_data_DPRAM
before setting the FLAG=1 */
if ( mfs > mfs_plim)
mfs_e = 0;
else if ( mfs < mfs_nlim)
mfs_e = 1;
if ( te > (te_plim))
{te_e = 0;
}
/* te_e = 0; */
else if ( te < te_nlim)
{
te_e = 2;
}
else
{
te_e = 1;
}
Appendixes.
A.13
switch(sectbis)
{
case 1:
e_fi_ti=0xa5;
e_fi_td=0x99;
e_fd_ti=0xa6;
e_fd_td=0x9a;
e_fi_ti_b=2;
e_fi_td_b=6;
e_fd_ti_b=3;
e_fd_td_b=5;
break;
case 2:
e_fi_ti=0xa6;
e_fi_td=0xa9;
e_fd_ti=0x96;
e_fd_td=0x99;
e_fi_ti_b=3;
e_fi_td_b=1;
e_fd_ti_b=4;
e_fd_td_b=6;
break;
case 3:
e_fi_ti=0x96;
e_fi_td=0xa5;
e_fd_ti=0x9a;
e_fd_td=0xa9;
e_fi_ti_b=4;
e_fi_td_b=2;
e_fd_ti_b=5;
e_fd_td_b=1;
break;
case 4:
e_fi_ti=0x9a;
e_fi_td=0xa6;
e_fd_ti=0x99;
e_fd_td=0xa5;
e_fi_ti_b=5;
e_fi_td_b=3;
e_fd_ti_b=6;
e_fd_td_b=2;
break;
case 5:
e_fi_ti=0x99;
e_fi_td=0x96;
e_fd_ti=0xa9;
e_fd_td=0xa6;
e_fi_ti_b=6;
e_fi_td_b=4;
e_fd_ti_b=1;
e_fd_td_b=3;
break;
case 6:
e_fi_ti=0xa9;
e_fi_td=0x9a;
Appendixes.
A.14
e_fd_ti=0xa5;
e_fd_td=0x96;
e_fi_ti_b=1;
e_fi_td_b=5;
e_fd_ti_b=2;
e_fd_td_b=4;
break;
}
switch(te_e)
{
case 0:
if ( mfs_e == 0 )
{ e1 = e_fd_td;
e1_b = e_fd_td_b; }
else
{ e1 = e_fi_td;
e1_b = e_fi_td_b; }
break;
case 1:
if ( mfs_e == 0 )
{ e1 = e0;
e1_b = 0; }
else
{ e1 = e0;
e1_b = 0;}
break;
case 2:
if ( mfs_e == 0 )
{ e1 = e_fd_ti;
e1_b = e_fd_ti_b; }
else
{ e1 = e_fi_ti;
e1_b = e_fi_ti_b;}
break;
}
}
/************************************************************************/
/* End function: dtc */
/************************************************************************/
/************************************************************************/
/* Function: send_active_state */
/************************************************************************/
void send_active_state (void)
{
asm(" PUSH AR1");
asm(" PUSH R1");
asm(" LDI @_e1,R1");
asm(" LSH 16,R1");
/* as long as save_active_state is not used */
/* asm(" LDI @pointerdio,AR1");*/
/* asm(" LDI *AR1,R1");*/
asm(" LDI @posicio_DIO,AR1");
asm(" STI R1,*AR1");
Appendixes.
A.15
asm(" POP R1");
asm(" POP AR1");
}
/************************************************************************/
/* End function: send_active_state */
/************************************************************************/
/************************************************************************/
/* Function : save_data_DPRAM */
/************************************************************************/
void save_data_DPRAM (void)
{ float te_aux;
te_aux=te+10;
sectbis_aux=sectbis*(-1);
e1_b=e1_b*(-1);
*pointerf0=isD;
*pointerf1=isQ;
*pointerf2=te_aux;
/* *pointerf3=te_aux;
*pointerf4=11.2;
*pointerf5=8.6;
*pointerf6=te_e;
/* *pointerf7=e1_b;
*pointerf8=te;
/* *pointerf9=te_e;
/*10*/
/* *pointerfa=wrrds_1;*/
/* *pointerfb=te;
*pointerfc=ang;
*pointerfd=sect;
*pointerfe=frD;
*pointerff=frQ;
*pointerf10=wrrds;
*pointerf11=isDdef;
*pointerf12=isQdef;
*pointerf13=ange2;*/
/*20*/
/* new reference values are read in save_data_DPRAM
before setting the FLAG=1 */
mfs_set=*pointer_mfs_set;
te_set=*pointer_te_set;
mfs_hst=*pointer_mfs_hst;
te_hst=*pointer_te_hst;
mfs_plim=mfs_set+mfs_hst;
mfs_nlim=mfs_set-mfs_hst;
te_plim=te_set+te_hst;
te_nlim=te_set-te_hst;
FLAG=1;
*pointer_FLAG = FLAG;
}
Appendixes.
A.16
/************************************************************************/
/* End function: save_data_DPRAM */
/************************************************************************/
/************************************************************************/
/* Funcio : save_data_DPRAM_2
/************************************************************************/
void save_data_DPRAM_2 (void)
{ float mfs_set_aux,mfs_aux,te_set_aux,te_aux,wrrds_aux;
mfs_set_aux=mfs_set*(-1);
mfs_aux=mfs*(-1);
te_set_aux=te_set;
te_aux=te;
wrrds_aux=wrrds/(-10);
*pointerf0=mfs_set_aux;
*pointerf1=mfs_aux;
*pointerf2=te_set_aux;
*pointerf3=te_aux;
*pointerf4=wrrds_aux;
/* new reference values are read in save_data_DPRAM before setting the
FLAG=1 */
mfs_set=*pointer_mfs_set;
te_set=*pointer_te_set;
mfs_hst=*pointer_mfs_hst;
te_hst=*pointer_te_hst;
mfs_plim=mfs_set+mfs_hst;
mfs_nlim=mfs_set-mfs_hst;
te_plim=te_set+te_hst;
te_nlim=te_set-te_hst;
FLAG=1;
*pointer_FLAG = FLAG;
}
/************************************************************************/
/* End function: save_data_DPRAM_2 */
/************************************************************************/
/************************************************************************/
/* save_active_state */
/************************************************************************/
void save_active_state (void)
{
asm(" PUSH AR1");
asm(" PUSH R1");
asm(" LDI @pointerdio,AR1");
asm(" LDI @_e1,R1");
asm(" LSH 16,R1");
asm(" STI R1,*AR1");
asm(" POP R1");
Appendixes.
A.17
asm(" POP AR1");
}
/************************************************************************/
/* End: save_active_state */
/************************************************************************/
/************************************************************************/
/* bit1 */
/************************************************************************/
void bit1 (void)
{
asm(" PUSH AR1");
asm(" PUSH R1");
asm(" LDI 0000h,R1");
asm(" LSH 16,R1");
asm(" LDI @posicio_DIO2,AR1");
asm(" STI R1,*AR1");
asm(" POP R1");
asm(" POP AR1");
}
/************************************************************************/
/* End function: bit1 */
/************************************************************************/
/************************************************************************/
/* bit0 */
/************************************************************************/
void bit0 (void)
{
asm(" PUSH AR1");
asm(" PUSH R1");
asm(" LDI 00ffh,R1");
asm(" LSH 16,R1");
asm(" LDI @posicio_DIO2,AR1");
asm(" STI R1,*AR1");
asm(" POP R1");
asm(" POP AR1");
}
/************************************************************************/
/* End function: bit0 */
/************************************************************************/
/************************************************************************/
/************************************************************************/
/* Inizialization routines */
/************************************************************************/
/************************************************************************/
/* Function: set_amd16qs */
/* It inizializates the board AM/D16QS. */
Appendixes.
A.18
/************************************************************************/
void set_amd16qs(void)
{
asm(" LDI @AMELIA0,AR0");
asm(" LDI 0010h,R0");
asm(" LSH 16,R0");
asm(" STI R0,*+AR0(DCR)");
/* Reset AM/D16QS board */
asm(" LDI 0000h,R0");
asm(" STI R0,*+AR0(CMR)");
asm(" STI R0,*+AR0(CFR)");
/* User Control register config.*/
/* Value 28E3h: TCLK0 clk. factor 1/8 MCLK_0 and MCLK_1 as an output */
/*asm(" LDI 28E0h,R0");*/ /* /1 48 32 */
asm(" LDI 28E1h,R0"); /* /2 24 16 */
/*asm(" LDI 28E2h,R0");*/ /* /4 12 8 */
/*asm(" LDI 28E3h,R0");*/ /* /8 6 4 */
asm(" LSH 16,R0");
asm(" STI R0,*+AR0(CTR)");
/* Config. Serial Data Configuration Register */
/* 00c0h: Enable AMELIA2 */
asm(" LDI 00c0h,R0");
asm(" LSH 16,R0");
asm(" STI R0,*+AR0(SDC)");
/* Config. el Amelia Control Register */
/* Value 00F6h: out of reset, Master config., divide 384 */
/* enable chanals 2 i 3 and M_CLOCK_0 */
/*asm(" LDI 00F6h,R0"); */ /* 32 16 8 4 */
asm(" LDI 00E6h,R0"); /* 48 24 12 6 */
asm(" LSH 16,R0");
asm(" STI R0,*+AR0(CMR)");
/* Config. Configuration Register */
/* Value 8010h. It is cte */
asm(" LDI 8010h,R0");
asm(" LSH 16,R0");
asm(" STI R0,*+AR0(CFR)");
/* Config. Enhanced Configuration Register */
/* 00A0h: level int. It is reset either reading ISR */
/* or reading the channels */
asm(" LDI 00A0h,R0");
asm(" LSH 16,R0");
asm(" STI R0,*+AR0(ECFR)");
Appendixes.
A.19
/* Config. Enhanced Control Register */
/* Value 0003h. AMELIA2 int. when buffer FIFO is 100% full*/
/*asm(" LDI 0000h,R0");*/ /* 25% */
/*asm(" LDI 0001h,R0");*/
/*asm(" LDI 0002h,R0");*/
asm(" LDI 0003h,R0"); /* 100% */
asm(" LSH 16,R0");
asm(" STI R0,*+AR0(ECTR)");
/* Config. Interrupt Mask Register */
/* Value 2000h int. when buffer if full at the specified % */
asm(" LDI 2000h,R0");
asm(" LSH 16,R0");
asm(" STI R0,*+AR0(IMR)");
/* Wait loop calibration system */
/*asm(" LDI 0800h,R0");
asm(" LSH 13,R0");
asm("Calib_wait: SUBI 01h,R0");
asm(" BNZ Calib_wait");*/
asm(" LDI 0300h,R0");
asm(" LSH 15,R0");
asm("Calib_wait: SUBI 01h,R0");
asm(" BNZ Calib_wait");
/* Clean the FIFO (4 read for channel) */
asm(" LDI *+AR0(DR0),R0");
asm(" LDI *+AR0(DR1),R0");
asm(" LDI *+AR0(DR2),R0");
asm(" LDI *+AR0(DR3),R0");
asm(" LDI *+AR0(DR0),R0");
asm(" LDI *+AR0(DR1),R0");
asm(" LDI *+AR0(DR2),R0");
asm(" LDI *+AR0(DR3),R0");
asm(" LDI *+AR0(DR0),R0");
asm(" LDI *+AR0(DR1),R0");
asm(" LDI *+AR0(DR2),R0");
asm(" LDI *+AR0(DR3),R0");
asm(" LDI *+AR0(DR0),R0");
asm(" LDI *+AR0(DR1),R0");
asm(" LDI *+AR0(DR2),R0");
asm(" LDI *+AR0(DR3),R0");
/* Clean any int. (reading ISR) */
asm(" LDI *+AR0(ISR),R0");
}
/************************************************************************/
/* End function : set_amd16qs */
/************************************************************************/
Appendixes.
A.20
/************************************************************************/
/* Function: set_amd16sa */
/* It inizializates the board AM/D16QS. */
/************************************************************************/
void set_amd16sa(void)
{
asm(" LDI @DCR1,AR0");
asm(" LDI @DCR1_DEF,R0");
asm(" STI R0,*AR0");
asm(" LDI @UCR,AR0");
asm(" LDI @UCR_DEF,R0");
asm(" STI R0,*AR0");
asm(" LDI @ACR,AR0");
asm(" LDI @ACR_DEF,R0");
asm(" STI R0,*AR0");
asm(" LDI @TIMER1,AR0");
asm(" LDI @TIMER1_DEF,R0");
asm(" STI R0,*AR0");
asm(" LDI @CONFIG,AR0");
asm(" LDI @CONFIG_DEF,R0");
asm(" STI R0,*AR0");
asm(" LDI @IMR1,AR0");
asm(" LDI @IMR1_DEF,R0");
asm(" STI R0,*AR0");
}
/************************************************************************/
/* End function : set_amd16sa */
/************************************************************************/
/************************************************************************/
/* Funcio : dio32 */
/* Ini. dio32 */
/************************************************************************/
void dio32(void)
{
/* Dio32 as a master without any trigger */
/* asm(" LDI 0241h,R1");*/
asm(" LDI 023Ch,R1");
asm(" LSH 16,R1");
asm(" LDI @CONTROL,AR1");
asm(" STI R1,*AR1");
/* 32 bits as output */
asm(" LDI 1111h,R1");
asm(" LSH 16,R1");
asm(" LDI @PORTREG,AR1");
asm(" STI R1,*AR1");
Appendixes.
A.21
/* disconnect the bridge */
asm(" LDI 00ffh,R1");
asm(" LSH 16,R1");
asm(" LDI @posicio_DIO,AR1");
asm(" STI R1,*AR1");
asm(" LDI 0000h,R1");
asm(" LSH 16,R1");
asm(" LDI @posicio_DIO2,AR1");
asm(" STI R1,*AR1");
}
/************************************************************************/
/* End function : dio32 */
/************************************************************************/
/************************************************************************/
/* Funcio : atn_table */
/* Creates a table with ATN values */
/************************************************************************/
void atn_table(void)
{
double s=0,r=0;
int k=0;
for(k=0;k<=100;k++)
{
r=atan(s);
table[k]=r;
s=s+0.01;
}
for(k=100;k<=200;k++)
{
s=k-99;
r=atan(s);
table[k]=r;
}
}
/************************************************************************/
/* End function : atn_table */
/************************************************************************/
Appendixes.
A.22
A.1.2 - PCTH1_5c.c
/**********************************************************************/
/* PCTH1_5C.C Classical DTC */
/**********************************************************************/
/* Needed C files */
#include <dos.h>
#include <math.h>
#include <conio.h>
/* Needed C files for the DSP */
#include "c:\mon32\bc45\tic32.h"
#include<stdio.h>
#include<stdlib.h>
#include<time.h>
/* Memory DPRAM positions for the set points + exchange values */
#define FLAG 0x0c00009 // FLAG
#define HST_MFS 0xc0000bl // Flux set point_hst margin
#define HST_TE 0xc0000cl // Torque set point_hst margin
#define MFS 0xc0000dl // Flux set point
#define TE 0xc0000el // Torque set point
#define STOP 0xc00012l // SVM stop bit
#define f0 0xc00048l
#define f1 0xc00049l
#define f2 0xc0004al
#define f3 0xc0004bl
#define f4 0xc0004cl
#define f5 0xc0004dl
#define f6 0xc0004el
#define f7 0xc0004fl
#define f8 0xc00050l
#define f9 0xc00051l
/*10*/
#define fa 0xc00052l
#define fb 0xc00053l
#define fc 0xc00054l
#define fd 0xc00055l
#define fe 0xc00056l
#define ff 0xc00057l
#define f10 0xc00058l
#define f11 0xc00059l
#define f12 0xc0005al
#define f13 0xc0005bl
/*20*/
#define f14 0xc0005cl
#define f15 0xc0005dl
#define PI 3.141592654
/* DSP file */
#define FILENAME "TH1_5C.OUT"
Appendixes.
A.23
/* Global variables */
char x=0;
int s=0,j=0,k=0,i=0;
long int t=0 ;
/* Global adquisition variables */
float v0,v1,v2,v3,v4,v5,v6,v7,v8,v9,va,vb;
float vc,vd,ve,vf,v10,v11,v12,v13,v14,v15;
unsigned long stop=0,flag=0; // Stop + flag bit variable
/* set points */
float mfs_set=0,te_set=0,te_hst=0,mfs_hst=0;
double mfs_sug=0,te_set_d=0;
/* pointer file */
FILE *f_grf;
/* data matrix */
/*float dt [10][901];*/
float dt [9][901];
/* Functions definition */
void IniciDSP(void);
void EngegaDSP(void);
void AturaDSP(void);
void ReadDPRAM(void);
void Savedata(void);
void Setpoints(void);
void Setpoints1(void);
void Data2file(void);
void main (void)
{
clrscr();
printf("\nPress '1' to start");
x = getch();
if (x=='1')
{
IniciDSP();
delay(500);
Setpoints();
delay (200);
EngegaDSP();
delay (4000);
/* Setpoints1();
delay (5000);
Setpoints1();
delay (5000);*/
Setpoints1();
delay (5000);
printf("\nSaving data");
for(t=0; t<1000000 ; t++)
{
Appendixes.
A.24
for (s=0; s<5 ; s++)
{
}
s=0;
Get_DPRAM_Word_32(FLAG,&flag);
if (flag == 1 )
{
if ( j <= 900 )
{
ReadDPRAM();
Savedata();
j++;
}
flag=0;
Put_DPRAM_Word_32(FLAG,flag);
}
}
}
AturaDSP();
Data2file();
}
/***************************************************************** */
/* DSP inizialization */
/******************************************************************/
void IniciDSP(void)
{
/* Seleccio data type for the DSP */
Set_Processor_Data_Type_Size_32();
/* DSP Inicialitzation. Board adress (0x290), DPRMA adress (0xD00)*/
/* bus ISA size */
Select_Board(0x290, 0xd00, 8);
/* Enable DPRAM */
Enable_DPRAM();
/* DSP reset */
Global_Reset();
/* Load the file to be executed */
Load_Object_File(FILENAME);
}
/*&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&*/
/* End of DSP inizialization */
/*&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&*/
/******************************************************************/
/* Start up DSP */
/******************************************************************/
void EngegaDSP(void)
{ stop=0;
Put_DPRAM_Word_32(STOP, stop);
Appendixes.
A.25
/* Run file */
Run_From(Get_Entry_PC());
delay(2000);
}
/*&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&*/
/* End start up DSP */
/*&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&*/
/******************************************************************/
/* Setpoints */
/******************************************************************/
void Setpoints(void)
{
printf("\n\nTorque setpoint N/m: ");
scanf("%f", &te_set);
Put_DPRAM_Float_32(TE,te_set);
printf("Torque set point hst margin: ");
scanf("%f", &te_hst);
Put_DPRAM_Float_32(HST_TE,te_hst);
te_set_d=te_set;
mfs_sug=0.3665*sqrt(te_set_d);
printf("\nThe suggested optimized flux square value is %lf",
mfs_sug);
printf("\nFlux set point: ");
scanf("%f", &mfs_set);
Put_DPRAM_Float_32(MFS,mfs_set);
printf("Flux set point hst margin: ");
scanf("%f", &mfs_hst);
Put_DPRAM_Float_32(HST_MFS,mfs_hst);
/* old version */
/* printf("\nFlux set point: ");
scanf("%f", &mfs_set);
Put_DPRAM_Float_32(MFS,mfs_set);
printf("Flux set point hst margin: ");
scanf("%f", &mfs_hst);
Put_DPRAM_Float_32(HST_MFS,mfs_hst);
printf("Torque setpoint N/m: ");
scanf("%f", &te_set);
Put_DPRAM_Float_32(TE,te_set);
printf("Torque set point hst margin: ");
scanf("%f", &te_hst);
Put_DPRAM_Float_32(HST_TE,te_hst);*/
}
/*&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&*/
/* End setpoints */
/*&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&*/
/******************************************************************/
/* Setpoints1 */
/******************************************************************/
void Setpoints1(void)
{
Appendixes.
A.26
printf("\nTorque setpoint N/m: ");
scanf("%f", &te_set);
Put_DPRAM_Float_32(TE,te_set);
te_set_d=te_set;
/* because squared value */
mfs_sug=0.3665*sqrt(te_set_d);
printf("\nThe suggested optimized flux value is %lf", mfs_sug);
printf("\nFlux set point: ");
scanf("%f", &mfs_set);
Put_DPRAM_Float_32(MFS,mfs_set);
/*old version */
/* printf("\nFlux set point: ");
scanf("%f", &mfs_set);
Put_DPRAM_Float_32(MFS,mfs_set);
printf("Torque setpoint N/m: ");
scanf("%f", &te_set);
Put_DPRAM_Float_32(TE,te_set);*/
}
/*&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&*/
/* End setpoints1 */
/*&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&*/
/******************************************************************/
/* Read DPRAM */
/******************************************************************/
void ReadDPRAM(void)
{
Get_DPRAM_Float_32(f0,&v0);
Get_DPRAM_Float_32(f1,&v1);
Get_DPRAM_Float_32(f2,&v2);
/*Get_DPRAM_Float_32(f3,&v3);
Get_DPRAM_Float_32(f4,&v4);
Get_DPRAM_Float_32(f5,&v5);
Get_DPRAM_Float_32(f6,&v6);
/*Get_DPRAM_Float_32(f7,&v7);
Get_DPRAM_Float_32(f8,&v8);
/*Get_DPRAM_Float_32(f9,&v9);
/*10*/
/*Get_DPRAM_Float_32(fa,&va);
Get_DPRAM_Float_32(fb,&vb);
Get_DPRAM_Float_32(fc,&vc);
Get_DPRAM_Float_32(fd,&vd);
Get_DPRAM_Float_32(fe,&ve);
Get_DPRAM_Float_32(ff,&vf);
Get_DPRAM_Float_32(f10,&v10);
Get_DPRAM_Float_32(f11,&v11);
Get_DPRAM_Float_32(f12,&v12);
Get_DPRAM_Float_32(f13,&v13); */
/*20*/
/*Get_DPRAM_Float_32(f14,&v14);
Get_DPRAM_Float_32(f15,&v15);*/
Appendixes.
A.27
}
/*&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&*/
/* End read DPRAM */
/*&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&*/
/******************************************************************/
/* Savedata */
/******************************************************************/
void Savedata(void)
{
dt[0][j]=v0;
dt[1][j]=v1;
dt[2][j]=v2;
/*dt[3][j]=v3;
dt[4][j]=v4;
dt[5][j]=v5;
dt[6][j]=v6;
/*dt[7][j]=v7;
dt[8][j]=v8;
/*dt[9][j]=v9;
/*10*/
/*dt[10][j]=va;
dt[11][j]=vb;
dt[12][j]=vc;
dt[13][j]=vd;
dt[14][j]=ve;
dt[15][j]=vf;
dt[16][j]=v10;
dt[17][j]=v11;
dt[18][j]=v12;
dt[19][j]=v13;*/
/*20*/
/*dt[20][j]=v14;
dt[21][j]=v15;*/
}
/*&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&*/
/* End save data */
/*&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&*/
/******************************************************************/
/* Stop DSP */
/******************************************************************/
void AturaDSP(void)
{ stop=1;
Put_DPRAM_Word_32(STOP, stop);
}
/*&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&*/
/* End stop DSP */
/*&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&*/
/******************************************************************/
/* Data2file */
/******************************************************************/
void Data2file(void)
{
Appendixes.
A.28
if ((f_grf = fopen("\\DTC2.GRF", "w")) == 0)
{
printf("Unable to open file");
return;
}
else
{
for(k=0;k<j;k++)
{
/* fprintf(f_grf, "%e %e %e %e %e %e %e
\n",dt[0][k],dt[1][k],dt[2][k],dt[3][k],dt[4][k],dt[5][k],dt[6][k]);*/
fprintf(f_grf, "%e %e %e \n",dt[0][k],dt[1][k],dt[2][k]);
}
fclose(f_grf);
}
}
/*&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&*/
/* End Data2file */
/*&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&*/
Appendixes.
A.29
A.1.3 - TH1_9.c
/* File : TH1_9.C */
/* Description: FLDTC */
/*_________________________*/
/* arc tangent function */
#include <c:\proves\math.h>
/* DPRAM Positions */
#define posicio_memoria_FLAG 0x0c00009 /*Flag*/
#define posicio_memoria_COUNTER 0x0c0000a
#define posicio_memoria_mfs_hst 0x0c0000b /*Flux set point_hst margin*/
#define posicio_memoria_te_hst 0x0c0000c /*Electr. torque set point_hst
margin*/
#define posicio_memoria_mfs_set 0x0c0000d /*Flux set point*/
#define posicio_memoria_te_set 0x0c0000e /*Electr. torque set point*/
#define posicio_memoria_STOP 0x0c00012 /*Stop bit*/
/* Start obtaining the DC */
#define posicio_memoria_START 0x0c00013 /*Start bit*/
/* Errors in obtaining the DC */
#define posicio_memoria_ERROR 0x0c00014 /*Number of errors*/
/* FLC1 references values */
#define posicio_memoria_FLUX_ANGLE_I 0x0c00015 /*Flux angle*/
#define posicio_memoria_TE_ERR_I 0x0c00016 /*Torque error i+1*/
#define posicio_memoria_WM 0x0c00017 /*Motor speed */
#define posicio_memoria_FI 0x0c00018 /*FI=0 flux decrease */
/*FI=1 increase */
/* FLC2 refernces values */
#define posicio_memoria_TE_ERR_I_1 0x0c00019 /*Torque error i*/
#define posicio_memoria_COUNT1 0x0c0001a /*Increment Torque error
i+1*/
#define posicio_memoria_DC_AUX 0x0c0001d /*Last duty cycle*/
#define posicio_memoria_INC_DC 0x0c0001e /*FLC2 set point*/
#define posicio_memoria_EQ 0x0c0001f /*Equal signal*/
/* duty cycle */
#define posicio_memoria_DCFLC1 0x0c0001b /*Duty cycle from FLC1*/
#define posicio_memoria_DCFLC2 0x0c0001c /*Duty cycle from FLC2*/
#define posicio_memoria_f0 0x0c00048
#define posicio_memoria_f1 0x0c00049
#define posicio_memoria_f2 0x0c0004a
#define posicio_memoria_f3 0x0c0004b
#define posicio_memoria_f4 0x0c0004c
#define posicio_memoria_f5 0x0c0004d
#define posicio_memoria_f6 0x0c0004e
#define posicio_memoria_f7 0x0c0004f
#define posicio_memoria_f8 0x0c00050
#define posicio_memoria_f9 0x0c00051
Appendixes.
A.30
/*10*/
#define posicio_memoria_fa 0x0c00052
#define posicio_memoria_fb 0x0c00053
#define posicio_memoria_fc 0x0c00054
#define posicio_memoria_fd 0x0c00055
#define posicio_memoria_fe 0x0c00056
#define posicio_memoria_ff 0x0c00057
#define posicio_memoria_f10 0x0c00058
#define posicio_memoria_f11 0x0c00059
#define posicio_memoria_f12 0x0c0005a
#define posicio_memoria_f13 0x0c0005b
/*20*/
#define posicio_memoria_f14 0x0c0005c
#define posicio_memoria_f15 0x0c0005d
#define posicio_memoria_f16 0x0c0005e
#define posicio_memoria_f17 0x0c0005f
#define posicio_memoria_f18 0x0c00060
#define posicio_memoria_f19 0x0c00061
#define posicio_memoria_f1a 0x0c00062
#define posicio_memoria_f1b 0x0c00063
#define posicio_memoria_f1c 0x0c00064
#define posicio_memoria_f1d 0x0c00065
/*30*/
#define posicio_memoria_f1e 0x0c00066
#define posicio_memoria_f1f 0x0c00067
#define posicio_memoria_f20 0x0c00068
#define posicio_memoria_f21 0x0c00069
#define posicio_memoria_f22 0x0c0006a
#define posicio_memoria_f23 0x0c0006b
#define posicio_memoria_f24 0x0c0006c
#define posicio_memoria_f25 0x0c0006d
#define posicio_memoria_f26 0x0c0006e
#define posicio_memoria_f27 0x0c0006f
/*40*/
#define posicio_memoria_f28 0x0c00070
#define posicio_memoria_f29 0x0c00071
#define posicio_memoria_f2a 0x0c00072
#define posicio_memoria_f2b 0x0c00073
#define posicio_memoria_f2c 0x0c00074
#define posicio_memoria_f2d 0x0c00075
#define posicio_memoria_f2e 0x0c00076
#define posicio_memoria_f2f 0x0c00077
#define PI 3.141592654
asm(" .data");
/* Direccio registre de control del timer 1 */
Appendixes.
A.31
asm("TIMECTRL .long 00808030h");
/* #define RSTCTRL 00000601 */
asm("RSTCTRL .set 00000601h");
/* Paraula de control que engega el timer 1 */
/* #define SETCTRL 000006c1 */
asm("SETCTRL .set 000006c1h");
/* Timer 1 register adresses */
asm("COUNTER .long 00808034h");
asm("PERIOD .long 00808038h");
/* Direccio registre de configuracio de la DIO32 */
asm("COUNTDPRAM .long 0c00016h");
/* Defineixo les adreces dels quatre canals anal•gics*/
/* #define posicio_DIO 0828000 */
asm("posicio_DIO .long 00828000h");
asm("posicio_DIO2 .long 00828002h");
asm("posicio_DIO3 .long 00828004h");
asm("posicio_DIO4 .long 00828006h");
/* #define PORTREG 00828007 */
asm("PORTREG .long 00828007h");
/* Direccio registre de control de la DIO32 */
/* #define CONTROL 00828005 */
asm("CONTROL .long 00828005h");
asm("dio1 .long 00ff0000h");
asm("c1 .long 450");
asm("pointerdio .long dio1");
asm("STR0A .word 00808064h");
asm("STR0D .word 004F0900h");
asm("STR1A .word 00808068h");
asm("STR1D .word 00070900h");
asm("IOSTRA .word 00808060h");
asm("IOSTRD .word 00000000h");
asm("AMELIA0 .word 0081A000h");
asm("ITTP .word 06000000h");
asm("Mascara .word 0000ffffh");
/* Map Registers AMELIA2 */
asm("DR3 .equ 01h");
asm("DR0 .equ 02h");
asm("DR2 .equ 03h");
asm("TMR0 .equ 04h");
asm("TMR1 .equ 05h");
Appendixes.
A.32
asm("DR1 .equ 06h");
asm("IMR .equ 07h");
asm("CTR .equ 08h");
asm("ECTR .equ 09h");
asm("SMR .equ 0ah");
asm("CMR .equ 0ah");
asm("ISR .equ 0bh");
asm("DCR .equ 0ch");
asm("SDC .equ 0dh");
asm("ECFR .equ 0eh");
asm("CFR .equ 0fh");
/* Map Register AMELIA2 */
asm("TIMER1 .word 81B005h");
asm("UCR .word 81B008h");
asm("ACR .word 81B00Ah");
asm("CONFIG .word 81B00Fh");
asm("IMR1 .word 81B00Bh");
asm("DCR1 .word 81B00Ch");
asm("CH0 .word 81B002h");
asm("CH1 .word 81B006h");
/* Constants */
asm("IMR1_DEF .word 000010000h");
asm("DCR1_DEF .word 0001e0000h");
asm("TIMER1_DEF .word 0fd9b0000h");
asm("UCR_DEF .word 0a4000000h");
asm("ACR_DEF .word 000f20000h");
asm("CONFIG_DEF .word 08dff0000h");
/* Program section called 'int0X' where the interruprion vector is placed*/
/* c_int0X is the name of the rotuine address */
asm(" .sect \".int01\"");
asm(" .word _c_int01");
asm(" .sect \".int02\"");
asm(" .word _c_int02");
asm(" .sect \".int05\"");
asm(" .word _c_int05");
asm(" .sect \".int10\"");
asm(" .word _c_int10");
/* End int label section */
asm(" .text");
/* pointers */
long * pointer_FLAG=(long *)posicio_memoria_FLAG;
long * pointer_COUNTER=(long *)posicio_memoria_COUNTER;
long * pointer_ERROR=(long *)posicio_memoria_ERROR;
float * pointer_mfs_set=(float *)posicio_memoria_mfs_set;
float * pointer_te_set=(float *)posicio_memoria_te_set;
Appendixes.
A.33
float * pointer_mfs_hst=(float *)posicio_memoria_mfs_hst;
float * pointer_te_hst=(float *)posicio_memoria_te_hst;
long * pointerSTOP=(long *)posicio_memoria_STOP;
long * pointerSTART=(long *)posicio_memoria_START;
float * pointer_flux_angle_i=(float *)posicio_memoria_FLUX_ANGLE_I;
float * pointer_te_err_i=(float *)posicio_memoria_TE_ERR_I;
float * pointer_wm=(float *)posicio_memoria_WM;
long * pointerFI=(long *)posicio_memoria_FI;
long * pointer_count1=(long *)posicio_memoria_COUNT1;
float * pointer_dc_aux=(float *)posicio_memoria_DC_AUX;
float * pointer_inc_dc=(float *)posicio_memoria_INC_DC;
long * pointerEQ=(long *)posicio_memoria_EQ;
long * pointerDCFLC1=(long *)posicio_memoria_DCFLC1;
long * pointerDCFLC2=(long *)posicio_memoria_DCFLC2;
float * pointerf0=(float *)posicio_memoria_f0;
float * pointerf1=(float *)posicio_memoria_f1;
float * pointerf2=(float *)posicio_memoria_f2;
float * pointerf3=(float *)posicio_memoria_f3;
float * pointerf4=(float *)posicio_memoria_f4;
float * pointerf5=(float *)posicio_memoria_f5;
float * pointerf6=(float *)posicio_memoria_f6;
float * pointerf7=(float *)posicio_memoria_f7;
float * pointerf8=(float *)posicio_memoria_f8;
float * pointerf9=(float *)posicio_memoria_f9;
/*10*/
float * pointerfa=(float *)posicio_memoria_fa;
float * pointerfb=(float *)posicio_memoria_fb;
float * pointerfc=(float *)posicio_memoria_fc;
float * pointerfd=(float *)posicio_memoria_fd;
float * pointerfe=(float *)posicio_memoria_fe;
float * pointerff=(float *)posicio_memoria_ff;
float * pointerf10=(float *)posicio_memoria_f10;
float * pointerf11=(float *)posicio_memoria_f11;
float * pointerf12=(float *)posicio_memoria_f12;
float * pointerf13=(float *)posicio_memoria_f13;
/*20*/
float * pointerf14=(float *)posicio_memoria_f14;
float * pointerf15=(float *)posicio_memoria_f15;
float * pointerf16=(float *)posicio_memoria_f16;
float * pointerf17=(float *)posicio_memoria_f17;
float * pointerf18=(float *)posicio_memoria_f18;
float * pointerf19=(float *)posicio_memoria_f19;
float * pointerf1a=(float *)posicio_memoria_f1a;
float * pointerf1b=(float *)posicio_memoria_f1b;
float * pointerf1c=(float *)posicio_memoria_f1c;
float * pointerf1d=(float *)posicio_memoria_f1d;
/*30*/
float * pointerf1e=(float *)posicio_memoria_f1e;
float * pointerf1f=(float *)posicio_memoria_f1f;
float * pointerf20=(float *)posicio_memoria_f20;
float * pointerf21=(float *)posicio_memoria_f21;
float * pointerf22=(float *)posicio_memoria_f22;
Appendixes.
A.34
float * pointerf23=(float *)posicio_memoria_f23;
float * pointerf24=(float *)posicio_memoria_f24;
float * pointerf25=(float *)posicio_memoria_f25;
float * pointerf26=(float *)posicio_memoria_f26;
float * pointerf27=(float *)posicio_memoria_f27;
/*40*/
float * pointerf28=(float *)posicio_memoria_f28;
float * pointerf29=(float *)posicio_memoria_f29;
float * pointerf2a=(float *)posicio_memoria_f2a;
float * pointerf2b=(float *)posicio_memoria_f2b;
float * pointerf2c=(float *)posicio_memoria_f2c;
float * pointerf2d=(float *)posicio_memoria_f2d;
float * pointerf2e=(float *)posicio_memoria_f2e;
float * pointerf2f=(float *)posicio_memoria_f2f;
int d=0,STOP=0,FLAG=0,s=0;
/* aux*/
int in1,in2,count1,index1,index2,index3;
float fin3,Tpc,Wpc;
/* DTC variables */
int e1=0x95,e2=0x95,e7=0x95,e0=0xbf;
int e1_b=0;
int e_fi_ti=0xaa,e_fd_ti=0xaa,e_fi_td=0xaa,e_fd_td=0xaa;
int e_fi_ti_b=0,e_fd_ti_b=0,e_fi_td_b=0,e_fd_td_b=0;
int te_e=0,mfs_e=0;
float te_plim=0,te_nlim=0,mfs_plim=0,mfs_nlim=0,te_hst=0,mfs_hst=0;
float mfs_set=0,te_set=0;
/* FLDTC variables */
int COUNTER_AUX=0,COUNTER=0,DC2=0,DC=0,ERROR=0,ERROR_FLAG=0,START=0;
int e1_b_1=0;
int EQ_aux=0,EQ=0;
float dc_aux=1,inc_dc=0;
/*FLC1 variables*/
int DCFLC1=0,FI=0;
float te_err_i=0,wm=0;
/* FLC2 variables */
int DCFLC2=0;
float te_err_i_1=0,inc_te_i=0;
float te_1=0;
/* adquisition variables*/
long int ch0=0,ch1=0,ch2=0;
long int *pch0=&ch0,*pch1=&ch1,*pch2=&ch2;
float ch0_float=0,ch1_float=1,ch2_float=0;
/* estimator zoh variables */
float isD=0,isQ=0,frD=0,frQ=0,fsD=0,fsQ=0,mfs=0,te=0,ang=0,sect=0;
float frD_1=0,frQ_1=0,isD_1=0,isQ_1=0;
float wrrds=0,wrrds_1=0,wrrds_2=0,wrrds_3=0,wrrds_4=0;
float sectbis_aux=0,angbisfloat=0;
Appendixes.
A.35
int sectbis=0;
float etz1_25=0.99803070219,etz1_6=0.9973751317,etz2_5=0.9960652825;
float Rr=5.05,Lm=0.30563,P=2,Lr=0.32023;
float Lx=0.0091376,c=0.816496,stz=0;
double angbis=0,table[402];
/* Functions */
void c_int01(void); /* Amelia int */
void c_int02(void); /* Amelia int */
void c_int05(void); /* Control */
void c_int10(void); /* Timer */
void set_amd16qs(void); /* ADC inizialization */
void set_amd16sa(void); /* ADC inizialization */
void dio32(void); /* DIO inizialization */
void set_c32_timer1(void); /* TIMER 1 inizialization */
void atn_table (void); /* ATN table */
void get_ADC(void); /* read 2 currents + wm */
void flux_torque_est_zoh(void); /* Flux and torque estimation zoh */
void dtc(void); /* dtc */
void save_data_DPRAM(void); /* saving data in DPRAM */
void save_data_DPRAM_2(void); /* saving data in DPRAM_2 */
void send_active_state(void); /* send the active state */
void save_active_state(void); /* save the active state */
void program_timer1(void); /* Timer 1 programing*/
void get_DC(void); /* Get Duty cycle */
void bit1(void);
void bit0(void);
/************************************************************************/
/* Funcio : main */
/************************************************************************/
void main(void)
{
asm(" LDP STR0A,DP");
asm(" LDP @STR0A,AR0");
asm(" LDP @STR0D,R0");
asm(" STI R0,*AR0");
asm(" LDP STR1A,AR0");
asm(" LDP STR1D,R0");
asm(" STI R0,*AR0");
asm(" LDP IOSTRA,AR0");
asm(" LDP IOSTRD,R0");
asm(" STI R0,*AR0");
/* null state to VSI */
dio32();
do {
STOP=*pointerSTOP;
}
while (STOP==1);
Appendixes.
A.36
if (STOP == 0)
{ atn_table();
/* getting the reference values */
mfs_set=*pointer_mfs_set;
te_set=*pointer_te_set;
Tpc=te_set*100/9.8;
mfs_hst=*pointer_mfs_hst;
te_hst=*pointer_te_hst;
mfs_plim=mfs_set+mfs_hst;
mfs_nlim=mfs_set-mfs_hst;
te_plim=te_set+te_hst;
te_nlim=te_set-te_hst;
/* ini ADC */
set_amd16qs();
set_amd16sa();
asm(" LDI @ITTP,IF");
/* Enalbing interruptions INT0 +INT1 + INT5 of PC/C32 board */
asm(" LDI 0013h,IE");
/* Globals int enable */
asm(" OR 2000h,ST");
/* Start Cache */
asm(" OR 0800h,ST");
}
do {
STOP=*pointerSTOP;
for(s=0;s<20;s++)
{
}
s=0;
}
while (STOP==0);
/* dis int */
asm(" AND 0000h,IE");
asm(" AND 0000h,ST");
/* disconnect VSI */
asm(" LDI 00ffh,R1");
asm(" LSH 16,R1");
asm(" LDI @posicio_DIO,AR1");
asm(" STI R1,*AR1");
*pointer_COUNTER=COUNTER;
*pointer_ERROR=ERROR;
}
/************************************************************************/
/* End function : main */
/************************************************************************/
/************************************************************************/
/* Funcio : c_int01 */
/* Amelia2 A int*/
/************************************************************************/
void c_int01(void)
{
asm(" PUSH AR0");
Appendixes.
A.37
asm(" PUSH AR2");
asm(" PUSH R0");
/* disable int*/
asm(" ANDN 2000h,ST");
asm(" LDI @AMELIA0,AR0");
asm(" LDI *+AR0(ISR),R0");
asm(" LDI *+AR0(DR0),R0");
asm(" LDI *+AR0(DR1),R0");
asm(" LDI *+AR0(DR2),R0");
asm(" LDI *+AR0(DR3),R0");
asm(" LDI *+AR0(DR0),R0");
asm(" LDI *+AR0(DR1),R0");
asm(" LDI *+AR0(DR2),R0");
asm(" LDI *+AR0(DR3),R0");
asm(" LDI *+AR0(DR0),R0");
asm(" LDI *+AR0(DR1),R0");
asm(" LDI *+AR0(DR2),R0");
asm(" LDI *+AR0(DR3),R0");
asm(" LDI *+AR0(DR0),R0");
asm(" LDI *+AR0(DR1),R0");
asm(" LDI *+AR0(DR2),R0");
asm(" ASH -16,R0");
asm(" LDI @_pch2,AR2");
asm(" STI R0,*AR2");
asm(" LDI *+AR0(DR3),R0");
/* int 05 is set*/
asm(" OR 010h,IF");
asm(" POP R0");
asm(" POP AR2");
asm(" POP AR0");
/* erase this interrupt flag */
asm(" ANDN 1h,IF");
}
/************************************************************************/
/* End Function : c_int01 */
/************************************************************************/
/************************************************************************/
/* Funcio : c_int02 */
/* AMELIA2 B int */
/************************************************************************/
void c_int02(void)
{
asm(" PUSH AR0");
asm(" PUSH AR1");
asm(" PUSH AR2");
asm(" PUSH R0");
Appendixes.
A.38
asm(" PUSH R1");
/* disable int*/
asm(" ANDN 2000h,ST");
asm(" LDI @IMR1,AR0");
asm(" LDI *AR0,R0");
asm(" LDI @CH0,AR0");
asm(" LDI @CH1,AR1");
asm(" LDI *AR0,R0");
asm(" LDI *AR1,R1");
asm(" ASH -16,R0");
asm(" LDI @_pch0,AR2");
asm(" STI R0,*AR2");
asm(" ASH -16,R1");
asm(" LDI @_pch1,AR2");
asm(" STI R1,*AR2");
asm(" POP R1");
asm(" POP R0");
asm(" POP AR2");
asm(" POP AR1");
asm(" POP AR0");
/* erase this interrupt flag */
asm(" ANDN 2h,IF");
}
/************************************************************************/
/* End function : c_int02 */
/************************************************************************/
/************************************************************************/
/* Funcio : c_int05 (166 us) */
/************************************************************************/
void c_int05 (void)
{ /* *pointer_FLAG = 0;*/
bit1();
get_ADC();
flux_torque_est_zoh();
dtc();
send_active_state();
bit0();
flc_set_points();
*pointerSTART=1;
/* save_data_DPRAM();*/
save_data_DPRAM_2();
for(d=0;d<150;d++)
{
}
d=0;
get_DC();
program_timer1();
/* DC=0;
asm(" LDI @PERIOD,AR0");
Appendixes.
A.39
asm(" LDI @_DC,R0");
asm(" STI R0,*AR0");
asm(" LDI @TIMECTRL,AR0");
asm(" LDI SETCTRL,R0");
asm(" STI R0,*AR0");
asm(" OR 200h,IE");*/
/* bit1(); */
/* save_data_DPRAM();*/
}
/************************************************************************/
/* End c_int05 (166us) */
/************************************************************************/
/************************************************************************/
/* Funcio : get_ADC (estimator)
/* Retorna : res */
/************************************************************************/
void get_ADC (void)
{
/* disable int*/
asm(" ANDN 2000h,ST");
/* get isA,isB,wm */
/* 65535 / 6volts ; 1volt / 7.0922 amp */
/* ch0_float=-(1.0*ch0*9.155273438e-5*7.1*1.03*6.11/7)+3.5e-3;
ch1_float=-(1.0*ch1*9.155273438e-5*7.1*1.015*6.11/7)-3.0e-2;*/
/* 65535 / 6volts ; 1volt / 10 amp */
/* LEM probe */
ch0_float=-(1.0*ch0*9.155273438e-5*10*4.85/5.15);
/* Tektronic Probe */
ch1_float=-(1.0*ch1*9.155273438e-5*10);
/* 65535 / 4volts ; 6e-2volts / 1rpm */
ch2_float=-(1.0*(ch2-170.5)*6.103515625e-5/(1.10965*6e-4));
/* enalbe global int*/
asm(" OR 2000h,ST");
}
/************************************************************************/
/* End function : get_ADC (estimator) */
/************************************************************************/
/************************************************************************/
/* flux_torque_est_zoh */
/************************************************************************/
void flux_torque_est_zoh(void)
{ /* using the square value */
double sqr=0;
float aux=0;
int index=0;
frD_1=frD;
Appendixes.
A.40
frQ_1=frQ;
wrrds_4=wrrds_3;
wrrds_3=wrrds_2;
wrrds_2=wrrds_1;
wrrds_1=wrrds;
isD_1=isD;
isQ_1=isQ;
te_1=te;
isD=1.2247*ch0_float;
/* isQ=0.95*(1.4142135*ch1_float)+(0.7071067*ch0_float);*/
isQ=(1.3435028*ch1_float)+(0.7071067*ch0_float);
/* wrrds=(wrrds_4+wrrds_3+wrrds_2+wrrds_1+(2*PI/60*ch2_float))/5;*/
wrrds=(wrrds_4+wrrds_3+wrrds_2+wrrds_1+(0.104719*ch2_float))/5;
/*frD=(((1-etz2_5)*((Lm*isD_1)-((Lr/Rr)*P*wrrds_1*frQ_1)))+(etz2_5*frD_1));
frQ=(((1-etz2_5)*((Lm*isQ_1)+((Lr/Rr)*P*wrrds_1*frD_1)))+(etz2_5*frQ_1));*/
/*frD=(1.20256771e-3*isD_1)-(0.499015431e-3*wrrds_1*frQ_1)+(etz2_5*frD_1);
frQ=(1.20256771e-3*isQ_1)+(0.499015431e-3*wrrds_1*frD_1)+(etz2_5*frQ_1);*/
/*frD=(((1-etz1_6)*((Lm*isD_1)-((Lr/Rr)*P*wrrds_1*frQ_1)))+(etz1_6*frD_1));
frQ=(((1-etz1_6)*((Lm*isQ_1)+((Lr/Rr)*P*wrrds_1*frD_1)))+(etz1_6*frQ_1));*/
frD=(0.80223847e-3*isD_1)-(0.332895663e-3*wrrds_1*frQ_1)+(etz1_6*frD_1);
frQ=(0.80223847e-3*isQ_1)+(0.332895663e-3*wrrds_1*frD_1)+(etz1_6*frQ_1);
/*
frD=(((1-etz1_25)*((Lm*isD_1)-((Lr/Rr)*P*wrrds_1*frQ_1)))+(etz1_25*frD_1));
frQ=(((1-etz1_25)*((Lm*isQ_1)+((Lr/Rr)*P*wrrds_1*frD_1)))+(etz1_25*frQ_1));
*/
/* fsD=(isD*(Lx/Lm))+(frD*(Lm/Lr));
fsQ=(isQ*(Lx/Lm))+(frQ*(Lm/Lr));*/
fsD=(isD*0.0298975)+(frD*0.9544077);
fsQ=(isQ*0.0298975)+(frQ*0.9544077);
/* may be it could be just used the square value */
sqr=(fsD*fsD)+(fsQ*fsQ);
mfs=sqrt(sqr);
/* using the square value */
/* mfs=(fsD*fsD)+(fsQ*fsQ);*/
/* using the table */
aux=fsQ/fsD;
if (aux < 0)
{aux=aux*(-1);
}
if( aux < 1 )
{index=(int)(aux*100);
angbis=table[index];
angbisfloat=(float)angbis; }
Appendixes.
A.41
else if ( aux >= 100)
{angbis=table[199];
angbisfloat=(float)angbis; }
else
{index=(int)(aux+99);
angbis=table[index];
angbisfloat=(float)angbis; }
if ( fsD > 0)
{ if( fsQ < 0)
{angbisfloat=(float)((-1)*angbis);}
}
else
{
if( fsQ > 0)
{angbisfloat=PI+((-1)*angbisfloat);}
else
{angbisfloat=(angbisfloat-PI);}
}
if (-PI < angbisfloat ) sectbis=4;
if ((-5*PI/6) < angbisfloat ) sectbis=5;
if ((-PI/2) < angbisfloat) sectbis=6;
if (-PI/6 < angbisfloat) sectbis=1;
if (PI/6 < angbisfloat) sectbis=2;
if (PI/2 < angbisfloat) sectbis=3;
if ((5*PI/6) < angbisfloat) sectbis= 4;
/* te=P*c*((fsD*isQ)-(fsQ*isD));*/
te=1.632992*((fsD*isQ)-(fsQ*isD));
}
/************************************************************************/
/* End function: flux_torque_est_zoh */
/************************************************************************/
/************************************************************************/
/* dtc */
/************************************************************************/
void dtc (void)
{ /* needed for FLDTC */
e1_b_1=e1_b;
if ( mfs > mfs_plim)
mfs_e = 0;
else if ( mfs < mfs_nlim)
mfs_e = 1;
if ( te > (te_plim))
te_e = 0;
else
te_e = 2;
switch(sectbis)
{
case 1:
Appendixes.
A.42
e_fi_ti=0xa5;
e_fi_td=0x99;
e_fd_ti=0xa6;
e_fd_td=0x9a;
e_fi_ti_b=2;
e_fi_td_b=6;
e_fd_ti_b=3;
e_fd_td_b=5;
break;
case 2:
e_fi_ti=0xa6;
e_fi_td=0xa9;
e_fd_ti=0x96;
e_fd_td=0x99;
e_fi_ti_b=3;
e_fi_td_b=1;
e_fd_ti_b=4;
e_fd_td_b=6;
break;
case 3:
e_fi_ti=0x96;
e_fi_td=0xa5;
e_fd_ti=0x9a;
e_fd_td=0xa9;
e_fi_ti_b=4;
e_fi_td_b=2;
e_fd_ti_b=5;
e_fd_td_b=1;
break;
case 4:
e_fi_ti=0x9a;
e_fi_td=0xa6;
e_fd_ti=0x99;
e_fd_td=0xa5;
e_fi_ti_b=5;
e_fi_td_b=3;
e_fd_ti_b=6;
e_fd_td_b=2;
break;
case 5:
e_fi_ti=0x99;
e_fi_td=0x96;
e_fd_ti=0xa9;
e_fd_td=0xa6;
e_fi_ti_b=6;
e_fi_td_b=4;
e_fd_ti_b=1;
e_fd_td_b=3;
break;
case 6:
e_fi_ti=0xa9;
e_fi_td=0x9a;
e_fd_ti=0xa5;
e_fd_td=0x96;
e_fi_ti_b=1;
e_fi_td_b=5;
Appendixes.
A.43
e_fd_ti_b=2;
e_fd_td_b=4;
break;
}
switch(te_e)
{
case 0:
if ( mfs_e == 0 )
{ e1 = e_fd_td;
e1_b = e_fd_td_b; }
else
{ e1 = e_fi_td;
e1_b = e_fi_td_b; }
break;
case 1:
if ( mfs_e == 0 )
{ e1 = e0;
e1_b = 0; }
else
{ e1 = e0;
e1_b = 0;}
break;
case 2:
if ( mfs_e == 0 )
{ e1 = e_fd_ti;
e1_b = e_fd_ti_b; }
else
{ e1 = e_fi_ti;
e1_b = e_fi_ti_b;}
break;
}
/* needed for FLDTC */
if (e1_b == e1_b_1)
EQ=1;
else
EQ=0;
}
/************************************************************************/
/* End function: dtc */
/************************************************************************/
/************************************************************************/
/* flc_set_points */
/************************************************************************/
void flc_set_points (void)
/* MULTIPLY 0.683 FOR MOTOR 2 */
/* MULTIPLY 0.5 FOR 250us */
/* MULTIPLY 0.7 FOR 166us */
{ if (EQ == 0)
{
/* FLC1 */
te_err_i=(te_set-te)*0.31;
if (te_err_i > 1.4)
te_err_i = 1.4;
if (te_err_i < -1.4)
te_err_i = -1.4;
Appendixes.
A.44
index1=((te_err_i+0.1)/0.2)+7;
/* rd 2 degress */
/* fin2=(fin2*180/PI)+180+30;*/
angbisfloat=(angbisfloat*57.29)+210;
in2=angbisfloat/60;
angbisfloat=angbisfloat-60*in2;
if (angbisfloat > 60)
angbisfloat = 60;
if (angbisfloat < 0)
angbisfloat = 0;
index2= (angbisfloat+3)/6;
/* Wpc=wrrds*100/146; */
Wpc=wrrds*0.685;
if (Tpc >= Wpc)
{fin3=Tpc+Wpc+Wpc;
in2=mfs_e+10;
*pointerFI=in2;
}
else
{fin3=Tpc+Tpc+Wpc;
in2=mfs_e;
*pointerFI=in2;
}
if (fin3 > 280)
fin3 = 280;
if (fin3 < 100)
fin3 = 100;
/* index3=(fin3-100+7.5)/15;*/
index3=(fin3-92.5)/15;
/* count1=(11*13*index1)+(13*index2)+(index3);*/
count1=(143*index1)+(13*index2)+(index3);
*pointer_count1=count1;
*pointerEQ=0;
}
else
{
/* FLC2 */
te_err_i_1=(te_set-te_1)*0.31;
inc_te_i=(te-te_1)*0.31;
/* te_err_i_1=0.3;
inc_te_i=-0.5;*/
if ( inc_te_i > 0.7 )
inc_te_i = 0.7;
if (inc_te_i < -0.7)
inc_te_i = -0.7;
in1=(inc_te_i+0.025)/0.05+14;
if (te_err_i_1 > 0.7)
te_err_i_1 = 0.7;
if (te_err_i_1 < -0.7)
te_err_i_1 = -0.7;
in2=(te_err_i_1+0.025)/0.05+14;
count1=(29*in1)+in2;
*pointer_count1=count1;
Appendixes.
A.45
*pointer_dc_aux=dc_aux;
*pointerEQ=1;
}
}
/************************************************************************/
/* End function: flc_set_points */
/************************************************************************/
/************************************************************************/
/* Function : get_DC */
/************************************************************************/
void get_DC(void)
{ COUNTER++;
START=*pointerSTART;
if (START==1)
{
ERROR=ERROR+1;
ERROR_FLAG=1;
}
else
{
ERROR_FLAG=0;
if (EQ == 0)
{
DC=*pointerDCFLC1;
DC2=DC;
}
else
{
DC=*pointerDCFLC2;
DC2=DC;
/* inc_dc=*pointer_inc_dc;*/
}
}
}
/************************************************************************/
/* End get_DC */
/************************************************************************/
/************************************************************************/
/* Function : program_timer1 */
/************************************************************************/
void program_timer1(void)
{
/* 1ct=80ns=80e-9s. */
/* 125us=1562.5ct*/
/* 10us=8 % 125*/
/* dc=1 => all active state. 1562 ct.*/
/* dc=0.92 => 1437ct */
/* dc=0.08 => 125ct */
/* 3125 for 250us */
Appendixes.
A.46
/* 2083 fpr 166us */
if ( DC > 2000 )
{
/*do not program the timer 1. Do not enable its interrupt*/
/*stop the timer wherever it was*/
asm(" LDI @TIMECTRL,AR0");
asm(" LDI RSTCTRL,R0");
asm(" STI R0,*AR0");
/* send_active_state();*/
dc_aux=1.0;
}
else if ( ERROR_FLAG == 1)
{
DC=600;
/*program the timer*/
asm(" LDI @PERIOD,AR0");
asm(" LDI @_DC,R0");
asm(" STI R0,*AR0");
/*start the timer*/
asm(" LDI @TIMECTRL,AR0");
asm(" LDI SETCTRL,R0");
asm(" STI R0,*AR0");
/* send_active_state();*/
/* dc_aux=(600+1000)/2083.0;*/
dc_aux=0.768;
/*Enable timer 1 interupt */
asm(" OR 200h,IE");
}
else if ( DC< 1084)
{
/*do not program the timer 1. Do not enable its interrupt*/
/*stop the timer wherever it was*/
asm(" LDI @TIMECTRL,AR0");
asm(" LDI RSTCTRL,R0");
asm(" STI R0,*AR0");
/* SEND just a null state*/
asm(" LDI @_e0,R1");
asm(" LSH 16,R1");
asm(" LDI @posicio_DIO,AR1");
asm(" STI R1,*AR1");
/* dc_aux=1000/2083.0; */
dc_aux=0.48;
}
else
{
/* 70/166*2083 = 878 */
DC=DC2-1082;
/* DC=600; */
/*program the timer*/
asm(" LDI @PERIOD,AR0");
asm(" LDI @_DC,R0");
asm(" STI R0,*AR0");
/*start the timer*/
Appendixes.
A.47
asm(" LDI @TIMECTRL,AR0");
asm(" LDI SETCTRL,R0");
asm(" STI R0,*AR0");
/* send_active_state();*/
/* dc_aux=(DC+878)/2083.0;*/
dc_aux=DC2/2083.0;
/*Enable timer 1 interupt */
asm(" OR 200h,IE");
}
}
/************************************************************************/
/* End program_timer1 */
/************************************************************************/
/************************************************************************/
/* send_active_state */
/************************************************************************/
void send_active_state (void)
{
asm(" PUSH AR1");
asm(" PUSH R1");
asm(" LDI @_e1,R1");
asm(" LSH 16,R1");
/* as long as save_active_state is not used */
/* asm(" LDI @pointerdio,AR1");*/
/* asm(" LDI *AR1,R1");*/
asm(" LDI @posicio_DIO,AR1");
asm(" STI R1,*AR1");
asm(" POP R1");
asm(" POP AR1");
}
/************************************************************************/
/* End function: send_active_state */
/************************************************************************/
/************************************************************************/
/* Funcio : save_data_DPRAM (estimator) */
/* Retorna : res */
/************************************************************************/
void save_data_DPRAM (void)
{ float e1_b_aux,DC_b,te_aux;
sectbis_aux=sectbis*(-1);
e1_b_aux=e1_b*(-1);
DC_b=DC2/2083.0;
te_aux=te;
*pointerf0=te;
*pointerf1=te_e;
*pointerf2=dc_aux;
*pointerf3=e1_b_aux;
*pointerf4=sectbis_aux;
*pointerf5=mfs;
*pointerf6=mfs_e;
Appendixes.
A.48
*pointerf7=EQ;
/* *pointerf8=;
*pointerf9=;*/
/*10*/
/* *pointerfa=11;
*pointerf0=e1_b;
*pointerf1=sectbis_aux;
*pointerf2=te_e;
*pointerf3=mfs_e;
*pointerf4=te_set;
*pointerf5=fsD;
*pointerf6=fsQ;
*pointerf7=mfs;
*pointerf8=te;
*pointerf9=mfs_set;*/
/*10*/
/* *pointerfa=wrrds_1; */
/* *pointerfb=te;
*pointerfc=ang;
*pointerfd=sect;
*pointerfe=frD;
*pointerff=frQ;
*pointerf10=wrrds;
*pointerf11=isDdef;
*pointerf12=isQdef;
*pointerf13=ange2;*/
/*20*/
/* *pointer_FLAG = 1;*/
}
/************************************************************************/
/* End function: save_data_DPRAM */
/************************************************************************/
/************************************************************************/
/* Funcio : save_data_DPRAM_2 (estimator) */
/* Retorna : res */
/************************************************************************/
void save_data_DPRAM_2 (void)
{ float mfs_set_aux,mfs_aux,te_set_aux,te_aux,wrrds_aux;
mfs_set_aux=mfs_set*(-1);
mfs_aux=mfs*(-1);
te_set_aux=te_set;
te_aux=te;
wrrds_aux=wrrds/(-10);
*pointerf0=mfs_set_aux;
*pointerf1=mfs_aux;
*pointerf2=te_set_aux;
*pointerf3=te_aux;
*pointerf4=wrrds_aux;
}
/************************************************************************/
Appendixes.
A.49
/* End function: save_data_DPRAM_2 */
/************************************************************************/
/************************************************************************/
/* bit1 */
/************************************************************************/
void bit1 (void)
{
asm(" PUSH AR1");
asm(" PUSH R1");
asm(" LDI 0000h,R1");
asm(" LSH 16,R1");
asm(" LDI @posicio_DIO2,AR1");
asm(" STI R1,*AR1");
asm(" POP R1");
asm(" POP AR1");
}
/************************************************************************/
/* End function: bit1 */
/************************************************************************/
/************************************************************************/
/* bit0 */
/************************************************************************/
void bit0 (void)
{
asm(" PUSH AR1");
asm(" PUSH R1");
asm(" LDI 00ffh,R1");
asm(" LSH 16,R1");
asm(" LDI @posicio_DIO2,AR1");
asm(" STI R1,*AR1");
asm(" POP R1");
asm(" POP AR1");
}
/************************************************************************/
/* End function: bit0 */
/************************************************************************/
/************************************************************************/
/* Function : c_int10 (timer 1 interruption) */
/************************************************************************/
void c_int10(void)
{ /* disable int*/
asm(" ANDN 2000h,ST");
/* clean the int */
asm(" ANDN 200h,IF");
asm(" PUSH AR1");
asm(" PUSH R1");
/* stop the timer1 */
asm(" LDI @TIMECTRL,AR1");
asm(" LDI RSTCTRL,R1");
asm(" STI R1,*AR1");
Appendixes.
A.50
/* send the null state */
asm(" LDI @_e0,R1");
asm(" LSH 16,R1");
asm(" LDI @posicio_DIO,AR1");
asm(" STI R1,*AR1");
asm(" POP R1");
asm(" POP AR1");
}
/************************************************************************/
/* End c_int10 (timer 1 interruption) */
/************************************************************************/
/************************************************************************/
/* save_active_state */
/************************************************************************/
void save_active_state (void)
{ asm(" PUSH AR1");
asm(" PUSH R1");
asm(" LDI @pointerdio,AR1");
asm(" LDI @_e1,R1");
asm(" LSH 16,R1");
asm(" STI R1,*AR1");
asm(" POP R1");
asm(" POP AR1");
}
/************************************************************************/
/* End: save_active_state */
/************************************************************************/
/************************************************************************/
/* Inizialization tasks. Exectuted just once. */
/************************************************************************/
/************************************************************************/
/* Function: set_amd16qs */
/* It inizializates the board AM/D16QS. */
/*************************************************************************/
void set_amd16qs(void)
{
asm(" LDI @AMELIA0,AR0");
asm(" LDI 0010h,R0");
asm(" LSH 16,R0");
asm(" STI R0,*+AR0(DCR)");
/* reset AM/D16QS board*/
asm(" LDI 0000h,R0");
asm(" STI R0,*+AR0(CMR)");
asm(" STI R0,*+AR0(CFR)");
Appendixes.
A.51
/* User Control register config.*/
/* Value 28E3h: TCLK0 clk. factor 1/8 MCLK_0 and MCLK_1 as an output */
/*asm(" LDI 28E0h,R0");*/ /* /1 48 32 */
asm(" LDI 28E1h,R0"); /* /2 24 16 */
/*asm(" LDI 28E2h,R0");*/ /* /4 12 8 */
/*asm(" LDI 28E3h,R0");*/ /* /8 6 4 */
asm(" LSH 16,R0");
asm(" STI R0,*+AR0(CTR)");
/* Config. Serial Data Configuration Register */
/* 00c0h: Enable AMELIA2 */
asm(" LDI 00c0h,R0");
asm(" LSH 16,R0");
asm(" STI R0,*+AR0(SDC)");
/* Config. el Amelia Control Register */
/* Value 00F6h: out of reset, Master config., divide 384 */
/* enable chanals 2 i 3 and M_CLOCK_0 */
/*asm(" LDI 00F6h,R0");*/ /* 32 16 8 4 */
asm(" LDI 00E6h,R0"); /* 48 24 12 6 */
asm(" LSH 16,R0");
asm(" STI R0,*+AR0(CMR)");
/* Config. Configuration Register */
/* Value 8010h. It is cte */
asm(" LDI 8010h,R0");
asm(" LSH 16,R0");
asm(" STI R0,*+AR0(CFR)");
/* Config. Enhanced Configuration Register */
/* 00A0h: level int. It is reset either reading ISR */
/* or reading the channels */
asm(" LDI 00A0h,R0");
asm(" LSH 16,R0");
asm(" STI R0,*+AR0(ECFR)");
/* Config. Enhanced Control Register */
/* Value 0003h. AMELIA2 int. when buffer FIFO is 100% full*/
/*asm(" LDI 0000h,R0");*/ /* 25% */
/*asm(" LDI 0001h,R0");*/
/*asm(" LDI 0002h,R0");*/
asm(" LDI 0003h,R0"); /* 100% */
asm(" LSH 16,R0");
asm(" STI R0,*+AR0(ECTR)");
/* Config. Interrupt Mask Register */
/* Value 2000h int. when buffer if full at the specified % */
asm(" LDI 2000h,R0");
asm(" LSH 16,R0");
asm(" STI R0,*+AR0(IMR)");
Appendixes.
A.52
/* Wait loop calibration system */
/*asm(" LDI 0800h,R0");
asm(" LSH 13,R0");
asm("Calib_wait: SUBI 01h,R0");
asm(" BNZ Calib_wait");*/
asm(" LDI 0300h,R0");
asm(" LSH 15,R0");
asm("Calib_wait: SUBI 01h,R0");
asm(" BNZ Calib_wait");
/* Clean the FIFO (4 read for channel) */
asm(" LDI *+AR0(DR0),R0");
asm(" LDI *+AR0(DR1),R0");
asm(" LDI *+AR0(DR2),R0");
asm(" LDI *+AR0(DR3),R0");
asm(" LDI *+AR0(DR0),R0");
asm(" LDI *+AR0(DR1),R0");
asm(" LDI *+AR0(DR2),R0");
asm(" LDI *+AR0(DR3),R0");
asm(" LDI *+AR0(DR0),R0");
asm(" LDI *+AR0(DR1),R0");
asm(" LDI *+AR0(DR2),R0");
asm(" LDI *+AR0(DR3),R0");
asm(" LDI *+AR0(DR0),R0");
asm(" LDI *+AR0(DR1),R0");
asm(" LDI *+AR0(DR2),R0");
asm(" LDI *+AR0(DR3),R0");
/* Clean any int. (reading ISR) */
asm(" LDI *+AR0(ISR),R0");
}
/************************************************************************/
/* End function : set_amd16qs */
/************************************************************************/
/************************************************************************/
/* Function: set_amd16sa */
/* It inizializates the board AM/D16QS. */
/************************************************************************/
void set_amd16sa(void)
{
asm(" LDI @DCR1,AR0");
asm(" LDI @DCR1_DEF,R0");
asm(" STI R0,*AR0");
asm(" LDI @UCR,AR0");
asm(" LDI @UCR_DEF,R0");
asm(" STI R0,*AR0");
asm(" LDI @ACR,AR0");
asm(" LDI @ACR_DEF,R0");
asm(" STI R0,*AR0");
Appendixes.
A.53
asm(" LDI @TIMER1,AR0");
asm(" LDI @TIMER1_DEF,R0");
asm(" STI R0,*AR0");
asm(" LDI @CONFIG,AR0");
asm(" LDI @CONFIG_DEF,R0");
asm(" STI R0,*AR0");
asm(" LDI @IMR1,AR0");
asm(" LDI @IMR1_DEF,R0");
asm(" STI R0,*AR0");
}
/************************************************************************/
/* End function : set_amd16sa */
/************************************************************************/
/************************************************************************/
/* Funcio : dio32 */
/* Inizializates the DIO 32 */
/************************************************************************/
void dio32(void)
{
/* Dio32 as a master without any trigger */
/* asm(" LDI 0241h,R1");*/
asm(" LDI 023Ch,R1");
asm(" LSH 16,R1");
asm(" LDI @CONTROL,AR1");
asm(" STI R1,*AR1");
/* 32 bits as output */
asm(" LDI 1111h,R1");
asm(" LSH 16,R1");
asm(" LDI @PORTREG,AR1");
asm(" STI R1,*AR1");
/* disconnect the bridge */
asm(" LDI 00ffh,R1");
asm(" LSH 16,R1");
asm(" LDI @posicio_DIO,AR1");
asm(" STI R1,*AR1");
asm(" LDI 0000h,R1");
asm(" LSH 16,R1");
asm(" LDI @posicio_DIO2,AR1");
asm(" STI R1,*AR1");
}
/************************************************************************/
/* End function : dio_32 */
/************************************************************************/
Appendixes.
A.54
/************************************************************************/
/* Funcio : atn_table */
/* Creates a table with ATN values */
/************************************************************************/
void atn_table(void)
{
double s=0,r=0;
int k=0;
for(k=0;k<=100;k++)
{
r=atan(s);
table[k]=r;
s=s+0.01;
}
for(k=100;k<=200;k++)
{
s=k-99;
r=atan(s);
table[k]=r;
}
}
/************************************************************************/
/* End function : atn_table */
/************************************************************************/
Appendixes.
A.55
A.1.4 - PCTH1_9.c
/******************************************************************/
/* PCTH1_9: FLDTC 166us */
/***********************************************************************/
/* Needed C files */
#include <dos.h>
#include <math.h>
#include <conio.h>
#include "c:\mon32\bc45\tic32.h"
#include<stdio.h>
#include<stdlib.h>
#include<time.h>
/* Memory DPRAM positions for the set points + exchange values */
#define FLAG 0x0c00009 // FLAG
#define COUNTER 0x0c0000a
#define HST_MFS 0xc0000bl // Flux set point_hst margin
#define HST_TE 0xc0000cl // Torque set point_hst margin
#define MFS 0xc0000dl // Flux set point
#define TE 0xc0000el // Torque set point
#define STOP 0xc00012l // SVM stop bit
/* Start obtaining the DC */
#define START 0xc00013l // SVM stop bit
/* Errors in obtaining the DC */
#define ERROR 0xc00014l // SVM stop bit
/* FLC1 references values */
#define FLUX_ANGLE_I 0x0c00015 /*Flux angle*/
#define TE_ERR_I 0x0c00016 /*Torque error i+1*/
#define WM 0x0c00017 /*Motor speed */
#define FI 0x0c00018 /*FI=0 flux decrease */
/*FI=1 increase */
/* FLC2 refernces values */
#define COUNT1 0x0c0001a /*Increment Torque error i+1*/
#define DC_AUX 0x0c0001d /* Last DC*/
#define INC_DC 0x0c0001e /* flc2 set point */
#define EQ 0x0c0001f
/* duty cycle */
#define DCFLC1 0x0c0001b /*Duty cycle from FLC1*/
#define DCFLC2 0x0c0001c /*Duty cycle from FLC2*/
#define f0 0xc00048l
#define f1 0xc00049l
#define f2 0xc0004al
#define f3 0xc0004bl
#define f4 0xc0004cl
#define f5 0xc0004dl
#define f6 0xc0004el
#define f7 0xc0004fl
#define f8 0xc00050l
#define f9 0xc00051l
/*10*/
#define fa 0xc00052l
#define fb 0xc00053l
Appendixes.
A.56
#define fc 0xc00054l
#define fd 0xc00055l
#define fe 0xc00056l
#define ff 0xc00057l
#define f10 0xc00058l
#define f11 0xc00059l
#define f12 0xc0005al
#define f13 0xc0005bl
/*20*/
#define f14 0xc0005cl
#define f15 0xc0005dl
#define PI 3.141592654
#define C_INC_DC 842
#define C_FI2 2150
#define C_FI2bis 2150
#define C_FD2 2150
#define C_FD2bis 2150
/* DSP file */
#define FILENAME "TH1_9.OUT"
/* Global variables */
char x;
int flg_err=0,q=0,r=0,j=0,k=0,i=0;
long int t=0;
/* Global adquisition variables */
float v0,v1,v2,v3,v4,v5,v6,v7,v8,v9,va,vb;
float vc,vd,ve,vf,v10,v11,v12,v13,v14,v15;
unsigned long stop=0,flag=0,counter=0,error=0,start=0;
/* set points */
float mfs_set=0,te_set=0,te_hst=0,mfs_hst=0;
/* FLDTC variables */
unsigned long dc2=3125,dc1=3125;
int eq,fi,index1,index2,index3,ct,in1,in2,in3,count, count1;
float Wpc,Tpc,fin1,fin2,fin3,data;
float dc_aux,inc_dc,duty_ratio=1;
float wmrds=0;
FILE *dades;
/*Array where the read file data is stored*/
float struct_INC_DC[C_INC_DC],struct_FI2[C_FI2],struct_FD2[C_FD2];
float struct_FI2bis[C_FI2bis],struct_FD2bis[C_FD2bis];
/* pointer file */
FILE *f_grf;
Appendixes.
A.57
/* data matrix */
float dt [5][300];
/* float dt [5][300];*/
/* Functions definition */
void Read_FLC(void);
void IniciDSP(void);
void Setpoints(void);
void EngegaDSP(void);
void ReadDPRAM(void);
void Savedata(void);
void Find_DC(void);
void AturaDSP(void);
void Data2file(void);
void main (void)
{
clrscr();
printf("\nPress '1' to start\n");
x = getch();
if (x=='1')
{
Read_FLC();
IniciDSP();
delay(500);
Setpoints();
delay (500);
EngegaDSP();
delay (500);
for(t=0; t<500000 ; t++)
{
delay(0.01);
r++;
Get_DPRAM_Word_32(START,&start);
if (start == 1 )
{
Find_DC();
start=0;
Put_DPRAM_Word_32(START,start);
/* for(q=0; q<10 ; q++)
{
}
q=0;*/
/* Get_DPRAM_Word_32(FLAG,&flag);
if (flag == 1 )
{ */
if ( j <= 299 && r > 20000)
{
ReadDPRAM();
Savedata(); /* Store the data array */
j++;
}
/* }
/* else
{
Appendixes.
A.58
flg_err++;
} */
}
}
}
AturaDSP();
printf("\nEND ");
delay(2000);
Get_DPRAM_Word_32(ERROR,&error);
printf("\nThe number of errors is %li",error);
Get_DPRAM_Word_32(COUNTER,&counter);
printf("\nThe number of times is %li",counter);
printf("\nThe number of flag real errors is %i",flg_err);
Data2file();
getche();
}
/******************************************************************/
/* DSP inizialization */
/******************************************************************/
void IniciDSP(void)
{
/* Seleccio data type for the DSP */
Set_Processor_Data_Type_Size_32();
/* DSP Inicialitzation. Board adress (0x290), DPRMA adress (0xD00)*/
/* bus ISA size */
Select_Board(0x290, 0xd00, 8);
/* Enable DPRAM */
Enable_DPRAM();
/* DSP reset */
Global_Reset();
/* Load the file to be executed */
Load_Object_File(FILENAME);
}
/*&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&*/
/* End of DSP inizialization */
/*&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&*/
/******************************************************************/
/* Engega DSP */
/******************************************************************/
void EngegaDSP(void)
{ stop=0;
Put_DPRAM_Word_32(STOP, stop);
/* Run file */
Run_From(Get_Entry_PC());
delay(2000);
}
/*&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&*/
Appendixes.
A.59
/* End Engega DSP */
/*&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&*/
/******************************************************************/
/* Setpoints */
/******************************************************************/
void Setpoints(void)
{ double mfs_sug=0,te_set_d=0;
printf("\n\nTorque setpoint N/m: ");
scanf("%f", &te_set);
Put_DPRAM_Float_32(TE,te_set);
Tpc=te_set*100/9.8;
printf("Torque set point hst margin: ");
scanf("%f", &te_hst);
Put_DPRAM_Float_32(HST_TE,te_hst);
te_set_d=te_set;
/* because squared value */
/* mfs_sug=(0.3665*sqrt(te_set_d)*0.3665*sqrt(te_set_d));
printf("\nThe suggested optimized flux square value is %lf \n",
mfs_sug);*/
mfs_sug=0.3665*sqrt(te_set_d);
printf("\nThe suggested optimized flux value is %lf \n", mfs_sug);
printf("\nFlux set point: ");
scanf("%f", &mfs_set);
/* mfs_set=1.05;*/
Put_DPRAM_Float_32(MFS,mfs_set);
printf("Flux set point hst margin: ");
scanf("%f", &mfs_hst);
Put_DPRAM_Float_32(HST_MFS,mfs_hst);
}
/*&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&*/
/* End setpoints */
/*&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&*/
/******************************************************************/
/* Read DPRAM */
/******************************************************************/
void ReadDPRAM(void)
{
Get_DPRAM_Float_32(f0,&v0);
Get_DPRAM_Float_32(f1,&v1);
Get_DPRAM_Float_32(f2,&v2);
Get_DPRAM_Float_32(f3,&v3);
Get_DPRAM_Float_32(f4,&v4);
/*Get_DPRAM_Float_32(f5,&v5);
Get_DPRAM_Float_32(f6,&v6);
Get_DPRAM_Float_32(f7,&v7);
/*Get_DPRAM_Float_32(f8,&v8);
Get_DPRAM_Float_32(f9,&v9);
/*10*/
Appendixes.
A.60
/*Get_DPRAM_Float_32(fa,&va);
Get_DPRAM_Float_32(fb,&vb);
Get_DPRAM_Float_32(fc,&vc);
Get_DPRAM_Float_32(fd,&vd);
Get_DPRAM_Float_32(fe,&ve);
Get_DPRAM_Float_32(ff,&vf);
Get_DPRAM_Float_32(f10,&v10);
Get_DPRAM_Float_32(f11,&v11);
Get_DPRAM_Float_32(f12,&v12);
Get_DPRAM_Float_32(f13,&v13); */
/*20*/
/*Get_DPRAM_Float_32(f14,&v14);
Get_DPRAM_Float_32(f15,&v15);*/
}
/*&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&*/
/* End read DPRAM */
/*&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&*/
/******************************************************************/
/* Savedata */
/******************************************************************/
void Savedata(void)
{
dt[0][j]=v0;
dt[1][j]=v1;
dt[2][j]=v2;
dt[3][j]=v3;
dt[4][j]=v4;
/*dt[5][j]=v5;
dt[6][j]=v6;
dt[7][j]=v7;
/*dt[8][j]=v8;
dt[9][j]=v9;
/*10*/
/*dt[10][j]=va;
dt[11][j]=vb;
dt[12][j]=vc;
dt[13][j]=vd;
dt[14][j]=ve;
dt[15][j]=vf;
dt[16][j]=v10;
dt[17][j]=v11;
dt[18][j]=v12;
dt[19][j]=v13;*/
/*20*/
/*dt[20][j]=v14;
dt[21][j]=v15;*/
}
/*&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&*/
/* End save data */
/*&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&*/
/******************************************************************/
/* Find_DC */
Appendixes.
A.61
/******************************************************************/
void Find_DC(void)
{
Get_DPRAM_Word_32(EQ,&eq);
if (eq == 0)
{
/* FLC1 */
Get_DPRAM_Word_32(COUNT1,&count1);
Get_DPRAM_Word_32(FI,&fi);
/* fi=1 and Tpc >=Wpc 10. Total fi=11*/
/* fi=0 and Tpc >=Wpc 10. Total fi=10*/
/* fi=1 and Tpc < Wpc 00. Total fi=01*/
/* fi=0 and Tpc < Wpc 00. Total fi=00*/
if (fi == 11)
duty_ratio=struct_FI2[count1];
else if (fi == 1)
duty_ratio=struct_FI2bis[count1];
else if (fi == 10)
duty_ratio=struct_FD2[count1];
else
duty_ratio=struct_FD2bis[count1];
/* if (duty_ratio < 0.45 )
duty_ratio=0.45;
if (duty_ratio > 0.55)
duty_ratio=0.55;*/
/* 83us=1041,666667ct 125us=1562.5ct 166us=2083.33ct 250us=3125ct */
dc1=duty_ratio*2083;
if (dc1<1850)
dc1=1850;
Put_DPRAM_Word_32(DCFLC1,dc1);
}
else
{
/* FLC2 */
Get_DPRAM_Word_32(COUNT1,&count1);
Get_DPRAM_Float_32(DC_AUX,&dc_aux);
inc_dc=struct_INC_DC[count1];
duty_ratio=inc_dc+dc_aux;
/* if (duty_ratio < 0.2 )
duty_ratio=0.2;
if (duty_ratio > 0.85)
duty_ratio=0.85;*/
dc2=duty_ratio*2083;
if (dc2<1850)
dc2=1850;
Put_DPRAM_Word_32(DCFLC2,dc2);
/* Put_DPRAM_Float_32(INC_DC,inc_dc); */
}
}
/*&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&*/
Appendixes.
A.62
/* End Find_DC */
/*&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&*/
/******************************************************************/
/* Stop DSP */
/******************************************************************/
void AturaDSP(void)
{ stop=1;
Put_DPRAM_Word_32(STOP, stop);
}
/*&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&*/
/* End stop DSP */
/*&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&*/
/******************************************************************/
/* Data2file */
/******************************************************************/
void Data2file(void)
{
if ((f_grf = fopen("\\FLDTC11.GRF", "w")) == 0)
{
printf("Unable to open file");
return;
}
else
{
for(k=0;k<j;k++)
{
/* fprintf(f_grf, "%e %e %e %e %e %e %e
%e\n",dt[0][k],dt[1][k],dt[2][k],dt[3][k],dt[4][k],dt[5][k],dt[6][k],dt[7][
k]);*/
fprintf(f_grf, " %e %e %e %e
%e\n",dt[0][k],dt[1][k],dt[2][k],dt[3][k],dt[4][k]);
}
fclose(f_grf);
}
}
/*&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&*/
/* End Data2file */
/*&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&*/
/******************************************************************/
/* Read_FLC */
/******************************************************************/
void Read_FLC(void)
{ clrscr();
count=0;
count1=0;
data=0;
/*open the file (it must be in the root */
dades=fopen("INC_DC.txt","rt");
/*while not file end*/
while (!feof(dades))
{
fscanf(dades,"%f",&data); /* read file float */
Appendixes.
A.63
struct_INC_DC[count]=data; /* save it to the structure */
/*printf("\nThe input %d of the file, is %f",count,data); */
count++;
}
fclose(dades); /*the file is closed*/
printf("\nThe file INC_DC has %d inputs",count);
/* The data from the structures is shown */
/* while (count1<count)
{
printf("\nThe data input %d of the struct is
%f",count1,estructura[count1]);
count1++;
} */
/* Second file*/
count=0;
count1=0;
data=0;
/*open the file (it must be in the root */
dades=fopen("FD2.txt","rt");
/*while not file end*/
while (!feof(dades))
{
fscanf(dades,"%f",&data); /* read file float */
struct_FD2[count]=data; /* save it to the structure */
/*printf("\nThe input %d of the file, is %f",count,data); */
count++;
}
fclose(dades); /*the file is closed*/
printf("\nThe file FD2 has %d inputs",count);
/* Third file*/
count=0;
count1=0;
data=0;
/*open the file (it must be in the root */
dades=fopen("FI2.txt","rt");
/*while not file end*/
while (!feof(dades))
{
fscanf(dades,"%f",&data); /* read file float */
struct_FI2[count]=data; /* save it to the structure */
/*printf("\nThe input %d of the file, is %f",count,data); */
count++;
}
fclose(dades); /*the file is closed*/
printf("\nThe file FI2 has %d inputs",count);
/* Fourth file*/
Appendixes.
A.64
count=0;
count1=0;
data=0;
/*open the file (it must be in the root */
dades=fopen("FD2bis.txt","rt");
/*while not file end*/
while (!feof(dades))
{
fscanf(dades,"%f",&data); /* read file float */
struct_FD2bis[count]=data; /* save it to the structure */
/*printf("\nThe input %d of the file, is %f",count,data); */
count++;
}
fclose(dades); /*the file is closed*/
printf("\nThe file FD2bis has %d inputs",count);
/* Fifth file*/
count=0;
count1=0;
data=0;
/*open the file (it must be in the root */
dades=fopen("FI2bis.txt","rt");
/*while not file end*/
while (!feof(dades))
{
fscanf(dades,"%f",&data); /* read file float */
struct_FI2bis[count]=data; /* save it to the structure */
/*printf("\nThe input %d of the file, is %f",count,data); */
count++;
}
fclose(dades); /*the file is closed*/
printf("\nThe file FI2bis has %d inputs",count);
}
/*&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&*/
/* End Read_FLC */
/*&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&*/
Appendixes.
A.65
A.2 - Fuzzy rules.
A.2.1 - FLC 1.
The Fuzzy Logic controller 1 system comprises four groups of rules, each of which contains
46 rules (see section 3.2.1). Two of them are used when the stator flux is smaller than its
reference value (Flux increase) and the other two in the opposite case (Flux decrease). In any
case just one fuzzy system is used per iteration, and it depends on the working point.
All four groups of 46 rules are listed below.
Appendixes.
A.66
A.2.1.1 - Flux increase, Wpc<Tpc.
1. If (t-e is n-l) and (s-f-p is s) and (T+2w is s) then (dc is vl) (1)
2. If (t-e is n-l) and (s-f-p is m) and (T+2w is s) then (dc is vl) (1)
3. If (t-e is n-l) and (s-f-p is l) and (T+2w is s) then (dc is m) (1)
4. If (t-e is n-m) and (s-f-p is s) and (T+2w is s) then (dc is s) (1)
5. If (t-e is n-m) and (s-f-p is m) and (T+2w is s) then (dc is s) (1)
6. If (t-e is n-m) and (s-f-p is l) and (T+2w is s) then (dc is s) (1)
7. If (t-e is n-s) and (s-f-p is s) and (T+2w is s) then (dc is z) (1)
8. If (t-e is n-s) and (s-f-p is m) and (T+2w is s) then (dc is z) (1)
9. If (t-e is n-s) and (s-f-p is l) and (T+2w is s) then (dc is z) (1)
10. If (t-e is s) and (s-f-p is s) and (T+2w is s) then (dc is s) (1)
11. If (t-e is s) and (s-f-p is m) and (T+2w is s) then (dc is s) (1)
12. If (t-e is s) and (s-f-p is l) and (T+2w is s) then (dc is s) (1)
13. If (t-e is m) and (s-f-p is s) and (T+2w is s) then (dc is s) (1)
14. If (t-e is m) and (s-f-p is m) and (T+2w is s) then (dc is m) (1)
15. If (t-e is m) and (s-f-p is l) and (T+2w is s) then (dc is m) (1)
16. If (t-e is l) then (dc is vl) (1)
17. If (t-e is n-l) and (s-f-p is s) and (T+2w is m) then (dc is vl) (1)
18. If (t-e is n-l) and (s-f-p is m) and (T+2w is m) then (dc is vl) (1)
19. If (t-e is n-l) and (s-f-p is l) and (T+2w is m) then (dc is l) (1)
20. If (t-e is n-m) and (s-f-p is s) and (T+2w is m) then (dc is s) (1)
21. If (t-e is n-m) and (s-f-p is m) and (T+2w is m) then (dc is s) (1)
22. If (t-e is n-m) and (s-f-p is l) and (T+2w is m) then (dc is s) (1)
23. If (t-e is n-s) and (s-f-p is s) and (T+2w is m) then (dc is m) (1)
24. If (t-e is n-s) and (s-f-p is m) and (T+2w is m) then (dc is m) (1)
25. If (t-e is n-s) and (s-f-p is l) and (T+2w is m) then (dc is m) (1)
26. If (t-e is s) and (s-f-p is s) and (T+2w is m) then (dc is m) (1)
27. If (t-e is s) and (s-f-p is m) and (T+2w is m) then (dc is m) (1)
28. If (t-e is s) and (s-f-p is l) and (T+2w is m) then (dc is l) (1)
29. If (t-e is m) and (s-f-p is s) and (T+2w is m) then (dc is m) (1)
30. If (t-e is m) and (s-f-p is m) and (T+2w is m) then (dc is l) (1)
31. If (t-e is m) and (s-f-p is l) and (T+2w is m) then (dc is l) (1)
32. If (t-e is n-l) and (s-f-p is s) and (T+2w is l) then (dc is vl) (1)
33. If (t-e is n-l) and (s-f-p is m) and (T+2w is l) then (dc is vl) (1)
34. If (t-e is n-l) and (s-f-p is l) and (T+2w is l) then (dc is vl) (1)
35. If (t-e is n-m) and (s-f-p is s) and (T+2w is l) then (dc is vl) (1)
36. If (t-e is n-m) and (s-f-p is m) and (T+2w is l) then (dc is z) (1)
37. If (t-e is n-m) and (s-f-p is l) and (T+2w is l) then (dc is z) (1)
38. If (t-e is n-s) and (s-f-p is s) and (T+2w is l) then (dc is vl) (1)
39. If (t-e is n-s) and (s-f-p is m) and (T+2w is l) then (dc is vl) (1)
40. If (t-e is n-s) and (s-f-p is l) and (T+2w is l) then (dc is vl) (1)
41. If (t-e is s) and (s-f-p is s) and (T+2w is l) then (dc is vl) (1)
42. If (t-e is s) and (s-f-p is m) and (T+2w is l) then (dc is vl) (1)
43. If (t-e is s) and (s-f-p is l) and (T+2w is l) then (dc is vl) (1)
44. If (t-e is m) and (s-f-p is s) and (T+2w is l) then (dc is vl) (1)
45. If (t-e is m) and (s-f-p is m) and (T+2w is l) then (dc is vl) (1)
46. If (t-e is m) and (s-f-p is l) and (T+2w is l) then (dc is vl) (1)
Appendixes.
A.67
A.2.1.2 - Flux increase, Wpc>Tpc.
1. If (t-e is n-l) and (s-f-p is s) and (2T+w is s) then (dc is vl) (1)
2. If (t-e is n-l) and (s-f-p is m) and (2T+w is s) then (dc is vl) (1)
3. If (t-e is n-l) and (s-f-p is l) and (2T+w is s) then (dc is m) (1)
4. If (t-e is n-m) and (s-f-p is s) and (2T+w is s) then (dc is s) (1)
5. If (t-e is n-m) and (s-f-p is m) and (2T+w is s) then (dc is s) (1)
6. If (t-e is n-m) and (s-f-p is l) and (2T+w is s) then (dc is s) (1)
7. If (t-e is n-s) and (s-f-p is s) and (2T+w is s) then (dc is z) (1)
8. If (t-e is n-s) and (s-f-p is m) and (2T+w is s) then (dc is z) (1)
9. If (t-e is n-s) and (s-f-p is l) and (2T+w is s) then (dc is z) (1)
10. If (t-e is s) and (s-f-p is s) and (2T+w is s) then (dc is s) (1)
11. If (t-e is s) and (s-f-p is m) and (2T+w is s) then (dc is s) (1)
12. If (t-e is s) and (s-f-p is l) and (2T+w is s) then (dc is s) (1)
13. If (t-e is m) and (s-f-p is s) and (2T+w is s) then (dc is s) (1)
14. If (t-e is m) and (s-f-p is m) and (2T+w is s) then (dc is m) (1)
15. If (t-e is m) and (s-f-p is l) and (2T+w is s) then (dc is m) (1)
16. If (t-e is l) then (dc is vl) (1)
17. If (t-e is n-l) and (s-f-p is s) and (2T+w is m) then (dc is vl) (1)
18. If (t-e is n-l) and (s-f-p is m) and (2T+w is m) then (dc is vl) (1)
19. If (t-e is n-l) and (s-f-p is l) and (2T+w is m) then (dc is l) (1)
20. If (t-e is n-m) and (s-f-p is s) and (2T+w is m) then (dc is s) (1)
21. If (t-e is n-m) and (s-f-p is m) and (2T+w is m) then (dc is s) (1)
22. If (t-e is n-m) and (s-f-p is l) and (2T+w is m) then (dc is s) (1)
23. If (t-e is n-s) and (s-f-p is s) and (2T+w is m) then (dc is m) (1)
24. If (t-e is n-s) and (s-f-p is m) and (2T+w is m) then (dc is m) (1)
25. If (t-e is n-s) and (s-f-p is l) and (2T+w is m) then (dc is m) (1)
26. If (t-e is s) and (s-f-p is s) and (2T+w is m) then (dc is m) (1)
27. If (t-e is s) and (s-f-p is m) and (2T+w is m) then (dc is m) (1)
28. If (t-e is s) and (s-f-p is l) and (2T+w is m) then (dc is l) (1)
29. If (t-e is m) and (s-f-p is s) and (2T+w is m) then (dc is m) (1)
30. If (t-e is m) and (s-f-p is m) and (2T+w is m) then (dc is l) (1)
31. If (t-e is m) and (s-f-p is l) and (2T+w is m) then (dc is l) (1)
32. If (t-e is n-l) and (s-f-p is s) and (2T+w is l) then (dc is vl) (1)
33. If (t-e is n-l) and (s-f-p is m) and (2T+w is l) then (dc is vl) (1)
34. If (t-e is n-l) and (s-f-p is l) and (2T+w is l) then (dc is vl) (1)
35. If (t-e is n-m) and (s-f-p is s) and (2T+w is l) then (dc is vl) (1)
36. If (t-e is n-m) and (s-f-p is m) and (2T+w is l) then (dc is z) (1)
37. If (t-e is n-m) and (s-f-p is l) and (2T+w is l) then (dc is z) (1)
38. If (t-e is n-s) and (s-f-p is s) and (2T+w is l) then (dc is vl) (1)
39. If (t-e is n-s) and (s-f-p is m) and (2T+w is l) then (dc is vl) (1)
40. If (t-e is n-s) and (s-f-p is l) and (2T+w is l) then (dc is vl) (1)
41. If (t-e is s) and (s-f-p is s) and (2T+w is l) then (dc is vl) (1)
42. If (t-e is s) and (s-f-p is m) and (2T+w is l) then (dc is vl) (1)
43. If (t-e is s) and (s-f-p is l) and (2T+w is l) then (dc is vl) (1)
44. If (t-e is m) and (s-f-p is s) and (2T+w is l) then (dc is vl) (1)
45. If (t-e is m) and (s-f-p is m) and (2T+w is l) then (dc is vl) (1)
46. If (t-e is m) and (s-f-p is l) and (2T+w is l) then (dc is vl) (1)
Appendixes.
A.68
A.2.1.3 - Flux decrease, Wpc<Tpc.
1. If (t-e is n-l) and (s-f-p is s) and (T+2w is s) then (dc is m) (1)
2. If (t-e is n-l) and (s-f-p is m) and (T+2w is s) then (dc is vl) (1)
3. If (t-e is n-l) and (s-f-p is l) and (T+2w is s) then (dc is vl) (1)
4. If (t-e is n-m) and (s-f-p is s) and (T+2w is s) then (dc is z) (1)
5. If (t-e is n-m) and (s-f-p is m) and (T+2w is s) then (dc is z) (1)
6. If (t-e is n-m) and (s-f-p is l) and (T+2w is s) then (dc is s) (1)
7. If (t-e is n-s) and (s-f-p is s) and (T+2w is s) then (dc is z) (1)
8. If (t-e is n-s) and (s-f-p is m) and (T+2w is s) then (dc is z) (1)
9. If (t-e is n-s) and (s-f-p is l) and (T+2w is s) then (dc is z) (1)
10. If (t-e is s) and (s-f-p is s) and (T+2w is s) then (dc is s) (1)
11. If (t-e is s) and (s-f-p is m) and (T+2w is s) then (dc is s) (1)
12. If (t-e is s) and (s-f-p is l) and (T+2w is s) then (dc is s) (1)
13. If (t-e is m) and (s-f-p is s) and (T+2w is s) then (dc is m) (1)
14. If (t-e is m) and (s-f-p is m) and (T+2w is s) then (dc is m) (1)
15. If (t-e is m) and (s-f-p is l) and (T+2w is s) then (dc is s) (1)
16. If (t-e is l) then (dc is vl) (1)
17. If (t-e is n-l) and (s-f-p is s) and (T+2w is m) then (dc is l) (1)
18. If (t-e is n-l) and (s-f-p is m) and (T+2w is m) then (dc is vl) (1)
19. If (t-e is n-l) and (s-f-p is l) and (T+2w is m) then (dc is vl) (1)
20. If (t-e is n-m) and (s-f-p is s) and (T+2w is m) then (dc is z) (1)
21. If (t-e is n-m) and (s-f-p is m) and (T+2w is m) then (dc is z) (1)
22. If (t-e is n-m) and (s-f-p is l) and (T+2w is m) then (dc is z) (1)
23. If (t-e is n-s) and (s-f-p is s) and (T+2w is m) then (dc is m) (1)
24. If (t-e is n-s) and (s-f-p is m) and (T+2w is m) then (dc is m) (1)
25. If (t-e is n-s) and (s-f-p is l) and (T+2w is m) then (dc is m) (1)
26. If (t-e is s) and (s-f-p is s) and (T+2w is m) then (dc is vl) (1)
27. If (t-e is s) and (s-f-p is m) and (T+2w is m) then (dc is m) (1)
28. If (t-e is s) and (s-f-p is l) and (T+2w is m) then (dc is l) (1)
29. If (t-e is m) and (s-f-p is s) and (T+2w is m) then (dc is vl) (1)
30. If (t-e is m) and (s-f-p is m) and (T+2w is m) then (dc is l) (1)
31. If (t-e is m) and (s-f-p is l) and (T+2w is m) then (dc is m) (1)
32. If (t-e is n-l) and (s-f-p is s) and (T+2w is l) then (dc is vl) (1)
33. If (t-e is n-l) and (s-f-p is m) and (T+2w is l) then (dc is vl) (1)
34. If (t-e is n-l) and (s-f-p is l) and (T+2w is l) then (dc is vl) (1)
35. If (t-e is n-m) and (s-f-p is s) and (T+2w is l) then (dc is vl) (1)
36. If (t-e is n-m) and (s-f-p is m) and (T+2w is l) then (dc is vl) (1)
37. If (t-e is n-m) and (s-f-p is l) and (T+2w is l) then (dc is z) (1)
38. If (t-e is n-s) and (s-f-p is s) and (T+2w is l) then (dc is vl) (1)
39. If (t-e is n-s) and (s-f-p is m) and (T+2w is l) then (dc is vl) (1)
40. If (t-e is n-s) and (s-f-p is l) and (T+2w is l) then (dc is vl) (1)
41. If (t-e is s) and (s-f-p is s) and (T+2w is l) then (dc is vl) (1)
42. If (t-e is s) and (s-f-p is m) and (T+2w is l) then (dc is vl) (1)
43. If (t-e is s) and (s-f-p is l) and (T+2w is l) then (dc is vl) (1)
44. If (t-e is m) and (s-f-p is s) and (T+2w is l) then (dc is vl) (1)
45. If (t-e is m) and (s-f-p is m) and (T+2w is l) then (dc is vl) (1)
46. If (t-e is m) and (s-f-p is l) and (T+2w is l) then (dc is vl) (1)
Appendixes.
A.69
A.2.1.4 - Flux decrease, Wpc>Tpc.
1. If (t-e is n-l) and (s-f-p is s) and (2T+w is s) then (dc is m) (1)
2. If (t-e is n-l) and (s-f-p is m) and (2T+w is s) then (dc is vl) (1)
3. If (t-e is n-l) and (s-f-p is l) and (2T+w is s) then (dc is vl) (1)
4. If (t-e is n-m) and (s-f-p is s) and (2T+w is s) then (dc is z) (1)
5. If (t-e is n-m) and (s-f-p is m) and (2T+w is s) then (dc is z) (1)
6. If (t-e is n-m) and (s-f-p is l) and (2T+w is s) then (dc is s) (1)
7. If (t-e is n-s) and (s-f-p is s) and (2T+w is s) then (dc is z) (1)
8. If (t-e is n-s) and (s-f-p is m) and (2T+w is s) then (dc is z) (1)
9. If (t-e is n-s) and (s-f-p is l) and (2T+w is s) then (dc is z) (1)
10. If (t-e is s) and (s-f-p is s) and (2T+w is s) then (dc is s) (1)
11. If (t-e is s) and (s-f-p is m) and (2T+w is s) then (dc is s) (1)
12. If (t-e is s) and (s-f-p is l) and (2T+w is s) then (dc is s) (1)
13. If (t-e is m) and (s-f-p is s) and (2T+w is s) then (dc is m) (1)
14. If (t-e is m) and (s-f-p is m) and (2T+w is s) then (dc is m) (1)
15. If (t-e is m) and (s-f-p is l) and (2T+w is s) then (dc is s) (1)
16. If (t-e is l) then (dc is vl) (1)
17. If (t-e is n-l) and (s-f-p is s) and (2T+w is m) then (dc is l) (1)
18. If (t-e is n-l) and (s-f-p is m) and (2T+w is m) then (dc is vl) (1)
19. If (t-e is n-l) and (s-f-p is l) and (2T+w is m) then (dc is vl) (1)
20. If (t-e is n-m) and (s-f-p is s) and (2T+w is m) then (dc is z) (1)
21. If (t-e is n-m) and (s-f-p is m) and (2T+w is m) then (dc is z) (1)
22. If (t-e is n-m) and (s-f-p is l) and (2T+w is m) then (dc is z) (1)
23. If (t-e is n-s) and (s-f-p is s) and (2T+w is m) then (dc is m) (1)
24. If (t-e is n-s) and (s-f-p is m) and (2T+w is m) then (dc is m) (1)
25. If (t-e is n-s) and (s-f-p is l) and (2T+w is m) then (dc is m) (1)
26. If (t-e is s) and (s-f-p is s) and (2T+w is m) then (dc is vl) (1)
27. If (t-e is s) and (s-f-p is m) and (2T+w is m) then (dc is m) (1)
28. If (t-e is s) and (s-f-p is l) and (2T+w is m) then (dc is l) (1)
29. If (t-e is m) and (s-f-p is s) and (2T+w is m) then (dc is vl) (1)
30. If (t-e is m) and (s-f-p is m) and (2T+w is m) then (dc is l) (1)
31. If (t-e is m) and (s-f-p is l) and (2T+w is m) then (dc is m) (1)
32. If (t-e is n-l) and (s-f-p is s) and (2T+w is l) then (dc is vl) (1)
33. If (t-e is n-l) and (s-f-p is m) and (2T+w is l) then (dc is vl) (1)
34. If (t-e is n-l) and (s-f-p is l) and (2T+w is l) then (dc is vl) (1)
35. If (t-e is n-m) and (s-f-p is s) and (2T+w is l) then (dc is vl) (1)
36. If (t-e is n-m) and (s-f-p is m) and (2T+w is l) then (dc is vl) (1)
37. If (t-e is n-m) and (s-f-p is l) and (2T+w is l) then (dc is z) (1)
38. If (t-e is n-s) and (s-f-p is s) and (2T+w is l) then (dc is vl) (1)
39. If (t-e is n-s) and (s-f-p is m) and (2T+w is l) then (dc is vl) (1)
40. If (t-e is n-s) and (s-f-p is l) and (2T+w is l) then (dc is vl) (1)
41. If (t-e is s) and (s-f-p is s) and (2T+w is l) then (dc is vl) (1)
42. If (t-e is s) and (s-f-p is m) and (2T+w is l) then (dc is vl) (1)
43. If (t-e is s) and (s-f-p is l) and (2T+w is l) then (dc is vl) (1)
44. If (t-e is m) and (s-f-p is s) and (2T+w is l) then (dc is vl) (1)
45. If (t-e is m) and (s-f-p is m) and (2T+w is l) then (dc is vl) (1)
46. If (t-e is m) and (s-f-p is l) and (2T+w is l) then (dc is vl) (1)
Appendixes.
A.70
A.2.2 - FLC 2.
The fuzzy logic controller 2 system contains 37 rules (see section 3.2.2).
All 37 rules are listed below.
1. If (inc-Te is n-l) then (inc-dc is vl) (1)
2. If (inc-Te is n-m) and (E-Te-ant is n-l) then (inc-dc is s) (1)
3. If (inc-Te is n-m) and (E-Te-ant is n-m) then (inc-dc is m) (1)
4. If (inc-Te is n-m) and (E-Te-ant is n-s) then (inc-dc is l) (1)
5. If (inc-Te is n-m) and (E-Te-ant is s) then (inc-dc is l) (1)
6. If (inc-Te is n-m) and (E-Te-ant is m) then (inc-dc is l) (1)
7. If (inc-Te is n-m) and (E-Te-ant is l) then (inc-dc is vl) (1)
8. If (inc-Te is n-s) and (E-Te-ant is n-l) then (inc-dc is n-s) (1)
9. If (inc-Te is n-s) and (E-Te-ant is n-m) then (inc-dc is n-s) (1)
10. If (inc-Te is n-s) and (E-Te-ant is n-s) then (inc-dc is z) (1)
11. If (inc-Te is n-s) and (E-Te-ant is s) then (inc-dc is s) (1)
12. If (inc-Te is n-s) and (E-Te-ant is m) then (inc-dc is m) (1)
13. If (inc-Te is n-s) and (E-Te-ant is l) then (inc-dc is l) (1)
14. If (inc-Te is z) and (E-Te-ant is n-l) then (inc-dc is n-m) (1)
15. If (inc-Te is z) and (E-Te-ant is n-m) then (inc-dc is n-m) (1)
16. If (inc-Te is z) and (E-Te-ant is n-s) then (inc-dc is n-s) (1)
17. If (inc-Te is z) and (E-Te-ant is s) then (inc-dc is z) (1)
18. If (inc-Te is z) and (E-Te-ant is m) then (inc-dc is s) (1)
19. If (inc-Te is z) and (E-Te-ant is l) then (inc-dc is m) (1)
20. If (inc-Te is s) and (E-Te-ant is n-l) then (inc-dc is n-l) (1)
21. If (inc-Te is s) and (E-Te-ant is n-m) then (inc-dc is n-m) (1)
22. If (inc-Te is s) and (E-Te-ant is n-s) then (inc-dc is n-s) (1)
23. If (inc-Te is s) and (E-Te-ant is s) then (inc-dc is n-s) (1)
24. If (inc-Te is s) and (E-Te-ant is m) then (inc-dc is z) (1)
25. If (inc-Te is s) and (E-Te-ant is l) then (inc-dc is s) (1)
26. If (inc-Te is m) and (E-Te-ant is n-l) then (inc-dc is n-vl) (1)
27. If (inc-Te is m) and (E-Te-ant is n-m) then (inc-dc is n-l) (1)
28. If (inc-Te is m) and (E-Te-ant is n-s) then (inc-dc is n-m) (1)
29. If (inc-Te is m) and (E-Te-ant is s) then (inc-dc is n-m) (1)
30. If (inc-Te is m) and (E-Te-ant is m) then (inc-dc is n-s) (1)
31. If (inc-Te is m) and (E-Te-ant is l) then (inc-dc is n-s) (1)
32. If (inc-Te is l) and (E-Te-ant is n-l) then (inc-dc is n-vl) (1)
33. If (inc-Te is l) and (E-Te-ant is n-m) then (inc-dc is n-vl) (1)
34. If (inc-Te is l) and (E-Te-ant is n-s) then (inc-dc is n-vl) (1)
35. If (inc-Te is l) and (E-Te-ant is s) then (inc-dc is n-vl) (1)
36. If (inc-Te is l) and (E-Te-ant is m) then (inc-dc is n-l) (1)
37. If (inc-Te is l) and (E-Te-ant is l) then (inc-dc is z) (1)
Appendixes.
A.71
A.3 - Experimental motor drive pictures.
A.3.1 - Workbench. Induction motor_1.5kW. DC motor.
Figure A.1. It is shown the entire workbench with the encoder, DC motor,
AC motor_1.5kW and the dynamometer.
Figure A.2. Encoder and DC motor detail. It should be remembered that the DC
motor works as a generator, i.e. as a load.
Appendixes.
A.72
( Next page shows figures A.3 and A.4 ).
Appendixes.
A.73
Figure A.3. AC motor_1.5kW and dynamo detail.
A.3.2 - Resistors.
Figure A.4. Resistors used as a load of the DC generator.
Appendixes.
A.74
( Next page shows figures A.5 and A.6 ).
Appendixes.
A.75
A.3.3 - Voltage Source Inverter.
Figure A.5. It is shown the Voltage Source Inverter with its protections board and
signal adaptation board.
A.3.4 - Workstation.
Figure A.6. It is shown the entire workstation.

INDEX.
Abstract Index Acknowledgements Symbols Introduction I.1 - Historical review I.2 - Structure of the thesis I.3 - Aims of the thesis Chapter 1 - Induction Motor Model. Generalities. 1.1 - Equations of the induction motor model 1.1.1 - Introduction 1.1.2 - Voltage equations 1.1.3 - Applying Park's transform 1.1.4 - Voltage matrix equations 1.1.4.1 - Fixed to the stator 1.1.4.2 - Fixed to the rotor 1.1.4.3 - Fixed to the synchronism 1.2 - Space phasor notation 1.2.1 - Introduction 1.2.2 - Current space phasors 1.2.3 - Flux linkage space phasor 1.2.3.1 - Stator flux-linkage space phasor in the stationary reference frame fixed to the stator 1.2.3.2 - Rotor flux-linkage space phasor in the rotating reference frame fixed to the rotor 1.2.3.3 - Rotor flux-linkage space phasor in the stationary reference frame fixed to the stator 1.2.3.4 - Stator flux-linkage space phasor in the rotating reference frame fixed to the rotor 1.2.4 - The space phasors of stator and rotor voltages 1.2.5 - Space-phasor form of the motor equations 1.2.5.1 - Space-phasor voltage equations in the general reference frame 1.2.5.2 - Space-phasor voltage equations in the stationary reference frame fixed to the stator 1.2.5.3 - Space-phasor voltage equations in the rotating reference frame fixed to the rotor 1.2.5.4 - Space-phasor voltage equations in the rotating reference frame at synchronous speed 1.3 - Torque expressions 1.1 1.1 1.2 1.4 1.5 1.5 1.5 1.5 1.6 1.6 1.7 1.9 1.9 1.10 1.11 1.12 1.12 1.13 1.13 1.14 1.15 1.15 1.17
IN.1

AB.1 IN.1 AC.1 S.1

I.1 I.6 I.8

Index.

1.3.1 - Introduction 1.3.2 - Deduction of the torque expression by means of energy considerations 1.3.3 - Torque constant 1.4 - Simulink model 1.4.1 - Equations used in the model 1.4.1.1 - Stator reference 1.4.1.2 - Rotor reference 1.4.1.3 - Synchronous reference 1.4.1.4 - Motion equation 1.4.2 - Simulated results 1.5 - Steady state analysis 1.5.1 - Steady state conditions 1.5.2 - Steady state equations 1.5.3 - Steady state equivalent circuit 1.6 - Interim conclusions Chapter 2 - Direct Torque Control. Principles and Generalities. 2.1 - Induction motor controllers 2.1.1 - Voltage/frequency 2.1.2 - Vector controls 2.1.3 - Field Acceleration method 2.1.4 - Direct Torque Control 2.2 - Principles of Direct Torque Control 2.2.1 - Introduction 2.2.2 - DTC Controller 2.2.3 - DTC Schematic 2.2.3.1 - Stator flux and torque estimator using wm, isA and isB magnitudes 2.2.3.2 - Stator flux and torque estimator using Vdc, isA and isB magnitudes 2.2.4 - Parameter detuning effects 2.3 - Improvements in Direct Torque Control 2.3.1 - Introduction 2.3.2 - Different tables 2.3.2.1 - First approach 2.3.2.1.1 - Six sector table but different zones 2.3.2.1.2 - Twelve sector table 2.3.2.1.3 - Simulations, results and conclusions 2.3.2.2 - Second approach 2.3.2.3 - Third approach 2.3.2.4 - Conclusions 2.3.3 - Predictive methods 2.3.4 - Fuzzy logic based systems 2.3.5 - Regulating the flux 2.4 - Interim conclusions

1.17 1.17 1.18 1.19 1.19 1.19 1.19 1.20 1.20 1.21 1.23 1.23 1.23 1.24 1.25

2.1 2.1 2.2 2.2 2.2 2.4 2.4 2.4 2.7 2.8 2.9 2.10 2.11 2.11 2.11 2.11 2.11 2.13 2.15 2.18 2.19 2.20 2.21 2.22 2.23 2.25

IN.2

5 .15 IN.Index.2.1.1.3 .Task distribution 4.2.5 5. 3.Interim conclusions Chapter 4 .2. 5.16 4. 3.3 .2.Inputs and output membership functions.FLDTC and DTC comparison 5.Rules 3.Fuzzy Logic Direct Torque Control.2.Induction motor drive architecture 4.1 4.3 3.2 .Design of Experimental Induction Motor Drive System.Fuzzy Logic DTC 5.1.Fuzzy Logic controller 1 3.1 .4 .2 .1 .Real implementation 6.Fuzzy Logic Direct Torque Control 3.Simulation of the real plant 4.7 3.1 . 3.1.2.Timing of the real implementation 4.5 3. 4.Conclusions.Simulated results 3.11 4.3.1 .3 3.Introduction 3.Fuzzy Logic DTC schema 3.3 .1 5.Implementing DTC and FLDTC 4.1 .1.1. Chapter 3 .Fuzzy Logic Direct Torque Control 6.Direct Torque Control 6.3 .Conclusions 6.6 3.2 .3.1 .Rules 3.Introduction 4.8 4.1 5.2 .1 6.1.4 .6 3.2.2.Interim conclusions Chapter 6 .3 .4 6.6 3.Experimental Results. 6.Stator Flux Reference Optimum Controller 3.1 .8 4.Classical DTC 5.3 .3. Further work.10 5.3 6.1.2 .2.2.Programming the system 4.1 .2 .1 3.2 .Inputs and output membership functions.1 .14 3.3 4.Further work 6.3 3.1 6.2.10 3.8 5.2 .Corroborating the real implementation 5.Fuzzy Logic controller 2 3.2.3 3.2.8 3.2 6.1.3 .9 3.9 4.2 .4 .Experimental motor drive system 6.Objectives 3.3 .2 .3 .Interim conclusions Chapter 5 .1 .Objectives 3.4 .8 4.

68 A.Flux increase.70 A.29 A.75 A.71 A.PCTH1_5c.Flux decrease.69 A.1.Workbench.Programs A.4 .Flux increase.1 .FLC 2 A. Wpc < Tpc A. References.Experimental motor drive pictures A.2 .FLC 1 A.Fuzzy rules A.Index.c A.66 A. Appendixes.2 .PCTH1_9.2.Workstation R.75 IN.5kW.65 A.1 .1.3.1.Voltage Source Inverter A.55 A.1.2.1.1 A.c A.22 A.3 .67 A.2.3 .1. Wpc > Tpc A.3.73 A.4 .1 .71 A.65 A.TH1_5c.1.c A.3.3 .1 .2.2 .2 A. A. Wpc > Tpc A.1 . Induction motor_1.1 A. DC motor A.1.c A.Resistors A.TH1_9.4 .3.2.3 .2 .Flux decrease. Wpc < Tpc A.2 .4 .2.

I would like to thank the economic support received from the "Comisión Interministerial de Ciencia y Tecnología de España". I would also like to acknowledge "Departament d'Enginyeria Electrònica" staff for providing enjoyable and educational atmosphere. I am most grateful to my Director of Studies Dr. I like to thank Anna for her encouragement and comprehension especially during my stay in the University of Glamorgan. guidance. Last but not least. support and advice throughout the period of research to which this thesis relates.ACKNOWLEDGEMENTS. I also like to thank Dr. Also. Also. for realising this work. José Luis Romeral for his continuous help. under the TIC98-1092 Project. I like to thank my parents and my sister for their patience and support. Marcel Jayne for his support and advice especially during my stay in the University of Glamorgan.1 . and also for initiating and maintaining the collaboration between the University of Glamorgan and the "Universitat Politècnica de Catalunya". CICYT. AC.

Mutual inductance between rotor windings. uri(t) Rotor voltage per phase. Stator self-inductance. Te Instantaneous value of the electromagnetic torque.1 . Rotor pulsation.rotor mutual inductance. wm wpc wr ws S. Mr Mutual inductance between stator windings. Instant torque referred to the nominal torque and in percentage. Rotor self-inductance. Space phasor of the stator voltage expressed in the rotor reference frame. Ts = Tz Sampling time. ur usi(t) us us ' Stator voltage per phase. s Slip.SYMBOLS. Ls1 Leakage stator inductance. Space phasor of the rotor voltage expressed in the rotor reference frame. Total three phase rotor inductance. Space phasor of the stator current expressed in the rotor reference frame. Rr Rotor Resistance. P Pair of poles. Stator pulsation. Lrm Rotor magnetising inductance. Space phasor of the stator voltage expressed in the stator reference frame. Ls Lsm Stator magnetising inductance. a iri(t) ir ir ' 120º operator. Ls Total three phase stator inductance. Rotor current per phase. Tpc Instant torque referred to the nominal torque and in percentage. Mechanical speed. Rs Stator Resistance. Space phasor of the rotor current expressed in the stator reference frame. isi(t) is is ' Lm Lr Three phase magnetising inductance. Lr Lr1 Leakage rotor inductance. Space phasor of the stator current expressed in the stator reference frame. ur ' Space phasor of the rotor voltage expressed in the stator reference frame. Stator current per phase. 1/s Integration operator. Space phasor of the rotor current expressed in the rotor reference frame. Ms Maximal value of the stator. M sr p Derivation operator.

and quadrature-axis components in the rotor reference frame. rc Ref s sA. Direct. Ψsi(t) ψs ψs ' Subscripts. α/β d/q D/Q g m r ra. rb.Symbols. Stator direct and quadrature-axis components in the stator reference frame. ρr ρs θm θr θs Ψri(t) ψr ψr ' Phase angle of the rotor flux linkage space phasor with respect to the direct-axis of the stator reference frame. Phase angle of the stator flux linkage space phasor with respect to the direct-axis of the stator reference frame. Rotor phases. Stator angle. General reference frame. Flux linkage per rotor winding. Rotor. Mathematical symbols. Space phasor of the rotor flux linkage expressed in the rotor reference frame. Reference. Complex conjugate. Space phasor of the rotor flux linkage expressed in the stator reference frame. S. sB. Flux linkage per stator winding. Space phasor of the stator flux linkage expressed in the rotor reference frame. sC x/y Direct.and quadrature-axis components in the stator reference frame. Stator to rotor angle. Space phasor of the stator flux linkage expressed in the stator reference frame. Stator phases. Stator. Rotor angle. x * Cross vector product. Rotor direct. Magnetizing.2 .and quadrature-axis components in general reference frame or in special reference frames.

all based on Oersted.C asynchronous motor [MAR 1]. AC asynchronous and synchronous.1 . motor. the main types of electric motors are still the same. but it was not until 1883 that Tesla invented the A. Michael Faraday discovered the electromagnetic rotation and built the first primitive D.C. Faraday went on to discover electromagnetic induction in 1831. I. DC. One year later. when Hans Christian Oersted discovered the magnetic effect of an electric current. The history of electrical motors goes back as far as 1820.1 .Historical review. Faraday and Tesla's theories developed and discovered more than a hundred years ago. Currently.INTRODUCTION. I.

where the rotor winding ends are brought out to slip rings. a motor with several windings is more expensive because more than three connections to the motor are needed and only certain discrete speeds are available. and less prove to any failure at high speeds. has become the most widespread electrical motor in use today. leading to the fact that they are maintenance free motors. Taking into account all the advantages outlined above. Before the days of power electronics. However. The only effective way of producing an infinitely variable induction motor speed drive is to supply the induction motor with three phase voltages of variable frequency and variable amplitude.Introduction. Furthermore. Therefore. However. A variable frequency is required because the rotor speed depends on the speed of the rotating magnetic field provided by the stator. Since its invention. the AC asynchronous motor.0 Billion/ Annum. The main advantage is that induction motors do not require an electrical connection between stationary and rotating parts of the motor. where the speed control system is not a trivial matter. Induction motors are also available with more than three stator windings to allow a change of the number of pole pairs. also named induction motor. At present. the motor can work in explosive environments because no sparks are produced. high efficiency and a high overload capability. they are cheaper and more robust. Another alternative method of speed control can be realised by means of a wound rotor induction motor.2 . mechanical energy is more than often required at variable speeds. allowing the voltage at the motor windings to be reduced. Therefore. A variable voltage is required because the motor impedance reduces at low frequencies and consequently the current has to be limited by means of reducing the supply voltages [VAS 1] [MOH 1]. However. this method obviously removes most of the I. 67% of all the electrical energy generated in the UK is converted to mechanical energy for utilisation. induction motors must be considered the perfect electrical to mechanical energy converter. a limited speed control of induction motor was achieved by switching the three-stator windings from delta connection to star connection. they do not need any mechanical commutator (brushes). In Europe the electrical drives business is worth approximately $1. Induction motors also have low weight and inertia. These facts are due to the induction motors advantages over the rest of motors.

which was the development of suitable methods to control the speed of induction motors. These conditions can be divided mainly in two groups: § § The decreasing cost and improved performance in power electronic switching devices. is Direct Torque Control [VAS 2]. With the enormous advances made in semiconductor technology during the last 20 years. At that time the above described methods were the only ones available to control the speed of induction motors. they had a good efficiency. However. The possibility of implementing complex algorithms in the new microprocessors. One method. poor performance is achieved.Introduction. and with a suitable control even a good dynamic response. By connecting resistors or reactances in series with the stator windings of the induction motors. Moreover. Historically. It is known as a scalar control and acts by imposing a constant relation between voltage and frequency. The structure is very simple and it is normally used without speed feedback. However. that considerable research effort is devoted. its main drawback was the compulsory requirement of brushes [MAR 1] [MOH 1]. However.3 . The aim being to find even simpler methods of speed control for induction machines. several general controllers has been developed: § Scalar controllers: Despite the fact that "Voltage-Frequency" (V/f) is the simplest controller. It is in this field. which is popular at the moment. These drives not only permitted the operation in four quadrants but also covered a wide power range. it is the most widespread. because in contrast to its mechanical simplicity their complexity regarding their mathematical structure (multivariable and non-linear) is not a trivial matter. one precondition had to be made. being in the majority of the industrial applications. the required conditions for developing a proper induction motor drive are present. advantages of induction motors and it also introduces additional losses. this controller doesn’t achieve a good accuracy in both speed and torque I. whereas infinitely variable speed drives with good performances for DC motors already existed.

there are control loops for controlling both the torque and the flux [BOS 1]. that is desired nowadays for all industrial applications. obtaining results as good as the classical vector control but with several advantages based on its simpler structure and control diagram. I. which occurs in vector controllers. Therefore. even when at stand still.4 . This method still requires further research in order to improve the motor’s performance. DTC is said to be one of the future ways of controlling the induction machine in four quadrants [LUD 1] [VAS 2]. thus overcoming the main problem with vector controllers and allowing this method to become an important alternative to vector controllers [BED 5] [ROM 1] [YAM 1]. Direct Torque Control (DTC) has emerged over the last decade to become one possible alternative to the well-known Vector Control of Induction Machines. mainly due to the fact that the stator flux and the torque are not directly controlled. as long as the parameters are identified. § Field Acceleration method: This method is based on maintaining the amplitude and the phase of the stator current constant. Its accuracy can reach values such as 0. and the dynamic response can be approximately around 50ms [LEO 1] [LUD 2]. This technique has achieved some computational reduction. Even though.Introduction. In DTC it is possible to control directly the stator flux and the torque by selecting the appropriate inverter state. as well as achieve a better behaviour regarding environmental compatibility (Electro Magnetic Interference and energy).5% regarding the speed and 2% regarding the torque. the accuracy in the speed can be 2% (except in a very low speed). the equations used can be simplified saving the vector transformation. whilst avoiding electromagnetic transients. responses. Its main characteristic is the good performance. The main disadvantages are the huge computational capability required and the compulsory good identification of the motor parameters [ROM 1] . The most widespread controllers of this type are the ones that use vector transform such as either Park or Ku. § Vector Controllers: In these types of controllers.

Minimal torque response time. Approximately sinusoidal stator fluxes and stator currents. Indirect control of stator currents and voltages. DTC main features are as follows: § § § § Direct control of flux and torque.Introduction. However. The main advantages of DTC are: § § § Absence of co-ordinate transform. implying the consequent parameters identification. Requirement of torque and flux estimators. I. even better than the vector controllers. Inherent torque and stator flux ripple. as well as other controllers such as PID for motor flux and torque. Absence of voltage modulator block. some disadvantages are also present such as: § § § Possible problems during starting. High dynamic performance even at stand still.5 .

Finally.Structure of the thesis. This chapter describes the designed workbench drive.". It introduces a mathematical model of cage rotor induction motors. Chapter 3 is entitled " Fuzzy Direct Torque Control". A way to overcome the mentioned limitations is presented. Fuzzy logic based systems.2 . Chapter 1 is entitled " Induction Motor Model. different methods for improving the main DTC drawbacks are introduced and studied. Once DTC is placed in this general classification.6 . Chapter 4 is entitled " Design of Experimental Induction Motor Drive System". such as the very well known vector control and "V/f". Theses six chapters are structured as follows. The elements of space phasor notation are also introduced and used to develop a compact notation.". firstly it is summarised different induction motor controllers. Generalities. However. Chapter 2 is entitled " Direct Torque Control. These methods are classified as follows: § § § Different look up tables. Moreover. The work presented in this thesis is organised in six main chapters. I. a method for regulating the stator flux to its optimum value it is presented. it is fully and deeply described. It is devoted to introduce different Direct Torque Control (DTC) strategies. Predictive methods. Different ways of implementing these models are presented as well as some simulations corroborating its validity.Introduction. It covers a full and deep description of a Fuzzy Logic Direct Torque Controller (FLDTC) which improves its performance. Real simulations of DTC and FLDTC are presented taking into account all the non ideal behaviour and delays of the real drive. It must be said that all simulations are obtained from MATLAB/Simulink. I. which compare the classical DTC with FLDTC. At the end of the chapter simulated results are presented. Principles and Generalities.

Obviously. This chapter is focused on the real implementation of the classical DTC and FLDTC.Introduction. In Chapter 6. An experimental comparison between both controllers is shown. Experimental results corroborate the correct behaviour of both controllers. entitled "Conclusions". Rules used in the Fuzzy Controllers are also listed. all experimental results obtained are from the workbench described in chapter 4. I. Finally. some pictures of the workbench are shown in the appendixes.7 . Chapter 5 is named " Experimental Results". Also. all PC/DSP programs used in the real implementation are listed in the appendixes. all achievements are summarised and appropriate conclusions are drawn.

This new FLDTC system is firstly designed and proved by means of simulations. Implementation of the FLDTC to prove its proper functionality. Development of a suitable "research workbench drive". I. Study the possible ways to overcome them. Corroboration of its proper performance by means of simulation. Develop and mathematically describe the chosen Fuzzy Logic system. I.Introduction. Therefore.Aims of the thesis.3 . The present thesis deals with the development of a Fuzzy Logic Direct Torque Controller that has improved performance compared to the classical DTC system. the development of this novel induction motor controller can be separated into the following steps: § § § Point out the DTC disadvantages.8 . when again compared to the classical DTC system. a stator flux optimum controller allows the FLDTC to consume the right energy from the mains. experimental implementation is discussed and the results are presented. Also. choosing the best one (Fuzzy Logic). The main improvement has been the torque ripple reduction. Later in the thesis. keeping the power consumption to a minimum.

1. Nevertheless. it could be said that the dynamic model of the machine could be just a good approximation of the real plant. A dynamic model of the machine subjected to control must be known in order to understand and design vector controlled drives. both methods are actually close and both methods will be explained. 1.1 . GENERALITIES. 1.CHAPTER 1.Equations of the induction motor model. Furthermore. it should be valid for any changes in the inverter’s supply such as voltages or currents [ROM 1]. Despite the compactness and the simplicity of the space phasor theory. INDUCTION MOTOR MODEL. Such a model can be obtained by means of either the space vector phasor theory or two-axis theory of electrical machines.1. Due to the fact that every good control has to face any possible change of the plant. the model should incorporate all the important dynamic effects occurring during both steady-state and transient operations.1 .1 – Introduction.

1) (1. The flux density is radial in the air gap.2) (1. Iron losses are neglected. In a similar way. For simplicity. Cross-section of an elementary symmetrical three-phase machine. the equations can be expressed as follows: u sA (t) = R s i sA (t) + u sB (t) = R s i sB (t) + u sC (t) = R s i sC (t) + dψ sA (t) dt d ψ sB (t) dt dψ sC (t) dt (1.1. the rotor voltages will be formulated to the rotating frame fixed to the rotor. Generalities. The stator and the rotor windings are simplified as a single. multi-turn full pitch coil situated on the two sides of the air gap. the induction motor considered will have the following assumptions: § § § § § § Symmetrical two-pole.Induction motor model. The slotting effects are neglected. The permeability of the iron parts is infinite.2 . three phases windings.1. which is the stationary reference frame fixed to the stator. sA' sC ra' rb sB rc rc' rb' ra sC' sB' sA Figure 1.2 – Voltage equations. In the stationary reference frame.3) 1. The stator voltages will be formulated in this section from the motor natural frame. 1.

θ m + 2 π 3 )i sA + M sr cos(− θ m + 4 π 3 )i sB + M sr cos(.13) 1.5) (1. and using the matrix notation in order to compact all the expressions. Generalities.12) Taking into account all the previous equations.10) (1.θ m )i sB + M sr cos(. Similar expressions can be obtained for the rotor: u ra (t) = R r i ra (t) + u rb (t) = R r i rb (t) + u rc (t) = R r i rc (t) + dψ ra (t) dt d ψ rb (t) dt dψ rc (t) dt (1. the following expression is obtained: u sA   R s + pL s u   pM s  sB     u sC  pM s  =  u ra   p M sr cosθ m  u rb   p M sr cosθ m2     u rc   p M sr cosθ m1    pM s R s + p Ls pM s pM sr cosθ m1 pM sr cosθ m p M sr cosθ m2 pM s pM s R s + pL s pM sr cosθ m2 p M sr cosθ m1 p M sr cosθ m p M sr cosθ m p M sr cosθ m2 p M sr cosθ m1 R r + pL r pM r pM r pM sr cosθ m1 p M sr cosθ m p M sr cosθ m2 pM r R r + pL r pM r pM sr cosθ m2  i sA     p M sr cosθ m1  i sB  pM sr cosθ m  i sC  ⋅   pM r   i ra   i  pM r   rb  R r + p L r   i rc     (1.Induction motor model.θ m + 4 π 3 )isC + L ri ra + M r irb + M r irc ψ rb = M sr cos(.3 . the rotor flux linkages can be expressed as follows: ψ ra = M srcos(.θ m + 4 π 3 )i sA + M sr cos(.11) (1.6) The instantaneous stator flux linkage values per phase can be expressed as: ψ sA = Ls i sA + M s isB + M s isC + M srcosθm i ra + M srcos(θm + 2 π 3 )irb + M srcos(θm + 4 π 3 )i rc ψ sB = M s i sA + L s i sB + M s i sC + M sr cos(θ m + 4 π 3 )i ra + M sr cosθ m i rb + M sr cos(θ m + 2 π 3 )i rc ψ sC = M s i sA + M s i sB + L s i sC + M sr cos(θ m + 2 π 3 )i ra + M sr cos(θ m + 4 π 3 )i rb + M sr cos θ m i rc (1.7) (1.θ m )i sA + M srcos(.8) (1.9) In a similar way.θ m + 2 π 3 )i sC + M r i ra + L r i rb + M r i rc ψ rc = M sr cos(.θ m + 2 π 3 )isB + M srcos(.θ m )i sC + M r i ra + L r i rb + M r i rc (1.4) (1.

4 . 1. Physically. the Park’s transform will be applied. In the symmetrical three-phase machine. The equivalencies for these direct (D) and quadrature (Q) magnitudes with the magnitudes per phase are as follows: 1 1 u s 0   1 2  u sA  2 2    cos θ cos (θ − 2 π ) cos(θ + 2 π )  ⋅  u  3 3   sB  u sD  = c ⋅  u sQ  − sin θ − sin (θ − 2 π 3 ) − sin (θ + 2 π 3 )  u sC        (1. the direct.3. Generalities.15) Where "c" is a constant that can take either the values 2/3 or 1 for the so-called non-power invariant form or the value 2 3 for the power-invariant form as it is explained in section 1. Notice how the expression 1. sQ sB rβ Wm ra rb Wm rα sA sD rc sC Figure 1. These previous equations can be applied as well for any other magnitudes such as currents and fluxes. as it is shown in figure 1.14) 1 u sA  u  = c ⋅  1   sB  1 u sC     2 2 2 cos θ − sin θ   u s 0     cos (θ − 2 π 3 ) − sin (θ − 2 π 3 ) ⋅ u sD  cos (θ + 2 π 3 ) − sin (θ + 2 π 3 ) u sQ     (1.16 by means of applying the mentioned Park's transform.13 can be simplified into a much smaller expression in 1.6 and obtain constant coefficients in the differential equations. it can be understood as transforming the three windings of the induction motor to just two windings.and the quadrature-axis stator magnitudes are fictitious.3.3 – Applying Park’s transform.2 Schema of the equivalence physics transformation.1.2 [VAS 1].Induction motor model. 1. In order to reduce the expressions of the induction motor equation voltages given in equation 1.1 to equation 1.

3 – Fixed to the synchronism.P ⋅ w m ) pL m L r pθ r R r + pL r    i rβ        (1.5 .1. It means that wr = 0 and consequently ws = wm.2 – Fixed to the rotor. It means that wr = sws. u sD   R s + pLs u    sQ  =  L s P w m  u rd   pL m    0  u rq     .P ⋅ w m Lr  i sD    pL m  i sQ  ⋅ P ⋅ w m L r   i rd     R r + pL r   i rq    0 (1. Lr = Lr − M r and Lm = 3 2 M sr .18 and 1.4. new matrixes are obtained as shown in equations 1.17) 1. u sD   R s + pL s u   0  sQ  =   u rd   pL m     u rq  .16 is simplified.16) Where Ls = L s − M s .17.P ⋅ w m L m   0 R s + pLs P ⋅ w m Lm pL m pLm 0 R r + pL r .4. If the matrix expression 1.19 [VAS 1].L r pθ r       u rβ   L m ( p θ s . 1.Ls P wm R s + pL s 0 pL m pL m L m P wm R r + pL r 0 − L m P w m   isD   i  pLm  ⋅  sQ    i rd  0    R r + pL r   i rq    (1. 1.4.1.L m ( pθ s .1.L m ( P ⋅ w m + p θ r )  isD     u   L s pθ s R s + pL s L m ( P ⋅ w m + pθ r ) pL m  ⋅  isQ   sQ  =   u rα     i rα  pL m . It means that ws = 0 and consequently wr = -wm.18) 1.4 – Voltage matrix equations. Generalities. u sD   R s + pL s .1 – Fixed to the stator.P ⋅ w m ) R r + pL r . u sD   R s + pLs u    sQ  =  L s w s  u rd   pL m     u rq   L m sw s   . 1.Ls w s R s + pLs − L m sw s pL m pL m Lm w s R r + pL r L r sw s − L m w s  i sD    pL m  i sQ  ⋅ − L r sw s   i rd     R r + pL r   i rq    (1.1.L s pθ s pL m .19) 1.Induction motor model.

1.3). Ws s sB Wr ra rb Wm r sA rc sC Figure 1. into its equivalent space phasor form. in the special case of the steady state. a2 = ej 3 (1.2 – Space phasor notation.Induction motor model. In this plane. On the right the equivalent two rotating windings induction motor. the space phasor rotate with an angular speed equal to the angular frequency of the three phase supply system.3 the equivalent schematic for this new model. Moreover. which represents a three phase balanced system. allowing the analysis in terms of complex algebra. The factor 2 3 makes the amplitude of any space phasor. A space phasor rotating with the same angular speed. the space phasor become equal to three-phase voltage phasors. where the supply voltage is sinusoidal and symmetric.6 . takes usually one of two different values either . In order to transform the induction motor model. for example.1 – Introduction. the current stator space phasor can be expressed as follows: i s = c ⋅ 1 ⋅ i sA (t ) + a ⋅ i sB (t ) + a 2 ⋅ i sC (t ) [ ] 2 3 (1.3. equal to the amplitudes of one phase of the three-phase system. 1. The factor 2 3 may also be used to define the power invariance of a three-phase system with its equivalent two-phase system (see section 1.20) Thus. Space phasor notation allows the transformation of the natural instantaneous values of a threephase system onto a complex plane located in the cross section of the motor. the 120º operator is introduced: a = ej 2π 3 4π .2.21) or 2 3 The factor "c". in natural co-ordinates. It is shown in figure 1. can describe the rotating magnetic field. Generalities.3. 1.

1. and the α-β axis which represent rotating frame fixed to the rotor. sQ rβ sA' sC ra' rc rc' rb' ra rb sB α θ rα wm θm sD sC' sB' sA Figure 1. The equivalence between the stator phasor and the D-Q two-axis components is as follows: i s = isD ( t ) + j ⋅ i sQ ( t ) or: (1.22) Expressed in the reference frame fixed to the stator. Generalities.2.Induction motor model. The stator current space phasor can be expressed as follows: is = 2 3 [i sA (t ) + aisB (t ) + a 2i sC (t )] = i s e jθ (1.7 . the real-axis of this reference frame is denoted by sD and its imaginary-axis by sQ. and α-β axis which represent rotating frame fixed to the rotor. the D-Q axis which represent the stationary frame fixed to the stator. It is represented in figure 1. Cross-section of an elementary symmetrical three-phase machine.24) sQ sA ] )] = i 1. During this section the induction machine assumptions introduced in the section 1. the D-Q axis which represent the stationary frame fixed to the stator.4.4 the model of the induction machine with two different frames.23) [ (i Im (i ) = Im[ (i Re( is ) = Re s 2 3 2 3 sA + aisB + a 2 isC ) = i sD + aisB + a 2 isC (1.1 will be further considered.2 – Current space phasors.1. with two different frames.

the real-axis of this reference frame is denoted by rα and its imaginary-axis by rβ.30) rc The magnetising current space-phasor expressed in the stationary reference frame fixed to the stator can be obtained as follows: i m = i s + ( N re N se )ir ' (1.31) 1. the space phasor of the rotor current can be written as follows: ir = 2 3 [i ra (t) + airb (t ) + a 2 irc (t )] = ir e jα (1.27) The equivalence between the current rotor space phasor and the α-β two-axis is as follows: ir = ir α ( t ) + j ⋅ irβ ( t ) or: (1.28) [ (i Im (i ) = Im[ (i Re( ir ) = Re r 2 3 2 3 ra + airb + a 2 i rc ) = irα + airb + a 2 i rc (1.26) Expressed in the reference frame fixed to the rotor.29) rβ ra ] )] = i The relationship between the space phasor current and the real stator currents can be expressed as follows: [ (i + ai + a i )] = i Re( a i ) = Re[ ( a i + i + ai )] = i Re( ai ) = Re[ (ai + a i + i )] = i Re( ir ) = Re 2 r 2 3 2 ra rb rc ra 2 3 2 ra rb rc r 2 3 2 ra rb rc rb (1.8 . Generalities. The space phasor of the rotor current expressed in the stationary reference frame fixed to the stator can be expressed as follows: ' j α +θ i r = ir e jθ = ir e ( m ) (1.25) sC In a similar way.Induction motor model. The relationship between the space phasor current and the real stator phase currents can be expressed as follows: [ (i + ai + a i )] = i Re( a i ) = Re[ (a i + i + ai )] = i Re( ai ) = Re[ ( ai + a i + i )] = i Re( is ) = Re 2 s 2 3 2 sA sB sC sA 2 3 2 sA sB sC s 2 3 2 sA sB sC sB (1.

35) Where Ls is the total three-phase stator inductance and Lm is the so-called three-phase magnetising inductance. In this section the flux linkages will be formulated in the stator phasor notation according to different reference frames.34 can be represented as follows: ψ s = L s + a M s + a 2 M s i s + M sr cos θ m + a M sr cos(θ m + 4 π 3 ) + a 2 M sr cos(θ m + 2 π 3 ) i r = s ( = (L − M s i s + 1.32) If the flux linkage equations 1.3 – Flux linkage space phasor.3.Induction motor model. 1. it is possible to define a space phasor for the flux linkage as follows: ψs = 2 3 (ψ sA + aψ sB + a 2 ψ sC ) (1.1.33.32.9 .9 are substituted in equation 1. the space phasor of the flux linkage in the stator depends on two components. ' r ) ) ( ( ) ( ) ) ' r = = Ls i s + L m i (1. 1. the flux linkage magnitude can be expressed in two-axis as follows: ψ s = ψ sD + jψ sQ (1.Stator flux-linkage space phasor in the stationary reference frame fixed to the stator.2. 1. expression 1. 1.2.8.7. Finally.36) 1. Once more.33) Developing the previous expression 1. the space phasor for the stator flux linkage can be expressed as follows: i L + a M s + a 2 M s + i M s + a L + a 2 M s + i M s + a M s + a 2 L +  sB s sC s  sA s  + i M cos θ + a M cos θ + 4 π + a 2 M cos θ + 2 π +  sr sr ( m 3) sr ( m 3) m  ra    2 2π 4π + irb M sr cos(θ m + 3 ) + a M sr cos θ m + a M sr cos( θ m + 3 ) +    2 + irc M sr cos(θ m + 4 π 3 ) + a M sr cos( θ m + 2 π 3 ) + a M sr cos θ m    ( ψs = 2 3 ( ( ( ) ( ) ( ) ) ) ) (1.5 cos θ m M sr i r = L s − M s i s + 15 M sr i r e j θm = L s − M s i s + 15 M sr i . Similarly to the definitions of the stator current and rotor current space phasors. .34) And finally. being the stator currents and the rotor currents. it is obtained the following expression: i L + a M s + a 2 M s + a ⋅ i a 2 M s + L + a M s + a 2 i a M s + a 2 M s + L + sB s sC s  sA s   + i M cos θ + a M cos θ + 4 π + a 2 M cos θ + 2 π +  sr sr ( m 3) sr ( m 3) ra m  2 ψs = 3   2 2π 4π  + a ⋅ irb a M sr cos (θ m + 3 ) + M sr cos θ m + a M sr cos (θ m + 3 ) +    2 2  + a ⋅ irc a M sr cos( θ m + 4 π 3 ) + a M sr cos (θ m + 2 π 3 ) + M sr cos θ m    ( ( ) ( ) ( ( ) ) ( ) ) (1. Generalities.

the space phasor for the rotor flux linkage can be expressed as follows: i L + a M r + a 2 M r + i M r + a L + a 2 M r + i M r + a M r + a 2 L +  sB r sc r  ra r  + i M cos θ + a M cos θ + 2 π + a 2 M cos θ + 4 π +  sr sr ( m 3) sr ( m 3) sA m  2 ψr = 3   2 4π 2π + isB M sr cos( θ m + 3 ) + a M sr cos θ m + a M sr cos(θ m + 3 ) +    2 + isC M sr cos( θ m + 2 π 3 ) + a M sr cos(θ m + 4 π 3 ) + a M sr cos θ m    ( ( ( ) ( ) ( ) ) ) ) ) (1.11. The rotor flux linkage space phasor.Induction motor model. is noticeable.38) (1.1. 1.12 are substituted in equation 1.10 . 1.5 M sr i s = . fixed to the rotor natural frame can be defined as follows: ψr = 2 3 (ψ ( ra + aψ rb + a 2 ψ rc ) (1.40.37) The relationship between the components ird and irα and irq and irβ may be introduced as follows: i r = ird + jirq = i r e j θm ' (1.3. Where its direct component is equal to: ψ sD = Ls isD + Lm ird And its quadrature component is expressed as: ψ sQ = Ls i sQ + Lm i rq (1. it can be expressed as: i L + a M r + a 2 M r + a ⋅ i a 2 M r + L + a M r + a 2 i a M r + a 2 M r + L +  rb r rc r  ra r  2 + i M cos θ + a M cos θ + 2 π + a M cos θ + 4 π +  sr sr ( m 3) sr ( m 3) m  sa  ψr = 2  3  2 4π 2π + a ⋅ isb a M sr cos( θ m + 3 ) + M sr cos θ m + a M sr cos(θ m + 3 ) +   2  2 + a ⋅ i sc a M sr cos( θ m + 2 π 3 ) + a M sr cos( θ m + 4 π 3 ) + M sr cos θ m    ( ( ) ( ) ( ) ( ( ) ) (1.42) And finally: ψ r = Lr + a M r + a 2 M r i r + M sr cos θ m + a M sr cos(θ m + 2 π 3 ) + a 2 M sr cos(θ m + 4 π 3 ) i s = r ( = (L − M r i r + 15 cos( − θ m ) M sr i s = Lr − M r ir + 1.Rotor flux-linkage space phasor in the rotating reference frame fixed to the rotor.10.43) 1.41) By re-arranging the previous expression 1.39) The compactness of the notation in the space phasor nomenclature compared to the two-axis notation in 1.40) If the flux linkage equations 1.2. 1.5 M sr i s e− jθ m = Lr − M r i r + 1. ' ' s ) ) ( ( ) ( ) ) = Lr i r + Lm i (1.41. Generalities.2.

50) From figure 1. and can be written as: ψ ' r = ψ rd + jψ rq = ψ r e j θm = ψ r α + jψ rβ e jθ m ( ) (1.45) And its quadrature component is expressed as: ψ rβ = Lr ir β + Lm i sβ (1.48) The relationship between the stator current referred to the stationary frame fixed to the stator and the rotational frame fixed to the rotor is as follows: i s = i s e j θm i s e − jθ m = i s ' ' (1. Generalities.49) Where i s = isD + ji sQ i s = is α + jis β ' (1. Once more the flux linkage magnitude can be expressed in the two-axis form as follows: ψ r = ψ rα + jψ rβ Where its direct component is equal to: ψ rα = Lr ir α + L m i sα ' (1.5.47) The space phasor of the rotor flux linkage can be expressed according to the fixed coordinates as follows: ψ r = Lr i r + Lm i s e j θm = Lr i r + Lm i s ' ' ' ' (1.44) (1. Where Lr is the total three-phase rotor inductance and Lm is the so-called three-phase magnetising inductance.46) 1.3.Induction motor model.51) 1.Rotor flux-linkage space phasor in the stationary reference frame fixed to the stator.2. i s is the stator current space phasor expressed in the frame fixed to the rotor. The rotor flux linkage can also be expressed in the stationary reference frame using the previously introduced transformation ejθm. the following equivalencies can be deduced: i s = is e jθ i s = is e jα = is e j(θ − θ m ) = i s e− j θm ' ' ' (1.3.11 .

2. 1.3. it can also be said that: usA = Re( u s ) usB = Re( a 2 u s ) usC = Re( aus ) (1.4.4.2. Generalities. – The space phasors of stator and rotor voltages.5.52) 1.54) Equivalent expressions can also be obtained for the rotor.Stator flux-linkage space phasor in the rotating reference frame fixed to the rotor.Induction motor model. 1.12 .53) Where the stator voltage space phasor is referred to the stator stationary frame and the rotor voltage space phasor is referred to the rotating frame fixed to the rotor. Similarly than 1.is' wm rα α θm sD θ Figure 1. sQ rβ is. Provided the zero component is zero [VAS 1].3 section. it can be deduced the following expression: ψ s = ψ se ' − jθ m ' '   − jθ =  L s i s + L m i r  e m = Ls i s + L m i r   (1.3. Stator-current space phasor expressed in accordance with the rotational frame fixed to the rotor and the stationary frame fixed to the stator.2. us = ur = 2 3 2 3 [u [u sA ra ( t ) + aurb( t ) + a 2 urc ( t ) ] = urα + jurβ = 2 (ura − 1 urb − 1 urc ) + j 3 2 2 ( t ) + ausB ( t ) + a 2usC ( t ) ] = usD + jusQ = 2 3 (u sA − 1 usB − 1 usC ) + j 2 2 1 3 1 3 (u (u rb sB − urc ) − usC ) (1. The space phasors for the stator and rotor voltages can be defined in a similar way like the one used for other magnitudes.

1. and then to the references frames fixed to the stator. and its angle referred to the three different axis.56) ψ sg = ψ s e − jθ g Where the magnitudes are the voltage space phasor and the stator flux linkage respectively.1 . rα-rβ fixed to the rotor whose speed is wm.6 is the stator current.Induction motor model. Firstly.55) wg x αs αr θm rα sD wm θg Figure 1. 1.6 is for instance the rotor current. It is shown a magnitude represented by means of the vector.2. and finally the general frame represented by means of the axis x-y whose speed is equal to wg . If the vector in the figure 1.Space-phasor form of the motor equations.5 . its space phasor notation will be: i rg = i r e − j θ g −θ m ( ) = i + ji rx ry (1. then its formulation in the space phasor form is as follows: i sg = i s e − j θg = i sx + ji sy sQ rβ y (1.2. if the magnitude in the figure 1.6. which rotates at a general speed wg. However.57) 1. rotor and synchronous speed. it can be written the following equations: u sg = u s e − jθ g = usx + jusy = ψ sx + jψ sy (1. The space phasor forms of the voltage equations of the three-phase and quadrature-phase smooth air-gap machines will be presented. the equations will be expressed in a general rotating reference frame.13 .5. In a similar way and for other magnitudes. Generalities. The three different axis are: sD-sQ fixed to the stator.Space-phasor voltage equations in the general reference frame.

u sg = R s i sg + u rg = Rr i rg + d ψ sg dt d ψ rg dt + jw g ψ sg + j w g − P ⋅ wm ψ rg ( ) (1.17.P ⋅ w m Lr  i sD    pL m  i sQ  ⋅ P ⋅ w m L r   i rd     R r + pL r   i rq    0 (1. the voltage equations can be represented by: R s + pLs u sx    u  w g Ls  sy  =  u rx   pL m       u ry   w g . the flux linkage space phasors are: ψ sg = Ls i sg + Lm i rg ψ rg = Lr i rg + Lm i sg (1.P ⋅ w m L m .w g Lm ) w g Lm pLm (w R r + pL r g .P ⋅ w m L m   0 R s + pLs P ⋅ w m Lm pL m pLm 0 R r + pL r .64) . Generalities.63) The stator voltage space phasor can be expressed as follows: u s = Rs i s + 1.2 .60.59) Simplifying equation 1.63. it is obtained equation 1.P ⋅ w m Lr ) (   isx       isy  ⋅ P ⋅ w m .w g L r   i rx     R r + pL r   i ry     .w g Lm pLm ) (1.2. If wg = 0. u sD   R s + pL s u   0  sQ  =   u rd   pL m     u rq  .Space-phasor voltage equations in the stationary reference frame fixed to the stator.62) 1.61) Using the two-axis notation and the matrix form. being equal to the expression 1. u sg e j θg = Rs i sg e jθ g + d ψ sg e dt ( jθ g )=R i ( dt s sg e j θg +e  jθ g d ψ sg dt + je jθ g w g ψ sg −θ m ( u rg e j θ g −θ m ) = R i rg e ( r j θ g −θ m )+ d ψ r e   j θ g −θ m )  = Rr i rg e j θ g − θm ( ) + e j( θ g ) d ψ rg + je j ( θ dt g −θ m ) w − P⋅ w ψ ( g m ) rg (1.58) Manipulating the previous equations yields the following stator and rotor space phasor voltage equations in the general reference frame.14 dψ s dt (1.w g Ls pL m R s + pLs m ( ) (P ⋅ w .59. and for other magnitudes: u rg = u r e − j θ g −θ m ( ) = u rx + ju ry ψ rg = ψ r e − j θ g −θ m ( ) = ψ rx + jψ ry (1.60) Where.Induction motor model. the matrix expression obtained is 1.5.

Space-phasor voltage equations in the rotating reference frame at synchronous speed.Ls P wm R s + pL s 0 pL m pL m L m P wm R r + pL r 0 − L m P w m   isD   i  pLm  ⋅  sQ    i rd  0    R r + pL r   i rq    (1.68) The rotor voltage space phasor can be written as: u r = Rr i r + dψr dt (1.67) The stator voltage space phasor can be expressed as follows: ' us = ' Rs i s + dψs dt ' + jψ s ⋅ P ⋅ wm ' (1.71) 1. The rotor voltage space phasor can be written as: ' u r e − jθ m = ' ' Rr i r e − jθ m ' dψ r + ' d  ψ r e − jθ m      dt ' u r = Rr i r + ' dt − j ⋅ P ⋅ wm ψ r (1. If wg = ws.67. Generalities. u sD   R s + pLs u    sQ  =  L s w s  u rd   pL m     u rq   L m sw s   .70) 1.2.Induction motor model.69) And the flux linkage space phasors can be expressed as follows ψ s = Ls i s + L m ir ψ r = Lr ir + L m i s ' ' ' (1.15 .19.5.2.18.5. being equal to the expression 1.66) 1. the matrix expression obtained is 1. u sD   R s + pLs u    sQ  =  L s P w m  u rd   pL m    0  u rq     .4 . If wg = wm. the matrix expression obtained is 1.71. being equal to expression 1.Ls w s R s + pLs − L m sw s pL m pL m Lm w s R r + pL r L r sw s − L m w s  i sD    pL m  i sQ  ⋅ − L r sw s   i rd     R r + pL r   i rq    (1.65) And the flux linkage space phasors can be expressed as follows ψ s = Ls i s + L m i r ψ r = Lr i r + L m i s ' ' ' (1.3 .Space-phasor voltage equations in the rotating reference frame fixed to the rotor.

73) And the flux linkage space phasors can be expressed as follows ψ sg = Ls i sg + L m i rg ψ rg = L r i rg + L m i sg (1. The stator voltage space phasor can be expressed as follows: u sg = Rs i sg + d ψ sg dt + jψ sg w s (1.Induction motor model. Generalities.74) 1.72) The rotor voltage space phasor can be written as: u rg = R r i rg + d ψ rg dt + j ψ rg ( w s − P ⋅ w m ) (1.16 .

3. where the point of obtaining two different currents. In an AC machine. 1. The expression given above can also be expressed as follows: t e = c ψ s ⋅ i r sin γ (1. one for controlling the flux and the other one for the rotor current. It is impossible to find them in a real application. ψ s and i r are the space phasors of the stator flux and rotor current respectively.3 – Torque expressions.77) 1. 1. Nevertheless.Introduction.2 .1 . Therefore. It is a further complication that in squirrel-cage machines. unless the motor is specially prepared for this purpose in a special laboratory. it is not possible to monitor the rotor current. the starting equation is as follows: Pmechanic = Pelectric − Ploss − Pfield (1. thus producing the maximum torque for all different magnitude values. The search for a simple control scheme similar to the one for DC machines has led to the development of the so-called vectorcontrol schemes.75) Where the “c” is a constant. in DC machines the space distribution of both magnitudes is fixed in space.Induction motor model. Torque equation is being deduced by means of energy considerations. It follows that when γ=90o the torque obtained is the maximum and its expression is exactly equal to the one for the DC machines.76) Where γ is the angle existing between the stator flux linkage and the rotor current. Furthermore. is achieved [VAS 1]. The general expression for the torque is as follows: t e = cψ s × i r ' ' (1. both referred to the stationary reference frame fixed to the stator. Generalities.17 .Deduction of the torque expression by means of energy considerations. however. both magnitudes can be controlled independently or separately.3. 1. it is much more difficult to realise this principle because both quantities are coupled and their position in space depends on both the stator and rotor positions.

Both possibilities are shown in table I. Generalities. plus the rate of change of the stator flux linkage. and "2→3" either two axis or space phasor notation to three axis.66 and 1. expression 1. 1.3 – Torque constant.78) Since in the stationary reference frame.35 are substituted in equation 1.83) 1.3.81 is as follows: t e = 3 P ψsD ⋅ i sQ − ψ sQ ⋅ i sD 2 ( ) (1.18 .79) (1. Substituting the previous powers for its values. Torque constant values.81) If the product is developed. the previous expression can be expressed as follows: t e ⋅ wr = 3 Re − jwr ψ r i r = − 3 wr Re j ψ r i r = − 3 wr ψ r × i r 2 2 2 Expressing the equation in a general way for any number of pair of poles gives: t e = − 3 Pψ r × i r 2 ' ' ( ' '* ) ( ' '* ) ' ' (1.I.80.Induction motor model. These depend on the constant used in the space phasor.I. the stator voltage space phasor u s can only be balanced by the stator ohmic drop. The value of the torque constant can take two different values. Non power invariant Torque constant Space phasor constant 3→2 Power invariant 3 2 2→3 3→2 1 2→3 2 3 1 2 3 2 3 Table I. different expressions for the torque can be obtained as follows: ' ' ' ' t e = − 3 P L r i r + L m i s  × i r = − 3 PL m i s × i r = − 3 PL m i s × i r  2  2 2   L ' ' 3L ' Lm ' 3 t e = − 3 P m  L m i r + L s i s  × i r = −P m ψ s × i r = − P ψs × ψ r   2 2  Ls  2 Ls 2 LsLr − Lm (1.80) If equations 1. it is obtained the following expression for the torque: t e = 3 Pψs × is 2 (1. "3→2" means the change from three axis to either two axis or space phasor notation. the equation can be expressed as follows:   d ψ s * 2 * t e ⋅ wr =  Re u s ⋅ i s − Rs is − Re is    dt     3 2 ( )   '    Re u'r ⋅ i '* − R i' 2 − Re  d ψ r i'*    + r r r  dt r        ( ) (1.82) Finally.

1. 1.Rotor reference.4.4.86) 1.19 . Stator and rotor fluxes can be expressed as follows: ψ rd = ψ rq = ψ'sd = 1 s 1 s 1 s (urd − Rrird ) = 0 ψ'sq = 1 s (u (u (u rq ' sd ' sq − Rr irq = 0 ) − Rs i'sd + P ⋅ wm ψ 'sq − Rr i'sq − P ⋅ wm ψ 'sd ) ) (1.Induction motor model. Stator and rotor fluxes can be expressed as follows: ψ sD = ψ sQ = 1 s 1 s ψ 'rd = 1 s ψ 'rq = 1 s (u (u (u (usD − Rs isD ) sQ − Rs isQ ) ' rd − Rr i' rd − P ⋅ w m ψ 'rq = − Rr i' rq + P ⋅ w m ψ 'rd ' rq ) (− R i ) = (− R i 1 s r 1 s r ' rd rq − P ⋅ w m ψ 'rq + P ⋅ w m ψ 'rd ' ) ) (1.Equations used in the model.1 – Stator reference.1.4.84) Stator and rotor currents can be expressed as follows: Lr L − ψ 'rd m Lx Lx L L i sQ = ψ sQ r − ψ 'rq m Lx Lx L L ' ird = ψ 'rd s − ψ sD m Lx Lx L L ' irq = ψ 'rq s − ψ sQ m Lx Lx i sD = ψ sD where Lx = Ls Lr − L2 m (1. Generalities. The final expressions used in the implemented models are obtained from all the previously introduced expressions. 1.85) 1.4 – Simulink model.2 .1 .1. All equations have been re-arranged in order to use the operator 1/s instead of the operator p because the “Simulink” deals with the integrator better than with the derivation.

te is the electromagnetic torque.4 – Motion equation.1.4. 1.89) where Lx = Ls Lr − 1.1. The motion equation is as follows: te − tL = J dw m + Dw m dt (1.Induction motor model.87) where L x = Ls Lr − 1. Stator and rotor fluxes can be expressed as follows: ψ sx = 1 usx − Rs isx + ws ψ sy s ψ sy = 1 s ψ rx = ψ ry = 1 s 1 s sy ( (u (u (u sx − Rr isy − ws ψ sx rx ry − Rr irx + ψ ry ( ws − P ⋅ wm ) = 1 − Rr irx + ψ ry ( ws − P ⋅ wm ) s − Rr iry − ψ rx s m 1 s r ry ) ( (w − P ⋅ w )) = ( − R i ) ) − ψ rx ( ws − P ⋅ wm ) )) (1. and finally the D is the damping constant.3 . Generalities.20 . tL is load torque. J is the inertia of the rotor. Stator and rotor currents can be expressed as follows: isD = ψ ' sD isQ = ψ ' sQ ird = ψ rd irq = ψ rq Lr Lx − ψ 'rd Lm Lx Lr L − ψ 'rq m Lx Lx Ls − ψ ' sD Lm Lx Lx Ls L − ψ ' sQ m Lx Lx L2 m (1.Synchronous reference.90) Where.4.88) Stator and rotor currents can be expressed as follows: isx = ψ isy = ψ Lr L − ψ rx m Lx Lx Lr L − ψ ry m Lx Lx Ls −ψ Lx Ls −ψ Lx sx sy irx = ψ rx iry = ψ ry Lm Lx Lm Lx L2 m sy (1.

8.6 0. Using the torque expressions 1. All simulations are done in Matlab/Simulink. rotor and synchronous) gave the same simulated results shown in figures 1. J=0.2 time (s) time (s) Figure 1.I shown in the previous section 1.3. Notice the transient at the beginning and the steady state torque value.7 and 1.8 1 1.2 0. 1.4. 1.7.2.Induction motor model.4 0.91. Left: Motor_1kW.21 .5kW.8 1 1. 60 60 50 50 40 40 torque (Nm) 30 torque (Nm) 0. Generalities.3. Torque response without load.84 to equation 1. the previous motion equation can be expressed as follows: P ⋅ c ⋅ (ψ sD ⋅ i sQ − ψ sQ ⋅ i sD ) = t L + w m (D + Js) wr = P ⋅ c ⋅ (ψ sD ⋅ i sQ − ψ sQ ⋅ i sD ) − t L D + Js (1.2 0.08Kgm2. being 0Nm for this ideal case.91) Where P is the number of pair of poles and the torque constant take the values either 1 or 2/3 according to the table I.4 0. Te= 0Nm.82. Right: Motor_1.6 0.2 30 20 20 10 10 0 0 -10 0 -10 0 0. Motor characteristics are listed in section 4. The validity of the motor model is corroborated. Figures 1.2 – Simulated results.7 and 1. It must be said that all three different references (stator.8 show the torque and speed responses obtained from equation 1.

Right: Motor_1.4 0.6 0.Induction motor model.8.2 0.22 .2 1.2 0. The final speed value is 157 rd/s.4 time (s) time (s) Figure 1.6 0. Left: Motor_1kW. 160 160 140 140 120 120 100 100 wm (rd/s) 80 wm (rd/s) 0 0.5kW. as expected from this ideal case. 1. Notice the small ripple at the beginning due to the transient.2 1. J=0. where Te=0Nm.8 1 1.4 0.08Kgm2. Speed response without load. Te=0Nm.4 80 60 60 40 40 20 20 0 0 0 0. Generalities.8 1 1.

23 . 1. can be taken into account: u s = Vs u r = Vr' e j θ d is = jws I s dt d ir = jwr I r' + j ⋅ P ⋅ wm I r' dt ' ' (1. the following assumptions expressed in 1. 1. Therefore. valid in both transient and steady state: u s = R s i s + (L s1 + 3 2 Lsm ) ' r ' r r dis 3 dir + 2 Lrm dt dt ' ' (1.66.95 and rotor 1.92 are applied to the stator 1.1 . the space vectors become identical to its phasors.64.Induction motor model.95) (1.93 and rotor 1. referred to the stationary reference frame fixed to the stator. stator 1.5.94) Once the conditions described above in equations 1. can be written the equations 1.92) 1.5. Generalities. When an induction motor operates in steady state and is supplied by symmetrical and sinusoidal waveforms.Steady state conditions.Steady state equations. This section deals with the conditions under which.2 .5 – Steady state analysis.92.94 for the rotor.96 steady state equations are obtained: V s = Rs I s + jws (L s1 + 3 2 L sm )I s + jws 0 = R r s I r' + jws (Lr 1 + 3 2 3 2 Lsm I r' Lsm I s (1. From the expressions 1.65 and 1.94 equations. induction motor operates in steady state.96) L sm )I r' + jws 3 2 1.93 for the stator and 1. 1.93) ' dir 3 dis u = R i + (Lr 1 + 2 L rm ) + 2 L sm − j ⋅ P ⋅ wm  (Lr 1 + 3 2 L rm )i r + 3 2 Lsm i s      dt dt 3 (1.

95 and 1.24 .98) (1.9.97) + jws (Lr 1 + 3 2 Lsm ) ' Ir − jws 3 2 L sm (1. From the equations 1.9: Rs wsL s1 wsL r1 Rr/s Is 3/2wsLsm Ir' Figure 1.99) ψ s = (L s1 + 3 2 Lsm )I s + 3 2 Lsm I r' 1.96.5. Generalities.Steady state equivalent circuit.3 . the well-known equivalent circuit for an induction motor can be drawn as shown in figure 1. Steady state equivalent circuit of Induction motor. stator current and stator flux can be obtained: T = 3 P 2 Rr s Is = Rr s 1 ws I r' 2 (1.Induction motor model. 1. From the previous steady state induction motor model the following expressions for the torque.

In the present chapter has been deduced the motor model. 1. Two different motors have been used in the model. rotor and synchronous references. In further chapters. introduced in section 1.Induction motor model.1.6 – Interim conclusions. being equal for the previously mentioned three references. the motor model with stator reference. will be the one most used. Generalities. it has been proved that the space phasor notation is much more compact and easier to work with. Despite the fact that both nomenclatures are valid.4. The model has been developed in both nomenclatures for the stator.1. The final concrete equations used in the Matlab/Simulink motor model have been presented by the three different references. Some simulations are shown to prove the validity of the model. Finally the steady state motor analysis has been introduced. The model has been formulated by means of the two-axis theory equations and the space phasor notation.25 . 1. Different torque expressions have been deduced.

it is the most widespread. 2. Despite the fact that "Voltage/frequency" (V/f) is the simplest controller. It is known as a scalar control and acts imposing a constant relation between voltage and frequency. There are many different ways to drive an induction motor.1 .1 . DIRECT TORQUE CONTROL. PRINCIPLES and GENERALITIES.CHAPTER 2.1.1 – Voltage/frequency. The main differences between them are the motor’s performance and the viability and cost in its real implementation. However. The structure is very simple and it is normally used without speed feedback. this controller doesn't achieve a good accuracy in both speed and torque 2. 2.Induction motor controllers. being in the majority of the industrial applications.

1. Even though. Indirect control of stator currents and voltages. the accuracy in the speed can be 2% (except in a very low speed) and the dynamic response can be approximately around 50ms [LEO 1][LUD 2].1.5% regarding the speed and 2% regarding the torque.Direct Torque Control. High dynamic performance even at locked rotor. Principles and Generalities. This method is based on avoiding the electromagnetic transients in the stator currents.2 . 2. as long as the parameters are identified. It is achieved some computational reduction. In these types of controllers. 2. The main disadvantages are the huge computational capability required and the compulsory good identification of the motor parameters [ROM 1]. Its accuracy can reach values such as 0. Its main features are as follows [LUD 1] [VAS 2]: § § § § Direct torque control and direct stator flux control. Therefore. In Direct Torque Control it is possible to control directly the stator flux and the torque by selecting the appropriate inverter state. even in stand still.3 – Field Acceleration method. keeping its phase continuous.2 – Vector controls. Approximately sinusoidal stator fluxes and stator currents. overcoming the main problem in the vector controllers and then becoming an important alternative for the vector controllers [BED 5] [ROM 1] [YAM 1].1. there are control loops for controlling both the torque and the flux [BOS 1].4 . 2. responses mainly due to the fact that the stator flux and the torque are not directly controlled. The most widespread controllers are the ones that use vector transform such as either Park or Ku. the equations used can be simplified saving the vector transformation in the controllers.Direct Torque Control. 2.

3 . as well as other controllers such as PID for flux and torque. even better than the vector controllers. This method presents the following advantages: § § § § § § Absence of co-ordinate transform. 2. Although. Absence of voltage modulator block. implying the consequent parameters identification. Principles and Generalities. Inherent torque and flux ripples. Requirement of torque and flux estimators.Direct Torque Control. some disadvantages are present: Possible problems during starting. Minimal torque response time.

the electromagnetic torque in the threephase induction machines can be expressed as follows [BOL 1][VAS 2]: t e = 3 Pψs × is 2 (2.Principles of Direct Torque Control.2 . The way to impose the required stator flux is by means of choosing the most suitable Voltage Source Inverter state. in fact.81. 2.2) Where ρ s is the stator flux angle and α s is the stator current one. The same conclusion can be obtained using another expression for the electromagnetic torque.Introduction. both referred to the horizontal axis of the stationary frame fixed to the stator. From equation 1. i s is the stator current (both fixed to the stationary reference frame fixed to the stator) and P the number of pairs of poles. the rotor flux changes slowly compared to the stator flux. then the electromagnetic torque can be rapidly changed and controlled by means of changing the angle ρ s − ρ r [TAK 2] [VAS 2]. If the ohmic drops are neglected for simplicity. Principles and Generalities. As long as the stator flux modulus is kept constant.4 .DTC Controller.1) Where ψ s is the stator flux.1 . 2. the rotor flux can be assumed constant.3) Because of the rotor time constant is larger than the stator one. The previous equation can be modified and expressed as follows: t e = 3 P ψ s ⋅ i s ⋅ sin (α s − ρ s ) 2 (2.2. next equation can be written: te = 3 Lm ' P ψ r × ψ s ⋅ sin(ρ s − ρ r ) 2 2 Ls L r − Lm (2.2. then 2. As it has been introduced in expression 1.2 . (The fact that the rotor flux can be assumed constant is true as long as the response time of the control is much faster than the rotor time constant). 2.83. then the electromagnetic torque is directly controlled.Direct Torque Control. If the stator flux modulus is kept constant and the angle ρ s is changed quickly.

Principles and Generalities. FI: flux increase. TI: torque increase. Figure 2. the stator voltage impresses directly the stator flux in accordance with the following equation: dψ s dt = us (2.I can be written. FD: flux decrease.TD) v1(100) 4 1 5 v5(001) v6(101) 6 Figure 2. that the states Vk and Vk+3 . These two components are directly proportional (Rs=0) to the components of the same voltage space vector in the same directions. are not considered in the torque because they can both increase (first 30 degrees) or decrease (second 30 degrees) the torque at the same sector depending on the stator flux position.TI) v2 (FI.TI) v6(FI. It can be seen from table II. The possible global locus is divided into six different sectors signalled by the discontinuous line.1.I.1. the general table II. TD: torque decrease. The usage of these states for 2.TD) v4(011) v5(FD.Direct Torque Control.1 shows the possible dynamic locus of the stator flux. 2 3 v3(010) v2(110) v3(FD. In Accordance with figure 2.4) Or: ∆ ψ s = u s ∆t (2.5) Decoupled control of the stator flux modulus and torque is achieved by acting on the radial and tangential components respectively of the stator flux-linkage space vector in its locus. and its different variation depending on the VSI states chosen.5 . Stator flux vector locus and different possible switching voltage vectors.

1 .Direct Torque Control. Principles and Generalities. The sectors of the stator flux space vector are denoted from S 1 to S6 .V k+2 DECREASE V k+2 .Vk+3 V k .V k-2 . 2.II. dividing the total locus into twelve sectors instead of just six [LUD 1]. and must remain unchanged. τ: torque error after the hysteresis block. Sx: stator flux sector. controlling the torque is considered one of the aims to develop in the present thesis. Finally.V k . Look up table for Direct Torque Control. FD/FI: flux decrease/increase.V k+1 . The zero voltage vectors V0 and V7 are selected when the torque error is within the given hysteresis limits.2 Table II. Torque error after the hysteresis block ( τ) can take three different values.I: General Selection Table for Direct Torque Control. Φ: stator flux modulus error after the hysteresis block. Stator flux modulus error after the hysteresis block (Φ ) can take just two values. VOLTAGE VECTOR Stator Flux Torque INCREASE V k . TD/=/I: torque decrease/equal/increase.V k -1 V k+1 .6 . the DTC classical look up table is as follows: Φ τ TI S1 V2 V0 V6 V3 V7 V5 S2 V3 V7 V1 V4 V0 V6 S3 V4 V0 V2 V5 V7 V1 S4 V5 V7 V3 V6 V0 V2 S5 V6 V0 V4 V1 V7 V3 S6 V1 V7 V5 V2 V0 V4 FI T= TD TI FD T= TD Table II. being "k" the sector number.

and the resulting error values are fed into the twolevel and three-level hysteresis blocks respectively.2. by means of two different phase currents and the state of the inverter.2.Direct Torque Control. flux and torque estimations can be performed using other magnitudes such as two stator currents and the mechanical speed. there are two different loops corresponding to the magnitudes of the stator flux and torque. In figure 2.3 . the stator flux modulus and torque errors tend to be restricted within its respective hysteresis bands. It can be proved that the flux hysteresis band affects basically to the stator-current distortion in terms of low order harmonics and the torque hysteresis band affects the switching frequency [VAS 2]. which can be performed as it is proposed in figure 2.2. together with the position of the stator flux are used as inputs of the look up table (see table II.7 . The DTC requires the flux and torque estimations. Principles and Generalities. Flux ref + - Torque ref + - Selection Table VSI induction motor flux sector VSI state stator flux torque estimators Figure 2. or two stator currents again and the shaft position [LUD 1] [TAK 2]. However. The reference values for the flux stator modulus and the torque are compared with the actual values.2 a possible schematic of Direct Torque Control is shown. As it can be seen.II). The position of the stator flux is divided into six different sectors.DTC Schematic. 2.2 schematic. Direct Torque Control schematic. 2. The outputs of the stator flux error and torque error hysteresis blocks. In accordance with the figure 2.

11)  Tz  (2.Stator flux and torque estimator using wm .6) If rotor current is isolated from equation 1.14. it can be said: i sD = c ⋅1. Firstly. all three-phase currents must be converted into its D and Q components.2. isA and isB magnitudes.Direct Torque Control.66 it can be said: ψ r ⋅ 1 + p ⋅ L r R r − j L r ⋅P ⋅wm = L m i s R r ' ( ) (2.3.9) (2.10) ψ rQ ⋅ (R r + p ⋅ L r ) = L m R r ⋅ i sQ + ψ rD ⋅ L r ⋅ P ⋅ wm ' ' And taking into account that this expression will be evaluated in a computer it should be expressed in z operator instead of p one. It is used the motor model fixed to the stationary reference frame fixed to the stator.10 the following equation are obtained: R  Tz  − r   ψ rD ⋅  z − e  L r    ' R  Tz  − r    z − e  Lr  ψ rQ ⋅   '  1− e  Lr =  Rr   1− e  Lr =  Rr  −  Rr −  Rr  Tz   L R ⋅ i sD − ⋅ψ ' ⋅ L ⋅ P ⋅ wm  m r  rQ r    L R ⋅ i sQ + ⋅ψ ' ⋅ L ⋅ P ⋅ wm  m r  rD r   (2. By means of the Park transformation defined in equation 1.8) Expanding the previous equation into its D and Q components. Principles and Generalities. 2.65 and substituted into 1.1 .5 ⋅ i sA i sQ = c ⋅ 3 2 ⋅ (2 ⋅ i sB + i sA ) (2. Therefore doing the z transform of equations 2. This estimator does not require co-ordinate transform.14) 2. is obtained: ψ rD ⋅ (R r + p ⋅ L r ) = L m R r ⋅ i sD − ψ rQ ⋅ L r ⋅ P ⋅ wm ' ' (2.12) And in time variable: ψ 'rD (k ) = ψ 'rD (k − 1) ⋅ e − R r  Tz  L   r  + 1−e − R r  Tz  L   r Rr − R r  Tz  L   r (L (L m R r i sD (k − 1) − L r ⋅ P ⋅ ψ 'rQ (k − 1) ⋅ wm(k − 1)) (2.8 .7) And if the expression 2.13) ψ 'rQ (k ) = ψ 'rQ (k − 1) ⋅ e − R r  Tz  L   r  + 1−e Rr m R r i sQ (k − 1) + L r ⋅ P ⋅ ψ 'rD (k − 1) ⋅ wm(k − 1)) (2.7 is rearranged: ψ r ⋅ (R r + p ⋅ L r ) = L m R r ⋅ i s + j ⋅ ψ r ⋅ L r ⋅ P ⋅ wm ' ' (2.9 and 2.

the D. This fact avoids the measurement of the stator voltage pulses. from the VSI state and having the instantaneous value of the Vdc .64 it can be said: ψs = ∫(u s − R s ⋅ i s dt ) (2. neither rotor speed nor rotor position are available.18) Expressing the previous equation in time and in its D and Q components: ψ sD (k ) − ψ sD (k − 1) = Ts ⋅ u sD (k − 1) − Ts ⋅ R s ⋅ i sD (k − 1) ψ sQ (k ) − ψ sQ (k − 1) = Ts ⋅ u sQ (k − 1) − Ts ⋅ R s ⋅ i sQ (k − 1) (2. Finally from equation 1. 2. In case that sensor-less direct torque control is desired. Finally. In practice. The motor speed may be estimated and fed into a flux estimator. It should be noted that a co-ordinate transform is not 2.17) And expressing this equation in z operator by means of the z transform: ψs = z −1 ⋅ Ts ⋅ u s − R s ⋅ i s 1 − z −1 ( ) (2.15) (2.Direct Torque Control.C. In order to obtain an estimation of the stator flux space vector.9 .19) It may be deduced that the stator voltage space vector components are derived from the inverter internal switch settings. it can be deduced the voltages in each phase. Stator flux and torque estimation based on the stator voltage equation does not require speed or position information when stationary co-ordinates are applied.Stator flux and torque estimator using Vdc . stator flux can be obtained as follows: L ψ sD (k ) = i sD (k ) ⋅ L x + ψ 'rD (k ) ⋅ L m L m r (2.82.2 . link voltage is measured. isA and isB magnitudes. thus the D and Q components of the stator voltage space phasor can be derived. two possible methods may be applied: § § An estimation that does not require speed or position signals may be used. Once the voltage and the current values are calculated and measured respectively. Thus. Principles and Generalities.3.16) L ψ sQ (k ) = i sQ (k ) ⋅ L x + ψ 'rQ (k ) ⋅ L m L m r Torque is obtained using equation 1. they are transformed in D and Q components by means of Park transformations.2.

4 . However. depart from their ideal behaviour when the motor model parameters used are not different from the true motor model parameters. required.1 and 2.Direct Torque Control.2. In further chapters will be used the estimator introduced in section 2.3.2.2.1.Parameter detuning effects. 2. shown in sections 2. 2. However. Stator flux and torque estimators DTC based systems.3. the estimator that uses Vdc performs very poorly when just small errors of its parameters are present [LUD 1]. It can be proved that estimators that uses either position or speed have similar characteristics.10 .2. Principles and Generalities. as long as the estimated parameters have an error lower than 10%. which are good enough.2. the accuracy of the estimation is limited due to the open loop integration that can lead to large flux estimation errors [LUD 1].3.

2.Six sector table but different zones.Introduction. there are several drawbacks.3 . instead of having as a first sector the zone from -30º up to 30º.1. Hence. as in classical DTC. Electromagnetic torque and stator flux. In the classical DTC. In other words. Then. are estimated for sampling period for all possible inverter sates. there are different solutions. is to use six sectors.3. 2. 2.3.1 .11 . It can be observed that in this case.3.Improvements in Direct Torque Control. Principles and Generalities. In order to overcome the mentioned drawbacks. which can be classified as follows: § § Non artificial intelligence methods. the same vectors are used during start up and step changes and during steady state. Some of them can be summarised as follows: § § Sluggish response (slow response) in both start up and changes in either flux or torque. used to determine the switching voltage vectors. 2. Large and small errors in flux and torque are not distinguished. it will be from 0º up to 60º. 2.First approach.2 – Different tables.1 .2.3. This novel sector division is shown in figure 2. 2. when it is tried to improve the DTC by means of changing the tables.Direct Torque Control. 2. the states not used in the first zone will be V3 and V6 instead of V1 and V4 . the predictive algorithm selects the inverter switching states to give minimum deviation between the predicted value of the electromagnetic torque and the reference torque. § Fuzzy logic based systems. First idea that comes up. Predictive algorithms. Next sections deal with all these methods. but changing the zones. mainly "sophisticated tables".1.3. A mathematical model of the induction motor is needed. achieving a good knowledge of all them in order to realise the best DTC improvement.

TD) v1(100) v4(FD. are not used in the classical DTC (c_DTC) because they can increase or decrease the torque at the same sector depending on if the position is in its first 30 degrees or in its second ones. V1 V2 V3 V4 V5 V6 CLASSICAL DTC -30º → 30º 30º → -30º Torque ambiguity 90º → 30º TI.3. V 3 and V6 are the states not used. FD -60º → -120º Flux ambiguity Table II. TI/TD: Torque Increase/Decrease. It is shown the angle of the voltage vector in the sector with reference to the normal and tangential axis.Direct Torque Control.TD) v5(FD. FI 120º → 60º Flux ambiguity 180º → 120º TI.III can be written. the general table II. FD -30º → -90º TD.TI) tg 1 v2 (FI. FD -150º → 150º Torque ambiguity -90º → -150º TD. Principles and Generalities. In the modified DTC (m_DTC). Right: Modified DTC and its new six sectors. FI MODIFIED DTC 0º → 60º 0º → -60º TD. FI 150º → 90º TI. 3 v3(010) v2(110) 2 v3(010) v2(110) tg 2 v2 (FI.TI) v1(FI.TI) v4(011) v5(FD. FI 60º → 0º TI. In Accordance with the figure 2.3. FI/FD: Flux Increase/Decrease It can be seen that the states V1 and V4 . However.TD) v1(100) n n v4(011) 4 1 4 5 5 v5(001) v6(101) 6 6 v5(001) v6(101) Figure 2. now the reason is the 2.TD) v6(FI. FD -120º → -180º TD.III: Behaviour of each state just in the first zone for the classical DTC (left) and the modified DTC (right).TI) 3 v3(FD. Left: Classical DTC and its six sectors.12 .

it is better to loose the usage of two states for flux ambiguity that for torque one. This is considered to be an advantage in favour of the m_DTC as long as the main point is to control the torque. Look up table for Modified DTC. Table II. τ: torque error after the hysteresis block. so they are never used either.IV. it is arisen the idea of the twelve sector modified DTC (12_DTC). This novel stator flux locus is introduced in figure 2. Φ: stator flux modulus error after the hysteresis block. they are never used. In classical DTC there are two states per sector that present a torque ambiguity.Twelve sector table. Φ FI τ TI T= TD TI T= TD S1 V2 V0 V1 V4 V7 V5 S2 V3 V7 V2 V5 V0 V6 S3 V4 V0 V3 V6 V7 V1 S4 V5 V7 V4 V1 V0 V2 S5 V6 V0 V5 V2 V7 V3 S6 V1 V7 V6 V3 V0 V4 FD Table II.IV shows the m_DTC look up table for all its six sectors.13 . as it was in the c_DTC. In a similar way. However. It seems a good idea that if the stator flux locus is divided into twelve sectors instead of just six. FD/FI: flux decrease/increase. mainly due to the fact that the tangential voltage vector component is very small and consequently its torque variation will be small as well. ambiguity in flux instead of torque.2 . Principles and Generalities.Direct Torque Control. in the modified DTC there are two states per sector that introduce flux ambiguity. it has to be introduced the idea of small torque increase instead of torque increase. 2. Therefore.4. Therefore. TD/=/I: torque decrease/equal/increase.3. 2. Notice how all six voltage vectors can be used in all twelve sectors. all six active states will be used per sector. Consequently. Sx: stator flux sector.2.1.

2. FD/FI: flux decrease/increase. V4 . Principles and Generalities.TI) V4(FD. V6 V 1 .TD) V4 6 7 1 V5(FD. TsD) V6(FI. V4 DECREASE V 3 . V6 . Notice how all six voltage vectors can be used in all sectors disappearing all ambiguities.Direct Torque Control. TsI) V2 (FI.TD) V2 (FI. V1 Table II. Notice how all six voltage vectors can be used in all twelve sectors. Table II.TI) V1(FI.TI) V1(FI.V can be written when a twelve-sector locus is used. V2 . V3 V2 4 5 3 2 V3(FD. V5 V 5 . TsD/TsI: torque small decrease/increase. As it has been mentioned in the previous paragraph. TD/TI: torque decrease/increase. V3 .14 . disappearing all ambiguities. V4 . S 12 Stator Flux Torque S1 Stator Flux Torque INCREASE V 1 . Twelve sector modified DTC (12_DTC) and its sectors.V: Table for sectors 12 and 1 in the 12_DTC. On the contrary. V6 DECREASE V 3 . V5 V 4 . TsI) V6(FI.TD) V3(FD. it is necessary to define small and large variations. V3 INCREASE V 1 . V6 V 2 .4. V2 . V5 .TI) V4(FD.TD) V3 V2 Figure 2. TsD) 12 8 9 10 11 V5(FD. V2 . It is obvious that V1 will produce a large increase in flux and a small increase in torque in sector S12 . V2 will increase the torque in large proportion and the flux in a small one.

It is reasonable to deduce that the torque error should be divided in the number of intervals that later on will be measured. TsD/TsI: torque small decrease/increase.5. 2. it can be drawn figure 2.3. Therefore.2. FD/FI: flux decrease/increase. the hysteresis block should have four hysteresis levels at is suggested in table II.5. TD/=/I: torque decrease/equal/increase. FD/FI: flux decrease/increase. Sx: stator flux sector.3 . It has been chosen the second most suitable).Simulations. results and conclusions.VI. Eight levels of flux and torque variation for the flux stator locus in the 12_DTC. which is the integral of the square error. The one that is used is IE2. Φ: stator flux modulus error after the hysteresis block. If the flux and torque effects are divided into eight groups. TD/TI: torque decrease/increase. It should be noted the fact that the index is computed 2. tg 150º torque TI FI 30º TI FD TsI FD TsD FD -150º TsI FI TsD FI TD FI -30º n flux TD FD Figure 2. Finally.VI: Switching table for the 12_DTC.15 . disappearing all ambiguities. τ: torque error after the hysteresis block.Direct Torque Control. the look up table is presented in table II. In order to compare the responses. Notice how all six active voltage vectors can be used in all twelve sectors. Principles and Generalities.1. it is needed an index error.VI. Φ FI τ TI TsI TsD TD TI TsI TsD TD S1 V2 *V2 V1 V6 V3 V4 V7 V5 S2 V3 V2 *V1 V1 V4 *V4 V5 V6 S3 V3 *V3 V2 V1 V4 V5 V0 V6 S4 V4 V3 *V2 V2 V5 *V5 V6 V1 S5 V4 *V4 V3 V2 V5 V6 V7 V1 S6 V5 V4 *V3 V3 V6 *V6 V1 V2 S7 V5 *V5 V4 V3 V6 V1 V0 V2 S8 V6 V5 *V4 V4 V1 *V1 V2 V3 S9 V6 *V6 V5 V4 V1 V2 V7 V3 S10 V1 V6 *V5 V5 V2 *V2 V3 V4 S11 V1 *V1 V6 V5 V2 V3 V0 V4 S12 V2 V1 *V6 V6 V3 *V3 V4 V5 FD Table II. (* there is no suitable state.

Input torque reference value. It is observed that c_DTC performs better in steady state flux and worse in transient flux. Conclusions: § § § At the beginning and end of each sector.003161 -0. and it was equal to the nominal motor torque at nominal speed.VII: IE2 values after the simulations. The reference torque value is shown in figure 2. ( -.Direct Torque Control.6.VII.6.019 -1. It was believed that 12_DTC would solve this problem but it didn't.4 Figure 2.002869 Torque 1. it performs worse in steady state torque and better in transient torque. the flux locus is worse in both c_DTC and m_DTC. Stator flux set point was set to its nominal value.6.25 1. and the stator reference flux value was the nominal one. However. Principles and Generalities.7 0. it performs better in steady state torque and worse in transient torque.5 t -6. Te 6.meaning that it didn't work). The torque load was proportional to the motor speed. by means of the square error instead of just the error. The torque reference value is described in figure 2. All simulations have been done just for the Motor_1kW (see chapter 4). therefore. 2. The simulated results for first approach modified DTC are shown in table II. It is observed that m_DTC performs worse in steady state flux and better in transient flux.3509 Table II.7 -13.05 0. IE2 c_DTC m_DTC 12_DTC Flux 0. the more error is produced the more emphasis it is given in the index. Results are not as good as expected. However.16 .

Behaviour of each state just in the sector 1 for the classical DTC (left) and the modified DTC (right). It can be seen how the flux ripple is higher in the m_DTC than in the c_DTC. Evolution of the flux stator locus in the classical DTC and modified DTC. it can be said that all the states in m_DTC produce large variation in flux. This fact explains both. § If the stator flux locus is observed the evolution is as shown in figure 2. Instead they do decrease the torque. § States. which are supposed to increase the torque in a small way (because they are either between 0º and 30º or 150º and 180º). It seems almost impossible to improve both at the same time. the locus in figure 2. the variation in flux and torque will be either small or large. 2. the torque one becomes worse and the other way round. meanwhile the ones in c_DTC produce large variation in torque.7 in the previous conclusion and why the m_DTC is unable to reach nominal conditions. It can be concluded that depending on the voltage vector angle referred to the normal reference axis. Principles and Generalities. c_DTC m_DTC Figure 2.VIII. § According to the definition given in figure 2. It is shown the angle of the voltage vector in the sector with reference to the normal axis.VIII can be written.7.7.5. don't increase the torque at all. Table II. Large flux and large torque variations.Direct Torque Control.17 . § If index error flux (IE2) improves. S1 V1 V2 V3 V4 V5 V6 c_DTC -30º → 30º 30º → -30º Not used 90º → 30º Torque large 150º → 90º Torque large -150º → 150º Not used -90º → -150º Torque large -30º → -90º Torque large m_DTC 0º → 60º 0º → -60º Flux large 60º → 0º Flux large 120º → 60º Not used 180º → 120º Flux large -120º → -180º Flux large -60º → -120º Not used Table II.

m_DTC TI / FI 0º 15º V2 30º 45º 60º / 0º 15º V1 30º 45º 60º small torque c_DTC TI / FD 120º 135º V3 TI / FI 60º 75º 90º /º30º 45º V2 60º 75º 90º / 30º V1 45º 60º medium torque Stator TI / FD 120º V4 135º 150º / 90º 105º V3 120º 135º 150º / 90º V2 105º 120º large torque Flux angle 60º 45º 30º 15º 0º -15º -30º -45º -60º V4 150º 165º 180º / 120º V3 135º 150º 165º 180º Table II. It is defined four working points. It is shown the typical torque-speed induction motor characteristic. Principles and Generalities.Direct Torque Control. This fact gives the idea that could be worthy use different tables depending on the working point. However. it is done a further investigation in order to find out why the expectations were not achieved. which means depending on both the speed and torque. 12_DTC has got plenty of sense when medium torque is required. IX.8.Second approach. It is shown the angles of each voltage vector referred to the tangential and normal reference axis.18 .2. On the other hand. for small torque m_DTC is more appropriate because small torque variations are needed. 2. 2.3. It is shown different possibilities for choosing the appropriate states attending the criteria of the level of torque variation required. After the bad previous results regarding c_DTC. Hence.2 . From table II. four general working points are distinguished: Te 100% 30% 2 1 10% 4 3 100% wm Figure 2. Just for the stator flux angle from -60º up to 60º. m_DTC and 12_DTC.IX seems evident that for nominal torque the best table is the c_DTC because large torque variation must be available.

2.19 . It is proved why in nominal conditions the best was c_DTC. Torque and flux reference values have been set to its nominal values for the motor 1_kW (see chapter4). as it is introduced in expression 2. However. This fact leads to the idea of modifying the c_DTC table once the working point is near to nominal conditions.6084 0.5s.3383 0. producing a big ripple in the torque response. it is needed several increasing states to recuperate the set point value again.Direct Torque Control. the decreasing states are not used and the null states are 2. Principles and Generalities. due to the fact that each working point has different most suitable look up table. which are supposed to keep the torque in the same level. Finally. It should be remembered that if its tangential component in the flux locus is positive the state is supposed to increase the torque and the other way round.019 Flux m_DTC Torque 0. regarding torque. Once one of the decreasing states is applied. Conclusions: § § It is born the idea of the working point.meaning that it didn't work). 2. Simulations have done during 1. Null states. as they should.0018883 ----- Table II.00304 0.56425 ----- 0. then the angle of the stator flux increases fast.3 .03161 Torque 0.0023447 0.0177 0.25697 0.5748 1. a more accurate study of the torque expression gives the idea that the torque just depends on the "sin(ρs-ρr)". Once the speed is high.Third approach. that is to say. always than both magnitudes are higher than 50% of the nominal conditions. ( --. decrease it in a notable way. Under these circumstances.3.3.X.01592 0. In this new table. the voltage states which are supposed to decrease the torque do it but in a very strong way. It has been observed that some states don't behave. IE2 simulated values. IE2 Work point 1 2 3 4 c_DTC Flux 0. states that are supposed to increase the torque do it in a very small quantity.

TD/=/I: torque decrease/equal/increase. FD/FI: flux decrease/increase.XII.XI. IE2 simulated values for the classical DTC and the second modified DTC. τ: torque error after the hysteresis block. Look up table for m2_DTC. used instead.Direct Torque Control. Sx: stator flux sector. Hence.20 .XI. Φ τ TI FI T= TD TI FD T= TD S1 V2 V2 V0 V3 V3 V7 S2 V3 V3 V7 V4 V4 V0 S3 V4 V4 V0 V5 V5 V7 S4 V5 V5 V7 V6 V6 V0 S5 V6 V6 V0 V1 V1 V7 S6 V1 V1 V7 V2 V2 V0 Table II. However. for torque maintaining states is better use the increase states instead of the null ones.6731 Table II.3. which were performed in the same conditions as in 2. another modified DTC (m2_DTC) is created and its table is shown in table II. 2. all this different look up tables study.003171 Torque 1.003161 0.019 0. are the increasing ones.4 . The states that are used for maintaining the torque value. have been as follows: IE2 c_DTC m2_DTC Flux 0. Φ: stator flux modulus error after the hysteresis block.2. Several conclusions from. have been obtained: § There is not a remarkable improvement in the motor performance changing the look up tables.Conclusions. Under the same circumstances.2. From this third approach can be concluded that when the working point is near to the nominal conditions. some little improvements can be achieved. 2. Simulation results for working point 4.3.2. it is a good idea do not use the torque decreasing states and use the null ones instead. Principles and Generalities.

which is its simplicity in calculus. 2. one of the main drawbacks of the classical DTC. The predictive algorithm then selects the inverter switching states to give minimum deviation between the predicted electromagnetic torque and the reference torque. Moreover. the torque decreasing states are forbidden because they introduce a high ripple. the most suitable state not only depends on flux and torque error values and on the sector. In other words. the mentioned method is not considered a good solution for improving the DTC. If the working point is high. § The working point determines the most suitable voltage state. If the machine is not in steady state. therefore Space Vector Modulation has to be applied [ARI 1]. In order to obtain the voltage reference value.21) [CAS 1] [HAB1] [VAS 2]. it is much better to use the null states. a good machine model is needed in order to know all the parameters that appears in equation (2. in any transient this predictive method won't work properly being compulsory the usage the classical DTC instead. the probability of obtaining a reference voltage decreases. overcoming therefore. Instead of them. § § The voltage vector angle referred to the normal reference axis implies a small or large variation in stator flux and torque. equations (2.21 . A brief summary of the mathematical expression for implementing this method is introduced in equations (2. Principles and Generalities.3. but also on the working point (torque and speed values). Equations (2. 2. The main problems for this solution are the procedure for calculating the voltage reference and the following decomposition by means of SVM. In this case.Direct Torque Control. It is obtained a reference voltage value.20) must be solved. The calculation of the voltage reference value and the SVM need a high computation capability.20).20) and (2.20) and (2. loosing one of the best advantages of DTC. Moreover. The point of this method is to choose the switching vectors that are in accordance with the range of flux and torque errors. Therefore. For this purpose a suitable mathematical model of the induction machine is used and the electromagnetic torque is estimated for each sampling period for all possible inverter modes.21) show the fact that this method increases the calculus of the drive in a considerable way. the classical DTC will be applied.3 – Predictive methods.

Some of these techniques involve the usage of high switching frequencies or the change in inverter topology.4 . after being studied this predictive method. However. it is possible to use an increased number of switches.Direct Torque Control.20) Once the reference voltage value is obtained.21) This thesis. 2. such as the duty ratio control [BIR 1] [VAS 3]. a ⋅ u ref _ D + b ⋅ u ref _ D + c = 0 ψ ⋅T a = Tz2 +  sQ z ψ    sD   2 2 b = 2 ⋅ α ⋅ ψsQ ⋅ ( ) + 2⋅ T ⋅ ψ Tz 2 2 ψ sD z sD + 2 ⋅ ψ sQ ⋅ Tz ψ 2 sD ψ c = 2 ⋅ α ⋅ Tz ⋅  sQ ψ  + ψ 2 + ψ 2 − ψs2 _ ref   sD sQ sD   2 α= 2 ⋅∆ t e ⋅L s 3 ⋅ P⋅ T z + ψsD ⋅ esQ − ψ sQ ⋅ esD (2.Fuzzy logic based systems. Principles and Generalities. In the classical DTC induction motor drive there are torque and flux ripples because none of the inverter switching vectors is able to produce the desired changes in both torque and stator flux. However. v ref = u ref + R s ⋅ i s (2. When changed the inverter topology is used. it will result in an increment of switching losses (leading to an efficiency reduction). 2. In DTC induction motor drive. if high switching frequency is used. the increase of switching frequency is desirable since it reduces the harmonic content of the stator currents. it is also possible to use schemes. in case of high switching frequency. will be focused on the Fuzzy Logic controllers. and also leads to reduce torque harmonics. but it is also possible to use schemes which do not involve any of the mentioned techniques. which do not involve using inverters with a higher number of switches.22 . it must be added the stator resistance drops. This increases the cost. because it is thought that they can improve in a better way the classical DTC without increasing the complexity in calculus that much. a fast processor is required since the control processing time becomes small. It also will increase the stress of the semiconductor devices of the inverter. but this will also increase the costs [MAR 2].3. using various techniques can be reduced the ripples in the electromagnetic torque and stator flux. However. such as duty ratio control. Furthermore.

The mentioned Fuzzy Logic method is considered a good solution for improving the DTC. and this causes the stator current and electromagnetic torque exceeds its reference value early during the cycle. the stator flux position and the working point. 2. causing a high torque ripple.Regulating the flux. in order to obtain even a better reduction. a duty ratio (δ) has to be determined each switching time. in which the zero switching vectors are applied in order to reduce the electromagnetic torque to reference value.23 . which is determined by the motor speed and the electromagnetic torque. stator flux reference value has to be adapted to an optimum value. As it has been explained in the previous sections. where the optimum duty ratio is determined every switching period [BIR 1][VAS 3]. Principles and Generalities. However. it is believed that by using a Fuzzy Logic based DTC system it is possible to perform a fuzzy-logic-based duty-ratio controller. Moreover. The suggested technique is based on applying to the inverter the selected active states just enough time to achieve the torque and flux references values. The rest of the switching period a null state is selected which won't almost change both the torque and the flux. Switching cycles then follows this. By means of varying the duty ratio between its extreme values (0 up to 1) it is possible to apply any voltage to the motor.5 . It is obvious that it is extremely difficult to model such an expression since it is a different non-linear function per working point. 2. The reason is that with this optimum value the increase in the active state is just large enough and the slight reduction in the null states is lower. Therefore. it is achieved a reduction in the power reactive consumption taken from the mains supply.Direct Torque Control. the ripples in the electromagnetic torque and stator flux are extremely reduced by using controllers based on Fuzzy Logic systems or predictive methods. The optimum duty ratio per sampling period is a non-linear function of the electromagnetic torque error. which should be just large enough to produce the desired torque. In the classical DTC induction motor drive a voltage vector is applied for the entire period. because it is thought that they can improve in a better way the classical DTC without increasing the complexity in calculus that much. This thesis after being studied this method will be focused on the Fuzzy Logic controllers.3. Thus.

9.99. the final expression.98 and 1. is given in 2. Re-arranging the mentioned expressions.23. It should be noted that this optimised stator flux value it is not only valid in DTC but also in any drive. 2. Principles and Generalities.Direct Torque Control.23) Finally the schematic of the DTC based on fuzzy controllers and optimising its reference stator flux value is as follows: Flux ref optimized cte sqr Torque ref + + - - Selection Table VSI induction motor flux sector VSI state stator flux torque estimators Figure 2.22 can be presented as in equation 2.22) Equation 2.22 ψs = [ Rr s (L s1 + 32 Lsm )]2 + [ws (L r1 (Ls1 + 3 2 L sm ) + 3 2 Lsm L s1 )]2 T 3 P 2 R s 1 w (ws 3 2 Lsm )2 r s (2. which relates the stator flux and the torque. 1. which gives the just large enough stator flux for the desired torque is obtained from expressions 1.24 . The optimum expression.97. Flux reference optimised controller in a classical DTC. ψ s = cte ⋅ T cte = [ Rr s ( L s1 + 3 2 L sm )]2 + [w sn ( L r 1 ( L s1 + 3 2 L sm )+ 3 2 L sm L s1 )]2 3 P 2 R r s 1 w sn ( w sn 3 2 L sm )2 (2.

is the third method. However.1 has been used in further chapters and has been implemented for the further experimental results.25 .4 . Many conclusions have been obtained in this study.2. which is the aim of the thesis. some little improvements can be achieved. Despite the fact that the aim of this thesis is not the parameters detuning effects.4. this method will be considered in further sections as well. as it is explained in next section 3. the fourth method is the regulation of the stator flux reference value. being the fundamental ideas for the development of the most suitable Fuzzy Logic controller.2. Principles and Generalities.Direct Torque Control. 2. it has been studied its main effects and has been shortly summarised in section 2. Four different methods for improving the classical DTC. 2.1. Two different estimators for the stator flux and torque have been fully developed. This method can be applied in any motor drive.3. Therefore.Interim conclusions.1. which is its simplicity. After the research done in this field. § The second method is the predictive one. have been studied and deeply discussed: § The first method is the search of a better look up table. but also reduces the power reactive consumption taken from the mains supply. § Finally. § The application of the Fuzzy Logic for implementing a simple modulation between the selected active state and a null one. just the estimator from section 2. It has been explained the basic concepts of the Classical Direct Torque Control.2. It can be concluded that this method is very promising and this thesis will be focused on that in the following chapters. it can be concluded that by means of changing the table can not be remarkably improved the DTC performance. However. It has been concluded that it is too complicated regarding its real implementation because of its calculus. Not only it reduces the torque ripple improving the motor performance. eliminating one of the DTC advantages.

A null state is selected for the remaining switching period. which won't almost change both the torque and the flux. a duty ratio (δ) has to be determined each switching time. 3.CHAPTER 3.Introduction. FUZZY LOGIC DIRECT TORQUE CONTROL. In DTC induction motor drive there are torque and flux ripples because none of the VSI states is able to generate the exact voltage value required to make zero both the torque electromagnetic error and the stator flux error.1 . it is possible to apply any voltage to the 3.1 . Therefore. By means of varying the duty ratio between its extreme values (0 up to 1). The suggested technique is based on applying to the inverter the selected active states just enough time to achieve the torque and flux references values.

3. this technique is based on a two-state modulation. The optimum duty ratio per sampling period is a non-linear function of the electromagnetic torque error. being different to the previous one. On the other hand. It is obvious that it is extremely difficult to model such an expression since it is a different non-linear function per working point. where the optimum duty ratio is determined every switching period [BIR 1] [VAS 3]. motor. which is determined by the motor speed and the electromagnetic torque. The first one will act each time that the selected active VSI state has changed. it is believed that by using a Fuzzy Logic based DTC system it is possible to perform a Fuzzy Logic based duty-ratio controller. These two states are the active one and a null one. which is when the active VSI selected state is the same as the previous one.2. The second controller will act in the opposite situation. The suggested Fuzzy Logic system is divided into two different Fuzzy Logic controllers. Therefore. the stator flux position and the working point.2 . the relationship between different rules is done by means of "or" operator.Fuzzy Logic Direct Torque Control. Thus. These Fuzzy Logic controllers and its functionality are explained deeper in section 3. The relation between different conditions in the same rule is done by means of "and" operator. Both fuzzy logic controllers use the Centroid defuzzification method.

Fuzzy Logic duty ratio estimator 3. The second idea is that the torque decrease states decreases the torque too much. instead of a null one.e. This idea is considered by means of the working point membership input and its consequent distribution in the working plane.3.3) were born two main ideas.2. It does seem obvious that if the working point increases.2 .1.Fuzzy Logic Direct Torque Control. speed and torque. there are three inputs. it will be generated by means of modulating a torque increase state and a null one.T) Fuzzy logic controller 1 duty ratio Figure 3.1.Objectives. As a solution.2) was born the idea of the working point.1) was lead the idea of small and large torque increases or decreases (see figure 2. The first one is that the higher the working point is. From the section entitled "first approach" (2. Stator flux position torque error f(wm.2. 3. Finally from the section entitled "third approach" (2. the more torque is decreased by the null states (instead of keeping it constant).Fuzzy Logic controller 1.1.2. being the result after the entire period a small reduction in torque. In this Fuzzy Logic controller these ideas from the third approach will be implemented by means of the working point and torque error inputs.2. The output is the duty ratio.2.3.2. (which almost do not increase the torque under these conditions). This idea will be taken into account by means of the stator flux position as input of the Fuzzy Logic system.Fuzzy Logic Direct Torque Control. From the section entitled "second approach" (2. 3.3 . electromagnetic torque error and the motor working point i.2. 3.3.1 .5). once a small decrease in torque is required. The torque maintaining state will be generated by means of a torque increase state. then the duty cycle must tend to one and in the opposite case the duty cycle must tend to zero.Inputs and output membership functions.1. In such a Fuzzy Logic system. stator flux position. 3.

The absolute values will depend on the nominal values of each electrical machine. The "wTi" values are as follows: wT1=120. The fuzzy system comprises four groups of rules. In any case just one fuzzy system is used per iteration.4 . However they are different depending on the working point position.3.w can be seen in figure 3. n-l n-m n-s s m l torque error -te3 -te2 -te1 te1 te2 te3 Figure 3. wT3=275. Two of them are used when the stator flux is smaller than its reference value (Flux increase) and the other two in the opposite case (Flux decrease). wT6=270. and it depends on the working point. wT2=200. It can be seen its four different groups of rules.3. Just one group of rules is used per iteration. s m l 0º 30º 60º Stator flux position Figure 3. te2=10%Tn. These two cases are speed wpc higher than torque Tpc (both in percent) and the opposite case. Stator flux position membership function is decomposed in three fuzzy sets as it is shown in figure 3. The different zones in the working plane T. The motor working point membership function is decomposed in just three fuzzy sets.T) FI FI FD FD w c<Tpc p w c>Tpc p w c<Tpc p w c>Tpc p duty ratio Figure 3. wT5=160. Fuzzy controller 1 Stator flux position torque error f(wm .Fuzzy Logic Direct Torque Control. Stator flux position membership input. wT4=100. where Tn is the nominal torque value.2. te3=20%Tn. The "tei" values are as follows: te1=5%Tn. 3. The working point is firstly divided into two different cases. Torque error membership input.5. Fuzzy logic duty ratio estimator.4. The torque error membership function is decomposed in six fuzzy sets.

Fuzzy Logic Direct Torque Control.3. each of which contains 46 rules.5. All four groups of 46 rules are listed in section A. Left wpc<Tpc. Working point membership inputs and the three different zones in the T.50. Notice that its membership values are single tone to simplify the calculation. It should be noted from figure 3.75. Two of them are used when the stator flux is smaller than its reference value (Flux increase) and the other two in the opposite case (Flux decrease). In any case just one fuzzy system is used per iteration. dc2=0.1.1.5 that the working plane behaviour can not be described by means of three lines in his entire plane.15.2. the working plane is divided into two zones and the fuzzyfication of these two zones is as well different. 3. W pc <T pc W pc >T pc s m l s m l Tpc +2wpc wT1 Tpc 100% T pc +2wp c =wT3 2Tpc +wpc wT4 wT5 wT6 wp c =Tpc wT2 wT3 wp c =Tpc Tpc 100% 2T p c +w p c =wT6 T pc +2w pc =wT2 2T p c +wp c=wT5 Tpc +2w pc =wT1 2T p c +wp c=wT4 100% wpc 100% wpc Figure 3. and it depends on the working point. Duty ratio membership. Duty ratio membership function is decomposed in five fuzzy sets. Right wpc>Tpc. Therefore. The " dci" values are as follows: dc1=0. 3.w plane.6. z s m l vl 1 duty ratio 0 dc1 dc2 dc3 1 Figure 3.5 .Rules: The fuzzy system comprises four groups of rules. dc3=0.2.

2). 3. n-l n-m n-s s m l Te* n-l n-m n-s s m l Figure 3.1. However. there are two inputs. It can be seen the evolution of the torque during one Tz.7. As long as the selected state is not changed. it must continue with the same duty cycle value.Objectives. the increment in duty ratio has to be zero.2.7. on the right of figure 3. 3.7. and the error in the previous state was small.7.2. This case corresponds to the seventeenth rule (see section A.Inputs and output membership functions.2.7 can be seen the adaptive characteristic of the Fuzzy Logic controller. Two examples are shown in figure 3. the duty ratio increment has to be small. and the error in the previous iteration was negative large.Fuzzy Logic Direct Torque Control. Left: if the torque increment is negative medium. it is obvious that next iteration should not decrease the duty ratio because the torque value would take a value under the reference torque value. Right: if the torque increment is zero.2 . therefore. 3.2. The output is the increment in duty ratio. 3.2.6 . The objective is to create an adaptive system. Therefore. This case corresponds to the second rule (see section A.2.2. Te* From figure 3.2. On the left of figure 3. the action must be to increase a bit the duty cycle in order to place next torque value a bit above than the torque reference value. it is obvious that the torque response has been excellent. torque increment and electromagnetic torque error in the previous iteration. In such a Fuzzy Logic system.2).Fuzzy Logic controller 2. then taking into account the last evolution is possible to predict next duty ratio increment to reduce the torque error.

n-vl n-l n-m n-s z s m l vl ∆δ − ∆δ4 −∆δ3 −∆δ2 −∆δ1 0 ∆δ1 ∆δ2 ∆δ3 ∆δ4 Figure 3. Torque increment and torque error in the previous iteration membership inputs.8. te2=5%Tn. The " ∆δi" values are as follows: ∆δ1=0.2. Notice that its membership values are again single tone to simplify the calculation.Fuzzy Logic Direct Torque Control. ∆δ2=0. and the torque error in the previous iteration membership function is decomposed in six as shown in figure 3. n-l n-m n-s z s m l n-l n-m n-s s m l ∆ torque -te3 -te2 -te1 te1 te2 te3 -te3 -te2 -te1 te1 te2 te3 torque error(i-1) Figure 3.7 . All 37 rules are listed in section A. where Tn is the torque nominal value.2. Fuzzy logic controller increment_duty ratio estimator. The rules number two and seventeen are explained in figure 3.9. ∆ torque torque error (i-1) Fuzzy logic controller 2 ∆δ Figure 3. The "tei" values in both cases are as follows: te1=1%Tn.9. The torque increment membership function is decomposed in seven fuzzy sets.15. Increment duty ratio membership.3.Rules: The fuzzy system contains 37 rules.2. The absolute values will depend on the nominal values of each machine. The increment duty ratio membership function is decomposed in nine fuzzy sets.5. ∆δ3=0.08. te3=10%Tn.10.2.35 and ∆δ4=0. 3.7. 3.

II just four rows are used. Finally the schematic of the DTC based on fuzzy controllers is as shown in figure 3. It means that from the classical DTC table II. which can be obtained by means of two different ways. Therefore. However. null states are introduced by means of the duty cycle.3 .11. It should be clear that despite the fact that there are two Fuzzy Logic controllers.Fuzzy Logic DTC schema.11 is pretty similar to the classical DTC one in figure 2. It should be noted as well. which will calculate the torque. just one fuzzy controller is used per iteration. This other way gives an increment of the duty ratio. the torque error is just given in two levels instead of three. Schematic of the Fuzzy Logic DTC.8 . 3. The second way corresponds to the adaptive controller thought to track the reference values. Finally this new controller will give a duty ratio value. In dashed line is separated the novel fuzzy controller part. The first way is through the FLC1 (Fuzzy Logic controller 1). there is a novel part that corresponds to the novel Fuzzy Logic controller already described. 3. Flux ref + - Table T ref + - δ VSI induction motor wm 2T + w T + 2w FLC 1 δ' δ ∆δ + DT z -1 + - FLC 2 + z -1 z -1 model Figure 3. This way will be the least used.Fuzzy Logic Direct Torque Control.2.11. the computation capability of the real system won't be necessarily that much. that the schematic in figure 3.2. being discharged the null states. Obviously. which will be added to the previous duty ratio value. The full system will work first as the classical DTC obtaining the active state through the classical table. However. including the motor model. Then the fuzzy controller will give the duty ratio. stator flux modulus values and its position.

Fuzzy Logic Direct Torque Control.

3.2.4 - Stator Flux Reference Optimum Controller. As it has been explained in the previous sections, the ripples in the electromagnetic torque and stator flux are extremely reduced by using controllers based on Fuzzy Logic systems or predictive methods. However, in order to obtain even a better reduction, stator flux reference value has to be adapted to an optimum value, which should be just large enough to produce the desired torque. The reason is that with this optimum value both the increase in the active state is just large enough and the slight reduction in the null states is lower. Moreover, it is achieved a reduction in the reactive power consumption taken from the mains supply. The optimum expression, which gives the just large enough stator flux for the desired torque is given in equation 2.23 from section 2.3.5. In figure 3.12 can be seen the final Fuzzy Logic DTC schema with the stator flux reference optimum controller. Notice how the optimum stator flux value is calculated from the torque set point value.
optimum flux T ref
+

-

Table
+ -

δ

VSI

induction motor
wm

2T + w T+ 2w

FLC 1 z -1
+ -

δ' δ ∆δ
+

DT

FLC 2

+

z -1

z -1

model

Figure 3.12. Flux reference optimised controller in a Fuzzy Logic DTC.

3.9

Fuzzy Logic Direct Torque Control.

3.3 - Simulated results.

It is shown the simulation results per different working points, comparing the classical DTC and the Fuzzy Logic DTC (FLDTC). More simulations than the ones shown have been done, and the obtained results have been summarised in table III.I and table III.II. In all simulations presented, it can be observed a much better behaviour of the FLDTC performance, achieving one of the main objectives of the present work, which was to reduce the torque ripple and consequently improve the motor performance. A good adaptation of the FLC to any motor is proved since the simulation results are done for two different motors, achieving in both cases a good response. These motors are the "motor_1kW" and "motor_1.5kW". (All motors' details can be found in chapter 4). An index error has been used to quantify the error in both the stator flux and torque responses. This index is the integral of the square error (IE2), which is computed by means of the square error instead of just the error; therefore, the more error is produced the more emphasis it is given in the index. All simulations have been realised with an ideal induction motor drive with no delays and the sampling time (Tz) has been fixed to 100µs.

3.10

Fuzzy Logic Direct Torque Control.

16 flux x 5 (Wb) 14 12 10 8 6 4 2 0 -2 0

wm
flux x 5 (Wb)

16 14 12

wm

T*

T

T*
10 8 6 4 2 0 -2 0 IE2 T=0.738 0.02 0.04 time (s)

T

speed/10 (rd/s) torque (Nm)

ψ∗

ψ

speed/10 (rd/s) torque (Nm)

ψ∗

ψ

IE2 T =0.380 0.02 0.04 time (s) 0.06

IE2 ψ=2.49e-3 0.08 0.1

IE2 ψ =2.57e-3 0.08 0.1

0.06

Figure 3.13 A. Stator flux, torque and speed motor_1.5kW responses in Fuzzy Logic DTC (left) and classical DTC (right). T=100%Tn . w m=100%wmn . Notice the IE2 flux and torque error indexes values.

flux x 10 (Wb)

flux x 10 (Wb)

16 14 12 10 8 6 4 2 0

wm

16 14 12 10

wm

ψ∗

ψ

ψ∗

ψ

speed/10 (rd/s) torque (Nm)

speed/10 (rd/s) torque (Nm)

8 6 4 2 0
IE2 T=0.297 IE2 ψ =2.46e-3

T*

T

T*

T

IE2 T =0.251

IE2 ψ =2.55e-3

-2 0

0.02

0.04
time (s)

0.06

0.08

0.1

-2 0

0.02

0.04
time (s)

0.06

0.08

0.1

Figure 3.13 B. Stator flux, torque and speed motor_1kW responses in Fuzzy Logic DTC (left) and classical DTC (right). T=100%Tn . w m=100%wmn . Notice the IE2 flux and torque error indexes values.

3.11

Fuzzy Logic Direct Torque Control.

16 flux x 10 (Wb) 14 12 10 8 6 4 2 0 -2 0

16

flux x 10 (Wb)

wm

14 12 10 8

wm ψ∗ ψ

speed (rd/s) torque (Nm)

speed (rd/s) torque (Nm)

6 4 2 0 -2 -4 0 0.02 IE2 T=0.160 0.04 time (s) 0.06 IE2 ψ =6.46e-3 0.08 0.1

T*

T

ψ∗ T*
IE2 T=0.002 0.02 0.04 time (s)

ψ T
IE2 ψ =0.14e-3 0.06 0.08 0.1

Figure 3.14 A. Stator flux, torque and speed motor_1.5kW responses in Fuzzy Logic DTC (left) and classical DTC (right). T=10%Tn . wm=10%wmn . Notice the IE2 flux and torque error indexes values.

10
flux x 10 (Wb) flux x 10 (Wb)

10 8 6
IE2 T=0.0367 IE2 ψ =7.46e-3

8 6

ψ∗

ψ

speed/10 (rd/s) torque (Nm)

speed/10 (rd/s) torque (Nm)

IE2T =1.35e-3

IE2 ψ=0.14e-3

4 2 0

ψ∗ wm T*

ψ

4

T*
2 0 -2 0

T

wm

T

-2 0

0.02

0.04
time (s)

0.06

0.08

0.1

0.02

0.04
time (s)

0.06

0.08

0.1

Figure 3.14 B. Stator flux, torque and speed motor_1kW responses in Fuzzy Logic DTC (left) and classical DTC (right). T=10%Tn . wm=10%wmn . Notice the IE2 flux and torque error indexes values.

3.12

Fuzzy Logic Direct Torque Control.

16 14 flux x 5 (Wb) 12 10 8 6 4 2 0 -2 0 IE2 T=0.304 IE2 ψ =3.14e-3

16

wm
flux x 5 (Wb)

wm T* T

14 12 10 8 6 4 2 0 -2 0 IE2 T =0.418 IE2 ψ=2.88e-3 0.06 0.08 0.1

T*

T

speed (rd/s) torque (Nm)

ψ∗

ψ

speed (rd/s) torque (Nm)

ψ∗

ψ

0.02

0.04 time (s)

0.06

0.08

0.1

0.02

0.04 time (s)

Figure 3.15 A. Stator flux, torque and speed motor_1.5kW responses in Fuzzy Logic DTC (left) and classical DTC (right). T=100%Tn . w m=10%wmn . Notice the IE2 flux and torque error indexes values.

10
flux x 10 (Wb) flux x 10 (Wb)

10

9 8 7 6 5 4 3 2 1 0 0 0.02

ψ∗

ψ

9 8 7 6 5 4 3 2 1 0 0 0.02

ψ∗

ψ

speed/10 (rd/s) torque (Nm)

T*

T

speed/10 (rd/s) torque (Nm)

T*

T

wm
IE2 T=0.169 IE2 ψ =2.74e-3

wm
IE2 T=0.189 IE2 ψ =2.53e-3

0.04
time (s)

0.06

0.08

0.1

0.04
time (s)

0.06

0.08

0.1

Figure 3.15 B. Stator flux, torque and speed motor_1kW responses in Fuzzy Logic DTC (left) and classical DTC (right). T=100%Tn . w m=10%wmn . Notice the IE2 flux and torque error indexes values.

3.13

Fuzzy Logic Direct Torque Control.

10 9 flux x 10 (Wb) 8 7 6 speed/10 (rd/s) torque (Nm) 5

10 9

wm ψ∗ ψ

flux x 10 (Wb)

ψ∗

ψ wm

8 7 6

T*

T

speed/10 (rd/s) torque (Nm)

5 4 3 2 1 0 0 0.02 IE2 T=0.224 0.04 time (s) 0.06 IE2 ψ =3.08e-3 0.08 0.1

T*
4 3 2 1 0 0 0.02 IE2 T=0.060

T

IE2 ψ =0.882e-3

0.04

time (s)

0.06

0.08

0.1

Figure 3.16 A. Stator flux, torque and speed motor_1.5kW responses in Fuzzy Logic DTC (left) and classical DTC (right). T=50%Tn . wm=50%wmn . Notice the IE2 flux and torque error indexes values.

10
flux x 10 (Wb)

10
flux x 10 (Wb)

9 8 7 6 5 4 3 2 1 0 0 0.02 0.04
IE2 T=0.033 IE2 ψ=0.88e-3

9 8 7 6 5 4 3 2 1 0 0 0.02
IE2 T=0.068

ψ∗ wm

ψ

wm ψ∗ ψ

speed/10 (rd/s) torque (Nm)

speed/10 (rd/s) torque (Nm)

T*

T

T*

T

IE2 ψ =2.57e-3

time (s)

0.06

0.08

0.1

0.04
time (s)

0.06

0.08

0.1

Figure 3.16 B. Stator flux, torque and speed motor_1kW responses in Fuzzy Logic DTC (left) and classical DTC (right). T=50%Tn . wm=50%wmn . Notice the IE2 flux and torque error indexes values.

3.14

and no delays have been considered. the simulations correspond to two different motors being proved the validity of the FLDTC for any motor. Therefore. The smaller the torque set point is the smaller flux FLDTC IE2 value is. Simulation results show the validity of the FLDTC method not only achieving a considerable reduction in torque ripple. this thesis is focused on introducing a modulation in the DTC. 3.I is shown the error value index (IE2) obtained in the simulations per different working points for the motor_1. Therefore. both flux error indexes are pretty similar. The reason is that the stator flux ripple is reduced by means of the stator flux reference optimum controller introduced in section 2. there are just a few exceptions when the torque set point is near to the nominal one. 3.II is shown the error value index (IE2) obtained in the simulations per different working points for the motor_1kW. thus the FLDTC is a good control method for any motor. However. which together with the DTC will create the Fuzzy Logic DTC.15 . Moreover. it can be concluded: § § IE2 in torque is always smaller in FLDTC than in classical DTC. but also reducing the reactive power consumption taken from the mains supply.5kW.4 .I and III. Simulated results corroborate all the presented work. In both motors the results are pretty similar. In table III. Under these circumstances. A Fuzzy Logic controller controls this modulation. From the tables III. it has been suggested and deeply described the Fuzzy Logic controller. IE2 in flux is nearly always smaller in FLDTC than in classical DTC. improving even more the whole FLDTC.5. the validity of FLDTC is corroborated.II. the first conclusion is that the Fuzzy Logic controller works properly in any motor. between the selected active state and a null one.Interim conclusions. In table III. Therefore. The Fuzzy Logic controller designed is adaptive.3.3.Fuzzy Logic Direct Torque Control. After all the research done in section 2. It has been used just one switching period (100µs) in all simulations. that always works but when the torque set point is near to the nominal value.

171 c_DTC Flux Torque 2.I: Error index values (IE2) obtained form the motor_1. 3.033 0.068 7.55e-3 0.16093 2.383 Table III.499 2.74e-3 0.46e-3 0.61e-3 0.86e-3 0.46e-3 0.53e-3 0.297 Table III.16 .2557 2.Fuzzy Logic Direct Torque Control.1494e-3 0.4184 3.06832 75% 75% 1.II: Error index values (IE2) obtained form the motor_1kW simulations per different working points.06047 10% 10% 0.46e-3 0. not only for the torque error values but also for the stator flux ones.60e-3 0.169 0.88e-3 0.30441 50% 50% 0.322 50% 100% 0.14e-3 0.189 2.3806 100% 50% 2.49e-3 0. A comparison between the classical DTC and the Fuzzy Logic DTC is done.57e-3 0.88e-3 0.002641 100% 100% 2.08e-3 0.5kW simulations per different working points. not only for the torque error values but also for the stator flux ones.14e-3 0.57e-3 0. IE2 FLDTC Tpc Wpc Flux Torque 100% 10% 3.7385 2.635e-3 0.00135 2.0367 2.2248 6. IE2 Tpc Wpc 100% 10% 50% 50% 10% 10% 100% 100% FLDTC Flux Torque 2.61e-3 0.61e-3 0. A comparison between the classical DTC and the Fuzzy Logic DTC is done.251 c_DTC Flux Torque 2.882e-3 0.

a drive system has been firstly design and then used. Also. 4. Also. DESIGN of EXPERIMENTAL INDUCTION MOTOR DRIVE SYSTEM. Next chapter deals with the implementation of both versions of Direct Torque Control. 4.CHAPTER 4. In previous chapters it has been introduced the theoretical study of both the DTC and the FLDTC. (All programs are listed in section A2). the present chapter deals with the program tools and the organisation of the different tasks. This chapter is focused on the architecture of the full drive system and the motor workbench.Introduction.1 .1 . being entirely described in detail its main features. these studies have been verified by means of simulations. Previously.

A brief description of the real implemented programs and its main routines are explained.Design of experimental induction motor drive system. which have been realised taking into account the real drive with all its delays and the finally used sampling period (166µs). some DTC and FLDTC real simulations. Finally.2 . are shown. 4.

1. This is the other processor that executes program code as well.1 shows the workbench.3 .2 . § Voltage Source Inverter based on Isolated Gate Bipolar Transistors. It is one of the processors that execute most of the programs of the control algorithm. Experimental workbench. This device supplies the induction motor generating a three phase voltage with variable both frequency and 4. All the system drive has been specially developed not only for this thesis but also for any implementation of further research in the topic of motor drives. These two boards make possible and easier the communication between the induction motor drive and the DSP based processor system [LSI 1] [LSI 2] [LSI 3]. this workstation is supposed to be very versatile as well as powerful [BED 2] [BED 3]. § Personal Computer (PC). Communications between the drive and the PC/DSP are solved by means of 32 digital I/O lines and 4 ADC. not only due to the fact that it has inside all the DSP based boards. being its sampling frequency 50kHz. Its processors are PC and DSP.Induction motor drive architecture. keeping all the reference values and results in its memory. but also because it allows the edition and compilation of DSP and PC programs.Design of experimental induction motor drive system. The experimental workbench is formed by the following described elements: § Digital Signal Processor (DSP) TMS320C32. which has been fully set up for the present thesis. PC/C32 ISA DPRAM ( 1K X 32 ) PC MEMORY INTERFACE DAUGTHER MODULE (A/D 4X16) PC CONTROL AND STATUS REGISTERS PC I/O INTERFACE DSP TMS320C32 Tl DSP LINK PORT wm ISA DIO 32 8bits VSI induction motor DC generator DT Figure 4. Therefore. DC generator is used as a load. It has got a self called "daughter module" that is composed by four analogue to digital converters of 16 bits. It works as a host. 4. Figure 4. The processor has got as well an input/output board TTL of 32 bits.

over temperature.Design of experimental induction motor drive system. Its main characteristics are its power that is 25kW and its maximum current 50A.46 N·m 4.006 kg·m2 In this section is being presented the values per phase obtained performing both no load and locked rotor tests for the "T" induction steady state model. over DC link voltage.75 TSTART = 2.6 W Nominal angular speed: ωmn = 1420 r. Stator resistance: R1 = 7.4 .7 N·m Shaft angular speed: ωmn = 1378.m. § Three-phase Induction motor_1kW.7A Nominal mechanical power: Pn = 1.05 A Start torque: TSTART = 12.p.8A Delta: 220V/4.35 CV = 993. = 144.2 Tnom TMAX = 2.p.0301 H Maximum and nominal values calculated using the identified parameters: Nominal torque: Tn = 6.6 rd/s Pair of poles: P = 2 Efficency = 72% cos(φ) = 0.6040 H Leakage inductance: L1 = L2 = 0. = 148.35 rd/s Nominal slip: s = 8.4 Tnom Inertia moment: J = 0.18 Ω Magnetising inductance: Lm = 0.1·10-2 RMS nominal magnetising current: Imn = 1. and IGBT saturation. amplitude. Its main characteristics are as follows: Star: 380V/2. This machine was used for all the simulated results. It can be supplied in either 220 V or 380 V. There are the necessary protections such as current limit.m.13 Ω Rotor resistance: R2 = 8.4 r.

8 In this section is being presented the values per phase obtained performing both no load and locked rotor tests for the "T" steady state induction motor model.5 .9% cos(φ) = 0.87 A § Three-phase Induction motor_1. Therefore.p. Its main characteristics are as follows: Star: 380V / 3. This motor is mechanically jointed to the DC servomotor.3 Ω Rotor resistance: R2 = 5.) Maximum slip speed: sωsMAX = 135. changing the load torque to the Induction motor.5kW.94 r. Stator resistance: R1 = 4.05 Ω Magnetising inductance: Lm = 0.p. = 146.p.67·10-2 § Permanent magnet DC servomotor.m.3056 H Leakage inductance: L1 = L2 = 0. Its function is to act as a mechanical load.62 rd/s Nominal slip: s = 6. This machine not only has been used in all the simulation results but also in the experimental ones. Its main characteristics are as follows: Manufacturer: Control Techniques.8 rd/s Pair of poles: P = 2 Efficency = 76.9 Nm Shaft angular speed: ωmn = 1400 r. = 151. Maximum torque: TMAX = 16 N·m (at ωmMAX = 851.0146 H Maximum and nominal values calculated using the identified parameters: Nominal torque: Tn = 9. Its shaft is mechanically jointed to the Induction motor's one.Design of experimental induction motor drive system. all the control strategies have been proved in this machine.5kW Nominal angular speed: ωmn = 1450 r.m.5A Delta: 220V / 6A Nominal mechanical power: Pn = 1.m.73 rad/s RMS maximum stator current: I1 = 6. 4.

0444 N1S 0. Armature voltage: 200V. Maximum stable armature current: 20A. Thermal time constant: 80minutes. Induced armature voltage: 57V/Krpm. These circuits adapt the motor currents and the speed signals to the Analogue to Digital converters. Type: Matador DCM 9B 30/20. Maximum angular speed: 10000rpm. It is together with the DC motor. Type of isolation: F (100o C temperature increment ).18A. Maximum speed: 3000rpm. 4.06V/rpm Maximum current: 0. Its main characteristics are as follows: Manufacturer: Radio-Energie. Dynamometer.3mH.55Nm/A( for ωm = 0 rd/s). Maximum stable torque: 11Nm. Number of poles: 4. § Adaptive Signal Board. Rotor inertia: 10⋅10-3 kgm2 . Armature inductance: 2. Torque constant at 25 o C: 0.06 EG Induced voltage: 0. The third one gives one impulse each turn. These resistances are electrically connected to the DC Generator absorbing different currents and consequently changing the load torque. It gives a voltage proportional to the shaft speed. There are some filters in order to reduce the noise keeping its delay as small as possible [LSI 3]. Weight: 22kg § § Power Resistances. Model: RE.Design of experimental induction motor drive system. It supplies three signals and its complementary ones. Maximum peak armature current: 90A. Armature resistance (at 25 o C): 0.6 .31W. Two of them are a square signals with one quarter of period delay. § Encoder.

7 . which is a Dual Port Random Access Memory.Design of experimental induction motor drive system. One processor can interrupt the other. Both processors can perform the programs independently. The PC can monitor the DSP by means of the interface based in the ISA bus.1) allows the implementation of complex algorithms and the modular programming of the system being possible to change one processor program keeping the other. [LSI 1] 4. The system architecture based on two processors (see figure 4. exchanging the data by means of a DPRAM.

Task distribution. The DSP performs the rest of the tasks controlling the real time. 4. Therefore. have been programmed in assembler. The rest of the tasks are performed by the DSP.1 . the computation capability of the real system won't be necessarily that much. many tasks were changed and proved without modifying the others. which its execution time was critical. Figure 4.Implementing DTC and FLDTC. which is partially performed by the PC. Flux ref + - Selection Table δ VSI induction motor wm T ref + - 2T + w FLC 1 T + 2w δ' δ DT + - FLC 2 ∆δ + z -1 + z -1 motor model Figure 4. As it has been said previously. Schematic of the Fuzzy logic DTC.Programming the system. 4.2. Also. 4.2 . The PC performs some of these blocks. the system architecture allows the system to be reprogrammed easily. In dashed line is separated the novel fuzzy controller part. All the tasks. just one fuzzy controller is used per iteration. The DSP has been programmed using both C language and assembler.2 shows the full schematic of the FLDTC. All blocks inside the dashed line are the ones corresponding to the fuzzy logic controllers.3 .3.8 . which are mainly the DTC itself including the motor model and the consequent control of the real time. Therefore.3. 4.Design of experimental induction motor drive system. tasks that configure the DSP hardware and interfaces have been programmed in assembler. It should be clear that despite the fact that there are two fuzzy logic controllers.

Because some parts of this controller are executed in the PC. the DSP waits until they are finished obtaining the duty cycle. the first idea that must be taken into account is the delay due to the non ideal behaviour of the whole system. the timer is programmed. The ADC sampling frequency has been set to 20kHz. shown in figure 4. due to the fact that its tasks are not critical regarding time [MAT 1].Design of experimental induction motor drive system. once the active new state is sent. Once the duty cycle is obtained. mainly due to the FLC. In the FLDTC the timing. [TII 2] [TII 3] [TII 4]. some differences are present. Then. Therefore. there is a total delay of 80 µs from the sampled data to the action of sending the new VSI state.3. The most significant delays are introduced by the Analogue to Digital Converter (ADC) and the control algorithm. However. PC has been programmed in C language.Timing of the real implementation. These three routines are firstly attending the ADC interruption processing all the data. being the period 50µs. is pretty similar to the classical DTC.3. sample i save data i+1 ADC Est DTC send 50us 30us 166us Figure 4. already shown in figure 4. The compiler allows mixed C and assembler code. In the c_DTC. Finally the data is saved in order to obtain the experimental results.4.9 .3 .3. secondly the estimation of the torque and flux values and finally the DTC itself. There is a delay of 80µs from the sampled data until the active state is sent. The real time is performed by the DSP. The DTC is executed each 166µs. All these routines take around 30µs to be executed. 4.3. the control algorithm is divided into three routines. the FLC starts being executed. Once the real system is implemented. All this process takes 50µs. DTC timing. The DTC and the FLDTC close the loop each 166µs. 4. as it can be seen in figure 4.

not all the duty cycles are possible.3 and 4. FLDTC timing. any duty cycle. being the minimum duty cycle 50% and the maximum 100%. Seeing figures 4.4 the idea that both systems have the same delays in order to validate the comparison should be clear.Design of experimental induction motor drive system. Therefore. 4. is ignored. There is a delay of 80µs from the sampled data until the active state is sent.10 . sample i i+1 ADC Est DTC send FLC save data 50us wait ρ timer 50us 30us 166us Figure 4. which needs to change the active state before this time. The Fuzzy Logic Controller needs 50µs to be calculated.4 . The FLDTC is executed each 166µs. Therefore.

Design of experimental induction motor drive system.

4.4 - Simulation of the real plant.

As it has been said in section 4.3.3, there are some limitations in the real plant. These limitations were not taken into account in the whole theoretical study realised in chapter 3. These limitations can be summarised as follows: § § § § The sample time can not be as small as wanted. In the real plant it is 166µs. There is a delay of 30µs due to the software time execution. There is a delay of 50µs in the worst case due to the Analogue to digital conversion. The duty cycle values are limited due to the delay in the FLC execution. The real values are in the range of 50% up to 100%. First three limitations are taken into account into the real simulation. It will be considered that its effect is similar to having a sample time of 166µs+30µs+50µs, being equal to 246µs. Therefore, the torque ripple is higher; in concrete is 246/100 times higher; that is to say 2.46. All magnitudes related to the torque ripple should be pre scaled according to this factor. Therefore, 2.46 will divide all torque error FLC inputs and the torque hysteresis value will be 2.46 times bigger. Simulations shown from figure 4.5 to 4.9 are done under these real conditions. All them should be compared with the experimental results obtained in chapter 5.
15 flux x (-1) (Wb) 15

T*
10

T
flux x (-1) (Wb) 10

T*

T

5 speed/(-10) (rd/s) torque (Nm)

5

speed/(-10) (rd/s) torque (Nm)

0

0

ψ∗
-5

ψ

ψ∗
-5

ψ

-10

wm

-10

wm

-15 0

0.01

0.02 time (s)

0.03

0.04

0.05

-15 0

0.01

0.02 time (s)

0.03

0.04

0.05

Figure 4.5. Stator flux, torque and speed motor_1.5kW responses in Fuzzy Logic DTC (left) and classical DTC (right). Torque reference value is 9.8Nm, i.e. T=100%Tn . Torque load is being fixed by connecting a 4 ohms resistor to the DC generator. All real system limitations are taken into account.

4.11

Design of experimental induction motor drive system.
10 flux x (-1) (Wb) 8 6 4 2 0 -2 -4 -6 -8 -10 0 flux x (-1) (Wb) 10

T*

T

8 6 4 2 0 -2 -4 -6 -8 -10 0

T*

T

speed/(-10) (rd/s) torque (Nm)

ψ∗

ψ

speed/(-10) (rd/s) torque (Nm)

ψ∗ wm

ψ

wm
0.01 0.02 time (s) 0.03 0.04 0.05

0.01

0.02 time (s)

0.03

0.04

0.05

Figure 4.6. Stator flux, torque and speed motor_1.5kW responses in Fuzzy Logic DTC (left) and classical DTC (right). Torque reference value is 4.9Nm, i.e. T=50%Tn . Torque load is being fixed by connecting a 4 ohms resistor to the DC generator. All real system limitations are taken into account.

8 flux x (-1) (Wb) flux x (-1) (Wb)

8

T*
6

T

6

T*

T

4

4

speed/(-10) (rd/s) torque (Nm)

2

speed/(-10) (rd/s) torque (Nm)

2

0

0

ψ∗
-2

ψ

-2

-4

wm

-4

ψ∗
-6 0.05 0.06 0.07

ψ

wm
0.08 0.09 0.1

-6 0

0.01

0.02 time (s)

0.03

0.04

0.05

time (s)

Figure 4.7. Stator flux, torque and speed motor_1.5kW responses in Fuzzy Logic DTC (left) and classical DTC (right). Torque reference value is 2.45Nm, i.e. T=25%Tn . Torque load is being fixed by connecting a 4 ohms resistor to the DC generator. All real system limitations are taken into account.

From now on, all real simulations and all experimental results are just done or obtained from motor_1.5kW. From figures 4.5, 4.6 and 4.7 can be concluded that the FLDTC is still working better than the classical DTC. Therefore, it is proved that the FLC can be adapted to any plant with its own characteristics and limitations, keeping its good performance. However, due to the limitations of the real system, both systems work worse when comparing these results with the one obtained in section 3.3.

4.12

Design of experimental induction motor drive system.
10

ψ sD (Wb) ψ sQ (Wb) ψ (Wb)

isD
8 6 4 2 0 -2 -4 -6 -8 -10 0.02

isQ

ψsD

ψsQ

ψ

isD

(A)

isQ

(A)

0.04

0.06

0.1

0.12

0.14

time (s)

Figure 4.8 . D and Q current components. D and Q flux components and its module. All magnitudes correspond to the simulation realised in figure 4.6 right. That is to say, classical DTC, Torque reference value 4.9Nm, i.e. T=50%Tn .

1.5

ψsD

ψsQ

ψ

1

ψ sD (Wb) ψ sQ (Wb) ψ (Wb)

0.5

0

-0.5

-1

-1.5

0

0.02

0.04

0.06

0.1

0.12

0.14

0.16

time (s)

Figure 4.9. Figure 4.8 vertical zoom. D and Q stator flux components and its modulus value. Notice how once one component is zero, the other is equal to the modulus

4.13

the system is capable of acquiring external signals and of generating digital outputs signals [BED 2] [BED 3]. This architecture solves the data exchange between processors and allows the experimentation of an AC motor control system with two processors that can execute two different programs in parallel.Design of experimental induction motor drive system.14 . It has been presented a parallel processing architecture with two processors (PC. which gives a high immunity to conducted and radiated interference. DSP) running simultaneously. It has been suggested a way to overcome the mentioned limitations keeping the proper performance of the system. The DSP is based in the PC ISA bus. This chapter has summarised the development of the equipment used for the experimental three phase induction motor drive.5 .Interim conclusions. 4. Simulated results are shown to validate the work. because the changes in one processor program do not affect to the other. it has been pointed out the main problems due to the limitations of the real systems. Finally. Also. 4. Reprogramming the system is considered to be one of the advantages of the system.

5kW. 5. 5.3Nm. 5. Flux hysteresis value =0.1. Torque hysteresis value = 1.CHAPTER 5. Sample time = Ts = Tz = 166µs. the reference values were as follows: § § § Torque reference value = 4. In all cases.Corroborating the real implementation.1 . EXPERIMENTAL RESULTS.15Wb.9Nm. All graphics try to show the correct behaviour of the classical DTC.05Wb.1 .Classical DTC. Flux reference value = 1. All graphics of the present chapter correspond to the experimental results obtained from the real plant just using the induction motor_1.1 .

Electromagnetic torque plus 10Nm. 5. D and Q flux components and its module.2 should be compared with its simulated equivalent in figure 4. D and Q current components. 10 8 6 4 2 0 -2 -4 -6 -8 -10 0 i sD i sQ ψsD ψsQ ψ isD (A) isQ (A) ψ sD (Wb) ψ sQ (Wb) ψ (Wb) 100 200 300 400 500 600 700 800 900 n x Ts. Figure 5. Ts=166us Figure 5.8. D and Q current components. Ts=166us Figure 5.2.2 .Experimental results i sD 20 isQ T torque + 10 (Nm) sQ (A) i 15 10 5 0 is D (A) -5 -10 0 100 200 300 400 500 600 700 800 900 n x Ts. It can be said that the simulation matches perfectly with the experimentation.1.

5 -1 -0.5 ψ sD (Wb) Figure 5. 1.5 ψ sQ (Wb) 0 -0. D and Q stator flux components and its modulus value.Experimental results Figure 5. the other is equal to the modulus.3 should be compared with its simulated equivalent in figure 4.4. Figure 5.9. 5.5 0 -0.5 0 0.5 1 0.3.5 -1. Again the simulated results are equal to the experimental ones. Stator flux.5 0 50 100 150 200 250 n x Ts. Notice how once one component is zero. Ts=166us Figure 5.5 ψsD ψsQ ψ ψ sD (Wb) ψ sQ (Wb) ψ (Wb) 1 0.5 -1 -1.5 1 1.2 horizontal zoom of the samples 300 to 550. Notice how it follows a circular shape. 1.5 -1 -1.3 .

Moreover.6. Flux sector. modulus and hysteresis limits.Experimental results ψsD 2 ψsQ state ψ ψ−hst sect ψ+hst T_e ψ_e (Wb) flux_hst_error torque_hst_error 1 0 sector*(-1) state*(-1) -1 -2 -3 -4 -5 -6 ψ 0 50 100 150 200 250 300 350 400 n x Ts. which are flux and torque errors signals and flux sector. Figure 5. Selected state and all the inputs in its look up table.4 . ψs D 2 1 state*(-1) 0 -1 -2 -3 -4 -5 -6 ψs Q state ψ ψ−hst sect ψ+hst T_e ψ_e (Wb) flux_hst_error torque_hst_error ψ sector*(-1) 0 10 20 30 40 50 60 n x Ts.5 horizontal zoom of the samples 0 to100. Q. it is shown D.5 Flux and torque errors signals. all magnitudes for the stator flux. 5. Ts=166us 70 80 90 100 Figure 5. Ts=166us Figure 5.

(Wb) 5. in the third sample the look up table inputs are: torque increase. Ts=166us 7 8 9 10 ψ +hst ψ−hst ψ_e T_e ψ Figure 5. It can be deduced the correct behaviour of the look up table according to its inputs. ψ 2 flux_hst_error torque_hst_error 1. For instance.4 0. It is shown the correct behaviour of flux hysteresis error value.6 1. once the modulus decreases under the negative hysteresis value.8 0.2 1 0. flux decrease and first sector.Experimental results ψsD 2 1 flux_hst_error torque_hst_error 0 -1 -2 -3 -4 -5 -6 ψsQ state ψ ψ−hst sect ψ+hst ψ_e T_e ψ 1 (Wb) sector*(-1) state*(-1) 2 3 4 5 6 7 8 9 10 n x Ts. Figure 5.5 . the selected sate is the third.4 1.7 vertical zoom. Therefore.2 0 1 2 3 4 5 6 n x Ts.6 horizontal zoom of the samples 0 to10. Figure 5. from samples 4 to 5. For example.8 1.7.8. Ts=166us Figure 5.6 0. its error value changes from 0 to 1.

Figure 5. all look up table inputs (being flux and torque errors signals and flux sector) and torque value plus 5 and its hysteresis limits plus 5.10. Of course.6 .Experimental results T T-hst T+hst T_e ψ_e state sect 15 torque+5 (Nm) flux_hst_error torque_hst_error sector*(-1) state*(-1) 10 5 0 -5 -10 0 50 100 150 200 250 300 350 400 n x Ts. T T-hst T+hst T_e ψ _e state sect 14 torque+5 (Nm) flux_hst_error torque_hst_error sector*(-1) state*(-1) 12 10 8 6 4 2 0 -2 -4 -6 1 2 3 4 5 6 n x Ts. all selected states are the correct ones. For example. Selected state. Ts=166us Figure 5.9. changing from 2 to 1 and finally to 0 the torque hysteresis error values. Ts=166us 7 8 9 10 Figure 5. from samples 2 to 4 the torque increases crossing both hysteresis limits. It can be deduced the correct behaviour of the look up table according to its inputs and the torque hysteresis error signal.9 horizontal zoom of the samples 20 to 30. 5.

Considering that the flux modulus is 1. If it is considered the particular moment that the Q flux component is equal to zero. Left: figure 5.Experimental results Figures 5. 5.15. Q flux and current components and torque value.11.12.11 horizontal zoom of the samples 20 to 30. T = P ⋅ c ⋅ (ψ sD ⋅ i sQ − ψ sQ ⋅ i sD ) ≅ 1.1) ψs D ψs Q T is Q isD (A) i sQ (A) ψ sD (Wb) ψ sQ (Wb) Figure 5. i sD torque (Nm) 8 7 6 5 4 3 2 1 0 -1 -2 1 isQ ψsD ψsQ T isD torque (Nm) 8 6 4 (Wb) 2 0 (Wb) -2 -4 isQ ψsD ψsQ T sQ (Wb) ψ sD (Wb) i sD (A) i sQ (A) ψ i sD (A) i sQ (A) ψ sD 2 3 4 6 n x5 Ts.12 are shown in order to justify the validity of the torque values. Ts=166us 7 8 9 10 ψ -6 -8 1 sQ 2 3 4 5 6 7 n x Ts.6 ⋅ ψ sD ⋅ i sQ is D torque (Nm) 10 8 6 4 2 0 -2 -4 -6 -8 -10 0 50 100 150 200 n x Ts. D. the torque value is 1.11 horizontal zoom of the samples 205 to 215. Therefore.6 times the product of D flux component and Q current component.7 . Ts=166us 8 9 10 Figure 5. In both cases Q flux component tends to zero. then the torque expression is simplified as it is shown in equation 5. the torque value is equal to 1. Ts=166us 250 300 (5. Right: figure 5.84 the Q current component.11 and 5.1.

the reference values were as follows: Torque reference value = 1.13. Notice how during almost all sectors the active selected state is almost always the same.Experimental results 5. In all cases. All graphics show the correct behaviour of the FLDTC.9Nm.23.2 . All graphics of the present chapter correspond to the experimental results obtained from the real plant. This graphic shows the excellent behaviour FLDTC.3Nm Flux hysteresis value = 0. The flux reference value is the optimum one obtained from equation 2. Torque hysteresis value = 1.05Wb Sample time = Ts = Tz = 166µs.8 .1. Ts=166us Figure 5. 5. T EQ δ state sect 4 3 torque (Nm) equal duty_cycle sector*(-1) state*(-1) 2 1 0 -1 -2 -3 -4 -5 -6 0 50 100 150 200 250 300 n x Ts.Fuzzy Logic DTC. keeping the torque ripple into a good value.

The sector is always the third and the selected state is the fourth except in the sample nine being the second. Ts=166us Figure 5. It is shown the excellent behaviour of the adaptive FLC. Once the selected state changes. T EQ δ 2 torque (Nm) equal duty_cycle 1. Ts=166us Figure 5. 5. modulating the duty cycle value in order to keep the torque among its reference value.Experimental results 4 T EQ δ state sect torque (Nm) equal duty_cycle sector*(-1) state*(-1) 3 2 1 0 -1 -2 -3 -4 0 2 4 6 8 10 12 14 16 18 20 n x Ts. Figure 5.14.5 1 0.5 1 2 3 4 5 6 7 8 9 10 n x Ts. the equal value changes from one to zero switching the FLC from the adaptive to the non-adaptive one. Figure 5.13 horizontal and vertical zoom of the samples 51 to 60.9 .13 horizontal zoom of the samples 35 to 55.15.

When the torque response characteristic for the two drive systems is compared.10 . § § The real system has got an inherent delay of 80µs.16 to 5.3. some simulations were done in section 4. being higher than 50%. These simulated results matches completely with the experimental ones. The torque ripple compared to the simulated results from chapter 3 is much bigger. meanwhile the simulations were done without taking into account any delay. the duty cycle can not take all the possible values. being possible finding a more optimised FLC for the real plant conditions.Experimental results 5. being the resistance values connected to the DC generator equal to 4 ohms and 8 ohms. as it is explain deeper in 4.2 .FLDTC and DTC comparison. the implemented controller was the optimum for 100µs as a sampling time and no delay.4 taking into account all the previously mentioned real limitations.3. Despite the fact that the controller should work properly for any sample time value. This is due to the following different reasons: § Simulations were done with a sample time equal to 100µs.25. 5. meanwhile the real system works at 166µs. § Due to the delays in executing the fuzzy controllers. when comparing the classical DTC drive system with the novel FLDTC drive system. However. Each torque reference value has been applied to two different load conditions. it can be seen that the ripple in the torque characteristics is very much less for the novel FLDTC system than for the classical DTC system for any torque reference value. Results obtained from the reported investigation. are illustrated from figure 5.

It can be said that the simulation matches perfectly with the experimentation due to the fact that the simulated results did take into account all the real limitations. T=100%Tn . Ts=166us 250 300 Figure 5. Torque reference value is 9. 5.8Nm.5kW responses in Fuzzy Logic DTC (left) and classical DTC (right). 15 (-1) (Wb) (-1) (Wb) 15 T* 10 T T* 10 T x flux 5 speed/(-10) (rd/s) torque (Nm) speed/(-10) (rd/s) torque (Nm) flux 5 0 0 x ψ∗ -5 ψ ψ∗ -5 ψ -10 wm -10 wm -15 0 50 100 150 200 n x Ts.5. Load resistance is 4Ω.Experimental results Figure 5.5kW responses in Fuzzy Logic DTC (left) and classical DTC (right). T=100%Tn . Load resistance is 8Ω. i.11 . Ts=166us 250 300 Figure 5.e.16.17.8Nm.e. 15 (-1) (Wb) 15 T* 10 T (-1) (Wb) 10 T* T flux x 5 speed/(-10) (rd/s) torque (Nm) flux x 5 0 ψ∗ ψ speed/(-10) (rd/s) torque (Nm) 0 ψ∗ -5 ψ -5 -10 wm -10 wm -15 0 50 100 150 200 n x Ts. Ts=166us 250 300 -15 0 50 100 150 200 n x Ts. Stator flux. Stator flux.16 should be compared with its simulated equivalent in figure 4. Torque reference value is 9. torque and speed motor_1. i. torque and speed motor_1. Ts=166us 250 300 -15 0 50 100 150 200 n x Ts.

18.19. Ts=166us 250 300 Figure 5. Stator flux. Ts=166us 250 300 -15 0 50 100 150 200 n x Ts. Stator flux.5kW responses in Fuzzy Logic DTC (left) and classical DTC (right).8Nm. T=75%Tn . 5.5kW responses in Fuzzy Logic DTC (left) and classical DTC (right). 15 (-1) (Wb) 15 T* 10 T (-1) (Wb) T* 10 T x flux flux 5 5 speed/(-10) (rd/s) torque (Nm) 0 0 speed/(-10) (rd/s) torque (Nm) x ψ∗ -5 ψ ψ∗ -5 ψ wm wm -10 -10 -15 -15 0 50 100 150 200 n x Ts. Ts=166us 250 300 Figure 5. Load resistance is 4Ω.e.e. Ts=166us 250 300 0 50 100 150 200 n x Ts. Torque reference value is 9. Load resistance is 8Ω. T=75%Tn . torque and speed motor_1. i. Torque reference value is 7. torque and speed motor_1.12 .Experimental results 15 (-1) (Wb) (-1) (Wb) 15 T* 10 T T* 10 T flux x 5 speed/(-10) (rd/s) torque (Nm) flux speed/(-10) (rd/s) torque (Nm) x 5 0 0 ψ∗ -5 ψ ψ∗ -5 ψ -10 -10 wm wm -15 0 50 100 150 200 n x Ts.35Nm. i.

Experimental results

Figure 5.20 should be compared with its simulated equivalent in figure 4.6. Again, the simulated results match perfectly with the experimental ones.

10

10

T*
(-1) (Wb) 8 6 4 2 speed/(-10) (rd/s) torque (Nm) 0 -2 -4 -6

T
(-1) (Wb) 8 6 4 2 speed/(-10) (rd/s) torque (Nm) 0 -2 -4 -6 -8 -10

T*

T

x

flux

ψ∗

ψ

flux

x

ψ∗ wm

ψ

wm
-8 -10

0

50

100

150 200 n x Ts. Ts=166us

250

300

0

50

100

150 200 n x Ts. Ts=166us

250

300

Figure 5.20. Stator flux, torque and speed motor_1.5kW responses in Fuzzy Logic DTC (left) and classical DTC (right). Load resistance is 4Ω. Torque reference value is 4.9Nm, i.e. T=50%Tn .

10 (-1) (Wb) 8 6 4 2 0 -2 -4 -6 -8 -10 (-1) (Wb)

10

T*

T

T*
8 6 4 2 0 -2 -4 -6 -8 -10

T

x

flux

speed/(-10) (rd/s) torque (Nm)

ψ∗

ψ

speed/(-10) (rd/s) torque (Nm)

flux

x

ψ∗

ψ wm

wm

0

50

100

150 200 n x Ts. Ts=166us

250

300

0

50

100

150 200 n x Ts. Ts=166us

250

300

Figure 5.21. Stator flux, torque and speed motor_1.5kW responses in Fuzzy Logic DTC (left) and classical DTC (right). Load resistance is 8Ω. Torque reference value is 4.9Nm, i.e. T=50%Tn .

5.13

Experimental results

Figure 5.22 should be compared with its simulated equivalent in figure 4.7. It can be said that the simulation matches perfectly with the experimentation due to the fact that the simulated results took into account all the non-ideal limitations.

8 (-1) (Wb) (-1) (Wb)

8

T*
6

T

T*

T

6

x

flux

speed/(-10) (rd/s) torque (Nm)

0

speed/(-10) (rd/s) torque (Nm)

2

flux

4

x

4

2

ψ∗
-2

ψ

0

-2

ψ∗

ψ wm

-4

wm

-4

-6

0

50

100

150 200 n x Ts. Ts=166us

250

300

-6

0

50

100

150 200 n x Ts. Ts=166us

250

300

Figure 5.22. Stator flux, torque and speed motor_1.5kW responses in Fuzzy Logic DTC (left) and classical DTC (right). Load resistance is 4Ω. Torque reference value is 2.45Nm, i.e. T=25%Tn .

8 (-1) (Wb) 6 4 2 speed/(-10) (rd/s) torque (Nm) 0 -2 -4 -6 -8

8

T*

T

(-1) (Wb)

T*
6 4 2 0 -2 -4 -6 -8

T

x

flux

ψ∗

ψ

wm

speed/(-10) (rd/s) torque (Nm)

flux

x

wm

ψ∗

ψ

0

50

100

150 200 n x Ts. Ts=166us

250

300

0

50

100

150 200 n x Ts. Ts=166us

250

300

Figure 5.23. Stator flux, torque and speed motor_1.5kW responses in Fuzzy Logic DTC (left) and classical DTC (right). Load resistance is 8Ω. Torque reference value is 2.45Nm, i.e. T=25%Tn .

5.14

Experimental results

8 (-1) (Wb) (-1) (Wb)

8

T*
6

T

6

x

flux

T*
4

T

x

speed/(-10) (rd/s) torque (Nm)

0

speed/(-10) (rd/s) torque (Nm)

2

flux

4

2

0

ψ∗
-2

ψ wm

-2

-4

-4

wm

ψ∗

ψ

-6

0

50

100

150 200 n x Ts. Ts=166us

250

300

-6

0

50

100

150 200 n x Ts. Ts=166us

250

300

Figure 5.24. Stator flux, torque and speed motor_1.5kW responses in Fuzzy Logic DTC (left) and classical DTC (right). Load resistance is 4Ω. Torque reference value is 1.9Nm, i.e. T=19%Tn .

8 (-1) (Wb) (-1) (Wb)

8

T*
6

T

6

T*

T

x

flux

4

flux speed/(-10) (rd/s) torque (Nm)

x

4

speed/(-10) (rd/s) torque (Nm)

2

2

0

0

ψ∗
-2

ψ

-2

wm
-4

-4

wm

ψ∗

ψ

-6 0 50 100 150 200 n x Ts. Ts=166us 250 300

-6 0 50 100 150 200 n x Ts. Ts=166us 250 300

Figure 5.25. Stator flux, torque and speed motor_1.5kW responses in Fuzzy Logic DTC (left) and classical DTC (right). Load resistance is 8Ω. Torque reference value is 1.9Nm, i.e. T=19%Tn .

5.15

the adaptation of the ideal FLC not only to any motor but also to the limitations of the real systems is corroborated. 5. Also. In this chapter. has been experimentally proved by means of the torque.Experimental results 5. Being the first classical DTC and the second the FLDTC. the implementation of two high performance control strategies for three cage rotor induction motors has been described. Experimental results are shown to analyse in detail the correct behaviour of both implementations. which is the torque ripple reduction. both with stator flux and torque estimation. flux and speed real experimental results. All magnitudes evolution are analysed and justified. Moreover.16 .Interim conclusions.3 . the main research point of the present thesis.

FURTHER WORK.1 . 6. Its main principles have been introduced and deeply explained.1 . 6. It is also demonstrated in this thesis that the method of DTC also allows the independent and decoupled control of motor torque and motor stator flux.1 .1. and co-ordinate 6. CONCLUSIONS.Direct Torque Control.CHAPTER 6.Conclusions. Two different estimators for the stator flux and torque have been fully developed. It is also apparent from the investigation reported that DTC strategy is simpler to implement than the flux vector control method because voltage modulators. Direct Torque Control is supposed to be one of the best controllers for driving any induction motor.

being the fundamental ideas for the development of the most suitable Fuzzy Logic Controller. A Fuzzy Logic Controller is in charge of controlling this modulation between the selected active state and a null one.Conclusions. the idea that this fuzzy controller has to be adaptive has been taken into account.1. Four different methods for improving the classical DTC. eliminating one of the DTC advantages.Fuzzy Logic Direct Torque Control. § The second method is the predictive one. which together with the DTC will create the Fuzzy Logic DTC.2 . § Finally. Therefore. this thesis is focused on introducing a modulation in the DTC. is the third method. not only the usage of Space Vector Modulation. improving even further the whole FLDTC. It implies. Further work. It can be concluded that this method is very promising. The FLC designed is adaptive. Therefore. but also the motor operating point. After the research done in this field.2 . this method will be further considered. transformations are not required. some little improvements can be achieved. However. § The application of the Fuzzy Logic for implementing a simple modulation between the selected active state and a null one. it can be concluded that by means of changing the table can not be remarkably improved the DTC performance. Many conclusions have been obtained in this study. After all the research done. the present thesis has been focused on that. which is its simplicity. This method can be applied in any motor drive. 6. being the torque ripple one of the worst. 6. Although. It has been deeply described and justified its way of working. but also the calculation of the proper voltage reference. have been studied and deeply discussed: § The first method is the search of a better look up table. the fourth method is the regulation of the stator flux reference value. Therefore. Moreover. Not only it reduces the torque ripple improving the motor performance. It has been concluded that it is too complicated regarding its real implementation because of its calculus. which is the aim of the thesis. making emphasis on the fact that not only its inputs had to be the torque errors and flux locus. it has been suggested and deeply described the Fuzzy Logic Controller. but also reduces the power reactive consumption taken from the mains supply. it introduces some disadvantages.

Firstly. Further work. DSP boards can be added. proving the adaptation of the FLC to any plant. a PC and a DSP. being a good architecture to avoid any electro magnetic interference. all simulations have been obtained for an ideal generic plant. Communication between both processors is achieved easily through the Dual Port RAM. but also reducing the energy consumption taken from the mains supply.Experimental motor drive system. Therefore the system allows the parallel processing. This architecture is currently quite common in industrial applications. All PC tasks have been programmed in C language. Its main characteristics are as follows: § § The DSP is based in the ISA PC bus. the simulations correspond to two different motors being proved the validity of the FLDTC for any motor. This parallel architecture has the following advantages: § § § § It is a high computational capability system. with sampling time equal to 100µs and no delays.Conclusions. allowing the addition of new algorithms without changing the other ones. 6. Moreover. Once the experimental workbench was set up. Assembler has been used in the critical real time tasks. It allows the possibility of an easy experimentation of new algorithms. New simulated results with the real plant have been obtained and presented. giving the possibility of testing the future real prototypes. It has been set up versatile experimental equipment based on two processors. maintaining its good performance. § The DSP can be easily programmed in both C language and assembler. without interrupting the other. Both processors can access this memory simultaneously.3 . Its program process can be modular. working all them in parallel. Both processors can work independently. Simulation results show the validity of the FLDTC method not only achieving a considerable reduction in torque ripple. its particular parameters of sampling time and delay had been taken into account adapting the FLC.3 . due to the fact that they are not critical regarding the execution time.1. 6.

has been experimentally corroborated. Using the second group of experimental results. Further work. it has been shown the evolution of all magnitudes. It has been proved how the torque ripple is much lower in the FLDTC than in the classical DTC for any working points. In these graphics. allowing the exportation to any computer or workstation. the adaptation of the ideal FLC not only to any motor but also to the limitations of the real system has been corroborated.1. the idea of reducing the torque ripple. Experimental results. 6.4 . Moreover. which is supposed to be one of the disadvantages of the classical DTC.Real implementation. have been obtained showing the validity of the entire research. which match perfectly with the real simulations. by means of a fuzzy logic modulation. it has been done the comparison between the classical DTC and the FLDTC for different motor working points. § All experimental results are based in ASCII files.4 .Conclusions. Therefore. even with a resolution equal to the sampling time (166µs). The first group shows the proper behaviour of the classical DTC and FLDTC. 6. The experimental results are divided into two groups.

at least. The controller must be adaptive to any motor. Sensorless FLDTC implementation. Study the torque ripple reduction not only with fuzzy modulators but also with multilevel converters. Quantify the real savings of reactive power obtained from the optimised stator flux reference value. All further work is summarised schematically in the following ideas: § Developments of new fuzzy controllers to achieve better performance. which appears in any power drive.Conclusions. This new fuzzy controller should. not only for torque ripple reductions.2 . 6.Further work. take into account the following ideas: § § § § § § § § Develop a completely auto adaptive controller. 6. Further work. just sensing two currents and the DC voltage and by means of either Kalman filter techniques or observers.5 . but also to any electrical motor. Study and apply different FLDTCs. not only to induction motors as it has been done in the present thesis. Find optimum controllers. but also for reducing EMI and for increasing energy savings form the mains. Try to overcome the electrical noises.

. Ignazio. on Industry Applications. ISBN: 84-89654-11-5. Arias. A.. SAAEI'00. L.. V. Pages 197 . G. E "Hard-less Dead-time Compensator for PWM Voltage Inverters".L. G.. Pages 780 . 35. Prefetto. Porto (Portugal). Arias. Tomasso. Jayne.. J..1 .L.. ISBN: 848498-451-6. J. "Vectorial Torque Control: A Novel Approach to Torque and Flux Control of Induction Motor Drives" IEEE Trans. A. September 1997. No. S. ISBN: 84-699-2994-1. D. SAAEI'98. C. 3 . E.L. Arias.. Arias. IBERDROLA INS. M. 2000. Bedford.M.” PC and DSP based AC motor rd Adaptive Vector Control System”.. Romeral. Technical Guide. Aachen.. " Control Directo de Par". Arias. Gianluca. [ABB 1] [ALF 1] ABB Sistemas Industriales. International Meeting on Vector and Parallel Processing. Nardi. SAAEI'97. A. "Fuzzy Logic Direct Torque Control". September 1998. December 2000. September 2000. 6.. Alfonso.. E. A.REFERENCES. Aldo.G. Romeral. [ARI 1] [ARI 2] [ARI 3] [ATT 1] [BED 1] [BED 2] [BED 3] R. September /1999. TEC... Romeral. Aldabas. Attaianese.. M. Mexico. A. Seminario Anual de Automática. Electrónica Industrial e Instrumentación. Lausanne. Jayne.. J. L. Aldabas. Seminario Anual de Automática. E.. 1998.. E. Aldabas. September 1998. Proceedings IECON'98. J." Sistema de Control Vectorial Adaptativo de -Motores de Inducción basado en DSP ".L. Electrónica Industrial e Instrumentación. Romeral. ISIE'00.785. Copiformes S. D.G. November/December 1999../J.. L. . 8th European Conference on Power Electronics and Applications. P. Bedford. Bedford. Germany... 24th Annual Conference of the IEEE Industrial Electronics Society. "Improving Direct Torque Control by means of Fuzzy Logic".A. Proceedings EPE'99.200. Aldabas. Arias. Aldabas. Puebla. J. D.1405. June 1998. D. Proceedings VECPAR'98. A. 1997. D. J. Electrónica Industrial e Instrumentación. "An improved Look-up table for Zero Speed Control in DTC Drives". IEEE International Sypmposium on Industrial Electronics. Vol. Aldabas. Romeral. pages 1399 .. “Parallel Processing AC Motor Adaptive Vector Control System”. Seminario Anual de Automática. A. Romeral.Dede. Bedford. E.

Casadei.. D. Portugal. ISBN: 90-75815-04-2. 1998 IEEE. Vol. Rajashekara. Prentice-Hall. J. vol. pages 217 . Electronics Letters. I. 15. [BED 5] [BIR 1] [BLA 1] [BOL 1] [BOS 1] [BOS 2] [BUJ 1] [BUJ 2] [CAS 1] [CAS 2] [GON 1] R. "A Neuro-Fuzzy based On-Line Efficiency Optimization Control of a Stator Flux-Oriented Direct-Vector Controlled Induction Motor Drive". Llaquet. “Vector Control of AC Drives” CRC Press Inc.. P.. July 2000. Tani A.. A. [BED 4] Bedford. Bird. Romeral. No.. Doctoral Thesis. Switzerland.. Serra. 2. K.17. "Improvement possibilities of PWM Voltage Inverter EMI effects using different Modulations Methods". "Direct Torque Control of Induction Motor Drives". G. Bedford. Nasar. D. J.. IEEE Catalog Number: 97TH8280. G. ISBN: 90-75815-04-2.A. L.. Serra G. I. D.. ISBN 0-7803-4489-8. K. K. ISIE 97. 8th European Conference on Power Electronics and Applications. pages 769 – 777. pages 270 – 273. Buja.. Proceedings EPE'99. "Improvement of Direct Torque Control Performance by using a Discrete SVM Technique".. Casadei. Guimaraes. S. "Implementation of a Direct Torque Control Algorithm for Induction Motors Based on Discrete Space Vector Modulation". vol. Abril 1997. October 1999.. Bose. D. Vol. D. Gonzalez. "The principle of Field Orientation applied to the new TRANSVECTOR Close Loop Control Systems for rotating field machines". pages 997 . Giuseppe. Univeritat Politècnica de Catalunya. Zelaya. 4. on Power Electronics." Fuzzy Adaptive Speed Controller without Reference Model". J.2 . J. "Power Electronics and AC Drives". Siemens Review. 8th European Conference on Power Electronics and Applications.L. on Ind. 44. Lausanne. B. 1992. September 1999. 1986. Arias.. Vol. Serra G.References. Blaschke. Romeral. " Fuzzy logic torque ripple reduction for DTC based AC drives". E.. IEEE Industrial Electronics Society Newsletter. Arias.. F.220 Boldea. 34. H. D.. Proceedings EPE'99.. Patel... No. Bedford. G. Aldabas. "Control Vectorial Adaptativo de Motores Asíncronos de Inducción". Casadei. IEEE Trans. September 1999. December 1998. B. Lausanne (Switzerland). Tani A.. 33. Electronics.1003. 14th August 1997.. Buja. Bose. A. Balcells.. IEEE Trans. D. May 1972.. N. "A New Control Strategy of the Induction Motor Drives: The Direct Flux and Torque Control".

[HIT 1] [HOL 1] [KAN 1] [KER 1] [LAS 1] [LEG 1] [LEO 1] [LLA 1] [LSI 1] [LSI 2] [LSI 3] [LUD 1] R. Ver 1. Romeral. R. No. University of Glamorgan.1082. pages 585 . 1.. LLaquet. No. pages 1076 . December 1994. 36. User Manual" Ver 1. Pastorelli. L.. J. Vol. Schlegel. W. September/October 1999. Bedford. Quad Channel ADC Daughter Module. S. G. I. “A Modified Direct Torque Control for Induction Motor Sensorless Drive". Boldea. M. "EMI effects of Hard-less Dead-time compensated PWM Voltage Inverter". B. “Pulse-Based Dead Time Compensator for PWM Voltage Inverters".. Loughborough Sound Images plc. D. [HAB 1] Habelter.A survey".593. D.’ Ph. December 1992. No. 39. on Industry Applications. 1990. 32 Channel Digital I/O Board. Vol. F. C. pages 191-197. I. Loughborough Sound Images plc. “ The Direct Control of Induction Motors”. January/February 2000.D. 5. vol.. "Pulse width modulation ..01. 32. on Industrial Electronics. IEEE Trans. User Manual". 2. No. Kang. Seibel.. 3. September/October 1992. J.. Proceedings ICHQP'98. Thesis. Hiti.3 . J. Dissertation. Leggate.. pages 122-130. "Control of Electrical Drives". Holtz. F. S. Kerkman." PC/C32 Technical Reference Manual". Arias. May/June 1996." AM/D16QS. 1995. W. 28.. "Direct Torque Control of Induction Machines Using Space Vector Modulation". R. ‘Modeling and Control of Three-Phase PWM Converters.. "New Direct Torque Control of Induction Motor for Minimum Torque Ripple and Constant Switching Frequency" IEEE Trans. Electronics.420. No. IEEE Trans.00. IEEE Trans. IEEE Trans.. pages 410 . Ver 1. on Industry Applications.References. Kerkman. VPEC..L.. Vol.Virginia Polytechnic Institute & State University. Profumo..520." PC/32 DIO. Ludtke.. T.. Tolbert. June 1995. May 1998. J.03. A. Department of Electronics and Information Technology. pages 1045 – 1053. M. 35. Leonhard. D. August 1996. Vol. Vol. Lascu. Sul. on Ind. on Industry Applications. Rowan. on Industry Applications. IEEE Trans. J. pages 516 . Blaabjerg. April 1997.. 5. 44. J. Springler-Verlag. Loughborough Sound Images plc. " A new flux and stator resistance identifier for AC drive systems". 8th International Conference on Harmonics and Quality of Power October 1998. J..

. Noguchi. Iniciación y programación avanzada". X... No. C. Takahashi. " Historia de las máquinas eléctricas". September 1999. Luukko J. Mohan. T. September/1999. 44. Jayne M. M. Applications. 33. O.. Proceedings EPE'99. EDP Sciences 1999. 1989. IEEE Trans. Osheiba. [LUD 2] Ludtke. Paraninfo. M. Radwan. IEEE Trans.G. IEEE Trans. " Power Electronics". S. 8th European Conference on Power Electronics and Applications. A.. Lausanne. Vol.. Induction Motor Vector Control without an Encoder". "Analysis of Current Controllers for Voltage Source Inverters". March/April 1997. Lashine. Yamamoto. on Ind. A. Pyrhönen. O.4 . M... " Enlarging Switching Frequency in Direct Torque-Controlled Inverter by Means of Dithering". 8th European Conference on Power Electronics and Applications.485 [LUD 3] [MAR 1] [MAR 2] [MAT 1] [MOH 1] [NAS 1] [NIE 1] [NOG 1] [PYR 1] [RAH 1] R. Lausanne. J. T. Roboam... Niemelä. University of Durham.. UK. Carvalho.. S.1366. Arias. August 1997. Undeland. 1991. A. T. Robbins. 8th European Conference on Power Electronics and Applications. 6. 35. Electronics. I. Edicions UPC. "Drift correction methods of the stator flux linkage in DTC synchronous motor drives". M. Pyrhönen. “Improvement Direct Torque Control of Induction Motors”... 1994. I. 11-13 September 1995.G.. J. ISBN: 90-75815-04-2. Vol. "Direct Torque Control. A. Universitat Politècnica de Catalunya. Mata. Seventh International Conference on electrical Machines and Drives. Meynard. November/December 1999. Rahman. S. J. 2. Ludtke. Nash. on Industry.The European Physical Journal Applied Physics.. Second edition. No. E.. M.. Pyrhönen. Applications. L. Proceedings EPE'99. Wiley. Martins. Vol. A. pages 477 . “A comparative study of high performance speed control strategies for voltage sourced PWM inverter fed induction motor drives”. "A Direct Torque Controlled synchronous motor drive concept for dynamically demanding applications". Second edition.. September/1999. on Ind. I. No 4. Niemelä.341. pages 333 . “A predictive sampling scale model for direct torque control of the induction machine fed by multilevel voltage-source inverters”. Lausanne. Pyrhönen.References. pages 1358 . A.. EPE'99. Jayne M. A. Kondo. Luukko J. Switzerland Martinez. A. " Turbo C.

Texas Instruments Incorporated. "The next generation motor control method Direct Torque Control. The 1st International Congress on Energy. e Instrumentación. H. Romeral. Aldabas. Vas.. Romeral. [ROM 1] Romeral. Electrónica Ind. October 1994. 25. [ROM 2] [ROM 3] [ROM 4] [SEP 1] [TAK 1] [TAK 2] [TII 1] [TII 2] [TII 3] [TII 4] [VAS 1] [VAS 2] R.87. Vas. June 1995.. Texas Instruments Incorporated. L. B. I and Nogushi.. February 1995. Y. Llaquet. October 1986. User's Guide ". J. IEEE International Sypmposium on Industrial Electronics. Vol. Vol. Actas SAAEI'00. Power & Motion Control. Proc. ISIE'00. Bordonau.." TMS320C3x Floating-Point DSP Assembly Language Tools. J. on Power Electronics.. Sepe. Arias. Puebla. P.. March 1989. IEEE Trans. Aldabas. Industry Applications.L. I and Ohimori. September 2000. LLaquet. A.. D." TMS320C3x Floating-Point DSP Optimizing C Compiler. A. Terrassa. J." TMS320C3x User's Guide". " Electrical machines and drives: a space-vector theory approach".References. " Sensor less Vector and Direct Torque Control". “High-Performance Direct Torque Control of an Induction Motor”. E. Num. Universitat Politècnica de Catalunya. Romeral. Vol.. " Optimización de Modelos de Control Digital para Motores AC". pages 257-264. Industry Applications. Pohjalainen. pages 820-827. October 1993. Aldabas. Takahashi. P. Lang.. J.. L. DTC".5 . Tel-Aviv. pages 82 . Arias.... December 2000. 8... “A New Quick-Response and High-Efficiency Control Strategy of an Induction Motor”. Lalu. J. May 1997. Anual de Automática. Oxford University Press 1992. J. 1994. "A Simple Self-Tuning PID Speed Controller". Lausanne. Bedford. R. Texas Instruments Incorporated. User's Guide ". "Inverter non linearities and discrete Dead Time Compensation". Doctoral Thesis. February 1995. E. " Regulador Difuso Adaptativo por variación de las Funciones de Pertenencia ". Mexico. "Adaptive fuzzy speed controller for an AC drive". Takahashi. T. 4. J. 1A-22. J.. E. IEEE Trans.. P. P. IEEE Trans. ISBN: 84-699-2994-1. J. Oxford University Press 1998. L. Switzerland. Tiitine. Sem. EPE Chapter Symp. 2000.276. pages 273 .

Oxford University Press 1999. [YAM 1] R.6 .. 1986. and Genetic-Algorithm-Based Techniques". Application of Fuzzy. Marcel Dekka.. Yamamura. [VAS 3] Vas. Inc. Ed. Fuzzy-Neural. Neural. S.References. " AC Motors for high-performance applications. "Artificial-Intelligence-Based Electrical Machines and Drives. P. Analysis and Control".

c. This program is executed by the PC. This program executes the classical DTC. All data from the th1_5c. Figure 4.3 in chapter 4 shows in detail its main functions. This program executes the Fuzzy Logic DTC.1 . In this section four programs are being listed: § § § § TH1_5c. All data from the th1_9.4 in chapter 4 shows in detail its main functions. PCTH1_5c.Programs. Figure 4.c.c file to the DSP in order to perform the classical DTC.c.1 . It sends the th1_5c.APPENDIXES. The PC executes this program.c is stored in the PC. the PC helps in the execution of the Fuzzy Logic controllers. It sends the th1_9.c is stored in the PC. It is sent to the DSP and executed by it.c file to the DSP in order to perform the Fuzzy Logic DTC. It is sent to the DSP and executed by it.c. PCTH1_9. A. Also. TH1_9. A.

Appendixes.TH1_5c. /*_______________________________________________________________________*/ #include <c:\proves\math.2 .h> /* DPRAM Positions */ #define posicio_memoria_FLAG 0x0c00009 /*Flag*/ #define posicio_memoria_mfs_hst 0x0c0000b /* DTC references values */ #define posicio_memoria_te_hst 0x0c0000c /* " */ #define posicio_memoria_mfs_set 0x0c0000d /* " */ #define posicio_memoria_te_set 0x0c0000e /* " */ #define posicio_memoria_STOP 0x0c00012 /*Stop bit*/ #define #define #define #define #define #define #define #define #define #define /*10*/ #define #define #define #define #define #define #define #define #define #define /*20*/ #define #define #define #define #define #define #define #define #define #define posicio_memoria_f0 posicio_memoria_f1 posicio_memoria_f2 posicio_memoria_f3 posicio_memoria_f4 posicio_memoria_f5 posicio_memoria_f6 posicio_memoria_f7 posicio_memoria_f8 posicio_memoria_f9 posicio_memoria_fa posicio_memoria_fb posicio_memoria_fc posicio_memoria_fd posicio_memoria_fe posicio_memoria_ff posicio_memoria_f10 posicio_memoria_f11 posicio_memoria_f12 posicio_memoria_f13 posicio_memoria_f14 posicio_memoria_f15 posicio_memoria_f16 posicio_memoria_f17 posicio_memoria_f18 posicio_memoria_f19 posicio_memoria_f1a posicio_memoria_f1b posicio_memoria_f1c posicio_memoria_f1d 0x0c00048 0x0c00049 0x0c0004a 0x0c0004b 0x0c0004c 0x0c0004d 0x0c0004e 0x0c0004f 0x0c00050 0x0c00051 0x0c00052 0x0c00053 0x0c00054 0x0c00055 0x0c00056 0x0c00057 0x0c00058 0x0c00059 0x0c0005a 0x0c0005b 0x0c0005c 0x0c0005d 0x0c0005e 0x0c0005f 0x0c00060 0x0c00061 0x0c00062 0x0c00063 0x0c00064 0x0c00065 A. /* File : TH1_5C.c. ATN table.C */ /* Description: DSP program that performs: 1/program the adquisition boards AM/D16QS + AM/D16SA 2/run the flux and torque estimator each 166us saving the data in the DPRAM 3/ Classical DTC. A.1.1 .

register asm("COUNTDPRAM */ .word 00808064h"). asm("STR0A asm("STR0D asm("STR1A asm("STR1D asm("IOSTRA asm("IOSTRD asm("AMELIA0 .long 00828002h"). 00070900h").long 00828006h").long 00ff0000h").long 00828005h").long 00828004h").word . .data"). 00000000h").long dio1").word . asm("dio1 .long 00828000h").word .word 0081A000h").141592654 asm(" . asm("pointerdio . /* 4 analog channels addresses*/ /* #define posicio_DIO 0828000 */ asm("posicio_DIO .3 .long 00828007h"). /* DIO32 control register address */ /* #define CONTROL 00828005 */ asm("CONTROL . 00808068h"). /*30*/ #define #define #define #define #define #define #define #define #define #define /*40*/ #define #define #define #define #define #define #define #define posicio_memoria_f1e posicio_memoria_f1f posicio_memoria_f20 posicio_memoria_f21 posicio_memoria_f22 posicio_memoria_f23 posicio_memoria_f24 posicio_memoria_f25 posicio_memoria_f26 posicio_memoria_f27 posicio_memoria_f28 posicio_memoria_f29 posicio_memoria_f2a posicio_memoria_f2b posicio_memoria_f2c posicio_memoria_f2d posicio_memoria_f2e posicio_memoria_f2f 0x0c00066 0x0c00067 0x0c00068 0x0c00069 0x0c0006a 0x0c0006b 0x0c0006c 0x0c0006d 0x0c0006e 0x0c0006f 0x0c00070 0x0c00071 0x0c00072 0x0c00073 0x0c00074 0x0c00075 0x0c00076 0x0c00077 #define PI 3.Appendixes. /* DIO32 config. 004F0900h").word . asm("posicio_DIO3 . /* #define PORTREG 00828007 */ asm("PORTREG .long 0c00016h"). A. asm("posicio_DIO2 .word . asm("posicio_DIO4 . 00808060h").

.int02\"").word 000010000h").equ 0ah"). 0001e0000h").word _c_int01").equ 09h").word . asm("DR0 .sect \". 000f20000h"). .word .equ 08h").equ 06h").equ 0dh").equ 05h").word .word . 81B00Ch").word _c_int02").word _c_int05"). 81B002h"). asm(" asm(" .equ 03h"). asm("TMR1 . asm(" asm(" . /* Map AMELIA2 registers */ asm("TIMER1 asm("UCR asm("ACR asm("CONFIG asm("IMR1 asm("DCR1 asm("CH0 asm("CH1 /* Constants */ asm("IMR1_DEF asm("DCR1_DEF asm("TIMER1_DEF asm("UCR_DEF asm("ACR_DEF asm("CONFIG_DEF . asm("CTR . asm("DR2 .word .4 . asm("ECFR . /*Program section called 'int0X' where the interruprion vector is placed */ /*c_int0X is the name of the rotuine address */ asm(" asm(" . asm("ITTP asm("Mascara . asm("DCR .equ 0bh").equ 02h").equ 01h"). asm("DR1 .word . . 08dff0000h"). asm("CFR . .word 81B005h"). asm("ECTR .equ 07h").sect \".int05\"").equ 0ch"). 0a4000000h").equ 0ah").word . 81B00Bh"). 81B008h").equ 0fh"). asm("CMR . 81B00Ah"). asm("SDC . asm("SMR . A. 81B00Fh").word 0000ffffh").word .Appendixes.word 06000000h").word . 81B006h"). asm("TMR0 . .int01\""). asm("IMR . 0fd9b0000h").word .equ 04h").word .sect \". /* Map AMELIA2 values / registers */ asm("DR3 .equ 0eh").word . asm("ISR .

*)posicio_memoria_f1b. *)posicio_memoria_f26. *)posicio_memoria_f1d. *)posicio_memoria_f16. *)posicio_memoria_f7. *)posicio_memoria_f5. pointerf13=(float *)posicio_memoria_f13. pointerfa=(float *)posicio_memoria_fa. float * pointer_te_set=(float *)posicio_memoria_te_set. *)posicio_memoria_f2. pointerf12=(float *)posicio_memoria_f12. long * pointerSTOP=(long *)posicio_memoria_STOP. /* pointers */ long * pointer_FLAG=(long *)posicio_memoria_FLAG. *)posicio_memoria_f23.Appendixes. *)posicio_memoria_f27. *)posicio_memoria_f15.5 . *)posicio_memoria_f3. float * pointer_mfs_hst=(float *)posicio_memoria_mfs_hst. pointerfb=(float *)posicio_memoria_fb. pointerfd=(float *)posicio_memoria_fd. *)posicio_memoria_f17. *)posicio_memoria_f24. *)posicio_memoria_f18. pointerf10=(float *)posicio_memoria_f10. pointerf14=(float pointerf15=(float pointerf16=(float pointerf17=(float pointerf18=(float pointerf19=(float pointerf1a=(float pointerf1b=(float pointerf1c=(float pointerf1d=(float pointerf1e=(float pointerf1f=(float pointerf20=(float pointerf21=(float pointerf22=(float pointerf23=(float pointerf24=(float pointerf25=(float pointerf26=(float pointerf27=(float *)posicio_memoria_f14. *)posicio_memoria_f1c. pointerf11=(float *)posicio_memoria_f11. float * pointer_mfs_set=(float *)posicio_memoria_mfs_set. *)posicio_memoria_f8. /* End int section */ asm(" . *)posicio_memoria_f1f. float * pointer_te_hst=(float *)posicio_memoria_te_hst. pointerfe=(float *)posicio_memoria_fe. *)posicio_memoria_f22. A. *)posicio_memoria_f21. *)posicio_memoria_f1. *)posicio_memoria_f20. float * float * float * float * float * float * float * float * float * float * /*10*/ float * float * float * float * float * float * float * float * float * float * /*20*/ float * float * float * float * float * float * float * float * float * float * /*30*/ float * float * float * float * float * float * float * float * float * float * pointerf0=(float pointerf1=(float pointerf2=(float pointerf3=(float pointerf4=(float pointerf5=(float pointerf6=(float pointerf7=(float pointerf8=(float pointerf9=(float *)posicio_memoria_f0. *)posicio_memoria_f9. *)posicio_memoria_f25. *)posicio_memoria_f6. pointerff=(float *)posicio_memoria_ff. *)posicio_memoria_f1a. pointerfc=(float *)posicio_memoria_fc. *)posicio_memoria_f19.text"). *)posicio_memoria_f4. *)posicio_memoria_f1e.

Lr=0. float ch0_float=0.32023.e_fi_td=0xaa.angbisfloat=0. /*40*/ float * float * float * float * float * float * float * float * pointerf28=(float pointerf29=(float pointerf2a=(float pointerf2b=(float pointerf2c=(float pointerf2d=(float pointerf2e=(float pointerf2f=(float *)posicio_memoria_f28. /* Control */ void set_amd16qs(void).isD_1=0. int e1_b=0. float sectbis_aux=0.isQ_1=0.mfs_hst=0. /* read 2 currents + wm */ void flux_torque_est_zoh(void). /* ADC inizialization */ void set_amd16sa(void).wrrds_1=0.e_fd_ti_b=0.frD=0. int d=0.fsQ=0. /* adquisition variables*/ long int ch0=0.FLAG=0.9960652825. /* send the active state */ void save_active_state(void).P=2. int x=0. /* estimator zoh variables */ float isD=0.30563.ch2_float=0. long int *pch0=&ch0.ang=0.e_fd_td=0xaa.mfs=0.e7=0x95. float Rr=5. float wrrds=0. /* ADC inizialization */ void dio32(void). /* Amelia int */ void c_int02(void).mfs_nlim=0. *)posicio_memoria_f2b. /* save the active state */ void bit1(void).*pch1=&ch1. /* functions */ void c_int01(void).*pch2=&ch2.te_set=0.mfs_plim=0. *)posicio_memoria_f2e. /* dtc */ void save_data_DPRAM(void).isQ=0.frQ_1=0.c=0.te_hst=0.e2=0x95.wrrds_3=0. float etz2_5=0. /*DTC varialbes*/ int e1=0x95. *)posicio_memoria_f2f. int e_fi_ti=0xaa.stz=0.6 .Appendixes.816496. int te_e=0.e_fi_td_b=0.wrrds_2=0.table[402].sect=0. A. float te_plim=0. *)posicio_memoria_f2c.e_fi_ti_b=0. *)posicio_memoria_f29.te=0. /* DIO inizialization */ void atn_table (void). double angbis=0. /* Flux and torque estimation zoh */ void dtc(void).9973751317.Lm=0. /* Amelia int */ void c_int05(void).etz1_6=0. *)posicio_memoria_f2d.te_nlim=0.e_fd_ti=0xaa.wrrds_4=0. *)posicio_memoria_f2a.mfs_e=0. float mfs_set=0. /* ATN table */ void get_ADC(void).*/ void send_active_state(void).fsD=0. int sectbis=0. float frD_1=0. int e_fd_td_b=0.ch2=0.frQ=0. float Lx=0.0091376.05.e0=0xaa.ch1_float=1. /*void save_data_DPRAM_2(void).ch1=0.STOP=0. void bit0(void).

} A.ST").Appendixes. @STR0A.IE"). asm(" LDP STR1A. mfs_plim=mfs_set+mfs_hst. asm(" LDI @ITTP.*AR0"). R0.7 . mfs_nlim=mfs_set-mfs_hst. @STR0D.AR0"). asm(" STI R0.*AR0"). dio32().AR0"). te_plim=te_set+te_hst. /* Enalbing interruptions INT0 +INT1 + INT5 of PC/C32 board */ asm(" LDI 0013h. /* getting the reference values */ mfs_set=*pointer_mfs_set.IF").DP"). } while (STOP==1). te_set=*pointer_te_set. asm(" LDP IOSTRA. set_amd16sa(). /* Globals int enable */ asm(" OR 2000h. te_nlim=te_set-te_hst.R0"). mfs_hst=*pointer_mfs_hst. /* Start Cache */ asm(" OR 0800h.ST"). asm(" STI R0. if (STOP ==0) { atn_table().*AR0").AR0"). /* null state to VSI */ do { STOP=*pointerSTOP. asm(" LDP IOSTRD.R0").R0"). set_amd16qs(). asm(" LDP STR1D. te_hst=*pointer_te_hst. /************************************************************************/ /* Function : main */ /************************************************************************/ void main(void) { asm(" asm(" asm(" asm(" LDP LDP LDP STI STR0A.

/* disable int*/ asm(" ANDN 2000h. -16.R0").R0"). LDI LDI LDI LDI LDI LDI LDI LDI LDI LDI LDI LDI LDI LDI LDI ASH LDI *+AR0(DR0). AND 0000h.R0").R0"). *+AR0(DR1).AR0"). *+AR0(DR3). *+AR0(DR1). } /************************************************************************/ /* End Function : main */ /************************************************************************/ /************************************************************************/ /* Function : c_int01 */ /* AMELIA2_A interruption */ /************************************************************************/ void c_int01(void) { asm(" PUSH AR0").R0").Appendixes.AR1"). *+AR0(DR3). *+AR0(DR2).ST"). *+AR0(DR2).R0"). LDI *+AR0(ISR).R0"). asm(" LSH 16. asm(" PUSH AR2"). *+AR0(DR0). *+AR0(DR0).R0").IE"). asm(" PUSH R0"). } while (STOP==0). A. /* Disable int */ asm(" asm(" AND 0000h.AR2").R0"). do { STOP=*pointerSTOP.R0"). @_pch2.R0"). *+AR0(DR0). asm(" asm(" asm(" asm(" asm(" asm(" asm(" asm(" asm(" asm(" asm(" asm(" asm(" asm(" asm(" asm(" asm(" asm(" asm(" LDI @AMELIA0.R0").R0"). *+AR0(DR2). *+AR0(DR1).*AR1"). *+AR0(DR2). *+AR0(DR1).R0").R0").R0").R1").8 .R0").ST"). asm(" STI R1. asm(" LDI 00ffh. *+AR0(DR3).R1"). asm(" LDI @posicio_DIO.

/* disable int*/ asm(" ANDN 2000h. LDI *+AR0(DR3). -16. @CH1. } /************************************************************************/ A. /* erase this interrupt flag */ asm(" ANDN 1h. asm(" POP AR2").AR2").*AR2"). asm(" POP AR0").AR2").IF").R0"). asm(" PUSH R1").R0").*AR2").AR0").R1").9 . asm(" PUSH AR2").AR0"). asm(" asm(" STI R0. R0.Appendixes.R1").*AR2"). *AR1. @_pch1. asm(" asm(" asm(" asm(" asm(" asm(" asm(" asm(" asm(" asm(" asm(" asm(" asm(" asm(" asm(" asm(" asm(" LDI @IMR1.R0"). LDI LDI LDI LDI ASH LDI STI ASH LDI STI POP POP POP POP POP @CH0.IF"). asm(" POP R0").IF"). @_pch0. asm(" PUSH R0"). /* int 05 is set*/ asm(" OR 010h. AR1"). AR2"). *AR0. R1"). R0"). AR0"). R1. -16.AR1"). /* erase this interrupt flag */ asm(" ANDN 2h.R0").ST"). asm(" PUSH AR1"). LDI *AR0. } /************************************************************************/ /* End Function : c_int01 */ /************************************************************************/ /************************************************************************/ /* Function : c_int02 */ /* AMELIA2_B int */ /************************************************************************/ void c_int02(void) { asm(" PUSH AR0").

*/ send_active_state(). 6e-2volts / 1rpm */ ch2_float=-(1.15).d++) { } d=0.ST").0*ch0*9.wm */ /* 65535 / 6volts . ch1_float=-(1. /* enalbe global int*/ asm(" OR 2000h.03*6.ST").5)*6.d<215.11/7)-3.103515625e-5/(1. 1volt / 7.*/ /* 65535 / 6volts .10 . /* save_data_DPRAM_2().isB. /* 65535 / 4volts . /* bit0().Appendixes.155273438e-5*10).5e-3. /* get isA.015*6.0*(ch2-170.*/ /* for(d=0.0*ch0*9.0922 amp */ ch0_float=-(1. /* Tektronic Probe */ ch1_float=-(1.1*1. get_ADC(). 1volt / 10 amp */ /* LEM probe */ ch0_float=-(1. /* End Function : c_int02 */ /************************************************************************/ /************************************************************************/ /* Funcio : c_int05 (166us) /************************************************************************/ void c_int05(void) { bit1().0*ch1*9. bit0().11/7)+3.155273438e-5*7. } /************************************************************************/ /* Funcio : get_ADC (estimator) */ /* A. dtc(). save_data_DPRAM().155273438e-5*10*4.1*1.0e-2. flux_torque_est_zoh().*/ } /************************************************************************/ /* End Function : c_int05 (166us) */ /************************************************************************/ /************************************************************************/ /* Function : get_ADC (estimator) /************************************************************************/ void get_ADC (void) { /* disable int*/ asm(" ANDN 2000h.155273438e-5*7.0*ch1*9.10965*6e-4)).85/5.

wrrds_3=wrrds_2. angbisfloat=(float)angbis. mfs=sqrt(sqr). /************************************************************************/ /************************************************************************/ /* Function : flux_torque_est_zoh */ /************************************************************************/ void flux_torque_est_zoh(void) { double sqr=0.*/ isQ=(1. } if( aux < 1 ) {index=(int)(aux*100).Appendixes. frQ_1=frQ.4142135*ch1_float)+(0. wrrds_2=wrrds_1. /* /* /*frD=(((1-etz2_5)*((Lm*isD_1)-((Lr/Rr)*P*wrrds_1*frQ_1)))+(etz2_5*frD_1)).80223847e-3*isQ_1)+(0.0298975)+(frD*0. frQ=(0. isD_1=isD. int index=0.*/ /*frD=(((1-etz1_6)*((Lm*isD_1)-((Lr/Rr)*P*wrrds_1*frQ_1)))+(etz1_6*frD_1)).7071067*ch0_float).*/ fsD=(isD*0.9544077). isQ_1=isQ. fsQ=(isQ*(Lx/Lm))+(frQ*(Lm/Lr)).2247*ch0_float.3435028*ch1_float)+(0. frQ=(((1-etz1_6)*((Lm*isQ_1)+((Lr/Rr)*P*wrrds_1*frD_1)))+(etz1_6*frQ_1)). if (aux < 0) {aux=aux*(-1).332895663e-3*wrrds_1*frQ_1)+(etz1_6*frD_1). isD=1.11 .9544077). wrrds_1=wrrds. fsQ=(isQ*0.95*(1.332895663e-3*wrrds_1*frD_1)+(etz1_6*frQ_1). } else A. wrrds_4=wrrds_3. wrrds=(wrrds_4+wrrds_3+wrrds_2+wrrds_1+(2*PI/60*ch2_float))/5. /* may be it could be just used the square value */ sqr=(fsD*fsD)+(fsQ*fsQ).*/ wrrds=(wrrds_4+wrrds_3+wrrds_2+wrrds_1+(0. /* fsD=(isD*(Lx/Lm))+(frD*(Lm/Lr)). } else if ( aux >= 100) {angbis=table[199]. isQ=0.104719*ch2_float))/5. frD_1=frD. frQ=(((1-etz2_5)*((Lm*isQ_1)+((Lr/Rr)*P*wrrds_1*frD_1)))+(etz2_5*frQ_1)).80223847e-3*isD_1)-(0. angbis=table[index]. angbisfloat=(float)angbis.*/ frD=(0.0298975)+(frQ*0. /* using the table */ aux=fsQ/fsD.7071067*ch0_float). float aux=0.

/* te=P*c*((fsD*isQ)-(fsQ*isD)). else if ( mfs < mfs_nlim) mfs_e = 1. */ else if ( te < te_nlim) { te_e = 2. if ((-PI/2) < angbisfloat) sectbis=6. } /* te_e = 0. } else { te_e = 1.} } if (-PI < angbisfloat ) sectbis=4.Appendixes. } if ( fsD > 0) { if( fsQ < 0) {angbisfloat=(float)((-1)*angbis). if (PI/6 < angbisfloat) sectbis=2. angbis=table[index].} } else { if( fsQ > 0) {angbisfloat=PI+((-1)*angbisfloat).632992*((fsD*isQ)-(fsQ*isD)). if ((5*PI/6) < angbisfloat) sectbis= 4.*/ te=1. {index=(int)(aux+99). if (-PI/6 < angbisfloat) sectbis=1.} else {angbisfloat=(angbisfloat-PI). if ((-5*PI/6) < angbisfloat ) sectbis=5.12 . } /************************************************************************/ /* End function: flux_torque_est_zoh */ /************************************************************************/ /************************************************************************/ /* Function: dtc */ /************************************************************************/ void dtc (void) { /* new reference values are read in savw_data_DPRAM before setting the FLAG=1 */ if ( mfs > mfs_plim) mfs_e = 0. angbisfloat=(float)angbis. if ( te > (te_plim)) {te_e = 0. if (PI/2 < angbisfloat) sectbis=3. } A.

case 2: e_fi_ti=0xa6. e_fi_ti_b=5. e_fd_ti_b=4. e_fd_td_b=5. e_fi_td=0xa5. e_fi_td_b=4. case 5: e_fi_ti=0x99. e_fd_ti=0xa9. e_fd_ti=0xa6. e_fd_ti=0x96. e_fd_td=0xa6. e_fd_td_b=1. e_fi_td=0x9a. case 4: e_fi_ti=0x9a. e_fi_td=0x99. e_fd_td=0x9a. e_fd_td=0x99. case 3: e_fi_ti=0x96. e_fd_ti=0x99. e_fd_ti_b=3. e_fd_td_b=3. e_fd_ti_b=6. A. break. e_fd_ti_b=1. e_fd_td_b=2. case 6: e_fi_ti=0xa9. e_fi_td=0xa9. e_fd_td=0xa5. e_fi_td_b=3. e_fi_td=0x96. e_fi_ti_b=4. break. break. e_fi_ti_b=3. e_fi_td=0xa6.Appendixes.13 . e_fd_ti=0x9a. e_fd_td_b=6. switch(sectbis) { case 1: e_fi_ti=0xa5. e_fi_td_b=2. e_fi_ti_b=6. e_fd_td=0xa9. e_fi_td_b=1. break. break. e_fd_ti_b=5. e_fi_td_b=6. e_fi_ti_b=2.

e1_b = e_fi_ti_b.R1"). e_fi_ti_b=1. e_fi_td_b=5. } else { e1 = e_fi_td.} break. asm(" STI R1. asm(" LSH 16. asm(" LDI @_e1.R1").R1").*/ /* asm(" LDI *AR1. e1_b = 0. case 1: if ( mfs_e == 0 ) { e1 = e0. e1_b = e_fi_td_b. } switch(te_e) { case 0: if ( mfs_e == 0 ) { e1 = e_fd_td. break. asm(" PUSH R1"). A. } else { e1 = e_fi_ti. e_fd_ti_b=2. /* as long as save_active_state is not used */ /* asm(" LDI @pointerdio.} break. } else { e1 = e0. e_fd_td=0x96. e_fd_td_b=4.*/ asm(" LDI @posicio_DIO. e_fd_ti=0xa5. } break. e1_b = 0.*AR1"). } } /************************************************************************/ /* End function: dtc */ /************************************************************************/ /************************************************************************/ /* Function: send_active_state */ /************************************************************************/ void send_active_state (void) { asm(" PUSH AR1").AR1"). case 2: if ( mfs_e == 0 ) { e1 = e_fd_ti.AR1").Appendixes.14 . e1_b = e_fd_td_b. e1_b = e_fd_ti_b.

*pointerf8=te. *pointerfc=ang. *pointerfd=sect. te_set=*pointer_te_set. } /************************************************************************/ /* End function: send_active_state */ /************************************************************************/ /************************************************************************/ /* Function : save_data_DPRAM */ /************************************************************************/ void save_data_DPRAM (void) { float te_aux. mfs_nlim=mfs_set-mfs_hst. *pointerf0=isD. *pointerf6=te_e.2.6. mfs_hst=*pointer_mfs_hst. /*10*/ *pointerfa=wrrds_1. e1_b=e1_b*(-1). *pointerf9=te_e. te_hst=*pointer_te_hst. *pointerf7=e1_b. te_plim=te_set+te_hst.*/ /*20*/ /* /* /* /* /* /* new reference values are read in save_data_DPRAM before setting the FLAG=1 */ mfs_set=*pointer_mfs_set.15 .*/ *pointerfb=te. mfs_plim=mfs_set+mfs_hst. *pointerf4=11. *pointerf11=isDdef. *pointerf3=te_aux. *pointerff=frQ. *pointerf12=isQdef. *pointerf1=isQ. *pointerf2=te_aux. te_nlim=te_set-te_hst. } A. *pointerf5=8. *pointerfe=frD. asm(" POP R1"). sectbis_aux=sectbis*(-1).Appendixes. FLAG=1. asm(" POP AR1"). *pointerf13=ange2. *pointer_FLAG = FLAG. te_aux=te+10. *pointerf10=wrrds.

asm(" PUSH R1"). asm(" LDI @_e1. wrrds_aux=wrrds/(-10). asm(" LDI @pointerdio. te_set=*pointer_te_set.R1").te_set_aux. mfs_aux=mfs*(-1). mfs_set_aux=mfs_set*(-1). FLAG=1. *pointerf1=mfs_aux. *pointerf3=te_aux. /* new reference values are read in save_data_DPRAM before setting the FLAG=1 */ mfs_set=*pointer_mfs_set. asm(" POP R1"). asm(" LSH 16. asm(" STI R1. te_aux=te.*AR1"). te_nlim=te_set-te_hst. *pointerf0=mfs_set_aux. *pointer_FLAG = FLAG. *pointerf4=wrrds_aux. te_hst=*pointer_te_hst.16 . mfs_nlim=mfs_set-mfs_hst. /************************************************************************/ /* End function: save_data_DPRAM */ /************************************************************************/ /************************************************************************/ /* Funcio : save_data_DPRAM_2 /************************************************************************/ void save_data_DPRAM_2 (void) { float mfs_set_aux. } /************************************************************************/ /* End function: save_data_DPRAM_2 */ /************************************************************************/ /************************************************************************/ /* save_active_state */ /************************************************************************/ void save_active_state (void) { asm(" PUSH AR1"). te_set_aux=te_set.wrrds_aux. mfs_hst=*pointer_mfs_hst. A.Appendixes. te_plim=te_set+te_hst.mfs_aux.te_aux. *pointerf2=te_set_aux.R1"). mfs_plim=mfs_set+mfs_hst.AR1").

asm(" POP AR1").R1").AR1"). asm(" POP R1"). asm(" POP AR1"). asm(" PUSH R1"). asm(" STI R1. asm(" LDI 0000h. asm(" POP AR1"). asm(" LDI @posicio_DIO2.R1").17 .*AR1"). } /************************************************************************/ /* End function: bit0 */ /************************************************************************/ /************************************************************************/ /************************************************************************/ /* Inizialization routines */ /************************************************************************/ /************************************************************************/ /* Function: set_amd16qs */ /* It inizializates the board AM/D16QS. } /************************************************************************/ /* End function: bit1 */ /************************************************************************/ /************************************************************************/ /* bit0 */ /************************************************************************/ void bit0 (void) { asm(" PUSH AR1"). */ A. asm(" LSH 16. asm(" LDI @posicio_DIO2.R1"). asm(" LSH 16. asm(" STI R1. asm(" LDI 00ffh.AR1"). asm(" POP R1").Appendixes. } /************************************************************************/ /* End: save_active_state */ /************************************************************************/ /************************************************************************/ /* bit1 */ /************************************************************************/ void bit1 (void) { asm(" PUSH AR1"). asm(" PUSH R1").*AR1").R1").

AR0"). asm(" STI R0. LSH 16. /* Config.R0"). asm(" LSH 16. /* /2 24 16 */ /*asm(" LDI 28E2h. asm(" STI R0.*+AR0(CFR)").R0"). Configuration Register */ /* Value 8010h. /* Config.R0"). A. asm(" asm(" asm(" LDI 0010h.*+AR0(DCR)").R0").R0").*+AR0(CMR)"). el Amelia Control Register */ /* Value 00F6h: out of reset.R0").*+AR0(CMR)").R0"). factor 1/8 MCLK_0 and MCLK_1 as an output */ /*asm(" LDI 28E0h.*+AR0(CFR)"). asm(" STI R0.18 .R0"). Master config.*+AR0(CTR)").*/ /* Value 28E3h: TCLK0 clk. divide 384 */ /* enable chanals 2 i 3 and M_CLOCK_0 */ /*asm(" LDI 00F6h. /* Config. STI R0.R0").R0"). It is cte */ asm(" LDI 8010h.*/ /* /1 48 32 */ asm(" LDI 28E1h. Enhanced Configuration Register */ /* 00A0h: level int.R0").R0"). /************************************************************************/ void set_amd16qs(void) { asm(" LDI @AMELIA0.Appendixes. asm(" asm(" */ /* 32 16 8 4 */ /* 48 24 12 6 */ LSH 16. /* Config. STI R0. STI R0. asm(" STI R0. /* Reset AM/D16QS board */ asm(" LDI 0000h. /* User Control register config. Serial Data Configuration Register */ /* 00c0h: Enable AMELIA2 */ asm(" LDI 00c0h.R0"). asm(" LDI 00E6h.*/ /* /8 6 4 */ asm(" asm(" LSH 16..*/ /* /4 12 8 */ /*asm(" LDI 28E3h.*+AR0(ECFR)"). It is reset either reading ISR */ /* or reading the channels */ asm(" asm(" asm(" LDI 00A0h. STI R0.R0").*+AR0(SDC)"). LSH 16.R0").R0"). asm(" LSH 16.R0").

Interrupt Mask Register */ /* Value 2000h int.R0").R0").R0"). (reading ISR) */ asm(" LDI *+AR0(ISR).R0"). /* Config.R0"). *+AR0(DR2).R0").R0").R0").*/ asm(" LDI 0003h.*/ /* 25% */ /*asm(" LDI 0001h.R0"). asm(" asm(" asm(" asm(" asm(" asm(" asm(" asm(" asm(" asm(" asm(" asm(" LDI LDI LDI LDI LDI LDI LDI LDI LDI LDI LDI LDI *+AR0(DR0). *+AR0(DR3).*+AR0(IMR)"). when buffer FIFO is 100% full*/ /*asm(" LDI 0000h. AMELIA2 int.R0"). asm("Calib_wait: SUBI 01h. asm(" STI R0. asm(" LSH 13.R0"). asm(" LDI *+AR0(DR3). *+AR0(DR1).R0").Appendixes. asm(" BNZ Calib_wait").R0").R0"). *+AR0(DR2).R0").R0").R0"). /* Config. */ /* Wait loop calibration system */ /*asm(" LDI 0800h. *+AR0(DR3). *+AR0(DR2). /* 100% */ asm(" LSH 16.R0"). asm(" LDI *+AR0(DR2).R0"). *+AR0(DR0).19 . /* Clean the FIFO (4 read for channel) */ asm(" LDI *+AR0(DR0).R0").R0").R0").R0"). when buffer if full at the specified % asm(" LDI 2000h.*/ asm(" LDI 0300h.*/ /*asm(" LDI 0002h.R0").R0"). *+AR0(DR0).R0"). *+AR0(DR3).R0"). *+AR0(DR1). Enhanced Control Register */ /* Value 0003h.R0"). } /************************************************************************/ /* End function : set_amd16qs */ /************************************************************************/ A. asm(" LDI *+AR0(DR1).R0"). asm(" BNZ Calib_wait"). asm(" STI R0. asm(" LSH 16. /* Clean any int.*+AR0(ECTR)"). asm("Calib_wait: SUBI 01h. asm(" LSH 15.R0"). *+AR0(DR1).

R0"). asm(" LDI @PORTREG. STI R0.*AR0").*AR0"). LDI @TIMER1_DEF.AR0"). asm(" LSH 16.20 . LDI @UCR_DEF.AR1"). asm(" STI R1.R0").AR0").R0").AR1"). STI R0.AR0"). LDI @IMR1. LDI @IMR1_DEF.*AR0").R0"). dio32 */ /************************************************************************/ void dio32(void) { /* Dio32 as a master without any trigger */ /* asm(" LDI 0241h.*AR0").AR0").R1").R1"). STI R0. /************************************************************************/ /* Function: set_amd16sa */ /* It inizializates the board AM/D16QS.*AR1"). LDI @CONFIG.*AR0").R1").*AR0"). LDI @ACR. STI R0. A. asm(" LSH 16. LDI @ACR_DEF.AR0"). asm(" asm(" asm(" asm(" asm(" asm(" asm(" asm(" asm(" asm(" asm(" asm(" asm(" asm(" asm(" LDI @UCR.*/ asm(" LDI 023Ch.Appendixes.*AR1").R1"). LDI @CONFIG_DEF. asm(" STI R1.R0"). asm(" STI R0.R0"). */ /************************************************************************/ void set_amd16sa(void) { asm(" LDI @DCR1. /* 32 bits as output */ asm(" LDI 1111h. asm(" LDI @CONTROL. LDI @TIMER1. asm(" LDI @DCR1_DEF.R1"). } /************************************************************************/ /* End function : set_amd16sa */ /************************************************************************/ /************************************************************************/ /* Funcio : dio32 */ /* Ini.AR0"). STI R0.

01. asm(" STI R1. asm(" LDI @posicio_DIO. for(k=0.k++) { r=atan(s).AR1"). asm(" LSH 16.*AR1").R1").R1").21 . asm(" LSH 16.R1").AR1"). asm(" LDI @posicio_DIO2.R1").k<=200.*AR1"). r=atan(s). table[k]=r. /* disconnect the bridge */ asm(" LDI 00ffh. table[k]=r. asm(" LDI 0000h.k<=100. asm(" STI R1. } } /************************************************************************/ /* End function : atn_table */ /************************************************************************/ A.k++) { s=k-99. } /************************************************************************/ /* End function : dio32 */ /************************************************************************/ /************************************************************************/ /* Funcio : atn_table */ /* Creates a table with ATN values */ /************************************************************************/ void atn_table(void) { double s=0. int k=0. } for(k=100. s=s+0.Appendixes.r=0.

h> /* Memory DPRAM positions for the set points + exchange values */ #define FLAG 0x0c00009 // FLAG #define HST_MFS 0xc0000bl // Flux set point_hst margin #define HST_TE 0xc0000cl // Torque set point_hst margin #define MFS 0xc0000dl // Flux set point #define TE 0xc0000el // Torque set point #define STOP 0xc00012l // SVM stop bit #define #define #define #define #define #define #define #define #define #define /*10*/ #define #define #define #define #define #define #define #define #define #define /*20*/ #define #define #define f0 f1 f2 f3 f4 f5 f6 f7 f8 f9 fa fb fc fd fe ff f10 f11 f12 f13 f14 f15 PI 3. A.C Classical DTC */ /**********************************************************************/ /* Needed C files #include <dos.h> #include<time.h> */ /* Needed C files for the DSP */ #include "c:\mon32\bc45\tic32.141592654 0xc00048l 0xc00049l 0xc0004al 0xc0004bl 0xc0004cl 0xc0004dl 0xc0004el 0xc0004fl 0xc00050l 0xc00051l 0xc00052l 0xc00053l 0xc00054l 0xc00055l 0xc00056l 0xc00057l 0xc00058l 0xc00059l 0xc0005al 0xc0005bl 0xc0005cl 0xc0005dl /* DSP file */ #define FILENAME "TH1_5C.h" #include<stdio.OUT" A.h> #include <conio.1.c /**********************************************************************/ /* PCTH1_5C.22 .2 .h> #include<stdlib.PCTH1_5c.h> #include <math.Appendixes.

*/ Setpoints1(). if (x=='1') { IniciDSP().v8.v2. delay (5000). delay(500).v6. delay (5000). void ReadDPRAM(void). void AturaDSP(void). int s=0.vd.k=0. t++) { A. /* pointer file */ FILE *f_grf.vf. /* data matrix */ /*float dt [10][901].v14. void Setpoints1(void).va. x = getch(). void Data2file(void).*/ float dt [9][901].v4. for(t=0.mfs_hst=0.v5.Appendixes.vb. // Stop + flag bit variable /* set points */ float mfs_set=0. double mfs_sug=0. void Savedata(void). /* Setpoints1().23 . EngegaDSP(). delay (4000). /* Global variables */ char x=0. unsigned long stop=0. long int t=0 . Setpoints1().te_set_d=0.te_hst=0. delay (200). /* Functions definition */ void IniciDSP(void).v10.v15.v12.flag=0. Setpoints().v13. /* Global adquisition variables */ float v0. t<1000000 . printf("\nPress '1' to start"). delay (5000).ve. void main (void) { clrscr().i=0.j=0. float vc. void EngegaDSP(void). printf("\nSaving data").te_set=0.v1.v11. void Setpoints(void).v3.v9.v7.

0xd00. } flag=0.&flag).flag).Appendixes. A. 8). Put_DPRAM_Word_32(STOP. /* Load the file to be executed Load_Object_File(FILENAME). Data2file(). */ */ (0x290). if (flag == 1 ) { if ( j <= 900 ) { ReadDPRAM(). for (s=0. s++) { } s=0.24 . stop). j++. Put_DPRAM_Word_32(FLAG. /* Enable DPRAM Enable_DPRAM(). Get_DPRAM_Word_32(FLAG. s<5 . /* DSP Inicialitzation. Savedata(). /* DSP reset */ Global_Reset(). DPRMA adress (0xD00)*/ } /*&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&*/ /* End of DSP inizialization */ /*&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&*/ /******************************************************************/ /* Start up DSP */ /******************************************************************/ void EngegaDSP(void) { stop=0. } /***************************************************************** */ /* DSP inizialization */ /******************************************************************/ void IniciDSP(void) { /* Seleccio data type for the DSP */ Set_Processor_Data_Type_Size_32(). } } } AturaDSP(). Board adress /* bus ISA size */ Select_Board(0x290.

Put_DPRAM_Float_32(HST_MFS. &mfs_set). scanf("%f". te_set_d=te_set.mfs_set). mfs_sug=0. scanf("%f". printf("Flux set point hst margin: "). Put_DPRAM_Float_32(MFS. Put_DPRAM_Float_32(HST_TE. printf("\nFlux set point: "). scanf("%f". printf("Flux set point hst margin: "). &te_set). /* Run file */ Run_From(Get_Entry_PC()). scanf("%f". Put_DPRAM_Float_32(TE. } /*&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&*/ /* End start up DSP */ /*&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&*/ /******************************************************************/ /* Setpoints */ /******************************************************************/ void Setpoints(void) { printf("\n\nTorque setpoint N/m: "). mfs_sug). Put_DPRAM_Float_32(TE.mfs_set). &te_set).Appendixes. scanf("%f". Put_DPRAM_Float_32(MFS. &te_hst).te_hst).te_set). /* old version */ /* printf("\nFlux set point: "). printf("Torque set point hst margin: ").mfs_hst). &mfs_hst). printf("\nThe suggested optimized flux square value is %lf". &te_hst). scanf("%f". printf("Torque set point hst margin: ").25 . delay(2000).te_set).3665*sqrt(te_set_d).te_hst).mfs_hst). Put_DPRAM_Float_32(HST_MFS.*/ } /*&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&*/ /* End setpoints */ /*&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&*/ /******************************************************************/ /* Setpoints1 */ /******************************************************************/ void Setpoints1(void) { A. scanf("%f". &mfs_hst). printf("Torque setpoint N/m: "). scanf("%f". Put_DPRAM_Float_32(HST_TE. &mfs_set).

mfs_sug).&vb).&v2). &mfs_set).&vf).&va).&v0).*/ } /*&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&*/ /* End setpoints1 */ /*&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&*/ /******************************************************************/ /* Read DPRAM */ /******************************************************************/ void ReadDPRAM(void) { Get_DPRAM_Float_32(f0. &te_set).26 .&v7).&v14). scanf("%f".&v4). /*Get_DPRAM_Float_32(f3. &te_set).te_set). Get_DPRAM_Float_32(f4. Get_DPRAM_Float_32(f15. Get_DPRAM_Float_32(f5.&v6). &mfs_set). /*Get_DPRAM_Float_32(f7.&v5). scanf("%f". printf("\nTorque setpoint N/m: ").&v15). Get_DPRAM_Float_32(f2. scanf("%f".&v9).*/ A. printf("\nFlux set point: ").&vd). Put_DPRAM_Float_32(MFS. Get_DPRAM_Float_32(f12. /* because squared value */ mfs_sug=0. Get_DPRAM_Float_32(ff. Get_DPRAM_Float_32(f11.te_set). te_set_d=te_set. Put_DPRAM_Float_32(MFS.&v10).&v1).&v12). Get_DPRAM_Float_32(fd. Get_DPRAM_Float_32(f1.&vc).&ve). */ /*20*/ /*Get_DPRAM_Float_32(f14. /*10*/ /*Get_DPRAM_Float_32(fa. scanf("%f".&v11).mfs_set). Get_DPRAM_Float_32(f8. printf("Torque setpoint N/m: "). Put_DPRAM_Float_32(TE. Get_DPRAM_Float_32(fb. Get_DPRAM_Float_32(f13. printf("\nThe suggested optimized flux value is %lf". /*Get_DPRAM_Float_32(f9. Get_DPRAM_Float_32(fc. Get_DPRAM_Float_32(f6. Get_DPRAM_Float_32(fe.&v8). Get_DPRAM_Float_32(f10.Appendixes.&v13).mfs_set). Put_DPRAM_Float_32(TE. /*old version */ /* printf("\nFlux set point: ").&v3).3665*sqrt(te_set_d).

*/ } /*&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&*/ /* End save data */ /*&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&*/ /******************************************************************/ /* Stop DSP */ /******************************************************************/ void AturaDSP(void) { stop=1. dt[14][j]=ve. Put_DPRAM_Word_32(STOP. dt[16][j]=v10. dt[12][j]=vc. dt[2][j]=v2. /*dt[3][j]=v3.Appendixes. dt[1][j]=v1. } /*&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&*/ /* End read DPRAM */ /*&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&*/ /******************************************************************/ /* Savedata */ /******************************************************************/ void Savedata(void) { dt[0][j]=v0. dt[19][j]=v13.27 . dt[8][j]=v8. dt[21][j]=v15. dt[13][j]=vd. dt[15][j]=vf. dt[11][j]=vb. stop). dt[6][j]=v6. dt[17][j]=v11. /*dt[9][j]=v9.*/ /*20*/ /*dt[20][j]=v14. dt[5][j]=v5. dt[4][j]=v4. /*dt[7][j]=v7. /*10*/ /*dt[10][j]=va. } /*&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&*/ /* End stop DSP */ /*&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&*/ /******************************************************************/ /* Data2file */ /******************************************************************/ void Data2file(void) { A. dt[18][j]=v12.

dt[0][k].GRF".dt[5][k].k<j. } fclose(f_grf). } } /*&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&*/ /* End Data2file */ /*&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&*/ A.dt[1][k]. "w")) == 0) { printf("Unable to open file").28 .k++) { /* fprintf(f_grf. if ((f_grf = fopen("\\DTC2.dt[2][k].dt[6][k]).*/ fprintf(f_grf. return. } else { for(k=0.dt[3][k].dt[2][k]).dt[0][k].dt[4][k]. "%e %e %e \n".dt[1][k].Appendixes. "%e %e %e %e %e %e %e \n".

29 .C */ /* Description: FLDTC */ /*_________________________*/ /* arc tangent function */ #include <c:\proves\math.Appendixes.1. A.h> /* DPRAM Positions */ #define posicio_memoria_FLAG 0x0c00009 /*Flag*/ #define posicio_memoria_COUNTER 0x0c0000a #define posicio_memoria_mfs_hst 0x0c0000b /*Flux set point_hst margin*/ #define posicio_memoria_te_hst 0x0c0000c /*Electr. torque set point*/ #define posicio_memoria_STOP 0x0c00012 /*Stop bit*/ /* Start obtaining the DC */ #define posicio_memoria_START 0x0c00013 /*Start bit*/ /* Errors in obtaining the DC */ #define posicio_memoria_ERROR 0x0c00014 /*Number of errors*/ /* FLC1 references values */ #define posicio_memoria_FLUX_ANGLE_I 0x0c00015 /*Flux angle*/ #define posicio_memoria_TE_ERR_I 0x0c00016 /*Torque error i+1*/ #define posicio_memoria_WM 0x0c00017 /*Motor speed */ #define posicio_memoria_FI 0x0c00018 /*FI=0 flux decrease */ /*FI=1 increase */ /* FLC2 refernces values */ #define posicio_memoria_TE_ERR_I_1 0x0c00019 /*Torque error i*/ #define posicio_memoria_COUNT1 0x0c0001a /*Increment Torque error i+1*/ #define posicio_memoria_DC_AUX #define posicio_memoria_INC_DC #define posicio_memoria_EQ /* duty cycle */ #define posicio_memoria_DCFLC1 #define posicio_memoria_DCFLC2 #define #define #define #define #define #define #define #define #define #define posicio_memoria_f0 posicio_memoria_f1 posicio_memoria_f2 posicio_memoria_f3 posicio_memoria_f4 posicio_memoria_f5 posicio_memoria_f6 posicio_memoria_f7 posicio_memoria_f8 posicio_memoria_f9 0x0c0001d /*Last duty cycle*/ 0x0c0001e /*FLC2 set point*/ 0x0c0001f /*Equal signal*/ 0x0c0001b 0x0c0001c /*Duty cycle from FLC1*/ /*Duty cycle from FLC2*/ 0x0c00048 0x0c00049 0x0c0004a 0x0c0004b 0x0c0004c 0x0c0004d 0x0c0004e 0x0c0004f 0x0c00050 0x0c00051 A. torque set point_hst margin*/ #define posicio_memoria_mfs_set 0x0c0000d /*Flux set point*/ #define posicio_memoria_te_set 0x0c0000e /*Electr.c /* File : TH1_9.TH1_9.3 .

/* Direccio registre de control del timer 1 */ A.data").141592654 asm(" .30 . /*10*/ #define #define #define #define #define #define #define #define #define #define /*20*/ #define #define #define #define #define #define #define #define #define #define /*30*/ #define #define #define #define #define #define #define #define #define #define /*40*/ #define #define #define #define #define #define #define #define posicio_memoria_fa posicio_memoria_fb posicio_memoria_fc posicio_memoria_fd posicio_memoria_fe posicio_memoria_ff posicio_memoria_f10 posicio_memoria_f11 posicio_memoria_f12 posicio_memoria_f13 posicio_memoria_f14 posicio_memoria_f15 posicio_memoria_f16 posicio_memoria_f17 posicio_memoria_f18 posicio_memoria_f19 posicio_memoria_f1a posicio_memoria_f1b posicio_memoria_f1c posicio_memoria_f1d posicio_memoria_f1e posicio_memoria_f1f posicio_memoria_f20 posicio_memoria_f21 posicio_memoria_f22 posicio_memoria_f23 posicio_memoria_f24 posicio_memoria_f25 posicio_memoria_f26 posicio_memoria_f27 posicio_memoria_f28 posicio_memoria_f29 posicio_memoria_f2a posicio_memoria_f2b posicio_memoria_f2c posicio_memoria_f2d posicio_memoria_f2e posicio_memoria_f2f 0x0c00052 0x0c00053 0x0c00054 0x0c00055 0x0c00056 0x0c00057 0x0c00058 0x0c00059 0x0c0005a 0x0c0005b 0x0c0005c 0x0c0005d 0x0c0005e 0x0c0005f 0x0c00060 0x0c00061 0x0c00062 0x0c00063 0x0c00064 0x0c00065 0x0c00066 0x0c00067 0x0c00068 0x0c00069 0x0c0006a 0x0c0006b 0x0c0006c 0x0c0006d 0x0c0006e 0x0c0006f 0x0c00070 0x0c00071 0x0c00072 0x0c00073 0x0c00074 0x0c00075 0x0c00076 0x0c00077 #define PI 3.Appendixes.

03h"). /* Direccio registre de control de la DIO32 /* #define CONTROL 00828005 */ asm("CONTROL . 004F0900h"). 02h").word 00808064h").word . .long 00828006h"). asm("PERIOD .word . 04h").long 00828007h").equ .word 06000000h"). asm("posicio_DIO3 . asm("dio1 .long 00828005h").set 00000601h"). /* #define RSTCTRL 00000601 */ asm("RSTCTRL . asm("posicio_DIO4 . . /* #define PORTREG 00828007 */ asm("PORTREG .long 00808030h").Appendixes.long 450").word .long 00828002h").long dio1"). 00000000h").equ 01h"). 05h").31 .long 00ff0000h"). asm("c1 . /* Direccio registre de configuracio de la DIO32 asm("COUNTDPRAM . 00808068h").word 0081A000h"). asm("posicio_DIO2 .long 00828000h").long 0c00016h"). . */ */ /* Defineixo les adreces dels quatre canals anal•gics*/ /* #define posicio_DIO 0828000 */ asm("posicio_DIO . 00808060h").long 00828004h").equ .word . /* Paraula de control que engega el timer 1 /* #define SETCTRL 000006c1 */ asm("SETCTRL . /* Map Registers AMELIA2 */ asm("DR3 asm("DR0 asm("DR2 asm("TMR0 asm("TMR1 . asm("TIMECTRL .long 00808034h").long 00808038h"). 00070900h"). /* Timer 1 register adresses */ asm("COUNTER .word .word 0000ffffh").set 000006c1h"). A.equ . asm("pointerdio . */ asm("STR0A asm("STR0D asm("STR1A asm("STR1D asm("IOSTRA asm("IOSTRD asm("AMELIA0 asm("ITTP asm("Mascara .equ .

A. . asm("DR1 asm("IMR asm("CTR asm("ECTR asm("SMR asm("CMR asm("ISR asm("DCR asm("SDC asm("ECFR asm("CFR . 08h").equ .Appendixes. 81B00Ah").equ .word . 0eh").word 81B005h").int05\""). /* pointers */ long * pointer_FLAG=(long *)posicio_memoria_FLAG.word . 0ch").equ 06h"). .word .int01\"").word . 0ah"). .equ .sect \".sect \".word _c_int02").word . /* End int label section */ asm(" . 81B006h").word 000010000h"). 0a4000000h"). 000f20000h").equ . 0fd9b0000h").word .equ . 0fh").word _c_int05"). long * pointer_COUNTER=(long *)posicio_memoria_COUNTER. 09h").word .word _c_int10").sect \".equ .int02\"").text"). 08dff0000h").word _c_int01"). 81B008h"). 0dh"). 81B002h").32 . long * pointer_ERROR=(long *)posicio_memoria_ERROR. .int10\"").equ .word .word . . 0bh"). . float * pointer_te_set=(float *)posicio_memoria_te_set. float * pointer_mfs_set=(float *)posicio_memoria_mfs_set. 81B00Bh").equ . /* Program section called 'int0X' where the interruprion vector is placed*/ /* c_int0X is the name of the rotuine address */ asm(" asm(" asm(" asm(" asm(" asm(" asm(" asm(" .sect \".word . 0001e0000h"). 81B00Fh"). .equ . . 81B00Ch").equ . 0ah").word .word . /* Map Register AMELIA2 */ asm("TIMER1 asm("UCR asm("ACR asm("CONFIG asm("IMR1 asm("DCR1 asm("CH0 asm("CH1 /* Constants */ asm("IMR1_DEF asm("DCR1_DEF asm("TIMER1_DEF asm("UCR_DEF asm("ACR_DEF asm("CONFIG_DEF . 07h").

float * pointer_te_hst=(float *)posicio_memoria_te_hst.33 . long * pointerSTOP=(long *)posicio_memoria_STOP. long * pointer_count1=(long *)posicio_memoria_COUNT1. pointerff=(float *)posicio_memoria_ff. *)posicio_memoria_f3. *)posicio_memoria_f6. *)posicio_memoria_f19. float * pointer_dc_aux=(float *)posicio_memoria_DC_AUX. *)posicio_memoria_f18. *)posicio_memoria_f1f. pointerfc=(float *)posicio_memoria_fc.Appendixes. pointerf11=(float *)posicio_memoria_f11. *)posicio_memoria_f7. *)posicio_memoria_f8. *)posicio_memoria_f9. *)posicio_memoria_f5. long * pointerSTART=(long *)posicio_memoria_START. *)posicio_memoria_f4. float * pointer_te_err_i=(float *)posicio_memoria_TE_ERR_I. long * pointerEQ=(long *)posicio_memoria_EQ. *)posicio_memoria_f20. long * pointerFI=(long *)posicio_memoria_FI. long * pointerDCFLC2=(long *)posicio_memoria_DCFLC2. float * pointer_mfs_hst=(float *)posicio_memoria_mfs_hst. *)posicio_memoria_f1c. pointerfe=(float *)posicio_memoria_fe. *)posicio_memoria_f2. *)posicio_memoria_f16. pointerf12=(float *)posicio_memoria_f12. long * pointerDCFLC1=(long *)posicio_memoria_DCFLC1. *)posicio_memoria_f1. *)posicio_memoria_f15. float * float * float * float * float * float * float * float * float * float * /*10*/ float * float * float * float * float * float * float * float * float * float * /*20*/ float * float * float * float * float * float * float * float * float * float * /*30*/ float * float * float * float * float * pointerf0=(float pointerf1=(float pointerf2=(float pointerf3=(float pointerf4=(float pointerf5=(float pointerf6=(float pointerf7=(float pointerf8=(float pointerf9=(float *)posicio_memoria_f0. pointerf14=(float pointerf15=(float pointerf16=(float pointerf17=(float pointerf18=(float pointerf19=(float pointerf1a=(float pointerf1b=(float pointerf1c=(float pointerf1d=(float pointerf1e=(float pointerf1f=(float pointerf20=(float pointerf21=(float pointerf22=(float *)posicio_memoria_f14. float * pointer_flux_angle_i=(float *)posicio_memoria_FLUX_ANGLE_I. pointerfb=(float *)posicio_memoria_fb. *)posicio_memoria_f21. A. pointerf10=(float *)posicio_memoria_f10. pointerfd=(float *)posicio_memoria_fd. *)posicio_memoria_f1d. *)posicio_memoria_f1a. *)posicio_memoria_f1b. float * pointer_inc_dc=(float *)posicio_memoria_INC_DC. float * pointer_wm=(float *)posicio_memoria_WM. pointerf13=(float *)posicio_memoria_f13. *)posicio_memoria_f22. pointerfa=(float *)posicio_memoria_fa. *)posicio_memoria_f17. *)posicio_memoria_f1e.

*)posicio_memoria_f29. float fin3.te_hst=0.STOP=0. *)posicio_memoria_f26. int te_e=0.count1.wrrds_2=0.DC2=0. float dc_aux=1.te_nlim=0. A. float sectbis_aux=0.COUNTER=0.ERROR=0.e_fd_ti=0xaa.index3. *)posicio_memoria_f2b.ch2=0.e_fi_td=0xaa. float * float * float * float * float * /*40*/ float * float * float * float * float * float * float * float * pointerf23=(float pointerf24=(float pointerf25=(float pointerf26=(float pointerf27=(float pointerf28=(float pointerf29=(float pointerf2a=(float pointerf2b=(float pointerf2c=(float pointerf2d=(float pointerf2e=(float pointerf2f=(float *)posicio_memoria_f23. /*FLC1 variables*/ int DCFLC1=0.Appendixes.fsD=0.index2. /* DTC variables */ int e1=0x95.e_fd_ti_b=0.frQ=0.START=0.*pch2=&ch2.s=0.wrrds_3=0. *)posicio_memoria_f2c. *)posicio_memoria_f27.Wpc.frQ_1=0. /* FLDTC variables */ int COUNTER_AUX=0.mfs_e=0.*pch1=&ch1.in2. /* adquisition variables*/ long int ch0=0.angbisfloat=0. float te_err_i_1=0.34 . int EQ_aux=0. /* estimator zoh variables */ float isD=0.isQ=0. long int *pch0=&ch0.index1.FI=0. int e_fi_ti_b=0. *)posicio_memoria_f2d. int d=0. float te_err_i=0. *)posicio_memoria_f24. float ch0_float=0. int e1_b=0.FLAG=0.mfs=0.ang=0.DC=0.sect=0.frD=0.ch2_float=0. float mfs_set=0.isQ_1=0. float te_1=0. *)posicio_memoria_f25. float frD_1=0.te=0.wrrds_1=0. float wrrds=0. /* FLC2 variables */ int DCFLC2=0.te_set=0. int e_fi_ti=0xaa.inc_te_i=0. *)posicio_memoria_f2f. int e1_b_1=0.e_fi_td_b=0.EQ=0.mfs_plim=0.e2=0x95.inc_dc=0.wm=0.e_fd_td=0xaa. float te_plim=0.e7=0x95.fsQ=0.Tpc. *)posicio_memoria_f28.mfs_hst=0.isD_1=0.mfs_nlim=0.ERROR_FLAG=0.e0=0xbf. *)posicio_memoria_f2a. *)posicio_memoria_f2e.ch1_float=1.ch1=0. /* aux*/ int in1.e_fd_td_b=0.wrrds_4=0.

AR0").P=2. void void void void void void void void void void void void void void void void /* /* /* /* Amelia int */ Amelia int */ Control */ Timer */ set_amd16qs(void). /* saving data in DPRAM_2 */ send_active_state(void).*AR0").etz1_6=0. } while (STOP==1).Appendixes.816496. float etz1_25=0. void c_int10(void).*AR0").R0"). /* saving data in DPRAM */ save_data_DPRAM_2(void).AR0"). /* dtc */ save_data_DPRAM(void).30563. int sectbis=0. asm(" LDP IOSTRD.c=0. @STR0A. /* Functions */ void c_int01(void). /* save the active state */ program_timer1(void). /* TIMER 1 inizialization */ atn_table (void). @STR0D. /* ADC inizialization */ set_amd16sa(void). asm(" LDP IOSTRA.05.*AR0"). asm(" STI R0. /************************************************************************/ /* Funcio : main */ /************************************************************************/ void main(void) { asm(" asm(" asm(" asm(" LDP LDP LDP STI STR0A.Lm=0.DP").R0"). void c_int05(void). /* read 2 currents + wm */ flux_torque_est_zoh(void). do { STOP=*pointerSTOP.etz2_5=0. double angbis=0. /* ADC inizialization */ dio32(void).Lr=0.stz=0. /* DIO inizialization */ set_c32_timer1(void). asm(" STI R0.9960652825. /* Flux and torque estimation zoh */ dtc(void).99803070219.35 . bit0(void). /* Get Duty cycle */ bit1(void). /* send the active state */ save_active_state(void). /* Timer 1 programing*/ get_DC(void).32023. float Rr=5. void c_int02(void). /* ATN table */ get_ADC(void).9973751317.R0"). /* null state to VSI */ dio32(). asm(" LDP STR1A. float Lx=0.0091376. A.table[402]. R0.AR0"). asm(" LDP STR1D.

for(s=0. asm(" LDI @posicio_DIO. } while (STOP==0). te_plim=te_set+te_hst. asm(" LDI @ITTP. A.IE").8. mfs_hst=*pointer_mfs_hst. if (STOP == 0) { atn_table().IF"). te_hst=*pointer_te_hst.IE").ST").36 . /* Globals int enable */ asm(" OR 2000h.Appendixes.s<20. set_amd16sa(). } do { STOP=*pointerSTOP. /* ini ADC */ set_amd16qs(). /* disconnect VSI */ asm(" LDI 00ffh. /* Start Cache */ asm(" OR 0800h. asm(" LSH 16. Tpc=te_set*100/9. /* getting the reference values */ mfs_set=*pointer_mfs_set. te_nlim=te_set-te_hst. *pointer_ERROR=ERROR. *pointer_COUNTER=COUNTER. asm(" STI R1. /* Enalbing interruptions INT0 +INT1 + INT5 of PC/C32 board */ asm(" LDI 0013h.R1").ST"). te_set=*pointer_te_set.s++) { } s=0. mfs_plim=mfs_set+mfs_hst. /* dis int */ asm(" AND 0000h.R1").ST"). mfs_nlim=mfs_set-mfs_hst. asm(" AND 0000h. } /************************************************************************/ /* End function : main */ /************************************************************************/ /************************************************************************/ /* Funcio : c_int01 */ /* Amelia2 A int*/ /************************************************************************/ void c_int01(void) { asm(" PUSH AR0").*AR1").AR1").

AR0").AR2").R0").R0"). *+AR0(DR1). PUSH R0"). /* int 05 is set*/ asm(" OR 010h. *+AR0(DR0). *+AR0(DR2).*AR2"). -16. *+AR0(DR3). *+AR0(DR1).R0"). asm(" PUSH AR1").R0").R0"). asm(" POP AR0"). /* disable int*/ asm(" ANDN 2000h. R0. asm(" PUSH R0").R0").R0").R0").R0").R0"). *+AR0(DR2).R0"). asm(" asm(" asm(" asm(" asm(" asm(" asm(" asm(" asm(" asm(" asm(" asm(" asm(" asm(" asm(" asm(" asm(" asm(" asm(" asm(" asm(" LDI @AMELIA0.ST").Appendixes. *+AR0(DR0).IF").R0").R0").R0").37 . asm(" PUSH AR2"). A. *+AR0(DR0). } /************************************************************************/ /* End Function : c_int01 */ /************************************************************************/ /************************************************************************/ /* Funcio : c_int02 */ /* AMELIA2 B int */ /************************************************************************/ void c_int02(void) { asm(" PUSH AR0"). /* erase this interrupt flag */ asm(" ANDN 1h. asm(" asm(" PUSH AR2"). *+AR0(DR2). LDI LDI LDI LDI LDI LDI LDI LDI LDI LDI LDI LDI LDI LDI LDI ASH LDI STI LDI *+AR0(DR0). *+AR0(DR2). asm(" POP R0"). *+AR0(DR3). LDI *+AR0(ISR).R0"). *+AR0(DR1). *+AR0(DR3).R0"). asm(" POP AR2"). *+AR0(DR3).R0").R0"). *+AR0(DR1).IF"). @_pch2.

program_timer1(). LDI LDI LDI LDI ASH LDI STI ASH LDI STI POP POP POP POP POP @CH0.*AR2").R1"). R1.ST"). *pointerSTART=1.AR2"). /* erase this interrupt flag */ asm(" ANDN 2h. dtc(). } /************************************************************************/ /* End function : c_int02 */ /************************************************************************/ /************************************************************************/ /* Funcio : c_int05 (166 us) */ /************************************************************************/ void c_int05 (void) { /* *pointer_FLAG = 0. R0"). -16. asm(" asm(" asm(" asm(" asm(" asm(" asm(" asm(" asm(" asm(" asm(" asm(" asm(" asm(" asm(" asm(" asm(" LDI @IMR1.*/ save_data_DPRAM_2(). @_pch1.*/ bit1(). /* DC=0.AR0"). flux_torque_est_zoh().38 . AR1"). get_ADC().d++) { } d=0. get_DC().R0").AR1").R0").AR0"). flc_set_points().R1"). /* save_data_DPRAM(). LDI *AR0. @_pch0.AR0"). asm(" LDI @PERIOD.IF"). send_active_state(). R0. @CH1.Appendixes. A.AR2"). *AR0.R0").*AR2"). /* disable int*/ asm(" ANDN 2000h. R1"). for(d=0. AR2"). -16. *AR1. asm(" PUSH R1"). AR0").d<150. bit0().

/* get isA. STI R0.*/ } /************************************************************************/ /* End c_int05 (166us) */ /************************************************************************/ /************************************************************************/ /* Funcio : get_ADC (estimator) /* Retorna : res */ /************************************************************************/ void get_ADC (void) { /* disable int*/ asm(" ANDN 2000h. /* A.155273438e-5*7. 6e-2volts / 1rpm */ ch2_float=-(1.155273438e-5*10*4.11/7)+3.5e-3.10965*6e-4)).0*ch0*9. 1volt / 10 amp */ /* LEM probe */ ch0_float=-(1.11/7)-3. /* enalbe global int*/ asm(" OR 2000h. /* 65535 / 4volts .39 . 1volt / 7.1*1. float aux=0. /* Tektronic Probe */ ch1_float=-(1.Appendixes. frD_1=frD. } /************************************************************************/ /* End function : get_ADC (estimator) */ /************************************************************************/ /************************************************************************/ /* flux_torque_est_zoh */ /************************************************************************/ void flux_torque_est_zoh(void) { /* using the square value */ double sqr=0.*AR0").15).ST").*/ /* /* bit1().*/ /* 65535 / 6volts .015*6.isB.*AR0"). STI R0.0*ch0*9.AR0").wm */ /* 65535 / 6volts .103515625e-5/(1.IE").0*(ch2-170.5)*6. int index=0.85/5. ch1_float=-(1.0*ch1*9.1*1.0922 amp */ ch0_float=-(1. LDI @TIMECTRL. LDI SETCTRL.155273438e-5*7.R0").155273438e-5*10).0*ch1*9. OR 200h.R0"). asm(" asm(" asm(" asm(" asm(" asm(" LDI @_DC.ST").0e-2. */ save_data_DPRAM().03*6.

332895663e-3*wrrds_1*frD_1)+(etz1_6*frQ_1). isQ_1=isQ. isQ=0. wrrds_4=wrrds_3.0298975)+(frD*0. te_1=te. isD=1.499015431e-3*wrrds_1*frQ_1)+(etz2_5*frD_1). mfs=sqrt(sqr). frQ=(1. /* may be it could be just used the square value */ sqr=(fsD*fsD)+(fsQ*fsQ).7071067*ch0_float). fsQ=(isQ*(Lx/Lm))+(frQ*(Lm/Lr)).499015431e-3*wrrds_1*frD_1)+(etz2_5*frQ_1).*/ wrrds=(wrrds_4+wrrds_3+wrrds_2+wrrds_1+(0. isD_1=isD. wrrds_3=wrrds_2.95*(1. angbisfloat=(float)angbis.*/ frD=(0.*/ /* using the table */ aux=fsQ/fsD.104719*ch2_float))/5.Appendixes. angbis=table[index]. frQ=(((1-etz1_6)*((Lm*isQ_1)+((Lr/Rr)*P*wrrds_1*frD_1)))+(etz1_6*frQ_1)). /* frD=(((1-etz1_25)*((Lm*isD_1)-((Lr/Rr)*P*wrrds_1*frQ_1)))+(etz1_25*frD_1)). } if( aux < 1 ) {index=(int)(aux*100). /* using the square value */ /* mfs=(fsD*fsD)+(fsQ*fsQ).40 .80223847e-3*isD_1)-(0.3435028*ch1_float)+(0. if (aux < 0) {aux=aux*(-1). frQ=(0.*/ /*frD=(1.332895663e-3*wrrds_1*frQ_1)+(etz1_6*frD_1).*/ fsD=(isD*0. frQ=(((1-etz1_25)*((Lm*isQ_1)+((Lr/Rr)*P*wrrds_1*frD_1)))+(etz1_25*frQ_1)).9544077).4142135*ch1_float)+(0. frQ=(((1-etz2_5)*((Lm*isQ_1)+((Lr/Rr)*P*wrrds_1*frD_1)))+(etz2_5*frQ_1)).*/ /*frD=(((1-etz1_6)*((Lm*isD_1)-((Lr/Rr)*P*wrrds_1*frQ_1)))+(etz1_6*frD_1)). wrrds_1=wrrds. wrrds=(wrrds_4+wrrds_3+wrrds_2+wrrds_1+(2*PI/60*ch2_float))/5.9544077).*/ isQ=(1. */ /* fsD=(isD*(Lx/Lm))+(frD*(Lm/Lr)).20256771e-3*isD_1)-(0.2247*ch0_float.7071067*ch0_float).20256771e-3*isQ_1)+(0. wrrds_2=wrrds_1.0298975)+(frQ*0. frQ_1=frQ. /* /* /*frD=(((1-etz2_5)*((Lm*isD_1)-((Lr/Rr)*P*wrrds_1*frQ_1)))+(etz2_5*frD_1)).80223847e-3*isQ_1)+(0. fsQ=(isQ*0. } A.

(PI/2 < angbisfloat) sectbis=3. } if ( fsD > 0) { if( fsQ < 0) {angbisfloat=(float)((-1)*angbis). (-PI/6 < angbisfloat) sectbis=1. else if ( aux >= 100) {angbis=table[199]. } /************************************************************************/ /* End function: flux_torque_est_zoh */ /************************************************************************/ /************************************************************************/ /* dtc */ /************************************************************************/ void dtc (void) /* needed for FLDTC */ e1_b_1=e1_b. else if ( mfs < mfs_nlim) mfs_e = 1.Appendixes. ((-PI/2) < angbisfloat) sectbis=6.} } else { if( fsQ > 0) {angbisfloat=PI+((-1)*angbisfloat). angbis=table[index]. ((5*PI/6) < angbisfloat) sectbis= 4.} } if if if if if if if /* (-PI < angbisfloat ) sectbis=4. te=P*c*((fsD*isQ)-(fsQ*isD)). (PI/6 < angbisfloat) sectbis=2. { switch(sectbis) { case 1: A. } else {index=(int)(aux+99). angbisfloat=(float)angbis. if ( mfs > mfs_plim) mfs_e = 0. angbisfloat=(float)angbis.41 . else te_e = 2. if ( te > (te_plim)) te_e = 0. ((-5*PI/6) < angbisfloat ) sectbis=5.632992*((fsD*isQ)-(fsQ*isD)).} else {angbisfloat=(angbisfloat-PI).*/ te=1.

42 . case 2: e_fi_ti=0xa6. e_fi_td=0x9a. e_fd_td=0xa5. break. e_fd_ti_b=4. e_fi_ti_b=5. e_fi_ti_b=4. break. e_fi_td=0xa5. e_fd_ti=0x9a.Appendixes. e_fi_td=0xa6. e_fd_td_b=2. e_fi_td=0x96. e_fi_td=0x99. e_fd_ti_b=5. e_fi_ti_b=2. case 5: e_fi_ti=0x99. e_fd_td_b=6. case 3: e_fi_ti=0x96. break. e_fd_ti=0xa6. e_fd_ti_b=6. e_fi_td_b=2. e_fi_ti_b=6. e_fi_td_b=5. e_fd_td_b=1. e_fd_ti=0x96. e_fd_td=0x96. e_fd_ti_b=3. e_fd_td=0x99. e_fi_ti=0xa5. e_fd_ti=0xa9. case 6: e_fi_ti=0xa9. e_fi_ti_b=1. break. e_fd_ti_b=1. e_fd_ti=0x99. e_fd_td=0xa6. break. e_fi_td_b=3. e_fi_td_b=6. e_fi_td=0xa9. e_fd_ti=0xa5. case 4: e_fi_ti=0x9a. e_fi_ti_b=3. e_fd_td_b=3. e_fd_td_b=5. e_fi_td_b=1. e_fi_td_b=4. e_fd_td=0xa9. A. e_fd_td=0x9a.

e1_b = e_fd_ti_b.4) te_err_i = 1.7 FOR 166us */ { if (EQ == 0) { /* FLC1 */ te_err_i=(te_set-te)*0. if (te_err_i > 1. else EQ=0.43 . } break.4.} break.31. } else { e1 = e_fi_ti. e1_b = 0.683 FOR MOTOR 2 */ /* MULTIPLY 0. e1_b = e_fi_ti_b. e1_b = 0. case 1: if ( mfs_e == 0 ) { e1 = e0.4. e_fd_ti_b=2. A. if (te_err_i < -1. } /* needed for FLDTC */ if (e1_b == e1_b_1) EQ=1. } else { e1 = e0. e1_b = e_fi_td_b.4) te_err_i = -1. e1_b = e_fd_td_b. e_fd_td_b=4. } switch(te_e) { case 0: if ( mfs_e == 0 ) { e1 = e_fd_td. case 2: if ( mfs_e == 0 ) { e1 = e_fd_ti. } else { e1 = e_fi_td. break.} break.Appendixes. } /************************************************************************/ /* End function: dtc */ /************************************************************************/ /************************************************************************/ /* flc_set_points */ /************************************************************************/ void flc_set_points (void) /* MULTIPLY 0.5 FOR 250us */ /* MULTIPLY 0.

inc_te_i=(te-te_1)*0. if (inc_te_i < -0. *pointer_count1=count1.7. *pointerFI=in2.025)/0. in2=mfs_e. if (Tpc >= Wpc) {fin3=Tpc+Wpc+Wpc.3.29)+210.5. in2=(te_err_i_1+0.025)/0.05+14.*/ if ( inc_te_i > 0.7) te_err_i_1 = 0.7. /* rd 2 degress */ /* fin2=(fin2*180/PI)+180+30. index3=(fin3-100+7.31.05+14. count1=(11*13*index1)+(13*index2)+(index3). in2=mfs_e+10. } if (fin3 > 280) fin3 = 280.1)/0. Wpc=wrrds*100/146.5)/15. if (angbisfloat < 0) angbisfloat = 0.31.7) inc_te_i = -0. } else { /* FLC2 */ te_err_i_1=(te_set-te_1)*0. if (te_err_i_1 < -0. *pointerEQ=0.685. index1=((te_err_i+0.7) te_err_i_1 = -0. index2= (angbisfloat+3)/6. if (te_err_i_1 > 0.2)+7. in1=(inc_te_i+0. in2=angbisfloat/60.7.*/ index3=(fin3-92.*/ count1=(143*index1)+(13*index2)+(index3). te_err_i_1=0. if (angbisfloat > 60) angbisfloat = 60. *pointerFI=in2. angbisfloat=angbisfloat-60*in2. inc_te_i=-0.*/ angbisfloat=(angbisfloat*57. if (fin3 < 100) fin3 = 100. /* /* /* /* A. */ Wpc=wrrds*0.7 ) inc_te_i = 0.5)/15.44 . *pointer_count1=count1.7. count1=(29*in1)+in2.Appendixes. } else {fin3=Tpc+Tpc+Wpc.

/* inc_dc=*pointer_inc_dc.08 => 125ct */ /* 3125 for 250us */ A.92 => 1437ct */ /* dc=0. *pointerEQ=1. DC2=DC. START=*pointerSTART. ERROR_FLAG=1. } else { DC=*pointerDCFLC2.Appendixes.*/ /* dc=0. DC2=DC.45 . *pointer_dc_aux=dc_aux.5ct*/ /* 10us=8 % 125*/ /* dc=1 => all active state. } else { ERROR_FLAG=0.*/ } } } /************************************************************************/ /* End get_DC */ /************************************************************************/ /************************************************************************/ /* Function : program_timer1 */ /************************************************************************/ void program_timer1(void) { /* 1ct=80ns=80e-9s. if (START==1) { ERROR=ERROR+1. if (EQ == 0) { DC=*pointerDCFLC1. */ /* 125us=1562. 1562 ct. } } /************************************************************************/ /* End function: flc_set_points */ /************************************************************************/ /************************************************************************/ /* Function : get_DC */ /************************************************************************/ void get_DC(void) { COUNTER++.

/* SEND just a null state*/ asm(" LDI @_e0.R1").AR0"). asm(" STI R0. asm(" STI R0. asm(" LDI SETCTRL. asm(" STI R0.R0"). /* 2083 fpr 166us */ if ( DC > 2000 ) { /*do not program the timer 1.*/ dc_aux=(600+1000)/2083. Do not enable its interrupt*/ /*stop the timer wherever it was*/ asm(" LDI @TIMECTRL. asm(" STI R0. /*program the timer*/ asm(" LDI @PERIOD. } else if ( ERROR_FLAG == 1) { DC=600. asm(" LDI @_DC.AR0").48. } else { /* 70/166*2083 = 878 */ DC=DC2-1082. */ dc_aux=0.AR0").0.*AR0"). asm(" STI R0.AR0"). */ /*program the timer*/ asm(" LDI @PERIOD.768.*/ dc_aux=0.*AR1"). /*start the timer*/ /* /* /* /* /* A. asm(" LDI @posicio_DIO.IE"). dc_aux=1000/2083.R0").*AR0").0. asm(" LSH 16. asm(" LDI @_DC. send_active_state().*/ dc_aux=1. asm(" LDI RSTCTRL.AR0").*AR0"). asm(" STI R1. send_active_state().R0").R0"). asm(" LDI RSTCTRL. /*start the timer*/ asm(" LDI @TIMECTRL.AR1").*AR0").R1"). /*Enable timer 1 interupt */ asm(" OR 200h. Do not enable its interrupt*/ /*stop the timer wherever it was*/ asm(" LDI @TIMECTRL. DC=600.Appendixes.R0").46 .*AR0").0. } else if ( DC< 1084) { /*do not program the timer 1.

sectbis_aux=sectbis*(-1). /* as long as save_active_state is not used */ /* asm(" LDI @pointerdio. *pointerf3=e1_b_aux. *pointerf6=mfs_e.DC_b. } /************************************************************************/ /* End function: send_active_state */ /************************************************************************/ /************************************************************************/ /* Funcio : save_data_DPRAM (estimator) */ /* Retorna : res */ /************************************************************************/ void save_data_DPRAM (void) { float e1_b_aux. asm(" PUSH R1"). /*Enable timer 1 interupt */ asm(" OR 200h.*AR0").AR0").*/ /* asm(" LDI *AR1. asm(" POP AR1").*/ dc_aux=DC2/2083.R0").*AR1"). asm(" LDI SETCTRL. e1_b_aux=e1_b*(-1).47 . asm(" LDI @TIMECTRL. asm(" STI R1.R1"). asm(" POP R1").*/ asm(" LDI @posicio_DIO. *pointerf1=te_e.0. *pointerf4=sectbis_aux. asm(" LDI @_e1.*/ dc_aux=(DC+878)/2083.R1").R1").AR1"). DC_b=DC2/2083.IE").AR1"). *pointerf2=dc_aux. send_active_state(). asm(" LSH 16. te_aux=te. A.te_aux. *pointerf0=te.0. *pointerf5=mfs. } /* /* } /************************************************************************/ /* End program_timer1 */ /************************************************************************/ /************************************************************************/ /* send_active_state */ /************************************************************************/ void send_active_state (void) { asm(" PUSH AR1"). asm(" STI R0.Appendixes.0.

*pointerf0=e1_b. *pointerf1=mfs_aux. *pointerf8=te.te_set_aux. mfs_aux=mfs*(-1).*/ /* /* /* /* /* } /************************************************************************/ /* End function: save_data_DPRAM */ /************************************************************************/ /************************************************************************/ /* Funcio : save_data_DPRAM_2 (estimator) */ /* Retorna : res */ /************************************************************************/ void save_data_DPRAM_2 (void) { float mfs_set_aux. *pointerf7=EQ. *pointerf11=isDdef. te_aux=te. *pointerfd=sect. *pointerf10=wrrds. *pointerf3=te_aux. *pointerf7=mfs.mfs_aux. wrrds_aux=wrrds/(-10). *pointerf4=te_set. te_set_aux=te_set. *pointerf4=wrrds_aux. *pointerfc=ang.*/ /*10*/ *pointerfa=11.te_aux. *pointerf3=mfs_e. *pointerf2=te_e. *pointerf12=isQdef. *pointerf5=fsD. *pointerf9=mfs_set. *pointerfe=frD. *pointerf2=te_set_aux. *pointerf13=ange2.wrrds_aux.48 .*/ /*10*/ *pointerfa=wrrds_1.Appendixes. *pointerf1=sectbis_aux. */ *pointerfb=te. mfs_set_aux=mfs_set*(-1). } /************************************************************************/ A. *pointerf9=. *pointerf8=. *pointerff=frQ. *pointerf6=fsQ.*/ /*20*/ *pointer_FLAG = 1. *pointerf0=mfs_set_aux.

IF").R1"). asm(" PUSH R1"). asm(" POP R1"). asm(" STI R1. asm(" LDI RSTCTRL.R1"). } /************************************************************************/ /* End function: bit1 */ /************************************************************************/ /************************************************************************/ /* bit0 */ /************************************************************************/ void bit0 (void) { asm(" PUSH AR1").R1").R1"). asm(" LSH 16. asm(" STI R1.*AR1"). asm(" PUSH R1"). asm(" STI R1.AR1"). asm(" POP AR1").AR1"). /* End function: save_data_DPRAM_2 */ /************************************************************************/ /************************************************************************/ /* bit1 */ /************************************************************************/ void bit1 (void) { asm(" PUSH AR1").Appendixes. asm(" LDI @posicio_DIO2. asm(" PUSH R1").AR1"). /* stop the timer1 */ asm(" LDI @TIMECTRL. /* clean the int */ asm(" ANDN 200h. A. asm(" POP R1").R1"). asm(" LDI 00ffh.ST"). asm(" POP AR1"). asm(" PUSH AR1").*AR1"). asm(" LSH 16.49 . asm(" LDI @posicio_DIO2.*AR1"). asm(" LDI 0000h. } /************************************************************************/ /* End function: bit0 */ /************************************************************************/ /************************************************************************/ /* Function : c_int10 (timer 1 interruption) */ /************************************************************************/ void c_int10(void) { /* disable int*/ asm(" ANDN 2000h.

*AR1").AR1").*+AR0(CFR)"). LSH 16.AR1").*+AR0(CMR)"). asm(" STI R0. asm(" PUSH R1").50 . */ /************************************************************************/ /************************************************************************/ /* Function: set_amd16qs */ /* It inizializates the board AM/D16QS. asm(" POP AR1"). asm(" LDI @_e1.R0").AR0").*+AR0(DCR)"). asm(" STI R1.Appendixes. } /************************************************************************/ /* End: save_active_state */ /************************************************************************/ /************************************************************************/ /* Inizialization tasks.R1"). A.R0"). asm(" LDI @posicio_DIO. */ /*************************************************************************/ void set_amd16qs(void) { asm(" LDI @AMELIA0.*AR1"). asm(" LSH 16.R1"). asm(" POP R1").R0").R1"). /* send the null state */ asm(" LDI @_e0. Exectuted just once. /* reset AM/D16QS board*/ asm(" LDI 0000h. asm(" LSH 16. asm(" STI R1.R1"). asm(" STI R0. asm(" asm(" asm(" LDI 0010h. asm(" LDI @pointerdio. STI R0. } /************************************************************************/ /* End c_int10 (timer 1 interruption) */ /************************************************************************/ /************************************************************************/ /* save_active_state */ /************************************************************************/ void save_active_state (void) { asm(" PUSH AR1"). asm(" POP R1"). asm(" POP AR1").

/* 100% */ asm(" LSH 16. It is reset either reading ISR */ /* or reading the channels */ asm(" asm(" asm(" LDI 00A0h. factor 1/8 MCLK_0 and MCLK_1 as an output */ /*asm(" LDI 28E0h.R0").R0"). /* /2 24 16 */ /*asm(" LDI 28E2h. /* 32 16 8 4 */ /* 48 24 12 6 */ asm(" LSH 16. asm(" STI R0.R0"). when buffer if full at the specified % asm(" LDI 2000h.*/ /* 25% */ /*asm(" LDI 0001h. Enhanced Configuration Register */ /* 00A0h: level int.R0"). /* Config. asm(" STI R0. /* Config. asm(" STI R0.*/ asm(" LDI 00E6h.R0").R0"). AMELIA2 int. /* Config.*/ /*asm(" LDI 0002h. when buffer FIFO is 100% full*/ /*asm(" LDI 0000h.*+AR0(IMR)"). */ A.R0"). asm(" LSH 16. It is cte */ asm(" LDI 8010h.R0")..*/ asm(" LDI 0003h. divide 384 */ /* enable chanals 2 i 3 and M_CLOCK_0 */ /*asm(" LDI 00F6h. asm(" STI R0. Interrupt Mask Register */ /* Value 2000h int.*+AR0(CTR)"). Serial Data Configuration Register */ /* 00c0h: Enable AMELIA2 */ asm(" LDI 00c0h.51 .*+AR0(ECTR)").*+AR0(ECFR)"). Master config.R0").R0").R0"). /* Config.R0").R0").R0").R0"). LSH 16. Configuration Register */ /* Value 8010h. /* Config.*+AR0(CFR)").R0"). /* User Control register config.R0").*+AR0(CMR)").R0"). asm(" LSH 16.*/ /* /4 12 8 */ /*asm(" LDI 28E3h. asm(" STI R0.Appendixes. asm(" LSH 16.R0"). el Amelia Control Register */ /* Value 00F6h: out of reset. /* Config.*/ /* /8 6 4 */ asm(" LSH 16.R0"). asm(" STI R0.*/ /* /1 48 32 */ asm(" LDI 28E1h. STI R0.R0").*+AR0(SDC)"). Enhanced Control Register */ /* Value 0003h.*/ /* Value 28E3h: TCLK0 clk.

R0").R0"). *+AR0(DR2).AR0"). *+AR0(DR3). asm(" asm(" asm(" asm(" asm(" asm(" LDI @UCR. *+AR0(DR2). asm(" LDI @DCR1_DEF.*AR0"). LDI @ACR. asm(" BNZ Calib_wait"). asm(" asm(" asm(" asm(" asm(" asm(" asm(" asm(" LDI LDI LDI LDI LDI LDI LDI LDI *+AR0(DR0).R0"). STI R0.52 .R0").*/ asm(" LDI 0300h.R0").R0"). asm(" LDI *+AR0(DR2).Appendixes. asm(" LDI *+AR0(DR1). /* Wait loop calibration system */ /*asm(" LDI 0800h. STI R0.R0"). (reading ISR) */ asm(" LDI *+AR0(ISR). asm(" LSH 13.R0").R0").R0").R0").R0"). A. asm("Calib_wait: SUBI 01h. asm(" LSH 15. *+AR0(DR0). *+AR0(DR1). asm(" LDI *+AR0(DR0). *+AR0(DR3). LDI @ACR_DEF. asm(" LDI *+AR0(DR3). asm(" LDI *+AR0(DR1). */ /************************************************************************/ void set_amd16sa(void) { asm(" LDI @DCR1.R0"). asm("Calib_wait: SUBI 01h. asm(" LDI *+AR0(DR2).R0"). /* Clean any int. /* Clean the FIFO (4 read for channel) */ asm(" LDI *+AR0(DR0). asm(" BNZ Calib_wait").*AR0").R0"). *+AR0(DR1).R0").*AR0").R0").R0"). asm(" LDI *+AR0(DR3). LDI @UCR_DEF.AR0"). asm(" STI R0. } /************************************************************************/ /* End function : set_amd16qs */ /************************************************************************/ /************************************************************************/ /* Function: set_amd16sa */ /* It inizializates the board AM/D16QS.R0").R0").R0").R0").R0").R0").R0").AR0").R0").

AR0").R1").R1"). asm(" LDI @CONTROL.53 .R1"). LDI @CONFIG.*AR1"). asm(" LSH 16.AR1").R1").R1"). asm(" STI R1.R1"). LDI @IMR1. asm(" STI R1.AR0").AR0"). } /************************************************************************/ /* End function : dio_32 */ /************************************************************************/ A. } /************************************************************************/ /* End function : set_amd16sa */ /************************************************************************/ /************************************************************************/ /* Funcio : dio32 */ /* Inizializates the DIO 32 */ /************************************************************************/ void dio32(void) { /* Dio32 as a master without any trigger */ /* asm(" LDI 0241h. asm(" LDI @posicio_DIO2.R1"). asm(" LDI 0000h. LDI @TIMER1_DEF.Appendixes.R1"). asm(" asm(" asm(" asm(" asm(" asm(" asm(" asm(" asm(" LDI @TIMER1. asm(" LDI @posicio_DIO. asm(" LSH 16.*AR0").AR1"). /* 32 bits as output */ asm(" LDI 1111h.*AR1"). STI R0. asm(" LSH 16.*AR1").AR1").*/ asm(" LDI 023Ch.R0"). LDI @CONFIG_DEF.*AR0"). /* disconnect the bridge */ asm(" LDI 00ffh. STI R0.*AR0"). STI R0. asm(" LDI @PORTREG. asm(" LSH 16. asm(" STI R1.*AR1").AR1"). LDI @IMR1_DEF.R0"). asm(" STI R1.R0").R1").

int k=0.k++) { r=atan(s). } for(k=100. s=s+0. table[k]=r.Appendixes.01.k++) { s=k-99. /************************************************************************/ /* Funcio : atn_table */ /* Creates a table with ATN values */ /************************************************************************/ void atn_table(void) { double s=0.k<=200.54 . table[k]=r.r=0. for(k=0. r=atan(s).k<=100. } } /************************************************************************/ /* End function : atn_table */ /************************************************************************/ A.

55 set points + exchange values */ // FLAG // // // // // Flux set point_hst margin Torque set point_hst margin Flux set point Torque set point SVM stop bit // SVM stop bit // SVM stop bit /*Flux angle*/ /*Torque error i+1*/ /*Motor speed */ /*FI=0 flux decrease */ /*FI=1 increase */ .1.Appendixes.h> #include "c:\mon32\bc45\tic32.4 .PCTH1_9.h> #include <math.h> #include<stdlib.h" #include<stdio.h> /* Memory DPRAM positions for the #define FLAG 0x0c00009 #define COUNTER 0x0c0000a #define HST_MFS 0xc0000bl #define HST_TE 0xc0000cl #define MFS 0xc0000dl #define TE 0xc0000el #define STOP 0xc00012l /* Start obtaining the DC */ #define START 0xc00013l /* Errors in obtaining the DC */ #define ERROR 0xc00014l /* FLC1 references values */ #define FLUX_ANGLE_I 0x0c00015 #define TE_ERR_I 0x0c00016 #define WM 0x0c00017 #define FI 0x0c00018 /* FLC2 refernces values */ #define #define #define #define /* duty #define #define #define #define #define #define #define #define #define #define #define #define /*10*/ #define #define COUNT1 0x0c0001a /*Increment Torque error i+1*/ DC_AUX 0x0c0001d /* Last DC*/ INC_DC 0x0c0001e /* flc2 set point */ EQ 0x0c0001f cycle */ DCFLC1 0x0c0001b /*Duty cycle from FLC1*/ DCFLC2 0x0c0001c /*Duty cycle from FLC2*/ f0 f1 f2 f3 f4 f5 f6 f7 f8 f9 fa fb 0xc00048l 0xc00049l 0xc0004al 0xc0004bl 0xc0004cl 0xc0004dl 0xc0004el 0xc0004fl 0xc00050l 0xc00051l 0xc00052l 0xc00053l A.h> #include <conio. A.h> #include<time.c /******************************************************************/ /* PCTH1_9: FLDTC 166us */ /***********************************************************************/ /* Needed C files */ #include <dos.

float vc.i=0.OUT" /* Global variables */ char x.ct.k=0.in2. unsigned long stop=0.index1.index3.struct_FI2[C_FI2].v9.fin2.vf.vb. /* Global adquisition variables */ float v0. int eq.in1. int flg_err=0. /* pointer file */ FILE *f_grf.struct_FD2bis[C_FD2bis].fin3.v13. float dc_aux.q=0. float struct_FI2bis[C_FI2bis].v6.count.v12.fi.56 .flag=0.fin1.start=0.counter=0. A.vd.mfs_hst=0.v4. /* set points */ float mfs_set=0.v15.va.v5.ve.j=0.v11.dc1=3125.te_set=0.141592654 C_INC_DC C_FI2 C_FI2bis C_FD2 C_FD2bis 842 2150 2150 2150 2150 /* DSP file */ #define FILENAME "TH1_9. FILE *dades.v14.v7.struct_FD2[C_FD2].index2. /* FLDTC variables */ unsigned long dc2=3125.v8.r=0.Appendixes. long int t=0.Tpc.v1.v10.v3. /*Array where the read file data is stored*/ float struct_INC_DC[C_INC_DC].te_hst=0.data.error=0. float Wpc.duty_ratio=1.v2.in3. float wmrds=0.inc_dc. count1. #define #define #define #define #define #define #define #define /*20*/ #define #define #define #define #define #define #define #define fc fd fe ff f10 f11 f12 f13 f14 f15 0xc00054l 0xc00055l 0xc00056l 0xc00057l 0xc00058l 0xc00059l 0xc0005al 0xc0005bl 0xc0005cl 0xc0005dl PI 3.

q++) { } q=0. start=0. void Setpoints(void). t<500000 .Appendixes. /* float dt [5][300]. t++) { delay(0. IniciDSP(). void ReadDPRAM(void). void Find_DC(void). delay (500). void main (void) { clrscr(). q<10 .&flag). /* for(q=0. EngegaDSP().57 .*/ /* Get_DPRAM_Word_32(FLAG. r++. Savedata(). x = getch(). /* Store the data array */ j++. if (x=='1') { Read_FLC(). void IniciDSP(void). void AturaDSP(void). if (flag == 1 ) { */ if ( j <= 299 && r > 20000) { ReadDPRAM(). printf("\nPress '1' to start\n"). if (start == 1 ) { Find_DC().&start). } /* /* } else { A. Put_DPRAM_Word_32(START. Get_DPRAM_Word_32(START. /* data matrix */ float dt [5][300]. delay (500). for(t=0.*/ /* Functions definition */ void Read_FLC(void). void EngegaDSP(void).start). void Data2file(void). Setpoints(). delay(500). void Savedata(void).01).

counter). Put_DPRAM_Word_32(STOP.Appendixes.&error). printf("\nEND "). /* Enable DPRAM Enable_DPRAM(). delay(2000). /* DSP reset */ Global_Reset(). 8). Get_DPRAM_Word_32(COUNTER. } /******************************************************************/ /* DSP inizialization */ /******************************************************************/ void IniciDSP(void) { /* Seleccio data type for the DSP */ Set_Processor_Data_Type_Size_32(). getche(). } /*&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&*/ A. /* Load the file to be executed Load_Object_File(FILENAME).flg_err).error). */ */ (0x290). DPRMA adress (0xD00)*/ */ } /*&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&*/ /* End of DSP inizialization */ /*&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&*/ /******************************************************************/ /* Engega DSP */ /******************************************************************/ void EngegaDSP(void) { stop=0. printf("\nThe number of flag real errors is %i". printf("\nThe number of errors is %li". Board adress /* bus ISA size Select_Board(0x290. printf("\nThe number of times is %li". Get_DPRAM_Word_32(ERROR. Data2file(). stop). */ } } } } AturaDSP(). /* DSP Inicialitzation. /* Run file */ Run_From(Get_Entry_PC()).&counter). flg_err++.58 . 0xd00. delay(2000).

Get_DPRAM_Float_32(f6. /*10*/ A.05. /* because squared value */ /* mfs_sug=(0. /* } /*&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&*/ /* End setpoints */ /*&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&*/ /******************************************************************/ /* Read DPRAM */ /******************************************************************/ void ReadDPRAM(void) { Get_DPRAM_Float_32(f0. mfs_sug). &mfs_set).*/ Put_DPRAM_Float_32(MFS.3665*sqrt(te_set_d)). printf("\n\nTorque setpoint N/m: ").&v5). printf("\nThe suggested optimized flux value is %lf \n".mfs_set).te_set). scanf("%f".&v3).Appendixes. Get_DPRAM_Float_32(f1. Put_DPRAM_Float_32(HST_TE. scanf("%f". Get_DPRAM_Float_32(f4.59 . Get_DPRAM_Float_32(f7. Put_DPRAM_Float_32(HST_MFS. &te_set). mfs_set=1.&v0). te_set_d=te_set. Get_DPRAM_Float_32(f2. Get_DPRAM_Float_32(f9. Tpc=te_set*100/9.*/ mfs_sug=0. scanf("%f".8. Get_DPRAM_Float_32(f3. printf("Flux set point hst margin: ").&v6). printf("Torque set point hst margin: "). /*Get_DPRAM_Float_32(f8.&v4). /* End Engega DSP */ /*&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&*/ /******************************************************************/ /* Setpoints */ /******************************************************************/ void Setpoints(void) { double mfs_sug=0. scanf("%f".mfs_hst).&v2). /*Get_DPRAM_Float_32(f5.&v9). mfs_sug). Put_DPRAM_Float_32(TE.&v7). printf("\nFlux set point: "). &te_hst).&v1).3665*sqrt(te_set_d)*0. printf("\nThe suggested optimized flux square value is %lf \n".&v8).3665*sqrt(te_set_d).te_hst).te_set_d=0. &mfs_hst).

&v10). Get_DPRAM_Float_32(fe.&vc).*/ } /*&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&*/ /* End save data */ /*&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&*/ /******************************************************************/ /* Find_DC */ A.*/ /*20*/ /*dt[20][j]=v14. dt[17][j]=v11. dt[15][j]=vf.&vd).&ve). Get_DPRAM_Float_32(f12. dt[2][j]=v2. dt[9][j]=v9. /*Get_DPRAM_Float_32(fa. dt[16][j]=v10. dt[14][j]=ve. dt[21][j]=v15. dt[7][j]=v7. dt[6][j]=v6. Get_DPRAM_Float_32(f13.&v13).&v15). Get_DPRAM_Float_32(f10. dt[18][j]=v12.&vf).Appendixes. dt[4][j]=v4. /*10*/ /*dt[10][j]=va. dt[12][j]=vc. Get_DPRAM_Float_32(ff. dt[1][j]=v1. Get_DPRAM_Float_32(f11.&v12).&va).&vb). */ /*20*/ /*Get_DPRAM_Float_32(f14.&v11). dt[3][j]=v3. Get_DPRAM_Float_32(fd. dt[13][j]=vd.&v14). /*dt[8][j]=v8.60 . Get_DPRAM_Float_32(fc. Get_DPRAM_Float_32(f15. /*dt[5][j]=v5.*/ } /*&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&*/ /* End read DPRAM */ /*&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&*/ /******************************************************************/ /* Savedata */ /******************************************************************/ void Savedata(void) { dt[0][j]=v0. dt[19][j]=v13. dt[11][j]=vb. Get_DPRAM_Float_32(fb.

Get_DPRAM_Word_32(FI.*/ /* 83us=1041.*/ dc2=duty_ratio*2083.55. } /* /* */ } /*&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&*/ A. if (duty_ratio < 0. /* if (duty_ratio < 0. 00. /* /* /* /* fi=1 fi=0 fi=1 fi=0 and and and and Tpc Tpc Tpc Tpc >=Wpc >=Wpc < Wpc < Wpc 10. if (duty_ratio > 0. } else { /* FLC2 */ Get_DPRAM_Word_32(COUNT1.5ct 166us=2083.dc1). else if (fi == 1) duty_ratio=struct_FI2bis[count1]. 00.85) duty_ratio=0.2. Put_DPRAM_Float_32(INC_DC.85.dc2).33ct 250us=3125ct */ dc1=duty_ratio*2083.&eq). Get_DPRAM_Float_32(DC_AUX.45 ) duty_ratio=0. if (dc2<1850) dc2=1850. 10.Appendixes.&count1). else if (fi == 10) duty_ratio=struct_FD2[count1].&fi).45.inc_dc). Put_DPRAM_Word_32(DCFLC1.55) duty_ratio=0. if (duty_ratio > 0. Total Total Total Total fi=11*/ fi=10*/ fi=01*/ fi=00*/ if (fi == 11) duty_ratio=struct_FI2[count1].666667ct 125us=1562. Put_DPRAM_Word_32(DCFLC2. duty_ratio=inc_dc+dc_aux. if (dc1<1850) dc1=1850. /******************************************************************/ void Find_DC(void) { Get_DPRAM_Word_32(EQ.2 ) duty_ratio=0.&count1). else duty_ratio=struct_FD2bis[count1].61 . inc_dc=struct_INC_DC[count1]. if (eq == 0) { /* FLC1 */ Get_DPRAM_Word_32(COUNT1.&dc_aux).

dt[1][k]. } else { for(k=0. /* End Find_DC */ /*&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&*/ /******************************************************************/ /* Stop DSP */ /******************************************************************/ void AturaDSP(void) { stop=1.dt[6][k].dt[5][k].dt[0][k]. data=0. count=0. "%e %e %e %e %e %e %e %e\n".Appendixes.k++) { /* fprintf(f_grf. Put_DPRAM_Word_32(STOP."rt").dt[4][k]. /*open the file (it must be in the root */ dades=fopen("INC_DC.k<j.dt[1][k].dt[2][k].dt[3][k]. /* read file float */ A.dt[0][k]. count1=0."%f".dt[3][k].txt".dt[4][k]). return.GRF". } fclose(f_grf). " %e %e %e %e %e\n".62 . /*while not file end*/ while (!feof(dades)) { fscanf(dades.dt[2][k]. stop).*/ fprintf(f_grf. } } /*&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&*/ /* End Data2file */ /*&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&*/ /******************************************************************/ /* Read_FLC */ /******************************************************************/ void Read_FLC(void) { clrscr(). "w")) == 0) { printf("Unable to open file").dt[7][ k]).&data). } /*&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&*/ /* End stop DSP */ /*&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&*/ /******************************************************************/ /* Data2file */ /******************************************************************/ void Data2file(void) { if ((f_grf = fopen("\\FLDTC11.

} fclose(dades).estructura[count1]). data=0. count++."%f".count1."rt").txt".&data).data). /*the file is closed*/ printf("\nThe file FI2 has %d inputs". /*while not file end*/ while (!feof(dades)) { fscanf(dades. count1++. /* save it to the structure */ /*printf("\nThe input %d of the file. is %f". /*open the file (it must be in the root */ dades=fopen("FD2. /* save it to the structure */ /*printf("\nThe input %d of the file. } fclose(dades). /* Third file*/ count=0. } fclose(dades). /*while not file end*/ while (!feof(dades)) { fscanf(dades. count1=0.count. /*the file is closed*/ printf("\nThe file FD2 has %d inputs".count. /* Fourth file*/ */ */ A. /* save it to the structure */ /*printf("\nThe input %d of the file. /* read file float */ struct_FD2[count]=data. } */ /* Second file*/ count=0.data). is %f". is %f". */ count++.count). /* The data from the structures is shown */ /* while (count1<count) { printf("\nThe data input %d of the struct is %f". struct_INC_DC[count]=data.data).63 .count.Appendixes.txt".count).count)."rt"). count1=0. count++.&data). /*open the file (it must be in the root */ dades=fopen("FI2. /* read file float */ struct_FI2[count]=data."%f". data=0. /*the file is closed*/ printf("\nThe file INC_DC has %d inputs".

count)."rt"). /* read file float */ struct_FD2bis[count]=data. count1=0. is %f". count1=0. data=0."rt"). /*while not file end*/ while (!feof(dades)) { fscanf(dades. } fclose(dades).data). /*the file is closed*/ printf("\nThe file FD2bis has %d inputs". } /*&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&*/ /* End Read_FLC */ /*&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&*/ A. */ count++.Appendixes. } fclose(dades). /*open the file (it must be in the root */ dades=fopen("FD2bis. /* Fifth file*/ count=0."%f". /*open the file (it must be in the root */ dades=fopen("FI2bis. /* save it to the structure */ /*printf("\nThe input %d of the file. /*the file is closed*/ printf("\nThe file FI2bis has %d inputs".&data).count. /*while not file end*/ while (!feof(dades)) { fscanf(dades. data=0. is %f".data).64 .count. /* read file float */ struct_FI2bis[count]=data.txt". /* save it to the structure */ /*printf("\nThe input %d of the file. count=0. */ count++."%f".txt".count).&data).

Fuzzy rules. Two of them are used when the stator flux is smaller than its reference value (Flux increase) and the other two in the opposite case (Flux decrease). All four groups of 46 rules are listed below.1).1 .FLC 1.2. and it depends on the working point. In any case just one fuzzy system is used per iteration.2. A. each of which contains 46 rules (see section 3. A.2 . The Fuzzy Logic controller 1 system comprises four groups of rules.Appendixes.65 . A.

If (t-e is n-s) and (s-f-p is l) and (T+2w is m) then (dc is m) (1) 26. If (t-e is n-m) and (s-f-p is l) and (T+2w is m) then (dc is s) (1) 23. If (t-e is n-m) and (s-f-p is s) and (T+2w is m) then (dc is s) (1) 21. If (t-e is n-m) and (s-f-p is l) and (T+2w is l) then (dc is z) (1) 38. If (t-e is m) and (s-f-p is l) and (T+2w is s) then (dc is m) (1) 16. If (t-e is s) and (s-f-p is m) and (T+2w is l) then (dc is vl) (1) 43. Wpc<Tpc.66 . If (t-e is n-l) and (s-f-p is l) and (T+2w is m) then (dc is l) (1) 20. If (t-e is n-m) and (s-f-p is m) and (T+2w is l) then (dc is z) (1) 37.Flux increase. If (t-e is n-l) and (s-f-p is s) and (T+2w is s) then (dc is vl) (1) 2. If (t-e is n-l) and (s-f-p is m) and (T+2w is s) then (dc is vl) (1) 3. If (t-e is m) and (s-f-p is s) and (T+2w is l) then (dc is vl) (1) 45.2. If (t-e is n-l) and (s-f-p is m) and (T+2w is l) then (dc is vl) (1) 34. If (t-e is n-l) and (s-f-p is l) and (T+2w is l) then (dc is vl) (1) 35. If (t-e is s) and (s-f-p is s) and (T+2w is s) then (dc is s) (1) 11. If (t-e is n-m) and (s-f-p is l) and (T+2w is s) then (dc is s) (1) 7. If (t-e is s) and (s-f-p is l) and (T+2w is m) then (dc is l) (1) 29. If (t-e is m) and (s-f-p is m) and (T+2w is s) then (dc is m) (1) 15. If (t-e is s) and (s-f-p is s) and (T+2w is l) then (dc is vl) (1) 42. If (t-e is n-s) and (s-f-p is m) and (T+2w is s) then (dc is z) (1) 9. If (t-e is n-m) and (s-f-p is m) and (T+2w is m) then (dc is s) (1) 22. If (t-e is m) and (s-f-p is l) and (T+2w is l) then (dc is vl) (1) A. If (t-e is s) and (s-f-p is l) and (T+2w is l) then (dc is vl) (1) 44. If (t-e is n-s) and (s-f-p is s) and (T+2w is l) then (dc is vl) (1) 39. 1. If (t-e is n-s) and (s-f-p is l) and (T+2w is l) then (dc is vl) (1) 41. If (t-e is n-s) and (s-f-p is s) and (T+2w is s) then (dc is z) (1) 8. If (t-e is n-s) and (s-f-p is s) and (T+2w is m) then (dc is m) (1) 24. If (t-e is n-l) and (s-f-p is s) and (T+2w is m) then (dc is vl) (1) 18.Appendixes. A. If (t-e is s) and (s-f-p is m) and (T+2w is s) then (dc is s) (1) 12. If (t-e is s) and (s-f-p is m) and (T+2w is m) then (dc is m) (1) 28. If (t-e is n-l) and (s-f-p is m) and (T+2w is m) then (dc is vl) (1) 19.1. If (t-e is n-m) and (s-f-p is m) and (T+2w is s) then (dc is s) (1) 6.1 . If (t-e is n-l) and (s-f-p is s) and (T+2w is l) then (dc is vl) (1) 33. If (t-e is m) and (s-f-p is m) and (T+2w is l) then (dc is vl) (1) 46. If (t-e is m) and (s-f-p is m) and (T+2w is m) then (dc is l) (1) 31. If (t-e is l) then (dc is vl) (1) 17. If (t-e is n-s) and (s-f-p is m) and (T+2w is m) then (dc is m) (1) 25. If (t-e is m) and (s-f-p is l) and (T+2w is m) then (dc is l) (1) 32. If (t-e is n-l) and (s-f-p is l) and (T+2w is s) then (dc is m) (1) 4. If (t-e is n-m) and (s-f-p is s) and (T+2w is s) then (dc is s) (1) 5. If (t-e is m) and (s-f-p is s) and (T+2w is m) then (dc is m) (1) 30. If (t-e is s) and (s-f-p is s) and (T+2w is m) then (dc is m) (1) 27. If (t-e is n-m) and (s-f-p is s) and (T+2w is l) then (dc is vl) (1) 36. If (t-e is n-s) and (s-f-p is l) and (T+2w is s) then (dc is z) (1) 10. If (t-e is m) and (s-f-p is s) and (T+2w is s) then (dc is s) (1) 14. If (t-e is s) and (s-f-p is l) and (T+2w is s) then (dc is s) (1) 13. If (t-e is n-s) and (s-f-p is m) and (T+2w is l) then (dc is vl) (1) 40.

1. If (t-e is n-l) and (s-f-p is s) and (2T+w is m) then (dc is vl) (1) 18. If (t-e is n-s) and (s-f-p is m) and (2T+w is m) then (dc is m) (1) 25. If (t-e is n-l) and (s-f-p is m) and (2T+w is s) then (dc is vl) (1) 3. If (t-e is m) and (s-f-p is s) and (2T+w is s) then (dc is s) (1) 14. If (t-e is n-m) and (s-f-p is m) and (2T+w is l) then (dc is z) (1) 37. If (t-e is n-l) and (s-f-p is m) and (2T+w is l) then (dc is vl) (1) 34. If (t-e is s) and (s-f-p is l) and (2T+w is m) then (dc is l) (1) 29. Wpc>Tpc. If (t-e is n-m) and (s-f-p is m) and (2T+w is m) then (dc is s) (1) 22. If (t-e is l) then (dc is vl) (1) 17. If (t-e is s) and (s-f-p is m) and (2T+w is l) then (dc is vl) (1) 43.2. 1. A. If (t-e is m) and (s-f-p is s) and (2T+w is m) then (dc is m) (1) 30. If (t-e is n-m) and (s-f-p is s) and (2T+w is l) then (dc is vl) (1) 36. If (t-e is m) and (s-f-p is l) and (2T+w is s) then (dc is m) (1) 16. If (t-e is n-s) and (s-f-p is l) and (2T+w is l) then (dc is vl) (1) 41. If (t-e is s) and (s-f-p is s) and (2T+w is l) then (dc is vl) (1) 42. If (t-e is n-l) and (s-f-p is s) and (2T+w is s) then (dc is vl) (1) 2. If (t-e is m) and (s-f-p is m) and (2T+w is l) then (dc is vl) (1) 46. If (t-e is n-l) and (s-f-p is l) and (2T+w is s) then (dc is m) (1) 4. If (t-e is n-m) and (s-f-p is l) and (2T+w is m) then (dc is s) (1) 23.Flux increase. If (t-e is n-s) and (s-f-p is l) and (2T+w is s) then (dc is z) (1) 10. If (t-e is n-m) and (s-f-p is s) and (2T+w is m) then (dc is s) (1) 21.67 . If (t-e is m) and (s-f-p is l) and (2T+w is m) then (dc is l) (1) 32.Appendixes. If (t-e is n-l) and (s-f-p is l) and (2T+w is l) then (dc is vl) (1) 35. If (t-e is n-m) and (s-f-p is l) and (2T+w is l) then (dc is z) (1) 38. If (t-e is n-l) and (s-f-p is l) and (2T+w is m) then (dc is l) (1) 20. If (t-e is n-m) and (s-f-p is s) and (2T+w is s) then (dc is s) (1) 5. If (t-e is n-s) and (s-f-p is m) and (2T+w is l) then (dc is vl) (1) 40. If (t-e is m) and (s-f-p is l) and (2T+w is l) then (dc is vl) (1) A. If (t-e is s) and (s-f-p is l) and (2T+w is l) then (dc is vl) (1) 44. If (t-e is n-s) and (s-f-p is s) and (2T+w is m) then (dc is m) (1) 24. If (t-e is n-m) and (s-f-p is m) and (2T+w is s) then (dc is s) (1) 6. If (t-e is n-m) and (s-f-p is l) and (2T+w is s) then (dc is s) (1) 7. If (t-e is n-l) and (s-f-p is s) and (2T+w is l) then (dc is vl) (1) 33. If (t-e is m) and (s-f-p is m) and (2T+w is m) then (dc is l) (1) 31. If (t-e is m) and (s-f-p is s) and (2T+w is l) then (dc is vl) (1) 45. If (t-e is s) and (s-f-p is m) and (2T+w is s) then (dc is s) (1) 12. If (t-e is s) and (s-f-p is m) and (2T+w is m) then (dc is m) (1) 28. If (t-e is m) and (s-f-p is m) and (2T+w is s) then (dc is m) (1) 15. If (t-e is n-l) and (s-f-p is m) and (2T+w is m) then (dc is vl) (1) 19. If (t-e is n-s) and (s-f-p is l) and (2T+w is m) then (dc is m) (1) 26. If (t-e is s) and (s-f-p is s) and (2T+w is m) then (dc is m) (1) 27. If (t-e is n-s) and (s-f-p is s) and (2T+w is s) then (dc is z) (1) 8. If (t-e is s) and (s-f-p is s) and (2T+w is s) then (dc is s) (1) 11. If (t-e is s) and (s-f-p is l) and (2T+w is s) then (dc is s) (1) 13.2 . If (t-e is n-s) and (s-f-p is m) and (2T+w is s) then (dc is z) (1) 9. If (t-e is n-s) and (s-f-p is s) and (2T+w is l) then (dc is vl) (1) 39.

If (t-e is s) and (s-f-p is s) and (T+2w is m) then (dc is vl) (1) 27.Flux decrease. If (t-e is m) and (s-f-p is l) and (T+2w is m) then (dc is m) (1) 32.2. If (t-e is n-l) and (s-f-p is l) and (T+2w is m) then (dc is vl) (1) 20. If (t-e is n-l) and (s-f-p is m) and (T+2w is l) then (dc is vl) (1) 34. If (t-e is n-l) and (s-f-p is s) and (T+2w is l) then (dc is vl) (1) 33. Wpc<Tpc. If (t-e is n-l) and (s-f-p is s) and (T+2w is s) then (dc is m) (1) 2. If (t-e is n-l) and (s-f-p is m) and (T+2w is m) then (dc is vl) (1) 19.1. If (t-e is s) and (s-f-p is s) and (T+2w is s) then (dc is s) (1) 11. 1. If (t-e is m) and (s-f-p is s) and (T+2w is l) then (dc is vl) (1) 45.3 . If (t-e is s) and (s-f-p is m) and (T+2w is s) then (dc is s) (1) 12. If (t-e is m) and (s-f-p is m) and (T+2w is s) then (dc is m) (1) 15. If (t-e is n-s) and (s-f-p is l) and (T+2w is s) then (dc is z) (1) 10. If (t-e is n-m) and (s-f-p is m) and (T+2w is s) then (dc is z) (1) 6. If (t-e is s) and (s-f-p is l) and (T+2w is l) then (dc is vl) (1) 44. If (t-e is n-s) and (s-f-p is s) and (T+2w is l) then (dc is vl) (1) 39. If (t-e is n-s) and (s-f-p is s) and (T+2w is s) then (dc is z) (1) 8. If (t-e is n-s) and (s-f-p is m) and (T+2w is s) then (dc is z) (1) 9. If (t-e is s) and (s-f-p is m) and (T+2w is m) then (dc is m) (1) 28.68 . If (t-e is n-l) and (s-f-p is m) and (T+2w is s) then (dc is vl) (1) 3. If (t-e is m) and (s-f-p is m) and (T+2w is m) then (dc is l) (1) 31. If (t-e is n-l) and (s-f-p is l) and (T+2w is l) then (dc is vl) (1) 35. If (t-e is n-s) and (s-f-p is l) and (T+2w is m) then (dc is m) (1) 26. If (t-e is s) and (s-f-p is m) and (T+2w is l) then (dc is vl) (1) 43. If (t-e is n-m) and (s-f-p is l) and (T+2w is s) then (dc is s) (1) 7. If (t-e is n-s) and (s-f-p is m) and (T+2w is m) then (dc is m) (1) 25. If (t-e is n-m) and (s-f-p is l) and (T+2w is l) then (dc is z) (1) 38.Appendixes. If (t-e is m) and (s-f-p is s) and (T+2w is m) then (dc is vl) (1) 30. If (t-e is n-m) and (s-f-p is m) and (T+2w is m) then (dc is z) (1) 22. If (t-e is n-l) and (s-f-p is l) and (T+2w is s) then (dc is vl) (1) 4. If (t-e is s) and (s-f-p is l) and (T+2w is s) then (dc is s) (1) 13. If (t-e is n-s) and (s-f-p is s) and (T+2w is m) then (dc is m) (1) 24. If (t-e is n-s) and (s-f-p is m) and (T+2w is l) then (dc is vl) (1) 40. If (t-e is m) and (s-f-p is m) and (T+2w is l) then (dc is vl) (1) 46. If (t-e is l) then (dc is vl) (1) 17. If (t-e is n-m) and (s-f-p is s) and (T+2w is l) then (dc is vl) (1) 36. If (t-e is n-s) and (s-f-p is l) and (T+2w is l) then (dc is vl) (1) 41. If (t-e is n-m) and (s-f-p is s) and (T+2w is s) then (dc is z) (1) 5. If (t-e is m) and (s-f-p is l) and (T+2w is s) then (dc is s) (1) 16. If (t-e is n-m) and (s-f-p is s) and (T+2w is m) then (dc is z) (1) 21. If (t-e is n-m) and (s-f-p is l) and (T+2w is m) then (dc is z) (1) 23. A. If (t-e is m) and (s-f-p is s) and (T+2w is s) then (dc is m) (1) 14. If (t-e is n-l) and (s-f-p is s) and (T+2w is m) then (dc is l) (1) 18. If (t-e is s) and (s-f-p is s) and (T+2w is l) then (dc is vl) (1) 42. If (t-e is n-m) and (s-f-p is m) and (T+2w is l) then (dc is vl) (1) 37. If (t-e is m) and (s-f-p is l) and (T+2w is l) then (dc is vl) (1) A. If (t-e is s) and (s-f-p is l) and (T+2w is m) then (dc is l) (1) 29.

If (t-e is m) and (s-f-p is l) and (2T+w is s) then (dc is s) (1) 16. If (t-e is n-l) and (s-f-p is l) and (2T+w is s) then (dc is vl) (1) 4. If (t-e is n-m) and (s-f-p is s) and (2T+w is m) then (dc is z) (1) 21. If (t-e is n-m) and (s-f-p is l) and (2T+w is s) then (dc is s) (1) 7. If (t-e is s) and (s-f-p is l) and (2T+w is l) then (dc is vl) (1) 44.2. If (t-e is n-l) and (s-f-p is l) and (2T+w is l) then (dc is vl) (1) 35.Appendixes. If (t-e is n-l) and (s-f-p is s) and (2T+w is l) then (dc is vl) (1) 33. If (t-e is n-m) and (s-f-p is m) and (2T+w is s) then (dc is z) (1) 6. If (t-e is m) and (s-f-p is s) and (2T+w is m) then (dc is vl) (1) 30. If (t-e is n-m) and (s-f-p is s) and (2T+w is l) then (dc is vl) (1) 36. If (t-e is m) and (s-f-p is l) and (2T+w is m) then (dc is m) (1) 32. If (t-e is m) and (s-f-p is s) and (2T+w is s) then (dc is m) (1) 14. If (t-e is s) and (s-f-p is m) and (2T+w is m) then (dc is m) (1) 28. If (t-e is n-m) and (s-f-p is l) and (2T+w is l) then (dc is z) (1) 38. If (t-e is l) then (dc is vl) (1) 17. If (t-e is m) and (s-f-p is l) and (2T+w is l) then (dc is vl) (1) A. If (t-e is n-s) and (s-f-p is s) and (2T+w is s) then (dc is z) (1) 8. If (t-e is s) and (s-f-p is m) and (2T+w is s) then (dc is s) (1) 12. If (t-e is n-m) and (s-f-p is l) and (2T+w is m) then (dc is z) (1) 23. If (t-e is s) and (s-f-p is m) and (2T+w is l) then (dc is vl) (1) 43. If (t-e is s) and (s-f-p is s) and (2T+w is l) then (dc is vl) (1) 42. If (t-e is n-m) and (s-f-p is m) and (2T+w is l) then (dc is vl) (1) 37. If (t-e is m) and (s-f-p is m) and (2T+w is l) then (dc is vl) (1) 46. If (t-e is n-l) and (s-f-p is m) and (2T+w is s) then (dc is vl) (1) 3. If (t-e is n-s) and (s-f-p is s) and (2T+w is m) then (dc is m) (1) 24. If (t-e is n-l) and (s-f-p is l) and (2T+w is m) then (dc is vl) (1) 20. A.Flux decrease. If (t-e is n-l) and (s-f-p is m) and (2T+w is m) then (dc is vl) (1) 19. If (t-e is s) and (s-f-p is l) and (2T+w is m) then (dc is l) (1) 29. If (t-e is n-s) and (s-f-p is l) and (2T+w is s) then (dc is z) (1) 10. Wpc>Tpc. If (t-e is s) and (s-f-p is l) and (2T+w is s) then (dc is s) (1) 13. If (t-e is n-m) and (s-f-p is s) and (2T+w is s) then (dc is z) (1) 5. If (t-e is n-s) and (s-f-p is l) and (2T+w is l) then (dc is vl) (1) 41. If (t-e is s) and (s-f-p is s) and (2T+w is s) then (dc is s) (1) 11.1. If (t-e is m) and (s-f-p is s) and (2T+w is l) then (dc is vl) (1) 45. If (t-e is n-l) and (s-f-p is m) and (2T+w is l) then (dc is vl) (1) 34.4 . If (t-e is n-m) and (s-f-p is m) and (2T+w is m) then (dc is z) (1) 22. If (t-e is n-s) and (s-f-p is m) and (2T+w is l) then (dc is vl) (1) 40. If (t-e is n-s) and (s-f-p is l) and (2T+w is m) then (dc is m) (1) 26. If (t-e is n-s) and (s-f-p is s) and (2T+w is l) then (dc is vl) (1) 39. If (t-e is s) and (s-f-p is s) and (2T+w is m) then (dc is vl) (1) 27. If (t-e is n-s) and (s-f-p is m) and (2T+w is s) then (dc is z) (1) 9. If (t-e is n-s) and (s-f-p is m) and (2T+w is m) then (dc is m) (1) 25.69 . If (t-e is n-l) and (s-f-p is s) and (2T+w is m) then (dc is l) (1) 18. 1. If (t-e is n-l) and (s-f-p is s) and (2T+w is s) then (dc is m) (1) 2. If (t-e is m) and (s-f-p is m) and (2T+w is s) then (dc is m) (1) 15. If (t-e is m) and (s-f-p is m) and (2T+w is m) then (dc is l) (1) 31.

If (inc-Te is n-s) and (E-Te-ant is n-l) then (inc-dc is n-s) (1) 9. If (inc-Te is m) and (E-Te-ant is s) then (inc-dc is n-m) (1) 30. If (inc-Te is z) and (E-Te-ant is n-l) then (inc-dc is n-m) (1) 15. If (inc-Te is n-m) and (E-Te-ant is m) then (inc-dc is l) (1) 7. If (inc-Te is m) and (E-Te-ant is n-s) then (inc-dc is n-m) (1) 29. If (inc-Te is n-m) and (E-Te-ant is l) then (inc-dc is vl) (1) 8. If (inc-Te is l) and (E-Te-ant is n-l) then (inc-dc is n-vl) (1) 33. If (inc-Te is z) and (E-Te-ant is l) then (inc-dc is m) (1) 20. If (inc-Te is n-m) and (E-Te-ant is s) then (inc-dc is l) (1) 6. If (inc-Te is l) and (E-Te-ant is n-s) then (inc-dc is n-vl) (1) 35.70 . If (inc-Te is z) and (E-Te-ant is n-m) then (inc-dc is n-m) (1) 16. If (inc-Te is s) and (E-Te-ant is n-m) then (inc-dc is n-m) (1) 22. If (inc-Te is z) and (E-Te-ant is s) then (inc-dc is z) (1) 18. All 37 rules are listed below. If (inc-Te is z) and (E-Te-ant is m) then (inc-dc is s) (1) 19. If (inc-Te is s) and (E-Te-ant is l) then (inc-dc is s) (1) 26. If (inc-Te is n-s) and (E-Te-ant is l) then (inc-dc is l) (1) 14. If (inc-Te is s) and (E-Te-ant is s) then (inc-dc is n-s) (1) 24. If (inc-Te is n-l) then (inc-dc is vl) (1) 2. A. If (inc-Te is s) and (E-Te-ant is n-l) then (inc-dc is n-l) (1) 21. If (inc-Te is n-m) and (E-Te-ant is n-l) then (inc-dc is s) (1) 3.2 .FLC 2. If (inc-Te is n-s) and (E-Te-ant is n-m) then (inc-dc is n-s) (1) 10. If (inc-Te is s) and (E-Te-ant is m) then (inc-dc is z) (1) 25. If (inc-Te is l) and (E-Te-ant is m) then (inc-dc is n-l) (1) 37. If (inc-Te is m) and (E-Te-ant is n-m) then (inc-dc is n-l) (1) 28. If (inc-Te is n-s) and (E-Te-ant is m) then (inc-dc is m) (1) 13. If (inc-Te is m) and (E-Te-ant is m) then (inc-dc is n-s) (1) 31.2. If (inc-Te is n-s) and (E-Te-ant is n-s) then (inc-dc is z) (1) 11. The fuzzy logic controller 2 system contains 37 rules (see section 3. If (inc-Te is n-m) and (E-Te-ant is n-m) then (inc-dc is m) (1) 4.Appendixes. 1. If (inc-Te is s) and (E-Te-ant is n-s) then (inc-dc is n-s) (1) 23. If (inc-Te is n-m) and (E-Te-ant is n-s) then (inc-dc is l) (1) 5. If (inc-Te is m) and (E-Te-ant is n-l) then (inc-dc is n-vl) (1) 27. If (inc-Te is n-s) and (E-Te-ant is s) then (inc-dc is s) (1) 12. If (inc-Te is l) and (E-Te-ant is n-m) then (inc-dc is n-vl) (1) 34. If (inc-Te is z) and (E-Te-ant is n-s) then (inc-dc is n-s) (1) 17. If (inc-Te is l) and (E-Te-ant is l) then (inc-dc is z) (1) A. If (inc-Te is m) and (E-Te-ant is l) then (inc-dc is n-s) (1) 32. If (inc-Te is l) and (E-Te-ant is s) then (inc-dc is n-vl) (1) 36.2).2.

DC motor.2.5kW. Figure A. AC motor_1. It should be remembered that the DC motor works as a generator. Encoder and DC motor detail. Induction motor_1. A. i.e. A. A.71 . DC motor. Figure A.1 .Experimental motor drive pictures.Workbench.5kW and the dynamometer. as a load.1.3 .Appendixes.3. It is shown the entire workbench with the encoder.

3 and A.72 .4 ). ( Next page shows figures A.Appendixes. A.

73 . A.4. AC motor_1.5kW and dynamo detail. Figure A. Figure A.Resistors. Resistors used as a load of the DC generator.3.Appendixes.2 .3. A.

A.5 and A.Appendixes.74 .6 ). ( Next page shows figures A.

Workstation. A.3.75 . It is shown the entire workstation. A.3 . A. Figure A. Figure A.3.5.Appendixes.4 .6.Voltage Source Inverter. It is shown the Voltage Source Inverter with its protections board and signal adaptation board.