A WIZARD'S ELECTRONICS COMPANION

SWITCHING CIRCUITS

The concept was long known how one might take advantage of a switch to control relatively large amounts of power, but the electronic switches weren't up to the task until a couple of decades ago. A switch is designed to not have significant losses when placed in series with a load, but the best switches had always been mechanical ones. When transistor became viable, some switching was tried, but switching circuits are far more complex than their analog counterparts, not the least because rates of change of current (the energy conversion between potential and energy of motion) are critical and very high in a switching circuit, as are rates of change of voltage. These fast transients are what create most of our noise problems in circuits to begin with because they generate stray fields which can affect nearby circuitry. Gradually, we are learning techniques to mitigate these problems. Improvements are constantly being made in the electronic switches themselves, too. Switches with no resistance whatsoever (in the form of a field-effect transistor) have already been demonstrated in the lab. Materials such as the carbon nanotube which allow electrons to take flight down their length as though in a waveguide (ballistic conductance) may also prove to revolutionize inductors as they would have no resistive losses along their length. A well-designed analog circuit may have an efficiency of 5%, but an equally well-designed switching circuit which might accomplish the same task can achieve better than 99%.

Regular analog and digital circuitry have traditionally been resistive and lossy in nature throughout the first few decades of electronics. Note that the most common component in this entire tutorial is the resistor. Reactive parts, on the other hand, only have resistance as an artifact of their construction. The fundamental principle of inductance and capacitance is not resistive at all. Theoretically, it is possible to cleverly shuttle electricity around in such a way that no resistors at all might be used. In practice, current trends are quite content with improving the losses where they are the worst, in power circuits and amplifier output sections. Computers, though, are pointing to the way much circuitry will go. Between your power source and your transducer, only information needs to exist. Digital computers themselves, working almost entirely in this realm of information, are more aggressively being engineered to reduce those losses. Experiments have shown that information can be stored in the smallest quantum of sub-atomic structure. Time and effort will coax these technologies from the cosmos.

To use these ideas in our own circuits will require a shift in thinking. I have inadvertantly brainwashed you with the bulk of this text by lightly covering reactive effects because inductors are among the more expensive components and it has been difficult to make a really pure inductor without either significant capacitance or resistance. If needed, study the section on inductance again.

The first switching circuit I ever attempted was an LED blinky that used a 9V battery. I knew I only needed about 1.8V of it for the LED and four-fifths of the power was being wasted in the series resistor. While this is almost never an issue in practice because of the added cost, to fix this in my circuit was to extend the battery life significantly. I reasoned that if I were to store a quantity of charge in a capacitor, I could charge that capacitor steadily, but draw it off in little bursts with an electronic switch. If my blinky circuit had used a linear device like a resistor, the current surges would have been five times what they needed to be for one-fifth of the time. Further, a resistor could have averaged the power and dissipated a nice steady amount. The LED, on the other hand, is a non-linear device. At 9V, the effective resistance is infinitesimal, leading to currents far, far beyond what the device is capable of withstanding, let alone functioning efficiently. What I needed was a current source that was not terribly lossy. A switching solution is descibed is shown in the figure.

The inductor tries always to maintain the current at whatever level it is at. When the upper switch is first turned on, no current can flow through the inductor. Gradually, the current begins to build as shown in the Basic Switching Concept figure A. Before the current becomes excessive, the upper switch is turned off. The inductor's magnetic field takes over the job of maintaining the current, and this field will be tapped at whatever rate is required to try and maintain the current. Before a misapplication of the energy in the inductor is allowed to occur, the lower switch is turned on to complete the circuit and allow the inductor to act a bit like a temporary battery for the LED. As the energy in the inductor begins to get a little depleted and the current threatens to drop below the amount we wish to maintain, we open the lower switch and close the upper switch, repeating the whole current charge and discharge cycle in the inductor.

The switches are electronic in nature and typically will be cycling at perhaps 50kHz. Let us give calculate what my inductor might be. For an inductor, an inductance of one(1) Henry will allow a rate of change of current of one Ampere in one second. The on/off switching begs to be driven with a rectangular waveform (generically, we usually refer to all of them as square-waves, even though it really refers to those with equal on and off times. Our square wave duty cycle needs to be on for one-fifth and off for four-fifths of the time. That total time being 1 / 50kHz = 200µs. Assuming an LED operating current of 20mA, and figuring the efficiency won't suffer if it varies by 10mA either way, the charging cycle will start at 10mA and end at 30mA during the on time which would be one-fifth of our 200µs, or a 40µs "kick". The inductance which would get us in the ballpark (since these are linear simplifications of much more complex equations) would be:

E = L * I / t ==> L = E * t / I = (9V - 1.8V) * 40µs / 0.02A = 14mH

Another useful way we can visualize an inductor's operation in a switching circuit is imagine the inductance tends to average the waveform, and if the inductance is high enough, to block the incoming switching waveform leaving an average DC voltage. Since an inductor does not block DC, the average DC on one side of the inductor will be that on the other side. The DC level with a switching waveform (or square wave) will be directly proportional to its duty cycle (that is, if the voltage goes to 9V for 1/9th of the time, the average will be 1V.) If there is no load on one side of the inductor, the DC level needed is zero and the duty cycle on the other In a circuit so sensitive to voltage as the LED, adjustment to the values or a slightly improved design is called for. Let's be clever and try to improve our circuit to adjust to our desired 20mA. This process really challenges your experience, as you either have to be familiar with a specific method or understand the underlying dynamics of your basic parts enough to achieve your goal. The figure shows several methods.

The simplest method is the current-limiting resistor. We needn't use a switching circuit for that. Because of the relatively high source voltage, changes in the battery voltage will have small effects on the current through the resistor and LED. This is the method of choice for a simple indicator. Since our load is a current-driven device (meaning it is overly-sensitive to voltage changes and is controlled or driven via a range of currents), we might choose the amplifying effect of active device such as a transistor to supply our current at a relatively stable rate in a current source. Since this is an inefficient analog approach we need to somehow monitor the actual current, then come up with a way to feed-back the information to our drive circuit. One of the most common ways is to put in a current-sensing resistor of a small value in series with the LED, amplify the small DC voltage which is proportional to the current, and using the amplified signal voltage to tell the circuit that it's time to switch states. In the versatile 555 timer IC, there are no less than four of the eight pins we could use to input that feedback signal: pin 6 (threshold, inverting) drives the output low and turns on the discharge transistor if the timing capacitor charge (or our external signal) goes above 2/3 of the the supply voltage, pin 4 (reset, inverting) drives the output low when it is pulled to ground, pin 2 (trigger, inverting) drives the output high and turns off the discharge transistor if the timing capacitor (or our external signal) goes below 1/3 of the supply voltage, and pin 5 (FM, frequency modulation, non-inverting) adjusts the reference voltage for the threshold input so it is different from 2/3 of the supply voltage (changes the frequency but not the duty cycle) which could be used if you pull current depending on whether it is low or high, thereby changing the rate of only one state (high or low). Since we need the input to turn off the current, an input pin which drives the output low means we would attach our LED between output and ground, if it drives it high then we attach the LED between output and the positive supply voltage. Looking at the LED connected to B+, to turn off the current requires the output to go high which is served by pin 2 or pin 5, and if the LED is to B-, by pin 4 or 6. To help us decide, look at the current-sense resistor circuit needs. We can either connect one end to either B+ or B- and tap our sense signal off of the other end, or with the addition of a comparator we might make a differential measurement between each end of the resistor no matter where between the 555 and the power supply "rail" it resides. Since ours is a simple application, we try the cheaper approaches first. The only input which might eliminate the need for an external transistor would be pin 5, since the other definitely would at times require several volts to trigger the desired action. Pin 5 would allow a continuously-variable average signal to perturb an otherwise normal oscillator cycle, so we consider this first. The FM input on pin 5 has a specific "rest" voltage of 2/3 of the supply, but we need it to react to both the sense-voltage and the 555 high/low state, requiring a summing of both signals. A resistor from our summing point to the output on pin three will satisfy that requirement. This would introduce a variable duty-cycle capability to an otherwise frequency-variable-only input. When the output was high, pin 5 would be slightly higher than 2/3 of B+, which changes the threshold reference to a that higher voltage and raises the trigger reference by half that amount, which would slightly lengthen the duration of that high output state. When the output was low, the threshold reference would be slightly lowered and lowers the trigger reference by half that amount, which would slightly lengthen the duration of that low output state, but by half as much as the lengthening of the high state. It would stay low longer the lower the value of resistance you had between the FM input (pin 5) and the output (pin 3), and be proportional also to the duty cycle. Summing this signal with the sense signal through a second resistor would perturb our duty cycle in the process described above such that a higher sense voltage (relative to ground) would push for a longer output low-state time. If the LED goes to B-, a higher sense voltage means more LED current and would push the output to be low longer thereby lowering the current that was rising. We need negative feedback here. If the LED goes to B+, a higher sense voltage (relative to ground) means less LED current and would push the output to be low longer thereby increasing the LED current that was getting smaller. So, we can make this work with the LED to either B+ or B-. By introducing an resistor to shift the duty cycle, then sum a voltage to this, we find we are able shift the duty cycle. Furthermore, it provides the negative feedback we need. The FM input configuration is shown in the figure:

To try and model the circuit begins with the divider reference in the 555 chip. The threshold reference is normally 2/3 of the supply and the trigger reference 1/3, taken from an internal resistor divider of approximately three equal resistors of 5k each. The threshold reference is the voltage on pin 5 (FM input), which we are pulling on. We can't directly see the trigger voltage, but both references are reflected precisely in the capacitor charge voltage waveform. The upper peak is the threshold reference and the bottom peak is the trigger reference. If you pull the upper node toward B+, the voltage difference is 3V, if toward B-, there is 6V. If we put a 4k resistor between the output (pin 3) and the FM input (pin 5), it will have an effective pull approximately the same as the resistance of the internal divider. The result is we will pull that 6V halfway to 9V (at 7.5V) when the output is high, and when the output is low our pin 5 will be twice a far below 6V (at 3V) because we are pulling with twice the potential. The lower node at 1/3 the supply is inaccessible, but we see the results in the trigger point when the capacitor begins charging again. Also, we know the divider places the voltage at precisely half the upper node. The voltage when the output is high would have been 3.8V, and when the output is low, 1.5V. Since we are intentionally introducing hysteresis in this manner, the effective capacitor charging band is, instead of 3V,

7.5V - 1.5V = 6V

Note this will change the frequency, but not the duty cycle. The middle third of the full charge voltage is used to both reduce the uneven triggering you would get if you tried to trigger on the very shallow curve of a capacitor near the limit of its charge voltage, as well as put the trigger and threshold far enough apart to be useful.

If we were to put a resistor between pin 5 and either B+ or B-, the reference voltages would be pulled toward one of the rails. The voltage closest to the rail would be seeing a very shallow capacitor charge curve, much shallower than the other one. The result would be a shifting in duty cycle as the shallower curve took longer to reach the reference voltage. We might try to use this effect to turn the FM input into an FM-with-a-little-pulse-width-modulation input. The frequency change doesn't affect the duty cycle, and thus won't change the steady-state current flow. If we modulate the offset, though, with a voltage proportional to our output current by putting a resistor between a current-sense resistor and pin 5, and that feedback is negative, we may have a way to control current flow from the output of the 555.

Since the voltage on a sense resistor attached to one of the power supply "rails" would never (ideally) get very far from that of the rail. If our modulating signal from the current sense resistor going to the offset in the charge capacitor references were connected via a simple resistor, they should preferably be sort of close in voltage so current variations are actually noticed by the FM input (i.e., if we pull the internal divider near to the B+ rail, we should connect our current sense resistor to the B+ rail also), unfortunately, this is positive feedback, so we will have to use the distant rail and deal with the loss of gain (or add more parts).


Previous section:
Attenuators
Table of
Contents
Next section:
Contents
Home