PID - A simple position control simulator

Here the original spread sheet with actual position rounded to 3 places and control output rounded to 4 places (close but not exactly 16 bit d/a conversion... Actually is about 17.6 bit equivalent).
 
Thomas,

Then welcome aboard.

Remember there are many levels of understand something. I could give my 5 yr old a copy of Richard Bach's "Johnothan Livingston Seagull" and he could probably read it as a story about a bird. Then if he read it again in 8th grade he would see more of the metaphores in the story... and so on. If I would read it today, I'm sure I'd learn and feel things I hadn't on my last reading years ago.

Math and science are that way too. I remember I had an intro to calculus class my Senior year in High School. The teacher told us flat out that he could really only teach us a cookbook approach to the derivates and integrals. That if we went on to Science or Engineering in college we would get a better understanding of them but really not grasp all the signifigance. Then those that went on to get jobs in experimental reasearch, where we could apply the functions to the physical would would, really begin to understand what it was all about.

Don't be discouraged. If you have an interest but lack understanding, ask questions! We all start somewhere.

nOrM
 
Peter:

Each time I see one of these "PID" related subjects come up I hope it will be the one that would get me started. Unfortunately I haven't been able to follow any of them. Would someone please explain whats happening or point me to a place where I can find out?

Thank You.
 
Peter:

Each time I see ine of these "PID" related subjects come up I hope it will be the one that would get me started. Unfortunately I haven't been able to follow any of them. Would someone please explain whats happening or point me to a place where I can find out?

Thank You.
 
ndzied1 said:
Now a question on the ITAE. You are taking the error (Target-Actual) and multiplying it by the current time. Then you are summing all these values together.
I have no books here to look this up but this just fells fishy. My inkling would be to multiply the current error by the time step and then sum them all up which is how it would be done for crude numerical integration of say a function. Am I missing something here?

Yes, ITAE stands for integrated time ABSOLUTE error. You must take the absolute value of the error otherwise they may cancel out. Multiplying the error by the time weights the errors so that the time for the PV to reach the SP is minimized. FInally you must sum all the values to integrate the ABS(ERROR)*TIME. ITAE is better for system that makes step changes in the SP. ISE is better for motion controllers that ramp the SP from one setting to another.

Norm, google for ISE ITAE. You can see that these evaluation techniques are common.

Norm, I was thinking about the resolution of a MDT rod. You are right, it gets much worse for 12 bit AtoD converters. Divide the plus and minus 5 inches into 4096 counts. It should be awful. Worse yet will be to reduce the sample time to .001 seconds. The effects of quantizing errors will be very high. The quantizing makes the output very jittery. This limits how high the differentiator gain can go.

Thomas, just play with the tuning and check out all the different spreadsheets. You did well on your tuning attempt. Try changing a few parameters and seeing the affects. You can't hurt anything. I have not explained the calculations on the calcs part of the spread sheet. Don't let the math bother you. I haven't told anyone about the math yet. I have made some comments on each field for those that are interested. I learned this stuff over years, not in a week end. Give yourself a break and some time.

Cdisher, go to the first post and download the spread sheet and read the instructions. All you need to do is to adjust the PID gains Kp, Ki and Kd so that the ISE at the bottom of the sheet is minimized. You should be able to get it below 60. You can see the results that other have got. Then play with the parameters on the graph sheet. Do not try to figure out the Calc sheet.

Don't concern yourself with Calc sheet.
 
ITAE:

So in laymans terms, when you multiply the error by the current time, you are saying that an error is worse if it occurs later in the simulation.

Perhaps this works better for step inputs because errors at the beginning are inevitable and are only multiplied by small time numbers. We would hope the control can match the straight line later in the simulation so errors there would be very bad and thus are multiplied by the larger time numbers.

Would you agree?

I'll check out the google search next.
 
You got it!

ndzied1 said:
ITAE:

So in laymans terms, when you multiply the error by the current time, you are saying that an error is worse if it occurs later in the simulation.

Perhaps this works better for step inputs because errors at the beginning are inevitable and are only multiplied by small time numbers. We would hope the control can match the straight line later in the simulation so errors there would be very bad and thus are multiplied by the larger time numbers.

Would you agree?

I'll check out the google search next.

yes, just remember. ABSOLUTE ERROR! Use ISE for systems with target generators ( motion systems ) and ITAE for systems that make step changes is the SP ( temperature systems ).
 
I'll first admit (at some risk) to being a student. I am having trouble making the transition from theory to application with PIDs. My overly general question is...How does one produce a model equation for a process? If I am asked to program control of a temp control valve or an exhaust system fan, how do I calculate the needed values? How can I come up with the equation needed?

Thanks in advance for any insight.
 
I don't want to Daze and Confuse people.

Dazed and... said:
I'll first admit (at some risk) to being a student. I am having trouble making the transition from theory to application with PIDs. My overly general question is...How does one produce a model equation for a process? If I am asked to program control of a temp control valve or an exhaust system fan, how do I calculate the needed values? How can I come up with the equation needed?

Thanks in advance for any insight.

So far I have just wanted people to tune the model by changing the PID gains and the system parameters on the front graph sheet. I have not explained anything about the calculations sheet to keep the math content low and not scare any one away. There are probably many that are dazed and confused.

You get credit for asking this excellent and practical question.
Below is a link to help you on your quest. It goes way to fast and does not have enough detail but you and a professor can figure it out.

Warning, your head will hurt, but if you must know now.

I suggest you just play with the PID gains and system parameters and notice the result. One can get a lot of experience quickly tuning the spread sheet. I must go SLOWER to keep from dazing and confusing people any more than what they are ready are.

Silver, that is good enough. The practical difference between 58 and 60 is small.
 
For those of you who are really ready to hurt your heads (Peter N., you'll probably like this link), try here for a technical paper on different methods of tuning PI and PID controllers. I warn you, this is for those with/who want advanced knowledge. I believe there are 280 tuning rules in this 0.9 Mb paper. Enjoy!
 
This is good stuff Rytko, but......

I was hoping to do this with out all the math. I don't want to scare anyone off. However, this does answer the question "is there another way?" One can also see that each model has its own set of equations and solutions for the PID gains. This is one of the points I am trying to make.

Rytko, I have all the simpler models worked out on my laptop. I use Mathcad. Finding this sight a few years ago would have saved me some time.

All I want people to do now is to tune the system.

Well done, Croakus, how much time did it take? Do you use the ISE to help guide your tuning procedure? Did the graphs help? Did you consider this hard or easy?
 
poles

a:=1/time constant. This has units of frequency in radians per second. This is also known as an exponential frequency.
l:= lambda. -l is the desired location for the three real poles.
Peter what do you mean by 3 real poles and what is radians per second?
Is there any hope or should I just read??
 
Re: poles

Thomas Sullens said:
a:=1/time constant. This has units of frequency in radians per second. This is also known as an exponential frequency.

A radian is a unit of angle like a degree. I found this definition on the web "An arc in a circle, equal in length to the radius; an angle (57.3°) at the center of a circle, formed by 2 radii cutting off such an arc. Thus one rad = 57.3°." There are 57.3 degrees per radian or 2*PI radians per 360 degrees. One converts from hertz to radians per second by multiplying the frequency by 2*pi. w = 2*pi*f.

Mathemetician often express frequency in radians per second. You can conver ratians per second to frequency by dividing by 2*pi.

Thomas Sullens said:
l:= lambda. -l is the desired location for the three real poles.
Peter what do you mean by 3 real poles and what is radians per second?

First, what is a pole? A mathematical definition is where the denominator of a fraction becomes 0. Example:

Code:
  1
-----
 s+3

When s = -3, the denominator is equal to 0. At this point the whole expression becomes infinite ( not good if it is a control system ).
Note in this case 'a' = 3 radians per second and the time constant is 1/3 seconds.

Now for a more practical explanation:

A real pole causes a lag in response. Perhaps you are familiar with the response of a RC low pass filter. One can calculate the time constant by multiplying the resistor's value by the capacitor's value.
See this link:

RC Low Pass Filter

A three pole filter is one that would take 3 RC filters and cascade them so the output of the first stage is connected to the input of the second stage and the output of the second stage is connected to the input of the third stage. Any noise on the input of the first stage would be filtered pretty well by the time the signal gets to the output of the 3rd stage.

Back to the equation:

Mathematically a 3 real pole system might look like this:

Code:
  1     1     1
-----*-----*-----
(s+3) (s+3) (s+3)

There are imaginary poles too. They come in pairs and cause oscillations. We will get to that later.

Thomas Sullens said:
Is there any hope or should I just read??

You must put a little into this. You should read. You definitely should play with the spread sheets. I am trying to make this fun and interesting. I am giving everyone including myself a breather until the weekend. I will do a new spread sheet to show the response of 1,2 and 3 real pole systems so you can get a feel for how they respond to inputs.
 

Similar Topics

Been working with PLCs for a couple of decades, but almost 100% DirectLogic. Have a customer who wanted me to make a couple of simple changes to a...
Replies
3
Views
1,127
Hey All In my down time between projects i enjoy building different types of control systems. I already do it all day for work but like to tinker...
Replies
7
Views
1,701
Hi all. Simple question here. I've seen both sides of the spectrum here and no one can give me a concrete answer. On a AB CLX platform PID...
Replies
16
Views
6,696
So you thought you would take the weekend off! No way. The link below is saying download me! Give me a try! The link is to a spreadsheet that...
Replies
15
Views
23,572
Hello, has anybody done a "user block", that delivers PID functionality? This could have been done using simple control blocks available in...
Replies
1
Views
6,286
Back
Top Bottom