the dc capacitor Cs, the converter of the STATCOM system produces a set of controllable ...... create 12 volt or more in the gate of high side MOSFET with respect to source it uses a bootstrap ...... . 7.
COPYRIGHT The authors have agreed that the Library, Department of Electrical Engineering, Pulchowk Campus, Institute of Engineering may make this report freely available for inspection. Moreover, the authors have agreed that permission for extensive copying of this project report for scholarly purpose may be granted by the supervisors who supervised the project work recorded herein or, in their absence, by the Head of Department wherein the project report was done. It is understood that the recognition will be given to the authors of this report and to the Department of Electrical Engineering, Pulchowk Campus, and Institute of Engineering in any use of the material of this project report. Copying or publication or the other use of this report for financial gain without approval of the Department of Electrical Engineering, Pulchowk Campus, Institute of Engineering and authors’ written permission is prohibited. Request for permission to copy or to make any other use of the material in this report in whole or in part should be addressed to: The Head Department of Electrical Engineering Pulchowk Campus, Institute of Engineering Lalitpur, Nepal
i
ACKNOWLEDGEMENT At first, our humble honor goes to our supervisor Prof. Dr. Indraman Tamrakar for his perspective guidance which helped us greatly to strive in right direction with this project. We would like to express our gratitude to the department of electrical engineering for providing us the opportunity to do a final year project on the topic of interest. Our thankfulness also goes to Associate Prof. Kumudini Koirala, head of department of electrical engineering. At last, we’d like to express our deep appreciation to our lecturers and friends, for
endless support and help from the inception of this project till its end, whether directly or indirectly.
ii
ABSTRACT Reactive power compensation is an important issue in the control of electric power system. Reactive power from the source increases the transmission losses and reduces the power transmission capability of the transmission lines. Moreover, reactive power should not be transmitted through the transmission line to a longer distance. Hence, Flexible AC Transmission Systems (FACTS) devices such as static compensator (STATCOM), unified power flow controller (UPFC) and static volt–ampere compensator (SVC) are used to alleviate these problems. In this paper, single phase STATCOM using hysteresis band current control is presented as the final year project. The detail MATLAB simulation study has been done, with addition to that, a hardware design to realize the system has been proposed, simulated, fabricated and tested in the lab. The MATLAB simulation model uses capacitor as DC source and PI controller to maintain its voltage. But, in order to reduce the complexity because of technical and time constraint, the hardware is designed with DC battery source eliminating the PI controller. The output gives the positive results.
iii
TABLE OF CONTENTS TITLE
Page No.
Copyright
i
Acknowledgement
ii
Abstract
iii
Table of Contents
iv
List of figures
ix
List of Abbreviations
xiii
1. INTRODUCTION
1
1.1 Background
1
1.2 FACTs Devices and Types
2
1.2.1 Series Compensators
2
1.2.2 Shunt Compensators
2
1.3 Objective
4
1.4 Methodology
4
1.5 Proposed System Model
5
1.6 Project Scope
5
2. STATCOM
6
2.1 Introduction
6
2.2 Operating principle
6
2.3 Control Strategy
7
2.4 Hysteresis Band Current Control Method
9
2.5 STATCOM with Hysteresis Band Current Control
10
3. MATLAB SIMULATION STUDY
13
3.1 Proposed System
13
3.1.1 Iq Generator
15
3.1.1.1 Introduction
15
3.1.1.2 Operation
15
iv
3.1.2 Id Generator
15
3.1.2.1 Introduction
15
3.1.2.2 Operation
15
3.1.3 Iref Generator
16
3.1.3.1 Introduction
16
3.1.3.2 Operation
16
3.1.4 Iref(phase) Generator
17
3.1.4.1 Introduction
17
3.1.4.2 Operation
17
3.1.5 Hysteresis Band Generator and Comparator
18
3.1.5.1 Introduction
18
3.1.5.2 Operation
18
3.1.6 Voltage Source Inverter
19
3.1.6.1 Introduction
19
3.1.6.2 Operation
19
3.2 Simulation Results
20
3.2.1 Load Voltage and Current
20
3.2.2 Source Voltage and Current
20
3.2.3 Current through STATCOM Branch and Hysteresis Band
21
3.2.4 Active and Reactive power by Source, Load and STATCOM
21
3.2.5 Voltage across the Capacitor
22
3.3 Proposed System with Battery as DC Source
23
3.3.1 System Model
23
3.3.2 Simulation Results
25
4. SOFTWARE AND HARDWARE DESCRIPTION 4.1 Hardware Plan
27 27
4.1.1 Block Diagram
27
4.1.2 System Algorithm
28
4.2 Simulation Software: Proteus
28
v
4.3 Microcontroller Programming: MPLAB IDE
29
4.4 PCB Design: PCB Wizard
30
4.5 Hardware Components
31
4.5.1
Section I
31
4.5.1.1 Sensors
31
4.5.1.2 Transistors
31
4.5.1.3 Microcontrollers
32
4.5.1.4 LCD
32
4.5.1.5 Operational Amplifier
33
4.5.1.6 DAC
33
4.5.1.7 USART Communication
34
4.5.2 Section II
34
4.5.2.1 Schmitt Trigger
35
4.5.2.2 MOSFET
35
4.5.2.3 Gate Driver IC
36
5. SOFTWARE AND HARDWARE SIMULATION STUDY 5.1 Circuits and Blocks
37 37
5.1.1 Current Sensor
37
5.1.2 Zero Cross Detector
37
5.1.2.1 Introduction
37
5.1.2.2 Operation
38
5.1.3 Peak Detector
38
5.1.3.1 Introduction
38
5.1.3.2 Operation
39
5.1.4 Microcontrollers
39
5.1.4.1 Microcontroller-1 (PIC16F877A)
39
5.1.4.2 Microcontroller-2 (PIC18F4550)
41
5.1.5 UART Communication
42
5.1.6 DAC
44
vi
5.1.6.1 Introduction
44
5.1.6.2 Operation
44
5.1.7 Interfacing DAC with microcontroller
45
5.1.8 Hysteresis Band and Gate Signal Generator
45
5.1.9 H-Bridge Inverter
46
5.2 Simulation Results
47
5.2.1 Zero Cross Detector
47
5.2.2 Peak Detector
47
5.2.3 DAC
48
5.2.4 Voltage Zero Cross and the Reference Current
48
5.2.5 Schmitt Trigger
49
5.2.6 H-Bridge Inverter
49
6. HARDWARE FABRICATION AND TESTING 6.1 Circuits
51 51
6.1.1 Whole System Circuit
52
6.1.2 Section I: Current Sensing and Reference Current Generator
52
6.1.3 Section II: Hysteresis Band Generator and H-Bridge Inverter
54
6.1.4 Section II: The Source and the Load
56
6.2 Hardware Results
56
6.2.1 Current Sensor
56
6.2.2 Zero Cross Detector Output
57
6.2.3 Peak Detector Output
57
6.2.4 LCD Display
58
6.2.5 Output from DAC
59
6.2.6 Source Voltage and Reference Current
60
6.2.7 Hysteresis Band Controller Output
60
6.2.8 Inverter Output
61
6.2.9 Current through STATCOM Branch
61
7. CONCLUSION AND RECOMMENDATIONS
64
vii
APPENDIX-I
66
APPENDIX-II
78
APPENDIX-III
81
REFERENCE
82
viii
List of Figures Fig 1.1 Power Triangle Fig 1.2 Thyristor Controlled Reactor Fig 1.3 Thyristor Switched Capacitor Fig 1.4 Advanced Shunt Static VAR Compensator (STATCOM) Fig 1.5 Proposed System Model
Fig 2.1 STATCOM with VSI and CSI Converter Fig 2.2 Synchronous Condenser Fig 2.3 STATCOM Fig 2.4 STATCOM with Hysteresis Band Current Control PWM Inverter Fig 2.5 Inverter Fig 2.6 Comparator Output Signal with Single and Double Threshold Value Fig 2.7 Hysteresis Band Current Control Fig 2.8 Characteristics Curve of Comparator with Double Threshold Value Fig 2.9 Switching Instants and Waveforms of Hysteresis Band Current Control PWM Inverter
Fig 3.1 Whole System Model Fig 3.2 Iq Generator Fig 3.3 Id Generator Fig 3.4 Iref Generator Fig 3.5 Iref(phase) Generator Fig 3.6 Hysteresis Band Generator and Comparator Fig 3.7 Voltage Source Inverter Fig 3.8 Load Voltage and Current Fig 3.9 Source Voltage and Current
ix
Fig 3.10 Source Voltage and Current (magnified) Fig 3.11 Current through STATCOM Branch and Hysteresis Band Fig 3.12 Current through STATCOM Branch and Hysteresis Band (magnified) Fig 3.13 Active and Reactive Power through Source, STATCOM and Load Fig 3.14 Voltage across the Capacitor Fig 3.15 Proposed System with Battery as DC Source Fig 3.16 Source Voltage and Current (upper) and Current in STATCOM Branch with Hysteresis Band (Lower) Fig 3.17 Source Voltage and Current (upper) and Current in STATCOM Branch with Hysteresis Band (Lower) (magnified) Fig 3.18 Current in STATCOM Branch with Hysteresis Band (magnified)
Fig 4.1 Whole System in Hardware Realization Fig 4.2 Transistor (BC547) Fig 4.3 Microcontrollers (PIC16F877A and PIC18F4550) Fig 4.4 LCD (LM016L) Fig 4.5 Op-Amp (LM741 and LM348) Fig 4.6 DAC (DAC0808) Fig 4.7 MOSFET Fig 4.8 Gate Driver IC (IR2110)
Fig 5.1 Zero Cross Detector Fig 5.2 Peak Detector Fig 5.3 Microcontroller-1 (PIC16F877A) Fig 5.4 Flowchart for μC-1 Fig 5.5 Flowchart for μC-2
x
Fig 5.6 UART Communication Fig 5.7 Connection Diagram for UART Communication Fig 5.8 DAC with Op-Amp Fig 5.9 Interfacing DAC with Microcontroller Fig 5.10 Hysteresis Band and Gate Signal Generator Fig 5.11 H-Bridge Inverter Fig 5.12 Zero Cross Detector Output Fig 5.13 Peak Detector Circuit Output Fig 5.14 DAC Output Fig 5.15 Voltage Zero Cross and Reference Current Fig 5.16 Schmitt Trigger Output Fig 5.17 Inverter Output with Schmitt Trigger
Fig 6.1 Whole System Circuit Fig 6.2 Section I: Current Sensing and Referece Current Generator Fig 6.3 Hall Effect CT Fig 6.4 H-Bridge Inverter Fig 6.5 Schmitt Trigger Fig 6.6 Section III: The Source and the Load Fig 6.7 Current Sensor Output Fig 6.8 Zero Cross Detector Output Fig 6.9 Peak Detector Output Fig 6.10 LCD Display of Load Current, Power Factor Angle and Reference Current Fig 6.11 LCD Display (magnified) Fig 6.12 DAC Output Fig 6.13 Source Voltage and Reference Current
xi
Fig 6.14 Schmitt Trigger Output Fig 6.15 Inverter Output with no Load Fig 6.16 Actual Current through STATCOM Branch and the Reference Current with very Small Hysteresis Band Width Fig 6.17 Actual Current from STATCOM with Higher Band Width Fig 6.18 Actual Current from STATCOM and Gate Signal with Maximum Band Width Fig 6.19 Reference Current and Actual Current in Medium Band Width Switching
xii
List of Abbreviations DC
:
Direct Current
AC
:
Alternating Current
STATCOM
:
STATic COMpensator
FACTS
:
Flexible AC Transmission System
PT
:
Potential Transformer
CT
:
Current Transformer
MATLAB
:
MATrix LABratory
VSI
:
Voltage Source Inverter
CSI
:
Current Source Inverter
IGBT
:
Insulated Gate Bipolar Transistor
HB
:
Hysteresis Band
GUI
:
Graphical User Interface
DAC
:
Digital to Analog Converter
ADC
:
Analog to Digital Converter
LED
:
Light Emitting Diode
LCD
:
Liquid Crystal Display
PCB
:
Printed Circuit Board
IDE
:
Integrated Development Environment
Op-Amp
:
Operational Amplifier
IC
:
Integrated Circuit
USART
:
Universal Synchronous Asynchronous Receiver Transmitter
UART
:
Universal Asynchronous Receiver Transmitter
SCI
:
Serial Communication Interface
RX
:
Receiver
TX
:
Transmitter
xiii
MOSFET
:
Metal Oxide Semiconductor Field Effect Transistor
ZCD
:
Zero Cross Detector
μC
:
Microcontroller
IO
:
Input/Output
xiv
CHAPTER 1
INTRODUCTION 1.1 Background Electric power is the rate at which electric energy is transferred by an electric circuit. In case of AC, this power is of two types as: active power (real power) and reactive power (imaginary power). i.e. Apparent power = √(active power)2 + (reactive power)2
Here,
S
Q
(1.1)
S= Apparent Power P= Active Power
Φ
Q= Reactive Power
P Fig 1.1 Power Triangle
ϕ= Power Factor Angle
Active power is used to perform the real work and reactive power is responsible to create electric field in the capacitor and magnetic field in a coil. The transmission line is inductive and capacitive in nature; hence, to transfer active power, some reactive power needs to be supplied by the generator. In addition to transmission line, the reactive load also requires the reactive power. Every unit that comes in a transmission system like conductors, transformers, etc. has a maximum apparent power carrying capacity. Thus, if reactive power flow requirement is lowered as much as possible, then flow of large amount of active power through the same transmission line can be achieved. To measure this effectiveness, a term power factor is used, which is defined as Power factor (pf) =
Real power Apparent power
= cos ϕ
(1.2)
Higher the value of power factor, the system delivers higher amount of active power. Major loads are inductive, which needs to develop magnetic field. For example, motors. Thus, inductors are called sink and capacitors are called source of reactive power. If the reactive power needed by the inductive load is supplied using a capacitor bank placed just nearby, the cost of using high capacity units for the flow of power from the source (generator) can be reduced. This is called reactive power compensation. But the use of capacitor is not that flexible. Thus, this project aims to build up such a compensator, not by using a capacitor bank
1
but using power electronics devices. The device is called STATCOM (Static Compensator). It is a shunt compensator.
1.2 FACTS Devices and Types Flexible AC Transmission System (FACTS) is a new emerging technology and its principal role is to enhance controllability and power transfer capability in ac systems. The philosophy of FACTS is to use power electronics for controlling power flow in a transmission network, thereby allowing the transmission line to be loaded to its full capability. All the systems under FACTS are mainly classified into two groups as: series compensators and shunt compensators.
1.2.1
Series Compensators
A series compensator, in principle injects a voltage, in series with the line. Even variable impedance multiplied by the current flown though it represents an applied series voltage in the line. As long as the voltage is in phase quadrature (900 lead or lag) with the line current, the series compensator supplies or consumes variable reactive power only. Therefore, a series compensator could be a variable impedance (such as capacitor or a reactor), which could be an electronic-based device.
1.2.2
Shunt Compensators
In the shunt compensation, a current is injected into the system at the point of connection. This can be implemented by varying shunt impedance, a voltage source or a current source. As long as the injected current is in phase quadrature with line voltage, the shunt compensator only supplies or consumes variable reactive power. There are different types of shunt compensators which are described as follows:
i. Thyristor Controlled Reactor It consists of a fixed reactor of inductance L and a bidirectional Thyristor switch as shown in fig. 1.2
L
Fig 1.2 Thyristor Controlled Reactor
2
YL(𝞪) =
1
𝜔𝐿
2
1
𝜋
𝜋
(1 − 𝛼 − 𝑠𝑖𝑛2𝛼)
(2.1)
The compensator can vary the impedance (varying the admittance) by changing firing angle 𝞪 as shown in above equation and hence compensating the current.
ii. Thyristor Switched Capacitor It consists of a fixed capacitor, a bidirectional Thyristor switch and a relatively small surge limiting reactor L. This compensator’s compensating current can be varied by changing the firing angle.
L
C
Fig 1.3 Thyristor Switched Capacitor
iii. Static VAR Compensator It consists of both capacitor and reactor bank which are controlled using a bidirectional switch. A controller is used which senses the voltage using PT and compares with the reference signal. Thus, obtained error is processed to get required value of firing angle for the control of compensating current.
iv. STATCOM STATCOM is similar to that of ideal synchronous condenser which can generate or absorbs reactive power by varying the excitation in the field winding. It is essentially a voltage source converter as shown in fig.1.4. This device also makes the exchange of both active and reactive power with the system possible.
3
Vr
Vs Coupling Transformer
PT
Voltage Source Converter
Controller
+ Vc Fig 1.4 Advanced Shunt Static VAR Compensator (STATCOM)
1.3 Objective To simulate and fabricate single phase STATCOM using hysteresis band current control.
1.4 Methodology The whole project work consists of simulation, software and hardware work. The works to be performed are listed in a chronological order as follows: Step 1: Literature review of the STATCOM and development of strategy to meet the objective, Step 2: Simulation development of proposed system in MATLAB, Step 3: Simulation of proposed hardware model in PROTEUS with microcontroller programming using MPLAB, Step 4: Hardware fabrication, Step 5: Testing and debugging. Step 6: Final documentation of the project.
4
1.5 Proposed System Model P
P
CT
Q
Load PT
Q CT
Gate Signal INVERTER Hysteresis Band Generator
Fig 1.5 Proposed System Model
Reactive current component
Reference current Active current component
Controller
1.6 Project Scope The project deals with the study and hardware fabrication of STATCOM with hysteresis band current control. The project has a wide range of application. The STATCOM can be used to improve:
Voltage Regulation and Stability
Power Factor
Power Transmission Capability of Transmission and Distribution Lines
Reduce Line Losses
The project can be implemented in:
Industries
Renewable Generation (for Reactive Power Generation)
With the devices at lower power factor
5
CHAPTER 2
STATCOM 2.1 Introduction STATCOM is a switching converter type static Var generator, which generates or absorbs reactive power without using capacitor and inductor bank, by various switching pattern within its converter. It is a shunt FACTS device. It injects the current respective to the compensation needed. It consists of inverter, coupling transformer and controller for generating the required switching signals. The inverter can be a VSI (voltage source inverter) or CSI (current source inverter). This project uses the VSI. The operation of STATCOM can be controlled in one of two ways: By controlling the current injected by the STATCOM or by controlling the terminal voltage of the STATCOM. Using any of the method the amount of reactive power generated or absorbed can be controlled.
VSI
CSI
Fig 2.1 STATCOM with VSI and CSI Converter
2.2 Operating Principle Functionally, the operation of STATCOM is similar to that of an ideal synchronous condenser which can generates or absorbs the reactive power by varying the excitation in the field winding. In case of STATCOM the change in gate signal is analogous to the change in excitation of condenser because it causes the change in terminal voltage of STATCOM as in the case of condenser terminal voltage. The reactive power in any line always flows from higher voltage magnitude to lower voltage magnitude. The operation of STATCOM thus can be explained by considering the following figure:
6
Vs Vs
Load Coupling Tr X0 =Reactance
Load Coupling Tr I0
I0
Pf
of Tr
X0 = Total reactance of Tr + machine E
Sensor
V0 0
(Pf)Ref
DC –AC If
Converter
Controller
Cs
Exciter
(Gate signal Gen)
+ Vdc Fig 2.2 Synchronous Condenser
Fig 2.3 STATCOM
Fig. 2.2 shows a basic configuration of a synchronous condenser. If the dc excitation current If is increased, magnitude of E will increase and if |E| becomes greater than the |V s|, then the synchronous machine will draw the leading current and supplies reactive power to the system. On the other hand, if the dc excitation current If is decreased, magnitude of E will decrease and if |E| becomes less than the |Vs|, then the synchronous machine will draw the lagging current and consumes reactive power from the system. In the similar manner, the STATCOM system shown in Fig. 2.3, can generate or consume reactive power. From the dc voltage source across the dc capacitor Cs, the converter of the STATCOM system produces a set of controllable single-phase output voltage (V0) with frequency equal to frequency of ac system voltage. By varying the magnitude of the inverter output voltage (V0), the reactive power exchange between the inverter and the ac system is achieved in a similar manner to that of the synchronous condenser. i)
If |V0| > | VS| , then the inverter generates the reactive power
ii)
If |V0| < | VS| , then the inverter consumes the reactive power
iii)
If |V0| = | VS| , then there is no exchange of reactive power
2.3 Control Strategy The reactive power generated by the STATCOM can be varied by in many ways, all the method ultimately changes the inverter output voltage (V0). The control action can be done by taking the terminal voltage or the current as a reference. In this project, current in the STATCOM branch is taken as reference to be controlled. For this a powerful and simple method, known as Hysteresis Band Current Control is applied. To explain in short, referring to the fig. 2.4,
7
whenever reactive power drawn by the load changes, the voltage across the terminal of the load and the power angle also changes. Thus, this change in voltage and reactive power and dc voltage across the capacitor (used as dc source for the inverter) can be compared with the reference values to generate the reference current that is to flow in STATCOM branch, by the controller at each instant of time. The reference current is the reactive component of the load current and the active component required by the STATCOM. The microcontroller generates the control signals to control the switching pattern of power IGBTs inside the inverter so that actual current from the STATCOM i0 tracks the reference current Iref generate by the controller. The actual current from the STATCOM is maintained within a limited hysteresis band. IL
I VS I0 PWM inverter
Z0 0
Q1 Q3
+ Vdc
-
0 -
Load
V0
Voltage Sensor
Q2
Q4
r2 PI-2
Gate signal generator
r1
-
PI-
Vdc(Ref) 1 + Fig 2.4 STATCOM with Hysteresis Band Current Control PWM
+ VRef
Fig 2.5 Inverter When switch Q1 & Q4 are ON and Q2 &Q3 are OFF, the inverter output current rises. When the current reaches the upper limit of the reference current, the microcontroller turns OFF Q1 & Q4 and turns ON Q2 & Q3. On doing so, the output current i0 of STATCOM decays. When the current i0 crosses the lower limit of the reference current, microcontroller turns ON Q1 &Q4 and turns OFF Q2 &Q3 and so on. Thus, the output current i0 of the STATCOM tracks the
8
reference current evaluated by the microcontroller to satisfy the reactive power generation and consumption by the load.
2.4 Hysteresis Band Current Control Method Hysteresis Band Current Control Method is an instantaneous feedback current control method. As the name implies, this method focuses on the control of the current. In this method, a band is created around the reference current. Reference current is the actual required current that should flow. The band is the tolerance within which the actual current magnitude can fluctuate. If the actual current crosses the band, it is made to return back within the band instantaneously using different controlling signals, which in this case is the gate signal of the inverter. A comparator is used to compare the value of actual signal and the reference signal to give gate signal as output. Normally, to control the value of some signal, one of the approach is: to use a single threshold value i.e. with no band around the reference signal. In that case, as the actual signal crosses the reference signal, the output gate signal varies as shown in the diagram as A. Another approach is to create a upper and lower threshold around the reference signal, thus obtained output gate signal is as shown in the diagram as B. The signal B has less oscillation then compare to A.
Fig 2.6 Comparator Output Signal with Single and Double Threshold The characteristic curve of such a comparator is as shown in fig 2.8. The curve is similar to the hysteresis curve, thus it is termed as hysteresis control method. And the band around the reference signal is known as hysteresis band. Thus, if we have a changing reference signal then it gives a changing threshold value with a set hysteresis band width and the aim of the control action is to drag the actual signal within the band by changing the gate signal as shown in the figure 2.7. The fig shown below takes the input signals as voltage values which is the normal
9
way of interpreting any signal, but which may represent a voltage or current as per the application.
Fig 2.8 Characteristic Curve of Comparator with Double Threshold Value
Fig 2.7 Hysteresis Band Current Control
2.5 STATCOM with Hysteresis Band Current Control Method Hysteresis band current control technique is basically an instantaneous feedback current control method of PWM, where the actual current through the STATCOM branch continuously tracks the reference current within a limited hysteresis band. The controller generates the reference current by sensing the ac terminal voltage and dc voltage across the capacitor in the dc side of the inverter. When, the reactive power of the load increases, the reactive component of the load current increases. This increase in reactive current is sensed to obtain the magnitude of the q-axis component (Iq) of the reference current Iref. The dc voltage across the capacitor is sensed and compared with the reference value. The error signal thus obtained is passed through a PI controller to obtain the magnitude of the d-axis component (Id) of the reference current Iref. The hysteresis band current controller compares the actual currents through the STATCOM branch with the reference currents and generates the gate signals to turn on and off the switch pairs T1T2, T3-T4 and T5-T6 several times in a cycle so that the actual inverter current I0 (actual) tracks the reference current Iref within a limited hysteresis band. Fig. 2.9 shows the switching instants and waveform of the current through the inverter branch along with the reference current for a phase.
10
ia(Ref) =Im Sin (t-900 0) Im
Im Sin (t-900 -0) + HB Im Sin (t-900 -0) HB Actual Current (i0 )
+HB
0
-HB
V0 = +0.5 Vdc 0 1 2 3 V0 = -0.5 Vdc Fig 2.9 Switching Instants and Waveforms of Hysteresis Band Current Control PWM Inverter The reference lagging current required by load is generated by the controller, described by: Iref =Im Sin (t-900-0)
(2.1)
Where, Im I 2 Iq2 d
(2.2)
(-900 -0) = Angle of lag of Iref with respect to VS The upper and lower limit currents are given by: Iref (upper) =Im Sin (t-900 -0) + HB
(2.3)
Iref (lower) =Im Sin (t-900 -0) – HB
(2.4)
When the switch T1 and T4 of the bridge inverter is turned on keeping T2 and T3 off, the inverter output voltage is Vc and the inverter current (i0) rises up satisfying the following equation.
di
0 Vc v R .i L s 0 0 0 dt
(2.5)
When the actual current exceeds a prescribed upper hysteresis band, the upper switch T 1 and T4 are turned off and T2 and T3 are turned on. As a result, the output voltage transits from +Vc to – Vc, and the current starts to decay satisfying the following equation.
di
0 Vc v R .i L s 0 0 0 dt
11
(2.6)
When the current crosses the lower band limit, the lower switch T 2 and T3 are turned off and the upper switch T1 and T4 are turned on. The actual current wave is thus forced to track the sine reference wave within the hysteresis band by sequential switching of the upper and lower switches as shown in Fig. 2.9. The inverter then essentially becomes a current source with peakto peak current ripple, which is controlled within the hysteresis band irrespective of Vc fluctuation.
12
CHAPTER 3
MATLAB SIMULATION STUDY MATLAB is a technical computing environment for high performance numeric computation and visualization. It is a technical computing language developed by Mathworks Inc. MATLAB integrates numerical analysis, matrix computation, signal processing, and graphics into an easyto-use environment. The name MATLAB stands for Matrix Laboratory. Simulink is a software package inside the MATLAB. Simulink and MATLAB form a package that serves as a vehicle for modeling dynamic systems. Simulink provides graphical user interface (GUI) that is used in building block diagrams, performing simulations, as well as analyzing results. Simulink includes a comprehensive block library of sinks, sources, linear and nonlinear components and connectors. Simulink provides the facility of customizing and creating our own blocks. Using scopes and other display blocks the simulation result can be observed and analyzed. In addition, the parameters of the model developed can be changed and can be observed immediately for ‘what if’ exploration.
3.1 Proposed System STATCOM is a shunt type reactive power compensator. Its operation, principle and control strategy has been discussed in chapter 2. The fig 3.1 shows the whole simulation model of the STATCOM. The model has different blocks with their function and operation discussed in the flowing section. The STATCOM senses the voltage and current across the load. The load voltage and current are utilized to find the reactive component of the current drawn by the load. PI controller is used to find the active component of the current drawn by the STATCOM to compensate the active power losses in the STATCOM. The active current drawn by the STATCOM and the reactive component of the load current are utilized by the reference current generator to evaluate the magnitude and phase of reference current required to flow thorough the STATCOM branch. The hysteresis band generator and comparator control the switching of the H-bridge inverter so that the actual current through the STATCOM branch tracks the reference current generated by the reference current generator.
13
14 Fig 3.1 Whole System Model
The brief introduction and operation of various blocks in the MATLAB simulation model:
3.1.1
Iq Generator
3.1.1.1 Introduction This block is responsible to calculate the amount of reactive component of load current which is utilized by the Iref generator block to generate Iref. The sub-system diagram is as shown in figure 3.2. 3.1.1.2 Operation This block senses the load current and load voltage. Using these parameter it calculates the reactive power and rms value of load voltage. This gives the reactive component of load current using the equation as follows: Iq= I SinФ =
𝑄 𝑉
(3.1)
Fig 3.2 Iq Generator
3.1.2
Id Generator
3.1.2.1 Introduction This block is responsible to calculate the amount of active component of current drawn by the STATCOM which is utilized by the Iref generator block to generate Iref. The sub-system diagram is as shown in figure 3.3.
3.1.2.2 Operation The voltage across the capacitor Vdc is sensed and compared with the reference voltage (Here 440V dc) to generate the error signal. This error signal is fed to PI controller. The PI controller generates active component of current drawn by the STATCOM. This output current is fed to the reference current generator.
15
Fig 3.3 Id Generator
3.1.3
Iref Generator
3.1.3.1 Introduction This block generates wave of the reference current that has to be supplied by the STATCOM. Hence, a control system has to be designed to make the output current from the STATCOM track this reference current with proper switching. The fig 3.4 shows the Iref generator.
3.1.3.2 Operation The Iref generator has rms value of Iq from the Iq generator and rms value of Id from Id generator as input. These values are utilized to generate the reference current that has to be supplied by STATCOM. The generator first generates the rms value of the reference current by the following equation. Iref (rms) = √Iq(rms)2 + Id(rms)2
(3.2)
This rms value is multiplied by √2 to get the peak value of reference current. Im = Iref (rms) X √2
(3.3)
The Iref(phase) block generates sine wave with the required phase angle for the Iref. The working of the Iref (phase) is explained in the following section 3.1.4. Let the phase angle between the reference current that STATCOM has to supply and the current drawn from the source be θ. Thus, the reference current is: Iref = Im Sin (ωt-900-θ)
(3.4)
This is the current that STATCOM has to supply to the load.
16
Fig 3.4 Iref Generator
3.1.4
Iref (Phase) Generator
3.1.4.1 Introduction This block generates the sine wave with the required phase angle of Iref and unit magnitude. The block has Iq (rms) and Id (rms) as inputs. The output of the Iref(phase) generator is multiplied with the output of the Iref generator to get the actual sine wave of the reference current. The fig 3.5 shows the Iref(phase) generator.
3.1.4.2 Operation The ratio of Id and Iq is first evaluated. The arc tan of this ratio gives the phase angle θ. Id
θ= tan-1( )
(3.5)
Iq
The output of the Iref(phase) generator is: 1.sin (ωt-900-θ) To evaluate above expression following equation is used: Sin (ωt-900-θ) = Sin (ωt-900).Cosθ + Cos (ωt-900). Sinθ = Sin (ωt-900).Cosθ + Sinωt.Sinθ It can be clearly seen that the above expression is identical to the fig 3.4.
17
(3.6)
Fig 3.5 Iref (phase) Generator
3.1.5
Hysteresis Band Generator and Comparator
3.1.5.1 Introduction This block generates the gate signals for the inverter controlling the switching pattern of the IGBTs so as to generate the required current. The block has actual output current from the inverter (I0) and reference current generated (Iref) as input. The hysteresis band of the current is created. The block checks if actual current from inverter is within the limit of the band. If not, then switching is changed so as to bring it back to the band. The block is shown in fig 3.6.
3.1.5.2 Operation The difference of the reference current (Iref) and actual current (I0) is fed to the relay. The relay is configured with the switch on point as 0.5 and switch off point as -0.5. Hence, the relay creates a hysteresis band and checks if the actual current is within the band. Thus, the relay generates gate signals in following pattern: When Iref – I0 ≤ -0.5, output of relay=1 When Iref - Io ≥ 0.5, output of relay =0
Fig 3.6 Hysteresis Band Generator and Comparator
18
3.1.6
Voltage Source Inverter
3.1.6.1 Introduction The inverter converts the dc voltage of capacitor into ac voltage. It has a dc capacitor as source. The inverter receives the gate signals from the hysteresis band generator and comparator. It has 2 pairs of IGBTs. It generates the reactive power for the load. However, due to internal losses, it too consumes the active power. Due to its active power consumption, the Id current calculation in Id generator has been introduced. The more the switching frequency the more is the active power consumed by it. This active power is the loss in the STATCOM. The fig 3.7 shows the voltage source inverter.
3.1.6.2 Operation There are two pairs of IGBTs: The IGBT_1 and IGBT_3 form one pair and remaining form the other pair as shown in fig 3.7. When the first pair is ON, the voltage at output is positive and hence the current from the inverter rises. And reversely, when the second pair is ON, the voltage at the output of inverter is negative. Thus, the current drops. When the current of the inverter rises, the capacitor discharges and when it falls, the capacitor charges. As it is observed, when one pair is on and the other pair has to be off. Thus, the signal to one pair is inverted for the other pair using NOT gate. For gate signal = 1: IGBT_1&_3 Turns ON and IGBT_2&_4 Turns OFF, V0 = +Vc. and for gate signal = 0: IGBT_1&_3 Turns OFF and IGBT_2&_4 Turns ON, V0 = -Vc.
Fig 3.7 Voltage Source Inverter
19
3.2 Simulation Results 3.2.1
Load Voltage and Current
Fig 3.8 Load Voltage and Current
Fig 3.8 shows the load voltage and current. It can be seen that the voltage is leading the current. Thus, the load is inductive load. It consumes both the reactive and active power.
3.2.2 Source Voltage and Current
Fig 3.9 Source Voltage and Current
Fig 3.10 Source Voltage and Current (magnified)
Fig 3.9 and fig 3.10 show the source voltage and source current with the STATCOM connected to the system. It can be clearly seen that the source voltage and source current are in phase with each other. Whenever the load changes, the magnitude of current supplied by the source
20
changes but it is always in phase with the source voltage. The reactive component the current required for the load is supplied by the STATCOM branch.
3.2.3
Current through STATCOM Branch and Hysteresis Band
Fig 3.11 Current through STATCOM Branch and Hysteresis Band
Fig 3.12 Current through STATCOM Branch and Hysteresis Band (magnified) Fig 3.11 and 3.12 show the current through the STATCOM branch. It can be clearly seen that the actual current through the STATCOM branch is within the hysteresis band and tracking the reference current. Whenever the load changes, the magnitude of the current through the STATCOM branch too changes so as to meet the new reactive component of the load current.
3.2.4
Active and Reactive Power by source, load and STATCOM
Fig 3.13 shows the active and reactive power flow through source (top), STATCOM (middle) and load (bottom). It can be clearly seen that the load is consuming both the active and reactive power. The source is supplying only the active power. The STATCOM is supplying only reactive power. However, it is consuming very small amount of reactive power to compensate the losses in the STATCOM branch. Whenever, the power (both active and reactive) required for load increases, the source supplies additional active power while STATCOM supplies additional reactive power. Thus, for the source, the combination of the actual load and the STATCOM is an active load.
21
Fig 3.13 Active and Reactive Power through Source, STATCOM and Load
3.2.5
Voltage across the Capacitor
Fig 3.14 Voltage across the Capacitor Fig 3.14 shows the voltage across the capacitor. The STATCOM acts as the source of reactive power. The active power losses in the STATCOM branch is provided by the source itself. Since, capacitor provides the reactive power only, the voltage across it should be constant. The fall in capacitor voltage means that the STATCOM is providing the active power to compensate the losses. The rise in capacitor voltage means STATCOM is consuming more active power. Rise and fall in capacitor voltage has been utilized to evaluate the active component of the current that must flow through the STATCOM branch. Also, to deliver reactive power, the capacitor voltage should be higher than the system voltage. It can be seen that the capacitor voltage is higher than the system voltage. If capacitor voltage is less than the system voltage, then STATCOM instead of delivering the reactive power, consumes the reactive power. Thus, the source needs to provide more reactive power which is undesired.
22
3.3 Proposed System with Battery as DC Source 3.3.1 System Model The whole system MATLAB simulation model using battery instead of capacitor as DC source is as shown in fig. 3.15. In this model, the capacitor has been replaced with a 24V battery. The source voltage is 15 V rms AC. Since the battery can provide the active power loss in the STATCOM by its stored power, there is no need of drawing the active current from the source by the STATCOM for the losses. Hence, the PI controller has been removed in this model. Thus, only Iq component of current is to be evaluated as in the previous model. All the other sub-system in this model are same as that of previously discussed model. The RL load used has 12 ohm resistance and 25 mH inductance. This simulation model was developed in order to find out the value of Zo (impedance of the coupling transformer) for battery as DC source. This is the first step hardware prototype the project aims to develop. After its completion the project aim to develop the prototype with the capacitor as DC source. The model is simulated and the result obtained is as shown the following section.
23
24 Fig 3.15 Proposed System with Battery as DC Source
3.3.2 Simulation Results
Fig 3.16 Source Voltage and Current (upper) and Current in STATCOM Branch with Hysteresis Band (Lower)
Fig 3.17 Source Voltage and Current (upper) and Current in STATCOM Branch with Hysteresis Band (Lower) (magnified)
Fig 3.18 Current in STATCOM Branch with Hysteresis Band (magnified)
25
From the above simulation results it can be seen that the STATCOM with battery as dc source behaves similar to that of the STATCOM with capacitor as dc source. This model simplifies the by omitting the need of PI controller to evaluate the active losses in the STATCOM branch. The dc battery itself provides the losses in the STATCOM without fall in voltage across it. This model has been implemented in hardware.
26
CHAPTER 4
SOFTWARE AND HARDWARE DESCRIPTION 4.1 Hardware Plan 4.1.1 Block Diagram In order to realize the system from hardware point of view the following block diagram has been developed.
Fig 4.1 Whole System in Hardware Realization
CT-1 is used to sense the load current. The peak of the load current (Im) is detected using a peak detector circuit. At the same time, the zero cross detector circuit senses the zero cross of the load current. PT is used to sense the voltage across the load. The sensed voltage is passed through the zero cross detector circuit to sense the zero cross of the load voltage. Hence, three inputs are provided to μC-1 (Microcontroller-1): Peak current, zero cross of the voltage and zero cross of the current. The zero cross of the voltage and current are taken as the interrupt to the μC-1. These inputs are utilized to calculate the phase angle (ϕ) between the voltage and the current using the timer-module of μC-1. The peak of the load current is converted into digital form using ADC module of the μC-1. The μC-1 hence calculates the peak reactive component of the current as Iq=ImSin ϕ. Battery has been used as a dc source in the inverter. Thus, the dc voltage is maintained constant and
27
loss in switching is compensated by the battery itself (The source does not provide any active power to compensate the losses in the inverter). So, the active current drawn by the inverter Id=0. It can be clearly seen that the current to be supplied by the inverter must be lagging 900 and should have the magnitude of Iq. The μC-1 calculates these values and sends these data to the μC-2 using RS-232 communication. The μC-2 generates the reference current (sinusoidal) using the data obtained from the μC-1 and an 8-bit DAC. The generated reference current is send to the hysteresis band controller. The controller compares the actual current flowing from the inverter with the reference current to generate the switching gate signals for the inverter.
4.1.2 System Algorithm In hardware, the working algorithm of the whole project has been develop as follows: a. Current sensing and measurement, b. Power factor angle measurement, c. Calculate reference current magnitude in microcontroller-1 (μC1); Iq = IL * sin (ϕ)
(4.1)
d. Calculate phase angle for reference current in μC1; θ = atan (Iq/Id) = atan (Iq/0) = 90˚
(4.2)
e. Transmitting these values (reference current magnitude and phase angle) obtained in μC1 to μC2 for reference current generation, f.
μC2 senses the zero crossing of voltage & generates the reference 900 leading current waveform using DAC.
g. Schmitt trigger for hysteresis band generation & switching signal for inverter by comparing the reference current (Iref) with actual current (Io) h. H-bridge inverter using MOSFET
4.2 Simulation Software: Proteus Proteus is a software for microprocessor/microcontroller simulation, schematic capture and printed circuit board (PCB) design. The software is developed by Labcenter. The software offers the ability to co-simulate both high and low-level microcontroller code in context of a mixed mode SPICE circuit simulation. It combines mixed mode SPICE circuit simulation, animated components and microprocessor models to facilitate co-simulation of complete microcontroller based design. It is possible to develop and test such design before the physical prototype is constructed. The designer can interact with the design using screen indicators such
28
as LED and LCD displays and actuators such as switches and buttons. The simulation takes place in real time. Proteus also provides extensive facilities for debugging. Proteus VSM uses ISIS schematic capture software to provide the environment for design and development. The software combines ease of use with powerful editing tools. ISIS provides a very high degrees of control over the drawing appearance, in terms of widths, fill styles, fonts, etc. These capabilities are used to provide the graphics necessary for circuit animation. Proteus includes a number of virtual instruments like Oscilloscope, Logic Analyzer, Function Generator, Pattern Generator, Counter Timer and Virtual Terminal as well as simple voltmeters and ammeters. The software allows the designer to take detailed measurements on graphs, perform analysis type such as frequency, distortion, noise or sweep analysis of analogue circuits. The most important feature of Proteus is its ability to simulate the interaction between software running on a micro-controller and any analog or digital electronics connected to it. The microcontroller model sits on the schematic along with the other elements of product design. It simulates the execution of designer object code, just like in a real chip. In addition to the microprocessor models for each supported family, and literally there are thousands of ‘standard’ models for passives, TTL/CMOS, memories, etc. Proteus is equipped with a comprehensive library of embedded peripheral models.
4.3 Microcontroller Programming: MPLAB IDE MPLAB IDE is a software program that runs on a PC to develop Micro-Chip Microcontroller Programs. It is called Integrated Development Environment because it provides a single integrated ‘environment’ to develop code for embedded microcontrollers. MPLAB IDE helps to write, edit, debug and program code- the intelligence of embedded system applications – into a microcontroller. MPLAB IDE contains all the components needed to design and deploy embedded system application. MPLAB IDE helps to:
Write and edit the program code for microcontrollers in high level programming language as well as in assembly language.
Compile, assemble and link the software using the assembler and/or compiler and linker to convert the codes into “ones and zeroes” –machine code for the PIC micro MCU’s. This machine code will eventually become the firmware (the code programmed into the microcontroller).
Test the code. Usually a complex program does not work exactly the way imagined, and “bugs” need to be removed from the design to get proper results. The debugger
29
allows to see the “ones and zeroes” execute, relate to the source code while the symbols and function names from the program. Debugging allows to experiment with code to see the value of variable point in the program, and to do “what if” checks, changing the variable values and stepping through routines.
“Burn” the code into a microcontroller and verify that it executes correctly in the finished application.
MPLAB IDE has different built-in components:
Project manager : The project manager provides integration and communication between the IDE and the language tools.
Editor: The editor is a full-featured programmer’s text editor that also serves as a window into the debugger.
Assembler/Linker and Language Tools: The assembler can be used standalone to assemble a single file, or can be used with the linker to build a project from separate source files, libraries and recompiled objects. The linker is responsible for positioning the compiled code into memory areas of the target microcontroller.
Debugger: The Microchip debugger allows breakpoints, single-stepping, watch windows and all the features of a modern debugger for MPLAB IDE. It works in conjunction with the editor to reference information from the target being debugged back to the source code.
Execution Engines: There are software simulators in MPLAB IDE for all PICmicro and dsPIC devices. These simulators use the PC to simulate the instructions and some peripheral functions of the PICmicro and dsPIC devices. Optional in-circuit emulators and in-circuit debuggers are also available to test code as it runs in the applications hardware.
There are additional components added to MPLAB IDE: Compiler Language Tools, Programmers, In-Circuit Emulators and In-Circuit Debugger. In this project, MPLAB IDE has been used to write, edit, debug, test, compile, assemble and burn the program codes for μC-1 (PIC16F877A) and μC-2(PIC18F4550).
4.4 PCB Design: PCB Wizard PCB Wizard is a powerful package for designing single-sided and double-sided printed circuit boards (PCBs). It is developed by the company New Wave Concepts. PCB Wizard provides a
30
comprehensive range of tools covering all the traditional steps in PCB production, including schematic drawing, schematic capture, component placement, automatic routing. In this project, PCB Wizard has been used for the PCB of the different circuits.
4.5 Hardware Components For easiness, the whole hardware system is divided into mainly two section as: Section 1, referring to the block of hardware that senses the load reactive power and other required parameters, and finally generates the reference current waveform signal for the next block & Section 2, referring to the block of hardware consisting of inverter and hysteresis band generating and comparing parts. Each hardware components used in these parts are discussed briefly in the following topics.
4.5.1 Section I 4.5.1.1 Sensors Sensors are used to sense the voltage and current of the load. - A current probe is used to sense the current value. It uses a current transformer and signal conditioning circuit which converts the current value into small scale voltage which can be used for further uses. - The voltage is sensed using a simple potential transformer connected in parallel. It steps-down the voltage value that can be used by the microcontroller. 4.5.1.2 Transistors
4.2 Transistor (BC547) Transistors are the semiconductor devices which can be controlled electrically. It has three terminals as collector, base and emitter. The current value through the base controls the flow of current from collector to emitter. This control helps to use this electronic component to preform
31
different actions. The transistor are solely used in this section to convert the +15 volt and -15 volt signal in to +5 volt and 0 volt signal, such that, they can be used by microcontroller. 4.5.1.3 Microcontrollers
Fig 4.3 Microcontrollers (PIC16F877A and PIC18F4550) Microcontrollers are the brain of the system. A microcontroller is defined in simple word as “a computer in a chip”. The microcontroller used in this section are of microchip. The project needs to perform two operation simultaneously, one is the sensing load current and calculate the reference reactive component of the current and the other is to generate continuously the sinusoidal reference current. Thus, for this purpose two microcontrollers are needed. PIC16F877A is used for the former task (to sense load current, voltage and their phase and determine the phase and magnitude of the reference current) and PIC18F4550 is used for the later task (to generate continuously the reference current digital value). PIC16F877A has the clock input of 20 MHz while PIC18F4550 has clock speed 48 MHz Hence, 18F4550 is faster than 16F877A. The 18F4550 continuously generates the digital value of real time magnitude of the sinusoidal reference current. The DAC is used to convert this digital value to analog. 4.5.1.4 LCD
Fig 4.4 LCD (LM016L) LCD stands for Liquid Crystal Display. It is a device that can be used with microcontrollers to display different messages. Here, this display is used to display the value of measured load voltage and current as well as the magnitude and angle of reference signal generated. LCD has a controller chip that control the action of LCD. To control the LCD, different command word
32
has to be sent to this controller using the pins of LCD. In this way, any messages can be displayed using microcontroller, which provide an easy way to communicate with the hardware. 4.5.1.5 Operational Amplifier
Fig 4.5 Op-Amp (LM741 and LM348) It is one of the versatile electronic device in its application. Op-amp in short, they refers to a class of high-gain DC coupled amplifiers with two inputs and a single output. The modern integrated circuit version is typified by the famous 741 op-amp. Some of the general characteristics of the IC version are: - High gain, on the order of a million, - High input impedance, low output impedance, - Used with split supply usually +/- 15V or with single supply mode as + and ground, - Used with feedback, with gain determined by the feedback network - The main principle of op-amp is that there terminal are virtually short, it means that the op-amp tries to maintain same potential in its both input terminal in anyway it can, Op-amp can be used for many purposes. In this section, two types of Op-amp IC are used: LM741 and LM348. LM741 is one of the famous op-amp with +/- 15 v split supply and LM348 is simply a quad version of 741 op-amp. Op-amp is used in this section as zero crossing detector, peak detector and to convert the current output of DAC into voltage. 4.5.1.6 DAC
Fig 4.6 DAC (DAC0808)
33
DAC stands for digital to analog converter. It is used to convert the digital 1 (+5 volt) and 0 (0 volt) data into analog values. The reference wave is generated in the digital circuit using the inputs and mathematics, which is then communicated with the DAC chip which converts the digital data into corresponding analog values. In this way, the reference signal is generated. Here, the DAC chip used is DAC 0808, which is a 8 bit DAC i.e. it takes 8 bit digital data as input with represents 2^(8) different analog values. It is a parallel DAC, thus it requires 8 data lines from the microcontroller to its input. The output of DAC 0808 is in current form, hence an op-amp is used to convert it into corresponding voltage form. In this way, section 1 generates the required respective reference wave for the hysteresis band comparator. 4.5.1.7 USART Communication The two micro-controllers used in this section needs to be communicated in order to perform the operation. USART stands for Universal Synchronous Asynchronous Receiver Transmitter. It is sometimes called the Serial Communications Interface or SCI. Synchronous operation uses a clock and data line while there is no separate clock accompanying the data for Asynchronous transmission. Since there is no clock signal in asynchronous operation, one pin can be used for transmission and another pin can be used for reception. But both the receiver and transmitter need to be set for the same data speed called baud rate. Both transmission and reception can occur at the same time — this is known as full duplex operation. Transmission and reception can be independently enabled. However, when the serial port is enabled, the USART will control both pins and one cannot be used for general purpose I/O when the other is being used for transmission or reception. This asynchronous communication protocol is used in this case for the communication purpose. It only requires 2 wires to be connected between the microcontrollers. These pins are designated as TX and RX in the micro-controllers. The data that flows in asynchronous mode is of a specific format such that both the controllers can understand it. The micro-controller uses a shift register to transfer the data in serial format one by one i.e. one bit at a time using one line. In this way, the first controller performs the calculation it has to perform and then transfer it to the second controller for further operation.
4.5.2 Section II This section consists of the inverter and hysteresis band generator and comparator circuit. Hysteresis band generator and comparator creates the hysteresis band and compares the actual current and reference current to generate the gate signal for inverter such the actual current tracks the reference current in the specified band. The hardware circuits and components used in this section are discussed briefly in the following topics.
34
4.5.2.1 Schmitt Trigger Schmitt trigger was invented by Otto H. Schmitt. It is a circuit or system with positive feedback and loop gain greater than 1. It is called “trigger” because the output retains its value until changes sufficiently to trigger a change. In the non-inverting configuration, when the input is higher than a certain chosen threshold, the output is high. When the input is below a different (lower) chosen threshold, the output is low, and when the input is between the two levels, the output retains its value. This dual threshold action is called hysteresis and implies that the Schmitt trigger possesses memory and can act as a bi-stable circuit (latch or flip-flop). It is normally used in signal conditioning application to remove noise from the signal used in digital circuits. A normal comparator compares threshold (reference) signal with actual signal and its output changes as the actual signal crosses the threshold value. But in case of Schmitt trigger the threshold value is not static but dynamic. There are two threshold values in Schmitt trigger which are formed by adding certain value to create upper threshold and subtracting same value to create lower threshold. In this way a band is created around the reference signal in Schmitt trigger called as hysteresis band. Thus, Schmitt trigger can be used to create a hysteresis band around the reference signal and compare the actual signal such that the output changes its state only when actual signal try to cross the band around the reference signal if the output signal can control the actual signal behavior. This can be done if output is used as a gate signal for the inverter which controls the actual current through inverter. Thus, Schmitt trigger is of great help to create hysteresis band and gate signal for the inverter. 4.5.2.2 MOSFET
Fig 4.7 MOSFET They are Metal Oxide Semiconductor Field Effect Transistors. The gate of MOSFET is insulated from the channel by a silicon dioxide layer. It is voltage controlled device i.e. a certain voltage applied in the gate turns on the MOSFET and it allows the flow of current from drain to source otherwise it acts like a huge impedance and stops the flow of current. Thus, MOSFET can be used as switch in the inverter. In this section, 4- MOSFET are used to construct a single phase H-bridge inverter. The MOSFET gate requires a voltage of about +12 volts with respect
35
to source in order to turn on. Thus, in order to drive the MOSFET a special driver IC is to be used which maintain this value using a bootstrap capacitor. Due to high cost of IGBTs, MOSFETs were used in hardware application. 4.5.2.3 Gate Driver IC
Fig 4.8 Gate Driver IC (IR2110) In case of single phase H-bridge inverter, 2 pair of MOSFET are to be used. Among these, 2 are high side MOSFET and 2 are low side MOSFET. The source of low side MOSFET are grounded, thus to create a voltage of 12 volt is not that difficult but in case of high side MOSFET the source is not grounded which creates difficulty in creating 12 volt across gate and source to turn on the high side MOSFET. Thus, for this purpose, a particular type of driver IC is to be used. Among several driver IC, IR2110 is one of the famous driver IC found in the market. It requires to be powered to 12 or 15 volt which it uses to switch the MOSFET on and off. It can easily control low and high side MOSFET. It only requires a digital 0/5 volt signal as input and it creates the required voltage across gate of MOSFET to turn it on and off. One driver IC is made to control 1 high and 1 low side MOSFET i.e. 1 leg of the bridge. In order to create 12 volt or more in the gate of high side MOSFET with respect to source it uses a bootstrap capacitor. While high side is off, the bootstrap capacitor get charged to the supply voltage, and during turning on process this capacitor is made to get connected across gate and source thus creating the required voltage to turn it on. The capacitor value is to be choose to suit the time of on state since its charge decreases with time. For fast operation, i.e. short on time period, small value capacitor is enough but for slow switching, high value may be necessary. In this way, driver IC provides easy control over the switching action of MOSFET using simple digital signals.
36
CHAPTER 5
SOFTWARE AND HARDWARE SIMULATION STUDY This chapter deals with the various circuits and their simulation study. The results of the simulation are also included in the chapter. This chapter gives idea about the various circuit diagrams, their operating principles and finally the results of the simulation study.
5.1 Circuits and Blocks 5.1.1 Current Sensor In order to sense the current in the circuit, a CT probe which was based on Hall Effect was used in the hardware. The probe output is the voltage proportional to the current in the input. However, for simulation study, a current sensor ACS755 was used. The sensor operates in the similar that of the actual CT probe. However, the current sensor used in simulation gives only positive output voltage for negative current as well. But the actual current probe used gives the output voltage as the exact replica of the scaled input current.
5.1.2 Zero Cross Detector 5.1.2.1 Introduction Zero Cross Detector circuit is used to detect the zero cross of the voltage and current. To find the zero cross of the current, the equivalent voltage of the current is used. The circuit below shows the zero cross detector circuit. The time lap between the voltage and current has been utilized to find the power factor angle of the circuit.
Fig 5.1 Zero Cross Detector
37
5.1.2.2 Operation The op-amp in this circuit is in comparator mode. When the voltage at the inverting terminal is greater than non-inverting terminal, the output is -15V. +15V is the output when the voltage at the inverting terminal is less than the non-inverting terminal. To convert this logic to 0-5 V range, transistor in inverting mode is used. When output from op-amp is +15V, transistor gets biased, turning ON the transistor. In this case, the output is 0V. Similarly, reverse is the case when the op-amp output is -15V. Thus, working of the whole circuit can be summarized as: When Vin>0V, output from op-amp = -15V, output from the whole circuit= 5V. When Vin0) { while(!TMR1IF); TMR1IF=0; TMR1H=0xEC; TMR1L=0x77; n--; } } void delay_100us(int n) { T0CS = 0; PSA = 0; PS2 = PS1 = PS0 = 0; TMR0IE = 0; TMR0 = 6; TMR0IF = 0; while(n!=0) { while(!TMR0IF); TMR0 = 6;
66
TMR0IF = 0; n--; } } #endif // DELAY_H_INCLUDED
Header file "lcd.h" #ifndef LCD_H_INCLUDED #define LCD_H_INCLUDED #include #include"delay.h" #define RS RB2 #define EN RB3 #define LCD_DATA PORTB void LCD_write(unsigned char DATA_,char rs) { RS = rs;//0 for command,1 for data //*************first nibble*********************** LCD_DATA = (LCD_DATA&0b00001111) | (DATA_&0b11110000); EN = 1; delay_nms(1); EN = 0; delay_nms(1);//delay for nxt enable on.. //*************second nibble********************** LCD_DATA = (LCD_DATA&0b00001111) | ((DATA_