# Tuning PDF loop (pseudo derivative feedback)

Started by January 15, 2014
```I know about the auto-tuning algorithm for PID: cycle the temperature up an=
d down, measure the peaks and distance between the peaks, and calculate Kp,=
Ki, and Kd. =20

But recently I've been experimenting with what Phelan called PDF, and am in=
trigued by it.  There isn't a lot of information out there about it, but ne=
arly everyone that's used it has good things to say. =20

The problem is, how is it tuned?  It only has a Ki and Kd, so that makes it=
slightly simpler.  An auto-tune algo like the one I just mentioned would b=
e great, or at the very least, some general guide for manual tuning.  A met=
hod that doesn't mention poles, zeros, or transforms would be nice because =
even though I have an EE degree, my strong point isn't controls. =20

Either I forgot everything in my controls class or never learned it, I don'=
t know which.
```
```On Wednesday, January 15, 2014 8:23:09 AM UTC-5, hon...@yahoo.com wrote:
> I know about the auto-tuning algorithm for PID: cycle the temperature up =
and down, measure the peaks and distance between the peaks, and calculate K=
p, Ki, and Kd. =20
>=20
>=20
>=20
> But recently I've been experimenting with what Phelan called PDF, and am =
intrigued by it.  There isn't a lot of information out there about it, but =
nearly everyone that's used it has good things to say. =20
>=20
>=20
>=20
> The problem is, how is it tuned?  It only has a Ki and Kd, so that makes =
it slightly simpler.  An auto-tune algo like the one I just mentioned would=
be great, or at the very least, some general guide for manual tuning.  A m=
ethod that doesn't mention poles, zeros, or transforms would be nice becaus=
e even though I have an EE degree, my strong point isn't controls. =20
>=20
>=20
>=20
> Either I forgot everything in my controls class or never learned it, I do=
n't know which.

Excellent!  (I'm very interested also and will try this in the next control=
task.)  I think the PDF term is a bit of a confusing as a name.  What he r=
eally does is just use negative feedback around the 'plant'.  So (though I =
haven't done it and don't know for sure.) You are still going to have to ga=
in up the error signal, then integrate it with some time constant, and appl=
y negative feedback as the damping term.  I'd start with near the same gain=
and integral time as in the 'normal' PI controller.  and then add the nega=
tive feedback. =20

So 'normal' PI looks like

error->gain--+--P(gain=3D1)----+->to plant---
+--intergral----+
(where the P and I terms are summed.)

and the PDF will look like,

error->gain--+--intergral---+->to plant---+--
+-<-g=3D-1)-<---+

That's my understanding, Perhaps someone else can correct or refine it. =20

George H.
```
```On Wednesday, January 15, 2014 8:22:21 AM UTC-6, George Herold wrote:
>=20
> Excellent!  (I'm very interested also and will try this in the next contr=
ol task.)  I think the PDF term is a bit of a confusing as a name.  What he=
really does is just use negative feedback around the 'plant'.  So (though =
I haven't done it and don't know for sure.) You are still going to have to =
gain up the error signal, then integrate it with some time constant, and ap=
ply negative feedback as the damping term.  I'd start with near the same ga=
in and integral time as in the 'normal' PI controller.  and then add the ne=
gative feedback. =20
>=20
>=20
>=20
> So 'normal' PI looks like
>=20
>=20
>=20
> error->gain--+--P(gain=3D1)----+->to plant---
>=20
>              +--intergral----+
>=20
> (where the P and I terms are summed.)
>=20
>=20
>=20
> and the PDF will look like,
>=20
>=20
>=20
> error->gain--+--intergral---+->to plant---+--
>=20
>                             +-<-g=3D-1)-<---+
>=20
>=20
>=20
> That's my understanding, Perhaps someone else can correct or refine it. =
=20
>=20
>=20
>=20
> George H.

I have it implemented, I just want to know how to tune it.  See my original=
post :-)

I found pseudocode that I converted to C and it works well, but tuning, yea=
h that's the problem.=20

eprints.soton.ac.uk/66198/1/mbennett_thesis.pdf
```
```On Wednesday, January 15, 2014 9:39:33 AM UTC-5, hon...@yahoo.com wrote:
> On Wednesday, January 15, 2014 8:22:21 AM UTC-6, George Herold wrote:
>
> >

> > George H.
>
> I have it implemented, I just want to know how to tune it.  See my original post :-)
>
> I found pseudocode that I converted to C and it works well, but tuning, yeah that's the problem.
Well how do you tune a PI loop?  (I get close and then do a step response changing the reference by a small amount and looking at the output.)

George H.
>
> eprints.soton.ac.uk/66198/1/mbennett_thesis.pdf

```
```On Wed, 15 Jan 2014 05:23:09 -0800, hondgm wrote:

> I know about the auto-tuning algorithm for PID: cycle the temperature up
> and down, measure the peaks and distance between the peaks, and
> calculate Kp, Ki, and Kd.
>
> But recently I've been experimenting with what Phelan called PDF, and am
> intrigued by it.  There isn't a lot of information out there about it,
> but nearly everyone that's used it has good things to say.
>
> The problem is, how is it tuned?  It only has a Ki and Kd, so that makes
> it slightly simpler.  An auto-tune algo like the one I just mentioned
> would be great, or at the very least, some general guide for manual
> tuning.  A method that doesn't mention poles, zeros, or transforms would
> be nice because even though I have an EE degree, my strong point isn't
> controls.
>
> Either I forgot everything in my controls class or never learned it, I
> don't know which.

It's easy enough to add real derivative control to Phelan's method.  I've
read some of his original articles (or the one?).  On the one hand, the
hype to value ratio is a bit high for my taste.  On the other hand, the
method itself is a useful one, it's just the text surrounding it that
gets tedious.

Phelan's layout does make implementing integrator anti-windup convenient.

Look around and see if you can find a Z-N method for just Ki and Kp.
Better yet, try Astrom-Hagglund.  Ziegler-Nichols is basically a highly
refined seat of the pants method, and tends to cough up underdamped
systems.  Astrom-Hagglund is basically Ziegler-Nichols but with different
constants that result in more conservatively tuned systems.

Astrom and Hagglund wrote a book just on PID control -- I bet they have
every flavor of Ziegler-Nichols-like tuning method in there, including
ones that exclude a derivative in the controller.

--
Tim Wescott
Control system and signal processing consulting
www.wescottdesign.com
```
```On Wednesday, January 15, 2014 9:43:03 AM UTC-6, George Herold wrote:

> Well how do you tune a PI loop?  (I get close and then do a step response changing the reference by a small amount and looking at the output.)
>
>
>
> George H.
>

I also mention that in the original post.  I don't give specifics but this is a great article on it:
http://brettbeauregard.com/blog/2012/01/arduino-pid-autotune-library/

However PID is not PDF so I can't use the same coefficients.
```
```On Wednesday, January 15, 2014 9:46:23 AM UTC-6, Tim Wescott wrote:

>=20
> Look around and see if you can find a Z-N method for just Ki and Kp. =20
>=20

Hmmm, I already have that implemented for PI control.  But P is not exactly=
the same as the D term in PDF, although close.  I'm terrible at the math s=
urrounding this.  I was thinking that at minimum, there was some tuning met=
hodology for PDF, but it's apparently not common enough. =20
```
```On Wednesday, January 15, 2014 10:48:21 AM UTC-5, hon...@yahoo.com wrote:
> On Wednesday, January 15, 2014 9:43:03 AM UTC-6, George Herold wrote:
>=20
>=20
>=20
> > Well how do you tune a PI loop?  (I get close and then do a step respon=
se changing the reference by a small amount and looking at the output.)=20
>=20
> >=20
>=20
> >=20
>=20
> >=20
>=20
> > George H.
>=20
> >=20
>=20
>=20
>=20
> I also mention that in the original post.  I don't give specifics but thi=
s is a great article on it:
>=20
> http://brettbeauregard.com/blog/2012/01/arduino-pid-autotune-library/
Nice thanks,  This looks useful=20
http://www.controlguru.com/pages/table.html
(but no PDF that I can see.)
>=20
>=20
> However PID is not PDF so I can't use the same coefficients.
Hmm well I havne't tried, but I don't expect the coefficients to be that mu=
ch different.. your system has some gain it needs and some time constant, t=
hat's pretty much fixed. =20
I really need to build a small (fast) thermal test bed to try it out.  I tr=
ied making an LT spice file to play with... but I never felt comfortable wi=
th implementing the thermal time of the system.  I had to make at least 3 R=
C's in series to get the thing to oscillate (which totally makes sense) but=
I model the system with a single RC... so how do I relate those things.. (=
sorry talking out loud.)=20

George H.

```
```On Wednesday, January 15, 2014 10:59:34 AM UTC-5, hon...@yahoo.com wrote:
> On Wednesday, January 15, 2014 9:46:23 AM UTC-6, Tim Wescott wrote:
>=20
>=20
>=20
> >=20
>=20
> > Look around and see if you can find a Z-N method for just Ki and Kp. =
=20
>=20
> >=20
>=20
>=20
>=20
> Hmmm, I already have that implemented for PI control.  But P is not exact=
ly the same as the D term in PDF, although close.  I'm terrible at the math=
surrounding this.  I was thinking that at minimum, there was some tuning m=
ethodology for PDF, but it's apparently not common enough.

I've got a copy of Phelans book.. but it's at home... And I never understoo=
d his notation (in depth)  There is no D (derivative term) in PDF.  Just an=
integral and damping.  Hey you might want to read Bob Pease's "What's all =
this PID stuff anyway"  So what's a bit weird is that if you do a PI loop t=
he I term becomes the 'gain' and the P term is the damping.. Then for PDF h=
e keeps the integral (gain) but uses negative feed back for the damping.  A=
nd (for the way I think about it) in PI the P term is one.  And for PDF the=
negative feed back term is -1 (I think.) =20

George H.

```
```On Wed, 15 Jan 2014 07:59:34 -0800, hondgm wrote:

> On Wednesday, January 15, 2014 9:46:23 AM UTC-6, Tim Wescott wrote:
>
>
>> Look around and see if you can find a Z-N method for just Ki and Kp.
>>
>>
> Hmmm, I already have that implemented for PI control.  But P is not
> exactly the same as the D term in PDF, although close.  I'm terrible at
> the math surrounding this.  I was thinking that at minimum, there was
> some tuning methodology for PDF, but it's apparently not common enough.

http://www.stablesimulations.com/technotes/pdf.html

is correct, then the action of the loop differs in its response to input,
not its response to a disturbance, nor in its stability properties.

So the numbers you get should be as applicable for Phelan's loop as for a