Skip to main content
Topic: Computer controlled PS/function gen/multimeter (Read 244135 times) previous topic - next topic

Re: Computer controlled PS/function gen/multimeter

Reply #120
[quote author="tayken"] Current sink will be a different section[/quote]
Yes, it would be complicated to re-use the regulator as a current sink. It might be possible with a bunch of relays, but I think the easiest would be an entirely seperate circuit with large power resistors and a bigger heatsink. The amount of watts we want to dissipate is going to be an important factor for that part.

Quote
The only thing that I am having trouble with is getting a constant current output. That is not maximum current setting, will we able to get a constant current even if the load changes by adjusting V2?
You can't force a certain current through a circuit if you have insufficient voltage. The way practically all constant voltage / constant current power supplies work is : 1- try to increase output to the requested voltage, whatever the current until 2- the current limit is reached. If you're trying to see how, for example, you could charge a pair of AA batteries, you'd have to set the voltage higher than necessary ; 2-3V above what's necessary, and set the current limiter to whatever charge rate you want.
See it the other way : it's a constant current regulator with a voltage limiter! Think about it.

Quote
How many of the resistors need to be super precise? Can we compensate for any of them with calibration on the microcontroller?
Some of them need to be matched, but none need to be absolutely precise. For example the four 4k7 resistors around the current sense resistor need to be nicely matched. You could use 1% 4k99 SMT resistors and that will probably be plenty good enough. The two resistors around U3 need to have the correct ratio (1:3) to accurately set the controlling voltage. Absolute value is not critical. Same goes with the four resistors around U4 (see the attached schematic), 5% will not be good enough. Usually SMT resistors are pretty well matched and are spec'd at 1%, that should be sufficient.  So we're looking at 10 resistors which need to be equal or better than 1% tolerance. For the current sense resistor, if we use 1 ohm, it should also be fairly precise and be rated @ 2W. But I guess even a 10% resistor could be dealt with in software. Calibration would require an external, precise current meter to establish a relation between set current on V3, real output current and sensed current at U4_output.


Note on the attached LtSPICE file : you'll need to copy the spice models to ???SwCadIIIlib or adjust the Include directives.

Re: Computer controlled PS/function gen/multimeter

Reply #121
How about a current sense resistor calibration routine like this: The user shorts the terminal to be calibrated, the power supply gives a known voltage say 1 V, we measure the current, it should be 1 A but we will measure something different because of the tolerance so the resistor value gets calculated and stored in the flash rom.

Another option is to use the current sink included. That will be fairly precise if we will use Dave's method.

Re: Computer controlled PS/function gen/multimeter

Reply #122
Has anyone seen this?
http://www.tuxgraphics.org/electronics/ ... unit.shtml
 it's 22V / 2.5A and it's PC controllable

I made it couple months ago and here is how mine looks...


Re: Computer controlled PS/function gen/multimeter

Reply #123
[quote author="tayken"]How about a current sense resistor calibration routine like this: The user shorts the terminal to be calibrated, the power supply gives a known voltage say 1 V, we measure the current, it should be 1 A but we will measure something different because of the tolerance so the resistor value gets calculated and stored in the flash rom.[/quote]If you design your own power supply, then you cannot depend upon it producing a known voltage or a known current, at least not unless you use components that have built-in voltage references that are highly accurate.  Even using Dave's current sink, if your resistance is unknown, then the measured current is also unknown.

If you short the terminals on a power supply, it's very likely that you will burn it out unless it has rock-solid over-current protection.  But, even protection is not focused on precision.  The current limiter might kick in just about anywhere, so you cannot use it to measure a precise current.

About the only thing that might be self-calibrating about a power supply that you design yourself is offset.  There are basically two kinds of errors in an unknown circuit: offset and scale.  Since it's fairly easy to know that you have 0 A (apart from quiescent current), then you could feasibly calculate any offset error and correct for it.  However, the scale error would be impossible to determine without some kind of outside reference that is independently accurate.

i.e. I you express error as
Code: [Select]
e = a +bx
, then
Code: [Select]
a
is the error offset, and
Code: [Select]
b
is the error scale.  I'm probably using the wrong terms, or even incomplete terms, but hopefully the idea makes sense.

Basically, I can't see any way for a power supply to calibrate itself (unless one of the chips has an accurate voltage reference, but that's not going to be a variable power supply).  You need an external measurement.  That could come in the form of an accurate resistance meter so that you can then calibrate your current-measurement resistor manually.  Or you could just buy an accurate voltage or current meter for manual calibration.

P.S.  Because of quiescent currents in various chips, I don't think that it's really even possible to calculate and correct error offset without external references.  In other words, even when you expect 0 A of current, there might still be a small amount of current flowing in the power supply being dissipated as heat but not going to the "output."  Depending upon where in the power supply you are measuring the current, there could easily be errors that cannot be detected without an external reference.

Re: Computer controlled PS/function gen/multimeter

Reply #124
If we use a DAC and op-amp voltage supply part, I'm pretty sure that we can get a good voltage output with a known value. Maybe there is a way that current also could be calculated with an automated program. Otherwise, we can just put a calibration method where the user connects a multimeter and a resistor in serial configuration to the output. Then the program might just give different voltage outputs to calibrate the internal measurement unit, gives a voltage, asks for user to input the current supplied a couple of times so that it adjusts some gains. So the big problem is not about voltage output measurement but actually current measurement. Also we can just divide it into two parts, first calibrate voltage output, then calibrate current output.

Re: Computer controlled PS/function gen/multimeter

Reply #125
I was basically talking about calibration to an accuracy which exceeds the parts used.  That would require an external reference.

However, you are correct that a DAC and op-amp voltage supply should start out quite good.

Caveats: The DAC power supply (which is different from the main power supply output) will affect accuracy, since all of the DAC output levels are a fraction of its supply.  Any resistors or other gain-setting components in the op-amp circuit will also affect accuracy.  If you're happy with being off by a few percent, plus or minus, then you don't need to worry about it.

Re: Computer controlled PS/function gen/multimeter

Reply #126
In a "normal" dual bench supply the supplies are floating so they can be connected in series or parallel or run independently as required.  I think this is too much effort and cost for this application -- it requires ferrite transformers instead of inductors, auxiliary supplies, and opto-isolators for the feedback to the MCU.  However, for analog circuits it is really nice to be able to have a split +/- supply.  So, I am thinking that you could add a switch or relay to change the second channel from a buck to an inverting topology (you just switch the diode and inductor terminals) -- presto you have a split supply.  The tricky part then becomes measuring the voltage and current when the supply is negative.  The brute force approach here is to generate an auxiliary negative supply, but think you can avoid that.  The supply voltage can easily be measured with an inverting op-amp configuration, since the - input is at virtual ground.  You just have to supply a fixed bias current to set the output range to be entirely positive.  The current is a bit trickier.  Low side sensing won't work if the supplies are connected together, and high side sensing would probably have to be done with an expensive hall sensor.

Does anyone else think this is worthwhile?  Unless there is a cheaper alternative to the hall sensor it will add significantly to the BOM, but it would certainly improve the utility for anyone doing analog projects.

Re: Computer controlled PS/function gen/multimeter

Reply #127
This power supply can give out +/- 6 V if you want. Just set V1 output to 12 V, V2 output to 6 V then V1+ connects to + supply of the circuit, V2+ is the "ground" and ground terminal is - supply. Of course there might be problems with this but this can support many hacker/maker needs.

[quote author="rsdio"]
I was basically talking about calibration to an accuracy which exceeds the parts used.  That would require an external reference.

However, you are correct that a DAC and op-amp voltage supply should start out quite good.

Caveats: The DAC power supply (which is different from the main power supply output) will affect accuracy, since all of the DAC output levels are a fraction of its supply.  Any resistors or other gain-setting components in the op-amp circuit will also affect accuracy.  If you're happy with being off by a few percent, plus or minus, then you don't need to worry about it.
[/quote]

Yep, a DAC is basically an ADC as inverse if you put it really simply. What I mean is there is the quantization and other effects present in an ADC. How about the second method I proposed, calibrating with a multimeter for first voltage, then current? Do you think it will work?

Re: Computer controlled PS/function gen/multimeter

Reply #128
[quote author="tayken"]How about the second method I proposed, calibrating with a multimeter for first voltage, then current? Do you think it will work?[/quote]Maybe allow for a couple of calibration methods.  If the user measures the current-sensing resistor with an accurate meter, then perhaps the software could allow a way to store this in Flash or EEPROM so that the chip could correct for it.  Other inaccuracies could possibly be calibrated as you say, by measuring the current externally and comparing the two.

I happen to have a current meter, so I would probably hook up the supply to a load while measuring the current, then adjust the DP PS current measurement calibration to match.  I just don't know how difficult that will be.

Re: Computer controlled PS/function gen/multimeter

Reply #129
I thought of another simple way of controlling the output voltage: DAC outputs offset voltage, which shifts the voltage feedback routed to whatever SMPS regulator IC, MC34063 for instance. However, without a negative supply, it will be impossible to regulate to a lower voltage than the IC's fb comparator (1.25V in this case).
I'm rather busy these days, so I don't have time to further simulate, let alone build this, but I think it would be worth a try. Just wire up a potentiometer followed by an op amp buffer to replace V2.

Re: Computer controlled PS/function gen/multimeter

Reply #130
@fenugrec: that looks great!  I was thinking there must be a way to combine instantaneous op-amp feedback with DAC control.  Personally, 1.25V as a minimum output would be fine with me.

I only have one device which uses 1.2V, and that is a core voltage which is not shared with anything else on the board, so it's best to have a dedicated supply for that.  Besides, it accepts 1.26V, so it would still work with your design.

Re: Computer controlled PS/function gen/multimeter

Reply #131
Yep, good design. Can you also include LTSpice files so that I can check them out? I'm also pretty busy these days but after I finish them, I'll try to restart working on this project.

I think 1.25 - 12 V is pretty good. Maybe we should include a FET as switch to turn the output on and off?

Re: Computer controlled PS/function gen/multimeter

Reply #132
Here's a schematic from the simulation. A schematic of the 'Dave sink' is also on the way.
Got a question? Please ask in the forum for the fastest answers.

Re: Computer controlled PS/function gen/multimeter

Reply #133
[quote author="ian"]
Here's a schematic from the simulation.
[/quote]

Just note that the 100 ohms at the output was just there for testing, I would make it 2-10k just to make sure the filter capacitor doesn't stay charged for too long p-)
Remember the pass transistor and op-amp were very preliminary choices, you can probably use different / more available parts. It's an unfinished design ! Probably good enough for testing though.

Quote
Can you also include LTSpice files so that I can check them out?
Sorry, you'll have to draw it yourself - I didn't save the file. Should be pretty easy ...

Re: Computer controlled PS/function gen/multimeter

Reply #134
Thanks Fenugrec

Here's the Dave sink schematic (at least a preliminary one).
Got a question? Please ask in the forum for the fastest answers.