Controlling voltage and current

Thread Starter

Mad Professor

Joined Apr 15, 2009
Good day all.

I have an upcoming project where I would like to revamp my old analog 0-20volt 10amp bench power supply.

I am looking to use a PicAxe or Arduino microcontroller to set and control the voltage & current.

I do not yet have any designs on paper yet, as I what to know what is involved 1st.

I know that voltage can be controled very easy via PWM, but I have never done current control.

I have read that current control can also be controled via PWM, but I can't quite get my head round how to control bolt the voltage and current on the same output via pwm.

Can someone please advice.

Thanks for your time.

Best Regards.


Joined Dec 20, 2011
You constantly monitor both current and voltage. You control only one at a time. Maintain constant voltage until the set current limit is reached. When the set current limit is reached then lower the voltage (PWM duty cycle) to maintain this current. That is how most bench top power supplies work.


Joined Mar 14, 2008
Note that unless you use voltage feedback from the output, the output voltage using PWM will not be regulated and thus will vary will the load you apply to the supply. And if you do use voltage feedback you will need to compensate the feedback loop for the resonant circuit caused by the output inductor and filter capacitor to avoid oscillations in the output voltage.


Joined Jul 3, 2008
There are a few ways to approach this, but one way is to use a primary voltage control feedback and then implement a current limiting feedback by creating a voltage limiter on the output of the voltage control loop. The current is monitored and a one-direction feedback loop is implemented to bring down a voltage limit for the voltage control loop. If the current limiting loop is tuned properly, it will cap the max voltage output on the voltage controller and regulate the current. This method can work for analog control (opamps) or digital control (microprocessor) on the feedback, and also for analog control (linear driver) or digital switching (PWM driver) on the transistor control.

This is the kind of thing that you see on most voltage controlled power supplies. Typically, current control is implemented by setting the current limit, and then setting a voltage that is above what is needed to achieve that current. Given that the application is a power supply, I suspect this is the preferred approach.

Thread Starter

Mad Professor

Joined Apr 15, 2009
Thanks for your replies.

You have given me a fair bit to think about.

And to tell the truth I might even be in over my head on this one.

What sort of hardware would I be needing.

If it still turns out to be over my head, I will just have to go for voltage control only.

Thanks again for your time.


Joined Nov 28, 2008
Another often used approach is to forcefully reduce the drive signal to the main regulating element(transistor) once the current limit has been reached. This has the effect of reducing the output voltage.

However, as the output voltage is now reduced, the voltage control loop would inevitably provide more drive to the main regulating element in order to raise the output voltage to the set point level.

The main issue is to make sure that the current limit loop output has more "strength" in lowering the drive signal than the voltage control loop to raise it.