How to use arduino to continuously control voltage/current?

Hi,
Just wonder how to use arduino to continuously control voltage/current?
So far, I've managed to generate PWM single from my arduino and I need to use this PWM to continuously control voltage(0-20v)/current(0-40A) with resolution of 0.1 second is sufficient. I have no idea how to use arduino to control such large voltage and current? Could anyone point me to the right direction?

Thanks.

1 Like

Power transistor or MOSFET?

which one gives higher efficiency? maybe go for MOFSET, could you give more details? Thanks

You can control voltage, or you can control current, but you cannot control both at the same time.

yeah, I use '/' which means either of voltage OR current.
Let's say control current. 8) 8)

Note that with PWM, you are not controlling voltage (or current). You are controlling time. i.e. With 10% PWM, the average voltage is 10% of the maximum.

If you need to control DC voltage, you need a DAC (digital-to-analog converter). Then, you'll need an amplifier of some kind to boost the voltage & current. (A linear amplifier circuit is a bit more complicated than a transistor or MOSFET used to boost PWM.)

You don't normally control current directly. The relationship between voltage, resistance, and current is defined by [u]Ohm's Law[/u]. Typically, the circuit puts-out a known voltage, and the current is determined by the load impedance/resistance. (If the impedance/resistance is too low and current exceeds the circuit's capabilities, voltage will drop and/or something in the circuit will burn-up.)

1 Like

yeah, I use '/' which means either of voltage OR current.
Let's say control current

In that case, you need a way of measuring/monitoring current in a feedback-loop. Typically, you'd measure voltage across a series resistor to monitor the current and provide a feedback signal. Then, the circuit automatically adjusts the voltage required to hit your target current through the load. Or, the circuit adjusts PWM (through a current-smoothing inductor) as required to hit the target current.

thanks for your advice, I;m thinking to use arduino to control some sort of heating device in order to give constant temperature.
According to feedback temperature, I use arduino to adjust the PWM signal. PWM is further used to adjust volt/current of heating device. Could you advise some feasible way to implement this system?
I only figure out the PWM part, and don't know how to use arduino to control such highvolt/current.

I;m thinking to use arduino to control some sort of heating device in order to give constant temperature.

That's a LOT easier! Do you know how a heater/furnace works? It just turns-on when it's too cold and turns-off when it reaches the target temperature. (No PWM, no variable anything.) You can use a MOSFET, transistor, relay, or solid state relay.

There is a delay between the time you apply power and when start to get heat... If you try to use PWM, you'll be "chasing your tail" trying to figure how much heat you need at any moment.

P.S.
I hope you are heating-up something rather small... 20V x 40mA = 0.8 Watts.... Not much heat/energy.

I can understand what you said, However, I believe turning on/off scheme only has 2 states, which is simple but not very accurate.
I want to continuously control the power of heating device to give more precise control. For example, for a 20V 20A 400w heating device, 100% PWM corresponds to working at 100% capacity. I can adjust percentage of PWM signal to control voltage/current.

If the heater and the system has a lot of "inertia", a simple on-off controller can work. After all, that is what PWM is, on or off.

It can certainly be done, but you need to familiarize yourself with something called PID. Proportional Integral Derivative. Basically:

If the difference is large, change the control signal by a larger amount.
If the rate of change of the difference is large (it is heating up quickly), back off on the control signal to reduce overshoot.
If the difference starts to change from nothing at a high rate (the room drops only 2 degrees but does so very quickly), change the control signal to compensate based on the rate of change. This helps keep things at the proper temperature.

There is an Arduino library for it.
http://playground.arduino.cc/Code/PIDLibrary#.UxjWo_ldXSg

And an autotune library, too.
http://playground.arduino.cc//Code/PIDAutotuneLibrary#.UxjZG_ldXSg

And more information:
http://www.expertune.com/tutor.aspx

Thanks for your reply. I'm indeed using PID algorithm to do the feedback and adjustment stuff.
My question is how to use arduino to control heating device of several hundred watt.
Thinking of a black box, input is PWM signal, output is positive and negative wire connected to heating device.
I need someone to design and fill what's inside the black box 8)

For a heater, PWM is fairly pointless. There is no point trying to turn a heating element on or off hundreds of times per second. It is not the same problem as trying to control a DC motor.

You are probably better off using some appropriate kind of relay, than a transistor or FET.

My question is how to use arduino to control heating device of several hundred watt.

The device you are looking for is called a DC SSR ( Solid State Relay ). Mostly SSRs deal with AC but there are some that will handle DC. Basically they are just power FETs packaged up.
However you do want to control a very big current and for that you will pay a very lot of money.

Like others have said for a heater application this is just a waste.

I don't prefer turning on/off scheme, it only has two states.
I want to control the voltage of heating device in a continuous way, e.g. working at 100% capacity when it's far below target temperature. and working at 10% or 20% capacity when reaching target and 5% capacity to keep ambient at a constant level.
turning on/off scheme can't provide accurate control.

turning on/off scheme can't provide accurate control.

Sorry you are deluding yourself.

If you have a linear regulator controlling a continuous voltage feeding a heater, that part of the power not being burned up in the heater is being dissipated in the voltage regulator. That is why absolutely nobody controls a heater like this especially at these currents.
If you have a switching regulator then the supply is a bit more efficient but again nobody uses this.

So sorry no matter what you prefer it is not going to happen.

You could use phase control, if this heater is being driven by AC power. Works just like a light dimmer, it turns a Triac On later in the half-cycle to turn down the power.

A heating element doesn't respond very quickly, and generally whatever you are heating up responds even more slowly. So no need to control it any faster than every half-cycle of the incoming AC power.

You just need a way for your Arduino to detect the zero crossings. Not difficult, it can be done with a fairly simple optoisolator, or if you are using a conventional step-down AC transformer to power the Arduino, picked off of the secondary by a number of methods.

Then it is just a matter of waiting more or less time before sending a trigger pulse to turn the Triac On.

Yes he can but it is still turning the heater on and off and not continuously powering it.

Agreed, absolutely. It is only a matter of speed - you can turn a heater on and off fairly slowly and have the temperature change very little. Phase control just happens to be a pretty simple way of controlling power to a heater, but you could probably make the cycle last a few seconds while controlling the duty cycle and achieve the same result.

so, how is precise temperature control system implemented in industry?