EEVblog Electronics Community Forum

Electronics => Projects, Designs, and Technical Stuff => Topic started by: TheUnnamedNewbie on February 05, 2018, 03:28:42 pm

Title: DIY voltage source - first "precision" analog circuit I've done
Post by: TheUnnamedNewbie on February 05, 2018, 03:28:42 pm
My current project is a voltage source. I got the idea to do this when I was working on repairing an old multimeter and needed to generate 1 mV voltages during the calibration.

The heart of this project is the AD5547 (http://www.analog.com/en/products/digital-to-analog-converters/ad5547.html#product-overview), a dual channel 16-bit parallel-in current-steering DAC. I got it at the time because I wanted it to be as simple as possible to input data, so I could even build it with just a 16-bit bank of dip-switches if I wanted to.

For now I am using ADR4540 reference. It is 4.086 V, which makes the math somewhat easier, although in hindsight it's not that important since I am using a amplifier to double that voltage anyways, and I have a trimmer in the feedback network to set that to the correct output voltage. So I can just trim that so that I get exactly the right step size.

One channel will be +- 8 V in about 250 uV steps. I'm still not sure about the second channel. I'm going to have it be lower voltage range, perhaps so I have 100 uV steps? I'll have to see. I'll use a matched network to divide the reference voltage down.

Currently I am dealing with the output stage. Ideally I would just want an opamp, but then stability becomes an issue. Perhaps a first revision I'll make use of this simple output stage. I have been thinking of using a switchable feedback capacitor network to push out the poles to improve the stability. The amplifiers I'm currently using for the output (AD8676) are only stable driving load capacitance up to a few nF, which is not that much.

Fabrication wise, the idea is that this will be a two-pcb project. I will have a PCB made (probably 4 layers because I really need the supply planes for this I think) for all the analog stuff. Then I will use prop-board and an arduino nano to do the control aspects. Simple LCD and some buttons should do for the interface.

Schematic from the analog output below.

Title: Re: DIY voltage source - first "precision" analog circuit I've done
Post by: MasterT on February 05, 2018, 06:25:32 pm
Doing similar project at the moment, with MAX5717A. Making voltage reference adjustment LM4040 (2.5V) up to 4V,  I couldn't get good voltage output stability over short period of time. Troubleshooting around my AZ OPA MCP6V27 I discovered a few my own missteps - I was not following the guidance stated in DS, regarding matching source output impedance at both AZ OPA inputs . I fixed that, but issue still persisted , though with lower noise. Touching the resistor in the OPA feedback network,  I noticed 10 mV drift, that seems enormously huge for 60uV objective. And finally I realized, that multiplying reference voltage up was terribly wrong idea, since all my resistors are cheap junk from china i-net, I even not sure its metal film, probably composition with +-1000 ppm /C.  Now  waiting 50 ppm/C resistors from trusted supplier, and 5 ppm MAX6164 4V reference, that I would not have to multiply  up, newer ever.
Title: Re: DIY voltage source - first "precision" analog circuit I've done
Post by: TheUnnamedNewbie on February 06, 2018, 07:11:45 am
Yeah, tempco of those resistors is one of the main things I'm gonna be looking at. I am going to do some more math to figure out what value trimmer I need. I am going to be using low tempco resistors, low enough for the accuracy I need at least. As small as possible trimmer so it has as little contribution as possible due to it's tempco.

I'm going to puzzle the layout now. I am hoping to use JLC pcb's 4 layer PCB process. It'll be a puzzle to get the analog section on a 50 x 50 mm board. I'll have to see how much of the power supply I put on there as well, and what I put on the external board.

Title: Re: DIY voltage source - first "precision" analog circuit I've done
Post by: TheUnnamedNewbie on February 12, 2018, 09:45:12 am
So an update: The PCB design is almost finished. I'm just working on the silkscreen and getting things done.

I've by now realized that a lot of things I'm doing is "overkill" and not worth it in a sense. However, I want to do it just to learn and get the experience. It would have been cheaper and easier to go for a 100 by 100 mm 2-layer PCB, but I wanted to do a 4 layer and the amount of supply lines I have here seemed to be a good candidate. The reference voltages I can generate, and the temperature coefficient I calculated for my dividers is orders-of-magnitude better than I would need for a 16 bit output, but I am happy I now have some more understanding about the potential problems you can have.

This is the final schematic of the analog portion. There is also a voltage regulator to generate a 5 V for the reference. I was originally planning to put on regulators for the +-12 V rails of the opamps, but decided not to since I would simply not be able to fit it (without going to smaller pitch parts and such, which I don't want to for now). So for now those rails will be on an external PCB where the digital control circuits will also be. I'll do this first on a protoboard, but might make a proper PCB later.

(http://teksyndicate.eu/pics/.nero/altium/vsource/finalschem.PNG)

And the PCB layout - As I said 4 layers.

Top signal:
(http://teksyndicate.eu/pics/.nero/altium/vsource/top2.PNG)
Bottom signal:
(http://teksyndicate.eu/pics/.nero/altium/vsource/bottom2.PNG)
Ground:
(http://teksyndicate.eu/pics/.nero/altium/vsource/gnd2.PNG)
Power:
(http://teksyndicate.eu/pics/.nero/altium/vsource/supply2.PNG)

I have two more DACs that I was going to use in a second version. The current version has 16 bit dacs, and should give me a +- 8.192 volt swing. At 16 bit that comes down to 250 microvolt steps. So with the 1 LSB INL/DNL of the DAC that is a worst case error of half a millivolt. The second channel will be lower voltage range, but I still have to decide (I just need to pick a divider resistor chip that matches). Currently I am looking at getting a divider of 5, which would give me +-1.638 V swing, but in 50 uV steps.

When I verified this version I can look at a new board in the future. That will use a 20 bit DAC to give me far more resolution, but for now I wanted to keep it simple enough and actually build something.

I am not going to do any major changes to the PCB now (unless it turns out it would just not work of course), because my goal with this project is to actually build a thing. Every previous project up to now I haven't actually built because there was a thing I didn't fully understand and wasn't perfect and I didn't want to build something that wasn't perfect. So now I decided that I'm gonna go through with it and build it even if it isn't amazing.

Title: Re: DIY voltage source - first "precision" analog circuit I've done
Post by: Inverted18650 on February 13, 2018, 04:39:54 pm
following. Nice work.
Title: Re: DIY voltage source - first "precision" analog circuit I've done
Post by: TheUnnamedNewbie on March 03, 2018, 09:29:13 am
An update! I got the board earlier this week. They look very nice, though in hindsight I wish I put all my digital stuff on one header instead of two (the idea was to be able to drive the digital data with a DIP switch or a separate board for serial-to-parallel conversion or something).

I've written a program for my arduino to sweep all the codes. I'll then use MATLAB on one of my computers to communicate with both the arduino and my Keithley 2000 (and perhaps a function generator/scope later to do some speed measurements). Then I should be able to sweep all the codes (my math says it should take about 18 hours, which is doable).

At first glance it seems to work as expected. I still need to do the trimming and such but that shouldn't take too long.


Some pictures:

The board:

(http://teksyndicate.eu/pics/.nero/forum/voltagesource/DSC_1028.JPG)
(http://teksyndicate.eu/pics/.nero/forum/voltagesource/DSC_1029.JPG)

Test setup:
(http://teksyndicate.eu/pics/.nero/forum/voltagesource/DSC_1030.JPG)
Title: Re: DIY voltage source - first "precision" analog circuit I've done
Post by: RandallMcRee on March 03, 2018, 03:54:29 pm
Interested to see the results. I, too, have a pair of those DACs. Is your board open source by any chance?

Question: C40 and C50 on your schematic. What are their values? Seem like those ought to be in the pf range but you have electrolytics?



Title: Re: DIY voltage source - first "precision" analog circuit I've done
Post by: TheUnnamedNewbie on March 03, 2018, 05:57:32 pm
C40 is not an electrolytic. C40 is the (unpopulated) capacitor below the designator. It, as well as C50, C21, C22, C31 and C32 are

The board is not opensource in the sense that I don't really have any licensing yet. But I'm very much willing to share the schematic and board. Please note that the capacitor values as they are in the schematic are not what I actually got myself... I'll try to update the schematic later this week and share it.

Title: Re: DIY voltage source - first "precision" analog circuit I've done
Post by: TheUnnamedNewbie on March 05, 2018, 10:08:05 am
So I'm now running a sweep. Matlab is controlling the arduino that loads codes into the DAC. Matlab then reads the voltage from the Keithley 2000.

The current estimated time will be another 20 hours or so (that is, if it doesn't stop working again, since a few earlier runs failed when an error occurred...). I'm really already measuring at the limits of what my Keithley 2000 is capable off since it can only measure in 10 uV intervals on the 10 V range (which is also why I don't expect to be seeing less than 10 uV error over most of the range... I would need to invest in a better meter to do so).

Once I'm done I can calculate absolute errors over the range (which should be more significant I think). When you zoom in on the data you can also clearly see some pattern emerging on the 4th bit. It will be interesting to see the errors once I get down under 1 V, as the resolution then increases to 1 uV. The first peak you see is me bumping into the table where the measurement is happening. I suspect the second is actually error in the DAC (since if it is not, you would expect a much lower than 125 uV step to follow it).

Now it is just a matter of me waiting for the measurements to finish and then I can crunch some numbers.

(http://teksyndicate.eu/pics/.nero/altium/vsource/measurement.PNG)
Title: Re: DIY voltage source - first "precision" analog circuit I've done
Post by: TheUnnamedNewbie on March 10, 2018, 08:22:14 am
My monologue continues!

So, I got some data. It seems like I screwed up and forgot to save a screenshot of the final result. The data is all saved so I can still process it but it seems ok.

(http://teksyndicate.eu/pics/.nero/forum/voltagesource/28822340_10214330216322634_1123314370_o.png)

This is the step size for the -4.096 to 4.096 DAC. Ideally it should be 125 uV.

However, the setup now is without a case, and without a powersupply board. I didn't design the powersupply system yet because I first wanted to figure out how I'm actually going to control things. Originally I was thinking about a stand-alone box, but now I am starting to think that making it USB controllable might be easier. However, I would need to figure out how to do this because I would want it to be isolated (so either I build in a sort of USB isolator, or I need to float the DAC with respect to the controller. I'm more and more thinking about the latter, since this would allow me to use a second board as well on the same controller.

Right now the shitty app I'm using to test looks like below. Ignore how horrible it looks and the fact that it has a lot of text on it that doesn't seem to serve much purpose (same for the multimeter "app"). I'm learning to work with the matlab instrumentation toolbox and app designer. Even though in the long run this might hurt, because I lose access to MATLAB once I finish my PhD... But at the same time, I will be needing matlab a lot in the process of that PhD, so I thought it was a good learning experience.

The "edit Field" is the place I put in the desired voltage I want from the DAC. And then I can press the set A or set B buttons to program the A or B dac. The meter is currently connected to the B, and it looks pretty good. (the results, not the apps). Oh, and the multimeter app has way to much digits, and I am aware everything past the first 6 digits is pretty useless. But this is just directly printing out what the meter is returning over RS232, no formatting.

(http://teksyndicate.eu/pics/.nero/forum/voltagsource/matlabapp.PNG)

In the end I'm gonna change the app to have a different way to select the values.

Some first measurements also seem to indicate I underestimated the temperature coefficient. I have to invest in some sort of temperature logger instrument. That way I can make a crude thermal chamber to really look at this in more detail.