Dr. Klge Chris Greacen Lets speak biologist's talk for a moment. In the past decade a new genus of electronics has evolved for home renewable energy systems. Species within this new genus include inverters, charge regulators, and linear current boosterstm (LCBs) which are small, efficient, and reliable. Outside of the renewable energy market, you'll find them in the heart of power supplies for computer equipment, as battery chargers, and as controllers for efficient variable speed motors. Inside their black boxes these switchmode circuits control the electrical current which flows through them by switching that current on and off thousands of times a second. [Sounds kind of strange, huh? Let's look at why and how.] Why Switchmode? Transistors are electrically-controlled electricity faucets. They can be turned anywhere from full-on (conducting) to full- off (insulating). Last issue I showed some circuits which use a small amount of electricity to turn a transistor greater or lesser degrees of "on". As we saw last time, these circuits are inefficient at regulating the amount of current that is delivered to a load. To regulate electricity they have to waste some of it as heat. For example, in the circuit in figure 1, if we want just 0.1 Amperes of current to flow through the 60 light, then Ohm's law (V=IR) tells us that the voltage drop across the light is (0.1A)(60) = 6 Volts. This means the remaining 6 Volts must be lost across the transistor. The transistor wastes half of the power the circuit consumes! If you want even less current in the lightbulb a greater percentage is lost in the transistor. INSERT FIGURE 1 (Figure 5 from last time) The problem here is that the transistor is turned only part way on. The switchmode solution is to turn it fully off, then fully on, then fully off, many times a second. When the transistor is turned fully on then there is only a very small voltage drop (V) across it, and therefore the power dissipated (P = IV) is small. On the other hand, if it is turned fully off, the transistor dissipates zero power because no current (I) flows. The trick is to switch the transistor on and off fast enough so that the load it is driving does not behave strangely. If the load is a lightbulb then you want to turn it on and off fast enough that your eyes don't notice a flicker. In a movie theater, for example, about 30 frames a second are shown on the screen. Our eyes and brain blur them into a continuously moving scene. To make an electronic dimmer for a 12 volt light, we might choose to have it turn on and off, say, 100 times a second. If the load is a motor, you want to drive it fast enough that its motion isn't jerky. In many circuits, switching at 100,000 times a second is not uncommon. It turns out that the faster the circuit switches, the smaller (and less expensive) some of the components can get. It is possible to switch too fast, especially for loads with lots of coils of wire in them (like motors). These inductive loads reject high frequency power. INSERT Figure 2 IcVsVbe Duty Cycle Now lets say that the transistor in this light dimmer spent 50% of its time 'off' and 50% of its time 'on'. On average the circuit will draw 50% the current it would if the transistor was 'on' all the time. We say this circuit has a duty cycle of 50%. Likewise, if it spends 75% of its time 'on', and the remaining 25% 'off', it will conduct 75% of the full current. It has a 75% duty cycle. In circuits like the Heliotrope cc series charge controllers, electronics vary the duty cycle of current coming from the pv panels. When the battery's voltage is low, duty cycle is 100% so that all current goes to charge the battery. As the battery voltage rises, the duty cycle shrinks, so current from the pv panels is 'refused' a larger and larger fraction of the time. There are two ways to vary the duty cycle of a switchmode circuit. The most commonly used is to keep the frequency of the pulses constant, but vary how long the pulses stay 'on'. This is called "pulse width modulation" (PWM). The other method is to keep the pulse widths the same, but vary the frequency. This is called frequency modulation. Of course you could vary the duty cycle by some combination of these two, but in practice that's not usually done. INSERT Figure 3 duty cycle How they work We've looked a bit at why switchmode transistor circuits are common, and what they do. Now lets look at how they do it. The important new element here is it is necessary to measure time. The pulse needs to be on for a controllable amount of time, and then off for a controllable amount of time. In switchmode circuits this is usually done with a relaxation oscillator with timing controlled by a resistor and a capacitor. What's a capacitor? A capacitor is a lot like a battery, but instead of storing lots of electricity in a chemical reaction, it stores a small amount in a static electric field. In fact, if you've lived in a dry climate, you've felt what it's like to be a capacitor, charging up as you walk across a rug floor, and discharging "ZAP!" if you touch a piece of grounded metal or another person. The capacitor is the first part which can be used to sense time. If you feed it a flow of current, its voltage rises predictably over time. More specifically, its voltage is proportional to the charge (Q) it holds: V = Q/C. Charge is current times time. Capacitance (C) is measured in Farads, and and indicates how much charge the capacitor will hold at a given voltage. If a capacitor is charged through a resistor from a set voltage (like the a battery voltage) then the voltage across the capacitor doesn't increase steadily. It increases more like a punctured tire deflates: quickly at first, then slower and slower. If you multiply R (resistance) times capacitance (C), the answer is in units of seconds. It takes about 1.1RC (seconds) for the capacitor to charge from 1/3 Vcc to 2/3 Vcc (or discharge from 2/3 Vcc to 1/3 Vcc). How long does it take to fully discharge a charged capacitor? In theory, it takes forever, just like in theory it takes forever for a tire with a leak to fully deflate. The flow just gets less, and less, and less... INSERT CapTriangle, CapSawtooth Sidebar: Klge Capacitor In the interest of clear mental imagery, Dr. Klge has assembled a plumbing capacitor. It's a piston in a pipe, restrained by a couple of springs. Turn on the water pressure and the cylinder in the capacitor is pushed down by the water pressure. Some of the pressure is lost going through the gravel filled "resistor", limiting the current which displaces the piston. Over time the spring gets tighter and tighter, and less and less water flows in past the resistor. It's fully charged when the spring is so tight that no more water can flow into it. In other words, the pressure on the capacitor is equal to the pressure of the water supply, with no pressure drop across the resistor. The bigger the capacitor or the greater the resistance of the resistor, the longer the capacitor will take to charge up. If the water pressure is turned off and the capacitor is allowed to drain, water gushes up through the resistor a lot at first, and then less and less as the spring relaxes. Notice no water flows though the capacitor. A capacitor looks like an open circuit to direct current flow. But it can pass "pressure jolts." A pressure pulse on one side of the capacitor jerks the cylinder, passing the jolt to the other side. The pressures on either side of the capacitor need not be equal for this "jolt passing" to work. In this way, real electrical capacitors are often used to pass voltage pulses from one DC voltage to another. In a similar application, a capacitor from + to - in a DC system will let noise pulses pass to ground, effectively drowning them out. A capacitor in this service is called a "filter capacitor". INSERT figure 3 capacitor piston INSERT figure 4 drawing of several capacitors The 555 relaxation oscillator Now for the oscillator, the part that turns the transistor quickly on and off. Fortunately integrated circuits (ICs) handle a lot of the dirty work for making reliable, accurate oscillators. The favorite around here is the venerable 555 timer chip you'll find a liberal sprinkling of circuits which use this chip in Home Brews in back issues. The 555 works by watching the voltage on pins 2 and 6. When pin 6 six is greater than 2/3 Vcc (Vcc is the supply voltage), then the output (pin 3) goes low (zero volts). When pin 2 goes below 1/3 Vcc, pin 3 goes high. Pin 7 is like a drain valve whenever pin 3 is low, pin 7 opens up a drain to ground. Below is the simplest oscillator you can make with a 555 chip. I chose large resistors so that the oscillator cycles slowly you can see it pulse on and off. INSERT ElectricDuck555 Dr. Klge has assembled an analogous "plumbing 555 circuit" as a pulsing bird bath for his duck friends. The dashed lines encircles everything going on inside the "chip". In every cycle the capacitor charges up through gravel filled "resistors" R1 and R2. When the pressure level reaches 2/3 Vcc a switch turns on lights alerting the upper duck to shut off the output (pin 3), and the lower ducks to open the drain to start discharging the transistor. The capacitor then drains through resistor R2. When it drains to 1/3 Vcc, the other set of lights come on, alerting the upper duck to turn on the output, and the lower ducks to shut off the drain that was draining the capacitor. INSERT PlumbingDuck555 INSERT 555pinout It seems like a hopelessly complicated way to make something turn on and off, doesn't it? But we're in the universe of electronics. Rube Goldbergian solutions are not penalized heavily here. Electrons are flexible travelers. And the advantage is that the oscillator's frequency and duty cycle are controlled by the choice of external components in this case two resistors (R1 & R2) and a capacitor (C). Mildly Techie Stuff: Real Light Dimmers It's fun to see the blinky lights, but for a real light dimmer the light needs to blink so fast you can't see it. Below the circuit is modified to make it 100 times faster, adjustable, and able to drive a big light. Pin 3 drives a small transistor, which, inturn drives a 15 Ampere power transistor. This configuration of transistors is called a Darlington pair, and is a common method of increasing the power of switched signals. INSERT Duck555Adj The oscillator in figure (xxx x) isn't as flexible as you might like. While the oscillator's frequency can be controlled over a wide range, its duty cycle cannot. The time the capacitor takes to charge from 1/3 Vcc to 2/3 Vcc is 1.1(R1 + R2)C. The capacitor then discharges to 1/3 Vcc in 1.1(R2)C seconds. So the duty cycle = time on (time on + time off) = (R1 + R2)C [(R1 + R2)C + (R2)C] = (R1 + R2)C [(R1 + 2R2)C]. If the circuit is built with R1 large compared with R2, then the duty cycle approaches 100%. If R2 is large compared with R1 the duty cycle approaches 50%, but that's as low as it goes. A circuit with duty cycle adjustable from 5% to 95% is shown below. It's one we use in the "pulsar" battery charger (HP #30 page 54) and the Mark VI alternator field controller (HP#2). In the charging cycle, the capacitor C charges through resistor R1 and the "top half" of R2, and the diode D1. When pin 7 opens up the drain to ground, the capacitor discharges through D2, R4, and the "bottom half" of R2. INSERT PulsarFrontEnd Field Effect Transistors A decade ago, 12 Volt DC to 110 ac inverters were finiky and inefficient, with low surge currents. You could count on them blowing up annually. Today they're standard equipment in renewable energy homes they're powerful and rock-steady. Power Field Effect Transistors (FETs) are a large part of the reason why. FETs also handle the power in electric vehicle motor controllers, and renewable energy charge controllers. Compared with regular bipolar transistors (the NPN or PNP transistors we covered last issue) they're easy to use, efficient, and extremely powerful. Properly heatsunk, an IRFZ40 FET in a TO-220 case the size of a large raisin can switch 50 Amperes. This is about 10 times what a similarly sized bipolar transistor can switch. INSERT plumbing bipolar INSERT plumbing FET Caption: If a bipolar transistor is a current controlled electricity faucet, a FET is a voltage controlled electricity faucet. What is a FET? It's a charge controlled transistor. Bipolar transistors (the NPN and PNP transistors we've looked at earlier) are current controlled devices. You put a current into the base of a bipolar transistor, and the transistor allows a proportionately larger current to flow through the collector and out the emitter. In a FET, conduction between the drain and source is controlled by an electric field, produced by voltage applied to the gate electrode. This is the main advantage of a FET the gate draws current only for an instant. The gate is electrically sealed from the rest of the transistor. It charges up like a tiny capacitor. When the gate is charged to about four volts (usually fractions of microsecond), the FET begins conducting. Once it's on, it stays on as long as the voltage continues to be applied to the gate. To turn it off, bleed this charge to ground. INSERT FET vs NPN Caption: In a FET, all the names of the terminals are all changed. The gate corresponds to a bipolar's base; the drain corresponds to the collector, and the source corresponds to the emitter. INSERT FETdrawn CAPTION: FETs can be destroyed by static electricity, and if humidity is down to 10% to 20% you can build up 35,000 Volts just walking on a fluffy carpet. When handling them, it's best to ground your wrist with a wire attached to your electrical system ground. As a result, a FET can be controlled by a much weaker signal than an equivalent bipolar transistor. In electronics jargon, we say FETs have a "high input impedance". This can simplify circuit design. As an exercise in FET appreciation, compare the output sections (everything to the right of pin 3) of figures (XX) and (XX). In the bipolar version, pin 3 drives the base of a 2N2222A transistor through a current limiting resistor. The current limiting resistor keeps the 555 output current to well below its 200 mA maximum. When this transistor is turned "on", it draws current through R5 (12 Volts 40 = 0.3 Amperes). This amplified current inturn supplies the base of power transistor Q2, which, finally, lights the light bulb. In the FET version, only a 100 resistor is required to limit the output current of the 555 as the gate charges. This happens quickly, mind you. The IRFZ40 has one of the largest FET gate- source capacitances, but it's still tiny: on the order of 3 nanofarads. This means the gate charges to four volts in about a third of a microsecond about 10,000 times faster than the duration of each pulse. Access: Chris Greacen, Home Power Magazine, POB 520 Ashland, OR 97520 916-475-3179 Parts: Your local electronics store. IRFZ40 FETs (or similar part IRFZ42) are available for around $4 a piece from DigiKey 1- 800-DIGIKEY. For currents under 5 Amps, you can use a weaker IRF511, available for about $2 in most electronics stores. Further reading: The 555 Timer Applications Sourcebook, Howard M. Berlin, 1976 Howard W. Sams & Co., Dept. DM, 4300 West 62nd Street, Indianapolis, IN 46268 The Art of Electronics, 2nd Edition, Paul Horowitz and Winfield Hill, 1989 Cambridge University Press. Over 1100 pages of this stuff, in depth, well-written, "hands on info".