17-03-2011, 10:52 AM
[attachment=10371]
A Digital DC Power Supply (programmable bench power supply unit), hardware version 3.0
Abstract:
A good, reliable and easy to use bench power supply unit is probably the most important and most used device in every electronic lab.
A proper electronically stabilized bench power supply unit is an important but also expensive device. Using a microcontroller based design we can build a power supply which has a lot of extra features, is easy to build and very affordable.
The tuxgraphics digital DC power supply has been a very successful product and this is now the third generation. It is still based on the same idea as the first version but comes with a number of good improvements.
Introduction
This bench power supply unit is less complex than most other circuits but has a lot more features:
1. The display shows the actual measurement values for voltage and current.
2. The display shows the pre-set limits for voltage and current.
3. Only standard components are used (no special chips).
4. Only one power source is needed (no separate negative supply voltage for operational amplifiers or control logic)
5. You can control the power supply from a PC. You can read current and voltages and you can set them with simple commands. This is very useful for automated testing.
6. A small button pad is available to directly enter the desired voltage and max. current.
7. It is really small but powerful.
How was it possible to remove components and add more features? The trick is to move functionality which is normally based on analog components like operational amplifiers into the microcontroller. In other words the complexity of the software and algorithms is higher but hardware complexity is reduced. This reduces the overall complexity for you as the software can just be copied.
The basic electrical design idea
Let's start with the simplest possible electronically stabilized power supply. It consists of 2 basic parts: a transistor and a reference voltage generated with a Z-diode.
The output voltage of this circuit is Uref - 0.7V. The 0.7V is approximately the voltage drop between B and E on the transistor. The Z-diode and the resistor generate a reference voltage which is stable, even if the input fluctuates and is noisy. The transistor is needed to handle higher currents than the Z-diode and resistor alone can provide. In this configuration the transistor just amplifies the current. The current which the resistor and Z-diode need to provide is the output current divided by hfe (hef is a number which you can lookup in the datasheet of the transistor).
What are the problems with this circuit?
• The transistor will die when there is a short circuit on the output.
• It provides only a fixed output voltage.
These are quite severe limitations which make this circuit unusable but this circuit is still the basic building block of all electronically regulated power supplies.
To overcome those problems you need some "intelligence" which will regulate the current on the output and a variable reference voltage. That's all (... and this makes the circuit much more complex).
For the last few decades people have used operational amplifiers to provide this intelligence. Operational amplifiers can basically be used as analog calculators to add, subtract, multiply or logically "or" voltages and currents.
Today microcontrollers are so fast that all this can easily be done in software. The beauty is that you get as a side effect a voltmeter and an amperemeter for free. The control loop in the microcontrollers has to know voltage and current values anyhow. You just need to display them. What we need from the microcontroller are:
• A AD-converter to measure voltage and current all the time
• A DA-converter to drive our power transistor (provide the reference voltage)
The problem is that the DA-converter needs to be very fast. If there is a short circuit detected on the output then we must immediately reduce the voltage on the basis of the transistor otherwise it will die. Fast means within milliseconds (as fast as an operational amplifier).
The ATmega8 has an AD-converter which is more than fast enough but it has at first glance no DA-converter. It is possible to use pulse width modulation (PWM) and an analog low pass filter to get an DA-converter but PWM alone is much too slow to implement the short circuit protection in software. How to build a fast DA-converter?
The R-2R ladder
There are many ways to build a digital to analog converter but we need a fast and cheap one which can easily interface to our microcontroller. There is a DA-converter circuit known as "R-2R ladder". It consists of resistors and switches only. There are two types of resistors. One with the value R and one with twice the value of R.