DIY reference voltage generator - Page 1
Forum section: electronics / projects

author: dannyf
author_rank: Super Contributor
timestamp: January 08, 2014, 01:36:31 pm
content: I am thinking about a device that would allow the user to set and generate a desired voltage, with reasonable precision, along the same lines of Linear's AN86: "A Standards Lab Grade 20-Bit DAC with 0.1ppm/°C Drift" -http://cds.linear.com/docs/en/application-note/an86f.pdfHowever, my design goals are slightly different:1) DIY oriented: it should be easy to build, as much a "snap together" exercise as possible;2) Easy to obtain parts / modules: no weird / exotic parts; Use as many junkbox parts as possible;3) Cheap: less than $50 in parts?4) Good upgrade / downgrade path: users can swap out better parts for higher performance, or lower-grade parts for a cheaper implementation.Note to myself: it is a long-term project, going at leisurely path.

author: dannyf
author_rank: Super Contributor
timestamp: January 08, 2014, 01:48:42 pm
content: Quick analysis of AN86:AN86 is a reference voltage generator. Its implementation is interesting in that it uses a high precision adc (lt2400) + two low-grade dacs in a feedback loop to produce an arbitrary reference voltage output. The DACs are summed in a way so that one of them are responsible for least significant bits and others for the most significant bits.Because of the negative feedback loop, only the lt2400 and its reference voltage source determine the performance of the entire apparatus.

author: dannyf
author_rank: Super Contributor
timestamp: January 08, 2014, 02:03:00 pm
content: Trickery: AN86 utilized a few tricks to produce its output voltage.error correction: LT2400's datasheet laid its "characteirstic" error curve. The Linear apparatus corrected the output against such curve. I will implement that as well.output amplifier: they used a chopper composite amp to minimize draft. This improves settling time + output stability inbetween samples. I am not sure if I would implement this.high-precision Vref: outlined in appendix i, the an86 authors presented a few choices for reference. All of them are of very high performance and less DIY-able. I have to compromise there and settle for something simpler and more "user-customizable".

author: dannyf
author_rank: Super Contributor
timestamp: January 08, 2014, 02:12:48 pm
content: My implementation:1) Code comparator: I would go with a mcu-based solution. The mcu will also handle user inputs and display;2) 24-bit adc: Use those cheap lt2400 modules off ebay; Actually, if someone had made a lt2440 board, it could have totally revolutionized the generator;3) Vref: I will use a simple reference voltage generator at around 2.5v. Picking this allows the user to downgrade to a cheaper part;4) DACs: I will pick a mcu with onboard DACs. STM32F4xx discovery comes into my mind, especially if you pick a version that comes with that lcd screen.5) Output: either rs232 or two-line hd44780-like lcds - cheap and gets the job done.6) Input: either preprogrammed output voltage choices and/or user selectable: Using either encoders or pots.7) Output amplifier: need to have high input impedance and reasonable output current capability. High-speed not desired. Preferrably RRIO. Likely CMOS or JFET (may have to use a negative rail).So that means a LT2400, some sort of Vref, a lcd screen, an output amplifier, a mcu with two DACs + software.

author: dannyf
author_rank: Super Contributor
timestamp: January 08, 2014, 02:15:43 pm
content: Software:It needs to read the LT2400's serial output (with error correction), compare it to user input, and generate the corresponding display + output on the DACs. Fairly simple.To avoid stability issues, I would implement a pid in the loop and figure out a way to refine it later.

author: ivan747
author_rank: Super Contributor
timestamp: January 08, 2014, 02:18:50 pm
content: That is very interesting, I would like to see what you come up with. Personally I would copy the circuit straight from the data sheet, I don't mind. But I understand why you want to use standard parts in your approach.

author: Spikee
author_rank: Frequent Contributor
timestamp: January 08, 2014, 02:24:56 pm
content: Here are two very interesting projects from some forum in china (use google translate):http://bbs.38hot.net/thread-39900-1-1.htmlhttp://bbs.38hot.net/thread-29599-1-1.html

author: sync
author_rank: Frequent Contributor
timestamp: January 08, 2014, 02:37:00 pm
content: Which voltage range, resolution and accuracy you do what to achieve?One problem is calibration and verification. You need a volt meter with better specs than the build reference source. That makes it less DIY-able. And I don't think you get good results with modules on the analog side.Here is a old thread about this topic:https://www.eevblog.com/forum/projects/building-a-7-decade-voltage-calibrator/

author: dannyf
author_rank: Super Contributor
timestamp: January 08, 2014, 02:45:22 pm
content: QuoteI haven't quite figured that out yet: to go outside of Vref, I would need a resistive divider which means calibration. To avoid calibration, I can only stay inside of Vref - maybe that's the reason for a 5v Vref.QuoteFor verification, yes. Not for calibration (if output is inside of Vref).

author: dannyf
author_rank: Super Contributor
timestamp: January 08, 2014, 02:46:30 pm
content: Proof of concept:To get it running, I will implement the loop with pwm analog output and onboard adc. This allows the whole loop to be implemented, with a super-minimalist approach.

author: sync
author_rank: Frequent Contributor
timestamp: January 08, 2014, 03:04:28 pm
content: Quote from: dannyf on January 08, 2014, 02:45:22 pmThe problem with resistors is that they drift. Good resistors are expensive and hard to get. Even when you stay within Vref you probably need calibration. The reference in not accurate, the ADC and circuit add errors. But this all depends on the specs.

author: dannyf
author_rank: Super Contributor
timestamp: January 08, 2014, 03:24:22 pm
content: QuoteNo. The design is inherently immune to the drift - you just need to understand how an86 works to know why.

author: sync
author_rank: Frequent Contributor
timestamp: January 08, 2014, 03:29:18 pm
content: I meant resistors for a voltage divider on the ADC to go outside of Vref. The resistors in the AN86 circuit are uncritical.

author: dannyf
author_rank: Super Contributor
timestamp: January 08, 2014, 03:42:36 pm
content: QuoteYes. Only the (relatively) drift of the divider ratio matters - the resistor values can drift all they want, as long as the radio doesn't drift.Obviously, you will need to know that ratio for calibration purposes.

author: Marco
author_rank: Super Contributor
timestamp: January 08, 2014, 03:44:59 pm
content: Switched capacitor divider? (There has been some previous discussion about them on this forum AFAIR.)

author: sync
author_rank: Frequent Contributor
timestamp: January 08, 2014, 04:15:07 pm
content: Quote from: dannyf on January 08, 2014, 03:42:36 pmYes, but the ratio will drift. Take two resistors (from the same batch) and they have different actual temperature coefficients. So the ratio drift with temperature. And even with exactly the same TC the ratio drifts when the temperature of the resistors are not the same. There are resistors networks specially designed for this.

author: sync
author_rank: Frequent Contributor
timestamp: January 08, 2014, 04:41:13 pm
content: Quote from: Marco on January 08, 2014, 03:44:59 pmMaybe. I done experiments with a LTC1043 divider but not with good results (yet). If this doesn't work I probably go for a LT5400 resistor network. But I didn't find a source here in Germany for it. I need a 4:1 divider for my planned AN86 based voltage source to get a >10V range.

author: Galaxyrise
author_rank: Frequent Contributor
timestamp: January 08, 2014, 05:19:00 pm
content: Quote from: sync on January 08, 2014, 04:41:13 pmWhat were your difficulties? It seems like an appealing technique, but I can't even get it to be stable in spice so I've been hesitant to try experimenting on my bench.

author: sync
author_rank: Frequent Contributor
timestamp: January 08, 2014, 05:35:29 pm
content: Quote from: Galaxyrise on January 08, 2014, 05:19:00 pmMaybe inadequate construction. They seems to be picky about stray capacitance. And I used 0.1uF instead 1uF polypropylene caps. I'm aiming for a few ppm linearity error from ~100uV to 12V input. But I got sidetracked with another project.

author: eurofox
author_rank: Unknown
timestamp: January 08, 2014, 05:42:35 pm
content: Why not control the temperature of all components in the "box" with a Peltier element + PID control to 22°C?This way we solve most of the temperature drift problem.With respect to the reference voltage:1/ LTZ1000A, I have a board working and will make some test, I will add as well an opamp to get 10VDC2/ AD587, I have the module from Geller Lab and it stay stable in the range 10,0000032V - 10,0000037V on my HP3458A3/ LM399eurofox

author: tszaboo
author_rank: Super Contributor
timestamp: January 08, 2014, 06:10:43 pm
content: Quote from: dannyf on January 08, 2014, 02:45:22 pmYou still have to calibrate your reference voltage. If you use any 3+/K ppm reference voltage, there is no point of this, because you will get the same accuracy with a simple 1 bit INL DAC. You only need two DAC for high resolution. Any you still need an accurate ADC.

author: lapm
author_rank: Frequent Contributor
timestamp: January 08, 2014, 06:12:26 pm
content: Quote from: eurofox on January 08, 2014, 05:42:35 pmIs 22°C Enough? In hot summer i can get to 40°C and sometimes even over that.

author: dannyf
author_rank: Super Contributor
timestamp: January 08, 2014, 06:16:18 pm
content: QuoteSure. But the question is really how much drift.What kind of drift do you think you have to deal with?

author: dannyf
author_rank: Super Contributor
timestamp: January 08, 2014, 06:17:03 pm
content: QuoteThat's nice.

author: don.r
author_rank: Frequent Contributor
timestamp: January 08, 2014, 08:27:00 pm
content: Quote from: lapm on January 08, 2014, 06:12:26 pmThe magic of a Peltier. Reverse the current and it cools instead of heats. All that needs to be in the "box" is the voltage divider network. I guess it wouldn't hurt to have the ref in there as well.sub'd.... looking forward to your projects gents...

author: eurofox
author_rank: Unknown
timestamp: January 08, 2014, 08:59:17 pm
content: Quote from: lapm on January 08, 2014, 06:12:26 pmIt is better to keep the temperature low to avoid aging/drift of the components, no problem to keek 22°C in the "box" with 40°C outside the box.eurofox

author: sync
author_rank: Frequent Contributor
timestamp: January 08, 2014, 09:35:11 pm
content: Quote from: dannyf on January 08, 2014, 06:16:18 pmA quick and dirty test. Two 10k resistors (0.1%, 25ppm/K) as voltage divider and a thermocouple in a closed plastic box. The divider is connected to a stable 10V source and measured with a HP 34401A (averaging). I heated the box over 40°C, let it cool down and done the measurements.40°C 4.99944335°C 4.99945030°C 4.99945525°C 4.999460Which is about 0.2ppm/K drift.Repeated it with another resisitor40°C 5.00099335°C 5.00099330°C 5.00099425°C 5.001000Which is unbelievable. In fact I don't believe the results. They are much better than the errors of the test setup should be. This batch of resistors looks fantastic. I think my voltage divider problem is solved. Although I don't know how they age.But don't expect this is normal. I had another batch of 0.1% resistors in the past which had a mix of substantial positive and negative temperature coefficients.

author: Andreas
author_rank: Super Contributor
timestamp: January 08, 2014, 09:50:45 pm
content: Quote from: eurofox on January 08, 2014, 08:59:17 pmHow do you keep the condensating humidity away from your cirquit when cooling?Quote from: sync on January 08, 2014, 05:35:29 pmThe LTC1043 is optimized for 1uF caps and 10nF (around 400Hz) oscillator.I use 1uF MKS-02 mylar capacitors with fair results. Although the gain is not exact 2:1 (some ppm off). The linearity error is below 1 ppm between 0.5 to 10V.checklist:- do not load the output (use a high impedant >1000 MegOhm buffer amplifier).- the input is sensitive to pickup noise from environment(so either use 1nF between input and gnd or a filtered buffer amplifier at the input).- stray capacitance is mentioned in the datasheet.I use a guard shield under the (SMD-mounted) flying capacitor.with best regardsAndreas

author: dannyf
author_rank: Super Contributor
timestamp: January 08, 2014, 09:53:20 pm
content: QuoteWhy?QuoteActually, it is not difficult to prove mathematically that if the tempco is the same for the two resistors (even if they are not constant vs. temperature), there would be no (temperature-induced) drift in the ratio.If you don't believe that, check out the datasheet for the dividers used in AN86: those resistors have 200ppm (non-linear) drift per 100c. Yet the ratio drifts within 0.1ppm/c.

author: eurofox
author_rank: Unknown
timestamp: January 08, 2014, 10:13:54 pm
content: Quote from: Andreas on January 08, 2014, 09:50:45 pmThere are several option, avoid fresh air from outside of the "box", 22°C is maybe low, 30°C should be ok as wellMaybe I will order a Peltier element and regulate the temperature in a "box" and experiment to have a stable design with no condensation issue.I have experience about this technology and I know the diagram of Molliereurofox

author: sync
author_rank: Frequent Contributor
timestamp: January 08, 2014, 10:21:53 pm
content: Andreas, thanks for the LTC1043 tips!Quote from: dannyf on January 08, 2014, 09:53:20 pmYes, but it's astonishing that the tempco is the same. I had a different experience in the past. These are cheap 25ppm/K resistors.QuoteWhat resistors? The Vishay VHD200? That's not a valid comparison. They are specially designed for ratio stability.

author: eurofox
author_rank: Unknown
timestamp: January 08, 2014, 10:23:27 pm
content: I just order 4 Peltier elements and will make the test.eurofox

author: Jay_Diddy_B
author_rank: Super Contributor
timestamp: January 08, 2014, 10:37:00 pm
content: Hi,The point with resistor temperature coefficient is that no sign is given by the manufacturer. The general idea is that you make a batch of the chemicals that are designed to have a zero temperature coefficient and you mix them up. If the material is no 100% homogeneous there will be variation in temperature coefficients from one resistor to the next. There are other factors like the expansion of the ceramic former that the resistor is made on.It is quite probable that two resistors from the same batch have good matching on their temperature coefficient as seen in Sync's experiment.Division ratios that can not be made from the same value of resistor, will require resistors that come from different batches.It would be interesting if Sync repeated his experiment with a 9:1 divider made with two values of resistor.The Linear Technology LT5400 series offer closely matched thermal 0.2ppm tempco match and good ratio match. The absolute values and the absolute temperature coefficient is not as good. This comes about because the resistor are made from the same material at the same time. They come in ratios of 1:1, 1:10, 1:4 and 1:5.Jay_Diddy_B

author: dannyf
author_rank: Super Contributor
timestamp: January 09, 2014, 01:28:56 am
content: It lives! on paper only,I put this together in Arduino to get a rough sense as to how it would work. I used two pwm channels to generate the two voltages and ltc2440 for adc.The lcd shows the desired voltage (the "set" line. The real output is 1234567 in 24-bit format, shifted to the left by 4 digits to account for the sub-LSB digits from the adc. The actual voltage (the "get" line) is generally stable within the first 3 digits and the fourth digit fluctuates a little.I did the simulation with the adc generating RMS noise so the last few digits are not stable. No error correction, no math, simple adjustment strategy to set pwm, no overlap in output digits and no pid.Stability is fairly tricky, as it takes a long time to get the output up to the desired levels. If you shorten the time, the output becomes unstable - not as unexpected, given the long time constant in the loop.

author: luky315
author_rank: Regular Contributor
timestamp: January 09, 2014, 08:34:28 am
content: I used the AD5791 (1ppm 20Bit DAC). But the real problem in any high precision project is always the Voltage Reference. They are accurate ("Initial Accuracy") or stable (over temperature AND time), but not both.

author: eurofox
author_rank: Unknown
timestamp: January 09, 2014, 08:42:52 am
content: Only one solution, use a reference that is aged and keep the temperature stable.eurofox

author: dannyf
author_rank: Super Contributor
timestamp: January 09, 2014, 12:10:01 pm
content: Modifications:1) changed the feedback strategy a little - to eliminate overshoot.2) changed the display to uv (vs. adc values in 32-bit format).ADC rms noise is turned on.

author: Jay_Diddy_B
author_rank: Super Contributor
timestamp: January 09, 2014, 12:32:52 pm
content: Hi dannyf and the group,I strongly suggest that using the PWM and Filter for a high resolution DAC is going to go nowhere.Let us start with some AC Analysis.This is the schematic proposed:Here is a LTspice model for AC analysis:Simulation reveals, not surprisingly, two poles. One at 3.38 Hz (1K and 47uF) and one at 0.34 Hz (10K and 47uF).The ADC which is not modelled introduces additional phase shift caused by the sampling interval.Time domainIf the same filter is given a 1V step. The response is dominated by the 10K 47uF filter.The response is essential exponential:Vout = Vin (1- e(-t/RC))for this to settle within 1ppme(t/RC) = 1ppmt = -1 x RC ln (1E-6)t= 13.8 RC= 13.8 x 10K x 47u = 6.5 secondsThis dac has a 1ppm (20 bit) settling time of 6.5 seconds.In addition the DAC output is directly proportional to the power supply rail of the microprocessor. So the microprocessor supply is the reference for the DAC.There is a reason why Jim Williams (& others) used the best DACs that they could get at the time in application note AN86.The LTC1599 used in the application note settles to 0.0015% (15ppm) in 2uS.I suggest that you look at high performance DACs with an equally good reference and output amplifier.Jay_Diddy_B

author: dannyf
author_rank: Super Contributor
timestamp: January 09, 2014, 11:17:49 pm
content: Using two real (el-cheapo) dacs: It gets to stability much faster, no overshoot and far more stable - the output goes between 367.907mv and 367.928mv.That kind of performance with the RMS noise on. With better software, I think we can do better still.No error correction yet - should be simple to implement.

author: dannyf
author_rank: Super Contributor
timestamp: January 09, 2014, 11:41:29 pm
content: Here is how the system starts and then deals with an exogenous shock.Start-up: it takes about 5 - 6 seconds for the system to read about 360mv.Shock: I applied a 5v 0.5second shock at 8 second mark. The system starts to counter it and brings itself back to equilibrium at about 13 second mark.No overshoot. So I may be able to increase the gain to produce faster responses.

author: dannyf
author_rank: Super Contributor
timestamp: January 09, 2014, 11:48:14 pm
content: I doubled the gain and cut the settling time down to about 2.5 seconds.I could increase the gain still a little more but it starts to react less gracefully to shocks.I will start working on the error correction.

author: Jay_Diddy_B
author_rank: Super Contributor
timestamp: January 10, 2014, 12:43:22 am
content: Hi Dannyf,The LT1451 you used has an internal reference of 2.048V. The Internal circuit has a gain of two for a full-scale reading of 4.096V.The REF pin on the LT1451 is an output.The LT1451 output swing is define by this graph:The maximum output voltage is just over 4V with a 5V supply.Jay_Diddy_B

author: dannyf
author_rank: Super Contributor
timestamp: January 10, 2014, 01:40:30 am
content: Forgot to mention that the two dacs are working at a 20-bit dac comobined: there are 2 bits overage for each of the dacs.