Gaining a better understanding of PID

Rob.Hill

Member
Join Date
Dec 2009
Location
Yorkshire
Posts
47
I've been programming PLCs/ SCADA systems for the past 6 years, including a number of PID loops.

I've recently started working for myself and as such have decided to dedicate 1 day per week to developing my skills further.

I think next thing I'd like to focus on is PID loops. Whilst I understand the basics, I'd like to fully grasp the formula(s) & how they fit into real life better.

Its been a while since I did A-Level maths, but I'm sure I'll grasp it again quick enough.

So if anyone with the detailed knowledge (Peter?!) feels like they would like to help me out (or point me in the right direction!), it would be much appreciated!
 
I had two controls classes in back in college on tuning all different kinds of control loops, including PIDs. Though it is nice to learn the fundamentals, I have yet in my career had someone give me the mathematical model of a control system, then ask me to find all the poles and holes, do a LaPlace transform, and mathematically find the best values for a PID function. In fact, that is the beauty of the PID function and why it is so popular. It is one of the very few control methods that can be tune without knowing an exact model of the system you are controlling. For the most part, they can be tuned with trial and error and experience.

If you are really interested in the math, there are plenty of websites on the internet that has all the math formulas, derivations, and examples. Just be prepared to do a lot of calculus and transforms.
 
If you guys want a more mathematical approach to control I can provide that. How deep to you guys want to go? I have not pushed this topic too much in the past because there are too few people that understand LaPlace transforms and differential equations and I never had more than two or three people attend my webinars. I have avoided bring up this topic unless one really wants to know. The last person that really wanted to learn this was Pandiani and that was about 5 years ago.

Are you willing to dig into something like this?
http://deltamotion.com/peter/Mathcad/Mathcad - t1 p.pdf
This example is from a problem present on this or maybe another forum.
 
If you guys want a more mathematical approach to control I can provide that. How deep to you guys want to go? I have not pushed this topic too much in the past because there are too few people that understand LaPlace transforms and differential equations and I never had more than two or three people attend my webinars. I have avoided bring up this topic unless one really wants to know. The last person that really wanted to learn this was Pandiani and that was about 5 years ago.

Are you willing to dig into something like this?
http://deltamotion.com/peter/Mathcad/Mathcad - t1 p.pdf
This example is from a problem present on this or maybe another forum.

I must admit what you posted looks fairly alien to me and I don't understand LaPlace transforms. I have done differential equations and integration years ago (15!), so would need help understanding those again!

Having said that I would love to further my understanding of control loops - hence if your willing to teach, I'm more than willing to learn!
 
I had two controls classes in back in college on tuning all different kinds of control loops, including PIDs. Though it is nice to learn the fundamentals, I have yet in my career had someone give me the mathematical model of a control system, then ask me to find all the poles and holes, do a LaPlace transform, and mathematically find the best values for a PID function. In fact, that is the beauty of the PID function and why it is so popular. It is one of the very few control methods that can be tune without knowing an exact model of the system you are controlling. For the most part, they can be tuned with trial and error and experience.

If you are really interested in the math, there are plenty of websites on the internet that has all the math formulas, derivations, and examples. Just be prepared to do a lot of calculus and transforms.

Helliana,
I am an engineering student and I know how to do the calculus and transforms. What I have not learned is where exactly do you apply this knowledge.

Can you give me an example of a project or process where you may need to implement a PID loop ? This might help me started.
 
Helliana,
I am an engineering student and I know how to do the calculus and transforms. What I have not learned is where exactly do you apply this knowledge.

Can you give me an example of a project or process where you may need to implement a PID loop ? This might help me started.

A great traditional application is any kind of temperature control on an oven. You can adjust your PID loops for a quick rise to temperature (which may go over your setpoint before settling down), a slow rise to an exact setpoint, or somewhere inbetween just by "turning 3 knobs." Basically anywhere were you have a loop of "this is where am at, this is where i want to be" a PID loop can attempt to get you there.

However, there are applications where you can us PID loops but they are not the best method. For instance, if you have a tank and you are trying to swing a very long barrel around to a precise location, you want it to be as fast as possible as well as being accurate as possible. It may be worthwhile to spend the extra time and effort to study and mathematically model your process and go with an more advanced control technique than PID.

There are also several applications where it is impossible for PID loops to control. Functions were the process constantly changes (such is robot devices where the environment and tasks constantly change) cannot be controlled because the control loop criteria is constantly changing. Also, rocket guiding systems are something else that PID loops generally do not have the power to control.
 
However, there are applications where you can us PID loops but they are not the best method. For instance, if you have a tank and you are trying to swing a very long barrel around to a precise location, you want it to be as fast as possible as well as being accurate as possible. It may be worthwhile to spend the extra time and effort to study and mathematically model your process and go with an more advanced control technique than PID.
Yes, but also use feed forwards as well as a PID.

There are also several applications where it is impossible for PID loops to control. Functions were the process constantly changes (such is robot devices where the environment and tasks constantly change) cannot be controlled because the control loop criteria is constantly changing.
There is nothing to stop you from changing the PID gains on-the-fly.

Also, rocket guiding systems are something else that PID loops generally do not have the power to control.
Not by themselves but they are used in conjunction with other techniques.

A PID can be used to place the poles to get a desired response. Sometime the plant poles move during the process. Now the PID gains need to change to keep the closed loop poles in the same location so the response stays constant.

Below is a link to a simulation of level control for two tanks. The idea is to control the level in the second tank using a VFD controlled pump that pumps water in a first tank than has a hole or valve in the bottom so that water can flow to the second tank. I think this was the last pdf because I started off simple and worked up to this. I was helping a student on LinkedIn with his project. I did not provide this final pdf until after he handed in his work. The student did get a A but I told him I would not have passed him because he wasn't able to write the first two differential equations that explain how the water level in the tanks behave. Meanwhile there were a lot of other 'engineers' that were annoying me because they said it is a simple application and one can tweak gains until it worked. That is true but a student doesn't go to college and take a class in controls just to learn how to tweak gains. I showed the student how the problem should be approached starting with writing the differential equations for the water level in the two tanks. On page one there is a Cv or flow coefficient for flow as a function of level. There is also an area A for each tank. At first we assumed the Cv and A were constants but in reality they aren't. The flow goes through the valve proportional to the square root of the pressure across the valve which is proportional to the level. The area of the tank doesn't need to be constant either. The time constants tau1 and tau2 are not really constant in this case and change as the plant changes. Now look at this:
http://deltamotion.com/peter/Mathcad/TwoTanks/Mathcad - t0p2 2pi tc - Alin's two tanks Cascade.pdf
Page 1 is the simple differential equations with out which I would not provide a passing grade.
Page 2-3 is where I computed the symbolic formulas for the PI controller for each tank as a function of the tank gains and 'time constants'
Page 4 is where I assigned some values to the variables. Notice that I didn't assume the areas or flows are constant.
Page 5-6 is where the differential equations for the simulation are executed.
Page 8 is where the response is plotted out.

You can see the response is a nice critically damped response regardless of the level set point. This occurs because I keep the closed loop poles in the same location by calculating new controller gains as a function of the changing level.

Notice also that at 28 minutes I added an disturbance by dumping more water to the second tank.

I did this with two simple PI controllers. I could do it with the just a P controller for the first tank and a PI controller for the second tank.
http://deltamotion.com/peter/Mathcad/TwoTanks/Mathcad - t0p2 p pi Alin's two tanks Cascade.pdf

So Helliana, a P, PI or PID controller is really pretty powerful if you know how to use it.

BTW, the first tank was supposed to be only one meter tall. One can see that the water would have over flowed the first tank. A real designer should do a simulation like I have done. Then he would know how the water level change s in the first tank as a function of the level in the second tank. Those that simply want to tweak gain would not do this simulation and the real design would fail.

I took a lot of **** from the other so called 'engineers' that suggested how to tweak gains but I asked the student, what do you want to be, a designer or a user?
 

Similar Topics

I have 8 of these systems all running the same code. Just this one seem to gain about 30 seconds in time everyday. So in 48hrs time will be...
Replies
3
Views
656
So im running into a little bit of a road block when it comes to the job field. The majority of my experience has been with Allen Bradley and...
Replies
30
Views
9,110
Good Afternoon , It seems like we always have problems with using Type J Thermocouples with our slip rings . Would using a RTD at 10...
Replies
6
Views
1,646
I am beginner in B&R Automation Studio and TIA Portal. Have an experience in electrical part of PLC cabinets. Now its time to get a new skills...
Replies
8
Views
1,674
Bla Bla Bla, why doesn't it work, l need help and l don't understand PLC's. Or better they understand everything, but can't understand +1 -1 = 6...
Replies
22
Views
6,009
Back
Top Bottom