### Author Topic: Power supply part 4  (Read 43266 times)

0 Members and 1 Guest are viewing this topic.

#### jahonen

• Super Contributor
• Posts: 1045
• Country:
##### Re: Power supply part 4
« Reply #25 on: December 05, 2011, 01:01:51 am »
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 05, 2011, 01:10:54 am by jahonen »

#### slateraptor

• Frequent Contributor
• Posts: 833
• Country:
##### Re: Power supply part 4
« Reply #26 on: December 05, 2011, 01:32:39 am »
The first stage if you consider it connected to a non-negligible load :
$H_1(j \omega) = \frac{Z_{in2}(j\omega)||\frac{1}{j\omega C_1}}{R_1 + \left( Z_{in2}(j\omega)||\frac{1}{j\omega C_1} \right)} = \frac{1}{1 + j\omega R_1 C_1 + \frac{R_1}{Z_{in2}(j\omega)} }$

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.

#### leniwiec

• Contributor
• Posts: 28
##### Re: Power supply part 4
« Reply #27 on: December 05, 2011, 01:43:29 am »
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

#### ivan747

• Super Contributor
• Posts: 2010
• Country:
##### Re: Power supply part 4
« Reply #28 on: December 05, 2011, 01:58:58 am »
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?

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, 01:45:52 pm by ivan747 »
Nothing like the smell of rosin core solder in the morning.
"Could you not use some of that crowdfunded $1.5 million to hire a graphic designer who understands perspective?" -Delta "A soldering station I bought once had a sticker on it that said, I shit you not, 'QENUINE'." -c4757p #### jahonen • Super Contributor • Posts: 1045 • Country: ##### Re: Power supply part 4 « Reply #29 on: December 05, 2011, 02:19:31 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!). 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 05, 2011, 02:21:56 am by jahonen » #### RJSC • Regular Contributor • Posts: 125 • Country: ##### Re: Power supply part 4 « Reply #30 on: December 05, 2011, 10:26:22 am » 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). #### george graves • Super Contributor • Posts: 1259 • Country: ##### Re: Power supply part 4 « Reply #31 on: December 05, 2011, 03:43:56 pm » 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, 03:50:35 pm by george graves » #### IanJ • Supporter • Posts: 932 • Country: • Pro EE guy many years ago, now a hobby/home biz. ##### Re: Power supply part 4 « Reply #32 on: December 08, 2011, 05:55:38 am » 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? 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 #### JimmyM • Regular Contributor • Posts: 93 ##### Re: Power supply part 4 « Reply #33 on: December 09, 2011, 04:41:06 am » 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. #### Frant • Regular Contributor • Posts: 54 ##### Re: Power supply part 4 « Reply #34 on: December 12, 2011, 12:09:21 pm » 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. #### ejeffrey • Super Contributor • Posts: 1736 • Country: ##### Re: Power supply part 4 « Reply #35 on: December 12, 2011, 08:53:01 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!). 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. #### EEVblog • Administrator • Posts: 28128 • Country: ##### Re: Power supply part 4 « Reply #36 on: December 12, 2011, 11: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. #### JimmyM • Regular Contributor • Posts: 93 ##### Re: Power supply part 4 « Reply #37 on: December 12, 2011, 11:34:08 pm » Sounds exactly like my design Part 5 coming soon... Dave. Anxiously awaiting. #### ivan747 • Super Contributor • Posts: 2010 • Country: ##### Re: Power supply part 4 « Reply #38 on: December 13, 2011, 02:45:28 am » 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? Nothing like the smell of rosin core solder in the morning. "Could you not use some of that crowdfunded$1.5 million to hire a graphic designer who understands perspective?" -Delta
"A soldering station I bought once had a sticker on it that said, I shit you not, 'QENUINE'." -c4757p

#### JimmyM

• Regular Contributor
• Posts: 93
##### Re: Power supply part 4
« Reply #39 on: December 13, 2011, 04:18:17 am »
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.

#### EEVblog

• Posts: 28128
• Country:
##### Re: Power supply part 4
« Reply #40 on: December 13, 2011, 08:53:41 am »
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.

#### baljemmett

• Supporter
• Posts: 666
• Country:
##### Re: Power supply part 4
« Reply #41 on: December 13, 2011, 09:34:57 am »
Plenty of videos to do yet I think...

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

#### firewalker

• Super Contributor
• Posts: 2313
• Country:
##### Re: Power supply part 4
« Reply #42 on: December 13, 2011, 09:36:57 am »

I am hoping for DIP packages...

Alexander.
Become a realist, stay a dreamer.

#### IanB

• Super Contributor
• Posts: 9366
• Country:
##### Re: Power supply part 4
« Reply #43 on: December 13, 2011, 10:52:55 am »
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?

#### EEVblog

• Posts: 28128
• Country:
##### Re: Power supply part 4
« Reply #44 on: December 13, 2011, 12:36:21 pm »
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.

#### caroper

• Regular Contributor
• Posts: 193
• Country:
##### Re: Power supply part 4
« Reply #45 on: December 23, 2011, 12:03:53 am »
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

#### JimmyM

• Regular Contributor
• Posts: 93
##### Re: Power supply part 4
« Reply #46 on: December 23, 2011, 12:19:03 am »
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?

#### firewalker

• Super Contributor
• Posts: 2313
• Country:
##### Re: Power supply part 4
« Reply #47 on: December 23, 2011, 12:27:14 am »
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.

#### RJSC

• Regular Contributor
• Posts: 125
• Country:
##### Re: Power supply part 4
« Reply #48 on: December 23, 2011, 12:55:34 am »
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 23, 2011, 01:38:36 am by RJSC »

#### RJSC

• Regular Contributor
• Posts: 125
• Country:
##### Re: Power supply part 4
« Reply #49 on: December 23, 2011, 12:59:50 am »
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.