Documente Academic
Documente Profesional
Documente Cultură
DRM064
Rev. 0
09/2004
freescale.com
by: Ivan Feno, Pavel Grasblum and Petr Stekl Freescale Semiconductor Czech System Laboratories Roznov pod Radhostem, Czech Republic To provide the most up-to-date information, the revision of our documents on the World Wide Web will be the most current. Your printed copy may be an earlier revision. To verify you have the latest information available, refer to: http://freescale.com/ The following revision history table summarizes changes contained in this document. For your convenience, the page number designators have been linked to the appropriate location.
Revision History
Date 09/2004 Revision Level 0 Initial release Description Page Number(s) N/A
Contents
Chapter 1 Introduction
1.1 1.2 1.2.1 1.2.2 1.2.3 1.3 Application Outline . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The UPS Topologies and Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Passive Standby UPS Topology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Line-Interactive UPS Topology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . On-Line UPS Topology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . MC9S12E128 Advantages and Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 13 14 15 16 17
35 36 36 37 39 39 41 41 41 42 45 47 47 50 61
Contents
PFC Booster Operational Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . PFC Booster Design Considerations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Output Inverter Operational Description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Output Inverter Design Considerations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
61 64 68 71
Appendix A. Schematics
A.1 A.2 A.3 A.4 A.5 A.6 Schematics of Power Stage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Schematics of User Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Schematics of Input Filter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Parts List of UPS Power Stage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Parts List of User Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Parts List of Input Filter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105 115 117 119 123 124
Contents
Figures
1-1 1-2 1-3 2-1 2-2 2-3 2-4 2-5 2-6 3-1 3-2 3-3 3-4 3-5 3-6 3-7 3-8 3-9 3-10 4-1 4-2 4-3 4-4 4-5 4-6 4-7 4-8 4-9 4-10 4-11 4-12 4-13 4-14 4-15 4-16 4-17 4-18 4-19 4-20 4-21 4-22 5-1 Passive Standby UPS Topology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Line-Interactive UPS Topology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . On-Line UPS Topology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . System Concept of UPS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . UPS Power Stage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Input Filter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . User Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . MC9S12E128 Controller Board. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Overall View of the UPS Demo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Battery Charger Algorithm. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . PFC Control Algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Hysteresis Control of Input Current . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Push-Pull Converter PWM Patterns . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . dc/dc Step-Up Converter Control Algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Sine Wave Modulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Inverter Control Algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Simulated PID Controller Response on Input Step . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Quality Control of Non-Linear Load. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Calculation of Phase Difference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . System Concept of UPS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . UPS Power Stage Block Schematic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Battery Charger Schematics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Battery Charger Transformer Winding Layout. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-Stage Charging Algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Auxiliary SMPSs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Isolated Flyback Converter for Drivers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Flyback Power Transformer Layout of Windings. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . dc/dc Converter Schematic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . dc/dc Converter Simulation Model Schematic. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Simulated Magnetizing Voltage and Magnetic Charge . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Simulated Primary Winding Current . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Simulated Secondary Winding Current . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Simulated Drain-to-Source and Gate-to-Source MOSFETs Voltages. . . . . . . . . . . . . . . . . . dc/dc Power Transformer Layout of Windings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Inverter MOSFET Power Analysis. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Rectifier Diode Voltage and Current Waveform . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Secondary Voltage and Rectified Current Waveforms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . PFC Power Stage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . PFC Current Controller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Output Inverter Power Circuit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Inverter IGBT Gate Drive Circuitry . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Main Data Flow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Single Phase On-Line UPS Using MC9S12E128 Freescale Semiconductor 9
14 15 16 19 20 20 21 21 22 26 27 28 28 29 30 31 31 32 34 35 36 38 40 41 42 44 47 48 49 51 53 54 55 56 58 59 61 62 63 69 70 74
Figures
5-2 5-3 5-4 5-5 5-6 5-7 5-8 5-9 6-1 6-2 6-3 6-4 6-5 6-6 6-7 6-8 6-9 6-10 6-11 6-12 6-13 6-14 7-1 7-2 7-3 7-4 7-5 7-6 7-7 7-8 7-9 7-10 7-11 7-12 7-13 7-14 7-15 7-16
Application State Machine. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77 Background Loop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79 Structure of PMF Interrupt. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80 Structure of ATD Conversion Complete Interrupt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81 TIM0 CH4 Input Capture Interrupt. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82 Structure of TIM0 CH5 Output Compare Interrupt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82 Structure of TIM0 CH6 Output Compare Interrupt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83 CPU Load of UPS Application. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84 Non-Linear Load . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87 Overall Efficiency at Linear Load. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88 Output Voltage and Current at Linear Load . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88 Overall Efficiency at Non-linear Load . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89 Output Voltage and Current at Non-linear Load . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89 Output Frequency in Synchronized Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90 Output Frequency in Free-running Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90 Output Voltage and Current at Non-linear Load Detail . . . . . . . . . . . . . . . . . . . . . . . . . . . 91 Output Voltage and Current at Non-linear Load . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91 Power Factor Measurement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92 Load Step from 20% to 100% . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93 Load Step from 20% to 100% Detail. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93 Load Step from 100% to 20% . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94 Load Step from 100% to 20% Detail. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94 UPS Demo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98 UPS Input and Outputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99 UPS Serial Ports and External Battery Connector . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99 Execute Make Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101 UPS User Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103 UPS Project in FreeMaster . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104 Block Schematic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106 Auxiliary Power Supplies. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107 Battery Charger . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108 Control Board Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109 dc/dc Step-Up Converter. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110 Analog Sensing Circuits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111 PFC and Inverter IGBT Drivers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112 PFC and Inverter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113 PFC Current Control Circuit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114 UPS User Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116
Tables
2-1 4-1 4-2 4-3 4-4 4-5 4-6 4-7 4-8 4-9 4-10 4-11 4-12 4-13 4-14 5-1 5-2 5-3 6-1 A-1 A-2 A-3 On-Line UPS Specification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 Battery Charger Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 Input Design Parameters of Flyback Converter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39 Required Parameters of Flyback Transformer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40 Measured Values on the Sample . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40 dc/dc Converter Specifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47 dc/dc Transformer Specification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56 Digital PFC Specifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61 PFC Inductor Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66 Design Parameters for Core P/N: T175-8/90 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66 dc-bus Capacitor Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68 Output Inverter Specifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68 MKP 338 4 X2 Capacitor Reference Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71 Output Filter Inductor Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72 Design Parameters for Core P/N: T175-8/90 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72 Software Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75 Execution Time of Periodic Interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84 Size of UPS Application Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84 Summary of Measured Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95 Parts List of UPS Power Stage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119 Parts List of User Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123 Parts List of Input Filter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124
Single Phase On-Line UPS Using MC9S12E128 Freescale Semiconductor Freescale Semiconductor Internal Use Only Draft For Review - September 30, 2004 11
Tables
Single Phase On-Line UPS Using MC9S12E128 12 Freescale Semiconductor Internal Use Only Draft For Review - September 30, 2004 Freescale Semiconductor
Chapter 1 Introduction
1.1 Application Outline
This reference design describes the design of a single phase on-line uninterruptable power supply (UPS). UPSs are used to protect sensitive electrical equipment such as computers, workstations, servers, and other power-sensitive systems. This reference design focuses on the digital control of key parts of the UPS system. It includes control of a power factor correction (PFC), a dc/dc step-up converter, a battery charger, and an output inverter. The dc/dc converter and the output inverter are fully digitally controlled. The PFC and the battery charger are implemented by a mixed approach, where an MCU controls the signals for PFC current and battery current demands. The digital control is based on Freescale Semiconductors MC9S12E128 microcontroller, which is intended for UPS applications. The reference design incorporates both hardware and software parts of the system including hardware schematics.
NOTE Although specific tools, suppliers, and methods are mentioned in this document, Freescale Semiconductor does not recommend or endorse any particular methodology, tool, or vendor.
Introduction
LINE FILTER
BATTERY CHARGER AC
= DC
= DC
AC
SWITCH
INVERTER
BATTERY
Figure 1-1. Passive Standby UPS Topology During normal operation, while the mains line (the power cord for the ac line) is available, the load is directly connected to the mains. The battery is charged by the charger, if necessary. If a power failure occurs, the switch switches to the opposite position, and the load is powered from the batteries. An inverter converts the battery dc voltage level to an ac mains level. The inverter generates a square wave output. The advantage of passive standby topology is its low cost and high efficiency. The disadvantage is limited protection against power failures. Because the load is connected to the mains line through the filter only, the load is saved against short sags and surges.
BYPASS
LINE FILTER
AVR
BATTERY CHARGER AC
= DC
= DC
AC
SWITCH
INVERTER
+
BATTERY
Introduction
BYPASS
RECTIFIER IN
PFC
BATTERY CHARGER AC
DC = DC =
AC INVERTER = DC
OUT
= DC
BATTERY
Figure 1-3. On-Line UPS Topology As can be seen, the complexity of the on-line UPS is much greater than the other two topologies described in this section. This means that the cost is higher, and the efficiency is lower due to double conversion. However, the on-line UPS brings a much higher quality of delivered energy. The UPS generates a pure sine wave output with tight limits (typically 2%). Besides the power failures eliminated by previous topologies, the on-line UPS avoids all the failures relating to frequency disturbance, such as frequency variation, harmonic distortion, line noise, or other shape distortions.
Introduction
DC-AC
PFC L1 D1 D2 KBU8J IN IN + Q2 + C1 Q1 D3
C2 GND D5
+ Q3
D4
OUT
Filter
OUT
DC-DC Converter D6
D7 Q4
L2
T1 GND
Q5 D8 L3
Charger
(Flyback Converter)
GND BT1 D9 GND
Figure 2-1. System Concept of UPS Output is provided by an output inverter (Q1, Q3, D3, D4). The inverter converts the dc bus voltage back to a sinusoidal voltage using pulse-width modulation. The output inverter is fully controlled by the MCU and generates a pure sinusoidal waveform, free of any disturbance.
System Description
The battery BT1 supplies a load during the backup mode. There are two 12-V batteries connected in serial. The battery voltage level 24-V is converted to 390-V by the dc/dc step-up converter (Q4, Q5, D6-D9, L2, L3, and T1) using a push-pull topology fully controlled by the MCU. The last part of a UPS is a battery charger. The battery charger maintains a fully charged battery. It uses a flyback topology controlled by a mixed approach. The flyback converter is controlled by a dedicated circuit and the required output voltage and current limit are set by the MCU. A dedicated circuit is used due to the lower cost compared to direct MCU control. Where a different battery charger topology is used, there is still enough MCU power to provide digital control.
Figure 2-2. UPS Power Stage The UPS consists of four PCBs. Most components are situated on the power stage (see Figure 2-2). These are all the power components (diodes, transistors, inductors, capacitors, relays, and so on) and analog sensing circuits. The power stage is connected to the mains line (power cord for the ac line) through an input line filter, realized on the next PCB (Figure 2-3).
System Concept
Figure 2-4 shows the user interface PCB. It includes two buttons (ON/OFF, BYPASS), four status LEDs (on-line, on-battery, bypass, and error), and six LEDs indicating output power or remaining battery capacity. There are also two serial RS232 ports, which can used for communication with the PC. The user interface provides an extension of the serial ports, which are implemented on the MC9S12E128 controller board.
System Description
Figure 2-5 shows a controller board for the MC9S12E128. The MC9S12E128 controller board is designed as a versatile development card for developing real-time software and hardware products to support a new generation of applications in UPS, servo and motor control, and many others. The power of the 16-bit MC9S12E128, combined with Hall-effect/quadrature encoder interface, circuitry for automatic current profiling, over-current logic and over-voltage logic, and two isolated RS232 interfaces, makes the MC9S12E128 controller board ideal for developing and implementing many motor controlling algorithms, UPS, SMPS, as well as for learning the architecture and instruction set of the MC9S12E128 processor. For more detailed information on the MC9S12E128 controller board, see [33]. An overall view of the assembled UPS is shown in Figure 2-6.
System Specification
System Description
UPS Control
IBAT = Imax
no
Control Techniques
SINUS GENERATION Zero Cross Top DC Overvoltage Bottom Overvoltage Top DC Bus Voltage Bottom DC Bus Voltage
AN07 AN08
Figure 3-2. PFC Control Algorithm The current control loop is partially performed by an external circuit. This control technique is also called indirect PFC control. The external circuit compares the actual input current with a sine wave reference. If the actual current crosses the lower border of sine waveform, the PFC transistor is switched on. As soon as the input current reaches the upper border, the PFC transistor is switched off. The resulting input current can be seen in Figure 3-3. Maximal switching frequency (50 kHz) corresponds to the hysteresis defined by resistors R664 and R675. (see Figure 4-20)
UPS Control
Hysteresis Levels
Sine Reference
Input current
Figure 3-3. Hysteresis Control of Input Current The software part of the current loop generates the sine wave reference. The sine wave reference is synchronized to be in phase with the input voltage. The sine wave generator is calculated every 50 s. The sine waveform is generated directly by the D/A converter within the range of the voltage reference. The voltage control loop is fully implemented by software. The sensed dc bus voltage is compared with the required dc bus voltage, 390 V. The difference inputs to the PI controller. The PI controller output directly defines the amplitude of the input current. The PI controller constants were experimentally tuned to get an aperiodic responds to the input step. The constants are P = 100 and T I = 0.016 s. The voltage control loop is calculated every 1 ms. The two hardware faults are immediately able to disable the PWM outputs in case of a dc bus over voltage. The digital output, PU8, enables/disables the external logic providing the current loop.
PWM 4
PWM 3
Control Techniques
The control algorithm is depicted in Figure 3-5. Both dc bus voltages pass the digital filter, and their sum is compared with the required value of the dc bus voltage. Based on the error, the PI controller sets the desired duty cycle of the switching transistors. During mains line operation, the required value of the dc bus is set to 720 V (2 x 360 V). Because the dc bus is kept by the PFC at 780 V (2 x 390 V), the dc/dc converter is automatically switched off. In case of mains failure, the dc bus voltage will start to fall. As soon as the voltage reaches the value 720 V, the dc/dc converter is activated. At 720 V, there is still 20 V reserve in amplitude to generate a maximum output voltage of 240 V RMS. As soon as the operation from batteries is recognized, the required value of the dc bus voltage is increased back to 780 V. The PI controller maintains the constant voltage on the dc bus independent of the load until the mains is restored or the battery is fully discharged. If the battery is discharged, the UPS output is deactivated and UPS stays in STANDBY ON BATTERY mode. After 1 minute, the UPS is switched off. The PI controller constants were experimentally tuned in the same way as the PFC. The constants are P = 39 and TI = 0.0033 s. The control loop is calculated every 1 ms.
FAULT1 FAULT0 + +
F I L T E R
Top DC Overvoltage Bottom DC Overvoltage Top DC Bus Voltage Bottom DC Bus Voltage
AN07 AN08
UPS Control
+DCBUS
-DCBUS
Figure 3-6. Sine Wave Modulation The control algorithm can be seen in Figure 3-7. The main control loop comprises of the PID controller and a feed forward control technique. The required value entering the PID controller is generated by a sine wave generator, optionally synchronized with input voltage. The same value is added directly to the output of the PID controller. It is called the feed forward technique, and it improves the responds of control loop. The amplitude of the sine wave reference is corrected by RMS correction, which keeps the RMS value of the output voltage independent of any load. The RMS correction uses the PI controller. The PI constants were experimentally tuned, and set to P = 0 and TI = 0.00936. The PID controller was tuned using simulation in MATLAB. The results of the simulation can be seen in Figure 3-8 and Figure 3-9, with P = 0.6, TI = 0, TD = 0.00071 s, and N = 31. The value N represents the filter level of D portion EQ 3-5. The result of the PID controller, including feed forward, is scaled relative to actual dc bus voltage. Then the exact duty cycle is set to the PMF module.
Control Techniques
UPS Control
1u ( t ) = K e ( t ) + ---TI
t 0
e ( ) d
(EQ 3-1)
1u ( t ) = K e ( t ) + ---TI
t 0
de ( ) d + T D ---- e ( t ) dt
(EQ 3-2)
(EQ 3-3)
(EQ 3-4)
To improve the response of the PID controller to noisy signals, the derivative portion is often replaced by a derivative portion with filter:
sT D sTD -----------------sT D 1 + -------N
(EQ 3-5)
For implementation of algorithms on MCU the equations EQ 3-3 and EQ 3-4 have to be expressed in discrete time domain like:
u ( kh ) = P ( kh ) + I ( kh ) + D ( kh )
(EQ 3-6)
Control Techniques
where
P ( kh ) = K e ( kh ) Kh I ( kh ) = I ( kh h ) + ------ e ( kh ) TI TD KT D N D ( kh ) = -------------------- D ( kh h ) -------------------- e ( kh h ) T D + Nh T D + Nh
e ( kh ) = w ( kh ) m ( kh )
and e(kh) w(kh) m(kh) u(k) P(kh) I(kh) D(kh) TI T, h K t s N = = = = = = = = = = = = = Input error in step kh Desired value in step kh Measured value in step kh Controller output in step kh Proportional output portion in step kh Integral output portion in step kh Derivative output portion in step kh Integral time constant Sampling time Controller gain Time Laplace variable Filter constant
UPS Control
The PLL algorithm measures a period from last two zero crossing signals. Because calculation of the phase increment to the sine wave table requires a division instruction EQ 3-11, the phase over one-half period is calculated instead:
T Phase Increment = 32767 ---------------Period
(EQ 3-11)
where T 32767 Period = = = period of sine wave algorithm (50 s) 180 in sine wave look up table measured period of main line voltage
If phase increment just corresponds to the measured period we should get a phase of 180. If there is some difference, the phase increment must be adjusted (see Figure 3-10). Based on the sign of the phase difference, the phase increment is incremented or decremented by the value which is equal to the phase difference multiplied by the PLL constant. If the phase difference falls below some limit for last 20 periods, the PLL is locked to the line frequency and a frequency locked status bit is set.
Actual Period
Phase Difference
Figure 3-10. Calculation of Phase Difference Now the PLL is running with the same frequency as the mains line, but the phase is still different. As soon as the frequency status bit is set, the actual phase is adjusted to 0 or 180 according to the previous polarity of the input voltage. The polarity of the input voltage is sensed in the middle of each period.
Figure 4-1. System Concept of UPS The UPS reference design provides both a ready-to-use hardware and a ready-made software development platform for an on-line UPS, under 1000 VA output power, and controlled by a single 16-bit MCU. The UPS power stage consists of several system blocks shown as: Battery Charger Auxiliary Power Supplies Control Board Interface dc/dc Step-Up Converter PFC + Inverter
Hardware Design
J100
J101 PSH02_02P
1 2
+VBAT
F101
+VBAT -VBAT
GNDA GND
GND_PFC +15V_PFC
+5V_REF
1 2
3 4
/POWER_EN POWER_EN
+15V_TOP -5V_TOP +15V_BOT -5V_BOT GNDA +15V_PFC GND_PFC PFC+Inverter GND_BOT GND_TOP
J106
+5V_REF
+5V_REF
GNDA GND
GND_PFC +15V_PFC
PE MH100
PE CONNECTION
L1 L2 N PE PWM_TOP PWM_BOT
Control Board Interface GNDA GND +5V_D +5V_A +15V
J107 J108
DCB_POS DCB_NEG
FAULT0 FAULT1
J109
J110
1 2
PSH02_02P J111
AD1 AD4 UNI-3_PWM2 AD5 UNI-3_PWM3 AD6 UNI-3_PWM4 UNI-3 PHAIS UNI-3_PWM5 UNI-3 PHCIS UNI-3 DCBI UNI-3 PFC_EN UNI-3 DCBV UNI-3 SERIAL UNI-3 BEMFZCA UNI-3 BEMFZCC UNI-3 BEMFZCB UNI-3 PFC_ZC DA0 DA1 Fault1 Fault0
GND GNDA +VBAT -VBAT
1 2
PSH02_02P
DC-DC Step Up
Battery Charger
NOTE The output values are set to the values recommended by the battery manufacturer. The current limits can be set to any value by SW.
D302 B250R
+
D303 P6KE200
1 R302 1M
T300
D301 BYW29E-200 13 LINE_OK 9 7 D304 1N4148 C303 100nF 220uF/50V + C304 C305
L
-
R304 39k
D305 BYV26C
6 R306 1M TR02/MC145
R305 1k8 +
R307 620
R309 2k4 D
R311 33k
G L301
sense
U300
7
L
2
C
R300 0.1
sense
R312 200 S
47uH 1 R313 27R 3 R315 7.5k C316 100n 2 4 ISO300 SFH615A-2 GND_CH 1 R329 1K IBAT1
CONTROL
GND
TOP249Y
5 3
R308 3K6
R316 220
R317 33K
+5V_A
100nF
R321 1k6
R322 220
C314 N/P
GND GND_CH R326 3k9 R323 1k R324 1k R327 560 470nF GND C312 D307 R328 68K C313 100nF/100V R330 10k G Q302 S MMBF0201NLT1 GND D
IBAT2
IBAT1
R319 1k6
C308
8
GND BC847
Q300
+ -
1 U301A MC33502
IBAT_CONTROL
LINE_OK
/POWER_ON
C310 470nF
C311
BAV103
IBAT
GND_TR
Battery Charger
The calculated parameters of the flyback transformer are specified in Table 4-3. The measured values on the manufactured sample are listed in Table 4-4. To decrease leakage inductance, the interleaved winding layout is used for the primary winding. The complete transformer winding layout is shown in Figure 4-4.
Hardware Design
L4 L3 L2 L1
2.5kV insulation layer 20T Cu f 4x0.315mm 2.5kV insulation layer 12T Cu f 3x0.56mm 2.5kV insulation layer 5T Cu f 2x0.315mm 2.5kV insulation layer 20T Cu f 4x0.315mm
14
Core
ETD29/16/10 N87 B66358-G-X187 ETD29/16/10 N87 B66358-G500-X187 Coil former B66359-J1014-T1 Yoke B66359-A2000
(EPCOS components)
L3
L1
L4
L2
7
Battery Charger
Hardware Design
As the name of algorithm suggests, charging consists of three stages. The charging starts with the current limit 0.25 of battery capacity. The battery charger works in current mode until the battery voltage reaches the high level voltage (2.45 V/cell). This stage is called bulk charging. As soon as the battery voltage reaches the high level, the current starts to fall, and the absorption stage begins. Once the battery current falls under 0.05 of battery capacity, the battery charge voltage is set to the low level (2.28 V/cell). The last stage is called the float stage.
NOTE The voltage levels and current thresholds come from the battery manufacturer. The values may also vary with the temperature if temperature measurement is implemented.
U202 LM2575-5
4 2
L202 470uH D210 1N5819 + C215 220uF/10V
TP204 +5V_D
+5V_D
/POWER_EN
1
R200 510 D211 KA3528LSGT GND GND TP200 +15V
3
+ D R213 100 G C216 22uF/50V
POWER_EN
GND
GND
GND
U200 LM2575-15
4 2
L203 680uH D213 1N5819
+15V
1
R215 20K R214 2.4k + R216 1.8K C217 220uF/10V
3
+ C218 22uF/50V
1 2
D214 KA3528LSGT
GND
GND
GND
GND
GND
GND
3
C221 100nF
U203 MC78L05ACP
VIN GND
VO
C200 100nF
GNDA
GNDA
GNDA
Supply voltages for the microcontroller and other digital circuits (+5V_D) are generated by U202. U200 is used to stabilize +15V for the flyback converter, relays, dc/dc MOSFETs drivers, and cooling fans and it is used as a down-converter for U203 in order to lower the power loss dissipated by U203. The IC supplies 5 V for op amps, comparators, and the heatsink temperature sensor. The output voltage is further filtered and used as a reference for the signal and control circuits. In order to switch-on and switch-off all the control and signal circuits, U200 and U202 are controllable by POWER_EN and /POWER_EN signals. POWER_EN signal is driven by the microcontroller to control the switch-off process. /POWER_EN signal is grounded when the ON button is depressed. All the power supplies are put into an operational state, the micro starts to execute the program, and the POWER_EN signal is then put into the active state to hold the supplies operational even when the button is released. Figure 4-7 shows the isolated flyback converter schematic that provides the inverter and PFC drivers with a power supply. MOSFET Q201 is driven by UC3843 in a classic current-mode configuration without the feedback loop. The supply is designed to deliver constant power to the output while access power is dissipated in zener diodes D202-D203, D206-D207, and D209 in case of drivers-in-standby. Respective zener diodes are used specifically to split the secondary voltage to 5-V and 15-V levels.
C201 T1
100pF
12
8z.
+15V L201 330u R202 R203 15k R206 8.2k + C206 330uF 15k D204 U201 GND D G S R209 1k C212 100pF GND R210 1.8 D1
1
C204 47nF
11 8
D202 BZV55/15V
5z.
8z.
7 6
C205 100pF D205 R205 220
TP210 -5V_TOP
2
R204 220
1 2 3 4
8 7 6 5
C209 100nF
MMBD914LT1 R207 33
6z.
5
TR01/MC145
UC3843
Q201 NTF3055
C208 100pF
LL4448
GND
GND
GND
GND
GND
GND
C213 100pF
-5V_BOT
+15V_PFC
C214 220uF/25V
GND_PFC
GND_PFC
Because the voltage is equal, the equality of these charges also provides equal energies. When we compare both equations, we get
P IN t ON I 1P -------- T = ------------------V IN 2
The peak secondary current for a 20-V output is calculated using EQ 4-6 (all the output power is considered), and the secondary winding inductance L2 is then given by EQ 4-7.
V IN 15 L 1 = -------- dt = ------------ 1.5 = 38H di 0.586 P OUT T 1.6 3.3 I 1P = 2 ------------ --------- = 2 ------ ---------- = 293mA 20 1.8 V OU T t O FF V OU T 20 L 2 = ------------- dt = ------------ 1.8 = 123H di 0.293
(EQ 4-3)
(EQ 4-4)
Hardware Design
Lets choose a RM8 core made from N97 ferrite material, with Ae = 64mm 2 and AL = 3300 nH. Respective winding turns are as follows:
N1 = LP ------ = AL LS ------ = AL 38 -------------- = 3.4 4t 3300n 123 -------------- = 6.1 6t 3300n
(EQ 4-8)
N2 =
(EQ 4-9)
(EQ 4-10)
For supplying the PFC driver, 15-V supply voltage is necessary and the turns ratio between both secondaries is used to calculate the number of turns for the PFC driver.
15 15 N 4 = ----- N 2 = ----- 6 = 4.5t 20 20
(EQ 4-11)
Rounding the number up or down would cause large unbalanced secondary voltages. Secondary turns are then scaled to obtain appropriate secondary-to-secondary ratio. Afterwards, primary turns are also altered. In this case, N2 = 8t gives exact value of N 4 = 6t as follows:
15 15 N 4 = ----- N 2 = ----- 8 = 6t 20 20
(EQ 4-12)
(EQ 4-13)
To maintain a discontinued conduction mode, the switching frequency has to be also altered to the value of 200 kHz. And the maximum flux has to be checked - simulation shows flux of amplitude 160 mT. Figure 4-8 shows the layout of the windings on the transformer bobbin.
L4 L3 L2 L1
Core Coil former Clamp
2.5kV insulation layer 6T Cu f 0.25mm 2.5kV insulation layer 8T Cu f 0.25mm 2.5kV insulation layer 8T Cu f 0.25mm 2.5kV insulation layer 5T Cu f 0.25mm
12
L3 L1
1
L2 L4
6
RM8 N97
(EPCOS components)
Figure 4-8. Flyback Power Transformer Layout of Windings
DCB_NEG
+VBAT
680u/50V 1 1
+Bat
-VBAT
680u/50V
680u/50V GND_BAT
680u/50V
FFPF05U120STU D500
1 D504 FFPF05U120STU 10 GND 13 15 D505 FFPF05U120STU 18 T500 TR03/MC145 9 1 1 2 R503 100R/1W 4 6 2 1 C508 1n GND_BAT D503 L502 650u/1A
+15V
L500 330u
GND_BAT
TP501 PWM_4
VCC
8 7 1 R505 10 2 G
U501 8 NC 7 OutA
6 VCC
MC33152D NC InA
1 2 TP502 PWM_5
R506 10
5 OutB GND 3
InB
GND_BAT
GND_BAT
The converter performance and features are analyzed by simulation with the model shown in Figure 4-10.
DC Bus
D1
L9
K K1
0
390 2 L11 20n R16 4700 C3 10p D3 C6 10p 1 R17 4700 D4 1 mur2100e/ON mur2100e/ON 560u 1 mur2100e/ON L17 2 0.3 R9 1 2 L12 20n C10 10p R23 2k D8 C8 22n R19 1000 2 V5 R6 50m R29 524meg
L14 20n
Inverter Model
Current Sensing
V3
K_Linear COUPLING = 1
K K2
D1N4149 D12
20
0
1 1 L19 80u 80m 2 L20 1.6m 2 R25 3 C11 5p R26 1k D6 D1N4149 D9 D1N4149 R27 220 R24 22
C12 10n
Hardware Design
The inverter is supplied by a set of a low-ESR capacitors, C502-C505 and C512-C513, to lower the battery bus ripple current and hence the EMI signature of the converter input. Inverter MOSFETs Q500-Q503 are driven by MC33152 drivers. MOSFETs drain voltage ringing is damped by RC cells R504-C507 and R503-C508. Because of the voltage source character of the inverter, the rectifier has to be a current type, which is why smoothing chokes L501 and L502 are used. Over voltage spikes across the rectifier diodes, due to the diodes reverse-recovery and transformer leakage, are clamped by RCD snubbers consisting of a R501- C501- D501 for the positive side, and R502 - C506 - D503 for the negative side.
(EQ 4-14)
where ui N = = = = = induced voltage linkage flux in the core number of turns flux in the core flux density in the core
u i dt = N S B
(EQ 4-15)
Initially, the magnetic charge has to be calculated. Since the induced voltage during an active part of the converter operational cycle is constant and it equals the input voltage, the magnetic charge in the core is given by EQ 4-16.
u i dt = V IN T
(EQ 4-16)
where VIN T = = = input voltage switching duty cycle switching period (f = 50kHz)
u i dt = 24 0.45 20 10 = 216 Vs
6
Simulation results can also be used to obtain the magnetic charge. Figure 4-11 shows simulated magnetizing voltage and magnetic charge. Magnetic charge is obtained by the time integral of the magnetizing voltage. Peak-to-peak reading of the magnetic charge is 218 V. Rearranging EQ 4-15, the number of primary turns can be calculated:
u i dt 6 216 10 --------------- = ---------------------------------- = 3.12 t N1 = S B 173 106 0.4
40V
100u
20V
0V
-100u
-20V
-200u
-40V
20us V(L1:1,L1:2) 2
25us S(V(L1:1,L1:2))
(EQ 4-17)
(EQ 4-18)
30us Time
35us
40us
45us
Hardware Design
Lets choose 3 turns. However, the flux density travel B has to be checked:
u i dt 6 216 10 B = ------------- = ----------------------------- = 416 mT S N 1 173 106 3
(EQ 4-19)
From EPCOS Siferit N97 specification (FAL0625-W @60C), the core power loss is 10 W, indicating a good core utilization. However, forced convection should be considered. The negative loss temperature coefficient of the N97 material is advantageous since it contributes to a temperature stability of the core (FAL0624-N). Now, the number of turns of the secondaries can be calculated. For primary to secondary ratio and a forward type of converter, equation EQ 4-20 is valid:
V OU T p = ---------------------------------V IN MA X
(EQ 4-20)
For efficiency = 0.93 and maximum duty (MAX) = 0.98, EQ 4-20 yields
V OUT 350 p = ---------------------------------- = ----------------------------------- = 18.47 V IN MAX 21 0.93 0.97
(EQ 4-21)
Primary to secondary ratio is rounded to 18, and the secondary winding number of turns yields
N 2 = p N 1 = 18 3 = 54t
(EQ 4-22)
Once the winding turns are determined, the cross sectional area of a winding can be calculated. For the ETD44 core, winding current density can be selected in the range 5-10A/mm 2. Let J = 8A/mm2. Primary cross-sectional area is given by EQ 4-23
I1 2 19.1 S 1 = --- = --------- = 2.39 mm J 8
(EQ 4-23)
where 1 = nominal primary winding current obtained by integrating the square of the simulated winding current (Figure 4-12).
60A
915m
40A
910m
20A
905m
0A
900m
-20A
2.3120ms
2.3160ms
2.3200ms
2.3240ms
2.3280ms
Time
Figure 4-12. Simulated Primary Winding Current Secondary cross-sectional area is given by EQ 4-24:
I2 2 0.74 S 2 = --- = --------- = 0.093 mm J 8
(EQ 4-24)
where 2 = nominal secondary winding current obtained by integrating the square of the simulated winding current (Figure 4-13).
Hardware Design
1.5A
1.300m
1.0A
1.296m
0.5A
1.292m
-0.0A
1.288m
-0.5A
1.284m
-1.0A
1.280m
-1.5A
2.3120ms
2.3160ms
2.3200ms
2.3240ms
2.3280ms
Time
Figure 4-13. Simulated Secondary Winding Current For a 50kHz switching frequency the skin effect depth is given by EQ 4-25:
0.066 0.066 = ------------ = --------------------- = 295 m 3 f 50 10
(EQ 4-25)
In this case the best solution for the primary is the use of a copper foil. An ETD44 bobbin has a width of 30 mm. Because of the necessary creepage, the foil width is set to 25 mm. Based on the result of EQ 4-23, the foil thickness yields 100 m and has excellent skin performance when compared with skin depth at the current switching frequency. From the result of EQ 4-24, the secondary winding wire diameter yields 0.338 mm. The nearest wire diameter in production is 0.315mm. A wire with a larger diameter is not helpful any more because of the increased ac resistance due to the skin effect. The primary winding of the push-pull converter transformer uses a center-tapped windings as well as the secondary windings. As the power transformer is a part of the push-pull converter, there are some restrictions required, especially with respect to the leakage inductance. With inverter transistor turn-off, the drain voltage in push-pull is not clamped by the circuit topology itself. For ideal case (zero leakage), the drain voltage is clamped through the transformer coupling when the rectifier diodes are re-opened.
60V
40V
20V
0V 9.458us 9.600us V(M1:d) V(M2:d) 9.800us V(M3:g) 10.000us V(M2:g) 10.200us Time 10.400us 10.600us 10.800us
Figure 4-14. Simulated Drain-to-Source and Gate-to-Source MOSFETs Voltages However, when leakage is non-zero, coupling between the primary and the secondary is not so close and the transformer acts more than an inductive load. As a result, inverter transistors receive voltage spikes and ringing at the drain voltage, usually leading to the use of MOSFETs with a higher break-down drain voltage (Figure 4-14). Due to the necessity to decrease the leakage inductance, an interleaved winding layout has to be used, as seen in Figure 4-15.
Hardware Design
L6 L5 L4 L3 L2 L1
2.5kV insulation layer 29T Cu f 0.315mm 2.5kV insulation layer 29T Cu f 0.315mm 2.5kV insulation layer 3T Cu stripe 25x0.15mm 500V insulation layer 3T Cu stripe 25x0.15mm 2.5kV insulation layer 29T Cu f 0.315mm 2.5kV insulation layer 29T Cu f 0.315mm
18
10
Core ETD44/22/15 N97 B66365-G-X197 2pcs Coil former B66366-B1018-T1 1pcs Yoke B66366-A2000 2pcs
(EPCOS components)
L6 L4
1
L2
L1 L3
L5
Figure 4-15. dc/dc Power Transformer Layout of Windings The transformer specification is presented by Table 4-6. The magnetizing inductance values are obtained from the manufacturer. The AL constant, total leakage, is obtained initially from numeric parametric simulation results, and afterwards is verified experimentally on the sample. Resistance values are measured values. Test voltages come from general standards defined for the inductive components used in SMPS. Measurements on the sample show that it is possible to achieve a relative leakage less than 0.6%. Table 4-6. dc/dc Transformer Specification
2.5mH+30-20% Magnetizing inductance referred to the secondary Magnetizing inductance referred to the primary 30H+30-20% Total leakage inductance referred to the secondary <20uH Primary DC resistance <1mOhm Secondary DC resistance <0.6Ohm Test Voltage secondary-to-secondary and primary-to-secondary 2kV AC Test Voltage primary-to-primary 150V AC
4.4.2.2 Inverter MOSFETs
As mentioned above, MOSFETs voltage rating is given by voltage spikes that can possibly occur during MOSFET switch-off. Of course it depends on the input voltage, load conditions, and transformer properties. For push-pull a number of twice the input voltage is usually sufficient. The current rating of the MOSFETs (chip size) is always a compromise because a small chip has large RDS(ON) that causes high conduction losses. On the other hand, a large chip has low RDS(ON), but the chip capacitances are higher, and, in the case of hard-switched topologies, the energy stored in the capacitances is not recovered in the switching process, but instead, energy is dissipated in the chip. This is especially the case in applications where the supply voltage is greater than 200 V.
Single Phase On-Line UPS Using MC9S12E128 56 Freescale Semiconductor
The primary factor for chip selection are the effective drain current and the switching frequency. Then a suitable device is selected. Power loss components are calculated and compared with the designed maximum power loss per package. Simulation results (Figure 4-12) show a value of 19.1 A (transistor and primary winding currents are the same). Dynamically, a current level as high as 50 to 60 A is observed when a load transient occurs and the regulator attempts to hold the output voltage level. Of course the transistor has to withstand such conditions for a number of milliseconds. A couple of ON Semis twin NTP45N06 could be a solution. RDS(ON) for the transistor is 26 m. If a single NTP45N06 switches the current with an effective value of 19.1 A, conduction losses are as high as 9.5 W. To lower the conduction losses and to ensure the transistor switching robustness in dynamic conditions, lets consider the twin NTP45N06 which decrease overall conduction losses to the half (power loss per package decreases to a quarter - 2.4 W). However, the switching and the capacitance losses have to be considered, due to the increased overall chip area, and hence the overall chip capacitance. Switching losses are given by EQ 4-26 (ref. [2]).
I SW P SW = V D S ( Q G D + Q GS2 ) f SW -------IG
3 30 P SW = 24 ( 3nC + 15nC ) 50 10 ------ = 0.72 W 0.9
where VDS QGD QGS2 fSW ISW IG = = = = = = drain-to-source voltage at the switching instance miller part of the gate charge post-threshold voltage gate charge switching frequency drain current at the instant of switch off available mean driver current
Note that VDS can reach a level close to 60V as depending on the particular duty cycle, input voltage, and output load conditions. The same is true for ISW parameter, and the loss value can be impacted.
CAUTION If the output load conditions or large transformer leakage cause over voltage spikes at the drain and the maximum drain voltage is reached, the voltage is clamped by MOSFET internal avalanche process (see Figure 4-14 fourth wave oscillation on green waveform). If the energy of the spikes is high enough, chip temperature will exceed the maximum limit and the semiconductor structure is destroyed. Please always observe the drain-to-source voltage when testing the prototype. If this is the case, increase the MOSFET voltage class or redesign the power transformer in order to decrease the leakage.
Hardware Design
Turn-on capacitance losses PCAP for the NTP45N06 are given by EQ 4-28.
1 2 P CAP = f SW W CAP = f SW -- C OSS ( EFF ) V D S 2 1 3 12 2 P CAP = 50 10 -- 380 10 60 = 34 mW 2
where fSW WCAP = = switching frequency capacitance energy (see ref. [1]) effective output capacity of the MOSFET (see ref. [2])
COSS(EFF) =
The sum of the switching and the capacitance losses is less than 0.8W per transistor at nominal conditions, resulting in 1.6 W for the single NTP45N06 solution and 3.2W for the twin solution. When all the loss contributions are compared, prevalence of the conduction losses is clear. The twin NTP45N06 solution results in an overall loss of 3.2W per package (the conduction component is 2.4 W, the switching component 0.8W). Therefore, the twin solution doesnt contribute significantly to lower a converter efficiency. Power loss 3.2 W per package means moderate package utilization for TO220, with a good power loss margin. The power losses can also be calculated by simulation of the model. Figure 4-16 shows the MOSFET instantaneous power and energy obtained by instantaneous power integration. The average power is then calculated by the definition of the power - the energy loss referred to the switching period.
400W
8.04m
200W
8.00m
0W
7.96m
>> -200W
7.92m 2.208ms 1
W(M3)
2.212ms 2 S(W(M3))
2.216ms
2.220ms Time
2.224ms
2.228ms
2.232ms
The use of a single transistor with a higher rated drain current is also possible, however, the copper lead utilization is rather high even though manufacturers define the value around 75 A as a limit for TO220 package leads.
0.5KV
1.5A
1.0A
0V
0.5A
-0.5KV
0A
>> -1.0KV
2.3150ms I(D1)
2.3200ms Time
2.3250ms
2.3300ms
Figure 4-17. Rectifier Diode Voltage and Current Waveform When choosing the rectifier current rating, similarly as with the MOSFETs, the anode effective current and switching frequency have to be considered. Simulation results for the nominal anode effective current shows a value of 0.54 A and a 1.3 W power loss. Because the power loss is rather high for a practical usage of the DO241 package, diodes with a fully-isolated TO220 package are chosen. One possibility is to use of the Fairchild ultrafast diode FFPF05U120S with 5-A rated current, 1200 V rated voltage, and 100ns reverse recovery time, which is good enough for 50 kHz switching frequency.
Hardware Design
(EQ 4-30)
(EQ 4-31)
voltage across the choke when active cycle the time during active cycle current ripple nominal input voltage voltage drop on resistive components (RDS(ON), transformer primary, etc.) transformer primary to secondary ratio nominal output voltage maximal switching duty cycle relative current ripple nominal output current
= =
= =
= =
Filter choke performance is analyzed by simulation, and the results (Figure 4-18) verified a good design procedure. Choke PCV2-564-02 from Coilcraft, with 560 H inductance and 2 A saturation current, is chosen.
800mA
1.0KV
400mA
0.5KV
0A
0V
-400mA
-0.5KV
-800mA
1.920ms Time
1.925ms
1.930ms
1.935ms
1.940ms
Hardware Design
I_IN1
I_IN2
L1
C602 + 330uF/450V
N GND
C607 MKP10/22nF/630VDC
C608 330uF/450V
Figure 4-19. PFC Power Stage The output voltage level is controlled using a digital controller algorithm executed by the MCU. The MCU generates a sinusoidal reference waveform for the discrete current controller. The current controller circuit can be seen in Figure 4-20. The controller performs hysteretic current control. Comparators U606A and U606C compare the actual input current value I_IN with the upper and the low limits set by the DA1 and DA0 signals, respectively. Comparator U606B turns on and off power switch Q606 according to the U606A and U606C outputs. The UPS input current corresponds to the shape of the reference signals DA0 and DA1 generated by the MCU. The PFC operation is disabled if the PFC_EN signal is tied low by MCU control. Alternatively (if signal DA0 is not available), the low hysteresis limit can be adjusted by the configurable voltage divider. The resulting hysteresis is then defined by the combination of resistors R664, R673, R674, and R675. The voltage divider can be configured according to the DIV1 and DIV2 signals.
NOTE Selecting whether the low hysteresis limit is taken from DA0 signal or from the configurable voltage divider has to be done by resoldering the zero resistors R666 and R667. If R666 is populated, the DA0 signal is selected. If R667 is populated, the configurable divider is selected. By default R666 is populated and R667 is not.
Single Phase On-Line UPS Using MC9S12E128 62 Freescale Semiconductor
+5V_A +5V_A C627 100n GNDA 2 LM339M 12 C629 100n R665 DA0 100 R668 I_IN 100 C630 100n C631 100n GNDA R666 0 R667 0 8 9 3 R664 1.6k 6 7 3 R658 10k R659 10k R660 10k R662 470 D G Q609 S MMBF0201NLT1 +5V_D +5V_D
R657 33
4 5
U606A
R661 470
C628 100n
V+ V-
U606B
GND
GNDA
V+ V12
1 LM339M
U606C
V+ V12
14 LM339M
R669 10k
R670 10k
TP611 PFC_CTRL
GND
PWM_PFC
+5V_D
GNDA
GNDA
GNDA
R671 4.7k
D G
UNI-3 PFC_EN
Q610 S MMBF0201NLT1 60% All On 55% R673 3.3k 75% R674 10k 85% R675 9.1k GND
Q612 S MMBF0201NLT1 GNDA GNDA 1 PWM_PFC 2 3 GND 4 HCPL3150 U601 8 7 6 5 C609 100nF +15V_PFC D609 BAT42 R606 10 R607 100 D628 15V GND_PFC GND_PFC
GATE_PFC
Hardware Design
(EQ 4-32)
If we know the input current maximum value we can calculate a current ripple. We chose the current ripple to be 15% of the input peak current. For the given peak current value it is:
I = I in max 0.15 = 0.645A
(EQ 4-33)
When the PFC switch is turned on, the following equation has to be met:
I L 1 ------- = V in T on
(EQ 4-34)
where L1 I Ton Vin = = = = inductance of the input boost inductor p-p input current ripple turn-on time of the PFC switch instantaneous input voltage value
(EQ 4-35)
When the PFC switch is turned off, the following equation has to be met:
I L 1 -------- = V in V out T off
(EQ 4-36)
where Toff Vout = = turn-off time of the PFC switch output voltage
(EQ 4-37)
(EQ 4-38)
Frequency is an inverse value of the period. The switching frequency of the PFC is then given by the formula:
V out V i n V in 1 f sw = -- = -----------------------------------T I L 1 V out
2
(EQ 4-39)
Switching losses of the IGBT transistor are proportional to the switching frequency. To maintain switching losses within acceptable limits we have to design the input inductor L1 with respect to a maximum switching frequency. From EQ 4-39, we can calculate the level of input voltage (Vin) when the switching frequency reaches its maximum value. We get the maximum switching frequency at
V out V in = --------2
(EQ 4-40)
If we substitute EQ 4-40 for EQ 4-39 we can solve the equation and find the value of the required input inductance value for the given ripple current (I), output voltage (Vout) and maximum switching frequency (fmax):
V out L 1 = -------------------------4 I f max
(EQ 4-41)
(EQ 4-42)
To limit the maximum frequency at 60 kHz at ripple current 0.645 A, we choose the input PFC inductance L1 = 2.5 mH.
Hardware Design
:
We ran the calculation and got a list of suitable cores, that met our selection criteria. From the list we selected core: T175-8/90. The software calculates all important data (number of turns, wire diameter, losses, Rdc, Al, dimensions, etc.). For the selected core, the parameters are as follows: Table 4-9. Design Parameters for Core P/N: T175-8/90
Parameter Al TURNS WIRE FILL Rdc Core Loss Cu Loss Temp. Rise Value 48 287 1.00 38.9 0.4971 0.28 6.21 41.8 Unit nH mm % W W C
The core T175-8/90 meets all of our criteria, is an acceptable size, with moderate losses and good linearity.
The dc-bus capacitor is a storage of energy for output power factor circuit and feeds an output inverter. The dc-bus voltage should be set above the peak at maximum r.m.s. input voltage. For input RMS voltage Vin = 270 V, the peak voltage is Vin peak max = 381 V. To achieve good regulation of the dc-bus voltage, the dc-bus voltage should be at least 10% above the peak at nominal r.m.s. input voltage, i.e. for Vin nom = 230 V RMS: Vdc-bus min = 1.1x1.41x230 = 356 V. Having Vin peak max and Vdc-bus min, we can determine the dc-bus nominal voltage. We chose Vdc-bus nom = 390 V. The dc-bus capacitor voltage should at least be rated at 450 V dc. If ac input is lost, it is desired that the dc-bus capacitor is large enough to hold up the dc-bus voltage at value Vdc-bus hup, allowing the output inverter voltage to remain within specifications for a time T hup. The maximum nominal output voltage is Vout nom = 230 V RMS. The dc-bus voltage has to be higher than the output voltage peak value Vout peak = 325 V. The hold-up time we define as a half-period of the output ac voltage frequency Thup = 10ms. The minimum dc-bus capacitor value can calculated:
I av T hup C 0 = ----------------------------------------------------V dc busnom V outpeak
(EQ 4-43)
where Iav is the average capacitor current during the drop from Vdc-bus nom to Vout peak. The Iav current can be calculated according to the formula:
2P out I a v = ------------------------------------------------------------- ( V dc busnom + V outpeak )
(EQ 4-44)
where Pout is the inverter output power is the inverter efficiency We can enumerate equation EQ 4-44 and obtain:
2 525 I a v = --------------------------------------- = 1.728A 0.85 ( 390 + 325 )
(EQ 4-45)
The minimum output capacitor value can be calculated if we enumerate formula EQ 4-43:
6 1.728 10 10 C 0 = -------------------------------------- = 266 10 F 390 325 3
(EQ 4-46)
The minimum output capacitance of the dc-bus capacitor is 266F. The next parameter we need to know for selecting the output capacitor is the ripple current rating. The dc-bus capacitor current consists of a dc-component plus an ac-component (100/120 Hz). The dc-component flows to the load, ac-component flows into the capacitor C0. The ripple current amplitude is equal to the peak load current. The ripple current can be then calculated:
I load I ri ppl e = --------2
(EQ 4-47)
(EQ 4-48)
Hardware Design
Ripple current is then: Iripple = 0.792/1.41 = 0.562 A. The waveform applied to the dc-bus capacitor is a near-rectangular waveform at the switching frequency. Therefore the dc-bus capacitor should have a low impedance at the switching frequency. A low-ESR electrolytic capacitor should be considered for this application. Considering all the above requirements, we selected following dc-bus capacitor: Table 4-10. dc-bus Capacitor Parameters
Parameter Manufacturer Catalogue Number Rated Capacitance Rated Voltage ESR @ 100 Hz Ripple Current@ 120 Hz Value BC Components (Vishay) 2222 157 47331 330 450 300 2.19 F V d.c. m A Unit
1. Nominal output apparent power for nominal output voltage 230 V r.m.s.
RE1 MZPA001 5 o o 4 3 o +15V RE2 MZPA001 5 o o 4 L2 +15V 3 o 1 2 RLY_OUT1 D602 BAT42 R602 100 G D 1 2 OUT1
RLY_OUT2
C602 + 330uF/450V
GATE_TOP
Q605 HGTG10N120BND V_OUT L506 5mH C605 6.8uF/400V 2 4 L507 TL34P 1 3 4.7nF/Y1
GND_TOP
1 2
GND
CT2
CS2106 8 5 I_OUT1
DCB_NEG
3 4
Hardware Design
The power IGBTs Q605 and Q608 switch in a complementary manner (if Q605 is on, Q608 is off, and vice versa). Using the power IGBTs, the dc-bus voltage is pulse-width modulated at 20kHz switching frequency to obtain an output voltage with a low frequency a.c. component (50/60 Hz). The junction of C602 and C608 is a zero-volts reference for the generated output waveform. The junction of the capacitors is galvanically connected to the mains N-terminal and is labelled as system ground. Switching pulses to gates Q605 and Q608 are generated by the dual IGBT gate opto-drive HCPL-315J (U615). The opto-drive provides the circuitry with galvanic isolation between the MCU and each of the IGBTs. Its topology is shown in the Figure 4-22. The IGBT gates are floating during the inverter operation in a voltage range +/- 430 V dc. Each channel of the dual opto-drive IC is supplied from a galvanically isolated voltage supply of +15V dc.
GATE_TOP D611 BAT42 PWM_TOP R608 330 U615 N/C VCC1 ANODE1 VO1 CATHODE1 VEE1 ANODE2 VCC2 CATHODE2 VO2 N/C VEE2 HCPL-315J C611 100nF +15V_TOP D610 C610 100nF BAT42 R609 33 R610 100 D624 15V D625 5V GND_TOP
1 2 3 6 7 8
16 15 14 11 10 9
C632 100nF
GND_TOP
-5V_TOP GATE_BOT +15V_BOT D612 BAT42 R612 33 R613 100 C633 100nF D626 15V D627 5V GND_BOT
GND
GND_BOT
-5V_BOT
Figure 4-22. Inverter IGBT Gate Drive Circuitry The by-pass relay RE2 connects the UPS output to either the inverter or the mains voltage. The relays RE1 and RE3 connect the UPS output socket banks to the output voltage. A current transformer CT2 is put into the output current path. Together with current-to-voltage converter circuitry, it makes up the sensing circuitry of the output load current.
NOTE Please note that during operation, the voltage on the power IGBTs is a sum of the voltages on the dc-bus capacitors, i.e., it can reach up to 2 x 430 V = 960 V! The IGBTs must be rated for a collector-emitter voltage of 1200 V.
Hardware Design
NOTE Note that we swapped the input and output peak voltage values in the design parameters. In a real inverter, the dc voltage is the input parameter and the ac voltage is the output parameter. To make an analogy with PFC, we have to swap these parameters in the input table.
We ran the calculation and got a list of suitable cores that met our selection criteria. From the list we selected core: T200-30B. The software calculates all important data (number of turns, wire diameter, losses, Rdc, Al, dimensions, etc.). For the selected core, the parameters are as follows: Table 4-14. Design Parameters for Core P/N: T175-8/90
Parameter Al Turns Wire Fill Rdc Core loss Cu loss Temperature rise Value 51 388 1.00 38.5 0.8868 1.46 9.38 46.4 Unit nH MM. % Ohms W W C
The core T200-30B meets all of our criteria, is an acceptable size, with moderate losses and low price.
counter_actual v_out_rms PLL Algorithm RMS Correction amplitude_correction amplitude_ref Mains Line Detection buttonStatus Button Processing
phase_pfc phase_pfc_inc
phase_out phase_out_inc
v_out_freq_detect
v_dcb[]
v_dcb_req
DC Bus Scaling
appState
Ramp v_sin_ref v_dcb[] v_dcb_req_rmp v_dcdc_req Inverter Control PFC Control Ramp PWMB_duty_cycle i_n_ref Sine Wave Reference pfc_ref_h PWMC_duty_cycle v_dcdc_req_rmp v_dcdc_sum Battery Charge Control v_out PWM_to_DCB_scale
LED Processing
V_bat
I_bat
BatState
Data Flow
Type: S8 = signed 8-bit, U8 = unsigned 8-bit, S16 = signed 16-bit, U16 = unsigned 16-bit.
Software Design
Data Flow
After RESET, the state machine enters into the Standby on battery state if the mains line is available. Then if the user pushes the ON/OFF button, the state machine continues on to the Run on line state. During mains line failure, the state machine goes to the Run on battery state. The state machine stays there until the batteries are discharged, the user switches the UPS off, or the main line is restored. If the batteries are discharged the state machine goes to the Standby on battery state. If the state machine stays in this state one minute, the UPS is switched off (UPS state) to avoid total discharge of the batteries. In the case of some fault, the state machine goes into the Error state. If the state machine goes from one to another state, a respective transition function is called.
CPU RESET
INIT
STANDBY BATTERY
STANDBY ONLINE
RUN ON LINE
RUN ON BATTERY
ERROR
RUN BYPASS
UPS OFF
5.2.10 Process PFC Control The PFC control process consists of the PI controller, which controls the dc bus voltage v_dcb[] to the required value v_dcb_req (v_dcb_req_rmp). The result defines the amplitude of the input current (i_n_ref).
Software Design
Subsequently, the communication with the PC is initialized, and the program variables are set to default values. Then the program enters the never-ending loop providing the application state machine (see main function listing below).
void main () { InitPeripherals(); PCMaster_Config(); EnableInterrupts; /* enable interrupts to make this routine interruptible (defined int PCMaster-S12.h) */ PCMasterInit(); // init PCMaster functions InitVariables(); while(1) { appStateFcn[appState](); FanControl(); } }
The structure of the background loop can also be seen in Figure 5-3.
RESET
Background loop
Software Design
Figure 5-4. Structure of PMF Interrupt The interrupt starts by reading a slow ATD conversion. A slow ATD conversion means that the quantities are not converted every 50 s. There is a table which defines the order of quantities to be converted. The results of a slow ATD conversion are ready from previous interrupt. After saving the conversion results, a fast ATD conversion is set and started. A fast ATD conversion means that the quantities are converted every interrupt (50 s). The output voltage and current are sensed in the fast ATD conversion.
While the fast ATD conversion is running the following tasks are performed: Detection of missing zero crossing on the input line Detection of input voltage polarity RMS value calculation and output power calculation (multiplication and addition) Generation of rectified sine waveform for the PFC Generation of sine wave reference for the output inverter The execution time for these tasks is shorter than the conversion time in a fast ATD conversion.
Software Design
RMS correction
Figure 5-7. Structure of TIM0 CH5 Output Compare Interrupt The interrupt performs following tasks: Voltage control loop of the PFC dc/dc step-up converter control loop Filtering and scaling of analog values measured in the slow ATD conversion finishing the RMS and output power calculations (multiplication by constant and square root) RMS correction algorithm This routine has a lower priority and can be interrupted by the PMF reload and ATD complete interrupts.
Single Phase On-Line UPS Using MC9S12E128 82 Freescale Semiconductor
Software timers
Battery charging
Software Design
Trace 1 ms Interrupt
Trace 50 ms
Figure 5-9. CPU Load of UPS Application Trace 1 (blue) represents a PMF reload interrupt; Trace 2 (cyan) is an ATD complete interrupt; Trace 3 shows 1 ms interrupt; Trace 4 (green) is 50 ms. The total MCU load is 65.16%. The execution time of each interrupt can be seen in Table 5-2, and the size code in Table 5-3. Table 5-2. Execution Time of Periodic Interrupts
Name PMF reload interrupt ATD conversion complete interrupt TIM0 CH4 input capture interrupt TIM0 CH5 output compare interrupt TIM0 CH6 output compare interrupt Execution Period 50 s 50 s 8.3 ms or 10 ms 1 ms 1 ms Execution Time 15.8 s 14.2 s 7.8 s 50 s 35.8 s
(EQ 5-1)
To keep the maximal precision of calculation, the SCALE should be set in order to push the GAIN into the upper half of the variable range. Example: Lets convert a constant 25 in U16 representation. The upper half of the U16 range is from 32768 to 65536. The get this constant to optimal range we set the SCALE to 5. Then the GAIN = 25 . 2(16-5) = 51200.
NOTE Note that the SCALE is shared for all constants in the PI/PID controller. So in case of a highly different order in the constants, a compromise has to be made.
The controller implementation is explained in 3.1.5 PI and PID Controller. From EQ 3-7 results, the proportional constant is equal to the gain of the system. The integral constant of the controller can be expressed as:
Kh -----TI
(EQ 5-2)
where
TI h K = = = Integral time constant Sampling time Controller gain
TD kd1 = -------------------T D + Nh
(EQ 5-3)
KT D N kd2 = -------------------T D + Nh
(EQ 5-4)
Software Design
where
h TD N = = = Sampling time Derivative time constant Filter constant
NOTE The proportional constant of the output inverter controller is called q1 in the software. Example:
Lets have constants for the PFC controller. The PFC uses the PI controller, where the controller gain K(P) = 100 and Integral time constant TI = 0.0016 s. The controller is calculated every 1 ms.
100 1 10 From EQ 5-2 we can calculate integral constant as: ------------------------------- = 6.25 . 0.0016
3
Since the scale is common for both constants, we choose SCALE = 8. Then we get a proportional gain 100 . 2(16-8) = 25600 and an integral gain 6.25 . 2(16-8) = 1600. In the source code we can see:
#define PFC_P_GAIN_BASE #define PFC_I_GAIN_BASE #define PFC_SCALE 25600 1600 8
D1
D3
Rs 2.8 + P1 160
C1 937 uF
D2
D4
Test Results
Test Results
Test Results
6.3.7 Summary
All measured parameters are summarized in Table 6-1 Table 6-1. Summary of Measured Parameters
Load Parameter Linear Efficiency Output voltage THD without load Output voltage THD Power factor Precision of generated frequency 1% 0.99 < 0.01% 91% 0.4% 5% Non-linear 90%
Figure 7-1. UPS Demo WARNING Do not touch any part of the board inside the metal case regardless of whether the UPS is running from mains line or batteries. There is a high risk of electric shock caused by high voltage, which may cause serious injury or death. To prepare the UPS for operation, follow these steps: 1. Connect the power supply cable to the INPUT LINE socket. 2. Connect the load supply cable to any OUTPUT SECTION socket. Be sure that the load power is within the limit of the UPS demo. 3. In the case of remote operation from a PC, connect a serial cable between the PC and the J2 connector of the UPS (on the right-hand side in Figure 7-3 and Figure 7-5). 4. Switch MAINS INPUT LINE switch ON. If the mains line is available, the UPS will go into standby on-line mode. In this mode, the MCU works and the batteries are charged, but the output is still switched off. In the case of remote operation, run the FreeMaster software on the PC and load the project file, UPS.pmp. The UPS is ready for operation.
5.
OUTPUT SECTION 2
OUTPUT SECTION 1
Serial Ports
Software Setup
Application Control
ON/OFF Button
Status LEDs
LED Bargraph
Bypass Button
Figure 7-5. UPS User Interface In the case of a mains line failure, the UPS automatically goes into run on battery mode. If the UPS is in bypass mode at the moment of the failure, the UPS is switched off. Run on battery mode is indicated by the orange LED and the UPS regularly beeps. If the batteries are discharged the UPS switches the outputs off and goes into standby on battery mode. In this mode the UPS stays for one minute, then switches itself off. Then user can switch the UPS by pushing the ON/OFF button for more than four seconds, during this time the UPS constantly beeps.
Figure 7-6. UPS Project in FreeMaster In addition to remote control, the FreeMaster displays the values of some variables. There is also a recorder and scope showing the output voltage and temperature of the power stage.
Application Control
Appendix A. Schematics
A.1 Schematics of Power Stage
J100
J101 PSH02_02P
1 2
+VBAT
D
+VBAT -VBAT
GNDA GND
GND_PFC +15V_PFC
+5V_REF
1 2
F101
3 4
/POWER_EN POWER_EN
+15V_TOP -5V_TOP +15V_BOT -5V_BOT GNDA +15V_PFC GND_PFC PFC+Inverter GND_BOT GND_TOP
J106
+5V_REF
GND_PFC +15V_PFC
GNDA GND
PE MH100
PE CONNECTION
L1 L2 N PE PWM_TOP PWM_BOT
GNDA GND +5V_D +5V_A +15V Control Board Interface
+5V_REF
J107 J108
DCB_POS DCB_NEG
FAULT0 FAULT1
J109
J110
AD1 AD4 UNI-3_PWM2 AD5 UNI-3_PWM3 AD6 UNI-3_PWM4 UNI-3 PHAIS UNI-3_PWM5 UNI-3 PHCIS UNI-3 DCBI UNI-3 PFC_EN UNI-3 DCBV UNI-3 SERIAL
B
1 2
PSH02_02P J111
1 2
PSH02_02P
Fault1 Fault0
UNI-3 BEMFZCA UNI-3 BEMFZCC UNI-3 BEMFZCB UNI-3 PFC_ZC DA0 DA1
GNDA GND +VBAT -VBAT
DC-DC Step Up
DCB_POS DCB_NEG
Motorola MCSL Roznov 1. maje 1009 756 61 Roznov p. R., Czech Republic, Europe
Title 750 VA UPS Power Stage Rev 01 Pavel Grasblum Author: Size Schematic Name: 00165_01 A3 Design File Name: Wednesday, October 01, 2003 of 2 10 Modify Date: Sheet Copyright Motorola 2003 POPI Status: Motorola General Business
5 4 3 2 1
C201 T1
100pF
12
8z.
+15V L201 330u R202 R203 510R R206 16K + C206 330uF/35V 15k D204 U201 GND D G S R209 1k C212 100pF GND R210 1.8 D1
1
C204 47nF
11 8
D202 BZV55/15V
5z.
8z.
7 6
C205 100pF D205 R205 220
TP210 -5V_TOP
2
R204 220
1 2 3 4
8 7 6 5
C209 100nF
MMBD914LT1 R207 33
6z.
5
TR01/MC145
UC3843
Q201 NTF3055
C208 100pF
LL4448
GND
GND
GND
GND
GND
GND
C213 100pF
+15V_PFC
GND_PFC
GND_PFC
U202 LM2575-5
4 2
L202 470uH D210 MBRA140 + C215 220uF/35V
TP204 +5V_D
+5V_D
/POWER_EN
R200 510
TP206 GND
+ Q200 BC846 +5V_A +5V_REF +5V_D +15V GND GND GNDA GNDA + C218 22uF/50V +5V_A +5V_REF +5V_D +15V U200 LM2575-ADJ POWER_EN R213 100 GND GND GND GND C216 22uF/50V
+15V_TOP
+15V_TOP GND_TOP
D211 KA3528LSGT
GND
GND
GND
4 2
L203 680uH D213 MBRA140
TP200 +15V
+15V L204
-5V_BOT
-5V_BOT
R215 20K
R214 2.4k
1u
+15V_PFC
+15V_PFC GND_PFC
1 2
GND
GNDA
GND_PFC
D214 KA3528LSGT
GROUND CONNECTION
GND
GND
GND
GND
GND
GND
3
C221 100nF
U203 MC78L05ACP
VIN GND
VO
C200 100nF
GNDA
GNDA
GNDA
D302 B250R +
D303 P6KE200
1
R302 1M
T300
D301 BYW29E-200
13
LINE_OK
L -
9 7 6 5
TR02/MC145
D304 1N4148 C303 100nF 220uF/50V + C304 C305 220uF/50V 100u/50 + C306
R304 39k
D305 BYV26C
R306 1M
R305 1k8 +
R307 620
R309 2k4 D
R311 33k
C
R312 200
U300
7
L
2
C
CONTROL
1
R313 27R
ISO300 SFH615A-2
1
R329 1K
GND_CH IBAT1
GND
TOP249Y
5 3
3
R315 7.5k C316 100n
R308 3K6
R316 220
R317 33K
+5V_A
100nF
R321 1k6
R322 220
+5V_A GND
GNDA GNDA
C314 N/P
IBAT2
IBAT1
R319 1k6
C309 470nF
C308
GND
MC33502 U301B
3
R320 100K
Q300 BC847
220n
+ -
1
U301A MC33502
8
U302 TL431ACD
IBAT_CONTROL
C310 470nF
R327 560
C312
D307
/POWER_ON
BAV103
Motorola MCSL Roznov 1. maje 1009 756 61 Roznov p. R., Czech Republic, Europe
Title 750 VA UPS Power Stage Rev 01 Author: Pavel Grasblum Size Schematic Name: Battery Charger A3 Design File Name: Modify Date: Thursday, August 19, 2004 Copyright Motorola 2003 Sheet 4 10 of POPI Status: Motorola General Business
1
GND_TR
GND GND
D
J401
GNDA GNDA +5V_A +5V_D +15V +5V_A +5V_D +15V UNI-3_PWM2 UNI-3_PWM3 UNI-3_PWM4 UNI-3_PWM5 GND +5V_D GNDA +15V UNI-3 DCBV UNI-3 PHAIS UNI-3 PHCIS
1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33 35 37 39
UNI-3
2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 40
GND
+5V_D GNDA UNI-3 DCBI GNDA UNI-3 SERIAL UNI-3 PFC_EN UNI-3 BEMFZCA UNI-3 BEMFZCC
C
GND
2 4 6 8 10
1 3 5 7 9
J400
FAULTS HEADER
2 4 6 8 10 12 14
1 3 5 7 9 11 13
GND
2 4 6 8 10 12 14 16 18 20 22 24 26
1 3 5 7 9 11 13 15 17 19 21 23 25
PWM10 PWM12
Title
Motorola MCSL Roznov 1. maje 1009 756 61 Roznov p. R., Czech Republic, Europe
750 VA UPS Power Stage Rev 01
Author: Pavel Grasblum Size Schematic Name: Control Board Interface A Design File Name: of 5 10 Modify Date: Sheet Wednesday, October 01, 2003 Copyright Motorola POPI Status: Motorola General Business 2003
DCB_NEG
+VBAT
680u/50V 1 1
+Bat
-VBAT
680u/50V
680u/50V GND_BAT
680u/50V
FFPF05U120STU D500
1 D504 FFPF05U120STU 10 GND 13 15 D505 FFPF05U120STU 18 T500 TR03/MC145 9 1 1 2 R503 100R/1W 4 6 2 1 C508 1n GND_BAT D503 L502 650u/1A
+15V
L500 330u
47uF C509 1 2 + 100n C511 GND_BAT 6 U500 1 NC 2 InA MC33152D VCC NC OutA
GND_BAT
TP501 PWM_4
8 7 1 R505 10 2 G
U501 8 NC 7 OutA
1 2 TP502 PWM_5
R506 10
5 OutB GND 3
InB
GND_BAT
GND_BAT
TP503 GND_BAT
+5V_REF
I_OUT1
5
R616 180 R678 180 R679 180 C612 10n R617 100k
+ -
U604B MC33502D
R600 10
GNDA GNDA
+ C614 22uF
+5V_A
GNDA +5V_REF +5V_REF C616 100n R620 11k TP601 -DCB_DIV V_DCB_BOT_DIV GNDA TP602 R621 V_OUT_NEG 11k
D600 1N4007
R619 300k
R622 470k
C
R626 330k
C617 33n
R631 130k
R628 330k
R632 1K
R629 300k
GNDA
2
C620 33n
GNDA
R636 33K
+ C619 10uF/10V
R633 11k
GNDA GNDA GNDA +5V_D R641 10k C600 U606D R644 10k TP606 PFC_ZC PFC_ZC +5V_REF R642 10k 100n GNDA GNDA DCB_NEG
V_DCB_TOP_DIV
5 6
R640 10k + -
7
U605B LM393D
V_INP
B
R646 330k
R647 330k
10 11
1
R649 11k D621 BAT42
R645 1K
V+ V12
13
LM339M
GNDA
R650 10K
TP607 REF_POS
2 1
+5V_A R651 680k R680 33 +5V_D
GNDA
+Vs
+Vout GND
2 1
R652 1K
C625 33n
TP609 REF_NEG
2 1
R655 10k
3 2
+ -
GNDA
GNDA
GNDA
GNDA
5 4 3 2
100n
D615 MBR0540
GNDA
1
MC33502D U604A C613
GNDA
R623 1K
R624 0R
V_OUT_BOT
R672 11K
C
R630 300k
2
C622 33n
V_OUT_TOP
B
GNDA GNDA
GNDA
C623 100n
Title
Motorola MCSL Roznov 1. maje 1009 756 61 Roznov p. R., Czech Republic, Europe
750 VA UPS Power Stage Analog_Sensing Sheet 7 10 of Motorola General Business POPI Status:
1
Rev 01
+15V_PFC D609 C609 100nF +15V_TOP R606 10 D628 15V GND_PFC GND_PFC GND_BOT GATE_TOP GND_BOT -5V_BOT +15V_PFC -5V_BOT +15V_PFC GND_PFC GND_PFC GND_TOP GND +15V_TOP D610 C610 100nF R609 33 D624 15V D625 5V GATE_PFC GND_TOP -5V_TOP +15V_BOT -5V_TOP +15V_BOT +15V_TOP GND_TOP
D611
C
BAT42 PWM_TOP R608 330 U615 N/C VCC1 ANODE1 VO1 CATHODE1 VEE1 ANODE2 VCC2 CATHODE2 VO2 N/C VEE2 HCPL-315J
1 2 3 6 7 8
16 15 14 11 10 9
C632 100nF
GND_TOP
GND
GND
D627 5V GND_BOT
C633 100nF
GND_BOT
-5V_BOT
Motorola MCSL Roznov 1. maje 1009 756 61 Roznov p. R., Czech Republic, Europe
Title 750 VA UPS Power Stage Rev 01 Author: Pavel Grasblum Size Schematic Name: A4
IGBT_Drives Design File Name: Modify Date: Monday, March 08, 2004 Sheet of 8 10 Copyright Motorola POPI Status: Motorola General Business 2003
2 1
RE1 MZPA001
5 o
+15V MBRS130 D601 L504
D
o 4
OUT1
3 o
+15V
1
D602
2
D
D1
330u
5 o
Q601 NTF3055 o 4 L2 +15V
3 o 1
D603 BAT42
I_IN1
I_IN2
RE3 MZPA001
5 o
Q603 BC846 GND o 4 OUT2
RLY_BYPASS
R603 4K7
3 o
+15V
1
D605 BAT42 R604 4K7
+15V
+ RLY_OUT2
D607 BAT42 o o o
RE4 MZPA002 C603 Q606 IRG4IBC20W GATE_PFC MKP10/22nF/630VDC C602 + 330uF/450V GATE_TOP
5
o
7
o
GND_TOP
R605 4K7
Q607 BC846
2 4
L507 TL34P
C604
1 3
4.7nF/Y1 C606 4.7nF/Y1
GND_PFC
PE
3.3uF/400V
RLY_IN
CT2
N_OUT
1 2
3 4
CS2106
I_OUT1
C607
RHRP8120
DCB_NEG
DCB_NEG
Title
Motorola MCSL Roznov 1. maje 1009 756 61 Roznov p. R., Czech Republic, Europe
750 VA UPS Power Stage Inverter 9 10 Sheet of Motorola General Business POPI Status:
1
Rev 01
+5V_A +5V_A C627 100n GNDA 2 LM339M 12 C629 10n R665 N/P DA0 C630 N/P C631 10n GNDA R666 N/P R668 100 I_IN R667 0 8 9 3 R664 1.6k 6 7 3 R658 10k R659 10k R660 10k R662 470 D G Q609 S MMBF0201NLT1 +5V_D +5V_D
R657 33
4 5
U606A
R661 470
C628 100n
V+ V-
U606B
GND
GNDA
V+ V12
1 LM339M
U606C
V+ V12
14 LM339M
R669 10k
R670 10k
TP611 PFC_CTRL
GND
PWM_PFC
+5V_D
GNDA
GNDA
R671 4.7k
D G
UNI-3 PFC_EN
R674 N/P
R675 N/P
GND
B
DIV1
S GNDA GNDA
Motorola MCSL Roznov 1. maje 1009 756 61 Roznov p. R., Czech Republic, Europe
Title 750 VA UPS Power Stage Rev 01 Author: Ivan Feno Size Schematic Name: A4
PFC_Control Design File Name: Modify Date: Monday, March 08, 2004 Sheet of 10 10 Copyright Motorola POPI Status: Motorola General Business 2003
5 4 3 2 1
Application Control
+5V_D LED_FAULT R2 10k BT_BYPASS J1 LED_LEV5 LED_LEV3 LED_LEV1 BT_BYPASS LED_BAT LED_FAULT 2 4 6 8 10 12 14 16 18 20 22 24 26 1 3 5 7 9 11 13 15 17 19 21 23 25 BEEP LED_LEV6 LED_LEV4 LED_LEV2 BT_ON/OFF LED_BYPASS LED_ON SW2 +5V_D BT_ON/OFF HEADER 5X2 GND Switch/P-0SYB +5V_D 1 3 5 7 9 LED_ON R3 1300 D2 L53LGD R1 1300 D1 L53LID
D
SW1
J3 2 4 6 8 10
R4 10k
GND
5 9 4 8 3 7 2 6 1
J2
HEADER 13x2
C
CON/CANNON9
GND
J4 PSH02_02W
R9 R10 R11 R12 1300 D5 L53LID D6 L53LGD D7 L53LGD 1300 1300 1300
1300
J5
BEEP
GND BZ1
B
LED_LEV5 LED_LEV6
CON/CANNON9 GND
SA003
+5V_D
GND GND
Motorola MCSL Roznov 1. maje 1009 756 61 Roznov p. R., Czech Republic, Europe
Title UPS 750 VA User Interface Rev 01 Author: Pavel Grasblum Size Schematic Name: 00165B01 A4 Design File Name: Modify Date: Wednesday, September 10, 2003 Sheet of 1 1 Copyright Motorola POPI Status: Motorola General Business 2003
5 4 3 2 1
Application Control
4.7nF/Y1
SIOV-S20K275
R100 SG-190
J103
L_OUT
4 2
TL34P
3 1
C101
C102
L100
R101
R102 J104
J101
N_OUT
100nF/X1 1uF/X1
100nF/X1
PE
B
J102
MH1
PE
GROUND CONNECTION
Title
Motorola MCSL Roznov 1. maje 1009 756 61 Roznov p. R., Czech Republic, Europe
750 VA UPS Input Filter Rev 01
Author: Pavel Grasblum Size Schematic Name: 00165C01 A Design File Name: 2 2 of Modify Date: Sheet Monday, September 15, 2003 Copyright Motorola POPI Status: Motorola General Business 2003
2 1
Application Control
Application Control
Application Control
SW2
Switch
MEC
Application Control
Appendix B. References
1. Feno, I.: Analysis and Synthesis of the IGBT switching techniques and verification in Partial Series Resonant Converter. Ph.D. Dissertation, University of Zilina, Faculty of Electrical Engineering, August 2003. A More Realistic Characterization Of Power MOSFET Output Capacitance Coss. Application Note AN-1001, International Rectifier. Billings, K.: Switchmode Power Supply Handbook, second edition. McGraw-Hill, 1999. Pressman, A. I.: Switching Power Supply Design, second edition, McGraw-Hill, 1998. International Standard IEC62040-1-1, Uninterruptable power systems (UPS) - Part 1-2: General and safety requirements for UPS used in operator access areas. International Standard IEC62040-1-2, Uninterruptable power systems (UPS) - Part 1-2: General and safety requirements for UPS used in restricted access locations. International Standard IEC62040-2, Uninterruptable power systems (UPS) - Part 2: Electromagnetic compatibility (EMC) requirements. International Standard IEC62040-3, Uninterruptable power systems (UPS) - Part 3: Method of specifying the performance and test requirements. YUASA NP valve regulated lead acid battery manual. Yuasa Battery GMBH, 1999. TOP242-250 Up to 290 W Extended power, design flexible, EcoSmart, integrated off-line switcher family, data sheet. Power Integrations, August 2003 AN-18, TOPSwitch Flyback Transformer Construction Guide. Power Integrations, 1996. AN-16, TOPSwitch Flyback Design Methodology. Power Integrations, 1996. MC9S12E-Family Device User Guide, data sheet. Motorola, 2003. HCS12 CPU V2.0 Reference Manual, Reference Manual. Motorola, 2003. HCS12 10-Bit, 16-Channel Analog to Digital Converter (ATD) Block Guide. Reference Manual. Motorola, 2003. HCS12 Background Debug Module Block Guide. Reference Manual. Motorola, 2003. HCS12 Clocks and Reset Generator (CRG) Block Guide. Reference Manual. Motorola, 2003. Digital-to-Analog Converter: 8-Bit, 1-Channel. Reference Manual. Motorola, 2003. Debug Module. Reference Manual. Motorola, 2003. Port Integration Module: 9S12E128. Reference Manual. Motorola, 2003. HCS12 128K FLASH Block Guide. Reference Manual. Motorola, 2003. HCS12 Inter-Integrated Circuit (IIC) Block Guide. Reference Manual. Motorola, 2003. Interrupt (INT) Module V1 Block User Guide. Reference Manual. Motorola, 2003. Multiplexed External Bus Interface (MEBI) Module V3 Block User Guide. Reference Manual. Motorola, 2003. Module Mapping Control (MMC) V4 Block User Guide. Reference Manual. Motorola, 2003. HCS12 Oscillator Block Guide. Reference Manual. Motorola, 2003. Pulse Modulator with Fault Protection: 15-Bit, 6-Channel. Reference Manual. Motorola, 2003. HCS12 8-Bit, 6-Channel Pulse Width Modulator (PWM) Block Guide. Reference Manual. Motorola, 2003. HCS12 Serial Communications Interface (SCI) Block Guide. Reference Manual. Motorola, 2003. HCS12 Serial Peripheral Interface (SPI) Block Guide. Reference Manual. Motorola, 2003. Timer: 16-Bit, 4-Channel. Reference Manual. Motorola, 2003. Voltage Regulator 3V3 Block User Guide V2. Reference Manual. Motorola, 2003. MC9S12E128 Controller Board, Design Reference Manual, Motorola 2004
Single Phase On-Line UPS Using MC9S12E128 Freescale Semiconductor 125
2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. 21. 22. 23. 24. 25. 26. 27. 28. 29. 30. 31. 32. 33.
Application Control
Appendix C. Glossary
ac ac/dc converter ATD A/D AVR CW DAC dc dc/ac converter dc/dc converter DT
alternating current a converter that converts alternating voltage (ac) to direct voltage (dc) analog-to-digital converter analog-to-digital automatic voltage regulation CodeWarrior; compilers produced by Metrowerks digital-to-analog converter direct current a converter that converts direct voltage (dc) to alternating voltage (ac) converter that converts one level of direct voltage to another level of direct voltage dead time; a short time that must be inserted between turning off one transistor in the inverter half-bridge and turning on the complementary transistor, to allow for the limited switching speed of the transistors. the ratio of the time the signal is on to the time it is off. Duty cycle is usually quoted as a percentage. electro magnetic compatibility electro magnetic interference integrated circuit integrated development environment Insulated gate bipolar transistor input/output interfaces between a computer system and the external world. A CPU reads an input to sense the level of an external signal and writes to an output to change the level on an external signal. a temporary break in the sequential execution of a program to respond to signals from peripheral devices by executing a subroutine. a voltage level approximately equal to the input power voltage (VDD) a voltage level approximately equal to the ground voltage (VSS) a Freescale Semiconductor family of 16-bit MCUs microcontroller unit; a complete computer system, including a CPU, memory, a clock oscillator, and input/output (I/O) on a single integrated circuit
duty cycle
interrupt
Metrowerks Corporation personal computer printed circuit board PC master software for communication between PC and system power factor correction proportional-integral controller proportional-integral-derivative controller phase-locked loop; a clock generator circuit in which a voltage controlled oscillator produces an oscillation that is synchronized to a reference signal FreeMaster software project file PWM value register of motor control PWM module of the MC9S12E128 microcontroller; it defines the duty cycle of the generated PWM signal. pulse width modulation to force a device to a known condition root mean square serial communications interface module; a module that supports asynchronous communication switched mode power supply instructions and data that control the operation of a microcontroller serial peripheral interface module; a module that supports synchronous communication software interrupt; an instruction that causes an interrupt and its associated vector fetch total harmonic distortion A module used to relate events in a system to a point in time uninterruptable power supply
PMP PVAL
SWI
Information in this document is provided solely to enable system and software implementers to use Freescale Semiconductor products. There are no express or implied copyright licenses granted hereunder to design or fabricate any integrated circuits or integrated circuits based on the information in this document. Freescale Semiconductor reserves the right to make changes without further notice to any products herein. Freescale Semiconductor makes no warranty, representation or guarantee regarding the suitability of its products for any particular purpose, nor does Freescale Semiconductor assume any liability arising out of the application or use of any product or circuit, and specifically disclaims any and all liability, including without limitation consequential or incidental damages. Typical parameters which may be provided in Freescale Semiconductor data sheets and/or specifications can and do vary in different applications and actual performance may vary over time. All operating parameters, including Typicals must be validated for each customer application by customers technical experts. Freescale Semiconductor does not convey any license under its patent rights nor the rights of others. Freescale Semiconductor products are not designed, intended, or authorized for use as components in systems intended for surgical implant into the body, or other applications intended to support or sustain life, or for any other application in which the failure of the Freescale Semiconductor product could create a situation where personal injury or death may occur. Should Buyer purchase or use Freescale Semiconductor products for any such unintended or unauthorized application, Buyer shall indemnify and hold Freescale Semiconductor and its officers, employees, subsidiaries, affiliates, and distributors harmless against all claims, costs, damages, and expenses, and reasonable attorney fees arising out of, directly or indirectly, any claim of personal injury or death associated with such unintended or unauthorized use, even if such claim alleges that Freescale Semiconductor was negligent regarding the design or manufacture of the part. Freescale and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. Freescale Semiconductor, Inc. 2004. All rights reserved