• # EEVblog #225 – Lab Power Supply Design Part 4 – PWM Control

The 4th installment in the lab power supply design series. This time Dave shows you how to control the supply with a Pulse Width Modulation (PWM) signal, and chose the correct filter values.

Be Sociable, Share!

## EEVblog #822 – World’s Worst Tablet Computer Teardown

WARNING: You cannot un-see the dodginess inside this Esinomed Infoview Medical Tablet Computer! Forum HERE ...

• HuanFai

Hi Dave,
you said some of the opamp cant go to 0V, is it good to use a high current reference and MOSFET output type MOSFET Driver to output the PWM pulses and use multiple RC filter to optain lower voltage to get the output analog signal better?
HuanFai

• Jim

You need to glue that 10-turn pot down. A little spot of hot glue aught to fix ‘er.

• http://www.eevblog.com EEVblog

It was, it broke!

• Simon

Hi Dave.

I have a small nit-pick about your calculations, I think you made a fencepost error at around 7:42.

An 8-bit PWM allows you to select 256 steps between 0V and 5V *including* the top and bottom boundary. That is, you divide the voltage range into 255 intervals.

So the interval is 100%/255 = .392% or 5V/255 = 19.6mV.

Not that it really matters…

Bye,
Simon

• bfritz

The correct number for the resolution of the DAC will matter when it comes time to write firmware/software!

• Chris

No, it should be divided by 256, not 255.
0-255 represents 256 discrete values, so each step is 1/256

• bfritz

Chris, Let me make this easy for you…

Assume you have a two bit DAC, with 1V full scale. According to you, 2^2=4, so 1/4 = 0.25V per bit.

So the 4 states are:
0 = 0.00V
1 = 0.25V
2 = 0.50V
3 = 0.75V

Note how that doesn’t work!

Resolution is always Vfs / (2^n – 1)

So for our 2 bit DAC example:
Vfs / (2^n – 1)= 1 /( 2^2 – 1 )= 0.33
0 = 0.00V
1 = 0.33V
2 = 0.67V
3 = 1.00V

• Henry Outram

Actually, there are 257 outputs to an 8 bit PWM signal, (0-255)*V and V itself. This includes both fence posts. Therefor each count of the PWM = V/256.

• http:www.toddfun.com Todd Harrison

I can’t say it enough, your videos and tutorials are the BEST! These last 4 on making a power supply have been so informative. Not just “how to make voltage & current limiting adjustable power supply” but all the details on design, pitfalls and anomalies one has to understand in order to approach such design. Keep up the great work! I learn so much from the material you share. I sure could have used a teacher like you 25 years ago when I was taking EE.

• http://none Allan

Great video, DAVE! Your trick of adding a second, twin low-pass RC filter for a greater roll-off than -20dB/decade of high-frequency noise.
I LUV IT!!!

• Michael K.

Hi Dave,

what a great course. Your informations around and in depth are perfect at the point. Thanks again for the EEVBlog!

Just right for me because I work right now on an +/-15V fixed output voltage power supply replacement for an vintage (around 30 years old) analog synthesizer. In addition to the normal requirements I think about extra secure fault behavior. Because of the very rare chips inside these old synths. And the power supply should work at least the next 30 years. 😉

Michael

BTW: I found this easy 5(!) part only power supply design. 😉
http://www.elo-formel-datenbank.de/Beitraege/Netzteile/FET_Netzteil_reg_5BE.htm

• ac

Could you do a video simulating this circuit on Simetrix? It’s the same simulator in Altium AFAIK but the UI is much nicer. I think their free version is bar none best learning tool for beginners and the program is liked by power supply people.

• http://www.eevblog.com EEVblog

Never heard of it.
LTspice is almost certainly the most popular free simulator on the market.

Dave,

I’m currently working on a very simple PWM based audio generator using the Parallax Propeller microcontroller. Up to now I’ve got the PWM working and now the next step is to work out the filtering method to convert the square wave into a nice smooth curved wave.

Anyway, I followed along with your LT Spice demonstration and actually got to the point where I had a working 2 pole + opamp filter working! I’ve never used LTSpice before (because it’s pretty scary for a noob).

How you can freestyle this awesome content off the top of your head I’ll never know – that’s a talent mate.

You are helping a lot of people with this stuff – I love it!

• Pingback: Younker Youtube Yarling | The Amp Hour()

• http://WWW.MrNixie.com Laurence

Dave, this is excellent stuff. The mark of a good teacher must be that the student sits there thinking, “Yeah, well I knew all that” without realising that they’ve only *just* learned it.

OK – I have followed the whole series, and it is most useful. But 5V? An Amp? We want POWER! We can double up the main device for greater currents as you say (yet to see an LT3083 in the wild – anyone??) but what about supplying voltages up to 40V? the input may need to float to over 50V to support that, at which point your LT308x will be TOAST.

So, how can we extend these numbers that you have shown us?

• http://www.eevblog.com EEVblog

Countless high power supplies available very cheaply, this is more niche, and you’ll see why in coming videos.

• http://callanbryant.co.uk/ Callan

Hi Dave,

Could you please send the RCfilter.asc file to me or link it? I would like to play around with that circuit.

Thanks for the great video!

• Pingback: ccn2785xdnwdc5bwedsj4wsndb()

• Pingback: xcmwnv54ec8tnv5cev5jfdcnv5()