e01b012.PDF

(293 KB) Pobierz
000166-1-UK Netvoeding
POWER SUPPLY
Power Supply (1)
Part 1:
analogue electronics controlled by microcontroller
Every electronics laboratory needs a powerful regulated bench supply. In
the model described here a microcontroller monitors the actual and
desired current and voltage settings.
There are many types of laboratory
benchtop power supplies available,
from the very simple to the highly
sophisticated. They range from lin-
ear, purely analogue supplies with
only voltage regulation to switching
supplies with both current and volt-
age regulation using a microcon-
troller, also offering programmable
signal patterns and various monitor-
ing functions, while also driving an
IEEE interface.
Our benchtop power supply lies
in the middle of this spectrum.
Depending on the rating, it offers a
voltage range of 0-25 V at up to 2.5 A
or 0-20 V at up to 1 A. The voltage
and current settings are adjustable
digitally using four buttons each
(two for coarse and two for fine con-
trol). These provide a resolution of
100 mV in voltage and 10 mA in cur-
rent. The desired and the actual volt-
age and current values are shown on
a backlit LCD panel. The device can
be controlled remotely over its built-
in RS232 interface, and the measured
current and voltage values are avail-
able continuously over this interface.
The communication protocol uses
only ASCII characters, so that, in the
simplest case, HyperTerminal suf-
fices to display and adjust the val-
ues. A proper power supply control
12
Elektor Electronics
11/2001
Digital Benchtop
39707384.024.png 39707384.025.png
POWER SUPPLY
program is also available for free
download from the author’s website
at www.pic-basic.de . The source
code of this program is also pub-
lished, so that it can be modified for
other applications.
A Microchip PIC16F84 microcon-
troller controls the power supply,
running a program written in PIC-
BASIC 1.3. The source code, assem-
bler 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
1-A version
Input voltage 230V
–0/+10 % @ 2.5 A / 25 V
±
10 % @ 2.5 A / 24 V
±
10% @ 1 A / 20 V
Set voltage accuracy
+30 mV typical
+30 mV typical
Set current limit accuracy
+5 mA typical
+5 mA typical
Output voltage ripple
5 mV (voltage regulation)
10 mV (current regulation)
5 mV (voltage regulation)
25 mV (current regulation)
Classical
analogue regulation
The circuit consists of an analogue
part and a digital part, which are
assembled on the same circuit
board. Only the pass transistors, the
LCD module and the mains trans-
former (along with the mains input
and switch) are not fitted to the
board. The classical analogue regu-
lator 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
E1
R45
0
TR1
51
Fl1
T2, T3, T4 = TIP142
T5
0W5
K4
T3
R46
0
2x
1N4148
C
E2
B1
51
D3
R5
T6
0W5
R1
R2
C2
4
C19
D4
R6
F1
F2
R7
IC1
(1k8)
T4
R47
0
T1
E3
K5
24V
80VA
µ
63V
11
µ
63V
C5
51
2A T
4A T
0W6
(21V)
B80C5000
(B80C1500)
5W
T7
1%
(2A T)
C1
C1'
0W5
0W5
C12
10n
R8
+5V
BC
557B
7
63V
µ
D1
P600D
(1N4007)
10 000
µ
R16
10k
1%
50V
R4
T5, T6, T7 = BC547B
R43
(4 700
µ
1%
35V)
B
6
R17
39k
R18
1k
0...25V
0...2A5
S2
C6
R15
10k
1%
U
+5V
D5
D6
7
U
IC5
SRG8
IC1.B
R19
8k2
1%
1%
5
1n
R9
10k
S3
9
1N4148
1N4148
13
+5V
I
R
IC7
14
8
C1/
C7
IC1.D
78L05
S4
12
oder
Drahtbrücke)
R20
1k
U
2
10
100n
R14
10k
3
1D
&
1
2
8
IC1.C
S5
4
D2
R3
150
1
9
I
C20
8
C3
IC1.A
R21
5
3
I
IC2
1%
6
µ
16V
4
10
µ
R13
IC1 = LT1491
R10
S6
C4
R22
18k
U
10
12V
1W3
63V
P1
R23
11
10
100n
(39k)
S7
12
1%
I
1%
13
+5V
R12
R11
C8
C9
R24 ...R33 = 1%
S8
74HC164
U
R34
1k
µ
Tant
µ
Tant
+5V
K2
+5V
S9
R40
R41
I
14
14
14
IC4
IC5
IC6
IC4.D
11
7
7
7
+5V
12
IC4.A 13
1
C18
8
4
2
R42
100n
10
6
5
14
IC4 = 4066
9
3
IC4.C
IC4.B
+5V
K3
1
GND
+5V
4
MCLR
+Ub
Uo
2
3
IC6
SRG8
C16
13
12
11
10
IC3
RB7
9
R
+5V
17
4
5
6
7
8
9
RS
8
10
µ
16V
RB6
RA0
R38
100k
1%
R44
C1/
2
18
RB5
RA1
R/W
E
1
V+
16
PIC16F84
1
IC2 = TLC272
+5V
K1
2
C13
C1+
RB4
RA2
RA3
C10
&
TXD
9
8
7
6
2
5
D0
D1
D2
D3
D4
D5
D6
3
1D
1
RB3
R37
100k
1%
IC8
7
R35
3
CTS
3
2
µ
16V
4n7
4
C1–
RB2
RA4
R39
1k
IC2.B
7
8
10
1
6
5
T2OUT
T2IN
RB1
IC2.A
9
RXD
3
P3
10
11
12
13
14
15
16
6
R2IN
R2OUT
RB0
13
14
12
1%
2k5
10
R1IN
R1OUT
OSC1
OSC2
11
11
T1OUT
T1IN
16
15
5
P2
4
C15
LCD
1x 16
12
C14
C2+
X1
500
D7
13
MAX232A
µ
16V
R36
µ
16V
5
15
C2–
C11
74HC164
V-
6
C17
4MHz
100n
1%
10
µ
16V
000166 - 11
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
470
10
4
(0
10
10
10
10
10
10
39707384.026.png 39707384.027.png 39707384.001.png 39707384.002.png 39707384.003.png 39707384.004.png 39707384.005.png 39707384.006.png 39707384.007.png 39707384.008.png 39707384.009.png 39707384.010.png 39707384.011.png 39707384.012.png 39707384.013.png 39707384.014.png 39707384.015.png 39707384.016.png 39707384.017.png 39707384.018.png 39707384.019.png 39707384.020.png 39707384.021.png
POWER SUPPLY
higher price. With the aid of a few close-tol-
erance metal film resistors the op-amps work
sufficiently accurately that only a few cali-
bration 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 con-
nectors (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 pro-
portional to the current) is practically mea-
surable 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 resis-
tance 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 amplified voltage is mea-
sured 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 circuit’s ground appears at the posi-
tive output terminal. Voltage divider R7/R8
and R15 have a total value of 50 k
Table 1. LM324 vs LT1491
LT1491
(typical values)
LM324
(typical values)
Offset voltage
200...350 µV
2 mV
Offset voltage drift
2 µV / °C
7 µV / °C
Input current
4 nA
45 nA
Power supply voltage (max.)
44 V
32 V
Short-circuit output current
25 mA
20 mA
would affect the measurement of
the output voltage. So that the op-
amps can operate with negative
voltages relative to ground a nega-
tive auxiliary supply is required,
which is derived from the input
voltage with the aid of diode D1.
The divided-down, amplified and
compensated measurement volt-
ages are finally taken to the invert-
ing 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 micro-
controller (IC3) which can generate
two precise analogue voltages
thanks to R/C combinations R11/C9
and R12/C8. The voltages are pro-
duced using pulse-width modula-
tion of the microcontroller’s output
pins. These two D/A converters
have a resolution of 8 bits.
C6 and C7 cause the two com-
parators to exhibit a lowpass
response. The outputs drive the base
connection of the pass transistors
via D5 and D6 in a ‘wired OR’ config-
uration. If one of the measured val-
ues exceeds the desired value, the
base is pulled towards ground (or
even slightly below) and the transis-
tors are switched off. If neither the
desired current nor the desired volt-
age is reached, constant current
source T1 delivers a base current of
2 mA (for a 2.5 A power supply) or
360
ter resistors are provided. If the volt-
age 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 tran-
sistors. This affords effective protec-
tion 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 fitted. The emitter resis-
tors and protection circuit can there-
fore be dispensed with. For the 2.5 A
power supply a 0.6 K/W heatsink is
required, and for the 1 A power sup-
ply 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 ver-
sions of the power supply are there-
fore (without active cooling) suitable
for continuous use at full load.
. 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 there-
fore 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 circuit’s 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 compen-
sation for the voltage error the voltage
across the shunt resistor (up to 0.25 V)
Values set
by the microcontroller
The connecting link between the
analogue and digital domains is the
PIC microcontroller IC3. In order to
accurately measure and produce
voltages an accurate and stable ref-
erence voltage is of course required,
which it derives from its supply volt-
age. For this reason a few compo-
nents are added around D2 (pre-reg-
ulation to 12 V) and IC7, a fixed volt-
age regulator. The pre-regulated
+12 V supply is also used to feed
IC2.
Using R3 and P1 the voltage at
the regulator output can be set to
5.12 V (in practice 5.14 - 5.16 V). R3
provides a basic load so that a cur-
rent of at least 33 mA always flows
through P3. This current is chosen to
be about 10 times as great as the
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-
14
Elektor Electronics
11/2001
µ
39707384.022.png
POWER SUPPLY
current in the ground connection of
the voltage regulator. Load-depen-
dent variations in the common-pin
current therefore only have a very
small effect. Moreover, the load cur-
rent 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 compo-
nents. 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 delta-
sigma A/D converter built around
IC2. Using this conversion technique
a high-precision converter can be
built with little circuitry, and, inde-
pendent 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 ana-
logue-to-digital conversion. Conver-
sion 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 con-
nected 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 measure-
ment is to be carried out, the micro-
controller 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 tog-
gling 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 integrator’s 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 volt-
ages: the microcontroller’s algorithm
would fail. As well as allowing for
compensation for component toler-
ances, P2 also provides a small posi-
tive 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 ben-
efit is bought at the cost of a rela-
tively high offset voltage. Here how-
ever, where an adjustment must be
made anyway, this is no real disad-
vantage.
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 com-
mands and character codes which are trans-
ferred 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 com-
prise 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 con-
nected. The RS232 interface offers remote dis-
play as well as remote control. This will not
concern us further here: a description of the
software and operation of the unit will be pre-
sented in the second part of this series, in the
next issue. Let us turn instead to the con-
struction of the power supply.
Interfaces
The microcontroller has several inter-
faces 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
(000166-1)
The construction of the Digital Benchtop PSU will
be described in next month’s issue.
11/2001
Elektor Electronics
15
39707384.023.png
Zgłoś jeśli naruszono regulamin