Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[SOLVED] DAC vs PWM+filter output voltage?

Status
Not open for further replies.

David_

Advanced Member level 2
Joined
Dec 6, 2013
Messages
573
Helped
8
Reputation
16
Reaction score
8
Trophy points
1,308
Location
Sweden
Activity points
12,219
Hello.
I am working on a power supply that as the EEVBLOG lab supply uses a signal from a microcontroller to adjust a voltage regulator.

A PWM signal trough a filter or a DAC will produce a voltage that will be amplified to adjust a voltage between 0V and 25v and feed to a voltage regulator, if 15 volts from the microcontroller+amplifier goes in to the regulator 15V comes out as a regulated voltage.
But the nois of the conroll volage will be inprinted on the regulator output amd i'm kind of lost regarding how i will produce the voltage.

In the end i will controll two rails with the voltage, one posetive related to ground and one negative.

Both rails have a max voltage of 25V so I'v decided that i need 12-bit resulution to adjust the voltage in 4096 steps, but i don't know if i should go for 12-bit PWM and filter it heavy or does a 12-bit DAC have the potential to output a clean DC voltage?

I am prepered to go to some lengths to get a realy clean output.
 

Hi,

By a rule of thumb..

12 bits of resolution gives a dynamic of about 12 x 6 dB = 72 dB.

Now you like the ripple after the filter to be less than one Lsb.
Therefore the filter has to attenuate the pwm frequency by 72dB.

Lets say you use a second order filter with 12dB/octave, then your cutoff frequency needs to be 6 octaves deeper than pwm frequency.

Lets assume pwm frequency to be 1kHz. Then your cutoff frequency has to be lower than 15Hz.

Finished.

Good luck
Klaus
 
  • Like
Reactions: David_

    David_

    Points: 2
    Helpful Answer Positive Rating
That helped a LOT, Thank you!

The microcontroller I will use does not support 12-bit pwm so i will need to controll another chip, but since i will need a second chip i wonder.
With the information i just recived i can figure out how well it will work with a external 12-bit PWM module, but i have found some very nice DACs. Is there any clear cut pros and cons conserning PWM+filter vs DAC regarding producing a clean accurate representation of the supply voltage?

If i went with a DAC i could use one with +-15V and skip the voltage amplifier stage, such as MAX532
https://datasheets.maximintegrated.com/en/ds/MAX532.pdf

The PWM alternativ are pretty much given to me through arduino library with TLC5940,
https://www.ti.com/lit/ds/symlink/tlc5940.pdf
I have not thought about it but this chip have constant current output but it shoulden't be a problem to translate the output current to voltage, or have i made a misstake in my resoning?

Any way its mostly a choise that need to be made, should i go with the PWM idea or should i go with the DAC idea. I'm leaning towards the MAX532 but since i don't realy know how to program any of the options today i wonder if anyone have any knowlage to help to make a preliminary decision?
Ether way i will have to learn much but i figure i'll choose i path and go with it, both option isn't cheap so some thought should proceed the decision, on my part:p
 

I found a cheap option to try out the max532 and i thought that i would supply it with +-15V and choose a referense voltage and produce that voltage to channel A ref with a positive polarity and the channel B ref with negative polarity and feed both channels the same code, i have no experience with these things but it appears to give me the same output voltage at both dacA output and dacB output but with opposite polarity.
And buffer the voltages by some sort of level shift arangement to get max +25V and min -25V or whatever the max voltage V+-0V-V- vs supply will be, and then feed the positive voltage to adjust a positive voltage regulator and the negative to adjust a negative voltage regulator.

Which would be
LT3081(positive 1,5A) and three parallelled LT3090(negative 600mA) they are designed to work well in parallel and they have current monotoring outputs, lt3090 have some more capabilitys than lt3081 but put current limmiting on that setup(credited) to EEVBLOG aswell and then voltage and current measuring with lcd display by some manner and then a big smile.

That is the goal at least and the only obsticle to really overcome is the implementation of the DAC(or pwm) stage, theres much to work out but the basic structure is done. But any and all thoughts are welcome

Edit// I don't really grasp how the DAC referens voltage works but something like what Iv'e proposed should work, I'm sure i will get it soon.
 

Hi,

Some hints for you:

Almost any microcontroller has built in pwm hardware, so i think this is the cheapest way. If the controller has a stable supply, not much varying load at the port pins and cmos output stage then you don't even need a cmos swith. But for sure, if you want precision, then i'd prefer a cmos switch combined wit a reference voltage.
The next better way will be the dac.

Nowadays refernce parts are good, cheap and easy to use (Vcc, gnd, out).

The max532 is a relatively old part, and it is one of the expensivest at farnell. There is no benifit with the +/-15 v supply instead of a - modern 3.3v or 5v supplied rail to rail dac. In both ways you need two external amplifier - as long as i understood your application right.
If you allways need one output that is the negative voltage of the other, then i'd use only one channel of dac.
In short. One dac with 0..3V output. One amplifer to get output 0 ..+25V, and another amplifier for the negative output.

How do you want to set the output voltage of lt3081?
What package of the lt3081 do you choose? With linear regulators you have much power dissipation, and therefore with the thermally best smd part you will get max 150ma outof the lt at low output voltages.

I dont know what load you want to connect, but maybe it's worth to consider a DC coupled bridge mode audio amplifer.
With that you can simply control the output voltage, there are a lot of parts that can deliver 1.5 A, very common and rugged...

I hope i don't confuse you with my thoughts..

Klaus
 
  • Like
Reactions: David_

    David_

    Points: 2
    Helpful Answer Positive Rating
No not at all, Some good points.

I'm not limited to AVR really but I have just begun to learn programming and the EEVBLOG project offers a good start to se how things are done and to modify to my own specs, its done with Arduino IDE but further down the path the idea is to write my own software i C or C++ cous i need to learn that for my education. But the microcontrollers i have to choose from does not support more than 10-bit PWM so thats out the window, the price of the max532 was an issue but I'm getting two chips as free sampel:)

Stil a have not finished the order jet cous I'm still considering options, but as i get them for free and i will still be needing dual rail supply seperat from the actual supply outputs i found it to be a nice but mostly more fun way to do it. The part have nice specs regarding errors, David behind the original project scraped the DAC stage and went with PWM becouse the DAC used had a Relative Accuracy of +-3LBS but the MAX532 i would get have only 1/2LBS error which seems quite nice.
Allthough i value the way to do it partly by learning opportunity the only things that matters in the end is the end result, if some way presents its self as to give bettet preformans that will be my choise.

It might just be that i have not done that kind of thing before but for some reason i would like to avoid seperatly amplifying the signal 5 or 8 times, it would recuire very precis resistors to get it just right?

As for the power dissipation, i will make heat sinking a priority and it will all be some sort of SMT arangment. But primarely i will use over +-10V but i have some thought of having low voltage and high voltage modes(along the way, the project is being built with further expansions in mind) så if i would require low voltage higer current i would switch down the voltage before the regulators.

One use of the supply will be to power varius dual rail experiments and i really want to get a accurate 0V between + and -, and i offen require someting in the neaborhood of +-15V. As for the future end result, the toroidal transformer i have purchesed a while back are rated if I'm not misstaken 300VA 28V-0-28V & a low current 0-12V. I did not know much about transformers when i checked some numbers but i think i decided that +-3A would be a possibility, i don't get along with numbers but i will sitt down and apply my since then new knowlage to figure out what the transformer should be capabel of.

The thoughts fan out and theres many different things that could impact the design but i do have a goal to controll the voltages and currents with a numpad and have displayed simultaniusly the output voltages and currents, as well as some form of temperatur gage for the regulator zones. The priority is preformans and the encloser dimensions are flexibel seeing as the project is a expansion on a older lm317/lm337 project and the perfect metal enclosure is now busted. But i plan to use this supply for a long time so theres really no long term restraints on anything specificaly, but i do need to read about DC coupled bridge mode audio amplifer. Never heard of it.

Edit// I will write down the different options regarding DAC voltage levels and figure out what will give the most satisfying results.

Thanks for the input.
 

Hi,

It might just be that i have not done that kind of thing before but for some reason i would like to avoid seperatly amplifying the signal 5 or 8 times, it would recuire very precis resistors to get it just right?

I don't know what you mean. Two amplifers with calculated gain should do the job..
Reagarding of precision with a number of resistors: It is no that 5 resistors with a tolerance of 1% will give you a tolerance of 5%. This is only true if you want to calculate the theretical (and not realistic) worst case tolerance.

In reality with 5 resistors you can count with a max tolerance of 2%. Some resistors may be slightly larger, others may be smaller as the desired value and therefore some errors are canceled...





Btw. This learning by doing is the best way to really understand what's going on. And all the trouble and difficulties will bring you forward.

Klaus
 
  • Like
Reactions: David_

    David_

    Points: 2
    Helpful Answer Positive Rating
Iv'e thought about the idea with a +-15V supplyed DAC and although i can't write it up I ended up with the conclusion that it is not at all viable as i originaly thought, but MAX532 is still a quite nice chip(in absense of any prior knowlage about ADC/DAC) and it works as a single supply between 11,3V-16,3V or something like that. But a 5V supply does appear to be the way to go.

In reallity, if i have a voltage between 0-5V and want to amplify that around 5 times(original voltage variable and the gain will have a exakt value, as accurate as possible) what is the most accurate way to do it?

I really don't like that 2%. But i guess it would be the similarly % ratio with 0,01% resistors?
I am willing to pay some money for them but not 100SEK/7USD each. Iv'e found +-0,01% at that price but it is way to high for a simple student, but why not go for +-0,1% and then hopfully in the future upgrade.

What I'm unfamiliare with is microcontroller and digital circuits in generall but is it a bigger task to program a 16-bit DAC than a 12-bit DAC, or is it a unvalid question?
I'm thinking that since my goal is a as flexible and capable supply as I possibly can design and assemble that all possible improvements to accuracy and precision is of intresse, as for power consumption, it's not a main concern for smaler loads but the volage keeping the regulators hot is a real consern and since you mentioned it i have been spawning some weired options to have some low voltage/high voltage mode. I would love to be able to draw 1,5A at around 5V, i don't know by what exactly but since the project starts with the specs +-0,xV-25V 1,5A but likely 3A since the regulators used us made to be easely parallelled and the transformer would be a waste if not(as for the positive there are a 3A version avalible, but the negative have only 600mA so it would be 5 parallelled). But since power dissipation is a real problem in some lower voltage situations I figure that it is benefical to use more than one regulator to have greater possibility to spread the heat around. I have not gotten to thinking of the acctual possibilityes of different heat sink through the PCB variations, but seeing as the regulators have been desiged to be parallelled with a very smal voltage lost, something like 10mV if I'm not remebering wrong there are a lots of perhaps odd but effective ways to use some sort of dedicated heat sinking circuit boad for the regulators + neacesary components. Brand new idea so I might overlook some considiations but I want to avoid Dc-dc converters due to noise. But dc-dc conveters is something that i have never played with and i mostly assume that I would be unhappy with the adition of switching noise.

I know its kind of unsuitible and probobly stupid but what about using in some instances a load of some kind that are meant to take the heat of a large voltage dissipation the releve the regulators? It sound straight out wrong but if theres headroom for extra power delivery from the transformer. I think i will forget that idea but its a possibility not seen generally for obvius reasons.

Forgot to read about DC coupled bridge mode audio amplifer, will do that right away.

Spot on regarding the learning,
added to that i am cursed/blessed with a couple of oddeties that makes theoretical work very hard for me to understand and preform but put some practical parts in the mix and bingo!

- - - Updated - - -

I dont know what load you want to connect, but maybe it's worth to consider a DC coupled bridge mode audio amplifer.
With that you can simply control the output voltage, there are a lot of parts that can deliver 1.5 A, very common and rugged...

I find it hard to understand what i really would mean to DC couple a bridge mode audio amplifier, without knowing anything about if it might be a good idea for me it presents a big task to find out without knowing if its relevant.
Would you mind very simply explain what it would be as a substitute to a regulator?
Or did you mean to use it instead of a regulator or before the regulator to step down the voltage?
 

Hi,

First: a 0.01% design is hard to do. It not only depend on ghe resistors tolerance but on
* reference voltage
* temperature drifts of all components
* leakage currents of all components
* pcb layout
* noise
....but its good to try...

What do you mean with "amplify that around five times..."

12bit / 16 bit dac programming is no problem.

DC coupled: most audio amplifiers have high pass filters to avoid DC at the output because this can distroy speakers.
 
  • Like
Reactions: David_

    David_

    Points: 2
    Helpful Answer Positive Rating
I looked at a 14-bit DAC and it appears to me who don't jet know how to program that it would be simpler to controll or to understand how to controll the DAC with one 16-bit word instead och 3 8-bit words but i will think some about reference voltage to, cous the 14 or 16-bit DACs iv'e looked at didn't allow very much of a choise regarding ref voltage.

If the DACs referens was 5V just to make the numbers match up, the max value digital value would give me 5V out, the maximum regulator voltage i want to controll is at least 25V both a + rail and a - rail.
Så that 5V would needed to be buffered with a gain suitible to give a 25V output to the regulator.

I have worked out the most basic parts exept a couple of things, the DAC for one but i will start a thread at a sutible part of the forum to show the whole project to be able to ask for suitible help becous its not simply a question for this place. Many things impact how i will implement the DAC but i have almost gotten all i need to decide on a part and then soon enough start the acctual programming bit.

I will edit this post with a link to the other thread when its done if you want to see a early draft of the whole(almost) circuit idea.

I will go with 0,1% resistors but the 0,01% problems sound kind of fun to work out and i will put that idea away for the future.

Edit//
I need to find the right referens voltage to the right number of bits for the resulution in order to get suitible voltage level steps, i might seatle on the idea that i want to be able to adjust the voltage in 0,1 or 0,01 steps and i really would like to do something like that without having the voltage vs controll steps not ending up as for exampel 25V/4096=0,0061035 steps and then use math in programin to adjust to get clean whole decimals voltage levels. I am years away from understanding that even would be done.
 
Last edited:

Hi,

don´t bother with the absolute value of the reference. Important: it has to be as exact ( in percent) as you need it. Amplifying the resulting (DAC output) signal to your desired value is no problem.

If the DACs referens was 5V just to make the numbers match up, the max value digital value would give me 5V out
not always...
It is no good idea to go to the supply rails of an ADC, DAC or OPAMP. it is always critical, although the parts have improved on that point.

You said you want a "precise 0V", sometimes it is easier to SWITCH your supply to zero than to regulate it to zero.
Maybe with an analog switch or reed relay...

Good luck
Klaus
 
  • Like
Reactions: David_

    David_

    Points: 2
    Helpful Answer Positive Rating
Yes I realise when reading you post that since I will change the voltage through some gain I can do what i want whith it, the 5V value whas entairely hypothetical. But Is there generally any pros and cons to use a referens voltage very close to the rail compared to say in the middle between Vss and Vdd/GND?

Is there any advantage to go with a 3,3V supply instead of 5V?
I see more and more 3,3V supply chips(the ones i come in contact with is more ore less only for hobbyist intress and i don't know about the proffesional part of the electronics product world)
But is it any more than it's a lower voltage and we are moving more and more to lower levels in an power consumption struggle?

I guess i wonder if i have anything to gain from a change from my 5V based digital circuit to 3,3V? Fore uC, DAC and such.
First I thought "screw power consumption concerns" regarding low level controll circuits cous there are lots and lots of other more importent things to spend time on, but it feels sloppy and as learning for a future in the imdustry I will have a secondary priority to minimize power drawn by all circuits, and 3,3V seams like a good start.

Since it appears to basicly be the same thing whether i use 12-, 14- or 16-bit DAC, why not go for 16-bit so thats my plan, i think...:)

Since companys are so very kind to offer free sampels a good 16-bit DAC is a reality and boy do it boost my specs, not that I have any potential to become a big buyer but it sure creates costumer return.

Moving from 12-bit(4096) to 16-bit changes my approche(no spell check:) ) to the adjustment principle, I have never done anything like this and all i know is that i would like ta have a numpad to enter output values but am I on the right track with the following, the acctual value input manner is unrelavant but getting the controll voltage to a appropiate level:
the transformer makes 30V the aimed max voltage.

16-bit = 30V/65,536 = 457,7636719uV ~ 457,76uV

16-bit = 2,5V/65,536 * =*38,14697266uV ~ 38,14uV

500uV / 38,14uV = 13,109596622

38,14uV * 13,2Gain ~ 500mV

- - - Updated - - -

As for 0V,
The supply will be att PE-ground level but if I tell the supply to give me 10V I want a symetrical output, i start to remember that this begun as a battery supply:) and i still aiming for att smal floating battery driven lab supply. But I need a real solid ~3A supply but when i have finished this transformer based circuit it will be a smal matter of make another version with lower current and a battery-bank.

In reality I'm crazed for a real tracking dual rail supply but in my current project path that will simply be a matter of software, no?
Both voltages will be continiusly monitored and displayed,
I also intend to fix a function to seperatly adjust the rails but that will have to wait untill Rev2, probobly. Theres really a need for me to open a new project thread and i have begun to write the post.

Edit//
I will need a ATmega2560,
http://www.atmel.com/Images/Atmel-2...r-ATmega640-1280-1281-2560-2561_datasheet.pdf
and it contains 16-bit PWM, but what determines accuracy and errors in the resulting final controll voltage?

Or to save you some time if you can anser this,
I don't neacecary need to understand what it depends on but whould a 16-bit DAC with performance (±0.5LSB INL and ±0.9LSB DNL) over tempera- ture without any adjustments. The DAC output is unbuffered, resulting in a low supply current of 0.3mA and a low offset error of 0.6mV be the better option.

Edit//
Iv'e found this, http://www1.elfa.se/data1/wwwroot/assets/datasheets/ltAD420_e.pdf
Supply voltage 12-32V so with a good referens att 30V its all done with unitygain buffers, might that be a good idea?
//


I can't say how much i appritiate all you help, i could not have gotten this far for a couple of months on my own. These are really new waters and man do I have a insain amount of datasheets read this week and theres more to come, datasheets that is.
Thanks a thousand.

This DAC/PWM have been a titanium nutt to ***** for me but i see the finishline very close and when the decision is made I can start to acctualy implement whatever software needed DAC/PWM wise.

Head ake is a side effekt of electronic project like this:)
 
Last edited:

My thoughts often eratic and goes all over and its a specific problem with ADD that I find it impossible to finish a train of thought and I involontarely skips from one to the next to the next and so on until Iv'e gone trough them all many times, please exuse my somewhat difficuilt texts but I'll summerise my questions.

Is this on the right track?:
16-bit = 30V/65,536 = 457,7636719uV ~ 457,76uV

16-bit = 2,5V/65,536 = 38,14697266uV ~ 38,14uV

500uV / 38,14uV = 13,109596622

38,14uV * 13,2Gain ~ 500mV

And how do I determine the ATmega2560s accuracy and errors with the PWM+filter approche?
Is there a clear winner refards to specs between PWM+filter and a high end 16-bit DAC?

Iv'e found a great option with MAX5316,
https://datasheets.maximintegrated.com/en/ds/MAX5316.pdf
And i simply have to seattle on a chip and go with that and hope for the best, so that choise is soon done. But the reason i mention the chips is to see so i don't miss something vital and end up ordering some very nice chip just to discover that ops i did not think of that, to bad.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top