views:

522

answers:

2

Hi,

I want to implement want I think is a fairly standard feedback loop, however it's been many years since I've looked at control theory and I'm having trouble understanding the concepts and finding implementation examples. I was hoping someone might be explain in simple terms what is happening and maybe point to some resources I could use to implement a solution. All the information I've seen on this topic is usually drowning in mathematics.

So here's what I'm trying to achieve:

  • I want to control the current of an electronic circuit, say I always want it to draw 0.75A.
  • The current, of course, varies over time depending what other parts of the circuit are doing. But I have some hardware that will draw more or less current as controlled by a voltage level I pass to DAC.
  • I also have an ADC which gives me a voltage which is proportional to the current be drawn by the system.

I need to handle ramping and also oscillations to within some thresholds. Also I'm working in C.

thanks, Richard

A: 

It would be difficult to software-control your system to draw constant current. This is better done with dedicated hardware that can respond immediately to current changes and actually implement the feedback loop you have problems understanding.

If you want to do it with software, then you probably must implement some form of a "fuzzy-logic" controller. Your problem is analogous to a fan used to control temperature. You have one input variable (voltage proportional to current) and one output variable (voltage level passed to DAC).

kgiannakakis
?! Fuzzy logic is a black art with far less theory than control loops. I've done current control in software. You have to do it fast if you want the bandwidth to be decent. But you can do it.
Jason S
How fast do you need to be? Let's say you take samples every 1ms. This means you can properly sample signals up to 1KHz/2 = 500Hz. So, you can't cope for 1KHz spikes for example. A software control loop can only work for low frequency signals. Also Fuzzy Logic and AI are supported by a lot of theory
kgiannakakis
+5  A: 
Stephen Friederichs
Good summary.Like you said, though: Scrap the D term; you almost never use it except in temperature controllers.
Jason S
Great response!! One little problem, half the text gets covered by ads in my browser. But otherwise thanks alot, I was looking at the PID but was a little lost with the terminology, your diagram helps alot. Thanks again!
Richard
Oh yes the hardware is already set.
Richard