Arduino control CC/CV switching circuit? - Page 1
Forum section: electronics / general

author: Porama6400
author_rank: Regular Contributor
timestamp: September 02, 2016, 04:23:48 am
content: Are there any switching controller that i can control with Arduino (with DAC) to create 30V 10A variable switching power supply?I don't want to buy complete set , It's not fun.

author: technotronix
author_rank: Regular Contributor
timestamp: September 02, 2016, 05:07:19 am
content: I think you can get NTE component.

author: Porama6400
author_rank: Regular Contributor
timestamp: September 02, 2016, 06:02:13 am
content: Any suggestion?I tried to search for Buck Controller can allow me to control via Analog reference but nothing helpful

author: T3sl4co1l
author_rank: Super Contributor
timestamp: September 02, 2016, 06:21:56 am
content: No.1. AVR isn't fast enough to implement a practical, safe and reliable switching supply (current mode control, >50kHz typical switching frequency).2. Arduino surely is not. You might stand some chance of doing it with a hand-assembled interrupt handler (which would be triggered by an external comparator). Using library functions, you're at the mercy of what the hardware offers, which isn't well suited to this application.3. You can add on a hardware circuit to handle the switching, but that perhaps loses the fun of trying to do it with an MCU.ATmega isn't powerful enough, but Xmega may be, if you prefer staying in the AVR family. dsPIC is suitable for this sort of thing. Most ARM controllers are powerful enough, and fast enough, to do it (they're also stupidly plentiful and cheap!).There's Arduino on ARM cores, but again, it depends on what hardware functions they provide. Datasheet level stuff. I wouldn't really expect that functionality to be accessible from basic Arduino functions...Any programmable logic will do it trivially (from PLDs to FPGAs), but you don't usually have the analog functions that MCUs provide internally (ADC, comparator, DAC?), so you're back to building the analog circuit around it.The simplest SMPS requires only a flip-flop, so it's rather dubious to distract an entire MCU with such a high speed yet simple task.Tim

author: MosherIV
author_rank: Super Contributor
timestamp: September 02, 2016, 09:30:02 am
content: Please stop calling it a Constant Current (CC) power supply, unless you do actually mean a CC PSU.You probably mean a Current Limit.A CV PSU sets the Volt and supplies the current upto the current limit depending on the load.A CC PSU sets the current and varies the voltage depending on the load, upto the volt limit.

author: Porama6400
author_rank: Regular Contributor
timestamp: September 02, 2016, 10:37:41 am
content: T3sl4co1lI mean i need hardware that will do switching jobbut I want to control it via AVR microcontrollerMosherIVI mean constant current

author: b_force
author_rank: Super Contributor
timestamp: September 02, 2016, 10:42:41 am
content: Well in theory you could create a 30-40kHz singal with the Arduino.Problem is that the adc is not really good enough.So you will need an external adc.Also the accuracy of the PWM is very limited.A Xmega is not much more expensive, and ca also be programmed with Arduino IDE (which therefore can also be called an Arduino IMO)

author: MosherIV
author_rank: Super Contributor
timestamp: September 02, 2016, 10:53:55 am
content: QuoteOK, what is the PSU going to be used for? (CC PSU are only good for specific applications, ie they are no good as general PSUs)Please amend the subject title.What Switching regulators have you looked at?Get the datasheet and/or the application notes.Most will have a sense input which is a feedback from the output voltage, so that the switcher can regulate the output voltage.They will have a number of suggested circuits in the datasheet/app note, usually there will be one (or more) with bypass transistors to increase the current output.To do Constant Current, it usually involves a measuring current shunt (resistor) and using the as part of the feedback instead of just the output voltage.Again, the datasheet/app note may have examples.

author: Porama6400
author_rank: Regular Contributor
timestamp: September 02, 2016, 02:29:36 pm
content: Quote from: b_force on September 02, 2016, 10:42:41 amI won't use AVR to control switching , I just want it to control output so i need switching controller that I can control it with AVR

author: alanb
author_rank: Frequent Contributor
timestamp: September 02, 2016, 02:55:50 pm
content: There is a series of videos on YouTube by IanScottJohnston (who also frequents this forum) that show the development of a PSU that uses an Arduino as a reference and controller. From what I remember it has a switching regulator followed by a linear regulator.

author: NiHaoMike
author_rank: Super Contributor
timestamp: September 02, 2016, 03:23:03 pm
content: I don't think he's trying to put the Arduino in the feedback loop, but rather trying to find a programmable regulator to control with it.

author: Cerebus
author_rank: Super Contributor
timestamp: September 02, 2016, 03:30:02 pm
content: Quote from: MosherIV on September 02, 2016, 09:30:02 amYe gods! This is the third topic today that I've read exactly the same thing from you. Give it a rest old chap.

author: alanb
author_rank: Frequent Contributor
timestamp: September 02, 2016, 03:34:32 pm
content: Quote from: NiHaoMike on September 02, 2016, 03:23:03 pmFrom what I remember IanScottJohnston's design uses an Arduino to set the reference voltage and work the display. The feedback loop is analog.Best to watch the video rather than relying on my memory.

author: Porama6400
author_rank: Regular Contributor
timestamp: September 02, 2016, 04:41:28 pm
content: His power supply can deliver only 3 AmpAre there any chip support 10 Amp?Or one that support external MOSFET?

author: b_force
author_rank: Super Contributor
timestamp: September 02, 2016, 05:42:08 pm
content: I think you can go for like a UC38xx in half bridge mode.Half bridge mode is not a bad choice with these currents.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: September 02, 2016, 08:34:47 pm
content: Ah yeah, with DAC, that's fine. You're best off doing it with a CC controller, and adding a CV loop (voltage error amplifier) around that. You clamp the voltage error amp's output based on the CC DAC output, and the CV DAC output sets the volt error amp's setpoint.Best part about this method is, even if the controller runs off into the weeds and crashes, the DAC outputs are bounded, so the CC/CV output settings are bounded, and the analog circuit can go on doing whatever it does. No self-destruction whatsoever!The downside is, most controllers are made to be self-contained. To do this, you need to hack things a bit. And not all controllers will be suitable for this.Controllers like UC3842 and UCC3808 set the peak current, not the average output current. So you need a second error amp, which controls switching current to regulate output current. Then you have to add an op-amp that controls output current to regulate output voltage (and has a clamp circuit to set CC mode).Tim

author: b_force
author_rank: Super Contributor
timestamp: September 02, 2016, 09:57:33 pm
content: I wouldn't rely on the internal circuit for CC.See it more as worst case over-current protection or so.Just build a nice and good dedicated current sensor.

author: Porama6400
author_rank: Regular Contributor
timestamp: September 03, 2016, 12:20:38 am
content: Quote from: b_force on September 02, 2016, 09:57:33 pmSo monitor and adjust on AVR?

author: b_force
author_rank: Super Contributor
timestamp: September 03, 2016, 10:21:54 am
content: yes, but it depends on the AVR. A standard Arduino is not very accurate. How is it going to be used?As a Lab bench supply or just to power batteries and heavy loads? (10A is a lot)

author: Porama6400
author_rank: Regular Contributor
timestamp: September 09, 2016, 04:01:44 pm
content: 10A is for charging thing so it don't need to be very accuratebut it will cool if it have 2 mode (10A and accurate 1A or something)