Você está na página 1de 51

ABSTRACT:

Unified Power Quality Conditioner (UPQC) for harmonic elimination and simultaneous compensation of voltage and current, which improves the power quality offered for other harmonic sensitive loads. UPQC consist of combined series active power filter that compensates voltage harmonics of the power supply, and shunt active power filter that compensates harmonic currents of a non-linear load. In this paper a new control algorithm for the UPQC system is optimized and simplified without transformer voltage, load and filter current measurement, so that system performance is improved. The proposed control technique has been evaluated and tested under dynamical and steady state load conditions using MATLAB software.

CHAPTER - 1

1.INTRODUCTION Continuous and fast development of power system has made FACTS an effective tool for its development. Among various FACTS controllers Unified Power Quality Conditioner [UPQC] is chosen as it embraces all basic attributes of the transmission. The mathematical model of the UPQC is developed and employed for the load flow control studies. By using UPQC the power flow control becomes more flexible than ever. But it has a drawback which requires pre-specified condition such as the power flow in the transmission line where it is being embedded. As no one has prior knowledge about this the pre-specified power flow and voltage are arbitrary. This projects aims to present a systematic and efficient method for performing load flow calculation of a generalized power system with multi-machines and multiUPQCs.

1.2 FACTS INTRODUCTION TO FACTS

We need transmission interconnections because, apart from delivery, the purpose of the transmission network is to pool plants and load centers in order to minimize the total power generation capacity and fuel cost. Transmission interconnections enable taking advantage of diversity of

loads, availability of sources, and fuel price in order to supply electricity to the loads at minimum cost with a required reliability. In general, if a power delivery system was made up of radial lines from individual local generators without being part of a grid system, many more generation resources would be needed to serve the load with the same reliability, and the cost of electricity would be much higher. With that perspective, transmission is often an alternative to a new generation resource. Less transmission capability means that more generation resources would be required regardless of whether the system is made up of large or small power plants. In fact small distributed generation becomes more economically viable if there is a backbone of a transmission grid. One cannot be really sure about what the optimum balance is between generation and transmission unless the system planners use advanced methods of analysis which integrate

transmission

planning

into

an

integrated

value

based

transmission/generation planning scenario. The cost of transmission lines and losses, as well as difficulties encountered in building new transmission lines, would often limit the available transmission capacity. It seems that there are many cases where economic energy or reserve sharing is constrained by transmission capacity, and the situation is not getting any better. In a deregulated electric service environment, an effective electric grid is vital to the competitive environment of reliable electric service. On the other hand, as power transfers grow, the power system becomes increasingly more complex to operate and the system can become less secure for riding through the major outages. It may lead to large power flows with inadequate control, excessive reactive power in various parts of the system, large dynamic swings between different parts of the system and bottlenecks, and thus the full potential of transmission interconnections cannot be utilized. The power systems of today, by and large, are mechanically controlled. There is a widespread use of microelectronics, computers and high speed communications for control and protection of present transmission systems; however, when operating signals are sent to the power circuits, where the final power control action is taken, the switching devices are mechanical and there is little high speed control. Another problem with

mechanical devices is that control cannot be initiated frequently, because these mechanical devices tend to wear out very quickly compared to static devices. In effect, from the point of view of both dynamic and steady state operation, the system is really uncontrolled. Power system planners, operators, and engineers have learned to live with this limitation by using a variety of ingenious techniques to make the system work effectively, but at a price of providing greater operating margins and redundancies. These represent an asset that can be effectively utilized with prudent use of FACTS technology on a selective, as needed basis. In recent years, greater demands have been placed on the transmission network, and these demands will continue to increase because of the increasing number of nonutility generators and heightened competition among utilities themselves. Added to this is the problem that it is very difficult to acquire new rights of way. Increased demands on transmission, absence of long-term planning, and the need to provide open access to generating companies and customers, all together have created tendencies toward less security and reduced quality of supply. The FACTS technology is essential to alleviate some but not all of these difficulties by enabling utilities to get the most service from their transmission facilities and enhance grid reliability. It must be stressed, however, that for many of the capacity expansion needs, building of new

lines or upgrading current and voltage capability of existing lines and corridors will be necessary.

2.2 Opportunities for FACTS: What is most interesting for transmission planners is that FACTS technology opens up new opportunities for controlling power and enhancing the usable capacity of present, as well as new and upgraded. The possibility that current through a line can be controlled at a reasonable cost enables a large potential of increasing the capacity of existing lines with larger conductors, and use of one of the FACTS Controllers to enable corresponding power to flow through such lines under normal and contingency conditions. These opportunities arise through the ability of FACTS Controllers to control the interrelated parameters that govern the operation of transmission systems including series impedance, shunt impedance, current, voltage, phase angle, and the damping of oscillations at various frequencies below the rated frequency. These constraints cannot be overcome, while maintaining the required system reliability, by mechanical means without lowering the useable transmission capacity. By providing added flexibility, FACTS Controllers can enable a line to carry power closer to its thermal rating. Mechanical switching needs to be supplemented by rapid-response

power electronics. It must be emphasized that FACTS is an enabling technology, and not a one-on-one substitute for mechanical switches. The FACTS technology is not a single high-power Controller, but rather a collection of Controllers, which can be applied individually or in coordination with others to control one or more of the interrelated system parameters mentioned above. A well-chosen FACTS Controller can overcome the specific limitations of a designated transmission line or a corridor. Because all FACTS Controllers represent applications of the same basic technology, their production can eventually take advantage of technologies of scale. Just as the transistor is the basic element for a whole variety of microelectronic chips and circuits, the thyristor or high-power transistor is the basic element for a variety of high-power electronic Controllers. FACTS technology also lends itself to extending usable transmission limits in a step-by-step manner with incremental investment as and when required. A planner could foresee a progressive scenario of mechanical switching means and enabling FACTS Controllers such that the transmission lines will involve a combination of mechanical and FACTS Controllers to achieve the objective in an appropriate, staged investment scenario.

It is also worth pointing out that, in the implementation of FACTS technology, we are dealing with a base technology, proven through HVDC and high-power industrial drives. Nevertheless, as power semiconductor devices continue to improve, particularly the devices with turn-off capability, and as FACTS Controller concepts advance, the cost of FACTS Controllers will continue to decrease. Large-scale use of FACTS technology is an assured scenario. 1.3 Limiting the load capability Assuming that the ownership is not an issue, and the objective is to make the best use of the transmission asset, and to maximize the loading capability (taking into account contingency conditions), what limits the loading capability, and what can be done about it? Basically, there are three kinds of limitations: _ Thermal _ Dielectric _ Stability Thermal: Thermal capability of an overhead line is a function of the ambient temperature, wind conditions, condition of the conductor, and ground clearance. It varies perhaps by a factor of 2 to 1 due to the variable environment and the loading history. The nominal rating of a line is

generally decided on a conservative basis, envisioning a statistically worst ambient environment case scenario. Yet this scenario occurs but rarely which means that in reality, most of the time, there is a lot more real time capacity than assumed. Some utilities assign winter and summer ratings, yet this still leaves a considerable margin to play with. There are also off-line computer programs that can calculate a lines loading capability based on available ambient environment and recent loading history. Then there are the on-line monitoring devices that provide a basis for on-line real-time loading capability. These methods have evolved over a period of many years , and, given the age of automation (typified by GPS systems and low-cost sophisticated communication services), it surely makes sense to consider reasonable, day to day, hour to hour, or even real-time capability information. Sometimes, the ambient conditions can actually be worse than assumed, and having the means to determine actual rating of the line could be useful. During planning/design stages, normal loading of the lines is frequently decided on a loss evaluation basis under assumptions which may have changed for a variety of reasons; however losses can be taken into account on the real-time value basis of extra loading capability. Of course, increasing the rating of a transmission circuit involves

consideration of the real-time ratings of the transformers and other equipment as well, some of which may also have to be changed in order to increase the loading on the lines. Real-time loading capability of transformers is also a function of ambient temperature, aging of the transformer and recent loading history. Off-line and on-line loading capability monitors can also be used to obtain real time loading capability of transformers. Also, the transformer also lends itself to enhanced cooling. Then there is the possibility of upgrading a line by changing the conduction to that of a higher current rating, which may in turn require structural upgrading.

Finally, there is the possibility of converting a single-circuit to a doublecircuit line. Once the higher current capability is available, then the question arises of how it should be used. Will the extra power actually flow and be controllable? The FACTS technology can help in making an effective use of this newfound capacity. Dielectric: From an insulation point of view, many lines are designed very

conservatively. For a given nominal voltage rating, it is often possible to increase normal operation by +10% voltage (i.e.500kV-550kV) or even higher. Care is then needed to ensure that dynamic and transient overvoltages are within limits. Modern gapless arresters, or line insulators with internal gapless arresters, or powerful thyristor-controlled overvoltage suppressors at the substations can enable significant increase in the line and substation voltage capability. The FACTS technology could be used to ensure acceptable over-voltage and power flow conditions. Stability: There are a number of stability issues that limit the transmission capability. These include: _ Transient stability _ Dynamic stability _ Steady-state stability _ Frequency stability _ Voltage collapse _ Sub synchronous resonance The FACTS technology can certainly be used to overcome any of the stability limits, in which case the ultimate limits would be thermal and dielectric.

1.4

RELATIVE

IMPORTANCE

OF

CONTROLLABLE

PARAMETERS: _ Control of the line impedance X (e.g., with a thyristor-controlled series capacitor) can provide a powerful means of current control _ Injecting a voltage in series with the line, and perpendicular to the current flow, can increase or decrease the magnitude of current flow. Since the current flow lags the driving voltage by 90 degrees, this means injection of reactive power in series, (e.g., with static synchronous series compensation) can provide a powerful means of controlling the line current, and hence the active power when the angle is not large. _ Injecting voltage in series with the line and with any phase angle with respect to the driving voltage can control the magnitude and the phase of the line current. This means that injecting a voltage phasor with variable phase angle can provide a powerful means of precisely controlling the active and reactive power flow. This requires injection of both active and reactive power in series. _ Because the per unit line impedance is usually a small fraction of the line voltage, the MVA rating of a series Controller will often be a small fraction of the throughput line MVA..

_ When the angle is not large, which is often the case, control of X or the angle substantially provides the control of active power. Control of angle (with a Phase Angle Regulator, for example), which in turn controls the driving voltage, provides a powerful means of controlling the current flow and hence active power flow when the angle is not large. Combination of the line impedance control with a series Controller and voltage regulation with a shunt controller can also provide a costeffective means to control both the active and reactive power flow between the two systems. 1.5 CHECKLIST OF POSSIBLE BENEFITS FROM FACTS

TECHNOLOGY: FACTS Controllers enable the transmission owners to obtain, one or more of the following benefits: Control of power flow as ordered. The use of control of the power flow may be to follow a contract, meet the utilities own needs, ensure optimum power flow, ride through emergency conditions, or a combination thereof. Increase the system security through raising the transient stability limit, limiting short-circuit currents and overloads, managing cascading blackouts and damping electromechanical oscillations of power systems and machines.

Provide secure tie line connections to neighboring utilities and regions there by decreasing over all generation reserve requirements on both sides. Provide greater flexibility in siting new generation. Upgrade of lines. Reduce reactive power flows, thus allowing the lines to carry more active power. Increase the loading capability of lines to their thermal capabilities, including short term and seasonal. This can be accomplished by overcoming other limitations, and sharing of power among lines according to their capability. It is also important to note that thermal capability of a line varies by a very large margin based on the environmental conditions and loading history _ Reduce loop flows. Increase utilization of lowest cost generation. One of the principal reasons for Transmission interconnection is to utilize lowest cost generation. 1.6. BASIC TYPES OF FACTS CONTROLLERS: In general, FACTS controllers can be divided into four categories: 1.Series controllers 2.Shunt controllers 3.Combined series series controllers 4.Combined series shunt controllers

CHAPTER - 2 2.1 SERIES CONTROLLERS: The series controller could be a variable impedance, such as capacitor, reactor, etc., or a power electronics based variable source of main frequency, sub synchronous and harmonic frequencies to serve the desired need. In principle, all series controllers inject voltage in series with the line. Even a variable impedance multiplied by the current flow through it, represents an injected series voltage in the line. As long as the voltage is in phase quadrature with the line current, the series controller only supplies (or) consumes variable reactive power. The basic type of series controller with and without energy storage element is shown in figure 3.1. Figure2.1 Series

SERIES CONTROLLERS

2.2 SHUNT CONTROLLERS: As in the case of series controllers, the shunt controllers may be variable impedance, Variable source, or a combination of these. In principle, all shunt controllers inject current into the system at the point of connection. Even a variable shunt impedance connected to the line voltage causes a variable current flow and hence represents injection of current into the line. As long as the injected current is in phase quadrature with the line voltage, the shunt controller only supplies or consumes variable reactive power. The basic type of shunt controllers are shown in figure. 2.3 COMBINED SERIES-SERIES CONTROLLERS: This could be a combination of separate series controllers, which are controlled in a coordinated manner, is a multilane transmission system or it could be a united controller in which series controllers provide independent series reactive compensation for each line but also transfer real power among the line via the power link. The real power transfer capability of the unified series series controller, referred to as interline power flow controller, makes it possible to balance both the real and reactive power flow in the lines and there by maximize the utilization of the transmission system. Note that the term Unified here

means that the dc terminals of all controller converters are all connected together for real power transfer. 2.4 COMBINED SERIES-SHUNT CONTROLLERS: This could be a combination of separate shunt and series controllers, which are controlled in a coordinated manner, or a Unified Power Flow Controller with series and shunt elements. In principle, combined shunt and series controllers inject current into the system with the shunt part of the controller and voltage in series in the line with the series part of the controller. The schematic diagram of UPFC is shown in figure.

CHAPTER 3 BLOCK DIAGRAM:

GENERATING STATION

TRANSMISSION LINES

LOAD

UPFC

CONTROL UNIT

BLOCK DESCRIPTION:

Circuit diagram:

Kgfvlsajkfgasghsg

CIRCUIT DESCRIPTION:

CHAPTER 4

Unified Power Flow Controller (UPFC): A combination of static synchronous compensator (STATCOM) and a static series compensator (SSSC) which are coupled via a common dc link, to allow bidirectional flow of real power between the series output terminals of the SSSC and the shunt output terminals of the STATCOM, and are controlled to provide concurrent real and reactive series line compensation without an external electric energy source. The UPFC, by means of angularly unconstrained series voltage injection, is able to control, concurrently or selectively, the transmission line voltage, impedance, and angle or, alternatively, the real and reactive power flow in the line. The UPFC may also provide independently controllable shunt reactive compensation. In UPFC, which combines a STATCOM and an SSSC the active power for the series unit (SSSC) is obtained from the line itself via the shunt unit STATCOM. The latter is also used for voltage control with control of its

reactive power. This is a complete controller for controlling active and reactive power control through the line, as well as line voltage control. Additional storage such as super conducting magnet connected to the dc link via an electronic interface would provide the means of further enhancing the effectiveness of the UPFC. The controller exchange of real power with an external source, such as storage is much more effective in control of system dynamics than modulation of the power transfer within a system. 4. THE UNIFIED POWER FLOW CONTROLLER The unified power flow controller (UPFC) concept was proposed by Gyugyi in 1991. The UPFC was derived for the real time control and dynamic compensation of ac transmission systems, providing multifunctional flexibility required to solve many of the problems facing the power delivery industry. Within the framework of traditional power transmission concepts, the UPFC us able to control, simultaneously or selectively, all the parameters affecting power flow in the transmission line (i.e., voltage, impedance, and phase angle), and this unique capability is signified by the adjective unified in its name. Alternatively, it can independently control both the real and reactive power flow in the line. The reader should recall that, for all the Controllers discussed in the previous chapters, the control of real power is associated

with similar change in reactive power, i.e., increased real power flow also resulted in increased reactive line power. In order to increase the system reliability and provide flexibility for future system changes, the UPFC installation was required to allow self-sufficient operation of the shunt converter as an independent STATCOM and the series converter as an independent Static Synchronous Series Compensator (SSSC). It is also possible to couple both converters together to provide either shunt only or series only compensation over a doubled control range.

BASIC OPERATING PRINCIPLES: From the conceptual view point, the UPQC is a generalized synchronous voltage source (SVS), represented at the fundamental (power system) frequency by voltage phasor Vpq with controllable magnitude Vpq (0< Vpq < Vpqmax) and in series with the transmission line, as illustrated for the usual elementary two-machine system (or for two independent systems with a transmission link intertie) in Figure . In this functionally unrestricted operation, which clearly includes voltage and angle regulation, the SVS generally exchanges both reactive and real power with the transmission System. Since, as established previously, a SVS is able to generate only the reactive power exchanged, the real power must be supplied to it, or absorbed from it, by a suitable power supply or sink. In the UPFC arrangement the real power exchanged is provided by one of the end buses (e.g., the sendingend bus), as indicated in Figure . In the presently used practical implementation, the UPFC consists of two voltage-source converters. These back-to-back converters, labeled

Converter 1 and Converter 2 in the figure 4.1, are operated from a common dc link provided by a dc storage capacitor. As indicated before, this

arrangement functions as an ideal ac-to-ac power converter in which the real power can freely flow in either direction between the ac terminals of the two converters, and each converter can independently generate (or absorb) reactive power at its own ac output terminal. Converter 2 provides the main function of the UPFC by injecting voltage Vpq with controllable magnitude Vpq and phase angle in series with the line via an insertion transformer. This injected voltage acts essentially as a synchronous ac voltage source. The transmission line current flows through this voltage source resulting in reactive and real power exchange between it and the ac system. The reactive power exchanged at the ac terminal (i.e., at the terminal of the series insertion transformer) is generated internally by the converter. The real power exchanged at the ac terminal is converted into dc power which appears at the dc link as a positive or Negative real power demand. The basic function of Converter 1 is to supply or absorb the real power demanded by Converter 2 at the common dc link to support the real power exchange resulting from the series voltage injection. This dc link power demand of Converter 2 is converted back to ac by Converter 1 and coupled to the transmission line bus via a shunt- connected transformer. In addition to the real power need of Converter 2, Converter 1 can also generate or

absorb controllable reactive power, if it is desired, and thereby provide independent shunt reactive compensation for the line. It is important to note that whereas there is a closed direct path for the real power negotiated by the action of series voltage injection through Converters 1 and 2 back to the line, the corresponding reactive power exchanged is supplied or absorbed locally by Converter 2 and therefore does not have to be transmitted by the line. Thus, converter 1 can be operated at a unity power factor or be controlled to have a reactive power exchange with the line independent of the reactive power exchanged by Converter 2. Obviously, there can be no reactive power flow through the UPQC dc link. 4.2 UPQC OPERATION STRATEGY: During system disturbances, mechanically switched shunt capacitor banks and associated controls are generally slow to react. Under actual system contingency conditions, all of these banks may not switch on (hunting concerns) or some may over-correct the voltage and lock-out. To resolve this situation, the UPFC is required to maintain a predetermined reactive power margin to maximize the shunt converters dynamic reactive power reserve for system contingency conditions. This ensures that the controllable reactive power range of the shunt converter is available at all times to

compensate for dynamic system disturbances. The shunt capacitor banks will be switched on and off to maintain the reserve UPFC and SVC margins during steady state load fluctuations. POWER FLOW CONTROL. Actual flow on the line could be higher depending on other prevailing system conditions. The UPFC, therefore, may be required to slightly reduce the line loadings. Line reactive power flow and its direction will be monitored to help maintain the dynamic reactive power margin of the shunt inverter. The series power flow control becomes important during contingency conditions. The control objective is to increase the line loading. This control is to be activated as soon as any one of the line loadings exceeds 90% of their respective emergency thermal ratings. The UPFC has to increase line loading until the critical line loadings are reduced below the defined levels or the UPFC reaches its rating limit. 4.3 DESCRIPTION OF THE UPQC: The Unified Power Flow Controller is designed to meet the defined system requirements, in particular, to provide fast reactive shunt compensation. In order to increase the system reliability and provide flexibility for future system changes, the UPFC installation was required to allow self-sufficient operation of the shunt converter as an independent STATCOM and the

series converter as an independent Static Synchronous Series Compensator (SSSC). It is also possible to couple both converters together to provide either shunt only or series only compensation over a doubled control range. Power Circuit Structure The UPFC equipment comprises two identical GTO thyristor-based converters. Each converter includes multiple high-power GTO valve structures feeding an intermediate (low-voltage) transformer. The converter output is a threephase voltage set of nearly sinusoidal (48 pulse) quality that is coupled to the transmission line by a conventional (three-winding to three-winding) main coupling transformer. The shunt connected transformer has a deltaconnected primary, and the series transformer has three separate primary windings each rated for the phase voltage. To maximize the versatility of the installation, two identical main shunt transformers and a single main series transformer have been provided. With this arrangement, a number of power circuit configurations are possible. Converter 1 can operate as a STATCOM with either one of the two main shunt transformers, while Converter 2 operates as an SSSC. Alternatively, Converter 2 can be connected to the spare main shunt transformer and can operate as an additional STATCOM.

Control System Both converters comprising the UPFC are controlled from a single central control system housed in three cabinets in the control room. Two of the cabinets house the relay interface and signal conditioning, while a single cabinet contains the control electronics. The actual control algorithms that govern the instantaneous operation of the two converters are performed in the real-time control electronics which employs multiple digital signal processors. The real-time control communicates with the pole electronics mounted on each pole via the valve interface that is linked to the poles by fiber-optic cables. The status processor is connected to every part of the system, including the cooling system and all of the poles, by serial communications. During run time it continually monitors the operation of all subsystems, collecting analyzing status information. It is responsible for all start-up and shutdown sequences and for the organizing and annunciation of all alarm conditions. The status processor is serially connected to a graphical display terminal which provides the local operator interface. A hierarchical arrangement of graphical display screens gives the operator access to all system settings and parameters, and provides extensive diagnostic information right down to the individual GTO modules. A typical layout of UPQC installed in a substation is shown in the figure.

4. UPQC layout

CHAPTER - 5 5.1 MODELLING MODELLING OF UPQC: The Model of the UPQC can be illustrated by the equivalent circuit shown in figure5.1.Each of the three following basic controllable parameters of the UPFC are modulated separately and they fall in the region. UT [0,UTmax], T [0,2], Iq [-Iqmax, Iqmax] The mathematical relations of the UPFC parameters are given by, Us = UP + UT Is = IP-Iq- It arg (Iq) = arg (UP) /2

In this model , we have considered the UPFC is placed at the centre of a medium transmission line(100km). The equations for sending end active and reactive power can be obtained from the real and imaginary powers of power equation as follows: Ps= Real part of [Vs Is*] =0.138+0.25 sin(b- ) -0.138 cos Qs= Imaginary part of [Vs Is*]

=1.56-1.56 cos + 0.25 cos(-b) +0.02 sin(-b)-0.138sin The variation limits of b and are according to the following to the following relation: 0 b 2 0 0.71 radians

5.2 LOAD FLOW EQUATIONS WITH UPQC: For the UPFC embedded transmission line with one end denoted as node 1 and the other as node m, the load-flow equations can be expressed as: PG1 PL1 = jl Ui Uj (Gij cosij + Bij Sinij).------------------(5.1) QG1 QL1 = jl Ui Uj (Gij Sinij Bij Sinij)-------------------(5.2) i =1,2,n; but i # l, m. PGl PLl = jm U1 Uj (Gij Cosij + Bij Sinij) + Pl ---------(5.3) QGl QLl = jm U1 Uj (Gij Sinij Bij Cosij) + Ql-------(5.4) PGm PLm = jm UmUj (Gmj Cosmj + Bmj Sinmj) + Pm----(5.5) QGm QLm= jm UmUj (Gmj Sinmj - Bmj Cosmj) + Qm----(5.6)

CHAPTER 6 ATMEGA CONTROLLER


ATMEGA 8089S52 DESCRIPTION-

AT89S52 MICROCONTROLLER

Features Compatible with MCS-51 Products 8K Bytes of In-System Programmable (ISP) Flash Memory

Endurance: 1000 Write/Erase Cycles 4.0V to 5.5V Operating Range Fully Static Operation: 0 Hz to 33 MHz Three-level Program Memory Lock 256 x 8-bit Internal RAM 32 Programmable I/O Lines Three 16-bit Timer/Counters Eight Interrupt Sources Full Duplex UART Serial Channel Low-power Idle and Power-down Modes

Description

The AT89S52 is a low-power, high-performance CMOS 8-bit microcontroller with 8K bytes of in-system programmable Flash memory. The device is manufactured using Atmels high-density nonvolatile memory technology and is compatible with the Indus-try-standard 80C51 instruction set and pin out. The on-chip Flash allows the program memory to be reprogrammed in-system or by a conventional nonvolatile memory pro-grammer. By combining a versatile 8-bit CPU with in-system programmable Flash on a monolithic chip, the Atmel AT89S52 is a powerful microcontroller which provides a highly-flexible and cost-effective solution to many embedded control applications. The AT89S52 provides the following standard features: 8K bytes of Flash, 256 bytes of RAM, 32 I/O lines, Watchdog timer, two data pointers, three 16-bit timer/counters, a six-vector two-level interrupt architecture, a full duplex serial port, onchip oscillator, and clock circuitry. In addition, the AT89S52 is designed with static logic for operation down to zero frequency and supports two software selectable power saving modes. The Idle Mode stops the CPU while allowing the RAM, timer/counters, serial port, and interrupt system to continue functioning. The Power-down mode saves the RAM con-tents but freezes the oscillator, disabling all other chip functions until the next interrupt or hardware reset.

Figure.3.5. Block diagram of the microcontroller

Figure.3.6. Pin diagram of 89s52

Pin Description

VCC Supply voltage. GND Ground. Port 0 Port 0 is an 8-bit open drain bidirectional I/O port. As an output port, each pin can sink eight TTL inputs. When 1s are written to port 0 pins, the pins can be used as high-impedance inputs. Port 0 can also be configured to be the multiplexed low-order address/data bus during accesses to external program and data memory. In this mode, P0 has internal pull-ups. Port 0 also receives the code bytes during Flash programming and outputs the code bytes during program verification. External pull-ups are required during program verification. Port 1 Port 1 is an 8-bit bidirectional I/O port with internal pull-ups. The Port 1 output buffers can sink/source four TTL inputs. When 1s are written to Port 1 pins, they are pulled high by the inter-nal pull-ups and can be used as inputs. As inputs, Port 1 pins that are externally being pulled low will source current (IIL) because of the internal pullups. In addition, P1.0 and P1.1 can be configured to be the timer/counter 2 external count input (P1.0/T2) and the timer/counter 2 trigger input (P1.1/T2EX), respectively, as shown in the following table. Port 1 also receives the low-order address bytes during Flash programming and verification.

Table.3.3. Port functions Port 2 Port 2 is an 8-bit bidirectional I/O port with internal pull-ups. The Port 2 output buffers can sink/source four TTL inputs. When 1s are written to Port 2 pins, they are pulled high by the internal pull-ups and can be used as inputs. As inputs, Port 2 pins that are externally being pulled low will source current (IIL) because of the internal pullups. Port 2 emits the high-order address byte during fetches from external program memory and during accesses to external data memory that uses 16-bit addresses (MOVX @ DPTR). In this application, Port 2 uses strong internal pull-ups when emitting 1s. During accesses to external data memory that uses 8-bit addresses (MOVX @ RI), Port 2 emits the contents of the P2 Special Function Register. Port 2 also receives the high-order address bits and some control signals during Flash programming and verification. Port Pin Alternate Functions P1.0 T2 (external count input to Timer/Counter 2), clock-out P1.1 T2EX (Timer/Counter 2 capture/reload trigger and direction control) P1.5 MOSI (used for InSystem Programming) P1.6 MISO (used for In-System Programming) P1.7 SCK (used for In-System Programming)

Port 3 Port 3 is an 8-bit bidirectional I/O port with internal pull-ups. The Port 3 output buffers can sink/source four TTL inputs. When 1s are written to Port 3 pins, they are pulled high by the internal pull-ups and can be used as inputs. As inputs, Port 3 pins that are externally being pulled low will source current (IIL) because of the pull-ups. Port 3 receives some control signals for Flash programming and verification. Port 3 also serves the functions of various special features of the AT89S52, as shown in the following table.

Table.3.4.Alternate Port functions of 89s52

RST Reset input. A high on this pin for two machine cycles while the oscillator is running resets the device. This pin drives high for 98 oscillator periods after the Watchdog times out.

ALE/PROG Address Latch Enable (ALE) is an output pulse for latching the low byte of the address during accesses to external memory. This pin is also the program pulse input (PROG) during Flash programming. In normal operation, ALE is emitted at a constant rate of 1/6 the oscillator frequency and may be used for external timing or clocking purposes. Note, however, that one ALE pulse is skipped during each access to external data memory. If desired, ALE operation can be disabled by setting bit 0 of SFR location 8EH. With the bit set, ALE is active only during a MOVX or MOVC instruction. Otherwise, the pin is weakly pulled high. Setting the ALE-disable bit has no effect if the microcontroller is in external execution mode. PSEN Program Store Enable (PSEN) is the read strobe to external program memory. When the AT89S52 is executing code from external program memory, PSEN is activated twice each machine cycle, except that two PSEN activations are skipped during each access to external data memory. EA/VPP External Access Enable. EA must be strapped to GND in order to enable the device to fetch code from external program memory locations starting at 0000H up to FFFFH. Note, however, that if lock bit 1 is programmed, EA will be internally latched on reset. EA should be strapped to VCC for internal program executions. This pin also receives the 12-volt programming enable voltage (VPP) during Flash programming.

XTAL1

Input to the inverting oscillator amplifier and input to the internal clock operating circuit. XTAL2 Output from the inverting oscillator amplifier.

Memory Organization MCS-51 devices have a separate address space for Program and Data Memory. Up to 64K bytes each of external Program and Data Memory can be addressed. Program Memory If the EA pin is connected to GND, all program fetches are directed to external memory. On the AT89S52, if EA is connected to VCC, program fetches to addresses 0000H through 1FFFH are directed to internal memory and fetches to addresses 2000H through FFFFH are to external memory. Data Memory The AT89S52 implements 256 bytes of on-chip RAM. The upper 128 bytes occupy a parallel address space to the Special Function Registers. This means that the upper 128 bytes have the same addresses as the SFR space but are physically separate from SFR space. When an instruction accesses an internal location above address 7FH, the address mode used in the instruction specifies whether the CPU accesses the upper 128 bytes of RAM or the SFR space.

CHAPTER 7 ANALYSIS OF UPFC

7.1 INTRODUCTION TO MATLAB MATLAB (matrix laboratory) is a numerical computing environment and fourth-generation programming language. Developed by MathWorks, MATLAB allows matrix manipulations, plotting of functions and data, implementation of algorithms, creation of user interfaces, and interfacing with programs written in other languages, including C, C++, Java, and Fortran. Although MATLAB is intended primarily for numerical computing, an optional toolbox uses the MuPAD symbolic engine, allowing access to symbolic computing capabilities. An additional package, Simulink, adds graphical multi-domain simulation and Model-Based Design for dynamic and embedded systems. In 2004, MATLAB had around one million users across industry and academia.[2] MATLAB users come from various backgrounds of

engineering, science, and economics. MATLAB is widely used in academic and research institutions as well as industrial enterprises. 7.2 SIMULATION SETUP: The simulation model including a power system with a transmission line. The UPFC installed near the sending end effectively controls the power flow from sending to receiving end.

CHAPTER 8 CONCLUSION

Você também pode gostar