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

Re: Computer controlled PS/function gen/multimeter

Reply #240
For the function generator, the XR2206 from Exar/Sipex is a good chip.
For the controller I would say the PIC24E series. 12-bit ADC, 9 16-bit timers, built-in USB OTG, 16-bit PWM. The Piccolo series from TI also has great analog!!!
An ATX power supply has +/-5V, +/-12V, and +3.3V. That would be fine for most applications.

Re: Computer controlled PS/function gen/multimeter

Reply #241
Have you guys seen eevBlog lately?
Dave made a pretty decent small psu thats quite accurate and pwm controlled.
Might be good for those of us who just want something small for the workbench...

Re: Computer controlled PS/function gen/multimeter

Reply #242
[quote author="colin.i"]Have you guys seen eevBlog lately?
Dave made a pretty decent small psu thats quite accurate and pwm controlled.
Might be good for those of us who just want something small for the workbench...[/quote]
I saw that video but couldn't watch completely. I'll try to watch it and come up with sth usable.

Re: Re: Computer controlled PS/function gen/multimeter

Reply #243
I use an AC to 28 volt 4 amp switching power source stolen from other equip and add one DC-DC module buyed at ebay for variable voltaje from 1.2 to 26 volt, add a discrete selector preselected values (3.3,5,9,12 and 24) and other multiturn potentiometer for fine adjustement. Add a virtual GND (only 100mA max) to obtain a splitted power source for some circuits that need it. Ferrite cores in cables, and final noise it´s really low, less than 10mV. I´m waiting from two modules from ebay to use as voltmeter and ammeter. All made from store pieces and $12 in components in ebay.

But, yo can buy good power sources used in ebay, but the cost of shipping to my country it´s greather than the cost of the power source :-(

Re: Computer controlled PS/function gen/multimeter

Reply #244
Well after watching Dave's Dig.PSU series, I got to thinking, THAT'S awesome! in a super convoluted kinda way....
so I looked at his schematic, and said, ok, this is how he did it, lets not do it that way, as I respect him, and don't wanna copy his work, also his design has the down side of being on the expensive side...

I really liked tip about the lt3080, but I hated the fact that it just buffered the voltage, and couldn't have any gain, so you had to drive it with a separate op-amp... So I scourged the net looking for other cool chips..
and these are my results...

If you are looking for a integrated regulators, whose reference can be overridden.
they are either too small, go only up to 3.3 or 5v, or the LT308x series. Only example that I've found that can actually work is the good old 723, but I don't think his inv- input can be sunk to gnd..

next I was looking for some cool chips that only had an op-amp, and an integrated pass resistor...and the only one I've found was this LPR30, which is exactly what i want (one op amp for voltage, one for current, its friking perfect) the problem was that it's discontinued, and I couldn't find anything similar out there..

Ok so after 2 days of searching for this stuff, I gave up, and decided to build it out of discrete parts... op-amp and pass trough I rummaged around the net for some cool discrete power-supply designs, and came to Jung Super regulator, supposedly much, much, better then any integrated regulator out there, and since all the audiophiles where in heat about it, it must be good, since they can hear the 0.000000000000000001% distortion difference. :D.

Whats cool about this design is that the series pass darlington is always pumped by the pnp/zener based constant current source..which is set for the maximum output current. the current feedback, and voltage feedback op-amps just sing this current away from the darlington base. this way even if everything fails, and there is a short the regulator will only give the maximum current..

The DACs are 12bit, I2C ones, and the Vref will be a 0.1% ~10-20ppm 2.048V
The current is monitored via the high-side current amplifier ina138. which has outputs V(Rshunt)*RS_OUT/5K. I plan on using 1oh Rshut, this will give out 2V @1A if RS_out=10k is used, or 2V@10mA if 1M is used, giving a better range for both reading current and controlling it.. these resistors can be switch via the MCU...

this is just the I2C DAC controlled PS part of the design. IT is designed to be powered with 19v dc lap top...I will add either a linear or switching tracking regulator which would float 3V above the output of this one...
*while the 358 is good enough for this regulator, really high performance regulation can be achieved by scaling the transistor and op-amps...for high frequency/low noise ones, the parts were chosen so they can easily be replaces with pin compatible, higher performance parts :D...

0-12V control with ~3mV adjustment
0-1A current limit with 244uA adjustment at 0-1A range and  2.44uA at 0-10mA range maybe change this

part cost, 0.14e for the op-amps (this could be changed for some 2e much better ones)
2xDaC MCP4726 ~1.5e
ina138 ~ 1.6e
Darlington 1e, and vref..~1e total ~6e
best regards FIlip.

Re: Re: Computer controlled PS/function gen/multimeter

Reply #245
I really liked this design! Maybe it is better to use a DAC with 2 voltage output? MCP4912 is 10bit SPI DAC, MCP4902 is 8bits SPI DAC. I managed to find some I2C DACs on Mouser but they were from Maxim and they were only 7 bits.

Re: Computer controlled PS/function gen/multimeter

Reply #246
yeah I checked, I really like the I2C design, and only affordable 12bit DACs in I2c are either single chanell or 4 chanell from microchip... if we build two separate output power supply's, the 4 channel one would work MCP4728...only it has to be powered from a reference, since the internal reference is total crap...*but they are dirt cheap :D
now I played around with it some more, and removed the ina138 and replaced it with the max9612 which does everything it does, plus it can control the current by itself, +and gives I2C 12ADC for current and (pre regulated voltage(which is useless)), It could be plcaed after the series-pass darlington, to but then it would only give us the voltage before the shunt, and add inductance to the feed back loop. only reason I see to move it would be to read the load current better, but even then there would be the error from the feedback loop resistors(current),
at its lowest setting X8 for current read.
which is 12bits @ (1A/8) 125mA which is a resolution of ~33uA ( if everything is set for 1A apsulute max current) id we lower it to 100mA it could do 3uApre ADC...
current control is via 12bit dac so at 1A it is 244uA per bit...

A pMOS LDO could easily be implemented, but I have concerns with stability with them
best regards FIlip.

Re: Computer controlled PS/function gen/multimeter

Reply #247
After designing a small benchtop supply powered by a laptop adapter I thought, maybe somebody on DP is already working on one. So it seems. But nonetheless, maybe some people can comment on my approach as well. The schematic is pretty rough for now, but I think you will get the idea. The PCB still has a lot of airwires, but this will be solved later on.

It will be a very small (10x8 cm) power supply with the following outputs:
3.3V - 300mA
5V    - 300mA
0-18V, 0-3A

There will also be a multimeter voltage and current measurement included.

a rotary encoder with switch is used to set the output voltage and current and there is a dedicated output disable switch. The whole thing can also be controlled via USB. There is a small Nokia LCD to output measured and set voltages and currents.

The PSU now uses the LM2596 as a buck converter with a second ripple filter and ferrite beads for filtering high frequency noise. I am contemplating to use the lm20323 (from TI) as a buck regulator instead, because it has a much higher switching frequency, so less output capacitors, a smaller coil, less heat dissipation and a smaller ripple. But it will be tougher to solder the TSSOP chip it is packaged in, especially the powerpad underneath.

For now I am trying to simulate the design in LTspice right now and the results are quite positive.
In the PCB design you can see all the output connectors (4mm banana plugs receptacles) which will be soldered to those holes.

Does anybody have comments on the design so far? I might need to add a precision reference somewhere. Any other suggestions?

There is quite a lot of PCB space left (except for under the switching regulator, as it needs a small heatsink), so any suggestions of things which might be handy in this design as well?

Re: Computer controlled PS/function gen/multimeter

Reply #248
seems cool, altgout the FB line seems to have too many contacts, are you sure the control will work.. it seems to me that the buffer from the DAC isnt doing much, but Don't fully understand how it works..
best regards FIlip.

Re: Re: Computer controlled PS/function gen/multimeter

Reply #249
Regarding the feedback:

R5 is used for voltage feedback from the output.
C22 is used in the feedback loop to make sure the system won't start oscillating because of the extra filters in place.
R15 is the resistor that is normally connected between the feedback pin and ground, to make a voltage divider.
R21 and R3 are not populated (for testing other feedback methods).

The LM2596 makes sure the voltage on the FB pin will always be 1.25V.

Voltage feedback
So the voltage on the output will be regulated to be:
In my case 1.25*(470+10000)/470=27.8 volts.

But by adjusting the voltage on the other side of R15, the voltage reference used in regulating won't be 1.25V, but (1.25-Vdac).
So if the DAC outputs a voltage of let's say 1 volt, the regulated voltage will then be:
(1.25-Vdac)*(R5+R15)/R5=Vout.    (1.25-1)*(470+10000)/470=5.7 volts.

The opamp after the DAC divides the voltage the DAC outputs. The normal range is 0-2.048 volts in 4096 steps, but I change it to 0-1.3, so the full range of the DAC can be used (4096/1.3*1.25=3940 steps) instead of only (4096/2.048*1.25)=2500 steps. It adds more flexibility to the design.

Current feedback
The current flowing towards the output is measured using R4 and the high side current amplifier MAX4372. A current in the range from 0-3A will be converted into a voltage of 0-1.5V, because:
I = 3 amps
R4 = 0.01 ohm
Voltage amplification MAX4372 = 50 times.


This measured current is then compared to the set current using opamp IC7B. When the current measured is higher than the set current, the output of the opamp will go high, current starts flowing through D3 into the feedback pin, increasing the voltage on that point, to which the LM2596 will respond by lowering the output voltage and decreasing the current.

I hope this makes things more clear. Thanks for letting me think the circuit through again, now I know I might have to move the current measurement resistor to right  before  the output, now the currents coming from the capacitors are not taken into account.

Re: Computer controlled PS/function gen/multimeter

Reply #250
cool, nice trick with the Vref-Vdac :), I see only one possible problem, the op amp is rated for only 6V, maybe it would be better to use a 30V one just to be safe, or add a 6v zener on its output.
best regards FIlip.

Re: Computer controlled PS/function gen/multimeter

Reply #251
I like this design so far. How do well do you think it will work across voltage ranges? Also what about minimum load? The Jung 2000 has a minimum load of 300 mA which is kind of high, in my opinion. I'm not much of an analog expert, so I haven't analyzed this circuit at all.

Re: Re: Computer controlled PS/function gen/multimeter

Reply #252
It does work over all voltage ranges, including short circuit without breaking, with a not so 'hard' to regulate load. The circuit kinda freaked out when I attached a DC motor, which is quite a nasty load. But under a resistive load there is almost no ripple apparent on the output. I tested the circuit a bit on a breadboard, but switching power supplies are not known for working well on breadboards. The output can come within 2.5 volts of the input voltage, under load. I am quite sure the irregular load condition problem can be compensated on a PCB.

I finished the design of the PCB and in a few weeks time post my findings on the build circuit here.
There are some problems with Vref of the LM2596 dropping under when the output comes closer to the input voltage. I hope this can be compensated in software. But I am making a version with another step down converter as well (The LM20323). It will be a guess if this chip works or not, as there is some over voltage protection in that chip which basically short circuits (in a safe way) the switching power supply if the feedback pin rises too high above the reference voltage.... But for the rest the LM20323 is quite a sturdy chip, it being used in automotive applications and all. But SEEDstudio lets me make a 10x10 cm PCB for the same price as a 10x5 cm. So I will just test both circuits at once.

For version 2.0 (or even higher ;), I might even use a Microchip DSPic, which can be used in a digital feedback loop SMPS. This adds interesting possibilities, like a digital PID feedback system with tunable parameters, direct current feedback (which responds much faster to changing loads) and some other nice tricks. But for now, I will stick to Version 0.5.

Re: Re: Computer controlled PS/function gen/multimeter

Reply #253
love the design so far.
may I suggest using a PIC with a USB port, say PIC18F2550, so it can be connected to a PC via USB, and then remotely controlled/measured.

just rechecked the schematic dooohhhhh !!
it has a USB port

Re: Re: Computer controlled PS/function gen/multimeter

Reply #254
I just send the PCB design to SEEED for manufacturing. There is a USB connector included and the PIC used in the project is the 18f46j50, which is the 44 pin version of the PIC in the bus pirate V4. So the thing can be controlled using a computer.

I plan to make the whole thing computer controllable. The current and voltage can be set on the PC and the actual current and voltages measured can be send to the computer. I hope to reuse part of the bus pirate code for this project, so it has about the same user interface and command structure.

Would be nice to use the thing to plot charging curves of batteries and the like for example.