Digital Benchtop Power Supply Part 1
Digital Benchtop Power Supply Part 1
Digital Benchtop Power Supply Part 1
12
Elektor Electronics
11/2001
POWERSUPPLY
program is also available for free download from the authors website at www.pic-basic.de. The source code of this program is also published, so that it can be modied for other applications. A Microchip PIC16F84 microcontroller controls the power supply, running a program written in PICBASIC 1.3. The source code, assembler listing and machine code hex dump for this program are also freely available from the address above.
DIGITAL PSU SPECIFICATION IN BRIEF 2,5-A version Input voltage 230V Set voltage accuracy Set current limit accuracy Output voltage ripple 0/+10 % @ 2.5 A / 25 V 10 % @ 2.5 A / 24 V +30 mV typical +5 mA typical 5 mV (voltage regulation) 10 mV (current regulation) 1-A version 10% @ 1 A / 20 V +30 mV typical +5 mA typical 5 mV (voltage regulation) 25 mV (current regulation)
board. Only the pass transistors, the LCD module and the mains transformer (along with the mains input and switch) are not fitted to the board. The classical analogue regulator circuit is brought up-to-date using an LT1491. This IC is a quad
operational amplifier, which has the same pinout and practically the same (or better) characteristics as the legendary LM324. Also, the LT1491 offers rail-to-rail operation on its inputs and outputs. Table 1 shows a few of the characteristics of the two ICs. The LT1491 earns its place in this circuit despite its
S1
T2 TR1
E1
T5
Fl1 K4
B1
4 R1 220
2x 1N4148
D3 R2 330 D4 T1 R5 330
T3
E2
T6
F2 4A T (2A T)
C2 470 63V
C19 10 63V
11
B80C5000 (B80C1500)
C1
C1'
5W
0W6
C5 10n
T7
051 0W5
1k
IC1
(1k8)
T4
E3
R47
R7
K5
C12 47 63V
1% R8 39k
0W5
+5V
D1 R43 10k
100k
P600D (1N4007)
BC 557B
R4
U I U I U I U I
S2
+5V IC5
SRG8 C1/ 9 8 2 3 1D
D5
D6
R15
U
1n 13 14 R9 10k
10k 1%
IC1.B
0...25V 0...2A5
S3
IC7 78L05
+5V
1N4148
C7 100n 2
1N4148
IC1.D
S4
12
(0 oder Drahtbrcke) 8
&
R14 10k
10
R20 1k
S5
4 5 6 10 11 12 13
IC1.C
R21 1% R22 18k (39k) 1%
R24
R25
R26
R27
R28
R29
R30
R31
R32
S6
10k
10k
1 2
R23 1k 1%
S7
+5V 74HC164
R34 1k
R12 47k
S8
47k
C8 10 Tant
R11
R24 ...R33 = 1%
+5V +5V
S9
K2
14 14 14
IC4
7
IC5
7
IC6
7
IC4.D +5V
C18 R42 47k 14 100n 10 11 12 8 6
IC4.A
4 5 1
13
+5V
+Ub 2 Uo R44 3k3 3
K3
1 GND
IC4.B
+5V IC6
SRG8 R C1/ 9 8 2 3 4 5 6 10 11 12 13 C14 10 16V 1D 2 10 16V 16 TXD 3 7 8 13 14 4 5 C1 T2OUT R2IN R1IN T1OUT C2+ CTS T2IN R2OUT R1OUT T1IN 10 9 12 11 C15 15 10 16V RXD C16
4 13
MCLR RB7 RB6 RB5 RB4 RB3 RB2 RB1 RB0 OSC1 16 X1 OSC2 15 5
IC3
RA0 17 18 1 2 3 R39 1k R38 100k 1% C10 4n7 1 2 RA1 RA2 RA3 RA4
+5V
4 5 6 7 8 9
RS R/W E D0 D1 D2
12 11 10 9 8 7 6
K1
C13 10 16V
C1+
V+
PIC16F84
IC2 = TLC272
R37 100k 1% 5 7 6
+5V
R35 100k
&
IC8
IC2.B
IC2.A
P3 2k5
1 0 D3 1 1 D4 1 2 D5 1 3 D6 1 4 D7 15 16
LCD 1x 16
MAX232A
C2 V6 C17
74HC164
4MHz
100n 000166 - 11
1%
10 16V
Figure 1. Circuit diagram of the 2.5 A power supply. Values in brackets refer to the 1 A version.
11/2001
Elektor Electronics
13
12V 1W3
R13
IC1 = LT1491
R10
R33
IC2
1k
IC1.A
POWERSUPPLY
higher price. With the aid of a few close-tolerance metal lm resistors the op-amps work sufficiently accurately that only a few calibration points are required. In a power supply with classical analogue regulation such as the circuit in Figure 1, the output voltage and current are measured and continuously compared against the desired values by comparators. For this, the output voltage is taken directly from the output connectors (thereby avoiding errors due to the resistance of the tracks and contacts) and brought into the input voltage range of the comparator using a simple voltage divider. Current measurement is somewhat more complicated, since in general a shunt resistor is required in the current feedback loop. The resistance of the shunt must be as low as possible in order not to reduce the output voltage range too severely and to keep the power losses low, but on the other hand must be high enough and accurate enough to ensure that the voltage drop (which is proportional to the current) is practically measurable by the comparator and not lost in the offset voltage or noise of the electronics. The shunt resistance consists of ten 1 resistors (R24-R33) wired in parallel. This is rather cheaper than a 0.1 resistor with a tolerance of 1 %, and the expected deviation from the true value is rather lower. The layout is organised so that only a little track resistance affects the measurement. With an output current, or load, of 2.5 A, 0.25 V is dropped across the shunt resistance. Op-amp IC1.C multiplies this voltage by a factor of 20, in the 2.5 A version, and 40, in the 1 A model. This amplied voltage is measured and taken to the comparator via R14. However, the current also has an effect on the voltage measurement. Op-amp IC1.B divides the voltage drop across the shunt by four and inverts it, giving 0.0625 V. If the voltage across the output terminals (i.e., across the load) is 25 V, then 25.25 V relative to the circuits ground appears at the positive output terminal. Voltage divider R7/R8 and R15 have a total value of 50 k. Across the voltage divider we have 25.25 V+0.0625 V=25.3125 V. Of this, 4/5th is dropped across R7 and R8, and 1/5th is dropped across R15. Across R15 we therefore have a drop of 5.0625 V. At the voltage divider output (at the junction of R8 and R15) we therefore have exactly 5 V relative to the circuits ground. The voltage at the output of the voltage divider (relative to ground) therefore reflects exactly the output voltage, independent of the current flowing in the shunt resistor. Without this compensation for the voltage error the voltage across the shunt resistor (up to 0.25 V)
Table 1. LM324 vs LT1491 LT1491 (typical values) Offset voltage Offset voltage drift Input current Power supply voltage (max.) Short-circuit output current 200...350 V 2 V / C 4 nA 44 V 25 mA LM324 (typical values) 2 mV 7 V / C 45 nA 32 V 20 mA
would affect the measurement of the output voltage. So that the opamps can operate with negative voltages relative to ground a negative auxiliary supply is required, which is derived from the input voltage with the aid of diode D1. The divided-down, amplied and compensated measurement voltages are finally taken to the inverting inputs of op-amps IC1.A and IC1.D via R9 and R14. Op-amp IC1.D, connected as a comparator, compares the actual voltage (at the inverting input) with the desired voltage, and IC1.A does the same for the current. The desired values originate from the PIC16F84 microcontroller (IC3) which can generate two precise analogue voltages thanks to R/C combinations R11/C9 and R12/C8. The voltages are produced using pulse-width modulation of the microcontrollers output pins. These two D/A converters have a resolution of 8 bits. C6 and C7 cause the two comparators to exhibit a lowpass response. The outputs drive the base connection of the pass transistors via D5 and D6 in a wired OR conguration. If one of the measured values exceeds the desired value, the base is pulled towards ground (or even slightly below) and the transistors are switched off. If neither the desired current nor the desired voltage is reached, constant current source T1 delivers a base current of 2 mA (for a 2.5 A power supply) or 360 A (for a 1 A power supply), independent of the output voltage. Such a low base current is only practical because power Darlington transistors (T2, T3 and.T4) are used. For the 2.5 A unit three Darlington transistors are fitted. In order that the current is properly shared between the transistors, 0.51 emit-
ter resistors are provided. If the voltage across one of the three resistors rises above 0.65 V (at around 1.3 A), one of the transistors T5, T6 and T7 will turn on and thereby turn off the base current to the Darlington transistors. This affords effective protection against current spikes that may occur if the output is short-circuited and which would otherwise damage the power transistors. In the 1 A power supply only one Darlington transistor is tted. The emitter resistors and protection circuit can therefore be dispensed with. For the 2.5 A power supply a 0.6 K/W heatsink is required, and for the 1 A power supply a 2.4 K/W heatsink is fitted. At maximum load that is with a short-circuited output at the highest current possible a temperature of 80 C will be reached. The two versions of the power supply are therefore (without active cooling) suitable for continuous use at full load.
14
Elektor Electronics
11/2001
POWERSUPPLY
current in the ground connection of the voltage regulator. Load-dependent variations in the common-pin current therefore only have a very small effect. Moreover, the load current varies proportionally less owing to the high basic load current. As a result of these measures, the reference voltage is very stable and changes only as a consequence of the normal ageing of the components. It is therefore recommended, as with any other electronic test equipment, to recalibrate the device after a few years. The reference voltage reference voltage is also used for the deltasigma A/D converter built around IC2. Using this conversion technique a high-precision converter can be built with little circuitry, and, independent of component tolerances, very accurate measurements can be achieved with good reproducibility. However, 1 % resistors have been used to simplify offset calibration using P2. The microcontroller also plays a part, of course, in the analogue-to-digital conversion. Conversion proceeds in the following stages: In the initial state, microcontroller pin A2 (set as an input) is high impedance and pin A3 (an output) is at 0 V. The voltage to be measured is present at the non-inverting input of IC2.B, and, since the op-amp is connected as a buffer, also at its output. Let us suppose that this voltage is exactly 1.28 V. Then the output of the integrator IC2.A will be at the level of the positive supply. Pin A2 on the microcontroller will interpret this as a high logic level. When a measurement is to be carried out, the microcontroller changes the state of pin A3 from low to high (i.e. to 5.12 V) and waits until the voltage on A2 changes to logic low. Now, by toggling pin A3 the microcontroller holds the output of the integrator in the middle of its range. The varying output signal of the integrator will be interpreted by the microcontroller as high or low. The mark-space ratio of the integrators output is now measured. It can be seen that pin A3 must be held high for three times as long as it is held low: this is so that, when combined together with the voltage being measured, a voltage can be produced at the inverting input to the integrator which on average is exactly the same as the voltage on its non-inverting input, namely 2.56 V. The offset with P2 is required, because this type of A/D converter does not operate with negative voltages: the microcontrollers algorithm would fail. As well as allowing for compensation for component tolerances, P2 also provides a small positive offset. A TLC272, with MOS inputs, is selected for IC2 because the A/D converter will only work accurately when the input currents are considerably smaller than those achieved with bipolar ICs. This benefit is bought at the cost of a relatively high offset voltage. Here however, where an adjustment must be made anyway, this is no real disadvantage. IC4 is an analogue switch that connects either the voltage at pin 11 (for voltage measurement) or at pin 8 (current measurement) to buffer IC1.B. loaded into the register by the microcontroller using pins B5 (data) and B6 (clock). In the case of IC6 these values are control commands and character codes which are transferred to the LCD module, running in 8-bit mode, using a strobe signal on pin B7. In the case of IC5 these form a bit pattern which allow the microcontroller to identify (via pin B4) when a button has been pressed. P3 is the potentiometer required for adjustment of display contrast. The wiper being at the ground end corresponds to a viewing angle of between 10 and 20 above vertical: this is the recommended setting when the unit is to be used on the bench. Microcontroller pins B0, B2 and B3 comprise an RS232 port. Using the well-known MAX232 the signal levels are shifted between 10 V on the RS232 side and TTL levels on the microcontroller side. In addition to the required connections (RXD and TXD), the CTS (clear to send) signal is also connected. The RS232 interface offers remote display as well as remote control. This will not concern us further here: a description of the software and operation of the unit will be presented in the second part of this series, in the next issue. Let us turn instead to the construction of the power supply.
(000166-1)
Interfaces
The microcontroller has several interfaces at its disposal. The keyboard interface is implemented using IC5 and the LCD panel is connected via IC6. These are 8-bit shift registers (type 74HC164) with serial input and parallel outputs. Digital values are
The construction of the Digital Benchtop PSU will be described in next months issue.
11/2001
Elektor Electronics
15