1000w Inverter PURE SINE WAVE Schematic Diagram
1000w Inverter PURE SINE WAVE Schematic Diagram
1000w Inverter PURE SINE WAVE Schematic Diagram
Sagar Khare
Mohammad Kamil
Microchip Technology Inc.
UPS OVERVIEW
An Uninterruptible Power Supply, or UPS, is an
electronic device that provides an alternative electric
power supply to connected electronic equipment when
the primary power source is not available.
Unlike auxiliary power, a UPS can provide instant
power to connected equipment, which can protect
sensitive electronic devices by allowing them to shut
down properly and preventing extensive physical
damage. However, a UPS can only supply energy for a
limited amount of time, typically 15 to 20 minutes.
Although its use can extend to a virtually unlimited list
of applications, in past years the UPS has become
even more popular as a means of protecting computers
and telecommunication equipment, thus preventing
serious hardware damage and data loss.
OFFLINE UPS
An Offline UPS system (see Figure 1), redirects the
electric energy received from the AC input to the load
and only switches to providing power from the battery
when a problem is detected in the utility power. Performing this action usually takes a few milliseconds,
during which time the power inverter starts supplying
electric energy from the battery to the load.
FIGURE 1:
AC Input
Load
Inverter
Charger
Battery
DS01279A-page 1
AN1279
LINE-INTERACTIVE UPS
FIGURE 3:
FIGURE 2:
AC Input
Load
Battery
Static Switch
AC Input
Load
Inverter
Battery
Legend:
Inverter
Rectifier/
Charger
LINE-INTERACTIVE UPS
DIAGRAM
Normal mode
Stored-energy mode
ONLINE UPS
An Online UPS (see Figure 3), combines the two basic
technologies of the previously described UPS models,
with rectifiers and inverter systems working all of the
time. As is the case with a Line-Interactive UPS, the
power transfer is made instantly as an outage occurs,
with the rectifier simply being turned off while the
inverter draws power from the battery. As utility power
is again established, the inverter continues to supply
power to the connected devices, while the rectifier
resumes its activity, recharging the battery. This design
is sometimes fitted with an additional transfer switch for
bypass during a malfunction or overload.
SYSTEM SPECIFICATIONS
The reference design in this application note describes
the design of an Offline Uninterruptible Power Supply
(UPS) using a Switch Mode Power Supply (SMPS)
dsPIC Digital Signal Controller (DSC).
The Offline UPS Reference Design consists of three
major UPS topology blocks:
Push-Pull Converter (steps up the DC battery voltage to a constant high-voltage DC)
Full-Bridge Inverter (converts DC voltage to a
sinusoidal AC output)
Flyback Switch Mode Charger (current source
and charges battery with constant current)
The input and output specifications are shown in
Table 1.
TABLE 1:
I/O SPECIFICATIONS
DC Input
UPS Output
Rating
Input Filtering
EMI/RFI filtering
DS01279A-page 2
AC Input
DC Input
UPS Output
Rating
Input Filtering
EMI/RFI filtering
AN1279
1 kVA OFFLINE UPS REFERENCE
DESIGN
FIGURE 4:
220 VAC,
50 Hz
DPDT
Relay
EMI Filter
Load
220 VAC
Constant Current
Battery
3 X 12 VDC
Flyback Switch
Mode Charger
Push-Pull
DC/DC
Converter
LC Filter
380 VDC
Full-Bridge
Inverter/
Rectifier
DS01279A-page 3
AN1279
Listing of I/O Signals for Each Block,
Type of Signal, and Expected Signal
Levels
PUSH-PULL CONVERTER
As specified in Figure 5, measurement of DC output
voltage (UDCM) is required to implement the control
algorithm. The EPP signal is for enabling the driver, the
FIGURE 5:
UBAT
IPM
PGND
UDCM-
UCDM
IP
DRIVER
EPP
Temperature
Sensor
ADC
ADC
ADC
ADC
I/O
PWM
PWM
UB
dsPIC33FJ16GS504
TABLE 2:
dsPIC DSC
Resources Used
Analog
AN3
2.99V
IP
Analog
AN2
0V-1.65V
Analog
AN8
0V-3.3V
UB
Analog
AN5
1.5V-1.98V
RB6
Digital
PWM3H, PWM3L
Signal Name
UDCM
EPP
Push-Pull Gate Drive
DS01279A-page 4
AN1279
FULL-BRIDGE INVERTER
The block diagram in Figure 6 illustrates that
measurement of the AC output voltage (ACO) is
required to implement the control algorithm. With
measurement of the output current (I), that current can
be limited to prevent overloading of the converter. The
presence of power grid voltage is detected with
measurement of (ACI) voltage. When power grid
voltage fails, signal A2 turns off the relay K2 and
prevents power flow to the line when the UPS is
operational. Signal A1 controls the K1 relay, which is off
when DC link voltage is low to prevent current inrush in
FIGURE 6:
UDC+
PGND
S5
S6
A2 (Mains Relay)
R
ACI1M
Power Grid
ACI2M
I
FLT_CLR
FAULT/SD
SYS_FLT
S4
FLT_CLR
FAULT/SD
SYS_FLT
DRIVER
S3
ACO1M
ACO2M
Load
I/O
ADC
PWM
PWM
I/O
I/O
I/O
PWM
PWM
DRIVER
ADC
ACO
KF(1)
ACI
KG(1)
I/O
dsPIC33FJ16GS504
Note 1:
ADC
KF and KG are feedback gain circuits. Refer to Appendix D: Schematics and Board Layout for details.
TABLE 3:
Signal Name
Type of Signal
dsPIC DSC
Resources Used
ACO
Analog
AN1
0.27V-3.3V
ACI
Analog
AN11
0.15V-3.16V
Analog
AN0
2.5V (nominal)
Digital output
RC10
A2
Digital output
RC0
FLT_CLR
Digital output
RB7
FAULT/SD
RC13 (INT1)
SYS_FLT
Digital input
RC8
PWM output
PWM1H, PWM1L
PWM output
PWM2H, PWM2L
A1
DS01279A-page 5
AN1279
FLYBACK SWITCH MODE CHARGER
The block diagram in Figure 7 shows that an analog
current controller is used for battery charging. Four signals are needed: EFB signal for enabling topswitch, (IB)
for measuring battery charging current, (UB) for measuring battery voltage and IREF for reference set with
PWM4L output.
FIGURE 7:
UDC+
UBAT
K3(1)
PGND
Flyback
transformer
PGND
UFEEDBACK
+15V
K4(1)
PI
TOPSWITCH
45V
ENABLE
EFB
UB
-
PI
IERROR
IFEEDBACK
IREF
IB
ADC
ADC
PWM
I/O
dsPIC33FJ16GS504
Analog Controller
Note 1:
K1 and K2 are feedback gain circuits. Refer to Appendix D: Schematics and Board Layout for details.
TABLE 4:
Signal Name
Type of Signal
dsPIC DSC
Resources Used
IBATM
Analog
AN4
0V-1.67V
UBAT
Analog
AN5
1.5V-2V
EFB
Digital output
RC7
IREF
PWM output
PWM4L
DS01279A-page 6
AN1279
DC/DC CONVERTER
Forward Converter
A forward converter, which can be a step-up or stepdown converter, is shown in Figure 8. When the
transistor Q is ON, VIN appears across the primary, and
then generates output voltage determined by
Equation 1.
Forward Converter
Push-Pull Converter
Half-Bridge Converter
Full-Bridge Converter
Flyback Converter
FIGURE 8:
FORWARD CONVERTER
T
+
D1
+
D2
VIN
VOUT
-
D3
EQUATION 1:
Vout Vin
N2
d
N1
DS01279A-page 7
AN1279
Push-Pull Converter
FIGURE 9:
PUSH-PULL CONVERTER
D1
T1
+
+ VIN
+
+
+ VOUT
L1
C2
0V
+
D2
C1
Q1
Q2
0V
EQUATION 2:
Vout 2 Vin
N2
d
N1
where:
d is the duty cycle of the transistors and 0 < d < 0.5
N2/N1 is the secondary-to-primary turns ratio of
the transformer
DS01279A-page 8
AN1279
Half-Bridge Converter
The half-bridge converter (see Figure 10) is similar to
the push-pull converter, but a center-tapped primary is
not required. The reversal of the magnetic field is
achieved by reversing the direction of the primary winding current flow. In this case, two capacitors. C1 and
C2, are required to form the DC input mid-point. Transistors Q1 and Q2 are turned ON alternately to avoid a
supply short circuit, in which case the duty cycle, d,
must be less than 0.5.
For the half-bridge converter, the output voltage VOUT
equals that of Equation 3.
FIGURE 10:
HALF-BRIDGE CONVERTER
+VIN
C1
D1
T1
Q1
+VOUT
+
+
C3
+
0V
C2
L1
+
Q2
D2
0V
EQUATION 3:
Vout Vin
N2
d
N1
where:
d is the duty cycle of the transistors and 0 < d < 0.5
N2/N1 is the secondary-to-primary turns ratio of
the transformer
DS01279A-page 9
AN1279
Full-Bridge Converter
The full-bridge converter topology shown in Figure 11,
is basically the same as the half-bridge converter,
where four transistors are used.
Diagonal pairs of transistors (Q1-Q4 or Q2-Q3) conduct alternately, thus achieving current reversal in the
transformer primary. Output voltage equals that of
Equation 4.
FIGURE 11:
FULL-BRIDGE CONVERTER
+VIN
Q1
L1
D1
T1
Q3
+VOUT
+
+
C1
C2
+
0V
Q2
Q4
D2
0V
Flyback Converter
EQUATION 4:
Vout 2 Vin
N2
d
N1
where:
d is the duty cycle of the transistors and 0 < d < 0.5
N2/N1 is the secondary-to-primary turns ratio of
the transformer
Figure 12 shows a flyback converter circuit. When transistor Q1 is ON, due to the winding polarities, the diode
D1 becomes reverse-biased. Therefore, transformer
core flux increases linearly. When transistor Q1 is
turned OFF, energy stored in the core causes the current to flow in the secondary winding through the diode
D1 and flux decreases linearly. Output voltage is given
by Equation 5.
FIGURE 12:
FLYBACK CONVERTER
D1
T1
+VIN
+VOUT
C1
+
C2
+
0V
Q1
0V
EQUATION 5:
Vout Vin
DS01279A-page 10
N2 d
N1 1 d
AN1279
VOLTAGE SOURCE INVERTER (VSI)
Full-Bridge VSI
Figure 14 shows the topology of a Full-Bridge VSI. This
inverter is similar to the half-bridge inverter; however, a
second leg provides the neutral point to the load. Both
switches S1+ and S1- (or S2+ and S2-) cannot be on
simultaneously because a short circuit across the DC
link voltage source vi would be produced. To avoid the
short circuit across the DC bus and the undefined AC
output voltage condition, the modulating technique
should ensure that either the top or the bottom switch
of each leg is ON at any instant. The AC output voltage
can take values up to the DC link value vi, which is
twice the value obtained with half-bridge VSI topologies. Several modulating techniques have been developed that are applicable to full-bridge VSIs. Among
them, the best known are bipolar and unipolar PWM
techniques.
Half-Bridge VSI
Figure 13 shows the topology of a Half-Bridge VSI,
where two large capacitors are required to provide a
neutral point N, such that each capacitor maintains a
constant voltage vi 2. Because the current harmonics
injected by the operation of the inverter are low-order
harmonics, a set of large capacitors (C+ and C-) is
required. The duty cycle of the switches is used to
modulate the output voltage. The signals driving the
switches must ensure some dead time to prevent
shorting of the DC bus.
FIGURE 13:
ii
VI
SINGLE-PHASE
HALF-BRIDGE VSI
+
C+
S+
VI
+
VI
io
N
+
C-
FIGURE 14:
D+
S-
+
VO
-
D-
ii
S1+
VI
+
-
VI
S2+
D2+
io
+
C+
S1-
D1+
D1-
S2-
+
VO
-
D2-
DS01279A-page 11
AN1279
BATTERY CHARGER
When the AC mains voltage is present, the Offline UPS
charges the batteries, and therefore, a battery charger
circuit is implemented.
Most battery chargers can be divided into four basic
design types, or topologies:
Linear Chargers
Switch Mode Chargers
Ferroresonant Chargers
SCR Chargers
Linear Chargers
Linear chargers consist of a power supply, which
converts AC power to lower voltage DC power, and a
linear regulating element, which limits the current that
flows into the battery. The power supply typically
consists of a transformer that steps down AC power
from 220/110 VAC to a lower AC voltage closer to that
FIGURE 15:
LINEAR CHARGER
Transformer
Rectifier
Current
Regulating
Element
Battery
AC Input
R1
Power Supply
FIGURE 16:
DC Output
Charge
Control
Power
Switch
Transformer
Output
Filter
Battery
AC Input
DC Output
Power Supply
Current Control
Logic
DS01279A-page 12
AN1279
Ferroresonant Chargers
SCR Chargers
Ferroresonant chargers (sometimes called ferro chargers), operate by way of a special component called a
ferroresonant transformer. The ferroresonant transformer reduces the AC voltage to a lower regulated
voltage level while simultaneously controlling the
charge current. A rectifier then converts the AC power
to DC power suitable for the battery. Figure 17 shows a
block diagram of a ferroresonant charger.
FIGURE 17:
FERRORESONANT CHARGER
Ferroresonant
Transformer
Rectifier
Battery
Charge
Control
DC Output
AC Input
Power Supply
FIGURE 18:
SCR CHARGER
Transformer
Diode
Rectifier
SCR
Current
Limiter
Battery
AC Input
DC Output
Power Supply
Charge Control
DS01279A-page 13
AN1279
SOFTWARE DESIGN
The Offline UPS Reference Design is controlled by a
single dsPIC DSC device as shown in the system block
diagram in Figure 19.
FIGURE 19:
3x12V Batteries
Auxiliary
Power
Supply
UPS
Output
Full Bridge
Voltage-Source
Inverter
Load
Relay Logic
Flyback Battery
Charger
dsPIC DSC
LCD Controller
PIC18F2420
USB
Controller
PIC18F2450
LCD Module
USB Port
Legend:
Signal Flow
Power Flow
Computer
DS01279A-page 14
AN1279
A high-level diagram of the Offline UPS software structure is shown in Figure 20. As shown in this figure, the
software is broadly partitioned into two parts:
UPS State Machine (includes power conversion
routines)
User Interface Software
These partitions are described in more detail in
subsequent sections of this document.
FIGURE 20:
Priority: Medium
Execution Rate: Medium
Power Conversion Algorithms
(Interrupt Based)
Priority: Low
Execution Rate: Low
Priority: High
Execution Rate: High
DS01279A-page 15
AN1279
FIGURE 21:
M
D AIN
BA C_LI S_O
T T NK K
ER _O &
Y_ K &
LO
W
MA
DC IN
BA _LINS_O
TT K _ K &
ER O K
Y_ &
OK
BATTERY_OVERVOLTAGE
MAINS_NOT_OK
Inverter Mode
MAINS_OK &
DC_LINK_OVERVOLTAGE
MAINS_OK &
DC_LINK_UNDERVOLTAGE
MAINS_NOT_OK &
DC_LINK_OK &
BATTERY_OK
Startup
Battery
Charger
Mode
MA
IN
DC_ S_NOT
BAT LINK_ _OK &
TER OK &
Y_
OK
E
& TAG
OK OL
_
E
O T RV
AG
_N DE
LT
NS _UN
I
O
E
V
MAERY
AG
ER
LT
OV
TT
O
_
A
Y
B
RV
GE
ER
DE
TA
TT
OL
UN
_
V
BA
K
R
IN
VE
_L
_O
K
DC
IN
_L
DC
BA
M
TT AIN
ER S_
Y_ N O
BA
UN T _
TT
DE OK
ER
RV &
Y_
OL
DC
OV
TA
_L
ER
INK
GE
V
_U
DC
OL
ND
TA
_L
INK
ER
GE
VO
_O
VE
LT
AG
RV
OL
E
TA
GE
MAINS_OK &
DC_LINK_OK &
(BATTERY_OK || BATTERY_LOW)
M
D AIN
BA C_LI S_O
TT N K K
ER _ O &
Y_ K &
M
LO
DC AIN
W
S
_
_
BA LIN O
TT K _ K &
ER OK
Y_ &
OK
System
System Error
D
C
_L
IN
O
K_
R
VE
VO
E
E
TAG
A GE
L
RVO
NDE
AG
LT
_U
LINK
DC_
RVO
LT
BATTERY_OVERVOLTAGE
BATT
ERY_
UND
E
System Startup
When the Offline UPS is turned ON, the state of the
system is unknown. Therefore, the state machine first
monitors all system variables and determines the
starting state of the UPS.
During this time, the state machine also monitors for
fault conditions and ensures that all system variables
are within specification so that the UPS can switch to
normal operation.
DS01279A-page 16
AN1279
BATTERY CHARGER MODE
FIGURE 22:
Trickle
Charging
State
Charging
Off
Bulk
Charging
State
Over
Charging
State
Float
Charging
State
Charging
Off
2.25A
0.1A
30V
35.7V
40.5V
43.2V
45V
Battery Voltage
DS01279A-page 17
AN1279
BATTERY CHARGER INITIALIZATION
ROUTINE
When the offline UPS switches to the Battery Charger
mode, the code must ensure that the previous mode is
turned OFF. To reduce stress on the hardware
components, the full-bridge inverter is turned OFF
when the output reaches 0V. The flowchart for the
Battery Charger mode is shown in Figure 23.
FIGURE 23:
Inverter
Mode
System
Startup
Priority: High
Set Relay flag =
NOT_READY_TO_SWITCH
Priority: High
No
Yes
Initiate relay release
Priority: Medium
AC Mains Detection
(ADC Interrupt)
Priority: Medium
Battery
Charger
Mode
DS01279A-page 18
AN1279
The dsPIC DSC device implements a predictive technique to achieve the fastest switchover time possible.
This is done by predicting the relay switching time and
initiating the relay release even before the inverter output has turned OFF. The switchover operation from the
inverter to the AC mains is described in subsequent
sections of this application note.
The battery charging current control scheme is illustrated in Figure 24. The battery charger control routine
is called inside the state machine under the Battery
Charger mode. The battery charging control loop is
therefore executed at the same rate (once every
100 s) and also at the same priority level as the state
machine. The battery current and voltage measurement is triggered using the PWM trigger feature on the
dsPIC DSC device.
If the measured charging current is less than the reference, the duty cycle is incremented by a fixed step.
Conversely, if the charging current exceeds the reference, the duty cycle is reduced by the same fixed step.
This process continues until the current error reduces
to a negligible value.
FIGURE 24:
+K
Duty Cycle
Charging Current
Reference
0
-K
-1
DS01279A-page 19
AN1279
FIGURE 25:
Priority: High
Yes
No
Yes
Is battery voltage <
BATTERY_BULK_VOLTAGE?
Priority: High
Set Maximum
Charging Current
No
Yes
Is battery voltage <
BATTERY_FLOAT_VOLTAGE?
No
Priority: Medium
AC Mains Detection
(ADC Interrupt)
Priority: Medium
DS01279A-page 20
Yes
Set Minimum
Charging Current
No
Turn Charger
OFF
Battery
Charger
Mode
AN1279
BATTERY CHARGER RESOURCE ALLOCATION
dsPIC DSC DEVICE RESOURCE ALLOCATION FOR BATTERY CHARGER
FIGURE 26:
VBAT
AC Input
+
Note 1
GND
kA(2)
kB(2)
ADC
ADC
PWM
dsPIC33FJ16GS504
Note 1:
2:
The AC mains input is rectified by the body diodes of the IGBTs to provide a DC voltage to the battery charger.
KA and KB are feedback gain circuits. Refer to Appendix D: Schematics and Board Layout for details.
TABLE 5:
Signal
Name
dsPIC DSC
Resource Used
Description
Type of Signal
IREF
PWM output
PWM4L
(remapped to pin 35)
25 kHz
IB
Analog Input
AN4
6.25 kHz
UB
Analog Input
AN5
6.25 kHz
EFB
Digital Output
RC7
Inverter Mode
If the AC mains voltage is not detected, the battery
charger is disabled and the Offline UPS switches to the
Inverter mode. During Inverter mode, the system is
running on battery power and produces a clean
sinusoidal voltage at the UPS output so that critical
electronics can continue operation without interruption.
The sinusoidal output waveform is generated using a
sine lookup table in the data memory. This lookup table
serves as the sinusoidal reference voltage for the
inverter control loop.
Execution Rate/Frequency
DS01279A-page 21
AN1279
The state machine, which is also interrupt-based, has a
lower priority than the control loops. As a result, the
execution of the state machine and user interface code
may be interrupted numerous times by the high-priority
control loops.
This operation is possible because the dsPIC DSC
device allows for nesting of interrupts. The interrupt
nesting feature enables the control loops to interrupt
the execution of the state machine. The state machine
execution is relatively slower than the control loops.
The dsPIC DSC device allows for seamless transition
between the power conversion routines and the UPS
state machine, with the use of multiple interrupts of
differing priorities and execution rates.
When operating in the Inverter mode, all system variables are monitored by the state machine. As soon as
the AC mains voltage is detected, the switchover
sequence is engaged and the system state is changed
to Battery Charger mode. If any system variable is in
error, the system state is changed to System Error.
FIGURE 27:
System
Startup
Priority: High
Priority: High
Priority: Medium
AC Mains Detection
(ADC Interrupt)
Priority: Medium
DS01279A-page 22
Inverter
Mode
AN1279
SOFT-START ROUTINE
The soft-start routine is called right after enabling the
push-pull converter. The soft-start routine increments
the reference voltage for the push-pull converter in software in fixed steps until the reference reaches the rated
DC Link voltage. At this point, the inverter is enabled by
calling the inverter re-initialization routine to produce a
sinusoidal voltage at the UPS output.
The ramp rate for the DC Link voltage is fixed and the
starting voltage for the soft-start routine is variable,
making the soft-start duration also variable.
The variable duration of the soft-start routine may
cause uncertainty in the mains-to-inverter switchover
time. The ramp rate for the soft-start routine is
configured to be completed in the time required for the
output relay to turn ON. This ensures that the
switchover time is within the design specification of
10 ms.
However, the other situation must also be considered
where the soft-start is completed in less time. In this
case, the inverter output will turn ON before the relay is
given enough time to switch, thereby causing the
inverter output to be turned ON at the UPS output
midway through the sine wave cycle. If the relay is
turned ON after the completion of the soft-start, the
switchover timing would be too slow.
The dsPIC DSC avoids both of these problems by initializing a delay counter at the beginning of the softstart routine. As the soft-start routine is ramping up the
DC Link voltage, the counter is incremented to reflect
the soft-start duration in milliseconds. If the soft-start is
completed before the minimum required time for the
relay turn-on, the code continues to wait until the minimum required switching time has elapsed. Once the
required relay switching time elapses, the full-bridge
inverter is enabled. This technique ensures that uninterrupted power is available at the UPS output at all
times.
DS01279A-page 23
AN1279
FIGURE 28:
(ADC Interrupt)
Start
Push-Pull
Soft-Start
Priority: High
Initialize delay counter
(ADC Interrupt)
Priority: High
Increment delay
counter
Increment push-pull
reference
Measurement
No
(ADC Interrupt)
Is Push-pull converter
reference = final setpoint?
Yes
Priority: Medium
Increment delay
counter
AC Mains Detection
(ADC Interrupt)
Priority: Medium
No
Inverter
Mode
DS01279A-page 24
AN1279
FULL BRIDGE INVERTER INITIALIZATION
The push-pull soft-start routine ensures that the DC link
voltage is at the rated value and the output relay has
completed the switching event. After the soft-start
routine concludes, the full-bridge inverter must be
enabled to produce a sinusoidal voltage at the UPS
output.
FIGURE 29:
The inverter control loop is reinitialized to purge all control history. The duty cycle is then configured to produce 0V output and the sine wave lookup table pointer
is also reset to the start. At this point, the PWM outputs
are enabled to produce the sinusoidal output voltage.
Priority: High
Inverter Initialization
Priority: Medium
Inverter
Mode
Priority: High
Set duty cycle to produce 0V output
Priority: Medium
AC Mains Detection
(ADC Interrupt)
Inverter
Mode
Priority: Medium
DS01279A-page 25
AN1279
PUSH-PULL CONTROL LOOP
FIGURE 30:
VREF
Voltage
Error
PID
Duty
Cycle
Control
Output
PWM
+-
+
Vin
VOUT
1001010111
Voltage Feedback
DS01279A-page 26
ADC
S&H
AN1279
INVERTER CONTROL LOOP
FIGURE 31:
Sinusoidal Reference
X
+
Voltage
Error
PI
Current
Reference Current
Error
X
+
AC Out
PWM
Output Filter
Current
Feedback
1011010011
Duty
Cycle
Control
Output
S&H
1001010111
Voltage Feedback
ADC
S&H
DS01279A-page 27
AN1279
PUSH-PULL CONVERTER HARDWARE AND
SOFTWARE RESOURCE ALLOCATION
dsPIC DSC DEVICE RESOURCE ALLOCATION FOR PUSH-PULL CONVERTER
FIGURE 32:
VDC
Push-Pull Converter
VBAT
GND
GND
FET
Driver
FET
Driver
PWM
PWM
kD
kC
ADC ADC
or
Analog Comparator
kE
dsPIC33FJ16GS504
ADC
TABLE 6:
dsPIC DSC
Resource Used
Sample Rate/
Frequency
PWM Output
PWM3L
100 kHz
S2
PWM Output
PWM3H
100 kHz
IP
Push-Pull Primary
Current Feedback
Analog Input
AN2
25 kHz
UDCM
DC Link Voltage
Feedback
Analog Input
AN3
25 kHz
Signal
Name
S1
Description
DS01279A-page 28
AN1279
FIGURE 33:
VDC
VOUT+
VOUT-
GND
IGBT
Driver
IGBT
Driver
IGBT
Driver
IGBT
Driver
PWM
PWM
PWM
PWM
dsPIC33FJ16GS504
kF
kG
ADC
ADC
The dsPIC DSC device resources used for the fullbridge converter are summarized in Table 7.
TABLE 7:
Signal
Name
Type of Signal
dsPIC DSC
Resource Used
Sample Rate/
Frequency
S3
PWM Output
PWM1L
50 kHz
S4
PWM Output
PWM1H
50 kHz
S5
PWM Output
PWM2L
50 kHz
S6
PWM Output
PWM2H
50 kHz
Analog Input
AN0
25 kHz
ACO
Analog Input
AN1
25 kHz
ACI
AC Mains Voltage
Feedback
Analog Input
AN11
25 kHz
A1
Digital Output
RC10
A2
Digital Output
RC0
DS01279A-page 29
AN1279
Inverter-to-Mains Switchover Routine
When a power failure occurs, the Offline UPS switches
to the Inverter mode and operates in this mode until the
mains is detected again. The system should switch
from one mode to the other in the shortest possible
duration in order to provide uninterrupted power to the
load.
Before switching to the Battery Charger mode, the software must reliably ensure that the mains voltage
detected is within the specified levels. The software
must also ensure that the mains waveform is clean and
has little or no distortion.
The mains detection routine is divided into the following
steps:
1.
2.
3.
4.
DS01279A-page 30
AN1279
FIGURE 34:
Zero-crossing Detected
Zero-crossing Aligned
AC
Mains
Inverter
Inverter turned
OFF
Inverter
Frequency
Modified
DS01279A-page 31
AN1279
Mains-to-Inverter Switchover Routine
When mains is present, the UPS software keeps comparing the measured mains voltage with the corresponding data in the mains reference array. The
quadrant information is also saved in a variable. On
every sample, the error between the expected voltage
and the actual voltage is calculated.
If the error is detected to be larger than 20V, a count
is incremented. If the error is detected to be outside the
limit consecutively for about 1 ms, then the Offline UPS
detects that a mains failure has occurred. The system
state is changed to Inverter mode and the relay is
switched immediately to disconnect the mains from the
FIGURE 35:
Push-pull Soft-start
Routine Completed
Inverter turned ON
at the last measured
mains voltage
UPS
Output
Battery
Charger
Mode (AC
Mains
Inverter Mode
Present)
DC
Link
Voltage
DS01279A-page 32
AN1279
System Error
The UPS goes into the System Error state if a combination of the system variables is detected to be in a
fault state. The state diagram in Figure 21 illustrates all
conditions under which a system error is detected.
The dsPIC DSC device has built-in fault and current
limit features that enable automatic shutdown of power
converters with no software overhead. This feature is
critical in power conversion applications and is useful in
protecting the user, system hardware, and downstream
electronics.
The System Error mode is designed to handle any
faults after the respective power stage has been disabled. When the system enters this mode, the type of
fault is displayed on the LCD module. When the UPS
enters the System Error mode, the system needs to be
restarted again before it can function normally.
All non-critical functions of the Offline UPS are categorized as auxiliary tasks. These tasks have a relatively
slow execution rate and therefore are assigned the lowest execution priority in the Offline UPS software.
The auxiliary tasks are executed in the main loop of the
code. These tasks are performed only when other highpriority tasks like power conversion control loops and
the UPS state machine are not active. In other words,
the auxiliary tasks are performed during the idle time
for the power conversion routines and state machine.
As a result, the main loop is also referred to as the idle
loop. The auxiliary tasks are numerously interrupted
by high-priority tasks like the control loops and the state
machine. Each of the auxiliary tasks is described briefly
in the following sections.
Signal
Name
SDO
SDI
SCK
LCD DISPLAY
Auxiliary Tasks
TABLE 8:
The DSP instructions of the dsPIC DSC device are utilized to efficiently execute the RMS calculation routines. The Q15 library includes functions for calculating
sum-of-squares and square-root. Both of these operations are available in the Q15 library, and are used for
implementing the RMS calculation in the offline UPS
reference design.
Type of Signal
dsPIC DSC
Resource Used
Sample Rate/Frequency
Digital Output
Digital Input
Digital Output
RP22
RP19
RP21
DS01279A-page 33
AN1279
Signal
Name
SS
Description
SPI Slave Select
Output
Type of Signal
dsPIC DSC
Resource Used
Digital Output
RP20
USB COMMUNICATION
The Offline UPS also includes a USB communication
interface to enable power management for a computer
or server connected to the UPS. The USB communication is performed by a separate USB controller MCU
(PIC18F2450). The USB controller communicates with
the dsPIC DSC device via an opto-isolated UART
interface.
TABLE 9:
Signal
Name
Tx
RX
Sample Rate/Frequency
Description
UART Transmit
UART Receive
DS01279A-page 34
Type of Signal
dsPIC DSC
Resource Used
Sample Rate/Frequency
Digital Output
Digital Input
RP27
RP28
9600 bps
9600 bps
AN1279
Fault States and Protection Schemes
The typical configuration of such a power supply contains a PFC boost converter as shown in Figure 37.
The boost converter usually contains a large output
capacitor. As seen from the circuit diagram, a low
impedance path exists from the AC input to the output
capacitor. As a result, the output capacitor draws a
large inrush current when the load is first connected to
the UPS output.
All faults that are fast-acting and destructive to the system and user's load are handled in the high-priority
control loops. The push-pull overcurrent fault is an
example of a very high-speed signal that must be
detected as quickly as possible. As a result, this fault is
detected at the same time as the push-pull control loop.
Other signals like the battery voltage are not very highspeed signals and therefore the faults are handled in
the UPS state machine.
When a fault condition happens, the system enters the
System Error mode and the type of fault is displayed on
the LCD module.
FIGURE 36:
AC
Offline UPS
UPS
Output
AC
Input
EMI Filter
PFC Boost
Converter
DC-DC
Converter
DS01279A-page 35
AN1279
FIGURE 37:
AC
Load
FIGURE 38:
Diode
OFF
Diode
ON
Diode
OFF
Diode
ON
Diode
OFF
Diode
ON
Input Voltage
Output Voltage
Input Current
DS01279A-page 36
AN1279
Due to the presence of a large capacitor on the output
of the PFC boost converter, the Offline UPS needs to
implement a special algorithm to handle load steps and
startup conditions for rectifier loads.
The current draw during a rectifier load startup can be
up to 20 times the maximum rated current. One option
to support these high current surges is to design the
hardware with sufficient design margin. However, this
approach is usually not cost effective and may also
cause a drop in performance or efficiency. The dsPIC
DSC provides a number of flexible features to overcome this problem. The PWM Current-Limit feature can
be used to limit the current on a cycle-by-cycle basis.
This feature, along with software can help charge the
output capacitor in a controlled manner so that the
inrush current is limited.
In the Offline UPS Reference Design, an external interrupt is generated when an overcurrent condition
occurs. This causes the PWM module to automatically
shut down. Inside the Interrupt Service Routine, the
PWM is configured for a very small duty cycle and then
re-enabled. As the duty cycle is small, the current
drawn during one PWM switching cycle is automatically
limited. The duty cycle is incremented in small steps to
charge the output capacitor in a controlled manner.
While the current-limit fault handling routine is being
executed, the inverter control loop is overridden. The
inverter control loop resumes operation when the sine
voltage reference of the inverter becomes equal to the
actual voltage on the inverter output.
If the first current limit fault is caused by a short circuit
condition on the inverter output, the current limit fault
will be triggered immediately for a second time. This
will cause the system to shut down with an overcurrent
error. The error state is displayed on the LCD display
module and is reset only when the system is turned
OFF and back ON.
DC Offset Elimination
A side-effect of operating with a high crest factor is that
the current drawn may become asymmetric. This is
caused by the presence of a small DC offset on the
inverter output voltage. The DC offset occurs due to the
tolerance limits of the feedback components.
A typical analog implementation requires the use of
trimming resistors to eliminate the DC offset. This
solution requires trimming of each UPS system during
manufacturing, and therefore becomes expensive and
time consuming. It may also need periodic adjustment
via a servicing schedule to account for effects of long
term degradation of components. The dsPIC DSC
helps overcome this problem with an active algorithm
to eliminate the DC offset.
The Offline UPS Reference Design implements an offset elimination routine by comparing the positive and
negative peak of the measured output voltage. If an
imbalance is detected, a correction factor is applied to
the output voltage to cancel the DC offset. The peaks
are determined by averaging the maximum and minimum recorded voltages over a number of sine wave
cycles. Doing so helps to ignore the effects of load
steps on the output.
DS01279A-page 37
AN1279
HARDWARE DESIGN
DESIGN SPECIFICATIONS
A push-pull boost converter needs to convert the wide
range battery link input voltage to a stabilized high-voltage DC-Link. The design specifications used in the
Offline UPS Reference Design are:
FIGURE 39:
Q1
Q2
C1
UB
Q3
Q4
C1
Q1
UB
T1
T1
+
C2
Q3
T1
UB
DS01279A-page 38
AN1279
FIGURE 40:
RECTIFIER CIRCUITS
T1
L1
R1
C1
D1
D2
L1
T1
D3
C1
D1
FIGURE 41:
D4
R1
D2
EQUATION 6:
For the secondary, a full-bridge rectifier was chosen for
the following reasons:
Reducing the leakage inductance by using only
one secondary winding on the transformer
Reducing cost of transformer
Rectifier diodes can be rated lower in reverse
breakdown voltage, such diodes have better
forward and switching characteristics.
Synchronous rectification is not required due to
high-voltage and low current operation.
N2
U DC = U BAT ------ 2d
N1
where:
d is the duty cycle of the transistors and 0 < d < 0.5
N2/N1 is the secondary-to-primary turns ratio of
the transformer
DS01279A-page 39
AN1279
DESIGN OF POWER-TRAIN COMPONENTS
EQUATION 7:
TABLE 10:
P l = a f B max
Material
Frequency
0.074
1.43
2.85
0.036
1.64
2.68
f 500 kHz
0.014
1.84
2.28
0.158
1.36
2.86
0.0434
1.63
2.62
f 500 kHz
7.36e-7
3.47
2.54
f < 10 kHz
0.790
1.06
2.85
0.0717
1.72
2.66
0.0573
1.66
2.68
f 500 kHz
0.0126
1.88
2.29
EQUATION 8:
1000
B max
DS01279A-page 40
1000
----------
----------d
2.68
Pl
150
= ---------------------------c
= ------------------------------------------------= 1339G
1.64
f
100000
a ----------
1000-
0.036 ----------------1000
AN1279
For selecting the right size core, the area product of the
core must be calculated by Equation 9. This equation is
derived from the flux linkage equation ( = N * ) and
represents the power handling ability of the core.
Therefore, each core has a number that is a product of
its window area, Wa, and the core cross-sectional area,
Ac.
FIGURE 42:
HYSTERESIS LOOP OF
MAGNETIC CORE
B
BSAT
EQUATION 9:
BMAX
8
10 P omax
W a A c = ------------------------------K t B f J
B
B in Equation 9 is equal to 2Bmax due to bidirectional
core excitation as seen in Figure 42. Current density of
a winding is estimated to be 500A/cm2, and maximum
output power Pomax is 2000W. Therefore, the calculated
area product is shown in Equation 10.
H
B
BMAX
EQUATION 10:
8
10 2000
4
W a A c = ------------------------------------------------------------------ = 5.9cm
0.254 2678 100000 500
BSAT
EQUATION 11:
NP
8
2
8
2
10 V imin --- Dmax 10 30 ------------------ 0.42
f
100000
= --------------------------------------------------------- = -------------------------------------------------------------- = 3.4
B AC
2678 2.8
DS01279A-page 41
AN1279
The secondary turns are calculated by Equation 12.
The result is rounded to the value 60 of secondary
turns.
EQUATION 12:
EQUATION 13:
I Prms
2
A cuP = ------------- = 3.81mm
JP
Vo
380
--------------------------------2D max
2 0.42
N s = ---------------- N p = ------------------ 4 = 60.3
V imin
30
I Srms
2
AcuS = ------------ = 0.41mm
JS
The cross section of the primary and secondary windings is calculated by Equation 13. Different current densities are used (JP = 8A/mm2 and JS = 5A/mm2) to fit the
windings into the transformer bobbin and because the
length of one-half of the primary is very short compared
to the secondary. In that case, it is allowed to use higher
current density for primary as temperature of winding will
FIGURE 43:
NS
NP
NP
NP
NS
Bobbin
CORE
NP
NP
NP
NS
DS01279A-page 42
AN1279
PUSH-PULL MOSFETS
Peak Current
EQUATION 16:
I pm
EQUATION 17:
EQUATION 14:
VBRDSS 2VBAT
2 45V 1.3 117V
Continuous Current
To calculate the current rating of the devices, peak and
average currents have to be estimated. The peak and
average currents can be estimated from the power ratings and input voltage. The average current is calculated using Equation 15, where PC is the continuous
power and UBAT is the battery voltage.
EQUATION 15:
I a Pc / U bat
The highest current will flow at the lowest battery
voltage so the continuous current is:
I = 1000W 30V = 33.34A. And per leg, the continuous
drain current is half of this: ID = 16.67A.
Pmax
U bat d
U DC N 2
2 U bat N1
EQUATION 18:
I pm
2000W
160.3 A
30V 0.416
Therefore, we have to design the MOSFETs for continuous drain current of 16.67A and peak drain current of
160.3A. Because the waveform shape will not be an
exact sawtooth, these calculations are only an estimate. To be on the safe side, these numbers are
increased by 30%.
EQUATION 19:
rms
I pc
d
3
EQUATION 20:
rms
80.15
2
.416 42.13 A
3
DS01279A-page 43
AN1279
Per leg, the current is half of this: IDRMS = 21.07A . This
is the most critical design consideration; therefore, an
overrating of 50% should be done IDRMS = 21.07A * 1.5
= 31.5A, and all current leading traces and the
transformer should also be rated for this current.
EQUATION 21:
2
Pc I Drms
RDSon
EQUATION 25:
RJH
50
0.91C / W
Ptot 55
EQUATION 22:
Poff f SW
WL
4
EQUATION 23:
WL
i2 L
2
EQUATION 24:
Poff 100e3
1.6e3
40W
4
DS01279A-page 44
AN1279
FULL-WAVE RECTIFIER
FIGURE 44:
T1
D3
D4
C1
R1
C1
R1
D2
L1
T1
D3
D4
D2
EQUATION 26:
I avg
EQUATION 27:
I pD I P
Pc 1000
2.6 A
VDC 380
N1
160.3 0.625 10 A
N2
DS01279A-page 45
AN1279
Switching Characteristics
Diode switching characteristics are determined by
forward recovery time and reverse recovery time.
FIGURE 45:
tfr
PDoff
PDon
t1
t[s]
t3
t2
Diode switching
Equation 28.
loss
can
be
estimated
using
EQUATION 28:
EQUATION 29:
PswD Qc VDC f SW
Package Thermal Performance
For diodes, an isolated TO-220-2 package is used.
Continuous working junction temperature should not
exceed 130C at a heat sink temperature of 60C. Typical thermal junction-to-heat sink resistance of the junction-isolated TO-220-2 package is Rt = 3.5C/W.
Therefore, the maximum allowed power dissipation per
part is PMAX = 70 3.5 = 20W.
The STTH1210DI from STMicroelectronics meets the
voltage and current requirements. Power loss calculation can now be done looking at the diode data sheet.
Output Inductor
This inductor is optional and is not required. Its use
depends on the transformer construction and control of
DC-link voltage, and the inductor value that must be
used. This section describes the design of a 50 H
output inductor.
The design of the output inductor uses the area product
approach with the following conditions:
Inductance: L = 50 H
Peak DC current: Ip = 13A
Operating flux density: Bm = 300 mT
Current density: J = 500A/cm2
Window utilization: Ku = 0.4
DS01279A-page 46
AN1279
EQUATION 30:
L I p2
2
EQUATION 34:
50 106 132
0.0043Ws
2
EQUATION 31:
2 E 104
Wa Ac
1.43cm 4
Bm J K u
The selected core was the P36/22 pot core from FERROXCUBE due to its small size and shape, which produces less interference into surrounding components.
The area product of this core is 1.46 cm4 and can be
calculated from the data in the manufacturers data
sheet.
The number of turns required to get the desired
inductance of the coil is calculated by Equation 32. The
Core cross section Ac = 172 mm2 is obtained from the
manufacturers data sheet.
EQUATION 32:
LIp
Ac Bm
12.6
EQUATION 33:
L N 2 AL 53 H
The new operating flux density is verified by
Equation 34 and must be lower than the saturation
point of the selected material.
Bnew
LIp
N Ac
308mT
EQUATION 35:
Acu
I rms
2 I Prms
NP
NS
0.82mm2
EQUATION 36:
Ku
N Acu
0.15
Wb
Output Capacitors
When choosing DC-link capacitors, the following must
be considered:
Voltage Rating
Ripple Current
Voltage Rating
The voltage rating is defined by the DC Link voltage:
VDC = 380V. Therefore, the capacitors must be above
this rating.
DS01279A-page 47
AN1279
Ripple Current
EQUATION 39:
EQUATION 37:
Q S 2 P 2 830.7Var
EQUATION 38:
Ir
Q 830.7
3.6 A
230
VAC
SNUBBERS
Snubbers are used to dampen high frequency oscillation and reduce ringing losses on diodes. Snubbers on
the primary side are placed across the primary windings and are not used to handle voltage spikes at turnoff of the MOSFETs. They only reduce ringing and
transformer in-rush current.
To design the snubber for the primary side, the
capacitance of the MOSFETs and leakage inductance
of the transformer must be known. Both parameters
can be measured; however, MOSFET capacitance is
voltage dependent so only an estimate can be used. In
our case, the capacitance of three parallel MOSFETs is
approximately CDS = 7 nF, and leakage inductance of
the transformer is estimated at LS = 500 nH. A
simplified high frequency circuit is shown in Figure 46.
FIGURE 46:
HIGH-FREQUENCY CIRCUIT
RS
LS
.5 H
RC
CDS
6.6 nF
The resonant
Equation 39.
DS01279A-page 48
frequency
is
calculated
1
2.7 MHz
2 CDS LS
FIGURE 47:
HIGH-FREQUENCY CIRCUIT
LSS
CD1
L1
CD3
using
AN1279
Calculating the required snubber circuit is very complex
and does not give the expected results. Therefore, the
parameters have to be evaluated by experimenting.
When designing the snubbers the following must be
considered:
FIGURE 48:
Q4
R6
D2
S1
+ V1
12V
R1
Q1
R2
Q2
R3
Q3
R4
R5
C1
EQUATION 40:
DS01279A-page 49
AN1279
Peak current estimate is calculated using Equation 41.
EQUATION 41:
I Gp
Thermal Design
The heat produced by the MOSFETs and diodes must
be transferred to ambient air using heat sinks. Total
power loss estimation which were performed earlier
are:
For MOSFETs, PMOS = 110W
For diodes, PDIODE = 40W. Forced air cooling is
used to dissipate the heat
Full-Bridge Inverter
INVERTER DESIGN SPECIFICATIONS
The inverter is used to generate the UPS output voltage. The specifications are:
For the push-pull stage, battery link, and DC link voltage, measurements are needed. Both measurements
are done differential with the MCP6022 rail-to-rail operational amplifiers. When taking high voltage differential
measurements, the input resistance must be high and
voltage and power rating of the resistors must not be
exceeded. Because of this, 1206 resistors are used on
the input dividers in the reference design. The output
signal for the differential amplifiers is 5V to increase
SNR. Then, a resistor divider is used near the dsPIC
DSC to interface to the 3.3V, 10-bit A/D converter. In
addition, a capacitor is placed near the dsPIC DSC to
enable fast charge of the S&H capacitor. For measurement, 1% tolerance resistors are used. This is especially important for the differential amplifiers to
guarantee the same resistance in both arms to reduce
common mode noise rejection.
DS01279A-page 50
AN1279
FIGURE 49:
EQUATION 44:
N
I1
LIp
Ac Bm
39.9
O1
Input
I2
Output
O2
EQUATION 45:
Design of the output common-mode choke is the same
design of that of a DC inductor, with the following
conditions:
Inductance: L = 250 H
Peak AC current: Ip = 17A
Operating flux density: Bm = 380 mT
Current density: J = 500A/cm2
Window utilization: Ku = 0.4
Output power: Po = 1000W
L
156nH
N2
EQUATION 46:
must
be
EQUATION 42:
L I p2
AL
250 106 17 2
0.036Ws
2
A k2
s L 3.3mm
k1
The gap is chosen from the data sheet to be 3.5 mm.
The new AL value must be calculated for the new air
gap by Equation 47.
EQUATION 47:
AL K1 s K 2 148nH
EQUATION 43:
2 E 104
Wa Ac
10.3cm 4
Bm J K u
The selected core is an Epcos ETD54 ferrite core. The
area product of that core is 11.5 cm4, and can be calculated from the dimension data in the manufacturers
data sheet.
The number of turns required to get the desired inductance of the coil is calculated by Equation 44. The core
cross-section, Ac = 172 mm2, is obtained from the
manufacturers data sheet.
EQUATION 48:
L N 2 AL 237 H
The new operating flux density is verified by
Equation 49 and must be lower than the saturation
point of the selected material.
DS01279A-page 51
AN1279
EQUATION 49:
Bnew
Output Relays
LIp
N Ac
360mT
EQUATION 50:
Po
I rms 230V
Acu
0.88mm 2
J
J
The calculated value is the minimum cross-section of a
wire (100 kHz litz wire must be used).
Next, the fill factor has to be calculated by Equation 51.
This will give an estimate if the windings will fit into the
bobbin. The fill factor must be 0.4 or less. Wb is the bobbin winding area and is 315.6 mm2. This information
can be found in the core data sheet.
EQUATION 51:
Ku
N Acu
0.11
Wb
DS01279A-page 52
AN1279
Because of the high differential input voltage, a series
of 1206 resistors were used to stay within the voltage
and power rating of the devices. All of the resistors
used were 1% tolerance to guarantee the exact measurement and reduce common mode noise rejection.
For current measurement, a Hall effect-based sensor
from LEM is used. The sensor is bipolar and signal
output is 0.5V. At zero current, the output is 2.5V.
For all of the 5V signals, a resistor divider was
added near the dsPIC DSC to interface with the 3.3V
10-bit A/D converter. In addition, a capacitor was
added near the dsPIC DSC to fast-charge the SH
capacitor.
THERMAL DESIGN
IGBTs must be placed on a heat sink to dissipate the
produced heat. Total power dissipation is estimated as
PIGBT = 68W. The devices must be mounted on the heat
sink using thermal conductive and electric insulating
material.
Flyback Transformer
The flyback transformer is designed to the desired output power and output current ripple, to enable current
source operation. For the flyback converter, a transformer with air gap is needed. The transformer is
designed for the following conditions:
EQUATION 52:
N PS (
Vinom VDSon
d
) n 1.9
VO VDf
1 dn
EQUATION 53:
LS
LP LS N PS 2
Is
684 H
196 H
DS01279A-page 53
AN1279
EQUATION 54:
I S
I Sc
IO
4A
(1 d max )
I Speek I Sc
I S
4.5 A
2
I S
I
1
) ( I Speek ( I Sc S ))2 3.2 A
2
3
2
EQUATION 55:
I P
I Pc
VO I O
2.4 A
(Vi min ) 0.9 d max
I Ppeek I Pc
I P
2.7 A
2
I P 1
I
) ( I Ppeek ( I Pc P )) 2 1.5 A
2
3
2
EQUATION 56:
I Prms
0.375mm 2
J
I
Srms 0.8mm 2
J
ACuP
ACuS
A winding factor of K = 0.2 is selected for the transformer and N87 material for the core. The maximum
core flux density is set to B = 130 mT. To select the
core, the area product has to be calculated with
Equation 55.
EQUATION 57:
Wa Ac
100 PO max
0.65cm 4
Kt 2 B f J
DS01279A-page 54
AN1279
FIGURE 50:
NP
NS
Bobbin
CORE
NP
Primary
Secondary
Primary
EQUATION 58:
nwP
ACuP
47.7
ACuw
nwS
ACuP
101.8
ACuw
EQUATION 60:
N tP
25
25 25
DP
N tS
25
16.7 16
DS
EQUATION 61:
N lP
NP
2.32 3
N tP
N lS
NS
1.875 2
N tS
EQUATION 62:
Wu ( DP N lP DS N lS ) / Wa 86%
EQUATION 59:
NP
NS
104 LP I Ppeek
2 B Ae
58.1 58
NP
30.5 30
N PS
Now, the window utilization and fill factor can be calculated for the selected core and wires. The bobbin window is 25x7 mm. From this we can calculated how
many turns for the primary and secondary
(Equation 60) and the number of required layers
(Equation 61).
EQUATION 63:
DS01279A-page 55
AN1279
EQUATION 64:
AL
L
203.3nH
N2
Now, from the core manufacturer data sheet, the correct air gap can be selected. For the used EPCOS
ETD39 N87 core, the correct air gap is calculated with
Equation 65.
EQUATION 65:
1
k2
A
s L 0.95mm
k1
The nearest standard air gap values are 0.7 mm and
1 mm. Our calculated value is close to 1 mm so we
select an air gap of 1 mm and do not need to change
the windings. If an air gap of 0.7 mm is selected, the
number of winding turns must be corrected.
Battery Selection
The battery selection will depend on the DC voltage
and the required backup time of the Offline UPS
system. The Offline UPS Reference Design has been
designed for 36V input DC voltage, being able to
produce one hour of backup time with a 35 AH battery.
THERMAL DESIGN
The top switch and rectifier diode must be mounted on
a heat sink. Assuming efficiency of the battery charger
to be 70%, nearly 50W of loss will be dissipated. Those
losses consist of clamp losses, transformer losses,
primary switch (TOP250Y), and rectifier losses.
Therefore, we can estimate that near 30W of losses
need to be dissipated on the heat sink. Both elements
TOP250Y and the rectifier diode must be mounted on
the heat sink using thermal conductive electrical
insulating material.
EQUATION 66:
DS01279A-page 56
N2
28
Vbat 2 VF ( IGBTD ) 260 2 45 2 1.3 240.4V
N1
52
AN1279
Design of Auxiliary Power Supply
CONCLUSION
DESIGN SPECIFICATIONS
CHOICE OF COMPONENTS
Because of a wide range of input voltage and power
losses, a buck converter was used to generate 12V
from the battery voltage. For 3.3V and 5V, linear
regulators are used because of simplicity and price. All
the voltage regulators are connected in series so the
12V buck converter needs to deliver 1A of current. For
the buck converter, an LM5575 from National
Semiconductor was used with the switching frequency
set at f = 500 kHz. Components were selected
according to the LM5575 data sheet. For the linear
voltage regulators, power dissipation must be
calculated to select the right package in the PCB
layout. For the 5V regulator, maximum power
dissipation is calculated to P5V = (VIN - VOUT) * IOUT =
3.15 mW and for 3.3V to P5V = (VIN - VOUT) * IOUT = 255
mW. For the 5V regulator, a (KE7805ER) TO-263
package with a PCB mount heat sink was selected, and
for the 3.3V regulator, a (TC1262) SOT223 package
was selected. For the analog circuits, additional chip
inductors and capacitors were added to separate digital
and analog supply voltages.
The auxiliary power supply will start when DC link
voltage is present or when the button is pressed.
REFERENCES
MCP14E3/MCP14E4/MCPE5 4.0A Dual HighSpeed Power MOSFET Drivers With Enable
(DS22062), Microchip Technology Inc.
TC1262 500mA Fixed Output CMOS LDO
(DS21372), Microchip Technology Inc.
Power Electronics Converter, Applications and
Design by N.Mohan, T.M. Undeland, and W.P.
Robbins
Control Topology Options for Single-Phase UPS
Inverter by M.J Ryan, W.E. Brumsickle, and R.D.
Lorenz, IEEE transaction on industry application,
Vol. 33, No. 2, March/April 1997.
A Current Mode Control Technique with Instantaneous Inductor Current Feedback for UPS
Inverter by H.Wu, D.Lin, D. Zhang, K. Yao,
J.Zhang, IEEE transaction, 1999.
A High Performance Sine Wave Inverter Controller with Capacitor Current Feedback and BackEMF coupling by M.J Ryan and R.D. Lorenz,
IEEE transaction, 1995.
DS01279A-page 57
AN1279
NOTES:
DS01279A-page 58
AN1279
APPENDIX A:
SOURCE CODE
Software License Agreement
The software supplied herewith by Microchip Technology Incorporated (the Company) is intended and supplied to you, the
Companys customer, for use solely and exclusively with products manufactured by the Company.
The software is owned by the Company and/or its supplier, and is protected under applicable copyright laws. All rights are reserved.
Any use in violation of the foregoing restrictions may subject the user to criminal sanctions under applicable laws, as well as to civil
liability for the breach of the terms and conditions of this license.
THIS SOFTWARE IS PROVIDED IN AN AS IS CONDITION. NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR
STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
PARTICULAR PURPOSE APPLY TO THIS SOFTWARE. THE COMPANY SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE
FOR SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER.
DS01279A-page 59
AN1279
APPENDIX B:
CONTROL SYSTEM
DESIGN
The Offline UPS Reference Design implements full digital control of the push-pull converter and full-bridge
inverter. MATLAB was used to design the compensators based on the hardware and to generate optimal
coefficients to be used in the software.
MATLAB SIMULINK
The simulation files contain the models for various subsystems. Some subsystems are presented as nested
blocks to simplify the main diagram. Simulink provides mathematical blocks for the time domain simulations.
There are typically two models in each file.
Analog implementation
Digital implementation
Each SIM file analog implementation typically consists
of the following sections:
Reference Block
Feedback System Block
Power System Block
Control System Block
Modulation Inverse Block
Modulation Block
Load System Block
Special Blocks
REFERENCE BLOCK
MODULATION BLOCK
This block represents the average model of the switching system. This block converts the duty applied to
physical system to voltage quantity. Its input is the duty
cycle ratio /parameter (0 to 1) that gets converted to
voltage quantity. It usually takes the system input voltage and duty cycle as input and generates an output
voltage.
DS01279A-page 60
SPECIAL BLOCKS
Second order effects like saturation of inductor and
dead-time are modeled for systems where these
become important like UPS. These are indicated by
saturation and dead-time blocks.
AN1279
MATLAB .m File
Push-Pull Compensator
FIGURE B-1:
VREF
Voltage
Error
X
+
PID
Control
Output
Duty
Cycle
PWM
+
VIN
VOUT
1001010111
Voltage Feedback
ADC
S&H
DS01279A-page 61
AN1279
Figure B-2 shows the MATLAB Simulink block
diagram. For further details of each block refer to the
MATLAB (.mdl) file.
FIGURE B-2:
VIN D
VO*
Digital
Control System
D
VIN.D
VIN1
Buck Modulation1
L_C
Voltage
iLoad
VO1
IL
L_C Circuit1
Scope1
VIN1
Out1 In1
ADC
VO ILOAD
Inverter Load Generator1
x
Product3
Expected Input
Current1
FIGURE B-3:
DS01279A-page 62
AN1279
The loop gain voltage plot shown in Figure B-4 is used
to find phase and gain margin. From the plot it can be
seen that the phase margin (difference between 180
degrees and the phase angle where the gain curve
crosses 0 db) is 90 degrees.
To prevent the system from being conditionally unstable, it is imperative that the gain plot drops below 0 db
when the phase hits 180 degrees.
The blue curve is for the analog implementation and
the green curve is for the digital implementation. It is
generally recommended to have a phase margin of at
least 40 degrees to allow for parameter variations.
The gain margin is the difference between gain curve
at 0 db and where the phase curve hits 180 degrees.
The gain margin (where the green line on the phase
plot hits 180 degrees) is -20 db.
FIGURE B-4:
DS01279A-page 63
AN1279
Figure B-5 shows the closed loop bode plot. The point
where the gain crosses -3 db or -45 degrees in phase
is usually denoted as the bandwidth. In this system, the
bandwidth of the voltage loop is approximately 1250 Hz
(8000 rad/s), which is closely matched by the bode plot.
FIGURE B-5:
FIGURE B-6:
Sinusoidal Reference
X
+
Voltage
Error
PI
Current
Reference Current
Error
X
+
AC Out
PWM
Output Filter
Current
Feedback
1011010011
Duty
Cycle
Control
Output
S&H
1001010111
Voltage Feedback
ADC
S&H
DS01279A-page 64
AN1279
Figure B-7 shows the MATLAB Simulink block diagram
for the inverter. For further details of each block, refer
to the MATLAB (.mdl) file.
FIGURE B-7:
Sine Wave
(input variation)
++
VO
VIN
390
IL
Dtop
Dtop
VIN
VO*
Sine Wave
VO*1
Zero-order
Hold2
ILoad
Digital
Control System1
ILZX
VIN
(2.D-1)
Full-Bridge
Modulation Model1
Out1 In1
++
Out2 In2
++
D.VIN VO
iLoad IL
L_C Circuit1
Scope2
Out1
FIGURE B-8:
DS01279A-page 65
AN1279
Figure B-9 shows the loop gain bode plot for the
inverter. From the plot, it can be seen that the phase
margin (difference between 180 degrees and the
phase angle where the gain curve crosses 0 db) is 47
degrees.
The gain margin is the difference between the gain
curve at 0 db, and where the phase curve hits 180
degrees. In the plots below, the gain margin (where the
green line on the phase plot hits 180 degrees) is -10 db.
FIGURE B-9:
Figure B-10 shows the closed loop bode plot for the
inverter. The point where the gain crosses -3 db or -45
degrees in phase is usually denoted as the bandwidth.
In this system, the bandwidth of voltage loop is 1250 Hz
(8000 rad/s), which is closely matched by the bode
plots.
DS01279A-page 66
AN1279
Scaling
The gains calculated from MATLAB are based on real
units (volts, amps, etc.). The dsPIC DSC has a fixed
point processor and the values in the processor have a
linear relationship with the actual physical quantities
they represent.
The gains generated by MATLAB being in real units,
cannot be directly applied to these scaled values (representation of physical quantities). Therefore, for consistency, these gains themselves need to be scaled.
The following sections present general concepts
behind proper scaling.
The basic idea behind scaling is quantities that need to
be added or subtracted should be of the same scale.
Scaling does not affect the structure of the control system block diagram in any way. Scaling only effects the
software representation of various quantities.
SCALING FEEDBACK
To properly scale the PID gains, it is imperative to
understand the feedback gain calculation. The feedback can be represented in various formats. Fractional
format (Q15) is a very convenient representation.
Fractional format allows easy migration of code from
one design to another with completely different ratings
with most changes only in the coefficients defined in the
header file.
To completely use the 16 bits available in the
processor, the Q15 format is most convenient as it
allows signed operations and full utilization of the
available bits (maximum resolution). Other formats are
also possible, but resolution is lost in the process. Q15
allows us to use the fractional multiply MAC operation
of the dsPIC DSC effectively.
The feedback signal (typically voltage or current) is
usually from a 10-bit ADC. Based on the potential
divider/amplifier in the feedback circuitry, actual voltage
and currents are scaled.
Typically, the feedback 10-bit value (0 -1023) is brought
to +/- 32767 range by multiplying by 32. This format is
also known as Q15 format: Q15(m) where -1 < m < 1
and is defined as (int) (m * 32767).
These formulas will have some error as we need 2^15
= 32768, but due to finite resolution of 15 bits we use
only +/- 32767. From a control perspective, for most
systems these hardly introduce any significant error.
GAIN SCALING
In simulation the control gains are calculated in real
units. For example, in current mode control, the output
of voltage loop is the current reference (in amps).
Therefore, the gain is Amps/Volts or in units of 1/ohms:
V Gain IREF
The goal is to obtain IREF in an appropriate format like
Q15(I/IN) to enable implementation of the current loop
in software.
In theory, the Q15 voltage V/VN is first multiplied by
VN, and then gain (G), and then the IREF that is
obtained is divided by IN to get current in the correct format. Since VN and IN are constants, the gain
G is scaled as: G * VN / IN. This value can be used
in software to act on voltage quantity and give out a
current quantity.
The input quantity should be in fractional format (this
has to be ensured in code). Then, the output current
quantity will automatically be in the correct fractional
quantity. This essentially solves the objective of
scaling. The same logic applies to any control block.
By considering the input and output units and scale of
each block to be implemented in software, the proper
scaled values can be arrived at.
SAMPLING TIME
In calculation of the derivative and integral term in the
discrete time domain, TS (sampling time) factors show
up. Since sampling time is usually constant, it can also
be lumped together with the gains. For example, if GS
is the integral gain in real units, GS * TS * VN / IN is the
scaled value.
DS01279A-page 67
AN1279
PRESCALER
Division By VIN
The output of the controller in the MATLAB model is
usually a voltage quantity. This needs to be converted
to a duty/modulation quantity. To do this, the control
output needs to be divided by the input voltage VIN. To
avoid division, VIN can be assumed to be constant and
1/VIN can be used as a constant multiplier and bundled
along with the gains in the previous blocks.
DS01279A-page 68
AN1279
APPENDIX C:
ELECTRICAL
SPECIFICATIONS
This Appendix provides an overview of the UPS electrical specifications as well as scope plots from initial test
results.
TABLE C-1:
Parameter
Min
Typ
Max
Units
VIN
Input Voltage
210
220
242
fIN
Input Frequency
47
50
53
Hz
VOUT
Output Voltage
fOUT
Output Frequency
49
50
51
Hz
34
36
45
POUT
1000
VA
OLP
>100
135
VBATTERY
THD
tTRANSFER
ICHARGE
I_BATTERY
T
220
Comments
84
84
10
ms
ms
2.5
40
Operating Temperature
25
CF
Crest Factor
3:1
PF
.65
.65
Note 1:
>50% load
@ 100% load
Only tested at .8 PF
UPS run time will vary with output load current and the batteries discharge rate. Refer to the battery data
sheet for specific discharge times.
DS01279A-page 69
AN1279
FIGURE C-1:
Percentage (%)
85
80
75
70
65
60
10
25
50
60
70
80
90
100
% Load
FIGURE C-2:
DS01279A-page 70
AN1279
FIGURE C-3:
FIGURE C-4:
DS01279A-page 71
AN1279
FIGURE C-5:
FIGURE C-6:
DS01279A-page 72
AN1279
FIGURE C-7:
FIGURE C-8:
DS01279A-page 73
AN1279
APPENDIX D:
FIGURE D-1:
DS01279A-page 74
Charger-
P2
IC4
1206
390k
R109
R108
1206
390k
R102
1206
390k
R100
1206
390k
R99
1206
390k
TOP250YN (TO220-7)
PGND
C82
0.22uF 630V
PGND
Charger+
P4
R97
4.7nF 1000V
C83
T2
DNP
C84
R98
DNP
PGND
Q14
BC817
R110
12k
C88
DNP
R114
4k7
PGND
100nF 100V
TP14
EFB
47uF 25V
C89
R107
6.8e
BYV26E
D26
6k8 4W
W2
2
X
3
F
5
R105
180e
C85
100uF 100V
100V
12V
C143
100nF
R104
3k3
1k5
R115
GND
GND
C91
12V
100nF 25V
47nF
C93
U7A
LM358
D49
Zener 47V
1SMB5941BT3G
R101
3k3
BAR43C PGND
D27
Q12
BC817
PGND
C86
0.68uF 100V
GND
R202
2k2
R113
10k
R111
24k
TP13
8
4
Udc
8
4
GND
C92
1uF
U7B
LM358
Iref
GND
R106
R103
6.8k 1%
GND
GND
Uch
C144
12V
100nF 25V
R112
2k2
C147
1uF
Ibatm+
GND
1k5 1%
Ibatm-
U6
INA168
R96
0.33e 5W
Ubat
Imax=2.5A
Vmax=48V
FIGURE D-2:
D25
STTH8R06D
AN1279
DS01279A-page 75
SDI
SDO
SCLK
SS
GND
dsICSPD
R15
DNP
D30
DNP
S2
DNP
R26
DNP
R206
DNP
3V3
GND
D33
DNP
R127
DNP
DNP
D34
GND
R201
DNPC140
100nF
ICSP
No galvanic isolation!
Do not connect when UPS is connected to AC Line!
dsICSPC
3V3
AGND
0e
BR4
GND
S5
S6
S1
S2
10uF 6V Tant
C139
10e
R207
FLT_CLR
11
10
PWM2L
PWM2H
PWM3L
PWM3H
VDDCORE
Vss
RP19
RP22
RP21
RP20
PGC1
C25
1uF
dsI CSPC
2
4
6
EPP
44
3V3
100nF
C94
1uF
C99
C141
100nFAGND
3V3A
dsI CSPD
41
1
3
5
40
P3
43
RP6
13
PWM 1H
12
S4
GND
38
PS
RP5
PWM 1L
S3
42
RP15
RP16
14
A2
RP8
RP29
15
FAULT/SD
39
VDD
AVSS
16
Vss
/SYS_FLT
3V3
C142
100pF
dsVpp
10k
R118
GND
18
AVDD
17
EFB
37
RP24
MCLR
19
Iref
35
Tb
36
RP23
RP2 7
TX
20
AN9
RP2 8
RX
PWM4L
34
PWM4H
AN1
22
AN0
21
I
DS01279A-page 76
ACo
AN2
AN3
AN4
AN5
AN11
AN10
VDD
Vss
AN8
OS CI
OSCO
23
24
25
26
27
28
29
30
31
32
33
IP
Udcm
Ib
Ub
ACi
A1
3V3
1
1uF
GND
100nF
C98
C97
U15
dsPIC33FJ16GS504
R116
20MHz
Y1
10k
12pF
L10
Q15
IRLL2705
4.7uH 1.5A
GND
GND
GND
R11712pF
1M DNP
C96
C95
AR1
100
ES1B
D29
12V
C59
C22
10uF 25V
1uF 25V
e10
FAN
1
2
P_FAN
FIGURE D-3:
dsVpp
AN1279
OFFLINE UPS REFERENCE DESIGN SCHEMATIC (SHEET 2 OF 8)
E2
GND
C102
33pF
R131
1M
GND
C103
33pF
R136
10k
5V
C101
2.2nF
Y2
7.3728MHz
2
1
GND
BTN
R122
10k
5V
GND
DB6
DB7
A0
E1
VPP
8
19
5V
2
3
4
5
6
7
10
9
LCD
GND
R130
10k
E1
DB0
DB2
DB4
DB6
2
4
6
8
10
12
14
16
18
20
A0
E2
DB1
DB3
DB5
DB7
5V
PIC18F2420-E/SO
VSS
VSS
MCLR/VPP
RA0/AN0
RA1/AN1
RA2/AN2/VREFRA3/AN3/VREF+
RA4/T0CKI
RA5/AN4/SS/LVDIN
OSC2/CLKO/RA6
OSC1/CLKI
U8
1
3
5
7
9
11
13
15
17
19
P5
R120
10k
R123
4k7
R121
4k7
RB0/INT0
RB1/INT1
RB2/INT2
RB3/CCP2
RB4
RB5/PGM
RB6/PGC
RB7/PGD
VDD
RC0/T1OSO/T1CKI
RC1/T1OSI/CCP2
RC2/CCP1
RC3/SCK/SCL
RC4/SDI/SDA
RC5/SDO
RC6/TX/CK
RC7/RX/DT
LED1
LED2
DB0
DB1
DB2
DB3
DB4
DB5
ICSP C
ICSP D
GND
C104
100nF
11
LED1
12
LED2
13
14
15
16
17
BTN
18
5V
20
21
22
23
24
25
26
27
28
D31
4k7
R134
5V
0R
0R
R133
0R
R132
0R
R129
R203
DNP
R126
DNP
R128
R204
DNP
1
2
R125
DNP
1
3
5
P6
2
4
6
5V
ICSP D
GND
R135
DNP
ICSP
No galvanic isolation!
Do not connect when UP S is connected to AC L
ICSP C
P_BZ
R124
DNP
5V
GND
Vpp
SDI
SDO
SCLK
SS
ine!
FIGURE D-4:
C100
100nF
R119
220e
AN1279
DS01279A-page 77
PGND
C146
1uF 25V
DSL2
LON2
LOP2
SDDL2
DSL1
LON1
LOP1
SDDL1
S4
S3
FLT_CLR
/SYS_FLT
FAULT/SD
PGND
GND
12V
PGND
C145
1uF 25V
GND
R46
4k7
GND
S6
S5
FLT_CLR
/SYS_FLT
FAULT/SD
PGND
GND
12V
FLT_CLR
GND
R43
4k7
GND
R44
4k7
1206
1e
R67
IR2214
1206
HIN
LIN
FLT_CLR
/SYS_FLT
/FAULT/SD
Vss
SSDL
COM
LON
LOP
Vcc
DSL
U5
1e
R66
IR2214
HIN
LIN
FLT_CLR
/SYS_FLT
/FAULT/SD
Vss
SSDL
COM
LON
LOP
Vcc
DSL
U3
FAULT/SD
/SYS_FLT
S4
S3
EGP10J
D19
DSH
Vb
N.C.
HOP
HON
Vs
SSDH
N.C.
N.C.
N.C.
N.C.
N.C.
EGP10J
D18
R49
4k7
DSH
Vb
N.C.
HOP
HON
Vs
SSDH
N.C.
N.C.
N.C.
N.C.
N.C.
R47
4k7
3V3 3V3
GND
R42
4k7
SDDH1
HOP1
HON1
DSH1
SDDH2
HOP2
HON2
DSH2
1uF 25V
C35
Plug AC Male
Not on P CB
PACin
2
3
1
1uF 25V
C41
L2
L1
R41
4k7
GND
F2
SDDL1
LON1
LOP1
DSL1
SDDL2
LON2
LOP2
DSL2
SDDH1
HON1
HOP1
DSH1
SDDH2
HON2
HOP2
DSH2
1kR65
3.3nF 25V
C37
3.3nF 25V
C33
Not on P CB
SW-DPST
S1
R62 12e
R61 47e
R60 1k
R59 12e
R58 47e
R57 1k
R54 12e
R53 47e
R51 1k
R48 12e
R45 47e
Filter
A2
R70
3k3
K2
R71
10k
J5
ACInN
C42
470pF
STGP14NC60KD
Q9
STGP14NC60KD
Q7
GND
Q11
BC817
J6
ACInL
PGND
3.3nF 25V
C38
C34
3.3nF 25V
R69
100e
PE
Not on PCB
GND
10k
R63
EGP10J
L1
D16
R55
10k
EGP10J
D13
A Ci1 m
S5
A Ci2 m
1N4148
D20
10k
R64
Q8
R72
12e
R40
1N4148
D15
100e 4W
12V
100nF
C39
AGND
J3
ACOutN
100nF
C40
R52
10k
Q6
BC817
R50
J4
ACOutL
5VA
A1
C36
4.7uF 305V
L2
250uH ETD54
3k3
U4
HXS 20-NP/SP2
GND
K1
Phoenix Contact DP DT MR...21- 21
C132
4n7 AGND
AGND
C43
10uF 25V
Im
Q10
STGP14NC60KD
STGP14NC60KD
R68
33e 12V
1206
EGP10J
L2
D17
R56
10k
EGP10J
D14
UDC
ref
12
gnd
1
3
5
7
1
3
5
7
out
11
2
4
6
8
2
4
6
8
Vc
9
DS01279A-page 78
10
FIGURE D-5:
A Co1m
S6
AN1279
OFFLINE UPS REFERENCE DESIGN SCHEMATIC (SHEET 4 OF 8)
A Co2m
No t on PCB
R165
82k 1%
1206
R172
82k 1%
1206
R164
82k 1%
1206
R171
82k 1%
1206
2k2 1%
AGND
2k2 1%
R186
R182
Tm+
82k 1%
1206
82k 1%
1206
5VA
R152
R151
C123
4.7nF
ACo2m
ACo1m
ACi2m
82k 1%
1206
82k 1%
1206
82k 1%
1206
R154
82k 1%
1206
82k 1%
1206
R153
82k 1%
1206
82k 1%
1206
82k 1%
1206
3k3 1%
R197
2k2 1%
R192
C130
100nF
AGND
AGND
AGND
2k2 1%
R178
2k2 1%
R158
2V5A
U11A
100nF
AGND MCP6022
1
C121
R174
R173
5VA
82k 1%
1206
82k 1%
1206
2V5A
R167
R166
2V5A
R145
R144
C118
4.7nF
C111
4.7nF
AGND
U11B
MCP6022
Tr
R198
3k3 1%
R176
2
A
C129
100nF
AGND
AGND
3V3
3V3
D38
BAR43S
ACo
100k 1%
R179
C122
3k3 1%
1
2
3
5VA
P7
R161
C115
4.7nF
3V3
Udcm+
Udcm-
C125
4.7nF
C128 R195
100nF
100k
AGND
AGND
R194
1k
3k3 1%
R185
IPm
D39
BAR43S
Ib
33k 1%
1206
R170
33k 1%
1206
R163
AGND
D41
BAR43S
Tb
C127
220pF
3V3
DNP
AGND
3V3
Ubm+
Ubm-
56k 1%
1206
56k 1%
1206
56k 1%
1206
D36
BAR43S
I
R150
R149
56k 1%
1206
56k 1%
1206
56k 1%
1206
R148
R141
R140
R139
AGND AGND
1k69 1%
R183
1k69 1%
R159
AGND
C120
4.7nF
Im
D35
BAR43S
ACi
U12A
100nF
AGND MCP6022
1
5VA
C119
4.7nF
3V3
AGND
C124
4.7nF
100k 1%
AGND
R188
AGND AGND
3k3 1%
C112
4.7nF
AGND AGND
1k69 1%
R169
33k 1%
1206
R184
3k3 1%
R156
AGND AGND
1k69 1%
R147
33k 1%
1206
R181
1k69 1%
R196
Ibatm+
Ibatm-
U10B
MCP6022
2k2 1%
R162
C114
4.7nF
3k3 1%
R193
C108
2k2 1%
R138
U10A
100nF
AGND MCP6022
1
5VA
8
4
8
4
ACi1m
R143
R142
8
4
8
4
10k
R190
AGND
C107
2k 1%
R137
C105
4.7nF
AGND
U12B
MCP6022
2k2 1%
R180
U9B
MCP6022
2k2 1%
R160
C113
4.7nF
U9A
100nF
AGND MCP6022
1
AGND
2k2 1%
R191
C116
4.7nF
AGND
2k2 1%
R177
C109
4.7nF
AGND
2k 1%
R157
5VA
8
4
8
4
R155
3k3 1%
R175
3k3 1%
R189
3k3 1%
4.7nF
C126
3V3
1k69 1%
R187
3V3
AGND
4.7nF
C117
AGND AGND
1k69 1%
R168
D40
BAR43S
IP
D37
BAR43S
Ub
D12
BAR43S
Udcm
AGND
C110
4.7nF
AGND AGND
1k69 1%
R146
3V3
FIGURE D-6:
C106
4.7nF
AN1279
DS01279A-page 79
Ubat
DS01279A-page 80
GND
R87
4k7
1206
R84
1206
150k
R80
1206
150k
R79
1206
150k
GND
68k
R78
0e
2
1
PAGND1
BR2
TEST
P10
BC856
Q13
GND
S3
SW-PB
R75
47k
R74
10k
GND
EGND
100pF 2kV
C80
GND
PGND
EGND
100pF 2kV
C81
3
2
4
8
10
7
5
6
9
PAGND1
EGND
EGND
UDC
LM5575
VIN
/SD
SYNC
RAMP
SS
RT
COMP
FB
AGND
IC1
C78
100pF 2kV
UBAT
1nF 25V
C56
100k
R77
0.33uF 100V
C45
2.2nF 25V
C57
R88
24k
C54
PAGND1
680pF 25V
C55
GND
1uF 25V
C48
C44
0.33uF 100V
C79
100pF 2kV
PGND
OUT
VCC
BST
SW
PRE
IS
GND
GND
12
11
1
16
14
15
13
C46
470nF 25V
GND
VOUT
GND
GND
TC1262-3.3
VIN
VR2
VOUT
GND
LM2904S-5.0
VIN
Needs heatsink on P CB
VR1
220nF 25V
C47
D22
ES3B
GND
GND
2.2uF 10V
C60
GND
C73
C75
2.2uF 10V 68uF 25V
LowESR
R81
10e
1206
C49
330pF
47uH 2.6A
L3
R82
10k
R221
1k
R220
2k2
R18
4k7
PAGND1
D47
D46
D45
R86
3k3
D21
BAV99
GND
GND
C50
power
1
3
5
7
P1
L8
L5
0805
BLM21PG221
3V3
0805
BLM21PG221
5V
GND
C51
C52
68uF 25V
LowESR
12V
12V
5VA
3V3A
AGND
C62
C61
2.2uF 10V 68uF 25V
LowESR
AGND
3V3A
D44
BZX85C16
GND
C68
C72
2.2uF 10V 68uF 25V
LowESR
AGND
5VA
0805
BLM21PG221
L6
68uF 25V
LowESR
2
4
6
8
68uF 25V
LowESR
C64
68uF 25V
LowESR
GND
C66
1uF 25V
R83
1k2
C53
1uF 25V
12V
5V
3V3
GND
FIGURE D-7:
R76
1206
150k
W1
R73
2-position header
1206 external ON/OFF switch F1
SMD075F/60
150k
(on enclosure)
Udc
AN1279
OFFLINE UPS REFERENCE DESIGN SCHEMATIC (SHEET 6 OF 8)
4k7
S2
C16
68uF 25V
LowESR
12e 1206
R19
D8
PS
TP7
R37
2k2
10k
GND
C30
68pF DNP
GND
IPm
ref1
U1A
5
ref2
U1B
3V3
LM393
GND 1
100nF C27 5V
DNP
R20
TP5
GND
C29
DNP
R36
1k
BAS21
D11
PGND
BAS21
D43
Q1C
FDP2532
GND
Q1B
FDP2532
1uF 100V
C13 C14
e5
e5
1uF 100V
Q1A
FDP2532
D4
current sense
1k
R10
12V
C12
1200uF
100V
PGND
1000uF 100V HT 105C
C11
1200uF
100V
PGND
BAS21
Ubm-
C20
PGND
D23
BAR43S100V
Q18
BC817
DNP
BAT-
J2
GND
Fext
Ubm+
Ubat
2x20A
BAT+ Slow Blow (on enclosure)
J1
EPP
3.3nF 25V
10k
R23
D7
BAS21
U2
MCP14E4
TP6
C28
Vvercurrent shutdown to driver
100pF DNP
C15
1uF 25V
12V
GND PGND
BR1
0e
R6
S1
4
3
2
1
I N_B
GND
I N_A
ENB_A
OUT_ B
VDD
OUT_ A
ENB_ B
5
6
7
8
DNP
4.7e R19A
4k7
4.7e R19B
R3
4.7e R19C
1k / 33e(CT)
1206 DNP
R5
1206
0.01uF
100V
D32
BAV99
10k
R24
D10
BAS21
0.01uF
100V
C24
T3 DNP
CT 1:1000
(optional)
12e 1206
R22
10R 3W
R17
10R 3W
R16
C23
1
2
P_CT
D1
D3
D24
100V
BAR43S
D9
D48
BAV99
C21
3.3nF 25V
C6
2.4k 3W
R7
PGND
10k
PGND
Q2B
FDP2532
D5
C8
2.4k 3W
R9
150pF 1kV
C2D05120
D28
150pF 1kV
C4
2.4k 3W
R4
Q2A
FDP2532
R21
BAS21
D2
C2D05120
current sense
1k
R11
12V
150pF 1kV
C2D05120
PGND
C1
2.4k 3W
R1
150pF 1kV
ETD54
C2D05120
T1
Q19
BC817
DNP
4.7e R22A
DNP
33e(CT)
DNP
4.7e R22B
Q3C
FDP2532
P9A
C5
C7
Udc
TP2
Udcm+
Tr
Tr
DNP
DNP
10k
R28
D6
GND
Tm+
C26
DNP
ref2
C17
DNP
ref1
Tm-
KTY81/122
DNP
RT1 DNP
Q5
BC807
3k3
R14
12V
DNP
DNP
GND
R30
R29
10k DNP
R25
GND
R13
R12
10k DNP
R8
C3
e15
.1uF 630V
Udcm470uF 400V HT 105C
DCPGND
C2
DC+
BZX84C3V6
P9B
e15
.1uF 630V
200H
L1
FIGURE D-8:
R2
AN1279
DS01279A-page 81
DS01279A-page 82
GNDUSB
GNDUSB
12pF
C135
12pF
C133
UVpp
1M
R200
20MHz
Y3
10k
R199
5VUSB
GNDUSB
GNDUSB
GNDUSB
1nF
C138
14
13
12
11
10
RB3/AN9/VPO
RB2/AN8/INT2/VMO
RA3/AN3/VREF+
RA4/T0CKI/RCV
RC4/D-/VM
PIC18F2450
RC5/D+/VP
VUSB
RC6/TX/CK
RC1/T1OSI/UOE
RC2/CCP1
RC7/RX/CK
VSS
OSC2/CLKO/RA6
RC0/T1OSO/T1CKI
VDD
OSC1/CLKI
RB0/AN12/INT0
RB4/AN11/KBI0
RA2/AN2/VREF-
Vss
RB5/KBI1/PGM
RA1/AN1
RB1/AN10/INT1
RB6/KBI2/PGC
RA5/AN4/HLVDIN
RB7/KBI3/PGD
UICSP D
MCLR/VPP/RE3
ICSP
5VUSB
RA0/AN0
U14
UICSP C
P8
15
16
17
18
19
20
21
22
23
24
25
26
27
28
GNDUSB
5VUSB
UICSP C
UICSP D
Vcc2
In A
Out B
GND2
Vcc1
Out A
In B
GND 1
ISO7221
J7
GND
D+
D-
VBUS
GNDUSB
C136
100nF
USB B 1-1470156-
1uF 25V
GNDUSB
GNDUSB
5VUSB
C137
L9
BLM21PG221
5VUSB
U13
0805
GND
3V3
C134
TX
RX
C131
100nF
GND
100nF
EGND
FIGURE D-9:
UVpp
AN1279
OFFLINE UPS REFERENCE DESIGN SCHEMATIC (SHEET 8 OF 8)
Note the following details of the code protection feature on Microchip devices:
Microchip products meet the specification contained in their particular Microchip Data Sheet.
Microchip believes that its family of products is one of the most secure families of its kind on the market today, when used in the
intended manner and under normal conditions.
There are dishonest and possibly illegal methods used to breach the code protection feature. All of these methods, to our
knowledge, require using the Microchip products in a manner outside the operating specifications contained in Microchips Data
Sheets. Most likely, the person doing so is engaged in theft of intellectual property.
Microchip is willing to work with the customer who is concerned about the integrity of their code.
Neither Microchip nor any other semiconductor manufacturer can guarantee the security of their code. Code protection does not
mean that we are guaranteeing the product as unbreakable.
Code protection is constantly evolving. We at Microchip are committed to continuously improving the code protection features of our
products. Attempts to break Microchips code protection feature may be a violation of the Digital Millennium Copyright Act. If such acts
allow unauthorized access to your software or other copyrighted work, you may have a right to sue for relief under that Act.
Trademarks
The Microchip name and logo, the Microchip logo, dsPIC,
KEELOQ, KEELOQ logo, MPLAB, PIC, PICmicro, PICSTART,
rfPIC and UNI/O are registered trademarks of Microchip
Technology Incorporated in the U.S.A. and other countries.
FilterLab, Hampshire, HI-TECH C, Linear Active Thermistor,
MXDEV, MXLAB, SEEVAL and The Embedded Control
Solutions Company are registered trademarks of Microchip
Technology Incorporated in the U.S.A.
Analog-for-the-Digital Age, Application Maestro, CodeGuard,
dsPICDEM, dsPICDEM.net, dsPICworks, dsSPEAK, ECAN,
ECONOMONITOR, FanSense, HI-TIDE, In-Circuit Serial
Programming, ICSP, ICEPIC, Mindi, MiWi, MPASM, MPLAB
Certified logo, MPLIB, MPLINK, mTouch, nanoWatt XLP,
Omniscient Code Generation, PICC, PICC-18, PICkit,
PICDEM, PICDEM.net, PICtail, PIC32 logo, REAL ICE, rfLAB,
Select Mode, Total Endurance, TSHARC, WiperLock and
ZENA are trademarks of Microchip Technology Incorporated
in the U.S.A. and other countries.
SQTP is a service mark of Microchip Technology Incorporated
in the U.S.A.
All other trademarks mentioned herein are property of their
respective companies.
2009, Microchip Technology Incorporated, Printed in the
U.S.A., All Rights Reserved.
Printed on recycled paper.
DS01279A-page 83
ASIA/PACIFIC
ASIA/PACIFIC
EUROPE
Corporate Office
2355 West Chandler Blvd.
Chandler, AZ 85224-6199
Tel: 480-792-7200
Fax: 480-792-7277
Technical Support:
http://support.microchip.com
Web Address:
www.microchip.com
India - Bangalore
Tel: 91-80-3090-4444
Fax: 91-80-3090-4080
India - New Delhi
Tel: 91-11-4160-8631
Fax: 91-11-4160-8632
Austria - Wels
Tel: 43-7242-2244-39
Fax: 43-7242-2244-393
Denmark - Copenhagen
Tel: 45-4450-2828
Fax: 45-4485-2829
India - Pune
Tel: 91-20-2566-1512
Fax: 91-20-2566-1513
France - Paris
Tel: 33-1-69-53-63-20
Fax: 33-1-69-30-90-79
Japan - Yokohama
Tel: 81-45-471- 6166
Fax: 81-45-471-6122
Germany - Munich
Tel: 49-89-627-144-0
Fax: 49-89-627-144-44
Atlanta
Duluth, GA
Tel: 678-957-9614
Fax: 678-957-1455
Boston
Westborough, MA
Tel: 774-760-0087
Fax: 774-760-0088
Chicago
Itasca, IL
Tel: 630-285-0071
Fax: 630-285-0075
Cleveland
Independence, OH
Tel: 216-447-0464
Fax: 216-447-0643
Dallas
Addison, TX
Tel: 972-818-7423
Fax: 972-818-2924
Detroit
Farmington Hills, MI
Tel: 248-538-2250
Fax: 248-538-2260
Kokomo
Kokomo, IN
Tel: 765-864-8360
Fax: 765-864-8387
Los Angeles
Mission Viejo, CA
Tel: 949-462-9523
Fax: 949-462-9608
Santa Clara
Santa Clara, CA
Tel: 408-961-6444
Fax: 408-961-6445
Toronto
Mississauga, Ontario,
Canada
Tel: 905-673-0699
Fax: 905-673-6509
Australia - Sydney
Tel: 61-2-9868-6733
Fax: 61-2-9868-6755
China - Beijing
Tel: 86-10-8528-2100
Fax: 86-10-8528-2104
China - Chengdu
Tel: 86-28-8665-5511
Fax: 86-28-8665-7889
Korea - Daegu
Tel: 82-53-744-4301
Fax: 82-53-744-4302
Korea - Seoul
Tel: 82-2-554-7200
Fax: 82-2-558-5932 or
82-2-558-5934
China - Nanjing
Tel: 86-25-8473-2460
Fax: 86-25-8473-2470
China - Qingdao
Tel: 86-532-8502-7355
Fax: 86-532-8502-7205
Malaysia - Penang
Tel: 60-4-227-8870
Fax: 60-4-227-4068
China - Shanghai
Tel: 86-21-5407-5533
Fax: 86-21-5407-5066
Philippines - Manila
Tel: 63-2-634-9065
Fax: 63-2-634-9069
China - Shenyang
Tel: 86-24-2334-2829
Fax: 86-24-2334-2393
Singapore
Tel: 65-6334-8870
Fax: 65-6334-8850
China - Shenzhen
Tel: 86-755-8203-2660
Fax: 86-755-8203-1760
China - Wuhan
Tel: 86-27-5980-5300
Fax: 86-27-5980-5118
Taiwan - Kaohsiung
Tel: 886-7-536-4818
Fax: 886-7-536-4803
China - Xiamen
Tel: 86-592-2388138
Fax: 86-592-2388130
Taiwan - Taipei
Tel: 886-2-2500-6610
Fax: 886-2-2508-0102
China - Xian
Tel: 86-29-8833-7252
Fax: 86-29-8833-7256
Thailand - Bangkok
Tel: 66-2-694-1351
Fax: 66-2-694-1350
Italy - Milan
Tel: 39-0331-742611
Fax: 39-0331-466781
Netherlands - Drunen
Tel: 31-416-690399
Fax: 31-416-690340
Spain - Madrid
Tel: 34-91-708-08-90
Fax: 34-91-708-08-91
UK - Wokingham
Tel: 44-118-921-5869
Fax: 44-118-921-5820
China - Zhuhai
Tel: 86-756-3210040
Fax: 86-756-3210049
03/26/09
DS01279A-page 84