Digital control or analog?

Thread Starter

Hamed T

Joined Dec 28, 2018
18
I finished designing my very first (semi?)-digital lab PSU, But how am I going to control the voltage/current?

Right now on the breadboard whatever voltage/current I set using 10 turn pot is bang on at the output, so first solution is using two infamous 10 turn pot.
The second solution is to use a DAC (MCP4922-12bit) and only one rotary encoder with switch which can change both voltage and current.

10 turn pot with the knob and the DAC with the reference voltage IC have the same price (where I live at least) but each have their advantages and disadvantages.

The advantage of pot is that it's VERY easy to implant and also I can set the voltage/current with 1mV/1mA accuracy. the disadvantages is; I can only pre-set the voltage/current values if I add an ADC to read the pot output to the op amp input to display it on the LCD. there gonna be two big pots which will occupy the box space and also from outside two big knobs, on a small box eehh... I can live with that though...

On the other hand DAC have non-linearity errors, is a bit difficult to implant code and circuit wise. with DAC in place; on the front panel only one rotary encoder gonna be which will not only control the voltage/current but also can use it to switch to menus and save/recall settings etc...

Please help me decide; should I pick the DAC with all the cool features and have some non-linearity(1-2mV) errors or ignore all those and just simply use a 10-turn pot?

my budget can't afford high-end DACs and availability is also an issue.
 

Marley

Joined Apr 4, 2016
519
Because you are using 10-turn pots you can get very precise control. But how precise is it really?
How good is the voltage reference that the output voltage is ultimately derived from? Are the quality of all the other components - thinking resistive dividers here - good enough? Using any op-amps? Offset voltage drift?

This matters because if you are going to switch to digital control this decides how many effective bits the DAC needs to have.
No need to have 24-bit accuracy if the voltage reference drifts a lot with temperature or time.

Digital control has advantages: Repeatability, storage of settings, remote control, etc. But don't be fooled by a digital display: just because it might say 10.09V does not mean it is actually that. Could be anything!

Better DAC = more accuracy = higher price. But only if the components and the design around it are equally good.
 

Thread Starter

Hamed T

Joined Dec 28, 2018
18
Because you are using 10-turn pots you can get very precise control. But how precise is it really?
How good is the voltage reference that the output voltage is ultimately derived from? Are the quality of all the other components - thinking resistive dividers here - good enough? Using any op-amps? Offset voltage drift?
I don't have much experience and I just know a little about electronics, here's some more details of the build:
The op amps are MC34074 with 1mV input offset error and MC34072 with 0.5mV error, MC34074 is configured as instrumental op amp for high side current sensing and MC34072 is working as error amplifier. both op amps have negative voltage so they can swing all the way down to 0V. the accuracy of current measuring is ~1mA off but the voltage is exactly what I set.

All resistors are 1%, bought 50 of them and matched them by hand one by one.

Current is gonna be measured from the output of the op amp with an 16bit ADC and the voltage with a voltage divider at the output also with the same ADC.

For digital control I'm planning to use LM4040AIZ-4.1 voltage reference with 0.1% accuracy and for analog control I'm thinking to use LM4040AIZ-5.0 or TL431.

20V/1A output is more than enough for my desktop, I'm not gonna draw more than few volts and ~200mA from the PSU. 1-2mV/mA error is acceptable but 5-10mV/mA error is something I'm trying to avoid.

Appreciate the help.
 

schmitt trigger

Joined Jul 12, 2010
2,085
For me at least, the choice depends whether you really plan on using a digital control's capabilities:

-memory presets for common loads.
-remote control with a computer, which allows to dial-in complex profiles.
-power up at a particular voltage/current configuration.
-safe area protection; i.e. a lower current limit at higher voltages.

Otherwise, go for analog.
 

Thread Starter

Hamed T

Joined Dec 28, 2018
18
Why such high accuracy?
That's usually not needed on a lab supply.
I already have a 30V/5A lab PSU, it's a chinese one with 10mV accuracy. it gets the job done but it's big and not very accurate.

I wanted to have an small low power linear PSU either digital or analog on my desk for powering MCUs, testing and calibrating sensors etc... so I decided to build it myself from scratch. it took 3 month of research for a hobbyist like me to build it, had to understand what op amp is! I had zero knowledge...

Now that it's build and it have the accuracy that I desired to have, I can't decide where to go from here. that's why I asked this question. am I going to lose this accuracy if I choose to go digital or the offset error is going to be negligible? I really want to make it a digital PSU and I know a 16bit or 24bit DAC will make it very accurate but all I can't afford is a 12bit DAC. so analog or digital?
 

Thread Starter

Hamed T

Joined Dec 28, 2018
18
For me at least, the choice depends whether you really plan on using a digital control's capabilities:

-memory presets for common loads.
-remote control with a computer, which allows to dial-in complex profiles.
-power up at a particular voltage/current configuration.
-safe area protection; i.e. a lower current limit at higher voltages.

Otherwise, go for analog.
Digital PSU was the plan but I'm afraid MCP4922 non-linearity error would ruin the accuracy that I can get with an analog control...
 

crutschow

Joined Mar 14, 2008
38,503
12-bits gives you a resolution of ≈5mV for 20V full-scale, so you need more bits, if you want better than that.

If are using a 16-bit ADC, then you could use that to measure the output voltage, and then use high resolution PWM from a microprocessor to adjust the voltage from that ADC value with a feedback loop until the output matches what you want.
That way the only source of significant error is the ADC.

Are you at all familiar with using microprocessors?
 
Last edited:

Thread Starter

Hamed T

Joined Dec 28, 2018
18
12-bits gives you a resolution of ≈5mV for 20V full-scale, so you need more bits, if you want better than that.

If are using a 16-bit ADC, then you could use that to measure the output voltage, and then use high resolution PWM from a microprocessor to adjust the voltage from that ADC value with a feedback loop until the output matches what you want.
That way the only source of significant error is the ADC.

Are you at all familiar with using microprocessors?
I'm familiar with only Arduino, and the resolution of of arduino PWM (analogWrite) is 8bit. so I think you're talking about some faster MCUs...

Can you please expand that method you described with more details?
 

crutschow

Joined Mar 14, 2008
38,503
I'm familiar with only Arduino, and the resolution of of arduino PWM (analogWrite) is 8bit. so I think you're talking about some faster MCUs...
I don't know which micros available can generate 16-bit PWM, but perhaps someone else can help with that.
Can you please expand that method you described with more details?
Basically you look at the difference between the digital voltage setting and the A/D output voltage measurement, and then adjust the PWM signal to close the gap.
You do this measurement and adjustment continually with the microprocessor in a loop, so that the difference between the setting and A/D measured value is reduced to 1LSB or so.
 
Last edited:

Thread Starter

Hamed T

Joined Dec 28, 2018
18
I don't know which micros available can generate 16-bit PWM, but perhaps someone else can help with that.
Basically you look at the difference between the digital voltage setting and the A/D output voltage measurement, and then adjust the PWM signal to close the gap.
You do this measurement and adjustment continually with the microprocessor in a loop, so that the difference between the setting and A/D measured value is reduced to 1LSB or so.
I'm coming to conclusion that if I'm not going to spend too much it's better to use analog control... a 12bit DAC as you mentioned in earlier post is not going to give me that fine tuning which I can get from 10 turn pot...
 

jpanhalt

Joined Jan 18, 2008
11,087
But aren't ordinary rotary encoders 5x more precise? It will all depend on the accuracy and stability of your reference. Why do most modern instrument manufacturers use encoders?

If this were the 1970's, you might have an argument, but not today. It seems you are just reluctant to go digital.
 
Top