Author Topic: Lab Power Supply Design Part 5  (Read 44000 times)

0 Members and 1 Guest are viewing this topic.

Offline Bored@Work

  • Super Contributor
  • ***
  • Posts: 3932
  • Country: 00
Lab Power Supply Design Part 5
« on: January 03, 2012, 01:51:05 pm »
Finally a schematic.

Dave,

I see you share the ISP and the DAC SPI (and plan to put the ADC on the same ISP bus, too). This can in principle be done. However, a lot of AVR ISP programmers are a little bit allergic when the ISP interface is shared. I recommend you have a look at Atmel's application note AVR042, section 4.1.1 http://www.atmel.com/atmel/acrobat/doc2521.pdf for the official way to handle this.

When all else fails, then a jumper to disconnect SCK from the rest of the bus, and only leave it connected to ISP helps, too.

Second, the reset pin should be handled differently, esp. if you are in a noisy environment. Most people don't try their luck and add a resistor and cap. Similar to what is also given in AVR042. However, most people skip the diode recommended in AVR042.

Third, and this might be a real issue, you have connected a LED to the reset pin. Presumably you want to drive the LED via PC6. However, that is not possible. AVR reset pins can either be used as a reset pins, or as a GPIO pin (here PC6). Which function the pin has can be set by a fuse, RSTDISBL.

But there is a catch! If you program the RSTDISBL fuse you no longer have the reset pin function. However, the reset pin function is needed for ISP programming. In other words, programming the RSTDISBL fuse is the last thing you can do via ISP. After that you don't have ISP any more. A workaround would be to program a bootloader via ISP into the AVR, then program RSTDISBL via ISP, and from that moment on do all further firmware updates via the bootloader. A bootloader, however, can not change (program or clear) the RSTDISBL fuse.

The other programming method for this AVR, high voltage serial parallel programming, HVSPP, is just a theoretical option. It would allow to clear RSTDISBL, thus again enabling ISP. But that method requires to wire up something like 18 pins of the AVR to the programmer and use a 12V programming impulse at some pins. This is nearly impossible while the AVR is in the circuit.

I would recommend you free the reset pin, too and use it exclusively for reset.
« Last Edit: January 03, 2012, 06:46:53 pm by BoredAtWork »
I delete PMs unread. If you have something to say, say it in public.
For all else: Profile->[Modify Profile]Buddies/Ignore List->Edit Ignore List
 

Offline shebu18

  • Frequent Contributor
  • **
  • Posts: 307
  • Country: ro
Re: Lab Power Supply Design Part 5
« Reply #1 on: January 03, 2012, 06:21:42 pm »
What if i need more then 4A? (beside 3-4 LT's or LM's) The whole current measurement must be changed, right?
« Last Edit: January 03, 2012, 06:57:41 pm by shebu18 »
 

Offline EEVblog

  • Administrator
  • *****
  • Posts: 28378
  • Country: au
    • EEVblog
Re: Lab Power Supply Design Part 5
« Reply #2 on: January 03, 2012, 06:38:39 pm »
Thanks BAW, the Reset pin had an I/O marked on it, so I assumed it could be used dual purpose without a nasty trap like that. I didn't bother to delve into the details of it at the time.

Dave.
 

Offline EEVblog

  • Administrator
  • *****
  • Posts: 28378
  • Country: au
    • EEVblog
Re: Lab Power Supply Design Part 5
« Reply #3 on: January 03, 2012, 06:45:58 pm »
Quote
To protect the RESET line further from noise, it is an advantage to connect a
capacitor from the RESET pin to ground. This is not directly required since the AVR
internally have a low-pass filter to eliminate spikes and noise that could cause reset.
Applying an extra capacitor is thus an additional protection.

Huh  ???
What kind of noise level would you need to overcome a 10K pull-up  :o

Dave.
 

Offline Psi

  • Super Contributor
  • ***
  • Posts: 6888
  • Country: nz
Re: Lab Power Supply Design Part 5
« Reply #4 on: January 03, 2012, 06:49:50 pm »
Could use a relay instead of the fet to bypass the ucurrent section and eliminate the fet rson drop.

However i don't really like things that click all the time when moving the controls.
So i'd probably stick with the fet for now, the vdrop is so small its probably the best option.

Replacing it with a relay is simple enough if its ever needed
« Last Edit: January 03, 2012, 06:53:25 pm by Psi »
Greek letter 'Psi' (not Pounds per Square Inch)
 

Offline shebu18

  • Frequent Contributor
  • **
  • Posts: 307
  • Country: ro
Re: Lab Power Supply Design Part 5
« Reply #5 on: January 03, 2012, 06:53:37 pm »
Is it ok if we use 10k 1% instead of 10k 0.1%?
 

Offline EEVblog

  • Administrator
  • *****
  • Posts: 28378
  • Country: au
    • EEVblog
Re: Lab Power Supply Design Part 5
« Reply #6 on: January 03, 2012, 06:58:10 pm »
I see you share the ISP and the DAC SPI (and plan to put the ADC on the same ISP bus, too). This can in principle be done. However, a lot of AVR ISP programmers are a little bit allergic when the ISP interface is shared. I recommend you have a look at Atmel's application note AVR042, section 4.1.1 http://www.atmel.com/atmel/acrobat/doc2521.pdf for the official way to handle this.

I only have input pins on other chips (DAC-D, DAC-CK, ADC-CS) connected to the SPI lines, so I can't see how they can interfere with the ISP?
So it's only one extra CMOS gate input loading on each line, surely not an issue?

Dave.
 

Offline Psi

  • Super Contributor
  • ***
  • Posts: 6888
  • Country: nz
Re: Lab Power Supply Design Part 5
« Reply #7 on: January 03, 2012, 07:00:20 pm »
Is it ok if we use 10k 1% instead of 10k 0.1%?

You can get issues with the opamps if their resistor values don't match since they control the gain.
Less accurate resistors mean less accurate gain, so you introduce errors.  (eg if it's supposed to be a gain of 5 you might end up with 5.05)
But yes, it will work with 1%, just won't be as accurate :)

If you have lots of 1% resistors you could go through them and find ones with matching values to use on the opamps.
That would be a good solution to your problem if you have lots of 1% resistors you want to use.
« Last Edit: January 03, 2012, 07:09:43 pm by Psi »
Greek letter 'Psi' (not Pounds per Square Inch)
 

Offline EEVblog

  • Administrator
  • *****
  • Posts: 28378
  • Country: au
    • EEVblog
Re: Lab Power Supply Design Part 5
« Reply #8 on: January 03, 2012, 07:08:49 pm »
Is it ok if we use 10k 1% instead of 10k 0.1%?

Sure.
My aim with 0.1% is so that hopefully you won't have to trim any potential errors in software and there is as little absolute tolerance error as possible without fuss, i.e. their tolerance is better than the voltage reference used.
As PSI said, you can hand match them if you like, or use 1% and be happy with any potential absolute error.

Dave.
 

Offline IanB

  • Super Contributor
  • ***
  • Posts: 9394
  • Country: us
Re: Lab Power Supply Design Part 5
« Reply #9 on: January 03, 2012, 07:12:11 pm »
Could use a relay instead of the fet to bypass the ucurrent section and eliminate the fet rson drop.

However i don't really like things that click all the time when moving the controls.
So i'd probably stick with the fet for now, the vdrop is so small its probably the best option.

Replacing it with a relay is simple enough if its ever needed

What kind of resistance might you expect across a typical relay contact? I have measured a high current mechanical switch at about 1.5 milliohms and an ordinary metal face-to-face contact point at about 5 milliohms. Would the relay need to have gold plated contacts to achieve a good low contact resistance?
I'm not an EE--what am I doing here?
 

Offline Psi

  • Super Contributor
  • ***
  • Posts: 6888
  • Country: nz
Re: Lab Power Supply Design Part 5
« Reply #10 on: January 03, 2012, 07:39:53 pm »
Could use a relay instead of the fet to bypass the ucurrent section and eliminate the fet rson drop.

However i don't really like things that click all the time when moving the controls.
So i'd probably stick with the fet for now, the vdrop is so small its probably the best option.

Replacing it with a relay is simple enough if its ever needed

What kind of resistance might you expect across a typical relay contact? I have measured a high current mechanical switch at about 1.5 milliohms and an ordinary metal face-to-face contact point at about 5 milliohms. Would the relay need to have gold plated contacts to achieve a good low contact resistance?

True
Greek letter 'Psi' (not Pounds per Square Inch)
 

Offline firewalker

  • Super Contributor
  • ***
  • Posts: 2313
  • Country: gr
Re: Lab Power Supply Design Part 5
« Reply #11 on: January 03, 2012, 08:38:12 pm »
Really, really good blog Dave.

Is there a link for the schematics. Like a pdf?

Alexander.
Become a realist, stay a dreamer.

 

Offline EEVblog

  • Administrator
  • *****
  • Posts: 28378
  • Country: au
    • EEVblog
Re: Lab Power Supply Design Part 5
« Reply #12 on: January 03, 2012, 08:40:37 pm »
Is there a link for the schematics. Like a pdf?

In the Youtube description:
http://eevblog.com/uploads/uSupplyBenchRevA.pdf

Dave.
 

Offline firewalker

  • Super Contributor
  • ***
  • Posts: 2313
  • Country: gr
Re: Lab Power Supply Design Part 5
« Reply #13 on: January 03, 2012, 08:43:14 pm »
Oh...  :-[ :-[ :-[

Alexander.
Become a realist, stay a dreamer.

 

Offline EEVblog

  • Administrator
  • *****
  • Posts: 28378
  • Country: au
    • EEVblog
Re: Lab Power Supply Design Part 5
« Reply #14 on: January 03, 2012, 09:00:31 pm »
Oh...  :-[ :-[ :-[

No one ever reads those!  ;D

Dave.
 

Offline Armin_Balija

  • Regular Contributor
  • *
  • Posts: 161
  • Country: 00
Re: Lab Power Supply Design Part 5
« Reply #15 on: January 03, 2012, 09:07:40 pm »
And just when I went ahead and ordered the IC's for your older videos! I guess I've got my work cut out for me.. I hope I can put it all together myself.. I guess everyone else is comfortable with this level of detail but it's a bit intimidating to me. I'll try it anyway though.

Again, thanks Dave, we all appreciate the hard work you put into this.
 

Offline shebu18

  • Frequent Contributor
  • **
  • Posts: 307
  • Country: ro
Re: Lab Power Supply Design Part 5
« Reply #16 on: January 03, 2012, 09:41:51 pm »
Dave, can you put a link to a rotary encoder you have used? I find only explications and examples of them.

Thanks.

LE: Thank you!
« Last Edit: January 03, 2012, 10:56:57 pm by shebu18 »
 

Offline EEVblog

  • Administrator
  • *****
  • Posts: 28378
  • Country: au
    • EEVblog
Re: Lab Power Supply Design Part 5
« Reply #17 on: January 03, 2012, 10:47:01 pm »
Dave, can you put a link to a rotary encoder you have used? I find only explications and examples of them.

http://search.digikey.com/us/en/products/EN12-VN20AF20/987-1197-ND/2408775

Dave.
 

Offline firewalker

  • Super Contributor
  • ***
  • Posts: 2313
  • Country: gr
Re: Lab Power Supply Design Part 5
« Reply #18 on: January 03, 2012, 11:14:15 pm »
Dave just noticed you was going to use PB6,PB7 for SPI communication with th ADC. Did you implemented a soft SPI?

Alexander.
Become a realist, stay a dreamer.

 

Offline metalphreak

  • Frequent Contributor
  • **
  • Posts: 815
  • Country: au
  • http://d.av.id.au
    • D.av.id.AU
Re: Lab Power Supply Design Part 5
« Reply #19 on: January 04, 2012, 05:21:17 am »
I was considering making my own uCurrent after the latest batch sold out so fast, but integrating it into a power supply is a brilliant idea :D

I too came across all the microchip ADC/DACs due to their low prices, but I was disappointed to see no quad input ADCs from them with I2C :( Using I2C is great from a modularity point of view. You can very easily expand to a dual/triple output supply without needing more microcontroller I/Os, and the code change is trivial (simple address change - no overlapping pins).

The Analog Devices AD7998 seems perfect for a dual output supply. Once setup you can read all 8 channels with one address/write byte + command byte, followed by one address/read byte and 16 read bytes (it just samples ch1, ch2, etc in order). For each output, I would sample current, uCurrent, output voltage BEFORE an output enable mosfet, and Vsense (either seperate terminal, or on the actual output connector, or switchable...). The AD7994 is a 4ch version.

Input voltage could simply be measured using the microcontrollers ADC as high accuracy isn't necessary.

For a i2c DAC I was going to go with the microchip MCP4728. Has an internal 2.048v Vref with a selectable x1 or x2 gain (handy for extended voltage ranges) but its accuracy is only +/- 2% with 45ppm/C...

For a micro I was going to go with a PIC18F4550 for a few reasons.

1) I've used them in the past :P
2) Hardware i2c, serial, and USB2.0 (all usable at once I believe)
3) Microchip USB stack and bootloader make it incredibly easy to do firmware updates over usb, or emulate a COM/Serial port over USB. Their framework and examples make it incredibly easy to get USB comms working.
4) Plenty of I/O leftover for "stuff"

Also comes in a DIP40 package although some of the other parts i've chose are SMD parts only. I'll be going for TQFP package myself since I've got a few of them leftover from a previous project.

I figured with I2C, you could build modular boards that have all the DAC/ADC/Vreg stuff, and a single control board. Thanks to Dave making his design open source other's can do things a little bit different :)

Also, for the main power supply, would it be reasonable to use something like an 15-18V switchmode supply? I want something I can mount internally instead of using an external jack, and AC transformers are so expensive!

Any thoughts, comments, glaringly obvious silly things? 
« Last Edit: January 04, 2012, 05:50:31 am by metalphreak »
 

Offline Nick Gammon

  • Contributor
  • Posts: 41
  • Country: au
    • Gammon Software Solutions
Re: Lab Power Supply Design Part 5
« Reply #20 on: January 04, 2012, 07:33:39 am »
Dave, one quick suggestion as you are running out of pins, if you have to use the reset pin to drive an LED ...

Your four switches (PB1 to PB4) ... one way of doing that without four pins is to set them up, via resistors as voltage dividers, to a single analog pin (you are using an analog pin anyway). The simple method (same value resistors) could give ambiguous results if multiples switches are pressed at once (I don't know if this would matter to you). With different value resistors (eg. powers of 2) you could deduce from the resulting analog level which combinations must have been pressed. So that frees up three pins.
 

Offline firewalker

  • Super Contributor
  • ***
  • Posts: 2313
  • Country: gr
Re: Lab Power Supply Design Part 5
« Reply #21 on: January 04, 2012, 07:56:25 am »
Charlieplexing is also a potential.

Alexander.
Become a realist, stay a dreamer.

 

Offline Rutger

  • Regular Contributor
  • *
  • Posts: 201
  • Country: us
Re: Lab Power Supply Design Part 5
« Reply #22 on: January 04, 2012, 08:05:47 am »
Hi, this might be a wacky idea, but how difficult would it to add a function generator option that turns the dc output specs into an ac output with the same specs (like voltage 5 VDC to 5 V peak-to-peak at a set current).

Rutger
 

alm

  • Guest
Re: Lab Power Supply Design Part 5
« Reply #23 on: January 04, 2012, 08:33:36 am »
( Using I2C is great from a modularity point of view. You can very easily expand to a dual/triple output supply without needing more microcontroller I/Os, and the code change is trivial (simple address change - no overlapping pins).

The Analog Devices AD7998 seems perfect for a dual output supply. Once setup you can read all 8 channels with one address/write byte + command byte, followed by one address/read byte and 16 read bytes (it just samples ch1, ch2, etc in order). For each output, I would sample current, uCurrent, output voltage BEFORE an output enable mosfet, and Vsense (either seperate terminal, or on the actual output connector, or switchable...). The AD7994 is a 4ch version.
One issue with this is that all outputs will share a common ground. In typical lab supplies, all outputs are floating. Isolating an I2C interface is somewhat complex. NXP has an appnote which basically involves two I2 transceivers with some optos in between. There are also some specialized I2C RF isolators by AD and others.
 

Offline JimmyM

  • Regular Contributor
  • *
  • Posts: 93
Re: Lab Power Supply Design Part 5
« Reply #24 on: January 04, 2012, 10:19:08 am »
Heck just go with a mega324! Scads of pins! Just bring out the unused pins to PTH pads. Voila!
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf