Author Topic: General Purpose Power Supply Design  (Read 215484 times)

0 Members and 1 Guest are viewing this topic.

Offline amspireTopic starter

  • Super Contributor
  • ***
  • Posts: 3802
  • Country: au
Re: General Purpose Power Supply Design
« Reply #125 on: April 12, 2012, 12:57:48 pm »
George, can you set the PWM to a few static levels and measure the DC stability of the DC out? I do not know what kind of multimeters you have but any results would be very interesting.

I know you are probably just using a test setup and the micro supply stability may be nothing special, but it would be good to see the results. One of the things I was wondering is that if you went from a low duty cycle to a high duty cycle, will the upper FET in the output start increasing in resistance causing the voltage to drop slightly over time.

Also you used 15K resistors. Using 100K would put much less load on the output, so in theory, the stability should be better.

Also what is the AC on the output according to the meter? Can your DMM see any noticeable noise? Test micro circuits tend to be noisy anyway, but again it would be interesting.

Excellent stuff.  I haven't disappeared - I have just been busy with other work the last two weeks, but I will be doing a series of posts very soon on the latest work.

Richard.
 

Offline A Hellene

  • Frequent Contributor
  • **
  • Posts: 602
  • Country: gr
Re: General Purpose Power Supply Design
« Reply #126 on: April 12, 2012, 03:10:03 pm »
Richard, I am sorry but my multimeters are not capable of reading microvolts or nanoampers. And, even though I do not have second thoughts on spending for example an amount of USD 500 for an SSD of a three-years long life expectancy, or half of that monetary amount for a toy-oscilloscope, I do not feel like investing such figures in immature software-based multimeters that I will not be able to completely trust in the long run --even though the industry seems it does. I guess I'll have to begin watering down my wine in this department, too... Awareness, after a certain point, really sucks! :P

What I could do instead, is to set up a high gain op-amp (100x/1000x) to make such readings; but again, being the whole setup constructed on breadboards, hunting down such resolution and accuracy figures shouts for the need of carefully arranged ground islands beneath the chips and the filters and of guarding loops around the sensitive lines. The digital output stages limitations are also considerable, since their expected characteristics drift due to temperature variations does never work in favour of accuracy or stability.


-George



EDIT: Corrections...
« Last Edit: April 12, 2012, 05:46:56 pm by A Hellene »
Hi! This is George; and I am three and a half years old!
(This was one of my latest realisations, now in my early fifties!...)
 

Offline amspireTopic starter

  • Super Contributor
  • ***
  • Posts: 3802
  • Country: au
Re: General Purpose Power Supply Design
« Reply #127 on: April 15, 2012, 05:23:39 am »
I did some serious number crunching work on the PWM DAC so I can build up a test circuit for my own, and found that the original scheme of an 8 bit PWM with corrections every PWM cycle performed better then all the other ideas that have come up since then. 10 bit PWM is messy since the lower 8 bits are double buffered and the top 2 bits are not - basically 10 bit PWM is for constant PWM. 16 bit PWM means that the output frequency is pretty low  - 244 Hz for a 16Mhz PWM clock - and the results through the filter is far worse then the results you get with an 8 bit PWM.

I also looked at an active filter instead of the simple PWM, but the problem there is the main noise is at 62Khz when the opamps are loosing a lot of their gain. The simple RC filter gives far superior results. So I will take Georges code and modify it for an Atmega328  (that's what I have for now), and set it up with a good reference.

The best filter looks like a three stage RC filter consisting of 22K resistors and 1u capacitors. There are no stability and accuracy requirement for these parts, so supply filter 1uF caps are fine. With these values, the output settles from a large voltage change to within 1% in less then 0.6 seconds, and to within 1uV of the final value within 1.5 seconds. I can live with that. Theoretically, the ripple from the PWM + correction with a 16Mhz PWM clock should be less then 1uV RMS on the final supply output  - probably below the noise from the opamps. It works out better then I expected, as the PWM cycle-by-cycle correction code is pretty good at minimizing the end noise because it spreads out corrections over the full correction cycle is a smooth way.

I will try both the PWM straight from the chip, and also PWM from a CMOS synchronous register powered by the reference. I will use the synchronous register to restore the timing for the PWM output using the Atmega's clock. The resulting waveform should be much better formed, and the levels more precise, as the CMOS chip is dedicated to this task - not handling 10 other loads like a Micro.

I aim to get some numbers out for linearity, short and long term stability and noise. 

Richard.
 

Offline fmaimon

  • Supporter
  • ****
  • Posts: 165
  • Country: br
Re: General Purpose Power Supply Design
« Reply #128 on: April 15, 2012, 09:52:32 pm »
An AVR output lower mosfet has an Rdson between about 20 R (-40C),  23 R (25C)  and 28R (85C) and the upper one has between 10 R (-40C), 12.5 R (25C) and 15 R (85C), both at 5V. These are typical figures, taken from the datasheet (m328P) graphs of the pin driver strength and 10 mA draw.

An HC00 @ 4.5V (there is no figure for 5V, even for the HCT) has Ron for the lower one of 37.5 R typical (25C) and max of 82.5 R (entire temperature range) and 45 R typical (25C) and 165 R (entire temperature range) for the upper one. The HC244 doesn't have typical figures but has a maximun Ron for 67 R (lower mosfet) and 133 R (upper mosfet). These are taken from NXP's datasheets.

Of course you can parallel multiple CMOS drivers to lower the Ron, but the pin driver of the AVR is better.
 

Offline caroper

  • Regular Contributor
  • *
  • Posts: 193
  • Country: za
    • Take your PIC
Re: General Purpose Power Supply Design
« Reply #129 on: April 15, 2012, 10:36:58 pm »
16 bit PWM means that the output frequency is pretty low  - 244 Hz for a 16Mhz PWM clock - and the results through the filter is far worse then the results you get with an 8 bit PWM.

I have some PIC32MX150F128B SPDIP Samples on the way, it may be worth trying the 16Bit PWM with the 40Mz clock.
They are for another project but I am sure I could reserve one or two and try getting the CHIPKIT Bootloader on them and see if I cant get them to work with the MPIDE to make porting Arduino Sketches easier for those that would like a more powerful CPU.

I am busy building a custom bootloader for the 32MX695 at the moment so the groundwork should be in place by the time the 32MX150's arrive.

Cheers
Chris

Offline amspireTopic starter

  • Super Contributor
  • ***
  • Posts: 3802
  • Country: au
Re: General Purpose Power Supply Design
« Reply #130 on: April 15, 2012, 11:05:02 pm »
An AVR output lower mosfet has an Rdson between about 20 R (-40C),  23 R (25C)  and 28R (85C) and the upper one has between 10 R (-40C), 12.5 R (25C) and 15 R (85C), both at 5V. These are typical figures, taken from the datasheet (m328P) graphs of the pin driver strength and 10 mA draw.

An HC00 @ 4.5V (there is no figure for 5V, even for the HCT) has Ron for the lower one of 37.5 R typical (25C) and max of 82.5 R (entire temperature range) and 45 R typical (25C) and 165 R (entire temperature range) for the upper one. The HC244 doesn't have typical figures but has a maximun Ron for 67 R (lower mosfet) and 133 R (upper mosfet). These are taken from NXP's datasheets.

The problem with using the micro outputs directly is that the other ports are driving other loads, and all the total current and transient loads goes through the common supply pins. The PWM will suffer voltage changes through resistive drops in the power supply pins as the total load changes. It may be I can avoid any heavy loads on other output pins which could make the micro outputs look pretty good. The RC filter look like a resistive load of between 22K and 220K depending on the final value I choose. If it is 220K, then a 10 ohm change in a output driver resistance would cause  something like a 0.005% change. 

i will have to see what kind of resistive change you actually get in the short term, as I am mainly concerned with short term stability after everything has had time to warm up.

Richard.
 

Offline amspireTopic starter

  • Super Contributor
  • ***
  • Posts: 3802
  • Country: au
Re: General Purpose Power Supply Design
« Reply #131 on: April 17, 2012, 02:34:02 pm »
My test breadboard to check out the PWM DAC performance is going well. I have an Arduino micro running with a LCD panel and pushbuttons.

So far the PWM looks like it may be able to get at least 0.1% accuracy, and it is definitely adjustable to better then 10uV.

The problems I have at the moment is the variable load from the micro and display is causing the micro supply to vary in the sub-mV range, and since the PWM output is proportional to the micro supply, I cannot measure the PWM stability till I solve the micro supply stability. I will probably take the PWM out to a buffer running from a precision voltage reference.

Also I found that the PWM interrupts are incompatible with the Arduino LCD routine. I suspect the LCD routing is using interrupts, or sharing the timer0 interrupt. So if I write to the display, then PWM output goes pretty bad.  It should be very fixable - no reason for the LCD routine to use any interrupts.

I want to get it running with software calibration, and the means to control the output voltage down to uV level. I am using Arduino 1.0 IDE and finding it pretty good. So far, it has not been hard to update libraries for the changes in Arduino 1.0.

I will post a circuit and some photos tomorrow.

Richard.
 

Offline amspireTopic starter

  • Super Contributor
  • ***
  • Posts: 3802
  • Country: au
Re: General Purpose Power Supply Design
« Reply #132 on: April 19, 2012, 01:11:33 am »
I finally got over my problems getting the micro up and running, so I should able able to get a really good test of the PWM DAC working today.

It am using a atmega328 running at 16MHz. Since I do not have the constraints George had, I am able to write the interrupt in C. I can easily fit the interrupt code for managing two timers inside the 16uS PWM period. It will probably end up using something like 8uS, so that is all I need for a good test.

This code does not use any dedicated registers - just standard RAM memory - so it is not nearly as efficient as George's code. There is a good chance I will end up using George's code in a final version, except if I use a micro that does not have a built-in clock multiplier for the PWM clock, then I will not use dedicated registers.

Here is the C code with the assembler the compiler generated:

Code: [Select]
ISR(TIMER2_OVF_vect) {
     b2a: 1f 92        push r1
     b2c: 0f 92        push r0
     b2e: 0f b6        in r0, 0x3f ; 63
     b30: 0f 92        push r0
     b32: 11 24        eor r1, r1
     b34: 2f 93        push r18
     b36: 3f 93        push r19
     b38: 4f 93        push r20
     b3a: 5f 93        push r21
     b3c: 8f 93        push r24
     b3e: 9f 93        push r25
     b40: af 93        push r26
     b42: bf 93        push r27

  OCR2A = (byte) (pwm_accum / 0x01000000L ) ;  // 16 cycles

     b46: 80 91 80 01 lds r24, 0x0180
     b4a: 90 91 81 01 lds r25, 0x0181
     b4e: a0 91 82 01 lds r26, 0x0182
     b52: b0 91 83 01 lds r27, 0x0183
     b56: 2b 2f        mov r18, r27
     b58: 33 27        eor r19, r19
     b5a: 44 27        eor r20, r20
     b5c: 55 27        eor r21, r21
     b5e: 20 93 b3 00 sts 0x00B3, r18

  pwm_accum &= 0x00FFFFFFL ; // 7 cycles

     b62: b0 70        andi r27, 0x00 ; 0
     b64: 20 91 7c 01 lds r18, 0x017C
     b68: 30 91 7d 01 lds r19, 0x017D
     b6c: 40 91 7e 01 lds r20, 0x017E
     b70: 50 91 7f 01 lds r21, 0x017F

  pwm_accum +=  value ;  // 11 cycles

     b74: 82 0f        add r24, r18
     b76: 93 1f        adc r25, r19
     b78: a4 1f        adc r26, r20
     b7a: b5 1f        adc r27, r21
     b7c: 80 93 80 01 sts 0x0180, r24
     b80: 90 93 81 01 sts 0x0181, r25
     b84: a0 93 82 01 sts 0x0182, r26
     b88: b0 93 83 01 sts 0x0183, r27

}
     b8e: bf 91        pop r27
     b90: af 91        pop r26
     b92: 9f 91        pop r25
     b94: 8f 91        pop r24
     b96: 5f 91        pop r21
     b98: 4f 91        pop r20
     b9a: 3f 91        pop r19
     b9c: 2f 91        pop r18
     b9e: 0f 90        pop r0
     ba0: 0f be        out 0x3f, r0 ; 63
     ba2: 0f 90        pop r0
     ba4: 1f 90        pop r1
     ba6: 18 95        reti


I am really impressed that the code optimizer translated

OCR2A = (byte) (pwm_accum / 0x01000000L )

into a move, and three exclusive ORs and a sts command. It didn't try to divide at all. It could have left out the eor commands, but that is just 3 cycles.

Richard.
« Last Edit: April 19, 2012, 01:31:58 am by amspire »
 

Offline amspireTopic starter

  • Super Contributor
  • ***
  • Posts: 3802
  • Country: au
Re: General Purpose Power Supply Design
« Reply #133 on: April 19, 2012, 04:05:41 pm »
I have my PWM test setup working and it is not bad.

The breadboard is limited by 0v rail digital noise around the 500uV level, so I cannot properly check out the performance of the PWM into the microvolt level, but the results are definitely promising. Transients from things like the LCD display are getting to the output. 

Looks like a linearity and accuracy of less them 10mV error can be expected which is pretty good for a basic 25v supply. I am typically getting within 2mV and since I have scaled the output for 25V maximum output, 2mV equates to 13 to 14 bits of DAC accuracy. That is good. I have a monotonic 32 bit DAC (well 23 bits practically)  that performs at least as well for accuracy as a 13-14 bit commercial DAC. I am very happy with that.

The output works well down to near zero volts just by using the LM324 amplifier on the PWM output with a 10K pull down resistor on the output. I am currently getting 4mV out at  minimum voltage. At 18 mV set, I get 15mV out. At 0.1V set, I get 97mV out. That is not bad performance for a single supply opamp circuit.

Long term accuracy is another issue, but there is no real reason for the output to change much.

As far as I can work out, with a proper layout, you should be able to adjust to within 10uV as a short term stability, but that does depend on the voltage reference used, and an excellent board layout to isolate digital noise from the analog sections.

I found that it may be hard to use the PWM from the micro directly. Loads on other outputs do affect the PWM output levels when you are looking at 0.01% error levels.

I have taken the PWM output to a cmos buffer which is powered by a 0.6ppm/C 5v reference IC just so I can look at the PWM accuracy and not the reference accuracy too. Definitely using something cheaper in the design.

It is a bit late now to get some pictures, but I will hopefully find time tomorrow. Overall though, the concept looks like it is good. It should give me the adjustment resolution I want down into the uV region. The negatives compared to a DAC is that the output takes up to a second to settle fully and the board layout will definitely be much more critical compared to a DAC.

How to adjust the output voltage in a way that gives you fine resolution - that will be another big challenge.

Before I switch it off for the night, here are some random results:

Setting             Output
0.9266V            0.9236V
3.1523V            3.1493V
4.9663V            4.9635V
6.7801V            6.7776V
10.7124V         10.7105V
13.1595V         13.1581V
15.4267V         15.4250V

All the readings are low by two or three millivolts and that is just the calibration is not quite right. I have not done any calibration of the linearity - that is the inherent linearity of the PWM. I just calibrate at 1V and 10V, and all the other voltages are calculated by the PWM reference using those two numbers.

To get a feel for the short term stability that may be possible, I have set the voltmeter to average over 20 mains cycles, and right now, it is stable to 100uV with 15V out and that is on a noisy breadboard.

A precision version of this as a high resolution  programmable reference box (a really good reference , better opamps and a dual supply) may be a handy spinoff from this work.

Richard.

« Last Edit: April 19, 2012, 04:20:21 pm by amspire »
 

Offline BravoV

  • Super Contributor
  • ***
  • Posts: 7549
  • Country: 00
  • +++ ATH1
Re: General Purpose Power Supply Design
« Reply #134 on: April 19, 2012, 04:24:54 pm »
Richard,

Looks really promising ! Thanks for the update !


A precision version of this as a high resolution  programmable reference box (a really good reference , better opamps and a dual supply) may be a handy spinoff from this work.

I'm in if you decided to design this too !

Offline m12lrpv

  • Regular Contributor
  • *
  • Posts: 175
  • Country: au
Re: General Purpose Power Supply Design
« Reply #135 on: April 19, 2012, 09:52:50 pm »
I have taken the PWM output to a cmos buffer which is powered by a 0.6ppm/C 5v reference IC just so I can look at the PWM accuracy and not the reference accuracy too. Definitely using something cheaper in the design.

This is something that's completely new to me (references and powering things from them) so i'm interested in knowing what the reference is that you're using so that I can learn more about it.

 

Offline amspireTopic starter

  • Super Contributor
  • ***
  • Posts: 3802
  • Country: au
Re: General Purpose Power Supply Design
« Reply #136 on: April 20, 2012, 12:25:01 am »
I have taken the PWM output to a cmos buffer which is powered by a 0.6ppm/C 5v reference IC just so I can look at the PWM accuracy and not the reference accuracy too. Definitely using something cheaper in the design.

This is something that's completely new to me (references and powering things from them) so i'm interested in knowing what the reference is that you're using so that I can learn more about it.
You won't want to know about the reference IC's I am using. VRE305A made by Thaler Corp. and they are actually hybrids - a buried zener reference IC mounted on a thick film temperature compensation network. It is laser trimmed for accuracy and temperature coefficient. I bought them directly from Thaler at something like $10-$15 each, but Thaler have been taken over by Cirrus, and the one-off price is now about $70. The specs are generally better then the best references IC's but too expensive unless you are desperate.

There are lots of great reference IC's, and a good place to start is to google REF01 and REF02. The 8 pin DIP pinout has become an industry standard, so you can often replace one reference with another completely different part number from a different manufacturer.

There are 2 common type of references. The best is the zener diode based references, but the zener references need at least 6.3V, and so these ICs usually need 10-15V to operate.

The second type uses the voltage differences between the base voltages of matched transistors at different currents to provide a low voltage reference. Not as good as the zeners, but still impressive, and it is excellent for 1.25 to 2.5V low power references running of 2.7V to 5V supplies. Good enough for most uses.

There are few other types of references but these are the most common.

Another really neat reference IC is the Texas Instruments TL431.

This is a very clever 3 pin shunt  regulator. It is not as good as the best of the 8 pin references, but it is far more versatile, and a lot of fun to play with. It basically can be used as an active part of a circuit, rather then just a reference.

Richard.
« Last Edit: April 20, 2012, 05:15:55 am by amspire »
 

Offline amspireTopic starter

  • Super Contributor
  • ***
  • Posts: 3802
  • Country: au
Re: General Purpose Power Supply Design
« Reply #137 on: April 20, 2012, 12:49:11 am »
Richard,

Looks really promising ! Thanks for the update !


A precision version of this as a high resolution  programmable reference box (a really good reference , better opamps and a dual supply) may be a handy spinoff from this work.

I'm in if you decided to design this too !

Just wondering how to proceed since I am really trying out ideas related to a really cheap quality power supply design rather then making a product.

I think the way I will go is to do it as a modular design. This will mean I can post the finished modules without needing solutions to everything.

If someone wants to integrate the ideas back into a single board - great.

The PWM does work better then expected so I am interested in looking at a high performance design. I have a Kelvin-Varley divider project that is in hybernation for the moment, but this could replace it.

A 2 point calibration for the PWM at zero volts and one reference voltage using a auto zero offset opamp based galvanometer should be straightforward, and if I can get a 0.001% linearity, it would be nice. Looking at the test PWM performance, resistor stability may be a bigger problem then the PWM linearity. Resistors better then 20ppm/C cost a lot, and it takes very little power to make a 20ppm/C resistor change significantly when you are looking for better then 0.1%.

Richard.
 

Offline m12lrpv

  • Regular Contributor
  • *
  • Posts: 175
  • Country: au
Re: General Purpose Power Supply Design
« Reply #138 on: April 20, 2012, 12:53:46 am »
You won't want to know about the reference IC's I am using. VRE305A made by Thaler Corp. and they are actually hybrids - a buried zener reference IC mounted on a thick film temperature compensation network. It is laser trimmed for accuracy and temperature coefficient. I bought them directly from Thaler at something like $10-$15 each, but Thaler have been taken over by Cirrus, and the one-off price is now about $70. The specs are generally better then the best references IC's but too expensive unless you are desperate.

...

Thanks.

I was more interested in the specs of what you were using because i've got some TL431's for use as ADC references and i'm looking at them wondering if I really could power a cmos buffer or inverter of them.
 

Offline BravoV

  • Super Contributor
  • ***
  • Posts: 7549
  • Country: 00
  • +++ ATH1
Re: General Purpose Power Supply Design
« Reply #139 on: April 20, 2012, 12:58:45 am »
Thanks, about programmable reference box, if you have time, please design it and definitely I will build it.

About the vref, I'm aware of that high end Thaler's stuff, just asking for other alternatives, though not as good in initial accuracy compared to Thaler, I have few of these in my component bins, these should be good enough right ?

MAX6350 (buried zener)
-> 1ppm/°C Max Tempco , 3µVp-p Noise , ±0.02% initial accuracy, has external trim feature
-> http://www.maxim-ic.com/datasheet/index.mvp/id/1700

or this one

LTC6655
->  2ppm/°C Max Tempco , 0.25 ppm p-p Noise , ±0.025% initial accuracy, has kelvin sense pins
-> http://www.linear.com/product/LTC6655
« Last Edit: April 20, 2012, 04:52:16 am by BravoV »
 

Offline amspireTopic starter

  • Super Contributor
  • ***
  • Posts: 3802
  • Country: au
Re: General Purpose Power Supply Design
« Reply #140 on: April 20, 2012, 05:20:38 am »

Thanks.

I was more interested in the specs of what you were using because i've got some TL431's for use as ADC references and i'm looking at them wondering if I really could power a cmos buffer or inverter of them.
References tend to have opamp output rather then power supply outputs, but they can usually manage up to about 10mA that is fine for low power IC's,   Make sure you have a ceramic 1uF cap or similar directly across the CMOS IC as even though they consume almost no power when static, the peak transient switching current can be quite high. The VRE305A is 10mA peak output.

I like to limit the current to 1 to 3mA maximum, but they will still work well at 10mA out.

Richard.
 

Offline EEVblog

  • Administrator
  • *****
  • Posts: 38720
  • Country: au
    • EEVblog
Re: General Purpose Power Supply Design
« Reply #141 on: April 20, 2012, 07:05:28 am »
I will try both the PWM straight from the chip, and also PWM from a CMOS synchronous register powered by the reference. I will use the synchronous register to restore the timing for the PWM output using the Atmega's clock. The resulting waveform should be much better formed, and the levels more precise, as the CMOS chip is dedicated to this task - not handling 10 other loads like a Micro.

Yes, my guess would have been that a decent accurate 16bit PWM from a direct micro might be asking a bit much, especially if the micro is handling other current stuff like direct LED drive.

Dave.
 

Offline EEVblog

  • Administrator
  • *****
  • Posts: 38720
  • Country: au
    • EEVblog
Re: General Purpose Power Supply Design
« Reply #142 on: April 20, 2012, 07:07:53 am »
I was more interested in the specs of what you were using because i've got some TL431's for use as ADC references and i'm looking at them wondering if I really could power a cmos buffer or inverter of them.

Easily.
I've powered micros directly with voltage references for the supply, and it works a treat at providing an accurate ADC and PWM DAC system.

Dave.
 

Offline amspireTopic starter

  • Super Contributor
  • ***
  • Posts: 3802
  • Country: au
Re: General Purpose Power Supply Design
« Reply #143 on: April 20, 2012, 07:45:05 am »

Yes, my guess would have been that a decent accurate 16bit PWM from a direct micro might be asking a bit much, especially if the micro is handling other current stuff like direct LED drive.

Dave.
That is exactly what I am seeing. I have an old-style 16x2 LCD display attached, and every time I write to it, I am seeing a 10mV glitch on the Atmega328 outputs. That is nothing as far as digital is concerned, but pretty bad for precision analog.

It may be possible to get accurate PWM out of a dedicated micro that is doing PWM and nothing else. Something like a ATtiny chip. How would you control it though?

I think I will go for the external CMOS buffer run from a reference. I have also found it is really important to get the capacitor in the first RC stage of the filter really close to the CMOS buffer to minimize the path of the transient current. Even though I am using 100K resistors and 0.22uF caps, the transient does infiltrate the later analog stages.

Richard.

 

Online jahonen

  • Super Contributor
  • ***
  • Posts: 1055
  • Country: fi
Re: General Purpose Power Supply Design
« Reply #144 on: April 20, 2012, 08:01:42 am »
I think I will go for the external CMOS buffer run from a reference. I have also found it is really important to get the capacitor in the first RC stage of the filter really close to the CMOS buffer to minimize the path of the transient current. Even though I am using 100K resistors and 0.22uF caps, the transient does infiltrate the later analog stages.

Richard.

That's why I thought that it would be probably a good idea to first shave off the highest frequency components (MHz and above), before doing any actual PWM filtering (see my spectrum measurements). Large-valued resistors tend to suffer from parasitic capacitance across which don't mix well with those steep edge rate signals. First thing to try might be putting a small cap (few tens of pF perhaps) directly at the logic gate output, that will slow down edges quite significantly.

Also, forget breadboarding and use that solid copper clad board that Jim Williams would use for the output logic gate buffer and PWM filter.

Regards,
Janne
 

Offline amspireTopic starter

  • Super Contributor
  • ***
  • Posts: 3802
  • Country: au
Re: General Purpose Power Supply Design
« Reply #145 on: April 20, 2012, 01:36:22 pm »

Also, forget breadboarding and use that solid copper clad board that Jim Williams would use for the output logic gate buffer and PWM filter.

Regards,
Janne
You mean like this  :)



I know what I should be doing. It is just that trying to work Jim Williams style drives me a bit nuts. I think I will just make a PCB for the next effort. Definitely, my current breadboard is useless below 1mV with all the noise on the 0V line just because of the presence of the micro. I may also try running the micro from batteries, and moving the analog to a different breadboard.

For anyone interested, the Arduino compatible Atmega328 RBBB board is on the left. The small Kapton tape wrapped board (top center) contains  a 4069 hex inverter with all six inverters in parallel plus decoupling caps. I definitely could move the first RC filter stage to that board. I had to use the small board as the 4069 was a smd package.

The 8 pin IC that is in front of the buffer board is the VRE305A reference and right is a LM324  IC.

The 4 switches from left to right are step down, step up, save 1V reference and save 10V reference. The down and up switches step in different increments depending on whether I single click, double click or single click, so that is how I can manage to adjust the 32 bit PWM value with two switches.

Richard
« Last Edit: April 20, 2012, 01:49:03 pm by amspire »
 

Offline amspireTopic starter

  • Super Contributor
  • ***
  • Posts: 3802
  • Country: au
Re: General Purpose Power Supply Design
« Reply #146 on: April 22, 2012, 07:36:00 am »
Inspired by Janne, I though I had better improve my PWM test setup a little.



In the photo above I have my PWM reference set for 10mV out, and it is actually putting out 10.141mV. Just to prove it works down to 0V.

I separated the Analog from the digital breadboard, and powered the micro from batteries, just so the analog breadboard only had one point of contact from the digital circuit. The analog board had a 74HC10A gate acting as a buffer  powered from a 5V reference. The filter was 3 stage RC filter with a 100K/22uF combination. A LM324 unity gain amp followed, and then I had another stage with an offset of about 50mV and a gain of 5.

I decided to check the jitter of the Atmega328 which was using a 16MHz ceramic resonator.

It turned out to be pretty bad - 4 nS jitter and the big errors were erratic, so it would not be hidden by the averaging all that much. It turns out that the clock was in the low power mode which is prone to noise sensitivity.  Changing the fuses to High Power mode for the clock reduced the jitter to below 0.5nS (I cannot measure below that). This is good enough for better then 1 part in 10-5, so I do not need a crystal oscillator or anything to recover the edges accurately.

How did it work out. Well extremely well actually.



If you look at the 14V reading, you see that as I approach the higher voltages, the error seems to be increasing. The error of .2mV amounts to a 15ppm error. A 50ppm/C metal film resistor in my LM324 amplifier circuit feedback can cause this if the resistor's temperature warms by just 0.33 deg C as the voltage across it increases. Also I have scaled this for 25V full scale, so an error of 0.2mV is just 8ppm of full scale. I really think this is amazing from such a simple circuit.

Is there anything for 10 times the cost  that comes close?

I am really on the limits of basic resistor and LM324 performance here. For my power supply, I am very happy to go for 10mV absolute accuracy, with typical accuracy being 1mV, and it looks like I get that with the most basic of parts.

I cannot see any reason why the results would not be even better with high stability resistors and ultra low offset & current opamps.

Richard.

« Last Edit: April 02, 2016, 12:10:54 am by amspire »
 

Offline amspireTopic starter

  • Super Contributor
  • ***
  • Posts: 3802
  • Country: au
Re: General Purpose Power Supply Design
« Reply #147 on: April 22, 2012, 08:39:06 am »
One of the motivations for starting this power supply project is I need a supply that is adjustable down to the microvolt level for a Fluke540A Thermal Transfer Standard. The 540A can calibrate an AC signal to a 0.01% RMS accuracy by comparing it with an equivalent DC signal.

For this, I really need something that is stable in the short term and settable to 0.001%. With a 400mV RMS AC signal, that means I need to be able to adjust down to 4uV DC. A supply is needed that can drive the 200 ohms/volt of the 540A, and it is amazing how much drift you get out of many standard power supplies. Just about all the digital supplies are totally useless as their resolution is so bad. A supply that has 1mV resolution is marginally useful for measuring above 10VAC and is only properly useful above 100V AC - but then the power supply probably doesn't go that high.

So I tried using the reference to null a random setting on the 540A, and it really worked brilliantly. Adjusting down in the uV level was brilliant - very monotonic and no jumps at all. Stability was perfectly adequate for the task.

I put up a photo. Watching a 540A work is not exciting. All you are trying to do is to get the galvanometer to 0.0 on HIGH sensitivity, but here it is. A deflection of +/- 6 corresponds to a +/- 0.01% error. I didn't wait for thermal equilibrium of the sensor, so the needle was still creeping up very slowly as I took the photo. It looks like it is about 0.003% above zero. This corresponds to an output voltage of about 410 mV from the PWM reference.

Richard.
 

Offline Leo Bodnar

  • Frequent Contributor
  • **
  • Posts: 814
  • Country: gb
Re: General Purpose Power Supply Design
« Reply #148 on: April 22, 2012, 11:01:19 am »
It may be possible to get accurate PWM out of a dedicated micro that is doing PWM and nothing else. Something like a ATtiny chip. How would you control it though?
Through three SPI pins (CS, CLK, MOSI) with inline high value resistors to reduce noise injection from master.
Preferably make their default state low.

Leo

Offline Leo Bodnar

  • Frequent Contributor
  • **
  • Posts: 814
  • Country: gb
Re: General Purpose Power Supply Design
« Reply #149 on: April 22, 2012, 11:16:40 am »
Is there anything for 10 times the cost  that comes close?
Dave has an episode on precision voltage reference that is nothing more than a voltage reference IC and a bunch of resistor dividers in a box.

I know you are excited!  :)

But by the time you put $1 something-duino in a rack enclosure, add power supply, user interface, go through agencies approvals,  issue calibration certificate, print user manual and product shipping package (so that it can be sold side-by-side with big guys) it will cost $500.

Leo


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf