Maker Pro
Maker Pro

Building a current source

Esteban

May 24, 2015
15
Joined
May 24, 2015
Messages
15
Hi!

I want to build a current source by fixing a current value with a PID controller, in order to get the error signal, the voltage on the load will be measured with a microcontroller ADC, the PID control stuff will be done with the controller, and by knowing the current and the voltage values the load resistance can be found so change in voltage will be the PID perturbation, therefore it will increase or decrease the error signal.

I'm planning to use a DAC board with my controller in order to use a transconductance amplifier to fix a current value. I've understood that mosfet are transconductance devices, which comercial mosfet can I use to fix a current between 0 and 1 amp?

I've found an opamp configuration which is a voltage to current amplifier (schematic is attached to the post), is it better to use a opamp instead of a single mosfet transistor, if it's better choice, which opamp should I use?

Thanks for reading! :)
 

Attachments

  • opvoltagetocurrent.png
    opvoltagetocurrent.png
    283 KB · Views: 106

(*steve*)

¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd
Moderator
Jan 21, 2010
25,510
Joined
Jan 21, 2010
Messages
25,510
why do you need a PID controller to maintain a constant current?

Can you describe what you want to do and why (not how)?
 

Esteban

May 24, 2015
15
Joined
May 24, 2015
Messages
15
Hi, sorry for not being so clear:

I just need to build any project that has PID application as fast as posible, I thought PID can be use to hold a current value for any load change, so the control can be done with some controller and transconductance devices like mosfets.

I want to build a current source that for any load change, it holds a current value by using PID.
 

(*steve*)

¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd
Moderator
Jan 21, 2010
25,510
Joined
Jan 21, 2010
Messages
25,510
you definitely don't need a PID controller for a constant current source. If you tried to use one the response time would be abysmal.

I think you should look for another application where such a controller would be an advantage.
 

hevans1944

Hop - AC8NS
Jun 21, 2012
4,878
Joined
Jun 21, 2012
Messages
4,878
...I want to build a current source that for any load change, it holds a current value by using PID.
This sounds suspiciously like a homework assignment. PID is short for Proportional, Integral, Derivative and is part of automatic control theory. Below is a block diagram of this linear process, extracted from the web page just cited..

400px-PID_en.svg.png


The box labeled Plant/Process can be just about anything you can imagine from a soldering iron to a hydro-electric power plant that produces an output, y(t), in response to a control or reference input, r(t). If you ignore (remove) the I and D boxes and examine the P or Proportional box, you can see that the process control input, u(t), is just a linear function of the error signal, e(t), which is the difference between the process output, y(t), and the reference or control input, r(t).

The consequence of this is that e(t) must be some finite, non-zero value, to produce any output, y(t). For any given reference or control input, r(t), there must always be an error, e(t), sufficiently large to produce the output y(t). That means no matter how large the proportional gain, Kp, is there will always be an error between r(t) and y(t). This is commonly called droop because in furnace controls it results in a furnace temperature that is less than the reference or control setting.

To correct for droop, the I box or Integral function is added. This box accumulates (integrates) the error signal as a function of time, applying the integrated result to the Plant/Process input in a direction that will eventually reduce e(t) to zero.

But what if a sudden change of load, or a change in r(t), causes e(t) to change abruptly? The D or Derivative box measures this rate of change and applies a component to u(t) in the opposite direction, thus "anticipating" the change.

So, if we take your proposal of building a PID controller to maintain a constant current across a variable load resistance, then the box labeled Plant/Process will be a voltage-controlled current source, the output y(t) will represent the current output. and r(t) will be the output of your DAC that is used to set the current. So far, so good. There are many things you can put in the Plant/Process box to implement a voltage-controlled current source, such as a MOSFET whose drain is in series with a variable load resistance connected to a voltage supply and whose source is connected through a current-sensing resistor to the other terminal of the voltage supply. A voltage applied between the MOSFET gate and source will control the current, although there may not be a linear relationship.

The derivation of the u(t) signal could be the output of a DAC controlled by a microprocessor, which in essence would emulate the PID functionality as well as the r(t) control or reference input. The microprocessor would need an ADC to derive the y(t) current feedback signal from which e(t) is calculated and then used to compute the PID control signals that constitute the u(t) signal produced by the DAC. Piece of cake, except for stability considerations. There is much math involved in determining whether a PID controller will have a proper response time and be unconditionally stable against perturbations caused by noise and sudden changes in load or control input.

It should be noted that it is impossible to build a constant-current source that will handle any load resistance. There will always be a maximum load resistance that occurs when the compliance voltage of the current source is reached. This will be R = Vcomp/Iconst, where Vcomp is the compliance voltage and Iconst is the constant current output.
 

CDRIVE

Hauling 10' pipe on a Trek Shift3
May 8, 2012
4,960
Joined
May 8, 2012
Messages
4,960
Hop, I have suspected for quite some time now that there are burn marks on your keyboard. This from a semi hunt and peck typist. I'm jealous! :p

Chris
 

BobK

Jan 5, 2010
7,682
Joined
Jan 5, 2010
Messages
7,682
I believe a typical constant current source is a PID controller, minus the I and D. It supplies a correction proportional to the error. Because the response time of electronic circuits is so fast, this is sufficient.

Bob
 

hevans1944

Hop - AC8NS
Jun 21, 2012
4,878
Joined
Jun 21, 2012
Messages
4,878
I believe a typical constant current source is a PID controller, minus the I and D. It supplies a correction proportional to the error. Because the response time of electronic circuits is so fast, this is sufficient.

Bob
You are absolutely correct. But whether you need the I and D depends on what the load is and whether the control (command) input is varying. You do seldom see a constant current source with the derivative action: that tends to add unnecessary noise to the output.

No response yet from the OP, so I bet this is a homework problem.:D
 

CDRIVE

Hauling 10' pipe on a Trek Shift3
May 8, 2012
4,960
Joined
May 8, 2012
Messages
4,960
why do you need a PID controller to maintain a constant current?

Can you describe what you want to do and why (not how)?
Hi, sorry for not being so clear:

I just need to build any project that has PID application as fast as posible,
No response yet from the OP, so I bet this is a homework problem.:D

For some odd reason it never requires the skills of Columbo to deduce when a topic is homework. :D

Chris
 

davenn

Moderator
Sep 5, 2009
14,254
Joined
Sep 5, 2009
Messages
14,254
we will leave the thread here in the mean time :)
 
Top