Author Topic: How do PSU achieve V/I control digitally ???  (Read 2139 times)

0 Members and 1 Guest are viewing this topic.

Offline Swaroop 21Topic starter

  • Contributor
  • Posts: 47
  • Country: in
How do PSU achieve V/I control digitally ???
« on: August 03, 2024, 01:34:49 pm »
I have watched multiple videos of Dave taking apart lab PSU's, he always talks about the ADC which is used to measure voltage and Current and always wondered how do these precision PSU achieves digitally controlled voltage and current regulation over a wide range of voltage. Hence I suspected DACs but never saw Dave showing the DACs. I am interested in how they achieve that precision with a wide voltage range from 0-30 etc. 
 

Online Andy Chee

  • Super Contributor
  • ***
  • Posts: 1114
  • Country: au
Re: How do PSU achieve V/I control digitally ???
« Reply #1 on: August 03, 2024, 02:00:43 pm »
PSUs don't usually use DAC like in audio equipment.

Most switchmode PSUs will use PWM control, with duty cycle control from 0% to 100%.

PSUs could potentially use DAC, but it would likely be a microprocessor internal peripheral, not an external DAC chip.
« Last Edit: August 03, 2024, 02:11:28 pm by Andy Chee »
 

Offline Swaroop 21Topic starter

  • Contributor
  • Posts: 47
  • Country: in
Re: How do PSU achieve V/I control digitally ???
« Reply #2 on: August 03, 2024, 02:58:31 pm »
won't the pwm create noise ?
 

Offline thephil

  • Regular Contributor
  • *
  • Posts: 89
  • Country: de
    • Techbotch
Re: How do PSU achieve V/I control digitally ???
« Reply #3 on: August 03, 2024, 03:37:57 pm »
Is sure does. SMPS are notorious for being noisy. Linear power supplies, on the other hand, use a mix of multiple transformer taps and linear regulators to control the voltage.
« Last Edit: August 03, 2024, 03:41:42 pm by thephil »
It's never too late for a happy childhood!
 

Online pcprogrammer

  • Super Contributor
  • ***
  • Posts: 4339
  • Country: nl
Re: How do PSU achieve V/I control digitally ???
« Reply #4 on: August 03, 2024, 04:50:35 pm »
won't the pwm create noise ?

When controlling a linear regulator the PWM signal is filtered to a stable DC level and the regulator will have some level of noise suppression on it's regulation input.

All that is needed is a voltage controlled current source to set the constant current and a voltage controlled voltage regulator to set the constant voltage. You can search for schematics on the net and see how it can be done.

Basically a DAC can easily be made with a PWM signal and a low pass filter. The lower the cutoff point of the filter and the higher the carrier frequency the less noise will come through.

Switched mode power supplies are a different story all together. There the PWM is used to control the system under load and not to set the actual output voltage or current. The feedback signal is used for that and to make it variable either a potentiometer is used in the feedback loop or an extra voltage is injected into the feedback point.

Is sure does. SMPS are notorious for being noisy. Linear power supplies, on the other hand, use a mix of multiple transformer taps and linear regulators to control the voltage.

For an adjustable output voltage on a laboratory power supply there is no direct need for multiple transformer taps. Just a single heavy duty linear regulator to control the output voltage over a wide range.

Offline thephil

  • Regular Contributor
  • *
  • Posts: 89
  • Country: de
    • Techbotch
Re: How do PSU achieve V/I control digitally ???
« Reply #5 on: August 03, 2024, 05:35:37 pm »

Is sure does. SMPS are notorious for being noisy. Linear power supplies, on the other hand, use a mix of multiple transformer taps and linear regulators to control the voltage.

For an adjustable output voltage on a laboratory power supply there is no direct need for multiple transformer taps. Just a single heavy duty linear regulator to control the output voltage over a wide range.

Of course, you can stick with a large regulator, but the mix is what most lab power supplies use. Using different taps dissipates a lot less heat than relying on a big fat regulator.
It's never too late for a happy childhood!
 
The following users thanked this post: Swaroop 21

Offline Faranight

  • Supporter
  • ****
  • Posts: 233
  • Country: si
Re: How do PSU achieve V/I control digitally ???
« Reply #6 on: August 03, 2024, 06:44:39 pm »
won't the pwm create noise ?
Spread spectrum PWM PMIC's are sometimes used to reduce noise and harmonics.
Fara-day? Fara-night.
 
The following users thanked this post: Swaroop 21

Online PGPG

  • Regular Contributor
  • *
  • Posts: 220
  • Country: pl
Re: How do PSU achieve V/I control digitally ???
« Reply #7 on: August 04, 2024, 12:32:31 am »
I am interested in how they achieve that precision with a wide voltage range from 0-30 etc.

You didn't said what precision?
Short search for laboratory supply gives me some with 30.00 at their display. 12 bit converter gives you 4096 results so it is enough to have 30V source with 0.01V precision and 12 bit ADC is nothing unusual.
 
The following users thanked this post: Someone

Offline Swaroop 21Topic starter

  • Contributor
  • Posts: 47
  • Country: in
Re: How do PSU achieve V/I control digitally ???
« Reply #8 on: August 04, 2024, 05:23:23 am »
by precision I mean they achieve 10mV 100mV resolution steps to adjust
 

Offline Swaroop 21Topic starter

  • Contributor
  • Posts: 47
  • Country: in
Re: How do PSU achieve V/I control digitally ???
« Reply #9 on: August 04, 2024, 05:39:40 am »
Are there any application guides or something for RC pwm filter ? For example if I wanna use STM32 which has 16-Bit PWM etc ?
 

Online pcprogrammer

  • Super Contributor
  • ***
  • Posts: 4339
  • Country: nl
Re: How do PSU achieve V/I control digitally ???
« Reply #10 on: August 04, 2024, 05:56:20 am »
Are there any application guides or something for RC pwm filter ? For example if I wanna use STM32 which has 16-Bit PWM etc ?

A simple single order RC filter with a very low cutoff point can be used. The downside is slower response to change of the voltage, but for a power supply it probably will be ok. Just experiment a bit.

Try it with a 150K resistor and a 10uF capacitor and see what it does. Cutoff point is ~1Hz so change stabilization time is ~1s. If this is to slow lower the resistor or the capacitor value.

The carrier frequency of the PWM on the STM32??? won't be super high in 16 bit mode, depending of the type and the max main clock frequency, but will certainly do for something like this.

Offline Swaroop 21Topic starter

  • Contributor
  • Posts: 47
  • Country: in
Re: How do PSU achieve V/I control digitally ???
« Reply #11 on: August 04, 2024, 10:47:50 am »
With stm32f401ccu6 (Black Pill) the pwm frequency with 16-Bit is around 1.2Khz and 20.5Khz at 12 Bit mode.

How will the frequency affect the working i.e Higher frequency / Lower frequency ??
 

Online pcprogrammer

  • Super Contributor
  • ***
  • Posts: 4339
  • Country: nl
Re: How do PSU achieve V/I control digitally ???
« Reply #12 on: August 04, 2024, 11:10:41 am »
With stm32f401ccu6 (Black Pill) the pwm frequency with 16-Bit is around 1.2Khz and 20.5Khz at 12 Bit mode.

How will the frequency affect the working i.e Higher frequency / Lower frequency ??

The amount of ripple in the voltage after the filter will vary based on the frequency but the load of the circuit behind the filter also plays a role in this.

You can experiment with this when you have an oscilloscope and monitor both the input and the output of the filter.

Offline Swaroop 21Topic starter

  • Contributor
  • Posts: 47
  • Country: in
Re: How do PSU achieve V/I control digitally ???
« Reply #13 on: August 04, 2024, 11:32:55 am »
I don't have a scope but I will try to simulate it. But even if I get the PWM to analog voltage how do I control the main power elements, voltage regulation and current regulation ?   
If I have a switching tracking pre-reg or even just a normal switching or linear element how do i control that with this limited voltage of 0 - 3.3V ?? I also have those MCP4725 12-Bit DACs but I don't know how to control the main element with their limited output of 5V or 3.3V. The feed back pins of switching or linear regulators are usually just a few volts so how will the PWM or the DAC output voltage correspond to the regulators feedback ?? This is what I am actually interested in so I can to my further work on a wirelessly controlled PSU. I am not that concerned about the super high resolution even 10mV or 100mV resolution will do also I don't care that much about the settling time just want it to be responsive enough.

Going off topic here but I have a 48V Meanwell Supply which can go up to 52V so I am planning to hookup a buck converter and after which I will put my linear regulator and the buck converter will be offset by a few volts. But I can't get my head around how to control the feedback of this regulation digitally.
 

Offline tszaboo

  • Super Contributor
  • ***
  • Posts: 7916
  • Country: nl
  • Current job: ATEX product design
Re: How do PSU achieve V/I control digitally ???
« Reply #14 on: August 04, 2024, 11:36:30 am »
won't the pwm create noise ?
Spread spectrum PWM PMIC's are sometimes used to reduce noise and harmonics.
In which case the noise is still there but you smear it all over the spectrum, tricking measuring equipment to pass EMC/CE/FCC certifications.
It's the electronics equivalent of Dieselgate IMHO.
 
The following users thanked this post: Swaroop 21

Online pcprogrammer

  • Super Contributor
  • ***
  • Posts: 4339
  • Country: nl
Re: How do PSU achieve V/I control digitally ???
« Reply #15 on: August 04, 2024, 12:09:05 pm »
Maybe reading something found here will help improve your understanding.

One hint on how to regulate a buck or boost converter with an "external" voltage is, mix the feedback voltage with the external voltage by simply connecting the external voltage via a resistor to the feedback input pin. Output voltage will vary when the external voltage varies.

Offline T3sl4co1l

  • Super Contributor
  • ***
  • Posts: 22408
  • Country: us
  • Expert, Analog Electronics, PCB Layout, EMC
    • Seven Transistor Labs
Re: How do PSU achieve V/I control digitally ???
« Reply #16 on: August 04, 2024, 01:10:09 pm »
Why not, you sure can!

Even made one myself:



Basic design is a discrete analog phase-interleave CC/CV control, with 0-5V range inputs, that are driven from a pair of MCP4922s; outputs are measured with a MCP3208.  Header has 5V and SPI on it.  (Well, one channel is phase interleave, the other is single phase. Hence the two input and two output terminal blocks, and the pair of dual DACs.)

With an MCU instead, there are many options:
- Many have an onboard DAC, that can be wired directly to a circuit as above.
- Timers are ubiquitous; generating PWM into a filter makes a simple if slow DAC.
- PWM can be passed direct to the inverter (open loop or slow closed loop) -- probably dangerous, not very responsive, but who knows?
- Same, but with a protective latch (e.g. peak current mode control) plus per-cycle interrupt doing PID control -- basic protections in place, safer, but still subject to software error.
- If elaborate configurable logic is available, the better part of a hardware digital control could be built (more likely a full FPGA though).
- There are also some more specialized SMPS MCUs out there; I recall MCP has a PIC integrated with a peak-current-mode latch and gate driver, something like that.

These would be hard to tell apart at a glance; the additional analog bits (filter), presence of SMPS controller, etc. would be the tip-off, but tracing much of the circuit may be necessary to identify the scheme.

Digital controls are tricky to get right.  Like, the last one I made was rather noisy; although it was a frequency-shift resonant control, and the dithering of that can contribute a lot more noise than other types might, but maybe it had to do with my sample timing, how I smoothed samples out to reduce ripple, etc., or just the natural tendency towards chaos that these systems can have.  But it only needed to be stable over say 10s of ms, so the modest cycle-to-cycle variations average out, and I didn't have reason to investigate further.

A basic buck converter with peak current control should be pretty easy to get within a few LSBs of correct (of whatever part of the control loop has the least ENOB; perhaps the current-setting DAC?), and then regulating output voltage and current to implement CC/CV operating region is just a slower PID loop.

But I would actively discourage developing digital controls, until one knows absolutely everything that they are doing.  Software has exponentially combinatorially more ways of failing than analog circuits do.  Using ICs as building blocks (SMPS controllers, etc.), you at least have some confidence that they tested that chip, if not exhaustively, then well enough to commit to the expense of tapeout and masks.  For my part, I don't consider my above mentioned control particularly reliable -- it seems to work but I have no way to truly test it, I have no illusions that it is infallible and reliable, that there aren't weird logic latchups, arithmetic errors, etc. in it, or that the platform itself is at all reliable (it seems to behave according to the datasheet/manual -- but how do you prove that?).

"Hardware eventually fails; software eventually works" - Michael Hartung

That is, hardware can be correct once, at design/manufacture time, and go until its very atoms cease to cooperate (which, can be sooner than later, but "later" can be very long indeed).  Software, after infinite updates, may eventually accomplish the thing that it was originally intended to, but I would go one further and say that software need never "work" at all, because in many projects, the priority is on more features, not less bugs.

Others may not share my caution about software, and especially among say cheap power supplies, where the pressure is to knock out something quickly, tested only to work in the average case -- who knows.  It's probably a good idea not to connect anything to such a power supply that is worth more than the supply, and not easily repaired in case of gross supply voltage mismatch.

Tim
Seven Transistor Labs, LLC
Electronic design, from concept to prototype.
Bringing a project to life?  Send me a message!
 
The following users thanked this post: Swaroop 21

Offline T3sl4co1l

  • Super Contributor
  • ***
  • Posts: 22408
  • Country: us
  • Expert, Analog Electronics, PCB Layout, EMC
    • Seven Transistor Labs
Re: How do PSU achieve V/I control digitally ???
« Reply #17 on: August 04, 2024, 01:16:22 pm »
In which case the noise is still there but you smear it all over the spectrum, tricking measuring equipment to pass EMC/CE/FCC certifications.
It's the electronics equivalent of Dieselgate IMHO.

This is extremely disingenuous, if not outright insulting.

The equivalent would be, somehow synchronizing the EUT with the analyzer sweep, so that the spectrum is spread exactly around where the analyzer is looking at any given time.

This would be very hard to arrange, at just any lab, but if you self-qualify, or just schmooze enough with a shady lab, I suppose you could pull it off.

"Dieselgate" was due to an extremely precisely defined and consistent test, easily gamed by watching for that program of steps; the perfect setup for an intentional bad-faith exploitation of that test.  It's like playing Simon Says from a fixed written and agreed-upon script, that one could simply rehearse, no RNG or other variation involved.

Don't accuse us of participating in such bad-faith actions.

Tim
Seven Transistor Labs, LLC
Electronic design, from concept to prototype.
Bringing a project to life?  Send me a message!
 
The following users thanked this post: uer166, Swaroop 21

Offline Kleinstein

  • Super Contributor
  • ***
  • Posts: 14769
  • Country: de
Re: How do PSU achieve V/I control digitally ???
« Reply #18 on: August 04, 2024, 01:36:35 pm »
There are µCs with festures to specially support SMPS control. They than include provisions for peak current limits and other extra features. While some parts are a bit easier analog, others (like anti-wind up) are easier done digital. A difficulty with digital control is that the noise / stability is limited by the ADC. This makes it difficult to get very low noise, but a SMPS is usually a bit more noisy anyway. Especially for high power large systems the digital control can still make sense, as the switching frequency tends to be not that high and it is more about getting close to the limits set by that frequency. There can also be added functions for protection / start up.

The normal lab supplies use analog control and just set the set points via DACs (including a PWM DAC of some type from cheap to highly linear).
 
The following users thanked this post: Swaroop 21

Online Andy Chee

  • Super Contributor
  • ***
  • Posts: 1114
  • Country: au
Re: How do PSU achieve V/I control digitally ???
« Reply #19 on: August 04, 2024, 02:01:08 pm »
The feed back pins of switching or linear regulators are usually just a few volts so how will the PWM or the DAC output voltage correspond to the regulators feedback ??
The PWM or DAC from a microcontroller may be 0-3.3V, but a simple opamp buffer can scale it to any voltage you need.

If you have a specific example then please provide a schematic or block diagram.  Otherwise my basic design for a 12F675 controlled LM317 power supply may confuse you when applied to your proposed project.

also I don't care that much about the settling time just want it to be responsive enough.
This sentence is not an engineering design specification.
« Last Edit: August 04, 2024, 02:03:24 pm by Andy Chee »
 
The following users thanked this post: Swaroop 21

Offline tszaboo

  • Super Contributor
  • ***
  • Posts: 7916
  • Country: nl
  • Current job: ATEX product design
Re: How do PSU achieve V/I control digitally ???
« Reply #20 on: August 04, 2024, 06:03:23 pm »
In which case the noise is still there but you smear it all over the spectrum, tricking measuring equipment to pass EMC/CE/FCC certifications.
It's the electronics equivalent of Dieselgate IMHO.

This is extremely disingenuous, if not outright insulting.

The equivalent would be, somehow synchronizing the EUT with the analyzer sweep, so that the spectrum is spread exactly around where the analyzer is looking at any given time.

This would be very hard to arrange, at just any lab, but if you self-qualify, or just schmooze enough with a shady lab, I suppose you could pull it off.

"Dieselgate" was due to an extremely precisely defined and consistent test, easily gamed by watching for that program of steps; the perfect setup for an intentional bad-faith exploitation of that test.  It's like playing Simon Says from a fixed written and agreed-upon script, that one could simply rehearse, no RNG or other variation involved.

Don't accuse us of participating in such bad-faith actions.

Tim
Few facts. Spread spectrum doesn't actually reduce the noise. They do it to actually save money on the input filtering, see example below
https://www.ti.com/lit/an/slyt809/slyt809.pdf
Quote
Spread spectrum can reduce the peak envelope on a
peak and average EMI sweep by as much as 10 dBµV,
which enables designers to choose a smaller-size and lessexpensive input EMI filter.
Oh we got less peaks because the spectrum analyzer doesn't show one very big peak, but several small ones, less reduce input filtering  >:(
Look at all the examples in the paper, noise was never actually reduced, just several smaller peaks are recorded instead of one big.
Also the RBW settings of tests like IEC 61000 are well known and standardized, and it's easy to overcome with these software techniques. You don't need to synchronize it, just make sure to place the several smaller peaks sufficiently apart (RBW apart).
It's a great example of following the letter of a law (stay below this emission line on a spectrum analyzer) while having complete disregard to the intention of the law (actually reduce EMI emissions).
 

Offline T3sl4co1l

  • Super Contributor
  • ***
  • Posts: 22408
  • Country: us
  • Expert, Analog Electronics, PCB Layout, EMC
    • Seven Transistor Labs
Re: How do PSU achieve V/I control digitally ???
« Reply #21 on: August 04, 2024, 08:54:43 pm »
Few facts. Spread spectrum doesn't actually reduce the noise. They do it to actually save money on the input filtering, see example below
https://www.ti.com/lit/an/slyt809/slyt809.pdf
Quote
Spread spectrum can reduce the peak envelope on a
peak and average EMI sweep by as much as 10 dBµV,
which enables designers to choose a smaller-size and lessexpensive input EMI filter.
Oh we got less peaks because the spectrum analyzer doesn't show one very big peak, but several small ones, less reduce input filtering  >:(
Look at all the examples in the paper, noise was never actually reduced, just several smaller peaks are recorded instead of one big.
Also the RBW settings of tests like IEC 61000 are well known and standardized, and it's easy to overcome with these software techniques. You don't need to synchronize it, just make sure to place the several smaller peaks sufficiently apart (RBW apart).
It's a great example of following the letter of a law (stay below this emission line on a spectrum analyzer) while having complete disregard to the intention of the law (actually reduce EMI emissions).

So? Radio receivers are narrow band. You've made no case here.

Worse, you've not explained your accusation against EMC professionals.  I have no recourse to but assume you meant it. Kindly fuck off, then.

Tim
Seven Transistor Labs, LLC
Electronic design, from concept to prototype.
Bringing a project to life?  Send me a message!
 
The following users thanked this post: uer166

Offline Swaroop 21Topic starter

  • Contributor
  • Posts: 47
  • Country: in
Re: How do PSU achieve V/I control digitally ???
« Reply #22 on: August 05, 2024, 06:42:50 am »
The feed back pins of switching or linear regulators are usually just a few volts so how will the PWM or the DAC output voltage correspond to the regulators feedback ??
The PWM or DAC from a microcontroller may be 0-3.3V, but a simple opamp buffer can scale it to any voltage you need.

If you have a specific example then please provide a schematic or block diagram.  Otherwise my basic design for a 12F675 controlled LM317 power supply may confuse you when applied to your proposed project.

also I don't care that much about the settling time just want it to be responsive enough.
This sentence is not an engineering design specification.

I haven't created any block diagram or such also I am not so concerned about the ripple, noise etc. as this is just an Idea for a DIY power supply. I am looking for the control section how it works. All the replies did help me clear my doubts. If you are ok with sharing your PIC and LM317 design. I will try to understand it.

I got a example which relates to my idea:
https://www.instructables.com/DIgital-Controlled-Bench-Power-Supply/
« Last Edit: August 05, 2024, 06:45:35 am by Swaroop 21 »
 

Offline Swaroop 21Topic starter

  • Contributor
  • Posts: 47
  • Country: in
Re: How do PSU achieve V/I control digitally ???
« Reply #23 on: August 05, 2024, 06:54:24 am »
Maybe reading something found here will help improve your understanding.

One hint on how to regulate a buck or boost converter with an "external" voltage is, mix the feedback voltage with the external voltage by simply connecting the external voltage via a resistor to the feedback input pin. Output voltage will vary when the external voltage varies.

Okay, So that means basically superimposing the DAC output to the regulation feedback loop
 

Online pcprogrammer

  • Super Contributor
  • ***
  • Posts: 4339
  • Country: nl
Re: How do PSU achieve V/I control digitally ???
« Reply #24 on: August 05, 2024, 07:25:06 am »
Maybe reading something found here will help improve your understanding.

One hint on how to regulate a buck or boost converter with an "external" voltage is, mix the feedback voltage with the external voltage by simply connecting the external voltage via a resistor to the feedback input pin. Output voltage will vary when the external voltage varies.

Okay, So that means basically superimposing the DAC output to the regulation feedback loop

Correct.


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf