Trying to build a supply with pwm dac, no 0 though - Page 1
Forum section: electronics / beginners

author: Moriambar
author_rank: Unknown
timestamp: December 02, 2021, 10:11:36 pm
content: Hello,insipred by theuSupplyI am trying to build a 0-10V supply, just for fun.My idea is to use, in this phase, an LT3080, but to regulate voltage I want to use a pwm dac. Why? Just to experiment. don't need precision.The schematic I'm using is in(Please excuse the crudity of this model. I didn't have time to build it to scale or paint it)So I hooked up my arb with a sqw (tried 1 to 100kHz, all worked) 5V pp (with 2.5V dc offset) and tried the output. All is good until the lower bound: once I reach 1.7V the output gets "stuck" meaning that no matter how much I reduce the pwm duty cycle (or even hooking the input to GND) the output does not get lower than 1.7V. The arb is on high impedance (not 50R) and I actually don't know what's wrong…One other thing I notice is that sometimes when booting up the circuit, if I'm not careful and don't switch the pwm first, the output is 9V and no matter the pwm that does not change.So I know I'm doing many things wrong, can you help me plz?EDIT: prettied a bit the attachment

author: drdm
author_rank: Contributor
timestamp: December 03, 2021, 01:28:45 pm
content: Check the voltage on the SET pin.I don't think your amp is rail-to-rail, so even if you apply 0% PWM at the input, the output of the amp may not reach 0V.

author: Moriambar
author_rank: Unknown
timestamp: December 03, 2021, 01:42:30 pm
content: Quote from: drdm on December 03, 2021, 01:28:45 pmOk I'll try later, but I used a 358 just as Dave uses on his uSupply schematic (although he uses a real dac for the set pin).it should go down to 0 iirc, perhaps not going to the upper rail but I think it should go down to 0.I'll check for good measure though, maybe there's something therethanks

author: Kim Christensen
author_rank: Super Contributor
timestamp: December 03, 2021, 07:43:51 pm
content: Like drdm said, the LM358's output won't go all the way to ground. It'll get close, but not all the way to zero, depending on how much current it is trying to sink.Your other problem will be that the LM3080 needs a minimum 1ma load. Quote from datasheet:QuoteThe LM334Z in your circuit is set for apx 0.64ma with a 100resistor. The resistor should be less than 64so it sinks 1ma or more. But the other problem with the LM334Z is that it won't maintain current regulation at 1ma with less than apx 1V across it. So that'll be another problem that will crop up with that circuit.

author: Moriambar
author_rank: Unknown
timestamp: December 03, 2021, 07:55:33 pm
content: Thanks. I'm actually curious on how Dave's design could work then down to 0V…What is the magic sauce that makes that possible?ps: btw the lm358 only goes down to about 1V with "pwm" input hooked straight to gnd

author: Kim Christensen
author_rank: Super Contributor
timestamp: December 03, 2021, 11:02:41 pm
content: It is possible that the LT3080 is oscillating due to layout issues, especially if you've mocked it up on a breadboard, or because the 2.2uF cap doesn't have a low enough ESR. Have you checked the LT3080 with a scope for oscillations?One thing to try would be to remove the LT3080 from the circuit and check to see that the LM358 behaves as expected.Dave's circuit works, but probably only down to 50-100mV or so, which is good enough for most scenarios. It would also depend if the load attached to the supply would satisfy the minimum load requirement by itself. Plus, the 1ma spec (LT3080 loading) just means that the manufacturer won't guarantee that the output will follow the input within tolerance if the load is lower. ie: It'll work, but the output voltage might be a bit higher than expected.

author: Moriambar
author_rank: Unknown
timestamp: December 03, 2021, 11:19:52 pm
content: Quote from: Kim Christensen on December 03, 2021, 11:02:41 pmno oscillations whatsoever, the voltage is perfectly regulated. I think I remember dave also breadboarding this circuit or a variant of his, without any problems.

author: Moriambar
author_rank: Unknown
timestamp: December 04, 2021, 09:42:51 am
content: ok, adding a 1k on the output allowed me to go low enough (0.0xxV) to call it 0. Still don't know how Dave planned his version to go to 0V...Do you think that adding a mosfet to switch in this 1k when Vprogrammed<=2V could be good? What am I missing that allowed the og design to go to 0? that's what bothers me the mostThanks

author: Doctorandus_P
author_rank: Super Contributor
timestamp: December 04, 2021, 09:58:23 am
content: Start by numbering your parts.I have no interest of referring to "That 1k resistor on the output of the second IC from the right".Edit.Ah, new schematic with ReDes' included. Much better.

author: Moriambar
author_rank: Unknown
timestamp: December 04, 2021, 10:23:05 am
content: Quote from: Doctorandus_P on December 04, 2021, 09:58:23 amyou're absolutely right. Low effort post. I thought it was a blatant mistake and that it would be apparent to you guys.Regardless, I corrected the attachment in the original post, now it's a bit betterI hope you can help me now.cheers

author: Doctorandus_P
author_rank: Super Contributor
timestamp: December 04, 2021, 01:00:02 pm
content: I'm not very familiar with the LT3080, but a peek at it's datasheet mentions a minimum load of 0.5mA. (Reference Buffer, Page 19). I assume you added the LM334 for this, but that IC probably stops working properly when it's voltage gets too low.Same is also true for the LM358. It also has some trouble with low output voltages. You could add a resistor between it's output and GND (or lower the impedance of R4, R5, R6) to pull it to GND "harder", but it quickly becomes a comprise between the ability to lower the minimum output voltage, and having a reasonable dissipation at the maximum output voltage.Designing a power supply (for low output voltages) is much easier if you have an extra negative voltage available.I also wonder why you added R3. Together with R1 it forms a voltage divider, which means that the opamp has to amplify more, and also amplifies it's input noise. (Which you partially filter out with R7 & C4).The reason I have never used the LT1080 myself is that I do not find it a very useful IC, and it's too expensive for what it does. If you replace it with a simple NPN BJT in this circuit, (And use feedback direct from the output) then the LM358 never has to control it's output below 600mV.You loose the current limit of the LT3080, but any decent power supply has an adjustable current limit anyway.During power-on the LM358 is also not guaranteed to work properly. You need some kind of circuitry that prevents any spurious voltage on the output of the LT3080 during power-up of this power supply.

author: Moriambar
author_rank: Unknown
timestamp: December 04, 2021, 01:19:47 pm
content: Quote from: Doctorandus_P on December 04, 2021, 01:00:02 pmHi.What I'm trying to do, as I stated in my first post is to do something like a "poor man's version" of the uSupply by Dave. He uses a DAC to control the output and, iirc, he stated the product could go to 0V.I want to try the pwm dac which was his original idea and which he implemented as the current limit circuit, and he basically has the pwm filtered so that it becomes more or less an analog voltage.Right now I cannot see how he could manage to have this set up (the schematic is linked in the first post) go down to 0V. He doesn't use a split supply.Idk, perhaps I should abandon this idea altogether since it seems that maybe Dave was wrong in some way, or that the "rest of the circuit" (idk how though) magically loads the output by its minimum requirements.thanks

author: Kim Christensen
author_rank: Super Contributor
timestamp: December 04, 2021, 06:28:12 pm
content: QuoteIt would work, but simply replacing the LM358 with better Op-Amp would be a more elegant solution.QuoteThe LM358 is manufactured by many vendors and has various versions (LM358A, LM358B, etc) which all perform differently, especially when pushed to their limits:You can see this on TI's LM358 datasheet herehttps://www.ti.com/document-viewer/LM358/datasheetFor the B version they state that it's output can sink 50uA and the voltage shouldn't exceed 150mV.But for the A version, they don't spec it that way at all. There they state 25mV max for RL ≤ 10 kΩ (RL is between the output and ground) so the output is not sinking any current at all for that spec.I suspect the LM358 which Dave used was a different version/vendor than the one you have tried. Try a different one if you have one in your junk box and see what happens.

author: Moriambar
author_rank: Unknown
timestamp: December 04, 2021, 11:36:18 pm
content: Quote from: Kim Christensen on December 04, 2021, 06:28:12 pmcool, do you have a suggestion? I tried all of the op-amps in my bin but nothing gave me the expected resultQuotethanks, I'll try some of the others 358 I have, but I strongly suspect they're all 358N from the same manufacturercheers

author: Kim Christensen
author_rank: Super Contributor
timestamp: December 05, 2021, 05:31:00 am
content: Ok, I mocked up your Op-Amp circuit on a breadboard with some old LM358s from my junk box. I powered it from 10Vdc and replaced the LT3080's SET input (pin 2) with a 1MΩ resistor to Vcc to simulate a 10uA source. I also tried it with a 100KΩ resistor to simulate the Lm358 sinking 100uA. The voltage measured on pin 1 of the LM358 are listed in the table below:Part Manufacturer 100K 1MLM358P TI 0.43V 27mVLM358N Motorolla 0.36V 24mVLM358N National Sem 0.42V 42mVM358 Mitsubishi 0.46V 21mVSo I think there is either something wrong with your OpAmp, your circuit wiring, or maybe the high reverse leakage current of D2 (unknown schottky) is messing things up...

author: Moriambar
author_rank: Unknown
timestamp: December 05, 2021, 08:27:02 am
content: Quote from: Kim Christensen on December 05, 2021, 05:31:00 amwow.first of all thank you for going into so much trouble.I'll re-recheck the wiring: my LM358N is from fairchild and I have a bunch of them all from fairchild. I tried putting an LM411CN from national Semi and the voltage was a bit lower but kinda the same.I removed D2 altogether and the result did not change by a single mv. I guess it's the wiring then. I'll try and check later. Thanks for now

author: Moriambar
author_rank: Unknown
timestamp: December 05, 2021, 02:33:16 pm
content: yeah, of course it was the wiring.the resistor for the current sink was wired from + to set, and not set to -.Now everything is good.thanks for your patience

author: Kim Christensen
author_rank: Super Contributor
timestamp: December 05, 2021, 06:48:19 pm
content: QuoteNo problem. Actually, it didn't really take that long to breadboard and test.QuoteExcellent! Good to hear that you got it figured out and working.