Author Topic: Arduino controlled CC/CV bench supply- I have questions  (Read 9836 times)

0 Members and 1 Guest are viewing this topic.

Offline crispytatoTopic starter

  • Regular Contributor
  • *
  • Posts: 54
  • Country: nz
Arduino controlled CC/CV bench supply- I have questions
« on: September 05, 2013, 07:34:43 am »
Hello everyone, I'm in the planning stage of a new project I'm designing. It will be an Arduino controlled power supply with 0-5 amps and 1.25-12v out. These numbers might be tweaked if the power source is higher voltage. I am intending to use a lm338 and an external npn pass transistor (tip41c). I will include a block diagram of the parts I intend to use. Any input that you think could help out, I'd appreciate heaps. I'm very new to digital electronics, and programming, so that'll be a challenge in itself, but the hardware is my first priority.

For power, I have two ideas in mind. First, is just using a regular (or toroidal) transformer and full wave rectifying/smoothing with a few mF of electros on another smaller board is one option, and the other was to get a high voltage, high current laptop power supply and have it out of the way near the socket! this would keep the other parts of the psu (regulator and ics) cooler and more isolated too. my only concern is if the laptop power supply was ground referenced and not able to disable it

I intend to drive the adj pin with an amplified and smoothed dac signal. this will give me range of 1.25-12, or up to about 15 volts I'm using lm324, and it doesn't go rail to rail, I'm not worried, 12v  out is my minimum requirement though. Am I correct in assuming the Arduino would have the power to control the output in 11-12 bits worth of steps and calculate all the required stuff for variable current or voltage? or am I expecting more power than I'll be able to get out of my Duemelanove (atmega 328pu)

I'll say it again, I'm a software noob, have very basic understanding of some analog circuitry, and a small amount of digital understanding. This is a bit  beyond what I've built before, but we only grow by pushing ourselves. Any "traps for young players" would be appreciated by me greatly.

Anything you'd like me to clarify please just ask, I really want to make sure I'm going in the right direction. Thanks very much for your time.

Peace
Chris O0
« Last Edit: September 05, 2013, 07:37:57 am by crispytato »
 

Offline Dave

  • Super Contributor
  • ***
  • Posts: 1356
  • Country: si
  • I like to measure things.
Re: Arduino controlled CC/CV bench supply- I have questions
« Reply #1 on: September 05, 2013, 09:26:15 am »
I hate to break it to you, but a software controlled CC loop is going to be really slow and prone to oscillating. You can forget about powering LEDs with this supply, because before the CC will kick in, the poor LEDs will be long gone.
What you need is a completely analog loop, which you can adjust with a DAC. And while you are at it, you might make a matching voltage control loop, so you eliminate the ye olde LM338 and use an ordinary transistor as the series pass element. Your power supply will be much more stable and reliable with all kinds of loads.
Have a look at the schematic of the good old HP/Agilent E3610A power supply (page 16; it might be worth reading the whole service manual to fully appreciate the design). Learn from it, and maybe use some of it in your own design.

I'll say it again, I'm a software noob, have very basic understanding of some analog circuitry, and a small amount of digital understanding. This is a bit  beyond what I've built before, but we only grow by pushing ourselves.
All the more reason to upgrade your analog knowledge. I bet nothing can stop you from succeeding. :-+
<fellbuendel> it's arduino, you're not supposed to know anything about what you're doing
<fellbuendel> if you knew, you wouldn't be using it
 

Offline crispytatoTopic starter

  • Regular Contributor
  • *
  • Posts: 54
  • Country: nz
Re: Arduino controlled CC/CV bench supply- I have questions
« Reply #2 on: September 05, 2013, 11:03:13 am »
Thanks for the input Dave. I'm glad to find that out before I make a PCB or design a whole board which has a fundamentally flawed design. I had wondered if the mcu's response time was going to be sufficient to keep it happily in regulation. I shall study the schematic of the HP, and try to work a new schematic up and post it here.

I am interested in moving away from the IC regulator for efficiency's sake as well as simplicity. However, I was concerned about getting the circuit stable because I don't have access to a scope. Do you think I'd be able to get it working stably so long as I err on the side of caution with design decisions?

I'm going to go do some reading now.
Peace
 

Offline fcb

  • Super Contributor
  • ***
  • Posts: 2135
  • Country: gb
  • Test instrument designer/G1YWC
    • Electron Plus
Re: Arduino controlled CC/CV bench supply- I have questions
« Reply #3 on: September 05, 2013, 11:06:00 am »
I have to agree that regulating CC with software loop would probably be crap, it would be interesting to see just how crap it would be.

I'd probably look at regulating a very high frequency poly-phase SMPS, but could an *acceptable* bench/lab supply be built I wonder?

https://electron.plus Power Analysers, VI Signature Testers, Voltage References, Picoammeters, Curve Tracers.
 

Offline Experimentonomen

  • Regular Contributor
  • *
  • Posts: 51
Re: Arduino controlled CC/CV bench supply- I have questions
« Reply #4 on: September 05, 2013, 02:05:43 pm »
I don't even see the point of bringing in a µC into something a linear regulator would do better than anything µC based could ever dream of.

The right way to implement µC control is to have the µC control what you normally control with analog pots, the µC is never part of the regulation loop itself. IE replace the analog pots with digital pots controlled by the arduino.

I have NEVER EVER in my life seen a power supply where the µC was part of the regulation loop, the µC simply controls the linear regulator by means of a dac which supplies the voltage/current setpoints to the voltage/current regulator just like the analog pots would on your bench supply.
 

Offline Dave

  • Super Contributor
  • ***
  • Posts: 1356
  • Country: si
  • I like to measure things.
Re: Arduino controlled CC/CV bench supply- I have questions
« Reply #5 on: September 05, 2013, 06:11:30 pm »
I have NEVER EVER in my life seen a power supply where the µC was part of the regulation loop
I have seen one, it was terrible.

However, I was concerned about getting the circuit stable because I don't have access to a scope. Do you think I'd be able to get it working stably so long as I err on the side of caution with design decisions?
It might be tricky to get it really stable without a scope, but there are other ways to check for oscillation. I suppose you could measure the AC voltage on the supply rail. Zero AC voltage = stable power supply.
As for picking the values of resistors and capacitors in the feedback loop, you could use Gerry Sweeney's programmable decade resistor and capacitor. You can then just play with the values and see what works best.
<fellbuendel> it's arduino, you're not supposed to know anything about what you're doing
<fellbuendel> if you knew, you wouldn't be using it
 

alm

  • Guest
Re: Arduino controlled CC/CV bench supply- I have questions
« Reply #6 on: September 05, 2013, 06:55:58 pm »
I have seen one, it was terrible.
The TuxGraphics one? Yep, that was a terrible idea.

It might be tricky to get it really stable without a scope, but there are other ways to check for oscillation. I suppose you could measure the AC voltage on the supply rail. Zero AC voltage = stable power supply.
Most circuits can easily oscillate at frequencies much higher than the few hundred Hz of a cheap DMM.
 

Offline Bored@Work

  • Super Contributor
  • ***
  • Posts: 3932
  • Country: 00
Re: Arduino controlled CC/CV bench supply- I have questions
« Reply #7 on: September 05, 2013, 07:42:51 pm »
the µC is never part of the regulation loop itself. IE replace the analog pots with digital pots controlled by the arduino.

I have NEVER EVER in my life seen a power supply where the µC was part of the regulation loop, the µC simply controls the linear regulator by means of a dac which supplies the voltage/current setpoints to the voltage/current regulator just like the analog pots would on your bench supply.

Actually, TI sells a whole range of digital control loop devices for SMPS' since at least 2009. For example http://www.ti.com/product/ucd3020 Around 2009 they published the math behind the loop design www.ti.com/download/trng/docs/seminar/Topic_7_Hagen.pdf

But just because digital controllers exist doesn't mean some Arduino crap with an ad-hoc control software loop will work well.
I delete PMs unread. If you have something to say, say it in public.
For all else: Profile->[Modify Profile]Buddies/Ignore List->Edit Ignore List
 

Offline fcb

  • Super Contributor
  • ***
  • Posts: 2135
  • Country: gb
  • Test instrument designer/G1YWC
    • Electron Plus
Re: Arduino controlled CC/CV bench supply- I have questions
« Reply #8 on: September 06, 2013, 08:32:18 am »
crispytato,

I say, go for it. You'll learn a huge amount from making an "arduino controlled bench supply" with a software controlled CC loop (including why it won't be as good as a linear loop). Yes, it probably isn't the *best* way to do it - but then the *best* way is probably just to buy one.


https://electron.plus Power Analysers, VI Signature Testers, Voltage References, Picoammeters, Curve Tracers.
 

Offline crispytatoTopic starter

  • Regular Contributor
  • *
  • Posts: 54
  • Country: nz
Re: Arduino controlled CC/CV bench supply- I have questions
« Reply #9 on: September 14, 2013, 01:35:36 pm »
Most circuits can easily oscillate at frequencies much higher than the few hundred Hz of a cheap DMM.

Lucky for me, I have a nice Agilent U1251 which measures fairly high frequencies happily. I have used it to measure ripple on a line of an old power supply that I built. I checked it along side a real scope that belonged to a friend and the RMS voltage of the AC signal was close enough to my reading to be useful (within 10 percent variation in several different samples!)

That being said, it's only so useful and I'm dying to get my hands on a real scope. I'm moving house in a couple of weeks (argggghh), but I really hope I can sort out an old analog scope when I get moved into a new place and have a bit more space for my lab. having the ability to look at a signal will be absolutely invaluable to me and understanding circuits more closely.

I'm going to work on this project a bit in theory until I have something better to go ahead with than the fully software regulated loop. I'm thinking I might start with just voltage controlling it and measuring back current until I get the first half finished.

I'm having a lot of trouble getting my head around the information I can find for regulators and the explanations of how they work. I think there are still holes in my knowledge of op amp action, making this all harder :/

I want to build something practical! Getting a circuit working the wrong way, would be a crap idea imo. I'd rather have spent the effort learning it the way professionals do it, so I have the most useful knowledge.
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8221
  • Country: 00
Re: Arduino controlled CC/CV bench supply- I have questions
« Reply #10 on: September 14, 2013, 03:00:54 pm »
Quote
I'm in the planning stage of a new project I'm designing.

The first question you want to ask yourself is what are you trying to achieve? If you intend to build a DC power supply to a (near) constant load, putting the mcu in the control loop is doable. If you intend to build a power supply to a varying load (aka a Class B audio power amp), putting the mcu in the control loop is difficult to do even for seasoned pros - Freescale doesn't make billions in the power supply business for nothing.
================================
https://dannyelectronics.wordpress.com/
 

Offline crispytatoTopic starter

  • Regular Contributor
  • *
  • Posts: 54
  • Country: nz
Re: Arduino controlled CC/CV bench supply- I have questions
« Reply #11 on: September 15, 2013, 02:31:38 pm »
I've been working on my own regulator based on the advice I've received here to ditch my lm338 idea.

I came up with this, It's rough, and I'm sure there's some mistakes, but if someone could throw some ideas my way it'd be great. is my theory and application okay for the analog circuitry for the most part? I gathered some inspiration from watching Dave and Gerry Sweeney's videos on their lab power supplys. I'll replace the main pass transistor with 1 or 2 darlington power transistors.

As for what I want to achieve with this project-

I have a couple of low-current 20-30 v maximum power supplys that I use for my projects. I built them over the years, and they're used to power anything from MCU's and such, all the way to fully analog circuitry and tubes etc.

Ultimately my intention for this power supply project is to get a small compact fan cooled supply with a micro controller to give me flexibility in programming it. be that through serial, or buttons/rotary encoder as I'm putting on the panel. I want good clean power and I don't need high voltage, it'll be mainly for sub 12 v precision circuitry and I want a nice clean output at high amps. I really want to have a current limit that I can reliably protect my projects with too.

It will be compact, linear, and fully cc/cv controllable. I am shooting for 12-15 volts max, with 4 or 5 amps current capability. I'm going to get a nice chunky transformer (hopefully toroidal) to achieve that sort of output. I want to use 12 bit dacs so I can still have small steps with my output amperage. I want to use a constant current device like dave did so it can be calibrated out easily.

I will hopefully get this on a breadboard/stripboard before I move house, I will post my results here when I do.

Excuse my scratchy writing and schematic, it's much easier to think on paper when you can use an eraser much easier than on the PC.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf