implementation of v/f control of three phase induction motor using microcontroller
TRANSCRIPT
-
7/27/2019 IMPLEMENTATION OF V/F CONTROL OF THREE PHASE INDUCTION MOTOR USING MICROCONTROLLER
1/60
IMPLEMENTATION OF V/F CONTROL OF THREE
PHASE INDUCTION MOTOR USINGMICROCONTROLLER
By
R.BRINDHA(Reg.No: 16104003)
A PROJECT REPORT
Submitted to the Department of
ELECTRICAL AND ELECTRONICS ENGINEERINGin the FACULTY OF ENGINEERING & TECHNOLOGY
In partial fulfillment of the requirementsfor the award of the degree
of
MASTER OF TECHNOLOGY
IN
POWER ELECTRONICS AND DRIVES
S.R.M. ENGINEERING COLLEGES.R.M INSTITUTE OF SCIENCE AND TECHNOLOGY
Deemed Universi ty
June/July, 2006
-
7/27/2019 IMPLEMENTATION OF V/F CONTROL OF THREE PHASE INDUCTION MOTOR USING MICROCONTROLLER
2/60
ii
BONAFIDE CERTIFICATE
Certified that this project report titled IMPLEMENTATION OF V/F
CONTROL OF THREE PHASE INDUCTION MOTOR USING
MICROCONTROLLER the bonafide work of R.BRINDHA (Reg. No.
16104003) who carried out the research under my supervision. Certified further, that
to the best of my knowledge the work reported here in does not form part of any
other project report or dissertation on the basis of which a degree or award was
conferred on an earlier occasion on this or any other candidate.
Signature of the Guide Signature of the H.O.D
(Ms.N.KALAIARASI, M.E) (Prof.R.CHIDAMBARAM, M.E)
Signature of Internal Examiner Signature of External
Examiner
-
7/27/2019 IMPLEMENTATION OF V/F CONTROL OF THREE PHASE INDUCTION MOTOR USING MICROCONTROLLER
3/60
iii
ABSTRACT
This project deals with simulation and hardware implementation of scalar
control (V/F control) of three-phase induction motor. The simulation work proves the
concept of V/F control and the software used for simulation is MATLAB
7.0/Simulink package. For simulation the gating pulses of inverter are generated
using Sinusoidal PWM.
The hardware implementation of V/F is also done and proved that the
experimental results are same as that of simulation results. The hardware of V/F
control comprises of three-phase MOSFET inverter, three-phase induction motor and
SPWM pulse generator. Microcontroller is used for generation of Sinusoidal PWM
pulses. It can be used in industrial drive control application.
ACKNOWLEDGEMENT
I would like to express my sincere thanks to
Prof.R.VENKATRAMANI, principal, and Prof.R.MUTHUSUBRAMANIAN
Vice principal for bringing out this project successfully.
-
7/27/2019 IMPLEMENTATION OF V/F CONTROL OF THREE PHASE INDUCTION MOTOR USING MICROCONTROLLER
4/60
iv
I wish to express my deep sense of gratitude to
Prof.R.CHIDAMBARAM, Head of the department, Department of Electrical and
Electronics Engineering for his permission and encouragement accorded to carry out
this project.
I sincerely thank my project guide Ms.N.KALAIARASI, Lecturer/EEE
who have had an untiring and active participation along the course of my project in
selection of concepts and further development of the project with timely intervention
I wish to give special thanks to my Class-in-charge and project co-
ordinator Mr.S.VENKATESH, Lecturer Department of Electrical and Electronics
for his valuable guidance and continuous encouragement in the course of my work.
I am also grateful to MR.R.CHANDRAMOHAN and all teaching and
non-teaching staff members of the Department of Electrical and Electronics
Engineering for their help during the course of project work. I wish to thank the
management ofS.R.M Institute of Science and Technology (Deemed University)
for their continuous support in my work.
TABLE OF CONTENTS
-
7/27/2019 IMPLEMENTATION OF V/F CONTROL OF THREE PHASE INDUCTION MOTOR USING MICROCONTROLLER
5/60
v
CHAPTER NO TITLE PAGE NO
ABSTRACT iiiLIST OF FIGURES vii
LIST OF ABBREVIATIONS viii
1 INTRODUCTION 1
1.1 General 1
1.2 Overview of the Thesis 1
1.3 Objective of The Thesis 2
1.4 Organisation of The Thesis 2
2 INDUCTION MOTOR 3
2.1 Introduction 3
2.2 Basic Operation 3
2.3Speed Torque Characteristics
of Induction Motor 42.4 Summary 6
3 V/F CONTROL METHOD 7
3.1 Introduction 7
3.2 Scalar Control of Induction Motor 7
3.3 V/F Control Theory 9
3.4 Summary 11
-
7/27/2019 IMPLEMENTATION OF V/F CONTROL OF THREE PHASE INDUCTION MOTOR USING MICROCONTROLLER
6/60
vi
4 SIMULATION OF V/F CONTROL
METHOD 12
4.1 Introduction 12
4.2 V/F Open Loop Control
of Induction Motor 12
4.3 Simulation Results of Open
Loop V/F Control 14
4.4 V/F Closed Loop Control
of Induction Motor 16
4.5 Simulation Results of Closed
Loop V/F Control 18
4.6 Summary 19
5 HARDWARE IMPLEMENTATION OF
V/F CONTROL METHOD 20
5.1 Introduction 20
5.2 Implementation for V/F control
of Induction Motor 20
5.2.1 Rectifier Unit 21
5.2.2 Pwm-Voltage Source Inverter
Circuit Diagram 21
5.2.3 Microcontroller Circuit Diagram
for Sine Wave Generation 22
5.2.3.1 Power Supply for
Microcontroller 24
5.2.3.2 Algorithm for
Sine Wave Generation 25
5.2.3.3 Flowchart for Sine Wave
Generation 25
-
7/27/2019 IMPLEMENTATION OF V/F CONTROL OF THREE PHASE INDUCTION MOTOR USING MICROCONTROLLER
7/60
vii
5.2.4 Sinusoidal Pulse Width
Modulation(SPWM) 28
5.2.5 Drive Circuit 30
5.3 Hardware Results of Open Loop V/F
Control of Three-Phase Induction Motor 32
5.3.1 Sinusoidal Waveform 32
5.3.2 Ramp Waveform 33
5.3.3 Comparing Sine with Ramp 33
5.3.4 PWM Pulses Waveform 34
5.3.5 Line Voltage (Vab) Waveform 34
5.4 Summary 35
6 CONCLUSIONS 36
APPENDICES
37
REFERENCES 45
-
7/27/2019 IMPLEMENTATION OF V/F CONTROL OF THREE PHASE INDUCTION MOTOR USING MICROCONTROLLER
8/60
viii
LIST OF FIGURES
FIGURE DESCRIPTION PAGENO
2.1 Speed Torque Characteristics of Induction Motor 5
3.1 Open Loop Volts/Hertz Control 8
3.2 Speed Torque Characteristics With V/FControl 11
4.1 Open Loop V/F Control Block Diagram 12
4.2 Simulation Diagram of Open Loop V/F Control of
Three-Phase Induction Motor 13
4.3 Output Speed Waveform 14
4.4 Output Gate Pulses 15
4.5 Output Line Voltage Waveform 15
4.6 Closed Loop V/F Control Block Diagram 16
4.7 Simulation Diagram of Closed Loop V/F Control of
Three Phase Induction Motor 17
4.8 Output speed Waveform 18
4.9 Output Line Voltage Waveform 18
5.1 Block Diagram of Hardware Implementation 20
5.2 Rectifier Unit 21
5.3 Circuit Diagram of PWM-Voltage Source
Inverter Circuit Diagram 21
5.4 Hardware Circuit Of Microcontroller for sine wave Generation 23
5.5 Power Circuit Diagram of Microcontroller 24
5.6 Flowchart for Sine Wave Generation 28
-
7/27/2019 IMPLEMENTATION OF V/F CONTROL OF THREE PHASE INDUCTION MOTOR USING MICROCONTROLLER
9/60
ix
5.7 Circuit Diagram for SPWM Pulse Generation 29
5.8 Circuit Diagram for Ramp Wave Generator 30
5.9 Drive Circuit 30
5.10 Optocoupler 31
5.11 Output Sinusoidal Waveform from Microcontroller 32
5.12 Output Ramp Wave Form 33
5.13 Comparing Sinusoidal Wave With Ramp Wave 33
5.14 PWM Pulses Waveform 34
5.15 Output Voltage Waveform 34
LIST OF ABBREVIATIONS
NO. ABBREVIATIONS DESCRIPTION
1 MOSFET Metal Oxide Field Effect Transistor
2 PWM Pulse Width Modulation
3 ADC Analog to Digital Converter
4 m Actual Speed
5 sl Slip Speed
6 m* Speed Command
7 sl * Slip Speed Command
8 SPWM Sinusoidal Pulse Width Modulation
CHAPTER 1
INTRODUCTION
-
7/27/2019 IMPLEMENTATION OF V/F CONTROL OF THREE PHASE INDUCTION MOTOR USING MICROCONTROLLER
10/60
x
1.1GENERAL
Industrial drive applications are generally classified into constant speed and
variable speed drives. Traditionally AC machines have been used in constant speed
applications, whereas DC machines were preferred for variable speed drives. DC
machines have the disadvantages of higher cost and maintenance problems with
commutators and brushes. Commutators and brushes do not permit a machine to
operate in dirty and explosive environment. An AC machine overcomes the draw
back of DC machines. Although currently, the majority of variable speed drive
applications use DC machines, they are progressively being replaced by AC drives.
While there are different methods of speed control of induction motor,
Variable Voltage Variable Frequency (VVVF) or V/F is the most common method of
speed control. This method is most suitable for applications without position control
requirements or the need for high accuracy of speed control. Examples of these
applications include heating, air conditioning, fans and blowers.
1.2OVERVIEW OF THE THESIS
First, implementation of open loop and closed loop V/F control of
induction motor has been done using MATLAB Simulink toolbox and corresponding
waveforms are analyzed.
Finally, hardware implementation for open loop V/F control of three-
phase induction motor is carried out and waveforms are analyzed. A comparison is
made between software implementation and hardware implementation.
-
7/27/2019 IMPLEMENTATION OF V/F CONTROL OF THREE PHASE INDUCTION MOTOR USING MICROCONTROLLER
11/60
xi
1.3OBJECTIVE OF THE THESIS
To control the speed of three phase induction motor using V/F control
stregery.
1.4ORGANISATION OF THE THESIS
This thesis is organized into five chapters including introduction, brief
description of the thesis and also it deals with the objective and Organisation of the
thesis. Chapter 2 deals with the discussion in detail about basics theory of V/F
control stregery of induction motor. Chapter 3 deals with simulation and results of
V/F control of induction motor. Chapter 4 deals with hardware implementation and
its results of V/F control of induction motor and finally Chapter 5 deals with
conclusion of this project.
-
7/27/2019 IMPLEMENTATION OF V/F CONTROL OF THREE PHASE INDUCTION MOTOR USING MICROCONTROLLER
12/60
xii
CHAPTER 2
INDUCTION MOTOR
2.1 INTRODUCTION
Induction motors are the most widely used motors in domestic
appliances, industrial control, and automation. Hence they are often called the
workhorse of the motion industry. They are robust, reliable, and durable. When
power is supplied to an induction motor, it runs at its rated speed. However, many
applications need variable speed operations. For example, a washing machine may
use different speeds for each wash cycle. Historically, mechanical gear systems were
used to obtained variable speed. Recently, power electronics and control systems
have matured to allow these components to be used for motor control in place of
mechanical gears.
2.2 BASIC OPERATION
When the rated AC supply is applied to the stator windings, it generates a
magnetic flux of constant magnitude, rotating at synchronous speed. The flux passes
through the air gap, sweeps past the rotor surface and through the stationary rotor
conductors. An electromotive force (EMF) is induced in the rotor conductors due to
the relative speed difference between the rotating flux and stationary conductors.
The frequency of the induced EMF is the same as the supply frequency.
Its magnitude is proportional to the relative velocity between the flux and the
conductors. Since the rotor bars are shorted at the ends, the EMF induced produces a
-
7/27/2019 IMPLEMENTATION OF V/F CONTROL OF THREE PHASE INDUCTION MOTOR USING MICROCONTROLLER
13/60
xiii
current in the rotor conductors. The direction of the rotor current opposes the relative
velocity between rotating flux produced by stator and stationary rotor conductors.
To reduce the relative speed, the rotor starts rotating in the same direction
as that of flux and tries to catch up with the rotating flux. But in practice, the rotor
never succeeds in catching up to the stator field. So, the rotor runs slower than the
speed of the stator field. This difference in speed is called slip speed. This slip speed
depends upon the mechanical load on the motor shaft. The frequency and speed of
the motor, with respect to the input supply, is called the synchronous frequency and
synchronous speed.
Synchronous speed is directly proportional to the ratio of supply
frequency and number of poles in the motor. Synchronous speed of an induction
motor is shown in the equation (2.1)
Where f = rated frequency of the motor
p= number of poles in the motor
Synchronous speed is the speed at which the stator flux rotates. Rotor
flux rotates slower than synchronous speed by the slip speed. This speed is called the
base speed. The speed listed on the motor nameplate is the base speed. Some
manufactures also provide the slip as a percentage of synchronous speed.
2.3 SPEED TORQUE CHARACTERISTICS OF INDUCTION
-
7/27/2019 IMPLEMENTATION OF V/F CONTROL OF THREE PHASE INDUCTION MOTOR USING MICROCONTROLLER
14/60
xiv
MOTOR
The x-axis shows slip speed, the y-axis shows torque and current, the
characteristics shown in Fig 2.1 are drawn with rated voltage and frequency supplied
to the stator. During startup the motor typically draws up to seven times the rated
current. This high current is result losses in the stator and rotor windings, and losses
in the bearings due to the friction.
At startup the motor delivers 1.5 times the rated torque of the motor. This
starting torque is also called locked rotor torque .As the speed increases, the current
drawn by the motor reduces slightly. At the base speed the motor draws the rated
current and delivers the rated torque
At base speed if the load on the motor shaft is increased beyond its rated
torque, the speed starts dropping and slip increases. If the load on the motor is
increased further, it will not be able to take any further load and the motor will stall
In addition when the load is increased beyond
the rated load, the load current increase following the
current characteristics path .Due to this higher
current flow in the windings inherent losses in the
winding increases.
The speed torque characteristic curve is highly non linear as speed varies
in application, the speed needs to be varied which makes the torque vary.
-
7/27/2019 IMPLEMENTATION OF V/F CONTROL OF THREE PHASE INDUCTION MOTOR USING MICROCONTROLLER
15/60
xv
Fig 2.1 Speed Torque Characteristics of Induction Motor
The disadvantages like motor draws high current during start up, torque
is highly non linear as speed varies. These drawbacks can be overcome by using V/F
control.
2.4 SUMMARY
This chapter describes the principle of operation of induction motor and
its speed torque characteristics. During startup the motor typically draws up to seven
times the rated current. The speed torque characteristic curve is highly non linear as
speed varies. These draw backs can be overcome by using V/F control.
-
7/27/2019 IMPLEMENTATION OF V/F CONTROL OF THREE PHASE INDUCTION MOTOR USING MICROCONTROLLER
16/60
-
7/27/2019 IMPLEMENTATION OF V/F CONTROL OF THREE PHASE INDUCTION MOTOR USING MICROCONTROLLER
17/60
xvii
by controlling the speed of fans, compressors,
pumps, etc.
2) Servo drives: - by means of sophist icated
contro l, induction motors can be used as servo
drives in computer peripherals, machine tools
and robotics.
However by means of power electronic
converters, it is possible to change the speed of an
induction motors. Even though the induction motors
are desirable, their speed control is not as straight
forward as that of a dc motor.
3.2 SCALAR CONTROL OF INDUCTION MOTOR
The following are the scalar control
techniques of an induction motor are given.
(1) Voltage/frequency (V/F) control
(2) Stator current and slip frequency
control
Scalar control, as the name indicates, is due
to magnitude variation of control variables only
and disregards the coupling effect in the machine.
-
7/27/2019 IMPLEMENTATION OF V/F CONTROL OF THREE PHASE INDUCTION MOTOR USING MICROCONTROLLER
18/60
xviii
For example, the voltage of a machine can be
controlled to control the flux, and frequency or slip
can be controlled to control the torque. However,
flux and torque are also the function of frequency
and voltage, respectively.
A simple and popular open loop
voltage/frequency control of induction motor isshown in Fig 3.1 .The power circuit consists of a
phase-controlled rectifier (R) supplied with 3-phase
supply. It is followed by a filter and a PWM inverter
(I). The frequency e*, is the command variable and
it is close to the motor speed. The scheme is
defined as the volts/hertz control because therectifier voltage command, Vs
*, is generated
directly from the frequency signal through a
volts/hertz gain constant (G).
-
7/27/2019 IMPLEMENTATION OF V/F CONTROL OF THREE PHASE INDUCTION MOTOR USING MICROCONTROLLER
19/60
xix
Fig. 3.1 Open Loop Volt/Hertz Control.
Here, sinusoidal PWM inverter is used because it can provide the
constant volts/hertz supply required for constant-torque operation of an ac motor. An
L-C filter is interposed between the rectifier and the inverter to maintain a ripple free
dc voltage at the input of the inverter, and thus prevent the harmonics in the rectifier
output voltage from getting coupled with the inverter.
3.3 V/F CONTROL THEORY
The base speed of the induction motor is directly proportional to the
supply frequency and the number of poles of the motor. Since the number of poles is
fixed by design, the best way to vary the speed of the induction motor is by varying
the supply frequency. The torque developed by the induction motors is directly
proportional to the ratio of the applied voltage and the frequency of supply. By
varying the voltage and the frequency, but keeping their ratio constant, throughout
the speed range. This exactly what v/f control tries to achieve.
-
7/27/2019 IMPLEMENTATION OF V/F CONTROL OF THREE PHASE INDUCTION MOTOR USING MICROCONTROLLER
20/60
xx
Other than the variation in speed the torque-speed characteristics of the
V/F control from Fig 3.2 reveals the following.
The starting current requirement is lower.
The stable operating region of the motor is increased. Instead of
simply running at its base rated speed, the motor can be typically from
5% of the synchronous speed up to the base speed .The torque
generated by the motor can be kept constant throughout this region.
At the base speed, the voltage and frequency reach the rated values.
We can drive the motor beyond the base speed by increasing the
frequency further. However, the applied voltage cannot be increased
beyond the rated voltage. Therefore, only the frequency can be
increased, which results in the reduction of torque. Above the speed
the factors governing torque become complex.
The acceleration and deceleration of the motor can be controlled by
controlling the change of the supply frequency to the motor with
respect to time.
The induction motor draws the rated current and delivers the rated torqueat the base speed. When the load is increased, while running at base speed, the speed
drops and slip increases. The motor can take up to 2.5 times rated torque with around
20% drop in speed. Any further increase of load on the shaft can stall the motor.
The torque developed by the motor is directly proportional to the
magnetic field produced by the stator. So the voltage applied to the stator is directly
proportional to the product of the stator flux and angular velocity. This makes the
flux produced by the stator proportional to the ratio of applied voltage and frequency
of supply.
By varying the frequency, the speed of the motor can be varied.
Therefore, by varying the voltage and frequency by the same ratio, flux and hence
-
7/27/2019 IMPLEMENTATION OF V/F CONTROL OF THREE PHASE INDUCTION MOTOR USING MICROCONTROLLER
21/60
xxi
the torque can be kept constant through out the speed range. This makes constant V/F
the most common speed control of the induction motor.
The equations (3.2) and (3.3) shows the
relationship between the voltage and torque versusfrequency. The voltage and frequency being
increased upto the base speed. At the base speed,
the voltage and frequency reach the rated values. We
can drive the motor beyond base speed by increasing
the frequency further. However, the voltage applied
cannot be increased the rated voltage.
Therefore, only the frequency can be
increased, which results in the field weakening and
torque available is being reduced. Above base speed,
the factors governing torque become complex, since
friction and windage losses increase significantly at
highest speeds. Hence, the torque curve becomes
non linear with respect to speed or frequency.
-
7/27/2019 IMPLEMENTATION OF V/F CONTROL OF THREE PHASE INDUCTION MOTOR USING MICROCONTROLLER
22/60
xxii
Fig 3.2 Speed Torque Characteristics With V/F
Control
3.4 SUMMARY
This chapter deals with the V/F control theory and its speed- torque
characteristic states at the base speed, the voltage and frequency reach the rated
values. The motor can be drive beyond the base speed by increasing the frequency.
However, the applied voltage cannot be increased beyond the rated voltage. The
starting current requirement is low. The stable operating region of the motor is
increased.
-
7/27/2019 IMPLEMENTATION OF V/F CONTROL OF THREE PHASE INDUCTION MOTOR USING MICROCONTROLLER
23/60
xxiii
CHAPTER 4
SIMULATION OF V/F CONTROL METHOD
4.1 INTRODUCTION
The V/F is simulated on MATLAB/Simulink software. The actual system
can be simulated with a high degree of accuracy in this package. It provides a user
interactive platform and wide variety of numerical algorithm. This Chapter discusses
the realization of V/F control using Simulink block .The Fig (4.2) and (4.8) shows
the basic block Simulink diagram for V/F control of three-phase induction motor.
4.2 V/F OPEN LOOP CONTROL OF INDUCTION MOTOR
The induction motors are often operated in open loop with no velocity or
position feed back.Fig.4.1 shows the open loop v/f control block diagram. The V/F
ratio is maintained constant to provide a constant torque over the operating range.
This form of control is relatively inexpensive and easy to implement.
-
7/27/2019 IMPLEMENTATION OF V/F CONTROL OF THREE PHASE INDUCTION MOTOR USING MICROCONTROLLER
24/60
xxiv
Fig.4.1 Open Loop V/F Control Block Diagram
The operation of an ac induction motor is
governed by two principles:
1. Base speed is directly proportional to the frequency of the alternating
current applied to the stator and the number of poles of the motor.
2. Torque is directly proportional to the ratio of applied voltage and
frequency of the applied ac current.
The Fig 4.2 shows the simulation diagram of open loop V/F control of
three-phase induction motor. It consists DC source, three -phase PWM inverter and
three phase induction motor. Dc source is connected to the dc side of the converter.
In this reference speed is set. From that reference speed frequency is determined
using the formulae illustrated in the equation (2.1). V/F function block determines
the amplitude corresponding to that frequency. This frequency and amplitude are
used to update the PWM duty cycle. MOSFET based converter gives the supply of
the induction motor. Connecting the scope through bus selector shows speed of the
induction motor.
Discret
Ts =
v+
-
Vab
Torque
step
Scope
Scope
Mux
Mux2
PWMBLOCKT
m
A
B
C
Induction
g
A
B
C
+
-
Inverter
f(u)
In RM
Discrete
RMS
+
Controlled Voltage
Constant
50
Constan
Cloc
-
7/27/2019 IMPLEMENTATION OF V/F CONTROL OF THREE PHASE INDUCTION MOTOR USING MICROCONTROLLER
25/60
xxv
Fig 4.2 Simulation Diagram of Open Loop V/F Control of Three-Phase
Induction Motor
4.3 SIMULATION RESULTS OF OPEN LOOP V/F CONTROL
The Fig 4.3 shows the simulated speed waveform of open loop V/F
control of three-phase induction motor. Reference speed is set at 1460 RPM. Speed
reaches the steady state at 0.3 second.
Speed
(RPM)
Time (sec)
Fig 4.3 Output Speed Waveform
The Fig 4.4 shows the gate pulses for PWM inverter consists of three
legs, one for each phase. The gating signals for the three phase inverters have a phase
difference of 120. The first pulse is given to the positive switch of phase A, the
pulse is given to the positive switch of phase B the third to the positive switch ofphase C.
-
7/27/2019 IMPLEMENTATION OF V/F CONTROL OF THREE PHASE INDUCTION MOTOR USING MICROCONTROLLER
26/60
xxvi
USWA
Time (sec)
USWB
Time (sec)
USWC
Time (sec)
Fig 4.4 Output Gate Pulses
The Fig 4.5 shows the simulated line-to-line voltage waveform of
open loop V/F control of three-phase induction motor. It is observed that the
voltage waveform is almost sinusoidal.
-
7/27/2019 IMPLEMENTATION OF V/F CONTROL OF THREE PHASE INDUCTION MOTOR USING MICROCONTROLLER
27/60
xxvii
Voltage(V)
Time (sec)
Fig 4.5 Output Line Voltage Waveform
4.4 V/F CLOSED LOOP CONTROL OF INDUCTION MOTOR
Fig 4.7 shows the block diagram of closed
loop V/F control of three-phase induction motor. The
speed error is processed through a PI controller and
slip speed regulator .The slip speed regulator sets the
slip speed command sl, whose maximum value is
limited to limit the inverter current to a permissiblevalue. The synchronous speed, obtained by adding
actual speed m and slip speed sl, determines the
inverter frequency .The reference signals for the
closed loop control of the machine terminal voltage
Vi* is generated from frequency f using a function
generator .It ensures nearly a constant flux operation
up to the base speed and the operation at a constant
terminal voltage above the base speed.
-
7/27/2019 IMPLEMENTATION OF V/F CONTROL OF THREE PHASE INDUCTION MOTOR USING MICROCONTROLLER
28/60
xxviii
A step increased in speed command m*
produces a positive speed error. The slip speed
command sl * is set at a maximum value. The drive
accelerated at a maximum permissible inverter
current, producing the maximum available torque,
unti l the speed error is reduced to a small value.
Fig 4.6 Closed Loop V/F Control Block Diagram
The Fig 4.8 shows the simulation diagram of closed loop V/F control of
three-phase induction motor. It consists DC source, three -phase PWM inverter and
three phase induction motor as open loop in addition to that it has PI controller,
limiter. Connecting the scope through bus selector .Now the simulation circuit is run
with closed loop control shows speed of the induction motor.
-
7/27/2019 IMPLEMENTATION OF V/F CONTROL OF THREE PHASE INDUCTION MOTOR USING MICROCONTROLLER
29/60
xxix
Fig 4.7 Simulation Diagram of Closed Loop V/F Control of Three-Phase
Induction Motor
4.5 SIMULATION RESULTS OF CLOSED LOOP V/F CONTROL
Constant V/HzControl
Discrete,Ts = 3.255e-005 s.
flux
v+
Vab
Scope
Scop
Mux
PWM
BLOCK
MATLA
Functio
MATLAB
Tm
mA
B
CInduction
g
A
B
C
+
-
Inverter
-K-
f(u)
K Ts
z-1
In RMS
Discrete
RMS
DiscretRate
Limite
Discret
Rate
PI
DiscretPI speed
s -
+
Controlled Voltage
Clock
Clock
thet
m
-
7/27/2019 IMPLEMENTATION OF V/F CONTROL OF THREE PHASE INDUCTION MOTOR USING MICROCONTROLLER
30/60
xxx
The Fig 4.9 shows the simulated speed waveform of closed loop V/F
control of three-phase induction motor. Reference speed is set at 1460 RPM. It
reaches the steady state at 0.1 second
Speed (rpm)
Time (sec)
Fig 4.8 Output Speed Waveform
The Fig 4.10 shows the simulated line-to-line voltage waveform of
closed loop V/F control of three-phase induction motor. It is observed that the
voltage waveform is almost sinusoidal
Voltage(V)
Time (sec)
Fig 4.9 Output Line Voltage Waveform
The Fig 4.11 shows the output current waveform of phase A closed loop
V/F control of three-phase induction motor. It is found that the output current
waveform is distorted
-
7/27/2019 IMPLEMENTATION OF V/F CONTROL OF THREE PHASE INDUCTION MOTOR USING MICROCONTROLLER
31/60
xxxi
4.6 SUMMARY
This chapter describes the simulation of V/F control of induction motor
using MATLAB/Simulink and simulation results were presented. From the outputs
obtained it is clearly observed that the time taken for speed waveform for closed loop
control reaches the steady state faster than open loop control. It is also observed that
the average output of three-phase line-to-line voltage waveform is almost sinusoidal.
-
7/27/2019 IMPLEMENTATION OF V/F CONTROL OF THREE PHASE INDUCTION MOTOR USING MICROCONTROLLER
32/60
xxxii
CHAPTER 5
HARDWARE IMPLEMENTATION OF V/F CONTROL
METHOD
5.1 INTRODUCTION
The V/F control of three-phase induction motor is implemented in
hardware and the gating pulses for the inverter fed motor are generated through the
PIC Microcontroller. The main controlling unit of the project is the microcontroller.
5.2 IMPLEMENTATION FOR V/F CONTROL OF INDUCTION
MOTOR
-
7/27/2019 IMPLEMENTATION OF V/F CONTROL OF THREE PHASE INDUCTION MOTOR USING MICROCONTROLLER
33/60
-
7/27/2019 IMPLEMENTATION OF V/F CONTROL OF THREE PHASE INDUCTION MOTOR USING MICROCONTROLLER
34/60
xxxiv
Fig 5.2 Rectifier Unit
5.2.2 PWM-Voltage Source Inverter Circuit Diagram
Fig 5.3 Circuit Diagram of PWM-Voltage Source Inverter Circuit Diagram
The Fig 5.3 shows PWM-voltage source inverter circuit diagram.
Inverters are employed to get a variable frequency as supply from a dc supply. For
the control of ac motor, voltage should also be controlled along with frequency.
Variation in output voltage can be achieved by varying the input dc voltage. Output
voltage and current have stepped waveform. Consequently they have substantial
amount of harmonics. Variable frequency and variable voltage ac is directly obtained
from fixed voltage dc when the inverter is controlled by pulse width modulation the
pwm control also reduces harmonics in the output voltage and also it eliminates the
following draw back of 6-step inverter drives like the motor losses increases at all
speeds causing derating of motor, torque pulsation at low speeds.
-
7/27/2019 IMPLEMENTATION OF V/F CONTROL OF THREE PHASE INDUCTION MOTOR USING MICROCONTROLLER
35/60
xxxv
In this method, several pulses per half cycle are used as in case of
multiple pulse width modulation. Instead of maintaining the width of all pulses the
same as in the case of multiple pulse modulation, the width of each pulses is varied
proportional to the amplitude of a sine wave evaluated at the center of the same
pulses. By comparing a sinusoidal reference signal with a triangular carrier wave
frequency, fc, the gating signal are generated.
The PWM control has the following advantages,
(1)The output voltage control can be obtained with out any additional components
(2)With this type of control, lower order harmonics can be eliminated of minimized
along with its output voltage control. The filtering requirements are minimized
as higher order harmonics can be filtered easily
5.2.3 Microcontroller Circuit Diagram for Sine Wave Generation
The PIC microcontroller is the main controlling unit of the project. The
main features and sine wave generation of PIC microcontroller (16F877A) is
explained section 5.3.3.a. Fig 5.5 shows the pin diagram of microcontroller, Digital
to Analog (DAC) and Buffer. Microcontroller used is a 40 pin single chip IC. It has 5
ports, they are A, B, C, D and E. It has 3 Digital to Analog Converters (DAC) and 5
latches RAX, RBX, RCX, and RDX AND REX.
-
7/27/2019 IMPLEMENTATION OF V/F CONTROL OF THREE PHASE INDUCTION MOTOR USING MICROCONTROLLER
36/60
xxxvi
Fig 5.4 Hardware Circuit of Microcontroller for Sine Wave Generation
-
7/27/2019 IMPLEMENTATION OF V/F CONTROL OF THREE PHASE INDUCTION MOTOR USING MICROCONTROLLER
37/60
xxxvii
Design Features of Microcontroller
1. Input to DAC through PORT C
2. RB0 FIRST LATCH CONTROL BIT
3. RB1- SECOND LATCH CONTROL BIT
4. RB2- THIRD LATCH CONTROL BIT
5. Give the array a[ ] element to PORT C and enable first latch by setting
RB0.by doing this R phase DAC produced its waveform. Give small delay in
between switching two latches. Enable second latch by setting RB1 and give
b[ ] input to DAC2.similarlygive input to DAC 3.
6. After giving to 3 DAC give a delay that will determine the frequency. This
delay is obtained from the DAC
5.2.3.1. Power Supply for Microcontroller
All electronic circuits works only in low DC voltage, so we need a power
supply unit to provide the appropriate voltage supply for their proper functioning. Fig 5.6
shows the power circuit diagram of microcontroller. This unit consists of transformer,
rectifier, filter & regulator. AC voltage of typically 230v rms is connected to a
transformer voltage down to the level to the desired ac voltage. A diode rectifier that
provides the full wave rectified voltage that is initially filtered by a simple capacitor
filter to produce a dc voltage. This resulting dc voltage usually has some ripple or ac
voltage variation. A regulator circuit can use this dc input to provide dc voltage that not
only has much less ripple voltage but also remains the same dc value even the dc voltage
varies somewhat, for the load connected to the output dc voltages changes.
-
7/27/2019 IMPLEMENTATION OF V/F CONTROL OF THREE PHASE INDUCTION MOTOR USING MICROCONTROLLER
38/60
xxxviii
Fig 5.5 Power Circuit Diagram of Microcontroller
5.2.3.2 Algorithm for Sine Wave Generation
Calculate the array elements using the formula 128+ 128sin(alpha),
128+128sin (120+alpha), 128+ 128sin(240+alpha) Array name a [], b [], c []
Initialize PORTC, PORT B as output port and port RA0 as input port, ADC
Module
Turn on ADC
Wait till completion of conversion.
Give phase A data to PORTC
Turn on the phase A latch by setting RB0. Give phase B data to PORT C
Turn on phase B latch by setting RB1
Give phase C data to port C
Turn on phase C latch by setting RB2
Give a long delay. That delay period obtained from ADC which determines
frequency (if ADC value Z=0 the frequency=12 hertz
If ADC value Z=255 the frequency=50 hertz
Until the first half cycle is reached, Repeat the above steps from step 4
Subtract the array element from 255 and give to ADC.for producing negative
half cycle
5.2.3.3 Flowchart for Sine Wave Generation
-
7/27/2019 IMPLEMENTATION OF V/F CONTROL OF THREE PHASE INDUCTION MOTOR USING MICROCONTROLLER
39/60
xxxix
The main logic for sine wave generation using microcontroller is
explained in the flow chart Fig 5.6
Start
Initialize
Ports And ADC
Convert ADC Results Into A Byte
and Store It In Available Z
Load 2 Micro
Second Delay
Set RB0 [Turn On
Phase A Latch]
Clear RB0 [Shunt Off Phase A Latch]
D
B
Load Phase B Input To Port C
[Input Stored In Array B [ ] ]
Load Phase A Input To Port C
[Input Stored In Array A [ ] ]
-
7/27/2019 IMPLEMENTATION OF V/F CONTROL OF THREE PHASE INDUCTION MOTOR USING MICROCONTROLLER
40/60
xl
NO
Clear RB1 [Shunt Off
Phase B Latch]
Set RB2 [Turn On
Phase C Latch]
Clear RB2 [Shunt Off
Phase C Latch]
Increment I register
IF
i < 90
Load 2 Micro
Second Delay Period
Load Delay
Period Of Z+75
Milli Second
B
Load 2 Micro Second
Delay Period To ADC
Set RB0 [TurnOn Phase A
Load Phase C Input To Port C
[Input Stored In Array C[ ] ]
-
7/27/2019 IMPLEMENTATION OF V/F CONTROL OF THREE PHASE INDUCTION MOTOR USING MICROCONTROLLER
41/60
xli
YES
NO
YES
Fig 5.6 Flowchart for Generating Sine Wave
5.2.4. Sinusoidal Pulse Width Modulation (SPWM)
Fig 5.8 shows the SPWM pulse generation circuit diagram. This circuit
generates sinusoidal pwm pulse. The output wave of Microcontroller is given as the
PORT C = 255-a[i]
= 255-b[i]
= 255-c[i]
Set Port B
Load 2 Micro
Second Delay
Period To ADC
Clear Port BLoad Delay Period Z+75
Milli Second To A
Initialize K
Increment K register
IF
K< 90
Stop
D
-
7/27/2019 IMPLEMENTATION OF V/F CONTROL OF THREE PHASE INDUCTION MOTOR USING MICROCONTROLLER
42/60
xlii
input to pin 3 of LM324 the circuit. The output got from the pin 1of (LM324) buffer
in similar to that the input, which is then fed through a pin 5 of square wave
converter (LM358) to produce square wave. When the sine wave is passed through
precisition rectifier (LM38), it produces rectified output. This rectified output from
pin 7 and the ramp wave generated from pin 5 of the Ramp generators (ICL8038) are
compared and produces PWM pulses of the cycle at pin 7.
Some of the square wave when passed through a transistor is converted
into an inverted square wave. The inverted square wave is fed through a AND gate
(CD4053) and the output got is also in the form of inverted square wave with delay
time, this delay is due to the diode present in the AND gate.
Some of the square wave directly fed to AND gate and produce square
wave of the cycle with delay time due to diode action.
Two types of results were produced while comparing with PWM pulses.
When the PWM pulses compared with the positive cycle square wave it produces the
positive cycle PWM pulses.
When the PWM pulses compared with the negative cycle square wave it
produces the negative cycle PWM pulses.
-
7/27/2019 IMPLEMENTATION OF V/F CONTROL OF THREE PHASE INDUCTION MOTOR USING MICROCONTROLLER
43/60
xliii
Fig5.7 Circuit Diagram for SPWM Pulse Generation
-
7/27/2019 IMPLEMENTATION OF V/F CONTROL OF THREE PHASE INDUCTION MOTOR USING MICROCONTROLLER
44/60
xliv
Fig5.8 Circuit Diagram for Ramp Wave Generator
5.2.5DRIVE CIRCUIT
Drive circuit isolates power circuit (VSI) and microcontroller circuit. The
main function of Drive circuit is isolation and amplification. The Fig 5.9 shows the
drivecircuit
-
7/27/2019 IMPLEMENTATION OF V/F CONTROL OF THREE PHASE INDUCTION MOTOR USING MICROCONTROLLER
45/60
xlv
Fig 5.9 Drive circuit
The output of microcontroller is given to the Buffer IC (CD 4050). The
signal is amplified and is given to optocoupler (MCT2E) circuit.
There are many situations where signals and data need to be transferred
from one subsystem to another, without making direct ohmic electrical
connection because the source and destination are at different voltages levels that
is a microcontroller which is operating with 5v dc but being used to control a
MOSFET which is switching 240v AC supply.
An Optocoupler contains a light emitting diode with a light sensitive
device in package. One of the simplest example is LED packed with a
phototransistor. The LED is illuminated by an input supply and the
phototransistor, responding to light, drives an output circuit. Thus the input and
output circuits are coupled by light energy alone. The principal advantage of this
arrangement is excellent electrical isolation is between input and output. These
devices are often called optoisolators. One of the optocoupler is shown in Fig5.10
x
y
a
b
Fig 5.10 Optocoupler
The amplified signal from buffer circuit is fed to the optocoupler. When
the optocoupler input signal is in high state, the optocoupler is activated. When
optocoupler is activated the transistor T1 is activated through resistor (R3). When T1
is activated, the current flows through the supply-D-T1and supply. Due to the
-
7/27/2019 IMPLEMENTATION OF V/F CONTROL OF THREE PHASE INDUCTION MOTOR USING MICROCONTROLLER
46/60
xlvi
voltage drop across resistor (R4) the transistor T2 and T3 are activated .Now the
current flows through the D-T2-T3-R7_supply.the pulse is taken across R8.
5.3 HARDWARE RESULTS OF OPEN LOOP V/F CONTROL OF
THREE-PHASE INDUCTION MOTOR
The open loop V/F control of three-phase induction motor is implemented
in hardware and the obtained results are shown below
5.3.1 sinusoidal Waveform
Fig 5.10 shows the sine waveforms obtained from microcontroller and its
frequency is 50 HZ with 120-phase shift. The amplitude of sine wave of phase A
obtained from microcontroller is 2.5V.
Voltage
(V)
Time (millisecond)
Voltage
(V)
-
7/27/2019 IMPLEMENTATION OF V/F CONTROL OF THREE PHASE INDUCTION MOTOR USING MICROCONTROLLER
47/60
xlvii
Time (millisecond)
Fig 5.11 Output Sinusoidal Waveform from Microcontroller
5.3.2 Ramp Waveform
The fig 5.12 shows the ramp wave generated from ramp wave generator
(ICL8038) and its frequency is 555 HZ. The amplitude of ramp wave obtained from
PWM generator is 0.7V
Voltage
(V)
Time (millisecond)
Fig 5.12 Output Ramp Wave Form
5.3.3 Comparing Sine with Ramp
The fig 5.13 shows the comparison of sinusoidal wave and ramp wave
for sinusoidal pulse width modulation pulse generation. Modulation index is 1
Voltage
(V)
-
7/27/2019 IMPLEMENTATION OF V/F CONTROL OF THREE PHASE INDUCTION MOTOR USING MICROCONTROLLER
48/60
xlviii
Time (millisecond)
Fig 5.13 Comparing sinusoidal Wave With Ramp Wave
5.3.4 PWM Pulses Waveform
The Fig 5.13 shows the pwm pulses obtained by comparing carrier and
sine waveform.
Voltage
(Volts)
time (m sec)
Fig 5.14 PWM Pulses Waveform
5.3.5 Line Voltage (Vab) Waveform
The Fig 5.1.6 shows the voltage waveform for Line-to- Line voltage Vab.
The voltage is obtained from the inverter output terminals is 43V
-
7/27/2019 IMPLEMENTATION OF V/F CONTROL OF THREE PHASE INDUCTION MOTOR USING MICROCONTROLLER
49/60
-
7/27/2019 IMPLEMENTATION OF V/F CONTROL OF THREE PHASE INDUCTION MOTOR USING MICROCONTROLLER
50/60
l
CHAPTER 6
CONCLUSIONS
The speed of three-phase induction motor is
being controlled by varying supply voltage and
frequency wi th constant (V/F) ratio. It is simple,
economic to easier to design and implement in open
loop. But the drawbacks of open loop is it doesnt
correct the change in output also it doesnt reach the
steady state quickly.
-
7/27/2019 IMPLEMENTATION OF V/F CONTROL OF THREE PHASE INDUCTION MOTOR USING MICROCONTROLLER
51/60
li
These drawbacks can be overcome by modifying an open loop into a
closed loop system. In this project only open loop was implemented in hardware.
The project can be extended in future to control the speed of induction motor in
closed loop.
APPENDICES
//16F870.h Header File/////////Standard Header files for the PIC16F870 device////////
#device PIC16F870
#no list
////////// Program memory: 2048x14 Data Ram: 128 stack: 8
//////////I/O:22 Analog pins: 5
////////// Data EEprom: 1024
////////// C Scratch area: 20 ID locations: 2000
-
7/27/2019 IMPLEMENTATION OF V/F CONTROL OF THREE PHASE INDUCTION MOTOR USING MICROCONTROLLER
52/60
lii
/////////// Fuses: LP,
XT,HS,RC,NOWDT,WDT,NOPUT,PUT,PROTECT,NOPROTECT,DEBUG////////// Fuses:
NODEBUG, NOBROWNOUT, BROWNOUT, LVP, NOLVP, CPD, NOCPD,
WRT, NOWRT
////////////////////////////////////////////////////////////I/O
// Discrete I/O functions: SET_TRIS_X (), OUTPUT_X (), INPUT_X ()
/// PORT_B_PULLUPS (), INPUT (),
/// OUTPUT_LOW (), OUTPUT_HIGH ()
// OUTPUT_FLOAT (), OUTPUT_BIT ()
//CONSTANTS USED TO IDENTIFY PINS IN THE ABOVE ARE:
#define PIN_A0 40
#define PIN_A1 41#define PIN_A2 42
#define PIN_A3 43
#define PIN_A4 44
#define PIN_A5 45
#define PIN_B0 48
#define PIN_B1 49
#define PIN_B2 50
#define PIN_B3 51
#define PIN_B4 52
#define PIN_B5 53
#define PIN_B6 54
#define PIN_B7 55
#define PIN_C0 56
#define PIN_C1 57
#define PIN_C2 58
#define PIN_C3 59
#define PIN_C4 60
#define PIN_C5 61
#define PIN_C6 62
#define PIN_C7 63
////////////////////////////////////////////////////////////
Useful defines
#define FALSE 0
#define TRUE 1
#define BYTE int
#define BOOLEAN short int
-
7/27/2019 IMPLEMENTATION OF V/F CONTROL OF THREE PHASE INDUCTION MOTOR USING MICROCONTROLLER
53/60
liii
#define getc getch#define fgetc getch
#define getcahr getch
#define putc putchar
#define fputc put char
#define fgets gets
#define fputs puts
/////////////////////////////////////////////////////////////
control
// control function: RESET_CPU (), SLEEP (), RESTART_CAUSE ()
// CONSTANTS RETURNED FROM RESTART_CAUSE () ARE:
#define WDT_FROM_SLEEP 0
#define WDT_TIMEOUT 8
#define MCLR_FROM_SLEEP 16
#define NORMAL_POWER_UP 24
//////////////////////////////////////////////////////////
Timer 0
// Timer 0 (AKA RTCC) functions: SETUP_COUNTERS () OR SETUP_TIMER0 ()
// SET_TIMER0() OR SET_RTCC(),
// GET_TIMER0() OR GET_RTCC()
// CONSTANTS USED FOR SETUP_TIMER0() are:
#define RTCC_INTERNAL 0
#define RTCC_EXT_L_TO_H 32
#define RTCC_EXT_H_TO_L 48
#define RTCC_DIV_1 8
#define RTCC_DIV_2 0
#define RTCC_DIV_4 1
#define RTCC_DIV_8 2
#define RTCC_DIV_16 3
#define RTCC_DIV_32 4
#define RTCC_DIV_64 5
#define RTCC_DIV_128 6#define RTCC_DIV_256 7
#define RTCC_8_BIT 0
// constants used for SETUP_COUNTERS() are the above
// constants for the 1st param and the following for
// the 2nd param:
-
7/27/2019 IMPLEMENTATION OF V/F CONTROL OF THREE PHASE INDUCTION MOTOR USING MICROCONTROLLER
54/60
liv
//////////////////////////////////////////////////////////////// WDT// watch Dog Timer Functions: SETUP_WDT() or SETUP_COUNTERS() (see
Above)
// RESTART_WDT ()
//
#define WDT_18MS 8
#define WDT_36MS 9
#define WDT_72MS 10
#define WDT_144MS 11
#define WDT_288MS 12
#define WDT_576MS 13
#define WDT_1152MS 14
#define WDT_2304MS 15
//////////////////////////////////////////////////////////////
TIMER 1
// Timer 1 Function: SETUP_TIMER_1, GET_TIMER1, SET_TIMER1
// constants used for SETUP_TIMER_1 () are:
// (OR (via 1) together constants from each group)
#define T1_DISABLE 0
#define T1_INTERNAL 0X85
#define T1_EXTERNAL 0X87
#define T1_EXTERNAL_SYNC 0X83
#define T1_CLK_OUT 8
#define T1_DIV_BY_1 0
#define T1_DIV_BY_2 0X10
#define T1_DIV_BY_4 0X20
#define T1_DIV_BY_8 0X30
////////////////////////////////////////////////////////////
TIMER 2
// Timer 2 Function : SETUP_TIMER_2,GET_TIMER2, SET_TIMER2constants used for SETUP_TIMER_2() are:
#define T2_DISABLE 0
#define T2_DIV_BY_1 4
#define T2_DIV_BY_4 5
#define T2_DIV_BY_16 6
//////////////////////////////////////////////////////////CCP
-
7/27/2019 IMPLEMENTATION OF V/F CONTROL OF THREE PHASE INDUCTION MOTOR USING MICROCONTROLLER
55/60
lv
//CCP Functions :SETUP_CCPX,SET_PWMX_DUTY
//CCP Variables :CCP_X,CCP_X_LOW,CCP_X_HIGH//constants used for SETUP_CCPX() are:
#define CCP_OFF 0
#define CCP_CAPTURE_FE 4
#define CCP_CAPTURE_RE 5
#define CCP_CAPTURE_DIV_4 6
#define CCP_CAPTURE_DIV_16 7
#define CCP_COMPARE_SET_ON_MATCH 8
#define CCP_COMPARE_CLR_ON_MATCH 9
#define CCP_COMPARE_INT 0XA
#define CCP_COMPARE_RESET_TIMER 0XB
#define CCP_PWM 0XC
#define CCP_PWM_PLUS_1 0XIC#define CCP_PWM_PLUS_2 0X2C
#define CCP_PWM_PLUS_3 0X3C
long CCP_1;
#byte ccp_1 = 0X15
#byte ccp_1_LOW= 0X15
#byte ccp_1_HIGH= 0X16
/////////////////////////////////////////////////////////// PSP
// PSP FUNCTIONS: SETUP_PSP, PSP_INPUT_FULL(), PSP_OUTPUT_FULL(),
// PSP_OVERFLOW(), INPUT_D(),OUTPUT_D()
// PSP VARIABLES: PSP_DATA
//Constants used in SETUP_PSP() are:
#define PSP_ENABLED 0X10
#define PSP_DISABLED 0
#byte PSP_DATA= 8
/////////////////////////////////////////////////////SPI
//SPI Functions:SETUP_SPI,SPI_WRITE,SPI_READ, SPI_DATA_IN
//Constants used in SETUP_SSP() ARE:
#define SPI_MASTER 0X20#define SPI_SLAVE 0X24
#define SPI_L_TO_H 0
#define SPI_H_TO_L 0X10
#define SPI_CLK_DIV_4 0
#define SPI_CLK_DIV_16 1
#define SPI_CLK_DIV_64 2
#define SPI_CLK_T2 3
-
7/27/2019 IMPLEMENTATION OF V/F CONTROL OF THREE PHASE INDUCTION MOTOR USING MICROCONTROLLER
56/60
lvi
#define SPI_SS_DISABLED 1
///////////////////////////////////////////////////// ADC
//ADC FUNCTIONS:SETUP_ADC() ,SETUP_ADC_PORTS() (aka
SETUP_PORT_A),
// SET_ADC_CHANNAL(),READ_ADC()
//Constants used in SETUP_ADC_PORTS() are:
#define NO_ANALOGS 0X86 //NONE
#define ALL_ANALOG 0X80 //A0 A1 A2 A3 A5 E0 E1 E2
Ref=Vdd
#define A_ANALOG_RA3_REF 0X81 //A0 A1 A2 A5 E0 E1 E2
Ref=A3
#define A_ANALOG 0X82 //A0 A1 A2 A3 A5 Ref=Vdd
#define A_ANALOG_RA3_REF 0X83 // A0 A1 A2 A5 Ref=A3#define RA0_RA1_RA3_ANALOG 0X84 //A0 A1 A3 Ref=Vdd
#define RA0_RA1_ANALOG_RA3_REF 0X85 //A0 A1 Ref=A3
#define ANALOG_RA3_RA2_REF 0X88 //A0 A1 A5 E0 E1 E2
Ref=A2,A3
#define ANALOG_NOT_RE1_RE2 0X89 //A0 A1 A2 A3 A5 E0
Ref=Vdd
#define ANALOG_NOT_RE1_RE2_REF_RA3 0X8A //A0 A1 A2 A5 E0
Ref=A3
#define ANALOG_NOT_RE1_RE2_REF_RA3_RA2 0X8B //A0 A1 A5 E0
Ref=A2,A3
#define A_ANALOG_RA3_RA2_REF 0X8C //A0 A1 A5 Ref=A2,A3
#define RA0_RA1_ANALOG_RA3_RA2_REF 0X8D //A0 A1 Ref=A2,A3
#define RA0_ANALOG 0X8E //A0
#define RA0_ANALOG_RA3_RA2_REF 0X8F //A0 Ref=A2,A3
//CONSTANTS USED FOR SETUP_ADC() ARE:
#Define ADC_OFF 0 //ADC OFF
#Define ADC_CLOCK_DIV_2 1
#Define ADC_CLOCK_DIV_8 0X41
#Define ADC_CLOCK_DIV_32 0X81
#Define ADC_CLOCK_INTERNAL 0Xcl //INTERNAL 2-BUS
// constants used in READ_ADC() are:
#define ADC_STRAT_AND_READ 7 //This is the default if nothing is
specified
#define ADC_START_ONLY 1
#define ADC_READ_ONLY 6
-
7/27/2019 IMPLEMENTATION OF V/F CONTROL OF THREE PHASE INDUCTION MOTOR USING MICROCONTROLLER
57/60
lvii
///////////////////////////////////////////////////////////INT
// interrupt functuion : ENABLE_INTERRUPTS(), DISABLED_INTERRUPTS(),// EXT_INT_EDGE()
//
//Constants used in EXT_INT_EDGE() ARE:
#define L_TO_H 0X40
#define H_TO_L 0
// constants used in ENABLE/DISABLE_INTERRUPTS() are:
#define GLOBAL 0X0BC0
#define INT_RTCC 0X0B20
#define INT_RB 0X0B08
#define INT_EXT 0X0B10
#define INT_AD 0X8C40
#define INT_TBE 0X8C10#define INT_RDA 0X8C20
#define INT_TIMER1 0X8C01
#define INT_TIMER2 0X8C02
#define INT_CCP1 0X8C04
#define INT_SSP 0X8C08
#define INT_PSP 0X8C80
#define INT_BUSCOL 0X8D08
#define INT_EEPROM 0X8D10
#define INT_TIMER0 0X0B20
#list
// 3 phase sinewave generation
#include
#Byte TRISA= 0X85
#Byte TRISB= 0X86
#Byte TRISC= 0X87
#Byte TRISD= 0X88
#byte ADCON0=0X1f
#byte ADCON1=0X9f
#byte ADRESH=0X1e
#byte ADRESL=0X9e#bit ADCGO=0X1f.2
#bit ADON=0X1f.0
#BYTE PORTD=0X08
#BYTE PORTC=0X07
#BYTE PORTB=0X06
#BYTE PORTA=0X05
#fuses HS,NOWDT,NOPROTECT
-
7/27/2019 IMPLEMENTATION OF V/F CONTROL OF THREE PHASE INDUCTION MOTOR USING MICROCONTROLLER
58/60
lviii
#use delay(clock=6000000)
//#org 0x700,0x720int8 i,k,x;
int32 z;
BYTE const a[90]=
{128,132,137,141,146,150,154,159,163,167,171,176,
180,184,188,192,195,199,203,206,210,213,216,219,222,
225,228,231,233,236,238,240,242,244,246,247,249,250,
251,252,253,254,254,255,255,255,255,255,254,254,253,
252,251,250,249,247,246,244,242,240,238,236,233,231,
228,225,222,219,216,213,210,206,203,199,195,192,188,
184,180,176,171,167,163,159,154,150,146,141,137,132};
BYTE CONST b[90]
{238,236,233,231,228,225,222,219,216,213,210,206,203,
199,195,192,188,184,180,176,171,167,163,159,154,150,
146,141,137,132,128,124,119,115,110,106,
102,97,93,89,85,80,76,72,68,65,61,57,53,50,
46,43,40,37,34,31,28,25,23,20,18,16,14,12,10,
9,7,6,5,4,3,2,2,1,1,1,1,1,2,2,3,4,5,6,7,9,10,12,14,16};
BYTE CONST c[90]
{18,16,14,12,10,9,7,6,5,4,3,2,2,1,1,1,1,1,2,2,3,4,5,6,7,
9,10,12,14,16,18,20,23,25,28,31,34,37,40,43,46,50,53,57,
61,64,68,72,76,80,85,89,93,97,102,106,110,115,119,124,128,
132,137,141,146,150,154,159,163,167,171,176,180,184,188,192,
195,199,203,206,210,213,216,219,222,225,228,231,233,236}
void main()
{
do
{
TRISB=0x00;
TRISC=0x00;
TRISA=0x01;
ADCON0=0x81; //ADC MODE=fosc/32,i/p=A0ADCON1=0x8e;
ADCGO=0x01; //READ THE ADC INPUT
while(ADCGO);
z=make16(ADRESH,ADRESL); //PUT THE RESULT IN VARIABLE Z
z=z/4; //SCALE Z VALUE
i=0;
-
7/27/2019 IMPLEMENTATION OF V/F CONTROL OF THREE PHASE INDUCTION MOTOR USING MICROCONTROLLER
59/60
lix
do
{if (i
-
7/27/2019 IMPLEMENTATION OF V/F CONTROL OF THREE PHASE INDUCTION MOTOR USING MICROCONTROLLER
60/60
lx
Delay_us(Z);
Delay_us(Z/2);}
}while(++k