You are on page 1of 15

VOLUME-1, ISSUE-1, DEC-2015, E-ISSN: 2455-5878

INTERNATIONAL JOURNAL OF RESEARCH FOR SCIENCE AND COMPUTATIONAL ENGINEERING

Design and Implementation of Flux Vector Control of


Induction Motor Using Microcontroller
Salah Gh. Ramadan, Gamal M. Sarhan and Ayman Y. Yousef

Electrical Engineering Department, Faculty of Engineering at Benha, Benha University, Benha, Egypt
1
salah.ghazy@gmail.com
Electrical Engineering Department, Faculty of Engineering at Benha, Benha University, Benha, Egypt
2
Gamal_bhit@yahoo.com
Electrical Engineering Department, Faculty of Engineering at Shoubra, Benha University, Cairo, Egypt
3
Ayman.youssef@feng.bu.edu.eg

ABSTRACT vector in relation to the rotor flux to achieve a required


This paper presents a design and implementation of flux vector objective. It usually refers to controllers which maintain a 900
(Field oriented) control of induction motor based on a 16-bit electrical angle between rotor and stator field components [1].
single chip microcontroller INTEL 80C196KC operating at 16 In DC motors, the flux and torque producing currents are
MHz clock frequency. This microcontroller is used as a main orthogonal and can be controlled independently. The magneto
control element of high performance industrial induction motive forces, developed by these currents are also held
motor drive system. The aim of using this microcontroller is to orthogonal. The torque developed is given by the equation
simplifying the intermediate analog stages. Consequently, Ta  Ka ( I f ) I a (1)
reduce the system cost and the execution time in order to
Hence the flux is only dependent on the field winding current.
improve the drive performance. The hardware requirements
If the flux is held constant, then the torque T a can be controlled
for this control system are only the measuring circuits of the
by the armature current Ia. For this reason DC machines are
necessary signals such as the actual current and speed. The
said to have decoupled or have independent control of torque
complete drive system consists, in addition to the
and flux. In AC machines, the stator and rotor fields are not
microcontroller based hardware, of a small fractional HP
orthogonal to each other. The only current that can be
induction motor and a three PWM inverter. The sequence
controlled is the stator current. Field Oriented Control is the
pattern required to the PWM inverter driving signals is
technique used to achieve the decoupled control of torque and
designed and implemented by the space vector modulator
flux by transforming the stator current quantities (phase
(SVM) technique. All the control algorithms of the input and
currents) from stationary reference frame to torque and flux
output operations such as current, flux, and speed controller’s
producing currents components in rotating reference frame.
calculations in the addition to the space vector modulator
There are basically two types of machine models that are used
SVM are software implemented and carried up by the
for the identification of the rotor flux vector in the indirect
microcontroller in order to fulfill the various application
field oriented control systems. The first type is the voltage
requirements.
model uses the stator voltage and the stator current vectors as
Keywords— Flux vector control, FOC, Machine model, Flux input signals. This model produces fairly accurate results as
controller, Interrupt Routine, Intel 80C196kc. long as the magnitude of the stator voltage vector is large as
compared to the voltage drop across the internal impedances
1. INTRODUCTION: of the machine [2]. The second type is the current model
The Field Oriented Control (FOC) depicts that the induction which uses the stator current vector and the mechanical speed
motor can be controlled like a separately excited dc motor by as input signals. The accuracy of this model does not depend
the orientation of the stator magneto motive forces or current on the operating speed of the drive. This makes the current

12
VOLUME-1, ISSUE-1, DEC-2015, E-ISSN: 2455-5878
INTERNATIONAL JOURNAL OF RESEARCH FOR SCIENCE AND COMPUTATIONAL ENGINEERING

model applicable in the entire speed range. In the present The output of the flux controller is the desired value of the
work, the current type of machine model is used to identify the direct current component needed to the direct component
rotor flux vector. This study started by describes the used current controller. While, the output of the speed controller is
machine model and then, consider the analysis of the internal the torque signal which gives the desired value of the
current controllers and the external flux and speed controllers quadrature current component using Eq. (2).
respectively. J (d / dt)  Te  TL  Kt imr I sq  TL (2)

2. THE IMPLEMENTED DRIVE SYSTEM: The two internal current controllers (direct and quadrature) are

The implemented field oriented control system shown in Fig. 1 very important to setup the required current values and to

is constructed generally from three-phase fractional HP compensate against the interactions between the two current

induction motor fed from three-phase VSI based on the space components depicted in equations (3) and (4).

vector PWM technique, in addition to the following main U sd  Rsd I sd  Ls [dI sd / dt]  Ls1 I sq
(3)
parts;  (1   ) Ls [dimr (t )) / dt]
1- The outer feedback control loops (flux and speed).
U sq  Rsq I sq  Ls [dI sq / dt]  Ls1 I sd
2- The inner feedback control loops (direct & quadrature (4)
 (1   ) Ls dimr (t )
current controllers).
3- The machine model (flux model). The outputs of the direct and quadrature component current
controllers are the reference values Usd* and Usq* respectively.

The external feedback control loops are required to maintain These desired values of voltage are gives to the space vector

the two controlled signals (speed and flux) at their respective modulator (SVM) as the input signals to impress the suitable

set values by comparing them with its desired values. voltage vector on stator terminals. The control system is
sampled at two different sampling rates depending upon the
time constants of separate loops. The sampling rates of the
external speed and flux controllers are quite slower than that of
the internal current controllers ( Tis = Tint. = 250 µsec and Tns =
Tfs = 20 Tis = 5 msec at switching frequency fs = 2kHz and
interrupt frequency fint.= 2fs = 4 kHz). The time interval
between two sample instants of flux or speed is sufficient for
internal current loop to reach steady state.

3. THE PROPOSED MACHINE (FLUX)


MODEL:
The machine model implemented in this work as shown in Fig.
Fig-1: Main block diagram of the implemented field oriented
control system. 3 is based on computing the magnitude of the magnetizing
current imr(t) and its angular position φ, from the available
The control system consists of two main feed forward paths as
feedback measured signals. The available measured signals are
shown in Fig. 2. These paths are the flux and speed controllers
the two stator line currents i s1, is2 of the motor and the rotor
in series with direct and quadrature current controller
speed ω.
respectively.

Fig-2: Main forward control system Paths.

13
VOLUME-1, ISSUE-1, DEC-2015, E-ISSN: 2455-5878
INTERNATIONAL JOURNAL OF RESEARCH FOR SCIENCE AND COMPUTATIONAL ENGINEERING

and it offers better adaptability as compared to p- and I-


controller.

Fig-4: PI-Control. (a) Arrangement. (b) Response to a step


Fig-3: Machine model implemented in 80196 Microcontriller
input.
The nonlinear interactions are such that they can only be The general form of PI- controller based on Fig. 4 is given by:
handled by the digital computation after the great development Gc ( s )  C ( s ) / E ( s )  ( R2 / R1 )[(1  sR2C2 ) / sR2C2 ] (9)
in microprocessor technology [3]. This model is constructed
Where:
from the equations (5), (6), (7), and (8) in addition to the
E(s) : is the input error signal.
available measured signals of the current and speed.
C(s): is the output of compensation.
I sd  is (t ) cos  is (t ) sin (5)
Equation (9) can be simplified to:

I sq  is (t ) sin  is (t ) cos (6) Gc ( s )  Ac (1  sTc ) / sTc (10)

Where:
Tr [dimr / dt ] i mr  I sd (7)
Ac: is the proportional gain of the controller (R2/R1).
d / dt  1  s1    [ I sq / Tr imr ]   (8) Tc: is the time constant of the controller (R2C2).

The main advantage of this model is that, the stator parameters The current controllers developed in this work is digitally
don't affect the model because the stator currents are implemented in the microcontroller. The z-transform of the
measured. The only major machine parameter that is subject to PI-controller transfer function of Eq. 9 can be written as [6]:
change is the time constant Tr which increases in the field Gc ( z)  [ Ac [1  (1 / Ti )]  Ac z 1 ] /(1  z 1 ) (11)
weakening range due to desaturation and is reduced when the
rotor resistance rises at higher temperature. The temperature Then, Eq. 11 can be written as numeric implementation form

effect is quite slow and corrected in the flux model by on-line of the PI- controller as:

adaptation by adding superimposed closed loop control signals C (n  1)  C (n)  Ac [1  (1 / Ti )]E (n  1) (12)
[5]. Also, this model functions satisfactory in the speed range  Ac E (n)
from zero to its base value. Or,
C(n  1)  C(n)  K P E (n  1)  K I E (n) (13)

4. THE D-Q COMPONENT CURRENT This is the most suitable PI- controller form which can be
COINTROLLERS: implemented numerically in the microprocessor systems,
The current controller can now be designed as two parallel where;
and independent controllers, one for Isd and the other for Isq. Kp: proportional constant = Ac[l + (1/Ti)]
To satisfy the control objectives of good dynamic performance KI: integration constant = -Ac
and zero steady-state error to constant current commands, a C(n) and E(n) : are the output and input signals respectively
proportion integral (PI) controller is employed in the current during new sampling period .
controllers [11]. The Pl-controller contains properties of both C(n+1) and E(n+1) : are the same variables during the next
P- and I- controller as shown in Fig. 4 and as such they find period.
large applications. The presence of integral element makes the
The direct component current controller loop is shown in Fig.
permanent control deviation zero, and the proportional element
5. The open loop consists of PI- controller, the stator winding
helps in faster response. The proportional gain and the time
leakage time constant of the motor, the space vector
constant can both be chosen to meet the system requirements

14
VOLUME-1, ISSUE-1, DEC-2015, E-ISSN: 2455-5878
INTERNATIONAL JOURNAL OF RESEARCH FOR SCIENCE AND COMPUTATIONAL ENGINEERING

modulator, dead time introduced by the discrete nature of the Gi ( s )  Gci ( s ) / Gmotor ( s ) (19)
control system (due to the controller) and the inverter circuit.
Gi ( s)  Ai Aci (1  sTci ) / sTci (1  sTsi ) (20)
(1  sTs )
According to the amplitude optimization criteria [12] which is
the most commonly used in practice to determine quickly the
Fig-5: Direct component current control loop. parameters of the PI- controller. The parameter of PI-
The magnitude of this dead time (Tdi) depends on the sampling compensation in the current controller are:
rate in the current loop. A value of (T di = 1.5 Tsi) is taken into Tci  Ts (21)
account to include the inverter time delay. In the present work,
Aci  Ts / 2Tsi Ai  [Ts / Tsi ]
the switching frequency is 2 kHz, and the corresponding dead (22)
[1 /(2 Amod . Amotor )]
time is 375 µsec. Figure 5 can be simplified to Fig. 6 where
the dead time is approximated by the equivalent time delay Aci  (Ts / Tsi )[1 / 2( / 2 3 )( Rbase / Rs )] (23)
which is equal to Tsi and Tsσ is the stator leakage time
Aci  (Ts / Tsi )( 3Rs / Rbases ) (24)
constant.
Then:

K Pi  Aci [1  (1 / Ts )] (25)

K Ii   Aci (26)

Since, the PI- compensation for the direct component current


controller is implemented numerically as the given form:
Fig-6: Simplified Block Diagram of Isd Control Loop.
U sd ( n  1)  U sd ( n )  K Pi E sdE ( n  1)
* *

Amod is the space vector modulator gain = π/(2√3). (27)


 K Ii E sdE ( n )
Amotor is the stator circuit gain of the motor =1/(Rs/Rbase)
And
The equivalent delay time transfer function is given by:
I sdE  I sd  I sd
*
(28)
Gdi  1 /(1  sTsi ) (14)
Due to the symmetry of the induction motor construction, the
and the stator circuit transfer function is given by: quadrature component current controller is similar to the direct
Gstator  Amotor /(1  sTs ) (15) component. Then, the numerical implementation of the
quadrature axis current controller form is;
Then, the total forward transfer function of the motor and the
U sq ( n  1)  U sq ( n )  K Pi I sqE ( n  1)
* *
modulator is defined as:
(29)
Gmotor  [ Amod /(1  sTsi )] /[ Amotor /(1  sTc ] (16)  K Ii I sqE ( n )

I sdE  I sd  I sd
*
or (30)
Gmotor  Ai /[(1  sTsi )(1  sTc )] (17)
Where: 5. THE FLUX CONTROLLER:
Ai: is the total gain in the forward path = Amod . Amotor The flux control loop shown in Fig. 7 is consists of PI-
compensation, equivalent time delay due to dead time and the

The transfer function of the PI-controller of the current first order delay, and the function due to rotor circuit.

depending on Eq. 10 given by:

Gci  Aci (1  sTci ) / sTci (18)

Then, the total forward path of all forward blocks in the


current control loop is given by:

15
VOLUME-1, ISSUE-1, DEC-2015, E-ISSN: 2455-5878
INTERNATIONAL JOURNAL OF RESEARCH FOR SCIENCE AND COMPUTATIONAL ENGINEERING

Fig-7: Diagram of Field Control Loop. torque Tel* . The speed control loop shown in Fig. 8 is drawn
depending on the mechanical system of the induction motor.
The transfer function of the rotor circuit based on the
magnetizing current depending on the analysis given in [13]
can be written as:
I mr ( s ) / I sd ( s )  1 /(1  sTr ) (31)

The first order transfer function of the approximated


equivalent delay time in the flux loop is given by:

Gdf  1 /(1  sTsf ) (32)

Where, the dead time in the flux control loop equals the Fig-8: Diagram of Speed Control Loop.

sampling period in this loop. Then, the field oriented forward The mechanical system of induction motor can be considered
path transfer function is given by: as a pure inertial load of mechanical time constant T m. The
Grotor  [1  (1  sTrf )][1  (1  sTr )] (33) viscous friction can be safely neglected while the mechanical
load TL is represented by an input disturbance. The mechanical
The transfer function of the PI- controller of the flux control
time constant Tm can be determined by the experiment
loop is given by:
described in reference [7]. Then, the transfer function
Gcf  Acf (1  sTcf ) / sTcf (34)
representing the mechanical system of the motor is given by:
Then, the total forward path transfer function of all forward
Gm  1 / sTm (41)
blocks in the field control loop is given by:
The dead time in speed control loop equals the speed sampling
G f ( s)  Gcf ( s).G f ( s) (35)
period and is approximated to the time delay T sn, where the
G f  Acf (1  sTcf ) / sTcf (1  sTsf )(1  sTr ) (36) transfer function of the equivalent delay time in the speed loop

The parameters of the PI compensation in the flux controller is:

are selected as: Gdn  1 /(1  sTsn ) (42)


Tcf  Tr (37) Thus, the transfer function of the motor including the
By the same way, the Pl-compensation of the flux controller is equivalent delay time is:
implemented numerically as the given form: Gn ( s )  [1 /(1  sTsn )][1 / sTm ] (43)
I sd (n  1)  I sd ( n )  K Pf E f ( n  1)
* *
(38) The transfer function of the PI- controller of the speed is given
 K If E f ( n )
by:
and
Gcn  Acn (1  sTcn ) / sTcn (44)
E f  I mr  I mr
*
(39)
Then, the total forward path transfer function of all forward
where:
blocks in the speed control loop is given by:
K Pf  Acf [1  (1 / Tr )] (40)
Gnt ( s )  Gcn ( s ).Gn ( s ) (45)
The previously used criteria gives too great impractical gain
Acf. Then, from the experimental results of different previous Gnt ( s)  Acn (1  sTcn ) /[s 2Tcn Tm (1  sTsn )] (46)

works, this gain can be selected in the range of 5 to 10 [6]. By neglecting the sampling time Tsn with respect to the
mechanical time constant Tm( Tsn<< Tm) and Eq. 46 can be
6. THE SPEED CONTROLLER: simplified to:
The difference between the input setting reference value of the Gnt ( s)  Acn (1  sTcn ) / s 2Tcn Tm (47)
rotor speed ω* and the feedback actual speed ω gives the Then, the closed loop transfer function with PI-
speed error signal which applied as input to the speed compensation becomes;
controller (PI- controller). The output is a voltage signal
Fn ( s )  Gnt ( s ) /(1  Gnt ) (48)
proportional to the reference value of the electromagnetic

16
VOLUME-1, ISSUE-1, DEC-2015, E-ISSN: 2455-5878
INTERNATIONAL JOURNAL OF RESEARCH FOR SCIENCE AND COMPUTATIONAL ENGINEERING

Fn ( s)  Acn (1  sTcn ) /[s 2Tcn Tm I sq T el / kI mr


* *
(62)
(49)
 Acn (1  sTcn )]
The dynamics of the implemented field oriented control
Or
system is based on the equations (27) to (30) for the current
Fn ( s)  (1  sTcn ) /[1  sTcn  s (Tcn Tm / Acn )]
2
(50) controllers, equations (38) and (39) for the flux controller and
The characteristic equation of the closed loop transfer function equations (60) and (61) for the speed controller
of Eq. 50 can be written as;
s 2  ( Acn / Tm )s  ( Acn / Tcn Tm )  0 (51) 7. HARDWARE IMPLEMENTATION:
The PI- compensation gain Acn can be determined by The major element of the hardware implementation for the

comparing the system characteristic Equation as Eq. 51 with field oriented control system is the INTEL 80C196KC

the following general characteristic equation form : microcontroller with Architecture as shown in Fig. 9.

s 2  2n s  n  0
2
(52)

Which is the optimal time response characteristic equation of


the second order system, the comparison gives:
2  2n  Acn / Tm (53)

n 2  Acn / TmTcn (54)


Where:
ζ: is the damping ratio of the system.
ωn : is the undamping natural frequency.
σ : is called the attenuation.

By using a small value of damping ratio ζ = 1 / √2 which Fig-9: Intel 80C196KC Microcontroller Architecture

satisfies the condition for under damped system, then Eq. 53


gives: 7.1 The Intel 80c196kc Microcontroller Features
The high speed CPU (16 MHz) on the 80C196KC
(2n / 2 )  Acn / Tm (55)
microcontroller is 16 bits wide and connects to the interrupt
n  2 Acn / 2Tm (56) controller and the memory controller by a 16-bit bus. The
major components of the high performance CPU on the
Substituting from Eq. 55 and Eq. 56 in Eq. 54 to give: 80C196KC microcontroller are the Register File and the
( 2 Acn / 2Tm )  Acn / TmTcn
2
(57) Register/Arithmetic Logic Unit (RALU). Communication with
the outside world is done through either the Special Function
Acn / 2Tm  1 / Tcn (58)
Registers (SFRs) or the Memory Controller.
Acn  2Tm / Tcn (59)
The 80C196KC microcontroller has five 8 bit Input / Output
By selecting suitable value of Tcn to give fast response, the ports (Port 0, Port 1, ..... Port 4) and two 16-bit timers
gain Acn is obtained. Similar to that of the current and flux considered as the time bases for the HSI and HSO units and
controller, the numerical implementation form of the PI- can be considered as an integral part of HSI / HSO units.
compensation is given by; These timers are called TIMER 1 and TIMER 2. The High

Tel (n  1)  Tel (n)  K Pn En (n  1)  K In En (n) Speed Input Unit (HSI) can record times of external events
* *
(60)
with a 9 state time resolution. It can monitor four
and
independently configurable HSI lines (HSI. 1 to HSI.3) and
En   *   (61)
capture the value of TIMER 1 when event takes place.
The desired value of quadrature component of stator current is The High Speed Output unit (HSO) can be programmed to
obtained by using Tel* as: cause transitions on any of its six output lines (HSO.0 to

17
VOLUME-1, ISSUE-1, DEC-2015, E-ISSN: 2455-5878
INTERNATIONAL JOURNAL OF RESEARCH FOR SCIENCE AND COMPUTATIONAL ENGINEERING

HSO.5) at specified times (based on TIMER 1 or TIMER 2). analog input of the A/D converter. Port 1 is a quasi-
Up to 8 pending events can be stored in the 24-bit CAM bidirectional port (having I/O pins). This port is used as a
register (Content Addressable Memory) of the HSO unit at one dummy output port for debugging any inter digital quantity
time. The Analog to Digital Converter (ADC) converts the calculated in the microcontroller.
analog input to 10-bit digital equivalent, and it consists of 8-
Channel multiplexer, Sample and hold, and 10 bit successive 8 ANALOG FEEDBACK SIGNALS
MEASUREMENT:
approximation A/D converter. The analog signals can be
There are three main feedback signals which must be
sampled by any of the 8-analog input pins (Ach.0 through
measured for the field oriented control systems. The first two
Ach.7) which are shared with Port.0. The Watchdog Timer is
signals are the actual currents of the motor (i s1 and is2) and the
a 16-bit counter that is incremented every state time. When it
other is the actual speed of the motor ω. These signals are used
overflows it pulls down the RESET pin for two state times,
as input signals to the A/D converter of the microcontroller.
which reinitializes the system. The interrupts are 28 interrupt
sources and 16 interrupt vectors on the 80C196KC. 8.1 Actual Current Measurement
The actual currents of the motor are measured in two stator
7.2 The Intel 80c196kc Microcontroller Adaptation lines. For field orientation only two line currents i s1 and is2 are
According to the architecture of the Intel 80c196kc required, which are transformed to i sα and isβ. The gain of the
Microcontroller [8, 9] shown in Fig. 9, the microcontroller is current transducer of type (VDM, 172001) is 100/0.1 A. The
configured to perform the field oriented controller. total gain of the current measurement is selected as 1V/1A
which results in a voltage range between 1 to 5 V at the A/D
7.2.1 The HSO Unit Configuration
converter inputs. In the internal calculations of the
The HSO unit is programmed to realize the space vector microcontroller, the current range corresponds to the
modulator which is the important part of the field oriented hexadecimal range 3FFFH, 4000H.
controller [4]. Timer 1 is used as the reference timer for the
8.2 Actual Speed Measurement
HSO command and incremented every 8 state times. The
The actual speed of the motor is measured using dc tachometer
comparator has a chance to look all 8 CAM registers before
which is coupled with the motor shaft. The gain of the
Timer 1 changes its value.
tachometer is given by 1 volt/500 rpm which gives a 6 volt for
7.2.2 The A/D Converter Configuration maximum mechanical speed of 3000 rpm for 50Hz. The

The analog inputs to the 80C196KC microcontroller system required range for the ADC input signals of the

are handled by the A/D converter. The Conversions can be microcontroller is 0 to 5V. A total speed gain of 1volt/1000

performed on one of 8-channels (conversion time 23µsec), the rpm is used to ensure that the speed signals is inside the range

inputs of which share pins with Port.0. The A/D converter is of 0 to 5V. Therefore, for maximum speed of 3000 rpm for

configured in auto scan mode to convert signals on channels 50Hz a 3 volt analog signal of speed can be measured. For the

Ach.0, Ach.l, and Ach.2. The A/D converter channel Ach.0, internal calculation of the microcontroller, the speed range

Ach.l, and Ach.2 are assigned to the signals of the motor corresponding to the hexadecimal range 7FFFH, 8000H.

current Is1, Is2, and rotor speed ω respectively. The result and
status of the conversion is read in the ADRESULT (High) and 9. TESTING THE INTERNAL
AD RESULT (Low) registers. CALCULATIONS OF 80196KC
MICROCONTROLLER:
7.2.3 Input/Output Ports Configuration In the field oriented control systems, it is important to examine
There are five 8-bit I/O ports on the 80C196KC the internal signals inside the microcontroller. The testing of
microcontroller. Some of these ports are input only, some are this internal signals such as Isd, Isq, Usd, and Usq can be done
output only, some are bi-directional and some have alternate using a 4-channeI digital to analog converter circuit consists of
functions. Port.0 is an input port which is also used as the four 8-bit high speed D/A converters. These D/A converters

18
VOLUME-1, ISSUE-1, DEC-2015, E-ISSN: 2455-5878
INTERNATIONAL JOURNAL OF RESEARCH FOR SCIENCE AND COMPUTATIONAL ENGINEERING

receive their input digital signals from a 3-state bus-driving sampling period). The analog signals output routine is also
outputs of four 8-latches. The 2 to 4 lines from the 3-To-8 serviced at the same sampling rate.
lines decoders/demultiplexers are used to determine which
The slow routine (machine model, flux controller, and speed
channel of the digital to analog converter (DAC) channels will
controller) is serviced every 20 interrupts (T slow = 20 Tfast and
be used. The HS0.4 and HS0.5 pins are used as input to the
Tfast = Tint). In this work, the microcontroller requires 70 µsec.
decoders/demultiplexers chip. A 8-bit Port 1 is used to transfer
to execute the activities of the slow routine. The number
the required examined signal to the specified DAC channel.
representing the sampling rate of the slow routine (20 T int) is
given before starting of the program. The parameters and the
10. SOFTWARE AND CONTROL
ALGORITHMS: rated values are calculated and normalized respectively in the
starting initialization of the program. Fig. 10 indicate the
The software and control algorithms of the implemented field
construction of the software implementation.
oriented control system are developed in assembly language
using MCS-96 Micro- Assembler. A relocatable program is
used to combing the used programs together in only one object
program. The monitor program (iECM-96) is used to load the
object file in the microcontroller RAM in order to execute the
system. In this section, the flowcharts and control algorithms
of the main and subprograms are given.

The implemented field oriented control system consists of two


Fig-10: Software Framework Implementation
control loops of different time constant. The first control loop
is the output service routine which contain the vector
11. SOFTWARE BUILDING BLOCKS:
transformation together with the current controllers and the
The software program of the field oriented controller can be
space vector modulator. The other control loop is the routine
divided into main routine and a group of subroutines. These
of the machine model together with the flux controller and the
routines representing the construction of the software used in
speed controller which is called slow routine.
the implemented drive system. The following subsections
The sampling rate of the current controller are increased in describe the flowcharts of each routine and subroutine.
order to optimize the over all drive response. The time
measurement unit is the interrupt period of Timer 1. The 11.1 Main Routine
switching time is equal to 2 of the interrupt period (T=2T int). The program of main routine shown in the flowchart of Fig. 11

This period is selected to give the required switching started by configuring the microcontroller system by makes

frequency suitable for the inverter power transistors. The the necessary system and initialization. The program calculate

minimum value of this period is determined by the time the parameters and normalize the rated values (such as

required to execute the routines of high sampling rate. constants A, B, Ki, Kf, and Kn).

In this work, the minimum interrupt time is 250 µsec.


(sampling period), which corresponding to a maximum
switching frequency of 2 KHz (500 µsec. switching time). The
fast routine (output service routine) is serviced every one
interrupt in order to optimize the response of the drive system.
The execution time of the fast routine activities is 170 µsec.
(this is the required microcontroller execution time in this
routine). Then, this routine can be sampled at a maximum
sampling rate of 4 KHz (interrupt frequency for 250 µsec.

19
VOLUME-1, ISSUE-1, DEC-2015, E-ISSN: 2455-5878
INTERNATIONAL JOURNAL OF RESEARCH FOR SCIENCE AND COMPUTATIONAL ENGINEERING

Fig-12: Flowchart of the fast Routine

This routine consists of the vector transformation, current


controllers, and the space vector modulator SVM, The output
selected signals to DAC converter subroutine is serviced at the
same sampling rate of the fast routine. The microcontroller
require a 170 µsec. to execute the activities of this routine. The

Fig-11: Flowchart of the Main Routine. following subsections explain in details the separate

The following step is to enable interrupts from Timer 1, start flowcharts of the different activities executed in the fast

Timer I and start analog to digital conversion, then wait for routine.

interrupt. The program calling suitable subroutine to compute 11. 2. 1 Analog Output Signals
the necessary values such as switching times for HSO's. The selected output signals to DAC routine is not integral part
of the normal field oriented controller. This routine is
This routine has one counter (COUNT). This counter necessary in testing phase to examine the internal signals and
decremented every one interrupt and compared with zero, to study the control system responses. The usefulness of this
when equality is satisfied the slow routine is called. Then, the routine is to select set of internal signals to the four DAC
counter loaded by the sampling rate of the slow routine N s = channels.
20. After executing all these activities another wait of interrupt
is entered where the complete activities are to be repeated. 11. 2. 2 Phase Splitting and Vector Transformation
Routine
The flowchart of this routine shown in Fig. 13 started by
11.2 Fast Routine
reading the ADC channels (Ach.0 & Ach.1) of the actual line
The fast routine of Fig. 12 shows the different activities to be
currents.
executed at the fastest sampling rate (every one interrupt).

20
VOLUME-1, ISSUE-1, DEC-2015, E-ISSN: 2455-5878
INTERNATIONAL JOURNAL OF RESEARCH FOR SCIENCE AND COMPUTATIONAL ENGINEERING

Fig-13: Flowchart of Phase Splitting


and Vector Transformation.

These readings are corrected and normalized as 12-bit integers


to give correct values of the line currents I s1 and Is2. The α and
β components of the stator current (I sα and Isβ) are calculated
from the measuring values of the stator current by using the Fig-14: Flowchart of Direct Current controller Routine.
two axis theorem. The vector transformation of stator currents
are made using the stator current Park’s vectors [14] to obtain 11.3 Slow Routine
the d-q components of the actual current I sd and Isq. This The slow routine shown in Fig. 15 consists of the machine
routine uses a lookup table (SINTABLE) to read the sin and model, the flux controller, and the speed controller. These
cos values corresponding to angle φ. activities are executed every Ns interrupts (Ns=20 interrupts)
of Timer 1 (i.e. this routine is sampled at a slower sampling
11.2.3 Direct and Quadrature Current Controllers rate than the fast routine). The execution time of the slow
Routines
routine activities is smaller than the execution time of the fast
The direct and quadrature current controller routines are
routine activities (the microcontroller execution time in this
similar proportional-integral (PI) controllers. As shown in the
routine is 70 µsec.). The separate flowcharts of the different
direct current controller flowchart of Fig.14, the input of each
activities executed in the slow routine are explained in details
routine is the actual values of stator current I sd and Isq
in the following subsections
(obtained from the previous routine) and the desired values I sd*
and Isq* (obtained from the flux and speed controllers outputs).

The equations (27) and (29) are used to give the outputs of
these current controllers Usd* and Usq* which are the desired
values for the direct and quadrature components of the stator
voltage. These outputs (Usd* and Usq*) are limited to maximum
and minimum values.

Fig-15: Flowchart of the Stow Routine.

21
VOLUME-1, ISSUE-1, DEC-2015, E-ISSN: 2455-5878
INTERNATIONAL JOURNAL OF RESEARCH FOR SCIENCE AND COMPUTATIONAL ENGINEERING

11. 3. 1 Machine Model Routine


The machine model routine shown in Fig. 16 contains two
parts. The first part is to calculate the magnitude of the actual
magnetizing current Imr. The second part is to calculate the
synchronous speed required to give the angle of the
magnetizing current φ.

Fig-17: Flowchart of Flux controller Routine.

This reference value Imr* selected according to the speed range


which is compared with the actual magnetizing current
obtained from the machine model routine. The PI- correction
is carried out on the error between the reference and actual
values of the magnetizing current to obtain the direct
Fig-16: Flowchart of Machine Model Routine. component of the reference current Isd*.

The inputs to this routine are the actual values of direct and This output value of the reference direct current I sd* is limited
quadrature components of the stator current (I sd and Isq) and to maximum and minimum values and stored as 14-bit signed
the actual speed ω. The reading of the actual speed ω from integer to be used as input to the direct current controller
ADC channel 2 (Ach.2) is corrected and normalized as 16-bit routine.
integers. One output of this model is the actual magnetizing
11. 3. 3 Speed Controller Routine
current Imr which is used as the input of the flux controller.
The speed controller routine shown in Fig. 18 is also
The other output is the flux position angle φ which is used as
implemented using the PI-controller and the inputs to this
the input to both vector transformation and space vector
routine are the reference and actual values of the rotor speed
modulator routines. The part of calculating the electrical angle
(ω* and ω). The reading of the actual speed co from ADC
φ is executed at the fastest sampling rate with the fast routine
channel 2 (Ach.2) is corrected and normalized as a 16-bit
in order to optimize the performance of the drive system.
integers. The actual speed ω is compared with its reference
11. 3. 2 Flux Controller Routine value ω* to give the dynamic error of speed ω n. The PI-
The flux controller routine shown in Fig. 17 is implemented by correction of speed error is implemented on the speed error to
the PI-controller. The inputs to this routine are the reference give the required reference value of the quadrature component
and actual values of the magnetizing current (I mr* and Imr). The of the reference current Isq*.
reference value Imr* is given as a constant value in the
initialization of the main program (0DBIH corresponds to I mr
=1.07A).

22
VOLUME-1, ISSUE-1, DEC-2015, E-ISSN: 2455-5878
INTERNATIONAL JOURNAL OF RESEARCH FOR SCIENCE AND COMPUTATIONAL ENGINEERING

Fig-19: Flowchart of HSO Interrupt Service Routine.


Fig-18: Flowchart of Speed controller Routine

11.4 Interrupt Service Routines 11. 4. 2 ADC Interrupt Routine

There are two interrupt routines serviced in this work as The ADC interrupt routine shown in Fig. 20, started by

shown in Fig. 10. These interrupt service routines are the HSO scanning the allowable ADC channels (Ach.0 to Ach.4) and

interrupt routine and the ADC interrupt routine. The following adjusting their readings (such as actual current and speed).

subsections describe the control algorithms and the flowcharts


of these interrupt service routines. As described previously,
the interrupt time is 250 µsec (half the switching time of 500
µsec). Since, these interrupt service routines are serviced for
250 µsec.

11. 4. 1 HSO Interrupt Routine


The duty of this routine is to service the HSO unit. As shown
in Fig. 19, the HSO interrupt routine started by testing the state
of pin.3 for the IOS0 register. The HSO,3 is used to give one
interrupt in each interval (HSO PER). On the other hand,
HSO.3 (used as a time base) is set and clear with even and odd
interrupts after each period (T1 cycle) depending on the state
of IOS0.3. If HS0.3 is set, the HSO.0, HSO.l, and HS0.2 are
set after NXT_ON_0, NXT ON l, and NXT_ON_2 times
respectively. Consequently, the HSO.0, HSO.1and HSO.2 are Fig. 20: Flowchart of ADC Interrupt Service Routine.

cleared after NXT_OFF_0, NXT_OFF_1, and NXT_OFF_2


times respectively, when HS0.3 is cleared. Since, the values The results are stored in input table at the beginning of the

are written in the respective registers of the HSO unit after main program. The ADC channel number (AD NUM) is

every interrupt with Timer 1 to give the suitable output space incremented and compare with the max allowable channel

vector voltages. number (5 channel, Ach.0 to Ach.4). The start of the A/D
conversions are done, if the AD_NUM is cleared when
reached to the max allowable value and initials a new ADC
read cycle. Since, the results are written in the respective

23
VOLUME-1, ISSUE-1, DEC-2015, E-ISSN: 2455-5878
INTERNATIONAL JOURNAL OF RESEARCH FOR SCIENCE AND COMPUTATIONAL ENGINEERING

registers of the ADC (AD_RESULT_HI and


AD_RESULT_LO) after every interrupt with Timer 1 to give
the suitable digital signals corresponding to the analog input
signals. The ADC interrupt service routine with the HSO
interrupt routine have the highest priority and must not be
interrupted.

12. EXPERIMENTAL RESULTS


The aim of this section is to evaluate the response of various
control loops and verify the overall control system. Also, the
response of the implemented field oriented control system is a) Transient Response at ω = 750 rpm.
evaluated in different operating ranges. The experimental Horizontal: 0.5 sec/div,
Vertical; Upper Trace: (I sq * ) 2 amp./div.
results of this proposed drive system are displayed using dual Lower Trace: (ω) 250 r.p.m,/div.
channel storage oscilloscope.

12.1 Dynamic Response of Motor Speed and Field


Oriented Quantities
The transient response of the rotor speed ω and the reference
value of the quadrature component of the stator current
(Torque current Isq*) at different speeds is shown Fig. 21. The
speed response can be controlled by adjusting the speed
controller parameters (KIn and Kpn) to give the desired best
response. Figure (21) indicate that, the torque current takes its
maximum value to provide the accelerating torque at the
begging of the transient instant. The transient response of the b) Transient Response at ω = 1000 rpm.
Horizontal: 0,5 sec/div,
rotor speed ω and the magnetizing current Imr is shown in Fig.
Vertical; Upper Trace: (I sq * ) 5 amp./div.
22. The magnetizing current is maintained constant in this Lower Trace: (ω) 500 r.p.m./div.
speed range which gives a good dynamic response. The Fig-21: Dynamic response of speed and torque current I sq * .
transient response of the speed ω and the direct component of
the stator current Isd is shown in Fig. 23, which represent the
motor flux is maintained constant in this speed range by means
of the field control loop of the flux controller. In all cases, the
reverence speed ω* is taken as a step input introduced to the
speed controller in hexadecimal by using the monitor program.

12.2 Motor Voltage and Current Waveforms


The typical line voltage uab and phase voltage ua waveforms of
the motor obtained by using the proposed drive system are
shown in Fig 24 and Fig. 25 respectively. The positive and
negative magnitudes of the output voltage pulses from the Horizontal: 0.5 sec/div.
inverter, are 2/3 of the dc link voltage as expected. A Vertical; Upper Trace: (Imr) 1 amp./div.
Lower Trace: (ω) 250 rpm./div.
comparison between the typical phase voltage and phase
Fig-22: Dynamic response of speed ω and magnetizing current
current is indicated in Fig. 26 and Fig. 27 show the two stator Imr
currents at another value of the power frequency.

24
VOLUME-1, ISSUE-1, DEC-2015, E-ISSN: 2455-5878
INTERNATIONAL JOURNAL OF RESEARCH FOR SCIENCE AND COMPUTATIONAL ENGINEERING

Horizontal: 0.5 sec/div. Horizontal: 0.5 sec/div.


Vertical; Upper Trace; 1 amp./div. Vertical; Upper Trace: (ua) 20 volt/div.
Lower Trace: (ω) 250 rpm/div. Lower Trace: (ia) 1 amp./div.
Fig-23: Dynamic response of speed ω and Direct Current Isd. Fig-26: Comparison between the phase voltage and phase
current.

Horizontal: 5 msec/div.
Vertical: 20 volt/div. Horizontal: 20 msec/div.
Fig-24: Output line voltage (uab). Vertical: 1 amp./div.
Fig-27: Stator currents Isα and Isβ at 5 Hz.

13. CONCLUSIONS:
This paper investigates the high performance field oriented
induction motor drive system. The control system is
implemented using single chip 16-bit microcontroller INTEL
80C196KC. Since, the hardware elements are minimized and
the execution time of the operation is reduced which gives low
cost and high performance drive system. The implemented
machine model depends on measuring the current and speed is
a better one for wide speed range. The current measurement by
using the current transducers based on the hall effect
Horizontal: 5 msec/div.
Vertical: 20 volt/div. phenomenon gives complete isolation between the power and
control sides. Also, speed measurement by using analog
Fig-25: Output phase voltage (ua). tachometer which is the common method for standard field
oriented control systems, gives better results for different
operating speeds.

25
VOLUME-1, ISSUE-1, DEC-2015, E-ISSN: 2455-5878
INTERNATIONAL JOURNAL OF RESEARCH FOR SCIENCE AND COMPUTATIONAL ENGINEERING

The software implementation of the suggested field oriented Vector Control of Induction Motor Using Rotor Flux
control system in two different sampling rate routines ( fast Estimation by Two Different Methods ", International
and slow routines) is fulfill the required fast dynamic response Journal of Electronic and Electrical Engineering, Volume
for precision speed. The software programs of the 7, Number 3 (2014).
implemented drive system have the facilities to generate pulses [11] R. B. Sepe & J. H. Lang "Inverter Nonlinearities and
to drive not only the used small fractional HP induction motor, Discrete Time Vector Current Control", IEEE Trans., Ind,
but it also suitable for all high power induction motor drives. Appl., Vol. 30, No. 1, pp. 62- 70, January/February 1994.
Such type of drive system is economical and efficient if it [12] R. K. Sugandhi & K. K. Sugandhi "Thyristors, Theory
compared with other types of the variable speed drives. and Applications", Wiley Eastern Limited, New Delhi,
1983.
14. REFERENCES: [13] Ayman Y. Yousef “ Dynamic Modeling of Induction

[1] P.Ramana, B.Santhosh Kumar, Dr.K.Alice Mary, and Motor with Rotor Field Orientation” International Journal

Dr.M.Surya Kalavathi “Comparison of Various PWM of Research, Volume 2, Issue 07, July 2015.

Techniques for Field Oriented Control VSI Fed PMSM [14] A. J. M. Cardaso & E. S. Saraiva "Computer-Aided
Drive” International Journal of Advanced Research in Detection of Air Gap Eccentricity in Operating Three

Electrical, Electronics and Instrumentation Engineering Phase Induction Motors by Park's Vector Approach",

Vol. 2, Issue 7, July 2013 IEEE Trans., Ind. Appl., Vol. 29, No. 5, pp. 897-901,

[2] J. Holtz & T. Thimm "Identification of the Machine September/October 1993.

Parameters in aVector-ControUed Induction Motor


Drive", IEEE Trans., Ind. Appl., Vol. 27, No. 6, pp. 1111-
1118, November/December 1991,
[3] W. Leonhard "30 Years Space Vectors, 20 Years Field
Orientation, 10 Years Digital Signal Processing with
Controlled AC Drives, a Review", EPE Journal, Vol. 1,
No. 2, pp. 89-102, October 1991.
[4] Ayman Y. Yousef " Microcontroller Based Flux Vector
Control of an Induction Motor ", Ph. D. thesis, Zagazig
University, 1995.
[5] J. Fetz & D. Horstmann "Comparison of Different Field
Oriented Control Methods for an Induction Machine Fed
by a PWM-Modulator Controlled Inverter", 3rd
Conference on Power Elec. and Appl. EPE' 89", Vol. Ill,
pp. 1079-1085, Aachen, Germany, 1989.
[6] Gamal. M. Sarhan "An Optimized Field Oriented
Induction Motor Controller", Ph.D. Thesis, Faculty of
Engineering, Cairo University, 1993.
[7] R. C. Dorf "Modern Control Systems", Addison-
Wesley Publishing Company, Inc. 1992.
[8] "Microcontroller 80C196KC User's Guide", Intel
Corporation, California. October, 1991.
[9] "MCS 96 Architectural Overview & 80C196KC Quick
Reference", Intel Corporation, California, 1991.
[10] Ashish Chourasia, Vishal Srivastava, Abhishek
Choudhary and Sakshi Praliya " Comparison Study of

26

You might also like