You are on page 1of 9

Application Note AN2192

Digital Bipolar Power Chopper

By: Chris and Vincent Paiano
Associated Project: Yes
Associated Part Family: CY8C26xxx
PSoC Designer Version: 4.2

Abstract
This note describes a way to directly produce house power without the need for a heavy,
expensive, inefficient transformer. This application uses a large solar panel array and the PSoC’s
8-bit PWM with Deadband (PWMDB8) User Module to generate AC waveforms. Standard house
110V/60Hz AC has been selected as the target output. This is accomplished with two DC power
supplies (batteries, bench supplies, solar cells, etc), a MOSFET half-bridge power section, and a
PSoC. The signal is generated via a “breathing” pulse width output based on a hard-coded sine
wave lookup table.

Introduction The effective formula in use is:
To directly produce house power, a large solar
panel array can be configured to supply the +/- sin( x ) * 255
PW ( x ) = (int)( + 128 ) (1)
160V needed without a heavy, expensive, 2
inefficient transformer. For test and development
of this project, floating boost regulators were The resulting 8-bit integers are laid out as a
configured to achieve the proper EMF. See the lookup table array in the PSoC, and called upon
block diagram in Figure 1. Although the bipolar in order to be written to the PWMDB8’s Pulse
configuration requires two supplies, it results in Width register to achieve the “breathing” effect.
fewer components per channel and – more The two out-of-phase PWM signals generated, in
importantly – a common ground. Observe (in other words, will change sinusoidally between
Figures 7 and 8) that the logic ground is the most their minimum and maximum values (full off to full
negative supply. Care (optical isolation) must be on) in order to generate an output that can be
used if any additional I/O involving the PSoC is used to fabricate a sine wave. In the actual
required. implementation, however, one must take care to
stay away from 0% and 100% duty cycles, so any
Software/PSoC Implementation 0 or 255 values are clipped to a 1 or 254,
The implementation of the PSoC in this digital respectively. This ensures there is always a small
bipolar power chopper consists of an 8-bit pulse for the bootstrap circuitry to charge itself.
PWMDB User Module and an 8-bit Counter The code necessary to achieve this functionality
User Module to generate the 38 kHz clock (to is shown below in Code 1, a flowchart of the code
drive). First, a 64-step lookup table was in Figure 2, and the configuration of the PSoC
generated with the help of Microsoft® Excel, and resources appear in Figures 3, 4, 5, and 6.
is shown below in Table 1. The sine is calculated
for selected values each a step size apart. The
result is scaled to an 8-bit unsigned integer value
for assigning proper approximations to the pulse
width register.

7/20/2004 Revision A -1-

The values a hot-swappable kilowatt module. thru Q1 and resistance. can then float up to 500V above the rest of the chip! 7/20/2004 Revision A -2- . which wave. This repeats until the voltage easily be driven with one chip. A basic circuit board has been laid out with the out. and L1 discharges the FETs used in this model.3 us when its forward voltage channel and requires both outputs to float. giving fast generated house current we want to synthesize cycle-by-cycle protection of the output FETs. The FET driver is in used with an IR2110. This is twice as many components per reacts in less than . earth ground) in a bipolar chopper configuration leaving a relatively clean sine wave. supplies (one for each side – above and below Lf/Cf filters out the 30 kHz PWM component. The is above 1. Dg/Rg The main advantages of utilizing two DC power ensure turn off before turn on of the power FETs. bridge) to generate the two sides of the sine the TLP2530 Dual Hi-Speed Opto-coupler. The high-side driver upon request. are The IR2110 is capable of 2A of gate drive current employed. Current limit resistors RsenH and RsenL trigger U5. Complex to generate AC sine waves lie in the scalability repetitive waveforms in multiple channels can be and the safety.output. the on- from charging the toroid inductor L1. in a 1x19 inch rack space with less and 190V output under no load. Q1 is turned off. When the current limit Isen (1 volt) is price of the devices are continually falling. a dozen could through D1 into C1. than 50 components. The voltage boost comes IGBTs. very much like the mechanically shutdown input of the FET driver. the power handling capacity. two TL3843 PWM Controllers.through currents. One could imagine divider Rreg outputs Vfb (2. floating high-side driver. Standard inverters turn a single implemented with this scheme. supplied by the solar array. with selected max out at a 2-amp input charge rate diagnostics. and the Rsen1. The and synchronize for sale back to the power grid. a dual. configured as boost converters.7V. With reached. The plan for the larger To simulate the large bi-polar EMF that will be unit is to incorporate Hall effect current sensors. Rt and Ct form the timing ramp for the per channel and can switch an array of FETs or fixed frequency PWM. Block Diagram Hardware Implementation To minimize shoot-through currents.expresspcb. The active low over current signal half bridge has one +/. This chip bootstraps free software package ExpressPCB its own high-side gate charge through Dboot into (www. AN2192 Figure 1. The required gate charge. high leg sense resistor also protects against shoot. referenced to is inverted in the PSoC and inserted into the earth ground.5V). DC power supply into AC by switching the two sides (+ and -) through a full bridge (or an H.com) and is freely available Cboot on each negative cycle.

5373718 177 1 0.1214044 153 2 3.07938 0.77273 197.6329 -161.1934 -49.9954 -253.71 -1 -254.47118 120.70795 180.162005 79 3 3.14 0.76625 0.88313 0.15875 0.2886 -73.607088 199 1 0.47258 120.40612649 128 3 3.88241 225.92426 235.999919 255 2 1.1502 188 1 0.37375 0.9803 -249.94375 0.3747196 165 2 2.09955 25.61188 -0.3858816 141 2 3.381 -97.95675 243.58875 0.6863 246 2 2.4698 -119.045183 227 1 0.09813 0.02313 -0.98096 250.0964 -24.63063 -0.98065 250.577536 116 3 3.1775 0.9625 0.83119 211.144714 253 2 1.82688 -0.7717 -196.944657 199 2 2.92365 235.90625 -0.554 -141.5325 -0.49063 0.785 0.179746 234 2 2.22327 3 4 7/20/2004 Revision A -3- .995 -253.8809 -224.27563 0.41563 -0.19499 49.19655 50.954215 234 1 1.99927 1 4 4.33625 -0.55532 141.925 -0.99511 253.66813 0.015437 241 2 2.9563 -243.78715 30 3 4.793162 255 2 1.8303 -211.29014 73.7475 0.015428 209 2 2.55125 0.971841 250 1 1.23813 -0.923 -235.84563 0.753375 255 1 1.19625 0.597407 91 3 3.9817404 140 1 0.065522 253 1 1.986157 165 1 0.3175 -0.72875 -0.29438 0.70683 180.912491 177 2 2.9529 38 3 4.77374 197.9813 -250.95721 244. AN2192 Table 1.55665 141.3825 97.72815 22 3 4.12125 -0.83208 212.26916 57 3 3.85339 6 3 4.64938 0.63535 162.99527 253.83231 1 4 4.240421 218 1 0.7057 -179.51375 -0.324743 103 3 3.355 0.80813 -0. Sine Wave Lookup Table Radians Sine Scaled (0-255) Pulse Width Quadrant of Sin(Rads) Sin*255 (int)(Scaled/2)+128 Sine Function 0 0 0 128 1 0.47188 0.824079 240 1 1.38737 47 3 3.57 1 254.00159 0.09797 24.45313 0.7231367 153 1 0.3925 0.21938 -0.43438 -0.527482 218 2 2.302718 227 2 2.508267 188 2 2.63215 16 3 4.98125 0.79183 68 3 3.71294 1 3 4.88166 224.06063 0.089675 250 2 1.37502 10 3 4.04188 0.38397 97.530957 246 1 1.29167 74.9857 3 3 4.86438 0.25688 0.

22.6.68.199.47.79.38.103.234.141. PWMDB_WritePulseWidth(PwmValue).0032 -0.789958 115 4 6.763093 91 4 6.86603 68 4 5.8832 -225. PwmValue=Sine[SineStep]. void main() { Trigger60(0).57. if (++SineStep==STEPS) { SineStep=0. } } } } Code 1.20063 -0.79. AN2192 5.16.218.10.1.22.153. PWMDB_Start().246.253.78937 -0. Trigger60(0).h" // PSoC API definitions for all User Modules #include "ports.91.1. M8C_EnableGInt.h" #define Trigger60(b) (PRT2DR = (b==0) ? (PRT2DR&0x7F) : (PRT2DR|0x80)) #define MinPWM 1 //how far from edge PWM is clipped .227.h> // part-specific constants and macros #include "PSoCAPI.9577 -244.474 -120.08375 -0.3854 -98.165. char SineStep=0. int PwmChangeDelayCounter = 0.558 -142.\ 38.287362 79 4 5.57.10.29. Trigger60(1).29875 -0.\ 254.3. PWMDB_DisableInt().1981 -50.140. char PwmValue = 128.153.115}. Clk_PWM_DisableInt().30.6.0.519545 103 4 6.\ 128.177.495 -0.188.254.241.18187 -0.9249 -235.812252 128 4 #include <m8c.103.6366 -162.250.81408 38 4 5.199. //top clipping else if (PwmValue < MinPWM) PwmValue = MinPWM.3.98562 -0. //bottom clipping PWMDB_WritePulseWidth(PwmValue).253.28187 57 4 5.234.2932 -74.250.7747 -197.55975 29 4 5.255.8875 -0.20689 6 4 5.240.833 -212.68.32884 47 4 5.177.28 -0. while(1) { if (++PwmChangeDelayCounter > PwmChangeDelay) { PwmChangeDelayCounter = 0.227.15. PSoC C Code 7/20/2004 Revision A -4- .209.188.59312 -0. if (PwmValue > (255-MinPWM)) PwmValue = 255-MinPWM.47.84105 10 4 5.218.39687 -0.165.40474 22 4 5. Clk_PWM_Start().1025 -0.246.7091 -180.20622 15 4 5.91.top and bottom #define PwmChangeDelay 50 //sine wave frequency #define STEPS 63 char Sine[STEPS]={128.116.00438 -0.1011 -25.69125 -0.

Program Flowchart 7/20/2004 Revision A -5- . AN2192 Figure 2.

AN2192 Figure 3. PSoC Pin Configuration Figure 4. PSoC Configuration GUI 7/20/2004 Revision A -6- .

PSoC Configuration Settings Figure 6. PSoC Global Resource Settings 7/20/2004 Revision A -7- . AN2192 Figure 5.

AN2192 Figure 7. Bipolar Chopper Schematic 7/20/2004 Revision A -8- .

787. The information contained herein is subject to change without notice.A. Inc.669. Contact: psoc@chrispaiano. Made in the U. 40+ years electronics/design and troubleshooting experience. WA 98037 Phone: 800. Programmable System-on-Chip™.com/ / http://www. Computer Engineer and Electronic Engineer Background: 22+ years programming/computer experience. AN2192 Figure 8. Dual High-Voltage Power Supply Schematic About the Authors Name: Chris and Vincent Paiano Title: B.com Cypress MicroSystems.4641 http://www. and PSoC Designer™ are trademarks of Cypress MicroSystems.cypress. All other trademarks or registered trademarks referenced herein are the property of their respective owners.S..0557 Fax: 425. Building D Lynnwood. Inc.S. All rights reserved. PSoC™.com engineering@chrispaiano. 7/20/2004 Revision A -9- .cypress. 2700 162nd St. Inc.com/aboutus/sales_locations. SW.cfm Copyright  2004 Cypress MicroSystems.