One channel DAC to control 6 channels, what is the best way to do it? - Page 1
Forum section: electronics / beginners

author: nour
author_rank: Frequent Contributor
timestamp: May 30, 2017, 08:11:33 am
content: I am building a power supply based on gerry sweeney design:http://gerrysweeney.com/fully-programmable-modular-bench-power-supply-part-14/?wppa-occur=1&wppa-cover=0&wppa-album=7&wppa-photo=108He is using an LTC2602 to control both voltage and current. I will have in my design 3 isolated outputs and the only thing available for me now is LTC2642, which have only 1 channel output, I want to use it to control all the voltage\current in my design which I will need to keep the same level of precision on all the 3 output of the power supply.One thing I have thought about is to use multiplexer, but I have never done that before and I don't know the impact on the DAC stability and accuracy!One more thing why he is using multiplexers with the I\O of the Dac and the adc?

author: bktemp
author_rank: Super Contributor
timestamp: May 30, 2017, 08:55:59 am
content: If you have 3 isolated outputs, you want the isolation barrier on the digital side. Therefore you need 3 DACs and 3 ADCs.You can multiplex analogue outputs by using a sample&hold stage. It can be as simple as a capacitor:You set the DAC to the desired voltage for the first channel, let it stabilize for a short time, then enable the multiplexer to the first output. Then you disable the multiplexer and set the DAC to the next channel and enable that multiplexer.You need to repeat this periodically to compensate for leakage currents slowly charging or discharging the holding capacitors.

author: mikerj
author_rank: Super Contributor
timestamp: May 30, 2017, 09:20:17 am
content: Quote from: bktemp on May 30, 2017, 08:55:59 amYou also need to be aware of the effects of charge injection from the mux. Far better to avoid all the potential sample/hold issues and buy a few dual channel DACs. If price is a problem then you don't have to use the Linear Tech parts, a DAC8552 is probably one of the cheapest 16 bit dual channel parts.

author: nour
author_rank: Frequent Contributor
timestamp: May 30, 2017, 09:29:06 am
content: Quote from: bktemp on May 30, 2017, 08:55:59 amI really need to only have one DAC\ADC for all the channels and at the same time keep the isolation, is there any way to do it with only one DAC\ADC because the DAC is not cheap--> 15+ from Digikey and also the ADC will not be cheap, I am planning on using ltc2400 which is 9$+.One more thing, wouldn't the hold and sample and periodically compensating fo the leakage introduce some errors\nosie?I am aiming to 1mV\1mA resolution with good stability so that's why I am using those two chips(hopefully that will be good enough)

author: mikerj
author_rank: Super Contributor
timestamp: May 30, 2017, 09:53:56 am
content: Quote from: nour on May 30, 2017, 09:29:06 amThere is no easy way, isolation is a vastly easier problem to solve on the digital side of the interface. You could look at isolation amplifiers such as Analog Devices ADUM4190, but you are still going to need six of them, plus the multiplexors for the DAC and ADC, and probably won't meet your stated accuracy targets.Quote from: nour on May 30, 2017, 09:29:06 amYes, as I mentioned you have to consider charge injection issues.Quote from: nour on May 30, 2017, 09:29:06 amYou really should discount multiplexing a 16 bit DAC. Achieving better than 2LSBs error with a sample/hold is going to be a tough challenge.

author: nour
author_rank: Frequent Contributor
timestamp: May 30, 2017, 10:01:24 am
content: Quote from: mikerj on May 30, 2017, 09:53:56 amIs there any specific monolithic solution for doing this, I mean multiplexing with sample/hold?

author: nour
author_rank: Frequent Contributor
timestamp: May 30, 2017, 10:06:35 am
content: I have found this App. Note:http://www.ti.com/lit/ug/tidubl9a/tidubl9a.pdfI am not sure how relevant it would be, but basically, the title is very relevant!. haven't yet read it though!

author: mikerj
author_rank: Super Contributor
timestamp: May 30, 2017, 10:09:10 am
content: Quote from: nour on May 30, 2017, 10:01:24 amCertainly, just search for "sample and hold amplifier". e.g. an Analog Devices SMP08 gives you 8 channels with internal S/H capacitors. Just look at the errors it can introduce though, and then you still need to deal with the isolation on the analog side which will introduce even more errors.You should really forget this idea and buy some more converters.

author: nour
author_rank: Frequent Contributor
timestamp: May 30, 2017, 10:21:21 am
content: Ok, I will for now buy 2 LTC2642, but for the ADC, should I use 2 channels internally separated ADC or just use ADC with multiple inputs internally multiplexed?

author: mikerj
author_rank: Super Contributor
timestamp: May 30, 2017, 10:34:31 am
content: For each PSU channel you need two DAC outputs and two ADC inputs. The LTC2642 is a single channel part, so buying just two more (three total) does not give you enough channels, you would need six of these. Much better to get three dual channel DACs (e.g. LTC2602 or DAC8552) which will minimise cost and the number of chip selects.Don't forget you need isolation on both the DACs and the ADCs. Once you have provided digital isolation for the DACs, then it would be foolish not to use the same isolated bus for the ADCs. This means you would need three dual channel ADCs.

author: nour
author_rank: Frequent Contributor
timestamp: May 30, 2017, 10:53:11 am
content: Quote from: mikerj on May 30, 2017, 10:34:31 amI will just do one channel for now and see the performance before going any further because the cost will be very high and I am not very confident yet about the design especially when it comes to the dynamic load performance!but for the ADC, it usually multiplexes the output internally, wouldn't that create the same issue as we have discussed with multiplexing with external multiplexers?

author: mikerj
author_rank: Super Contributor
timestamp: May 30, 2017, 11:02:32 am
content: Quote from: nour on May 30, 2017, 10:53:11 amThe demands are lower since the voltage only needs to be maintained on the S/H capacitor during the ADC conversion (i.e. a few microseconds or less). They can still suffer errors from charge injection, but are carefully designed to minimise this. You also have the opportunity to take multiple samples from a single channel (i.e. no MUX switching) to reduce any residual errors even further, not something you could do with a DAC+MUX.

author: nour
author_rank: Frequent Contributor
timestamp: May 30, 2017, 11:07:50 am
content: Well, in that case, I have LTC2404 and LTC2498maybe I will utilize one of them to do this job

author: fcb
author_rank: Super Contributor
timestamp: May 30, 2017, 11:10:52 am
content: I've done this before with 12bit DAC's with some degree of success a few years back.However charge-injection from the MUX was a real problem, I ended up having to use some fancy (expensive) MUX's to solve this along with larger-than-I-wanted S&H capacitors, a buffer amplifier on the DAC output and buffers on the S&H capacitors. All in, I reckon I would just use separate DAC's if I did it again.

author: nour
author_rank: Frequent Contributor
timestamp: May 30, 2017, 02:11:28 pm
content: Well, can you remember this mux. because right now I am looking for this one nowhttp://www.tme.eu/en/Document/724eeec5165f30e8e5d400ee9fc841ee/MUX36D08.pdfI am still not sure about it yet

author: David Hess
author_rank: Super Contributor
timestamp: May 30, 2017, 04:04:31 pm
content: Are the outputs suppose to be isolated from each other or just from the digital control side?

author: nour
author_rank: Frequent Contributor
timestamp: May 30, 2017, 04:20:22 pm
content: Quote from: David Hess on May 30, 2017, 04:04:31 pmFrom each other

author: Kleinstein
author_rank: Super Contributor
timestamp: May 30, 2017, 04:28:02 pm
content: Isolating an analog signal is rather difficult and expensive. So today one would at least use separate ADC / DAC for each supply. With the ADCs (reading voltage and current) multiplexing or an ADC wit integrated MUX are possible and easy to use. A low cost version would be something like MCP3426, but even 2 of the MCP3421 are still not expensive.For the DAC multiplexing with a S&H is possible in principle, but more difficult and it can add some extra spikes from charge injection. So it might be easier to used 2 separate DACs or a dual DAC. A power-supply might not need the same degree of resolution for the current setting, especially if there a separate low and high ranges.

author: David Hess
author_rank: Super Contributor
timestamp: May 30, 2017, 04:47:51 pm
content: Quote from: nour on May 30, 2017, 04:20:22 pmThat will certainly make a separate ADC and DAC for each channel less expensive than trying to do precision analog galvanic isolation and performance will be better anyway.

author: nour
author_rank: Frequent Contributor
timestamp: May 30, 2017, 04:56:59 pm
content: Quote from: David Hess on May 30, 2017, 04:47:51 pmOk, I surrender, I will a have to do it that way, at least for the sake of precision, that I hopefully will reach

author: danadak
author_rank: Super Contributor
timestamp: May 30, 2017, 10:07:36 pm
content: Just a thought, but charge injection can be overcome by timedS/H so that the mux settling time expires before you sample.Another approach is to use current output DAC, and mux that.You still get injection issues to deal with, but mux switch variationessentially mitigated. Of course the receiving end has to be a I > Vconversion. And the DAC must have high compliance and outputZ to meet accuracy issues due to mux variation.Another cheap way of getting a lot of DACs cheap is PWM approach.16 bits easy to do, but there are other considerations. LPF filterdesign, settling time, noise, etc....Ap note attached.Here is a thread where I showed 16 16 bit PWMs on one chip.https://www.eevblog.com/forum/microcontrollers/best-way-to-add-external-dacs/25/You could easily transmit via opto isolator each DAC stream, and recover the DC on the otherside with a LPF implementation. Full 16 bit performance over T & V still a challenge, spendtime with your error budget analysis.Regards, Dana.

author: mikerj
author_rank: Super Contributor
timestamp: May 31, 2017, 08:38:03 am
content: Quote from: danadak on May 30, 2017, 10:07:36 pmThat implies another analog switch between the MUX and the S/H circuit, then you have to worry about charge injection from the switch.

author: nour
author_rank: Frequent Contributor
timestamp: May 31, 2017, 08:52:57 am
content: I didn't know it would be very hard\costly to do it as I wantI wanted to have 3 isolated channel power supply, each channel capable of delivering 20V\1A with an accuracy and resolution of 1mV\1mAIf I buy a decent lab PSU with those specs, how much would that cost?I mainly want it for testing low power electronics\LEDs and other low power stuff with a decent level of accuracy and controlI even though I can go down to 0.5mV\0.5mA on the lower range, say under 8 or 7 V!I know that a 16bit DAC wouldn't be able to go to this level, but I had some Ideas to enhance the accuracy and the resolution beyond the 16 bit DAC resolution that I want to try!

author: danadak
author_rank: Super Contributor
timestamp: May 31, 2017, 09:36:47 am
content: QuoteActually not, just logical control of the S/H enable or track pin. A writeoccurs to DAC, and a timeout is applied before S/H goes to hold mode.Unless I am missing something.Regards, Dana.

author: fcb
author_rank: Super Contributor
timestamp: May 31, 2017, 09:56:19 am
content: So you're trying to build a 3x2 separate channels. Assuming each channel pair (Vset & Alimit) can share a channel common, i'd think about the following:1. 3x digitally isolated 16 bit DAC's, split the output as discussed before with an S/H mechanism to get your Vset and Alimit voltages.2. If you don't need alot of speed, why not use PWM over the isolators. 10MHz base, 2^16 resolution would give 152Hz output, easily filtered to 1-2Hz bandwidth.3. Use a low cost quad 12 bit DAC, use some summing circuitry to combine 2 DAC's into something close to 16 bit (can be done).If you're only making one or two of these , personally I'd bite-the-bullet and just use 6 DAC's. Also, 16 bits is quite alot of resolution, implies sub mV at 20V FSD?

author: nour
author_rank: Frequent Contributor
timestamp: May 31, 2017, 10:19:46 am
content: Quote from: fcb on May 31, 2017, 09:56:19 amBased on other people experiments in this very specific design a 16 bit is required to have a stable and accurate 0.5mV\A resolution, maybe 1m is a bit overkilling but if possible I will go down to maybe 100 micro resolution for range up to 5V and less resolution for higher ranges.I think I have miscalculated the resolutionand maybe 14bit is more than enough for the original specs

author: Kleinstein
author_rank: Super Contributor
timestamp: May 31, 2017, 10:28:47 am
content: A good high precision DAC is expensive, even if t is just a true 14 Bit precision.There are two options to make a slow precision DAC:1) use PWM (or SD modulation) and precision filtering. Some calibrators use this way. If needed one can also get good linearity.2) use something like 2 lower resolution DACs (like 12 Bit) and combine them to a high resolution. A cheap R2R chain might also be used instead of the 2 DACs. This give high resolution, but low accuracy. Accuracy could than obtained if an ADC is used for corrections. It still needs some care to prevent too much noise.For a lab supply one could also use different ranges, especially for the current setting / regulation. This might be an alternative to a high resolution DAC. So a 12 or even 10 Bit DAC might be enough.

author: mikerj
author_rank: Super Contributor
timestamp: June 15, 2017, 09:59:56 pm
content: Quote from: danadak on May 31, 2017, 09:36:47 amSorry for late reply!Any transient caused by the charge injection of the mux or an additional switch after the mux would be passed through to whatever the voltage is controlling, every time the DAC is updated. Delaying the s/h simply removes any residual DC error that might otherwise occur.

author: Ian.M
author_rank: Super Contributor
timestamp: June 15, 2017, 10:40:45 pm
content: There's also the hybrid approach - combine an 8 bit parallel DAC with PWM of its LSB. It won't be very accurate, but it will be monotonic so its easy to close the loop and cancel out the nonlinearities. The ripple on the output is over two orders of magnitude lower than direct PWM so the filtering is also much easier.

author: jbb
author_rank: Super Contributor
timestamp: June 15, 2017, 11:41:09 pm
content: 1mV out of 20V is 1/20000, so you need about 13.5b resolution. Add a couple of bits non-linearity and you need a 16b DAC.I suggest you design all 3 modules to be identical. Each module will need a dual 16b DAC (1 channel for V, 1 channel for A) and dual 16b ADC. Definitely isolate on the digital side.How about the MAX5136 ex Digikey?Or maybe even a module (one per channel, with isolated serial comms) using the MK10DX128 ARM micro: NZ$12 ea, 16b ADCs for V, I measurement, 1x 12b DAC for setting output current, just add 1x MAX5138 NZ$11 for 1x16b DAC for setting ouput V. The MK10 can also do protection in the event of a Comms failure.

author: BrianHG
author_rank: Super Contributor
timestamp: June 16, 2017, 03:32:32 am
content: For each channel, why don't you just put a 2-3$ MCU with PWM out and ADC in with voltage ref, and RS232 IO. All that each MCU needs to do is set voltage and measure voltage & current. With the PWM, it would be your choice to make the output stage linear, or PWM switched with a minor change in the output transistor and filter.For each channel, a simple IO rs232 comm to your main display keypad MCU to select voltage/current & readback from the smaller slave CPUs.During development and debug, it would be easy to hook one of these supply modules up to a PC & run a terminal software to test out.Add a 3 bit config switch to each MCU so you can address up to 7 PSUs on 1 RS232 buss on your controller side.

author: rstofer
author_rank: Super Contributor
timestamp: June 16, 2017, 01:49:00 pm
content: Quote from: nour on May 31, 2017, 08:52:57 amAround $500 for the Rigol DP832 which would have to be unlocked (free) to give 1 mV resolution..But this has (2) 30V 3A plus (1) 5V 3A outputs and one of the 30V and the 5V share a common connection. As a result, it doesn't have 3 truly floating outputs.https://www.amazon.com/Rigol-DP832-Triple-Output-Supply/dp/B00ENX02GCThere are others but many (most) don't go down to 1 mV resolution. Until you get to the high dollar variety...

author: Kleinstein
author_rank: Super Contributor
timestamp: June 16, 2017, 03:23:02 pm
content: Quote from: Ian.M on June 15, 2017, 10:40:45 pmThe problem with DACs is usually not the resolution, but the accuracy. Using PWM between DAC settings would keep the DNL error for the range covered with the PWM modulation. So this would need a really accurate DAC (like a string type). Finding one with a parallel input can be tricky, and a serial interface might be slow.One can use a similar scheme with just PWM: use 8 bit PWM as a first step and than do additional modulation of the 8 Bit PWM value between to settings in a sigma delta converter way. This can be done with many µCs in software. So one can get good resolution "PWM" with not so much lower frequency ripple. So the main PWM frequency could be relatively high (e.g. 50 kHz range), with only a small amount (less than 1/200 of amplitude) of low frequency ripple contend down to the maybe 200 Hz range. So filtering is reasonable easy (no very large capacitors), though the response would not be super fast (maybe 100 ms settling time).