PID control intuition

Thread Starter

tindel

Joined Sep 16, 2012
939
PID control is defined as follows:
Dc(s) = k*(1+1/(Ti*s)+Td*s)

where
Dc(s) is the laplace transform of the
k=gain factor (unitless)
Ti=the integration time (in seconds)
Td=the differential time (in seconds)

I'm trying to get a more intuitive understanding of what setting Ti and Td actually do the bode plot (k is pretty clear). It's also clear to me that setting Ti and Td effect where their respective slopes are positioned with respect to the overall gain.

My book defines the break frequencies to be (see Figure 6.66)
wi=1/Ti
wd=1/Td

But this creates a problem because the frequency is the inverse of the cycle time!
fi=1/Ti
fd=1/Td

And the radial frequency should be
wi=2*pi*fi
wd=2*pi*fd

Is the book just wrong?
 

Attachments

Papabravo

Joined Feb 24, 2006
22,082
The following simulation demonstrates what happens as a result of the relative values of parameters a & b. It should be clear the term (1 + (s/a)) is exactly equivalent to the term (s + a), and that a and b have units of frequency. I hope this helps.

1649469911856.png
 
Last edited:

SamR

Joined Mar 19, 2019
5,488
Interesting subject about which many books have been written. Seems the Bode plot concerns are covered but let me add a few things. It is a difficult subject and actual field tuning can be time consuming. Foxboro Automation added autotune to their DCS systems PID controllers ~20 years ago for that very reason. BUT, if the field input elements and their control elements are not properly sized control is impossible. Case in point was a flow loop. Flow input was from a differential pressure gauge cell with an orifice plate and the control element was a pneumatically controlled butterfly valve. I was getting reports from the area that it was not working and the instrument technician told me he could find nothing wrong. He had gone over the field and DCS wiring, checked the I/O cards, the DP cell, and the pneumatic valve controls and could find nothing wrong. I spent several hours attempting to tune the loop even using autotune and it would not perform as it should. I eventually went to the guy who had specified the control elements and was told that he had just used some spare salvaged valves and had not actually purchased the required valve but simply used what seemed to be about the right size. Problem found! It could not overcome the out of specification valve and never would without the correctly sized valve and trim.
 

Papabravo

Joined Feb 24, 2006
22,082
I went back and looked at the actual transfer function from your text and redid the simulation. The shape does not change much, but the location of the minimum magnitude point does.

1649509356345.png
 

Thread Starter

tindel

Joined Sep 16, 2012
939
Perhaps I should ask my question again. My book says that the radial frequency (w) is the inverse of the time (1/T) (see my initial image)

In fact, @Papabravo's second post proves my point. A differential time of 1 second should be 1Hz, but clearly the zero associated with the derivative is ~0.15Hz or so. Therefore, fd = 1/(2*pi*Td) = 0.159Hz, and the angular frequency is then 1rad/s.

Perhaps I've answered my own question. The angular frequency (rad/s) is 1/T while the frequency (Hz) is 1/(2*pi*T).

Quite the brain bender. And defies the w=2*pi*f definition.
 

Papabravo

Joined Feb 24, 2006
22,082
Perhaps I should ask my question again. My book says that the radial frequency (w) is the inverse of the time (1/T) (see my initial image)

In fact, @Papabravo's second post proves my point. A differential time of 1 second should be 1Hz, but clearly the zero associated with the derivative is ~0.15Hz or so. Therefore, fd = 1/(2*pi*Td) = 0.159Hz, and the angular frequency is then 1rad/s.

Perhaps I've answered my own question. The angular frequency (rad/s) is 1/T while the frequency (Hz) is 1/(2*pi*T).

Quite the brain bender. And defies the w=2*pi*f definition.
Yes. The scaling factor of 1/(2*pi) just converts angular frequency in radians/sec to angular frequency in revolutions per second, or cycles per second which is how frequency was referred to when I was a young radio enthusiast (ca. 1960). From the Wikipedia article:

The SI derived unit of frequency is the hertz (Hz),[5] named after the German physicist Heinrich Hertz by the International Electrotechnical Commission in 1930. It was adopted by the CGPM (Conférence générale des poids et mesures) in 1960, officially replacing the previous name, "cycles per second" (cps). The SI unit for the period, as for all measurements of time, is the second.[6] A traditional unit of measure used with rotating mechanical devices is revolutions per minute, abbreviated r/min or rpm. 60 rpm is equivalent to one hertz.[7]

Apology: I wrote post #2 without looking at the transfer function you were talking about, and the circuit from post #2 describes a traditional Lead-Lag compensation scheme to be used in conjunction with the transfer function for some unspecified "plant". The circuit in Post #5 is the traditional PID construction which involves the summation of three terms. They are not the same thing. Sorry for my confusion.
 
Last edited:

Thread Starter

tindel

Joined Sep 16, 2012
939
Right - T, in the books case, is the time for 1 revolution to complete. Which is great for mechanical folks but is a pain for electrical folks.

Anyway - Ultimately what I'm trying to do is make this intuitive for my EE brain. I think there are three inputs: k, fi (Hz), and fd (Hz)

Then make the following equations:
Ti=1/(2*pi*fi)
Td=1/(2*pi*fd)
Dc=k*(1+1/(Ti*s)+Td*s)

Then in octave, this produces the following gain plot when
k=0.175
fi=6000
fd=800
1649514870735.png

This ends up being super intuitive to me. k adjusts the minima of the system - in this case ~-17dB, fi adjusts the frequency break point at -17dB, and fd adjusts the final zero at -17db. The assymtotes align nicely with the frequencies input into the system. In this case, fi>fd so the zeros end up being the complex conjugate at ~2200k.
 

Thread Starter

tindel

Joined Sep 16, 2012
939
Now if I could come up with a way to set the center frequency (fc), and the q, and have it calculate the fd and fi, I'd really be in business. I'd still also need k.
 
Last edited:

Papabravo

Joined Feb 24, 2006
22,082
The center frequency should be the geometric mean of the two corner frequencies:

\(f_{0}\;=\;\sqrt{f_{i}*f_{d}}\;\approx\;2190.9\;\text{Hz} \)

I expect it is where the red and the green trace intersect.

This is my simulator output with those values. Not sure I understand why it looks different from your plot.
Edit: I think your constant term needs to be:

\( K \left( \cfrac{T_d}{T_i} \;+\;1 \right ) \)

1649518652764.png
 
Last edited:

Thread Starter

tindel

Joined Sep 16, 2012
939
I think it's because you have the Td/Ti in the proportional section, which is changing the PID controller slightly, and not allowing for the zeros to be complex.

So then are these equations right given an input of fo and Q?
fi=fo*Q
fd=fo^2/fi

They seem to be good enough for government work:
k=0.175
Q=2.7
fo=2200
1649519153375.png
 
Last edited:

MrSalts

Joined Apr 2, 2020
2,767
Are you looking for an intuitive description of PID in general or an intuitive description of the laplace transformation of PID in post 1?
What are you controlling? A frequency of a signal, a rotation speed of a motor (RPM), temp, position, ...
 

Papabravo

Joined Feb 24, 2006
22,082
I implemented the equation given in the book. When you expand the product of the terms with Ti and Td you get four terms, two of which are constants. Here is the revised simulation which actually can measure the center frequency and it appears to be the geometric mean of the two corner frequencies. If you want to ignore the ratio of the two, time constants, you need to conclude that is very small. If they are equal or large, then the effect will be noticeable.

\( D(s)\;=\;\cfrac{K}{s} \left[\left(T_Ds+1)(s+\cfrac{1}{T_I}\right)\right] \)
\( \;=\;\cfrac{K}{s}\left[T_Ds^2+\cfrac{T_Ds}{T_I}+s+\cfrac{1}{T_I}\right] \)
\( \;=\;K\left[T_Ds+\left(\cfrac{T_D}{T_I}+1\right)+\cfrac{1}{T_Is}\right] \)

1649523751220.png
 
Last edited:

Thread Starter

tindel

Joined Sep 16, 2012
939
Are you looking for an intuitive description of PID in general or an intuitive description of the laplace transformation of PID in post 1?
What are you controlling? A frequency of a signal, a rotation speed of a motor (RPM), temp, position, ...
I'm trying to get an intuitive understanding of what the bode plot should look like based on the input values provided. The book does a poor job at this, but now I think I've got it figured out based on this thread. So thanks to those who contributed.
 

Thread Starter

tindel

Joined Sep 16, 2012
939
I implemented the equation given in the book. When you expand the product of the terms with Ti and Td you get four terms, two of which are constants. Here is the revised simulation which actually can measure the center frequency and it appears to be the geometric mean of the two corner frequencies. If you want to ignore the ratio of the two, time constants, you need to conclude that is very small. If they are equal or large, then the effect will be noticeable.
\( D(s)\;=\;K\left[T_Ds+\left(\cfrac{T_D}{T_I}+1\right)+\cfrac{1}{T_Is}\right] \)

Note that this equation is essentially the equivalent to classical PID equation.

\( D(s)\;=\;K\left[1+\cfrac{1}{T_Is}+T_Ds\right] \)

Td/Ti has just been absorbed as a constant into the 1. A trivial change mathematically, but makes a big change to the bode plot, as you correctly observed the differences between what I've provided, and what you've provided. Note this is also referenced in the paragraph within the photo in post #1
 
Top