Author Topic: Power supply part 4  (Read 44551 times)

0 Members and 1 Guest are viewing this topic.

Offline jahonen

  • Super Contributor
  • ***
  • Posts: 1046
  • Country: fi
Re: Power supply part 4
« Reply #25 on: December 04, 2011, 02:01:51 pm »
I don't think one can just ignore the input impedance of the second stage. Here is a simulation and comparison to a transfer functions represented here. They match perfectly for each case and shows that if one puts ideal buffer (SPICE E-component, or VCVS) between stages, then the direct cascade assumption holds.

I think that math is a good thing in general but I like application oriented way, so that when I get a mathematical description of the problem done (this can't be easily done by a computer), I'd prefer to use brute force of CAS to solve it, just to avoid page(s) full of just dummy algebraic manipulations which are quite error prone and I hate discovering stupid error three pages later...

Edit: It seems that I mistyped the frequency in Maple, but not a great amount. :)

Regards,
Janne
« Last Edit: December 04, 2011, 02:10:54 pm by jahonen »
 

Offline slateraptor

  • Frequent Contributor
  • **
  • Posts: 833
  • Country: us
Re: Power supply part 4
« Reply #26 on: December 04, 2011, 02:32:39 pm »
The first stage if you consider it connected to a non-negligible load :


Ahh, yes. I see where you're coming from and rescind my argument. Indeed, I was approximating way too much. Good show on putting me in my place.

@jahonen: Simulated and got the same results. But I see exactly where tnt is coming from now and he's without a doubt correct.
 

Offline leniwiec

  • Contributor
  • Posts: 28
    • EE & IT Blog
Re: Power supply part 4
« Reply #27 on: December 04, 2011, 02:43:29 pm »
As dave said, use a real DAC.  Filtering PWM is cheap and easy, but very low performance.  It is fine for generating low resolution DC signals, but if you need anything fancy a DAC is what you want.  Even a cheap DAC will outperform the PWM signal by a lot.  That said, designing a control loop with a microprocessor in the feedback loop is significantly more complicated to get right.  It takes some effort to have anywhere near as fast of a response time as a cheap op-amp and guaranteeing stability is considerably harder due to the latencies involved.

Yes, I am currently using DAC (r2r), but I just wondering, because theoretically we can calculate it from 1 signal period... only hardware implementation of this may be very hard. 

These power supplies are floating and only connected to the + and - terminals.  The ground terminal is simply connected to the chassis ground and to the mains earth connection.  They are generally provided with clips that let you short either the + or the - output to ground in order to make a positive or negative voltage supply.  All current is returned to the - output, only leakage current from the powered device flows through the ground pin.

Uh, so they really not so much symmetrical ;)
 

Offline ivan747

  • Super Contributor
  • ***
  • Posts: 2013
  • Country: us
Re: Power supply part 4
« Reply #28 on: December 04, 2011, 02:58:58 pm »
All this PWM filter stuff is a bit meh. It would look far more impressive to attach a stepper motor to the ten turn pot and control the stepper motor from the micro  ;)

Just like on those expensive Hi-Fi's where people want to see the knob spin at their command from the chair huh?  ;D

Dave.

Yup. I took an old stereo apart just to get that part. It's not a stepper motor, though; just a common DC one. There is no electronic feedback because you choose when to stop, so you are part of the feedback system, actually. There must be some current limiter for the DC motor on that circuit, though.
« Last Edit: December 05, 2011, 02:45:52 am by ivan747 »
 

Offline jahonen

  • Super Contributor
  • ***
  • Posts: 1046
  • Country: fi
Re: Power supply part 4
« Reply #29 on: December 04, 2011, 03:19:31 pm »
I have wondered why there are no delta-sigma modulators in a MCU for DA conversion, it would be easier to filter than a PWM (as the noise would be at higher frequency), and further, the noise would be random noise, instead of discrete tone + harmonics that of PWM. All 1-bit audio DACs work with this principle (I'm listening one as I write this via my headphones and it works great!).

But anyway, if the noise performance is a great concern, I'd go to a DAC solution (I think that it is not _that_ expensive) without any hesitation as it makes much easier to get rid of the supply induced noise in the MCU (output logic voltages are not clean even if fed from voltage reference) due to ground bounce/VCC droop in ground/VCC bond wires etc.

Regards,
Janne
« Last Edit: December 04, 2011, 03:21:56 pm by jahonen »
 

Offline RJSC

  • Regular Contributor
  • *
  • Posts: 125
  • Country: pt
Re: Power supply part 4
« Reply #30 on: December 04, 2011, 11:26:22 pm »
Any reason why using a digital pot wasn't an option?

I'm thinking of modding an off the shelf, coarse/fine typical bench top supply with some digital pots - mostly to give me programmable features.  Any thoughts?

I was thinking about it to.
Any reason we shouldn't?

A supply only with one pot would be more suitable to mod.
One problem on modding an off the shelf supply could be that I don't know of any digital pot that can be floatting (MCU ground and one terminal of the POT must be tied, because of the internal CMOS switch).
 

Offline george graves

  • Super Contributor
  • ***
  • Posts: 1259
  • Country: us
Re: Power supply part 4
« Reply #31 on: December 05, 2011, 04:43:56 am »
I was thinking about it to.
Any reason we shouldn't?

A supply only with one pot would be more suitable to mod.

Dave mentioned in the Constant current dummy load video, that it's often done with two pots in series.  So, you might be able to replace both with a single digital pot?

One problem on modding an off the shelf supply could be that I don't know of any digital pot that can be floatting (MCU ground and one terminal of the POT must be tied, because of the internal CMOS switch).

Hmmmm - I'm a noob - and have only played with digital pots - but something like this can't be used?

http://www.maxim-ic.com/datasheet/index.mvp/id/2676

That chip is only 256 values....but I'd assume there would be a 10-bit type digital pot?

I could see adding a few rotary encoders, an character LCD and a keypad to make a poor-man's, single channel version of something like this:



Based around an arduino, and something like this:



The goal  (for me) would be to have a power supply that I could store a few values in and press a button to recall them.  Also the ability to "type" in a value quickly.  "3.3v" or "10.111v" - I think it would be very hand to have to simulate sensor outputs and quickly calibrate a device based on two different voltages- quickly switching between a few voltages - rather then having to manually dial in a voltage over and over again.

« Last Edit: December 05, 2011, 04:50:35 am by george graves »
 

Offline IanJ

  • Supporter
  • ****
  • Posts: 992
  • Country: scotland
  • Pro EE guy many years ago, now a hobby/home biz.
    • IanJohnston.com
Re: Power supply part 4
« Reply #32 on: December 07, 2011, 06:55:38 pm »
All this PWM filter stuff is a bit meh. It would look far more impressive to attach a stepper motor to the ten turn pot and control the stepper motor from the micro  ;)

Just like on those expensive Hi-Fi's where people want to see the knob spin at their command from the chair huh?  ;D

Dave.

Yup. I took an old stereo apart just to get that part. It's not a stepper motor, though; just a common DC one. There is no electronic feedback because you choose when to stop, so you are part of the feedback system, actually. There must be some current limiter for the DC motor on that circuit, though.

I converted an old analogue Denon amplifier by using DC motor and a small H-bridge circuit driven via an Arduino. Input via a small IR detector that picks up the VOL UP/DN on my remote.
Current limiting is done at the supply to the H-bridge taking into consideration FET RDS(on).......everything set up safe so that in the event say both FETs on left side of the H-bridge turn on at same (say the Arduino crashes!) then then nothing is overdriven.......no smoke!

I use it every day.

Ian.
Ian Johnston
www.ianjohnston.com
Manufacturer of the PDVS2 & PDVS2mini
 

Offline JimmyM

  • Regular Contributor
  • *
  • Posts: 93
Re: Power supply part 4
« Reply #33 on: December 08, 2011, 05:41:06 pm »
I really enjoyed the 4 part series. I like the design a lot. I may start going through the design process to see if I could build something similar with a slightly larger range.
One thing did bother me though. Using pots is fine to adjust because you move the pot until the output reads what you want. However, the uC doesn't know if the output is really what you want it to be. But you could have a calibration procedure. The uC can read the output via ADC and adjust an internal calibration matrix so that when it says to output 3.3V worth of PWM, the output is actually 3.3V.

One thing though. 12-bit PWM using the internal 8MHz oscillator in an AVR will only do 8MHz/4096 ~= 1.9kHz. So even with an external 16MHz crystal, you can only get 3.8 kHz PWM at 12-bits. So an external DAC would be needed to get a clean DC signal without a lot of extra filtering. DACs aren't all that expensive. Some even have an internal reference. the price difference between 12-bit and 16-bit DACs is small, so why not go for a 16-bit SPI or I2C driven DAC and be able to get fine control and calibration of the output.

Just thinking out loud.
 

Offline Frant

  • Regular Contributor
  • *
  • Posts: 54
Re: Power supply part 4
« Reply #34 on: December 12, 2011, 01:09:21 am »
Ahh, yes. I see where you're coming from and rescind my argument. Indeed, I was approximating way too much. Good show on putting me in my place.

The two stages of the filter obviously interact with each other, which is inherent to this topology. What can be done is to choose the component values differently in order to minimize the loading of the first stage. For instance, in the second stage the values can be R=100k and C=10n. If you run your simulation with these values, you'll see the improvement.
 

Offline ejeffrey

  • Super Contributor
  • ***
  • Posts: 1938
  • Country: us
Re: Power supply part 4
« Reply #35 on: December 12, 2011, 09:53:01 am »
I have wondered why there are no delta-sigma modulators in a MCU for DA conversion, it would be easier to filter than a PWM (as the noise would be at higher frequency), and further, the noise would be random noise, instead of discrete tone + harmonics that of PWM. All 1-bit audio DACs work with this principle (I'm listening one as I write this via my headphones and it works great!).

A few MCUs do have true DACs.  Some of the PIC line have general purpose D/A converters, and analog devices has a few as well.  In the SOC class of embedded processors onboard audio DACs are pretty standard.  They are not always suitable for control applications, but as long as they can be DC coupled they should be OK for providing an operating set point.

Anyway, if you are desperate to save a few cents, but PWM isn't good enough, you can actually make a 1st order sigma-delta modulator in software.  You just set the PWM resolution for (say) 8 bits at a higher frequency, but keep a 12 bit control word.  Then keep a software error accumulator that keeps track of the quantization error and updates the PWM width every cycle.  You will still see low frequency ripple because this is a 1st order modulator, but most of the noise power will be pushed up into the higher frequencies and be easier to filter, and the response time will be much faster.  IMHO, not really worth it compared to just putting in a cheap DAC.
 

Online EEVblog

  • Administrator
  • *****
  • Posts: 29700
  • Country: au
    • EEVblog
Re: Power supply part 4
« Reply #36 on: December 12, 2011, 12:15:51 pm »
Hmmmm - I'm a noob - and have only played with digital pots - but something like this can't be used?

http://www.maxim-ic.com/datasheet/index.mvp/id/2676

That chip is only 256 values....but I'd assume there would be a 10-bit type digital pot?

The most common type is 256 step, but you can get 1024 step ones. IIRC I have never sen higher.
Digital pots also have a low max supply voltage, mostly TTL type range, only a few have say 12V or greater.
No problem in my circuit configuration because one of the advantages of it is the ground referenced control voltage design. But harder to use digital pots in higher voltage designs where sometime the pot isn't ground referenced.

Quote
The goal  (for me) would be to have a power supply that I could store a few values in and press a button to recall them.  Also the ability to "type" in a value quickly.  "3.3v" or "10.111v" - I think it would be very hand to have to simulate sensor outputs and quickly calibrate a device based on two different voltages- quickly switching between a few voltages - rather then having to manually dial in a voltage over and over again.

Sounds exactly like my design  ;)
Part 5 coming soon...

Dave.
 

Offline JimmyM

  • Regular Contributor
  • *
  • Posts: 93
Re: Power supply part 4
« Reply #37 on: December 12, 2011, 12:34:08 pm »

Sounds exactly like my design  ;)
Part 5 coming soon...

Dave.

Anxiously awaiting.
 

Offline ivan747

  • Super Contributor
  • ***
  • Posts: 2013
  • Country: us
Re: Power supply part 4
« Reply #38 on: December 12, 2011, 03:45:28 pm »

Sounds exactly like my design  ;)
Part 5 coming soon...

Dave.

Anxiously awaiting.

Looking forward to watching it. Is is going to be about the user interface and the MCU?
 

Offline JimmyM

  • Regular Contributor
  • *
  • Posts: 93
Re: Power supply part 4
« Reply #39 on: December 12, 2011, 05:18:17 pm »
I am SO building one of these. A couple of ADC connections from the Current amplifier and the Vout can calculate Wattage on an LCD.
 

Online EEVblog

  • Administrator
  • *****
  • Posts: 29700
  • Country: au
    • EEVblog
Re: Power supply part 4
« Reply #40 on: December 12, 2011, 09:53:41 pm »
Looking forward to watching it. Is is going to be about the user interface and the MCU?

Next video will probably be a few additions to the schematic, like the micro, ADC/DAC (yes, no PWM), and various current measurement stuff, and likely more datasheet and component selection stuff.
I just laid out the board and have a time lapse video of that, so I'll add some commentary and make a video.
Then there will likely be another on the system design and layout etc
Plus still another trick up my sleeve.
Plenty of videos to do yet I think...

Dave.
 

Offline baljemmett

  • Supporter
  • ****
  • Posts: 666
  • Country: gb
Re: Power supply part 4
« Reply #41 on: December 12, 2011, 10:34:57 pm »
Plenty of videos to do yet I think...

Excellent news -- I get the impression you're really enjoying this project!
 

Offline firewalker

  • Super Contributor
  • ***
  • Posts: 2328
  • Country: gr
Re: Power supply part 4
« Reply #42 on: December 12, 2011, 10:36:57 pm »






 ;D ;D ;D

I am hoping for DIP packages...

Alexander.
Become a realist, stay a dreamer.

 

Offline IanB

  • Super Contributor
  • ***
  • Posts: 9559
  • Country: us
Re: Power supply part 4
« Reply #43 on: December 12, 2011, 11:52:55 pm »
I am hoping for DIP packages...Alexander.

But some of us need an excuse to practice SMD soldering  ;)
I'm not an EE--what am I doing here?
 

Online EEVblog

  • Administrator
  • *****
  • Posts: 29700
  • Country: au
    • EEVblog
Re: Power supply part 4
« Reply #44 on: December 13, 2011, 01:36:21 am »
I am hoping for DIP packages...Alexander.

But some of us need an excuse to practice SMD soldering  ;)

Then you will both get your wish!
As mentioned on today's AmpHour, the PSU project is mostly through-hole, but a few SMD parts were unavoidable.

Dave.
 

Offline caroper

  • Regular Contributor
  • *
  • Posts: 193
  • Country: za
    • Take your PIC
Re: Power supply part 4
« Reply #45 on: December 22, 2011, 01:03:53 pm »
If I may add to the wish list.

Will the final design allow them to be connected in Series / paralleled / cascade configurations to provide more current, more voltage or a tracking +/- Supply?

It is often stated that it is cheaper to buy a good bench supply than to make one, but the joy of building it and understanding exactly how it works, thanks to your tutorials, is priceless. I would love to build this just for the practical experience and my power requirements, for the foreseeable future, are low. 12V at 500mA is more than I envisage needing, but if the PSU's are isolated then 2 could possibly give +/-12V at 500mA or 12V at ~1Amps or 24V at 500mA.

This will be a step up from my Velleman LAB1 PSU and a great addition to any hobby lab.
Any chance of releasing it in Kit form?

Good on you Mate.
I look forward to Part 5.

Cheers
Chris

Offline JimmyM

  • Regular Contributor
  • *
  • Posts: 93
Re: Power supply part 4
« Reply #46 on: December 22, 2011, 01:19:03 pm »
I'm hoping for an AVR based design instead of PIC. Just a personal preference. I have more experience with AVRs. But if it is with a PIC, I can certainly substitute an AVR in my version. I'm envisioning a few buttons, a rotary encoder, and a small LCD. What say you, Dave? Will you be doing an LCD?
 

Offline firewalker

  • Super Contributor
  • ***
  • Posts: 2328
  • Country: gr
Re: Power supply part 4
« Reply #47 on: December 22, 2011, 01:27:14 pm »
I am also hoping for a AVR design. Not because I don't like PICs. Because PIC programming under GNU/Linux...

Either way it would be trivial to "cross platform it".

Alexander.
Become a realist, stay a dreamer.

 

Offline RJSC

  • Regular Contributor
  • *
  • Posts: 125
  • Country: pt
Re: Power supply part 4
« Reply #48 on: December 22, 2011, 01:55:34 pm »
If I may add to the wish list.

Will the final design allow them to be connected in Series / paralleled / cascade configurations to provide more current, more voltage or a tracking +/- Supply?

It is often stated that it is cheaper to buy a good bench supply than to make one, but the joy of building it and understanding exactly how it works, thanks to your tutorials, is priceless. I would love to build this just for the practical experience and my power requirements, for the foreseeable future, are low. 12V at 500mA is more than I envisage needing, but if the PSU's are isolated then 2 could possibly give +/-12V at 500mA or 12V at ~1Amps or 24V at 500mA.

This will be a step up from my Velleman LAB1 PSU and a great addition to any hobby lab.
Any chance of releasing it in Kit form?

Good on you Mate.
I look forward to Part 5.

Cheers
Chris

If you write your own MCU firmware, tracking will be easy:
Build 2 identical floating PSUs and add an optoisolator to the microcontroller (use standard serial ASCII characters over the UART or custom protocol if you want) and send the current voltage from the master supply, and the slave should receive the data and track the master accordingly.

If you leave an optoisolated serial interface for computer control (useful for automated tests or extremely low frequency function generator) you can just connect the 2 supplies directly to one another and the master supply will issue commands as if it were the computer.
Or if you leave them connected to the computer, the computer can read the voltage from the master supply and send it to the slave, or you can have both a dedicated computer interface and tracking interface.

The key is the optical isolation on the communication so that you can connect the ground of one supply to the positive of another.

Now the difficult is to choose between all of this communication methods.

(I'm not a native english speaker, so, if it sounds confuse, feel free to ask for clarification)
« Last Edit: December 22, 2011, 02:38:36 pm by RJSC »
 

Offline RJSC

  • Regular Contributor
  • *
  • Posts: 125
  • Country: pt
Re: Power supply part 4
« Reply #49 on: December 22, 2011, 01:59:50 pm »
I am also hoping for a AVR design. Not because I don't like PICs. Because PIC programming under GNU/Linux...

Either way it would be trivial to "cross platform it".

Alexander.

Well, there's good news for you!  :)

Quote
    After a long beta testing period Microchip finally released MPLAB X V1.0.

    MPLAB X is the new  integrated development system for Microchip microcontrollers. It is built on the Java platform so Mac, Linux, and Windows users are supported. Here are some major features of MPLAB X:

        Based on Java / Netbeans.
        Supported under Windows, Linux and Mac OS X 10.5 and Mac OS X 10.6.
        Newer, more functional GUI.
        MPLAB C32 (for PIC32MX), C30 (for PIC24 and dsPIC), C18 compilers are available.
        HI-TECH C Lite Compiler for PIC18s, and HI-TECH C Lite Compiler for PIC10/12/16 are also available.

 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf