Maker Pro
Maker Pro

PID question

R

Richard The Dreaded Libertarian

Jan 1, 1970
0
Actually, a "Pole" is someone native to Poland. A "pole" is a linear
measure of one-quarter of a chain or five-and-one-half imperial yards.

;-)

I knew it! The guy can't tell shit from Shinola! ;-P

Cheers!
Rich
 
G

Genome

Jan 1, 1970
0
Thanks for the schematic. I still need to determine if I'm going all
analog, or hybrid (analog current control/digital voltage control).

No worries. Well, maybe.

Ignore the compensation things.... like ignore the capacitors. Just have a
look at the way things go up and down to see that they do the right sort of
thing. This bit goes up so this bit goes down and takes away from that bit
and then the other bit gets taken away from the first guess and things
balance themselves out.....

It's sort of cute because the error amplifiers, U1 and U2, are inverting
configurations and, if you need to, that makes it easier to clamp their
outputs to sensible levels.....

On the other hand you do need dual supplies for your op-amps.

Of course TBW (TopBossWank) will have some sort of mental tick over that one
and you might feel the need to waste a lot of time trying to find a way
around it. Obviously TBW knows best.

If you value your sanity then don't waste too much time thinking about it.
Mind you, I don't want to seem like an old fart.

TBW always asks these sort of questions because if you can find the answer
to his problem he can say he has saved tuppence a unit whilst ignoring the
extra sixpence it cost to get there and the fact he had to dump his original
specification..... Then you get to sort out the recurring problems.

Even if you do choose to go the digital way you will still need to look at
things in an analog way if you want to progrim things proper like.

I will tell you this....
I'm thinking about it... can't you do all analog functions with a uP
now anyway ?:)

...Jim Thompson
--

You're some sort of smug bastard on the quiet. Obviously they can, it's just
that your crappy analog electronics isn't fast enough to make it viable.
Instead of sitting on the sidelines and sniping you should get your finger
out.

DNA
 
J

joseph2k

Jan 1, 1970
0
I'm working on a linear bench power supply using a microcontroller. My
plan is to have a DAC set the output voltage, which will be regulated
by a simple op-amp circuit.
An analog input on the micro will monitor load current. I plan on
using this value to provide current limiting, via a PID algorithm
controlling the set voltage. Some general PID tuning advice in a
Microchip PDF says to first set Kp (with Ki and Kd set to 0) so the
system is as stable as possible.

With only Kp set, the voltage output just follows the error. Not too
helpful. Things got better when I added Ki. I'm not sure if I need
Kd. This seems like a somewhat difficult problem because anything can
be connected as a load.

I've searched the Internet, but nobody seems to be using PID in this
way. I'm sure it is being done, however. What is some general advice
on tuning this PID system? So much information out there seems to be
related to motors and heaters.

I confess to some surprise at not understanding the difference between
control signal and error signal. PID stands for proportional, integral,
and differential components for the the control process. Using an error
signal for the PID input is a fools errand. Properly used, proportional
sets the final response, integral provides smoothing, and differential
provides response speed. Direct error signals are not useful.

This is the underlying concepts for "Kalman filtering" which take into
account device response characteristics to determine optimal control
outputs for the highest performance and reliable stability.
 
J

John Popelish

Jan 1, 1970
0
joseph2k said:
I confess to some surprise at not understanding the difference between
control signal and error signal.

The control signal is usually the output from the error
amplifier that drives some control device (pass transistor,
in this case)
PID stands for proportional, integral,
and differential components for the the control process. Using an error
signal for the PID input is a fools errand.

This depends on whether the setpoint is changing or fixed,
and whether or not you want fastest response to both
setpoint changes and load disturbances, or just fast
response to load changes and slow, over damped response to
setpoint changes (like turning the voltage setting knob on
the supply). There are several useful combinations.
Properly used, proportional
sets the final response, integral provides smoothing,

Integral provides eventual perfection, since it keeps
changing the output (ever more slowly) till the average
error is zero.
and differential
provides response speed. Direct error signals are not useful.

Another way to look at PID response is as a soft notch
filter. Any feedback process develops a conjugate pair of
poles that represent the onset of oscillation (a peak in the
feedback response. If you can center the response notch of
the PID combination (falling gain with rising frequency from
the integrator term to some minimum gain from the
proportional term, with rising gain above that minimum from
the derivative term) this response peak, you extend amount
of closed loop gain tolerated and the frequency range of
stability. Some versions of PID terms have deeper possible
notches than others. The more deeply notched versions work
better with inherently resonant systems.

Lots of useful lead lag phase compensation networks used to
tweak feedback systems can be described as a P. I. and/or D.
terms.
This is the underlying concepts for "Kalman filtering" which take into
account device response characteristics to determine optimal control
outputs for the highest performance and reliable stability.

I think that Kalman filter control also takes the noise of
the measured variable into account, combining some part of
the control output run through a system model that predicts
the result of control changes with some fraction of the
measurement of the system, to improve the control you can
achieve based strictly on a noisy measurement. Ideally, the
proportions of predicted response and measured response
adjust in response to the noise. Please correct me if I am
misunderstanding it.
 
J

joseph2k

Jan 1, 1970
0
John said:
The control signal is usually the output from the error
amplifier that drives some control device (pass transistor,
in this case)

Yes, i am suggesting that OP move across the error amp to the reference
value / input.
This depends on whether the setpoint is changing or fixed,
and whether or not you want fastest response to both
setpoint changes and load disturbances, or just fast
response to load changes and slow, over damped response to
setpoint changes (like turning the voltage setting knob on
the supply). There are several useful combinations.


Integral provides eventual perfection, since it keeps
changing the output (ever more slowly) till the average
error is zero.


Another way to look at PID response is as a soft notch
filter. Any feedback process develops a conjugate pair of
poles that represent the onset of oscillation (a peak in the
feedback response. If you can center the response notch of
the PID combination (falling gain with rising frequency from
the integrator term to some minimum gain from the
proportional term, with rising gain above that minimum from
the derivative term) this response peak, you extend amount
of closed loop gain tolerated and the frequency range of
stability. Some versions of PID terms have deeper possible
notches than others. The more deeply notched versions work
better with inherently resonant systems.

Lots of useful lead lag phase compensation networks used to
tweak feedback systems can be described as a P. I. and/or D.
terms.

Yes, PID controllers have the added ability to change the P, I, and D values
in a running system.
I think that Kalman filter control also takes the noise of
the measured variable into account, combining some part of
the control output run through a system model that predicts
the result of control changes with some fraction of the
measurement of the system, to improve the control you can
achieve based strictly on a noisy measurement. Ideally, the
proportions of predicted response and measured response
adjust in response to the noise. Please correct me if I am
misunderstanding it.

Doesn't seem like it to me.
 
J

John Popelish

Jan 1, 1970
0
joseph2k said:
John Popelish wrote:

Nice links, the wiki still hits the hard math a little too quick and not
enough explanation. The second link is really good. I could probably use
it to learn the deep stuff that is hard follow in the wiki.

I have been reading about Kalman filters for a long time,
but I haven't yet had an industrial control application that
cried out for it loud enough to make me learn how to
actually use it. One of these days, perhaps.

I have managed to apply a couple of Smith Predictors, which
are sort of related but deal with delay in a control loop,
instead of noise.
http://www.controleng.com/article/CA188333.html
 
J

joseph2k

Jan 1, 1970
0
John said:
I have been reading about Kalman filters for a long time,
but I haven't yet had an industrial control application that
cried out for it loud enough to make me learn how to
actually use it. One of these days, perhaps.

I have managed to apply a couple of Smith Predictors, which
are sort of related but deal with delay in a control loop,
instead of noise.
http://www.controleng.com/article/CA188333.html

Another good site. I suspect you would end up teaching me very quickly.
 
J

John Popelish

Jan 1, 1970
0
joseph2k said:
John Popelish wrote: (snip)

Another good site. I suspect you would end up teaching me very quickly.

You might be able to learn very quickly, but I doubt I can
teach quickly. ;-)
 
J

joseph2k

Jan 1, 1970
0
John said:
You might be able to learn very quickly, but I doubt I can
teach quickly. ;-)

That's ok. stay in this NG, your expertise is very welcome.
 
Top