Offline UPS Reference Design using the dsPIC® DSC

183 downloads 3626 Views 433KB Size Report
converter, and a DC-AC inverter as shown in the block diagram. The Offline ... the Inverter mode, the system produces a pure sine wave output with a voltage. THD less ... Use of the reference design is Royalty Free, and complete documentation, .... The basic circuit diagram of the full-bridge inverter is as shown on this page.
Offline UPS Reference Design using the dsPIC® DSC

© 2006 Microchip Technology Incorporated. All Rights Reserved.

Offline UPS Reference Design using the dsPIC® DSC

Slide 1

Hello, and welcome to this web seminar on Microchip’s Offline UPS Reference Design. My name is __________, and I am an Applications Engineer in the High performance Microcontroller Division of Microchip.

1

Session Agenda 

Background Information



1kVA Offline UPS Reference Design



Software Integration



Special Algorithms



Summary

© 2006 Microchip Technology Incorporated. All Rights Reserved.

Offline UPS Reference Design using the dsPIC® DSC

Slide 2

In this webinar, we will go through the design of Microchip’s Offline UPS Reference Design, including hardware details and the system software.

2

Session Agenda 

Background Information



1kVA Offline UPS Reference Design



Software Integration



Special Algorithms



Summary

© 2006 Microchip Technology Incorporated. All Rights Reserved.

Offline UPS Reference Design using the dsPIC® DSC

Slide 3

So let’s get started with some Background information on uninterruptible power supplies.

3

Uninterruptible Power Supply 

Offline UPS Architecture − Switches to battery as it detects power failure − Few millisecond switchover time at power failure Transfer Switch

Filter

DC

DC DC Battery Charger

Battery

© 2006 Microchip Technology Incorporated. All Rights Reserved.

Boost Converter

AC Inverter

Offline UPS Reference Design using the dsPIC® DSC

Slide 4

An Uninterruptible Power Supply, or UPS, is a device that provides power to electronic equipment when the primary power source is not available. While the primary source is not available, a battery is used to power the load, typically for a short duration of time. The duration may range from a few minutes for residential UPS systems, to several hours for medical or telecommunications equipment. There are many different architectures for UPS systems. Some of the common ones are the Offline UPS, Online UPS, and Line Interactive UPS architectures. This webinar focuses on the Offline UPS architecture. The main system blocks of the Offline UPS include a battery charger, a DC-DC converter, and a DC-AC inverter as shown in the block diagram. The Offline UPS system also consists of a transfer switch to select the source of energy for the load. When AC mains power is available, the transfer switch redirects energy from the AC mains supply directly to the load. When a problem is detected on the AC mains supply, the transfer switch routes power to the load from the battery. Switching to battery power usually takes a few milliseconds, at the end of which the power inverter starts supplying energy from the battery to the load. The offline UPS architecture is commonly used for residential applications such as personal computers. The typical power rating typically ranges from a few hundred watts to a few kilowatts.

4

Session Agenda 

Background Information



1kVA Offline UPS Reference Design − Overview



Software Integration



Special Algorithms



Summary

© 2006 Microchip Technology Incorporated. All Rights Reserved.

Offline UPS Reference Design using the dsPIC® DSC

Slide 5

We can now take a closer look at Microchip’s 1kVA Offline UPS Reference Design, starting with a high level overview.

5

1kVA Offline UPS Reference Design Specifications 





  



Input range AC: − 95 to 135V,60 HZ +/-3Hz − 210 to 242V,50 HZ +/-3Hz Output voltage AC: − 110V @ 60 Hz +/- 1Hz − 220V @ 50 Hz +/- 1Hz Transfer time: − < 10ms Adjustable charging current High Efficiency Pure Sine Wave Output, With THD < 3% Power Rating: − 1000 VA steady-state output power − 1350 VA peak power (Surge)

© 2006 Microchip Technology Incorporated. All Rights Reserved.

Offline UPS Reference Design using the dsPIC® DSC

Slide 6

The Offline UPS reference design comes in two versions. One version for 110V output and one version for 220V ouput. Both versions are rated for 1000VA continuous power and 1350VA surge power. In the Inverter mode, the system produces a pure sine wave output with a voltage THD less than 3%. The battery charger employs variable charging current depending on the charge state of the battery. The reference design uses a dsPIC33F “GS” series digital signal controller for complete digital control of all power stages. Use of the reference design is Royalty Free, and complete documentation, software, and hardware design information is available on the Microchip web site. Demonstration units are also available from worldwide Microchip sales offices.

6

Offline UPS Block Diagram Power Conversion Block 3 x 12V Batteries

36Vdc

Push-Pull DC-DC Converter

390/230VDC

Full-Bridge 220/110VAC Inverter

Relay Logic

Flyback Battery Charger

UPS Output

Load

UPS Input

Auxiliary Power Supply

dsPIC® DSC

AC Mains 220/110VAC

Legend Power Flow Signal Flow

LCD Controller PIC18F2420

USB Controller PIC18F2450

LCD Module

USB Port

Computer

User Interface Block © 2006 Microchip Technology Incorporated. All Rights Reserved.

Offline UPS Reference Design using the dsPIC® DSC

Slide 7

This slide shows a system-level block diagram of the Offline UPS. A single dsPIC33F “GS” series digital signal controller, shown in the center of the block diagram. It is used to control all the important functions of the offline UPS. The system is primarily divided into two sub-sections: 1) The power conversion block 2) The user interface block. These main sub-sections are discussed in more details on the next few slides.

7

Offline UPS Block Diagram

Power Conversion Block 3 x 12V Batteries

36Vdc

Push-Pull DC-DC Converter

390/230VDC

Full-Bridge 220/110VAC Inverter

Relay Logic

Flyback Battery Charger Auxiliary Power Supply

dsPIC® DSC

UPS Output

Load

UPS Input

AC Mains 220/110VAC

Legend Power Flow Signal Flow

© 2006 Microchip Technology Incorporated. All Rights Reserved.

Offline UPS Reference Design using the dsPIC® DSC

Slide 8

Breaking down the system block diagram further, we see a partial block diagram showing only the dsPIC DSC and the power conversion block. The power conversion block includes three power conversion stages, namely a push-pull DC-DC converter, a full-bridge inverter and a Flyback Battery charger. When AC Mains is present, the Relay logic is used to route the AC mains power directly to the load. During this time, the push-pull converter and full-bridge inverter are disabled. The flyback battery charger is enabled and the batteries are charged with a variable charging current. The dsPIC DSC controls the charging current supplied to the battery based on the battery state. When a power failure occurs, the relay is switched in the shortest possible time, and the push-pull converter and full-bridge inverter are enabled. Power is now supplied to the load from the battery. The Push-pull converter boosts the battery voltage to a high DC voltage, which is then converted to a sinusoidal voltage using the full bridge inverter. The dsPIC DSC is responsible for the control of all power conversion stages, detecting the presence or failure of the AC mains, and also the switching of the output relay logic. These are the most critical operations of the Offline UPS. The dsPIC DSC guarantees the delivery of high quality, uninterrupted power to the load at all times.

8

Offline UPS Block Diagram 3 x 12V Batteries

Auxiliary Power Supply

dsPIC® DSC

Legend Power Flow Signal Flow

LCD Controller PIC18F2420

USB Controller PIC18F2450

LCD Module

USB Port

Computer

User Interface Block

© 2006 Microchip Technology Incorporated. All Rights Reserved.

Offline UPS Reference Design using the dsPIC® DSC

Slide 9

The second half of the system block diagram contains the user interface block, comprising of an LCD display and a USB port. The dsPIC DSC is also responsible for all user interface functions shown on this page. The LCD module is used to display the mode of operation, battery state, the output RMS voltage and current, and the error condition if one has occurred. The USB interface is provided for power management, remote monitoring and data logging purposes. These user Interface functions are less time critical than the power conversion functions, and are therefore performed at a lower priority. All individual routines as well as the high-level software structure is described later in this presentation.

9

UPS Board Layout: Push-Pull Converter

© 2006 Microchip Technology Incorporated. All Rights Reserved.

Offline UPS Reference Design using the dsPIC® DSC

Slide 10

Now that we have seen a functional overview of the Offline UPS system, we can physically locate each section on a picture of the system itself. This is a top view of the Offline UPS Reference Design. Positions of each block of the system are highlighted as follows:

10

UPS Board Layout: Push-Pull Converter

dsPIC

© 2006 Microchip Technology Incorporated. All Rights Reserved.

Offline UPS Reference Design using the dsPIC® DSC

Slide 11

1. dsPIC DSC on the left-center of the board.

11

Current Sensor

Full-Bridge Inverter

Output Filter

dsPIC

© 2006 Microchip Technology Incorporated. All Rights Reserved.

Offline UPS Reference Design using the dsPIC® DSC

Output Relay

UPS Board Layout: Push-Pull Converter

Slide 12

2. Full-bridge Inverter on the top right.

12

Current Sensor

Full-Bridge Inverter

Output Filter

dsPIC

Output Relay

UPS Board Layout: Push-Pull Converter

DC Link Filter Push-Pull Primary Side

© 2006 Microchip Technology Incorporated. All Rights Reserved.

Push-Pull Secondary Side

Offline UPS Reference Design using the dsPIC® DSC

Slide 13

3. Push-pull Converter on the bottom left and center right

13

Current Sensor

Full-Bridge Inverter

Output Filter

dsPIC

Output Relay

UPS Board Layout: Push-Pull Converter

DC Link Filter Push-Pull Primary Side

© 2006 Microchip Technology Incorporated. All Rights Reserved.

Push-Pull Secondary Side

Flyback Battery Charger

Offline UPS Reference Design using the dsPIC® DSC

Slide 14

4. Flyback Battery Charger on the bottom right

14

USB Controller

LCD Controller

Auxiliary Power Supply

Current Sensor

Full-Bridge Inverter

Output Filter

dsPIC

Output Relay

UPS Board Layout: Push-Pull Converter

DC Link Filter Push-Pull Primary Side

© 2006 Microchip Technology Incorporated. All Rights Reserved.

Push-Pull Secondary Side

Flyback Battery Charger

Offline UPS Reference Design using the dsPIC® DSC

Slide 15

5. User Interface circuitry on the top left of the board.

15

Session Agenda 

Background Information



1kVA Offline UPS Reference Design − Full-Bridge Inverter



Software Integration



Special Algorithms



Summary

© 2006 Microchip Technology Incorporated. All Rights Reserved.

Offline UPS Reference Design using the dsPIC® DSC

Slide 16

We can now study each of these blocks in more detail. The first sub-section on the agenda is the full-bridge inverter.

16

Full Bridge Inverter

IGBT

IGBT

IGBT

IGBT

VAC

VIN

© 2006 Microchip Technology Incorporated. All Rights Reserved.

-

Offline UPS Reference Design using the dsPIC® DSC

Slide 17

The basic circuit diagram of the full-bridge inverter is as shown on this page. Four semiconductor switches are used, connected in a bridge configuration. Usually IGBTs are preferred over MOSFETs due to better EMI and RFI performance characteristics. Four PWM outputs are required to drive each of the IGBTs of the full-bridge. The input voltage must be greater than the peak of sinusoidal output voltage, or greater than 1.414 times the RMS AC voltage. As the maximum voltage across the IGBT can be Vin, the switch voltage rating must be greater than VIN.

17

Full Bridge Inverter

IGBT

IGBT

IGBT

IGBT

VAC

VIN



Four switches are required



Four PWM outputs are required



VIN > VAC(RMS)*1.414



Switch voltage rating > VIN

© 2006 Microchip Technology Incorporated. All Rights Reserved.

-

Offline UPS Reference Design using the dsPIC® DSC

Slide 18

Four semiconductor switches are used, connected in a bridge configuration. Usually IGBTs are preferred over MOSFETs due to better EMI and RFI performance characteristics. Four PWM outputs are required to drive each of the IGBTs of the full-bridge. The input voltage must be greater than the peak of sinusoidal output voltage, or greater than 1.414 times the RMS AC voltage. As the maximum voltage across the IGBT can be Vin, the switch voltage rating must be greater than VIN.

18

Full-Bridge Inverter: Unipolar Switching PWM1H

PWM2H

VAC VIN

+Vref(f1)

Vtri(fs)

PWM1L

PWM2L

-Vref(f1)

+Vref > Vtri

PWM1H

PWM1L

-Vref > Vtri

PWM2H

PWM2L © 2006 Microchip Technology Incorporated. All Rights Reserved.

Offline UPS Reference Design using the dsPIC® DSC

Slide 19

There are various switching techniques that can be utilized for the full-bridge inverter. The Offline UPS Reference Design uses the Unipolar Switching methodology as described on this slide. The unipolar switching technique uses two sinusoidal references for each leg of the full-bridge. The two sinusoidal references are exactly 180 degrees out of phase. PWM1H/PWM1L and PWM2H/PWM2L form complementary, center-aligned PWM pairs. When PWM1H and PWM2L are ON, the output voltage is +VIN. On the other hand, when PWM2H and PWM1L are ON, the output voltage is –VIN. When the both top IGBTs or both bottom IGBTs are ON, the voltage across output LC filter is zero. Due to the presence of the zero state, unipolar switching is also known as 3-level control. The advantage of unipolar switching is that this switching technique reduces the harmonic content in the output voltage, which in turn helps to reduce the size of the output LC filter. The disadvantage of unipolar switching is that it requires complex drive signals. However, the dsPIC DSC makes this implementation very simple, with its built-in support for center-aligned and complementary PWM modes.

19

Full Bridge Sine Wave Inverter Inverter Full-Bridge

Lac Cac

VDC

Loads

PWM1

PWM2

IGBT

PWM Module

IAC

VACinv

VDC

A to D Converter

Digital Control System

Digital Signal Controller © 2006 Microchip Technology Incorporated. All Rights Reserved.

Offline UPS Reference Design using the dsPIC® DSC

Slide 20

This page shows the interface of the dsPIC DSC with the full-bridge inverter. Four PWM signals are used for driving the full-bridge inverter. In addition to the PWM signals, we also need to measure the sinusoidal output voltage and current. These signals are fed into the High-speed 10-bit ADC of the dsPIC DSC. An additional analog input is used for measuring the DC input voltage for the Inverter. The ADC on the dsPIC33F “GS” series of devices has flexible triggering options. The ADC conversions can be triggered directly by the PWM. This feature ensures that the ADC conversion results are not affected by any switching noise present in the circuit. The dsPIC DSC also has dedicated sample and hold circuits and dual ADC blocks that enable simultaneous sampling and conversion of the current and voltage feedback. The analog inputs measured by the ADC are then used by the digital control system, to produce a new duty cycle value. This duty cycle value is provided to the PWM module, which in turn produces the desired output voltage. The control scheme used for the full-bridge inverter is described on the next slide.

20

Inverter Control Loop: Current Mode Control PWM D*VDC

VREF PI

Output Filter

VOUT

P

ADC 1011001010

S&H

1011001010

S&H

Note : D is the duty VDC is input voltage © 2006 Microchip Technology Incorporated. All Rights Reserved.

Offline UPS Reference Design using the dsPIC® DSC

Slide 21

The Full-Bridge Inverter uses average current mode control to achieve fast transient response and also a low output THD. The inverter control scheme uses a Proportional-Integral, or PI compensator for the voltage loop, A Proportional, or P type compensator is used for the current loop. These compensators are implemented in software as difference equations. The dsPIC DSC features single cycle multiply and fast divide instructions with prefetch, and two 40-bit accumulators to enable fast and accurate computations needed for any control loop. The measured output voltage is compared with a sinusoidal reference voltage that is obtained from a lookup table stored in the device memory. Then the voltage error is passed through the PI compensator, and a current reference value is generated. This current reference value is compared with the measured current, and the error is passed through the P-type compensator. The result of the P-type compensator is scaled and clamped to the min and max limits, and then fed to the PWM generator to produce the necessary output voltage.

21

Session Agenda 

Background Information



1kVA Offline UPS Reference Design − Push-Pull Converter



Software Integration



Special Algorithms



Summary

© 2006 Microchip Technology Incorporated. All Rights Reserved.

Offline UPS Reference Design using the dsPIC® DSC

Slide 22

The next hardware block we will visit is the Push-pull converter.

22

Push-Pull DC-DC Converter IL

Period

VDC

Tx L

Q1

+

Rectifier

C

IQ1

Q2

IQ2

VIN Q1

Q2 2*VIN

VQ1



Switch voltage rating > 2*VIN



Switch current rating > PIN/VIN Low side MOSFET drive is required

  

Two switches are required Push-Pull mode of PWM is required

© 2006 Microchip Technology Incorporated. All Rights Reserved.

-

IQ1

IQ2

IL

Offline UPS Reference Design using the dsPIC® DSC

Slide 23

The Full-bridge inverter needs an input voltage greater than the peak value of the output sine wave. Therefore, the 36V battery voltage is stepped up to a high DC link voltage using the push-pull converter. Two switches are used, with voltage rating greater than twice the input voltage. The switch current rating must be greater than the input power over the input voltage. The full load current that is supplied from the battery may be as high as 40A. Therefore MOSFETs with the lowest possible Rds(on) rating must be selected. Two PWM signals are required in the push-pull mode of operation. A diode bridge is used to rectify the secondary transformer voltage, before smoothing it to a DC voltage using an LC filter. The operation of the push-pull converter is summarized in the waveforms shown on this slide.

23

Push-Pull Boost Converter VDC

VIN

12V x3

LOAD

Q2

Q1

PWM2

PWM1

OR

VIN

IQ1/IQ2

PWM Module

VDC

A to D Converter

Digital Control System

dsPIC® DSC © 2006 Microchip Technology Incorporated. All Rights Reserved.

Offline UPS Reference Design using the dsPIC® DSC

Slide 24

The push-pull converter needs two PWM drive signals and up to three analog inputs. The block diagram on this page shows the interface of the dsPIC DSC with the push-pull converter. The dsPIC DSC provides a built-in mode for pushpull PWM. Another important feature to note is that the dsPIC33F “GS” series of devices also supports multiple time-bases. Therefore each power converter in the system can be designed to operate at its optimum switching frequency. In the Offline UPS, the inverter is operated at 50khz while the push-pull converter is operated at 100kHz. The output voltage of the push-pull converter is measured by the ADC for the control loop, while the primary switch currents are measured for overcurrent protection. The battery voltage is also measured to ensure that the converter is operated within its specified operating conditions.

24

Push-Pull Control Loop: Voltage Mode Control PWM

VREF

D*VIN

Output Filter

VDC

PID

ADC 1011001010

S&H

Note : D is the duty VIN is input voltage © 2006 Microchip Technology Incorporated. All Rights Reserved.

Offline UPS Reference Design using the dsPIC® DSC

Slide 25

The push-pull converter control system is implemented as Voltage mode control. Therefore, only voltage feedback is used for the control loop. This method is cost effective as no current sensor is required. A PID-type compensator is used for the control loop, and is implemented as a difference equation in software. The result of the control loop computation modifies the duty cycle and therefore maintains a clean, DC output voltage.

25

Session Agenda 

Background Information



1kVA Offline UPS Reference Design − Flyback Battery Charger



Software Integration



Special Algorithms



Summary

© 2006 Microchip Technology Incorporated. All Rights Reserved.

Offline UPS Reference Design using the dsPIC® DSC

Slide 26

The final power conversion block that we will look at is the Flyback Battery Charger.

26

Flyback Battery Charger

3x12V Batteries

VDC

© 2006 Microchip Technology Incorporated. All Rights Reserved.

Offline UPS Reference Design using the dsPIC® DSC

Slide 27

The basic flyback converter circuit is shown on this slide. The flyback converter is designed for a maximum of 100W operation. This gives a maximum of 2.5A of battery charging current. The flyback converter does not need an output inductor or freewheeling diode, and is a very cost-effective topology. The flyback topology is therefore very popular for power converters less than 150W. The battery charger in the Offline UPS Reference Design is designed as a constant current generator. The charging current is determined by the state of the battery, which in turn is defined by the battery voltage.

27

Flyback Battery Charger

+ -

3x12V Batteries

PWM1

VDC

Ibat

PWM Module

Vbat

A to D Converter

Digital Control System

dsPIC® DSC © 2006 Microchip Technology Incorporated. All Rights Reserved.

Offline UPS Reference Design using the dsPIC® DSC

Slide 28

As shown in the diagram, the battery voltage and charging current are both measured using the high-speed 10-bit ADC available on the dsPIC DSC. A PWM signal is used to drive the switching MOSFET to obtain the desired charging current.

28

Battery Charger Control Scheme: Incremental Control

© 2006 Microchip Technology Incorporated. All Rights Reserved.

Offline UPS Reference Design using the dsPIC® DSC

Slide 29

The battery charging control loop is implemented as an incremental control system. The battery state is first determined by the measured battery voltage. Then, the desired charging current is calculated and used as a reference. The current reference is compared with the measured charging current to obtain the current error. If a positive error is detected, the duty cycle is decremented by a fixed number. If a negative error is detected, the duty cycle is incremented by the same fixed number.

29

Battery Charging Profile Charging Curent

Charging Off

Trickle Charging State

Bulk Charging State

Over Charging State

Float Charging State

Charging Off

2.25A

0.1A

30V

35.7V

40.5V

43.2V

45V

Note: Not drawn to scale

© 2006 Microchip Technology Incorporated. All Rights Reserved.

Offline UPS Reference Design using the dsPIC® DSC

Slide 30

The battery charging current is calculated based on the battery charging profile as shown in this diagram. The various states of the battery and the corresponding voltages are listed on the graph.

30

Session Agenda 

Background Information



1kVA Offline UPS Reference Design



Software Integration



Special Algorithms



Summary

© 2006 Microchip Technology Incorporated. All Rights Reserved.

Offline UPS Reference Design using the dsPIC® DSC

Slide 31

In the session so far, we studied the specifications and hardware of Microchip’s 1kVA Offline UPS Reference Design. The remaining portion of this web seminar talks about the UPS software in more detail.

31

Software Integration Offline UPS Software UPS State Machine (Interrupt based)

User Interface Software

Priority: Medium Execution Rate: Medium

Power Conversion Algorithms (Interrupt based)

Priority: Low Execution rate: Low

Priority: High Execution Rate: High

© 2006 Microchip Technology Incorporated. All Rights Reserved.

Offline UPS Reference Design using the dsPIC® DSC

Slide 32

We shall take a top-down approach to understand the software structure. This diagram shows the high-level partitions for the Offline UPS software. Each block represents a functional piece of software that pertains to one of the subsections of the UPS system. As seen from the diagram, the UPS software is first split into the UPS State machine and the User Interface Software. The State Machine software determines the mode of operation for the UPS, detects the presence or failure of the AC Mains, and also executes all the power conversion algorithms.

32

Software Integration Offline UPS Software UPS State Machine (Interrupt based)

User Interface Software

Priority: Medium Execution Rate: Medium

Power Conversion Algorithms (Interrupt based)

Priority: Low Execution rate: Low

Priority: High Execution Rate: High

© 2006 Microchip Technology Incorporated. All Rights Reserved.

Offline UPS Reference Design using the dsPIC® DSC

Slide 33

Within the state machine, the power conversion algorithms are assigned the highest priority. The other state machine code forms the next level, or medium priority. The other side of the top-level partition includes the User Interface Software. This software controls the LCD display and the USB communications. The user interface software uses data from the State machine such as mode of operation, battery state, error conditions etc. to be displayed on the LCD or communicated via USB. The user interface software is assigned the lowest priority of execution, as most of these functions are not time critical.

33

Offline UPS State Machine System Start-up

Inverter Mode

State Machine

Battery Charger Mode

System Error © 2006 Microchip Technology Incorporated. All Rights Reserved.

Offline UPS Reference Design using the dsPIC® DSC

Slide 34

The UPS State machine consists of four main operating modes: 1. System Startup: During this mode, the state of the system is unknown. Therefore, all system variables such as battery voltage and state of AC Mains is first determined. Then, based on the information collected, the state machine determines which mode the UPS should switch to. 2. Battery charger Mode: If AC Mains is present, the system is switched to the battery charger mode. The flyback converter is enabled and the battery is charged with variable charging current based on the battery state. The mode of operation and battery state is displayed on the LCD module. 3. Inverter Mode: If an AC mains failure occurs, the system is switched to the Inverter mode. This switch-over is accomplished in as little time as possible and the push-pull converter and full-bridge inverter are enabled. In this mode, the UPS provides power to the load from the batteries. If AC mains returns, the system switches back to the battery charger mode, also in the shortest time possible. 4. System Error: If the battery is discharged or if the system is overloaded or operated outside the specified limits, the UPS state machine initiates the system error mode. In this mode, all power conversion blocks are turned OFF and the error condition is displayed on the LCD module.

34

Power Conversion Algorithms

© 2006 Microchip Technology Incorporated. All Rights Reserved.

Offline UPS Reference Design using the dsPIC® DSC

Slide 35

Depending on the mode of operation of the UPS, different power conversion routines are executed within the State machine. Although each power conversion stage is implemented differently, each one has a structure similar to the one shown on this slide.

35

Power Conversion Algorithms Start

© 2006 Microchip Technology Incorporated. All Rights Reserved.

Offline UPS Reference Design using the dsPIC® DSC

Slide 36

The power conversion algorithms start off with initialization of all system resources and peripherals.

36

Power Conversion Algorithms Start

Initialization

© 2006 Microchip Technology Incorporated. All Rights Reserved.

Offline UPS Reference Design using the dsPIC® DSC

Slide 37

37

Power Conversion Algorithms Start

Initialization Enable Peripherals

© 2006 Microchip Technology Incorporated. All Rights Reserved.

Offline UPS Reference Design using the dsPIC® DSC

Slide 38

38

Power Conversion Algorithms Start

Initialization Enable Peripherals

Fault Present ?

© 2006 Microchip Technology Incorporated. All Rights Reserved.

Offline UPS Reference Design using the dsPIC® DSC

Slide 39

A fault check routine is executed periodically.

39

Power Conversion Algorithms Start

Initialization Enable Peripherals

Fault Present ? Idle Loop (Normal Operation)

© 2006 Microchip Technology Incorporated. All Rights Reserved.

Offline UPS Reference Design using the dsPIC® DSC

Slide 40

A fault check routine is executed periodically.

40

Power Conversion Algorithms Start

Initialization Enable Peripherals

Fault Present ? Idle Loop (Normal Operation)

© 2006 Microchip Technology Incorporated. All Rights Reserved.

Fault Loop

Offline UPS Reference Design using the dsPIC® DSC

Slide 41

A fault check routine is executed periodically.

41

Power Conversion Algorithms Start

Initialization Enable Peripherals

Fault Present ? Idle Loop (Normal Operation)

Fault Loop

ADC Interrupt © 2006 Microchip Technology Incorporated. All Rights Reserved.

Offline UPS Reference Design using the dsPIC® DSC

Slide 42

After the fault check, execution proceeds to an idle loop where the software waits for an ADC interrupt to occur. Inside the ADC interrupt, the most recent voltage and currents are measured and used for the control loops. The control loops are executed inside the ADC interrupt routine and the PWM output is modified accordingly. This structure ensures the fastest performance, and the highest execution priority.

42

Session Agenda 

Background Information



1kVA Offline UPS Reference Design



Software Integration



Special Algorithms − Switch-over



Summary

© 2006 Microchip Technology Incorporated. All Rights Reserved.

Offline UPS Reference Design using the dsPIC® DSC

Slide 43

For the next topic, we will cover some special algorithms implemented in the Offline UPS. These algorithms are unique to a UPS application and help to achieve higher performance without adding any cost to the system. The first such special algorithms we will look at are the Switch-over routines.

43

Switch – Mains to Inverter

Inverter Output

Inverter Mode

DC Link Voltage

© 2006 Microchip Technology Incorporated. All Rights Reserved.

Offline UPS Reference Design using the dsPIC® DSC

Slide 44

The Mains to Inverter switch-over routine is executed when a power failure happens.

44

Switch – Mains to Inverter Mains Failure Occurred

Inverter Output

DC Link Voltage

© 2006 Microchip Technology Incorporated. All Rights Reserved.

Offline UPS Reference Design using the dsPIC® DSC

Slide 45

As this event is usually unpredictable, there is always a short duration when the power to the load is interrupted. The key here is to ensure that the inverter turns ON as quickly as possible, usually within the hold-up time allowed by the load. The Mains to inverter switch-over sequence is executed as follows:

45

Switch – Mains to Inverter Mains Failure Occurred

Mains Failure Detected

Inverter Output

DC Link Voltage

© 2006 Microchip Technology Incorporated. All Rights Reserved.

Offline UPS Reference Design using the dsPIC® DSC

Slide 46

1. Software checks AC mains: Mains voltage is compared with a mains reference array stored in the device memory. If a voltage difference is larger than +-20V continuously for 1 millisecond, then a Mains failure is detected.

46

Switch – Mains to Inverter Mains Failure Occurred

Mains Failure Detected Inverter Turns ON

Inverter Output

Inverter Mode

DC Link Voltage

© 2006 Microchip Technology Incorporated. All Rights Reserved.

Offline UPS Reference Design using the dsPIC® DSC

Slide 47

2. Switching to Inverter: As soon as the Mains failure is detected, the output relay is switched to disconnect the AC mains from the UPS output. The battery charger is disabled and the push-pull converter is enabled. A soft start routine is executed and the DC Link voltage is ramped up to 390Vdc in a 220Vac system, or 230Vdc in a 110Vac system. 3. Inverter is enabled: At the end of the soft-start routine, the voltage at the inverter output is measured again. Based on the measured voltage, the inverter is also started at close to the same output voltage. This is accomplished by a binary search algorithm to find the appropriate sample point from the sinusoidal reference lookup table.

47

Switch –Inverter to Mains

AC Mains

Inverter

© 2006 Microchip Technology Incorporated. All Rights Reserved.

Offline UPS Reference Design using the dsPIC® DSC

Slide 48

Just as the AC mains can fail at any time, it can also resume at any time. Therefore when the UPS is operating in the inverter mode, the state machine keeps polling the AC mains to determine if mains power has been restored. The Inverter to Mains switch-over sequence is executed as follows:

48

Switch –Inverter to Mains High Voltage detect

AC Mains

Inverter

© 2006 Microchip Technology Incorporated. All Rights Reserved.

Offline UPS Reference Design using the dsPIC® DSC

Slide 49

1. Mains High Voltage Detection: In the first step, the software checks if a high voltage is detected on the AC mains. If a high voltage is detected consecutively for about 5 ms, the software goes to the next step in the sequence.

49

Switch –Inverter to Mains High Voltage detect

ZCD detect

AC Mains

Inverter

© 2006 Microchip Technology Incorporated. All Rights Reserved.

Offline UPS Reference Design using the dsPIC® DSC

Slide 50

2. Zero Crossing Detection: After a high voltage has been detected, the software checks for a zero-crossing on the AC mains. As soon as the zero-crossing is detected, the switch-over sequence proceeds to the next step, that is to start data collection.

50

Switch –Inverter to Mains Starts Mains data collection High Voltage detect

ZCD detect

AC Mains

Inverter

© 2006 Microchip Technology Incorporated. All Rights Reserved.

Offline UPS Reference Design using the dsPIC® DSC

Slide 51

3. Mains Data Collection: After the first zero-crossing was detected, the software now starts accumulating the measured voltage in a data array. As the frequency of the AC mains is unknown, the end of a sine wave cycle is determined by zero crossing detections. The collected data is then averaged over four sine wave cycles.

51

Switch –Inverter to Mains ZC Aligned

Starts Mains data collection High Voltage detect

ZCD detect

Data collection complete

AC Mains

Inverter

Inverter frequency Modified © 2006 Microchip Technology Incorporated. All Rights Reserved.

Offline UPS Reference Design using the dsPIC® DSC

Slide 52

4. Synchronization routine: After the data collection has been completed, the UPS software now tries to synchronize the Inverter output with the AC mains. This is accomplished by modifying the inverter frequency so that the zero crossing of the inverter output and the zero crossing of the AC mains eventually occurs at the same instant.

52

Switch –Inverter to Mains ZC Aligned

Starts Mains data collection High Voltage detect

ZCD detect

Data collection complete

AC Mains

Inverter

Inverter frequency Modified © 2006 Microchip Technology Incorporated. All Rights Reserved.

Offline UPS Reference Design using the dsPIC® DSC

Inverter turned OFF Slide 53

5. Switch to Mains: Finally, when both voltages are aligned at the zero crossing, the switch-over is initiated and the inverter is turned OFF. However, since the output relay has finite switching time, the zero crossing is actually predicted by the software, and the relay is engaged a little prior to the actual alignment. As a result, the inverter to mains switch-over happens almost instantaneously and there is no interruption of power to the load.

53

Session Agenda 

Background Information



1kVA Offline UPS Reference Design



Software Integration



Special Algorithms − Operation with Rectifier Load



Summary

© 2006 Microchip Technology Incorporated. All Rights Reserved.

Offline UPS Reference Design using the dsPIC® DSC

Slide 54

The final algorithm described in this webinar is the operation of the UPS with a Rectifier Load.

54

Inverter Operation with Rectifier Loads Typical Rectifier Load

Offline UPS

 

220V, 50Hz

+

L o a d

When load switch is closed, output capacitor draws huge inrush current This type of load step appears as a short circuit on the UPS output

© 2006 Microchip Technology Incorporated. All Rights Reserved.

Offline UPS Reference Design using the dsPIC® DSC

Slide 55

An Offline UPS is often used to power computers or other electronic equipment. Such loads to the UPS typically contain switch-mode power supplies with a front-end PFC stage. However, older systems or low power systems may not implement PFC on the front end. If many such systems are connected to the UPS output in parallel, then the resulting load appears to be of a highly capacitive nature. An example of such a rectifier load is shown in the diagram on this slide. When the switch is closed for the first time, a huge inrush current is drawn by the load capacitor to charge up to the rectified DC voltage. This inrush current can even be 20 times the rated current of the UPS. Such a type of load poses a problem, because the UPS system must be designed to support the load without adding to the cost. One solution may be to over-design the components of the UPS so that they can handle such a high inrush current. Another solution may be to add a series resistor or NTC to limit the inrush current. Both these solutions are not desired, as they add cost to the system and may also compromise the UPS performance. Instead, the dsPIC DSC helps to easily solve this problem in software.

55

Inverter Operation with Rectifier Loads

Inverter Output Voltage

Inverter Output Current

© 2006 Microchip Technology Incorporated. All Rights Reserved.

Offline UPS Reference Design using the dsPIC® DSC

Slide 56

The waveform shown on this page demonstrates the operation of the UPS when a rectifier load is connected to the UPS output.

56

Inverter Operation with Rectifier Loads

Inverter Output Voltage

Large Inrush Current causes fault

Inverter Output Current

© 2006 Microchip Technology Incorporated. All Rights Reserved.

Offline UPS Reference Design using the dsPIC® DSC

Slide 57

As soon as the load is connected, a large inrush current is drawn from the inverter output. The dsPIC DSC has built-in PWM fault modes that turn OFF the PWM outputs almost instantaneously when a fault is detected. As a result, the inverter output voltage drops to zero.

57

Inverter Operation with Rectifier Loads

Inverter Output Voltage

Inverter Output Current

© 2006 Microchip Technology Incorporated. All Rights Reserved.

Fault Recovery Routine increments PWM duty cycle in small steps and charges load capacitor

Offline UPS Reference Design using the dsPIC® DSC

Slide 58

After the fault has been detected, the UPS fault handling software re-enables the PWM, but with a very small duty cyde. This small duty cycle ensures that the current drawn is small. Subsequently, the duty cycle is incremented in small steps and the output load capacitor is charged up in a controlled fashion.

58

Inverter Operation with Rectifier Loads Inverter Control Loop resumes when output voltage matches sine reference

Inverter Output Voltage

Inverter Output Current

© 2006 Microchip Technology Incorporated. All Rights Reserved.

Offline UPS Reference Design using the dsPIC® DSC

Slide 59

Finally, when the inverter output voltage becomes equal to the sinusoidal reference, the inverter control loop is resumed for normal operation. With this simple routine, the dsPIC DSC easily enables the support of rectifier loads without adding to the cost of the system.

59

Session Agenda 

Background Information



1kVA Offline UPS Reference Design



Software Integration



Special Algorithms



Summary

© 2006 Microchip Technology Incorporated. All Rights Reserved.

Offline UPS Reference Design using the dsPIC® DSC

Slide 60

So to conclude this webinar, let us look at a summary of what we learned.

60

Summary 



Microchip’s 1kVA Offline UPS Reference Design is a full digital UPS with hardware and software provided for free The dsPIC DSC controls: − Power Conversion Routines − UPS State Machine − User Interface Routines

 

Unique algorithms implemented provide performance boost and reduce cost The dsPIC DSC simplifies the design and control of an Offline UPS system

© 2006 Microchip Technology Incorporated. All Rights Reserved.

Offline UPS Reference Design using the dsPIC® DSC

Slide 61

Microchip’s 1kVA Offline UPS Reference Design is a full digital UPS with hardware and software provided for free. All functions including the power conversion, state machine and user interface tasks are easily accomplished with a single dsPIC DSC. Unique algorithms are easily implemented using the dsPIC DSC and provide a performance boost while reducing the overall system cost. The dsPIC DSC therefore simplifies the design of an Offline UPS system.

61

Thank You  

Link to Offline UPS Reference Design: www.microchip.com/offlineups Available for Free Download: − Application note AN1279 − Complete Source code − PCB Design files



Visit www.microchip.com/smps for more design resources

© 2006 Microchip Technology Incorporated. All Rights Reserved.

Offline UPS Reference Design using the dsPIC® DSC

Slide 62

Thank you for joining me in this webinar on the Offline UPS Reference Design using the dsPIC DSC. Please visit the links on this page for more useful resources.

62