PID - MicroLogix Temperature Control

Greetings Peter,

here is a little more information to throw at the “RG bit” issue ... last night I put the software simulators aside and fired up the original real-world Hotrod ... basically I ran the same tests on the Hotrod that I had tried earlier ... first with your new simulator ... then with my own simulator ...

first a basic recap:

using Peter’s simulator, turning the RG bit ON or OFF caused radically different responses from the PID ...

using my own simulator, turning the RG bit ON or OFF caused little or no differences in the PID’s responses ...

and incidentally just for the record, my simulator is called: the “RAMROD” - © Copyright 1999, R.H. Beaufort, Charleston, SC – All rights reserved ... (get it? ... HOTrod vs. RAMrod? ... real-world hardware vs. computer memory ... well, personally I think that it’s a very clever name ... )

and now for the real-world Hotrod’s responses ...

[attachment]

the top graph shows the response to a step change (100 to 350 degrees) in the PID’s setpoint ... and as noted, in this test the RG bit was turned ON ...

the bottom graph shows the response to the same setpoint step change ... but in this test the RG bit was turned OFF ...

so we can see that turning the RG bit OFF gives slightly more “noise” to the CV signal ... but the most significant detail is that in both test cases, the PID generated essentially the !SAME! CV signal ...

this proves (at least to my personal satisfaction) my assertion that turning the RG bit ON has no “downside” ... it simply gives us the advantage of one additional decimal place of resolution for the Kc (Proportional) and the Ti (Integral) settings ...

Peter, in an earlier post you politely told me that the experiment that I had suggested for the RG bit’s response was not a valid test ... you’re certainly entitled to your own opinion, and I take no offense at your comment ... but personally I still think that the test was a perfectly valid one ... but regardless, I don’t see how anyone could possibly argue that the tests shown in the figure above are invalid ... after all, this is real data taken right from the real Hotrod ...

but just in case ... can anyone come up with any other tests that you’d like to see me run on the Hotrod? ... just let me know and I’ll do what I can ...

and now for the BIG question ... if turning the RG bit ON caused no significant change in the CV response with MY software simulator ... and also, turning the RG bit ON caused no significant change in the CV response with the real-world Hotrod ... then why on earth did turning the RG bit ON cause such a drastic change in the CV response of Peter’s simulator? ...

the only reasonable answer that I can come up with, Peter, is that there is some minor flaw in the design or operation of your simulator ... and just in case the word “flaw” doesn’t sit too well, let’s borrow a line from the old Willy Nelson song about the cowboy: “He ain’t wrong – he’s just DIFFERENT” ... well, the simulator was supposed to simulate the Hotrod ... so maybe it ain’t “wrong” ... but it sure is “different” ...

now I sincerely don’t want to appear overly critical ... I’m only trying to be helpful ... and I’m quite sure that IF such a flaw (or “difference”) DOES exist, then you’ll certainly want to identify it and eliminate it ... and in a previous post, you DID ask for my comments ...

and so (offered in a genuinely helpful spirit) here’s what I’ve come up with so far:

item 1 ... consider the “open loop” test which I ran on your simulator and compare it to the “open loop” test which I ran on the real-world Hotrod ... the characteristics of the simulator are quite close to the characteristics of the Hotrod ... except for the lack of any deadtime in the simulator ... I find that lack of deadtime to be quite troubling ...

item 2 ... consider the “closed loop” test which I ran on your simulator and compare it to the “closed loop” test which I ran on the real-world Hotrod ... the characteristics of the simulator are SIGNIFICANTLY different from the characteristics of the Hotrod ... even using an EXTREMELY high proportional gain, I was unable to force your simulator into a pattern of sustained oscillations ...

now I’m certainly NOT saying that oscillation is a “good” thing ... quite the contrary ... oscillation in the field is invariably a “bad” thing ... but the simple fact remains that your simulator was presumably designed to simulate the operation of the real-world Hotrod ... and the real-world Hotrod DOES have a definite tendency to oscillate ... I actually spent a lot of extra effort to incorporate that tendency into the Hotrod’s design ... remember that I designed and built a set of six of these things as lab equipment for my students’ hands-on exercises ... the students need some experience with an oscillating system and the Hotrod provides that experience ...

item 3 ... now we come to the perplexing problem of the RG bit ... turning this bit OFF or ON should have no appreciable effect on the response of the PID ... but there IS, however, a significant effect on the PID’s response when the RG bit is applied to your simulator ... this same effect is NOT seen when the RG bit is applied to the real-world Hotrod ... or to the Ramrod simulator that I wrote ...

item 4 ... take a look at the tuning values that you used for your simulator’s PID: Kc=41.0 Ti=2.7 Td=0.63 ... I’ve got a very strong suspicion that there’s something sort of fishy about that “41.0” proportional setting ... the real-world Hotrod uses something in the neighborhood of “2.20” ...

and so ... based on all of this evidence, the only reasonable conclusion that I can come to is that there is something “flawed” in the design or operation of your simulator ... it may be something minor ... but I’m sure that it’s there ... and since you asked for my input, I’m doing the best that I can to systematically help you find and correct it ...

finally ... if there are any more tests that I can run on the Hotrod to help you out, just let me know ... it might take me a day or two to find the time, but somehow I’ll make it happen ... personally I’d like to see you bring this whole simulator idea to a successful conclusion ...

realrodc.jpg
 
tips about posting trends ...

BobO said:

Sorry the pictures are so big. I tired the shrink them but then lost readability

Bob, I’ve found it helpful to simply “open” the trend and leave it in its original size ... specifically, don’t "maximize" the trend window while you’re graphing ... then hit "Print-Screen" to capture the entire screen to the Windows clipboard ... and "Paste" the clipboard into Windows Paint ... now you can use Paint’s “Selection Tool” to lasso just the part of the screen that you want ... and use "Edit/Copy To" to save just the selected portion to a new file ... effectively this “crops” the full-screen picture down to a manageable size ...

finally ... I’ve found it helpful to change the trend’s background color to white ... and to use dark colors for the pens ... this saves a LOT of toner when I decide to print my trends out on paper ... and makes it much easier to mark up interesting features with a pencil ...
 
Greetings to all,

in an earlier post (#23) I mentioned that:
the length of time (the period) between successive oscillations is a VERY important characteristic to consider when preparing to tune a control loop

then in post #27, Thomas Sullens asked: “why?”

the simple answer would be: “read this and you’ll see” ... but that would be way too easy ...

I don’t have time to go into a LOT of detail ... but maybe this will help ... disclaimer: the following is a general beginner-level discussion ... there are exceptions to all of these “rules” ...

basically each “closed-loop” control system has certain unique characteristics ... let’s use my six individual Hotrod stations as examples ... specifically, Hotrod #1 has slightly different operating characteristics from Hotrod #6 ... even though I built all six of the Hotrods at the same time and to exactly the same specifications ... now if all of the Hotrods COULD have been made to be functionally IDENTICAL, then one universal set of tuning parameters (our Proportional, Integral, and Derivative settings - PID) would suffice to properly tune ALL of the Hotrods ... (and each student could simply copy the tuning values from his neighbor) ... but such is not the case ... simple variables inherent in the manufacture of each individual device give that device its own unique characteristics ...

some important characteristics of a heating device such as the Hotrod include:

1. how fast can its temperature start responding after the controller changes the drive to the heater?

2. and once the temperature has started to respond, how fast can the temperature actually rise?

3. how big a change in temperature will I get for a 1% change in drive to the heater?

4. how will a heavy load on the system affect the operation when compared to a light load?

these are the same types of questions that you would ask yourself whenever you’re deciding which new car to buy ... you crank up the car and press on the gas pedal ... does the engine rev right up – or does it hesitate just a little? ... once the engine starts to respond, does it quickly rev up to match the gas pedal position – or does it give a “mushy” response that takes quite awhile to come up to speed? ... does a little bit of gas pedal movement result in a big change in engine speed – or do you really have to stomp on it to make the engine spin? ... and no matter WHAT the engine sounds like in the dealer’s parking lot, you’re NOT going to buy anything until you’ve checked its response out on the freeway ...

so the basic idea is that you can learn a lot about a car’s engine just by checking its response to the gas pedal ... a “VVVRRROOOMMMM-VVVRRROOOMMMM” response is obviously a lot different from a “putt-putt-putt” response ...

so now back to tuning the Hotrod ... the same types of questions that I listed above (and others that we don’t have time to discuss here) can be answered by running what is commonly called an “open loop” test and graphing the Hotrod’s response ...

the graph in this post should give you some ideas about how such a test might be run and how the results might be graphically analyzed ... by knowing the length of the chart’s X-axis and Y-axis and then setting up some simple ratios of “how-many-millimeters-for-this-compared-to-how-many-millimeters-for-that” then we can come up with some fairly precise numbers for our analysis ...

the important thing to remember is that the purpose of this particular test is simply to gain some insight into the operating characteristics of the system ... in other words, “how will this thing react when I try to control it automatically?” ... you really need to have some type of “feel” for the system’s characteristics before you can successfully control it ...

now the “open loop” test is very popular and it’s basically easy to set one up ... but it does have a drawback ... the “open loop” test is (by definition) always done in the manual mode ... specifically, the PID controller is NOT being tested at the same time we’re testing the process itself ...

so now we’ll take up another commonly performed procedure: the “closed loop” test and try to answer Thomas Sullens’ specific question ...

once our Hotrod system has been actually connected to the PID controller, we might do the “closed loop” test ... what we’re going to do is force the system to oscillate ... we’ll graph those oscillations and then analyze the data ... hopefully this will give us even more insight into how the system will respond when we eventually try to control it ... one big advantage that the “closed loop” test has over the “open loop” test that we previously discussed, is that now the PID controller will be actively participating in the test ... so this is a lot more like the freeway “road test” for your new car than the simple “gun the gas” test performed in the dealer’s parking lot ...

but one disadvantage of the “closed loop” test is that not all industrial systems should be tested like this ... some machinery will actually tear itself right off the wall if forced into oscillations ...

anyway ... the picture in this post should give you a good idea of what a “closed loop” test might look like ... once again ... by knowing the length of the chart’s X-axis and Y-axis and then setting up some simple ratios of “how-many-millimeters-for-this-compared-to-how-many-millimeters-for-that” then we can come up with some fairly precise numbers for our analysis ...

now once someone has looked at enough of these “open loop” and “closed loop” tests ... and they’ve gotten a good bit of experience under their belt ... then (I’m told) that they develop a sort of “seat-of-the-pants feel” for how to go about tuning a control loop ... at least that’s what I’ve been told ... so far I personally haven’t reached that stage yet ... and this late in life, I doubt that I ever will ...

so now the question is: once we’ve performed our “open loop” and/or our “closed loop” test and we've measured and analyzed the graphs, what do we do next? ...

here I’d suggest that you read the classic “Ziegler-Nichols” paper which was written way back in 1942 ... far before PLCs and computers had come along ... you can find a copy here at Mr. Driedger’s excellent website ...

in all honesty I should warn you that many (most?) people nowadays (including my distinguished colleague Mr. Peter Nachtwey) don’t put too much faith in this old “dark ages” stuff ... but personally I find it fascinating and very helpful ... in my humble opinion, the main benefit of studying the Ziegler-Nichols method is that it literally FORCES my students to view the graphs from the “open loop” and the “closed loop” tests as something much more than just “squiggly lines” on a paper ... from my own personal experience, once I started seriously studying the various details on these graphs, I started gaining a LOT more insight into what each one of the individual features actually MEANS about the system to be tuned ... in short, I was learning “what-to-look-for” on the trends ...

once you’ve worked your way through the old Ziegler-Nichols paper, then I’d suggest that you take a look at this previous example showing how I applied that old “dark ages” approach to an actual graph to come up with some “ball park” tuning values ...

and actually you’ll find that there are TWO different approaches given by Ziegler and Nichols in that old paper ... the first is based on taking a “closed loop” test ... they generally referred to this as their “ultimate sensitivity” method ... the second is based on taking an “open loop” test ... they generally referred to this as their “reaction curve” method ...

there’s lots of good stuff here folks ... in my opinion, if these old techniques were able to help people tune loops back in the old days before computers and PLCs, why would they suddenly become totally useless today? ... the elemental laws of physics didn’t change just because we started using computers and PLCs for our controllers ... the old-timers had to rely on springs, and levers, and pressures, and all sorts of gadgets and what-nots for their controllers ... and these old voodoo tricks helped them get by ... in my humble opinion, this old stuff is still well worth studying ... I know that it’s helped me ...

in summing up I’d like to discuss Thomas Sullens’ comment:
And I hope you can get Peter straighten out????

I’m quite sure that Thomas intended for this to be in a humorous vein ... but I’d like everyone to know that I consider Peter to be WAY ahead of me in this process control subject ... but ... he and I DO have very different approaches to the same subject ... his approach seems to be much more “mathematically” oriented ... mine is more “visually” oriented ... to be honest, when Peter talks about “pole placement” and the “s domain” frankly I don’t understand a word he’s saying ... I just don’t have (nor do I desire to have) the “elegant math” background that Peter enjoys ... personally, I think that my “kung-fu” is much better than his ... but I’m also sure that Peter is firmly convinced that his approach is better than mine ... so be it ...

the major point is that even though Peter and I might seem to “disagree” from time to time, I’m extremely glad that he and I (and many others) can get together here on Phil’s excellent forum and discuss our different viewpoints ...
 
Heater Head

First I need to say sorry if I mislead anyone with the earlier trends thinking they were from a real system, the results I listed were from just playing around with the simulator and Peter ask me to post thinking they were from a real application.

This trend is from a test on a “Heater Head”. The heater head in this case is a 4 1/2” diam. Al. disk that is 1” thick with some machining in the middle for mounting and a circular grove for the 350 W heater. This heater head is used to seal the film to a food container.

I played with the TC card filter but ended back to default @ 60HZ.

I am cooling the Heater head down so I can do a larger step in temp.

[attachment]

Time Constant(TC) was 30 for this trend.

heaterhead.jpg
 
This next trend shows the time for the heater head to cool-down. I pointed out on the trend that it started to ramp-up at 1590 when the set point was at 1500. I let it go for a bit then adjusted the set point to 3000. TC was 30 for this test also.

[attachment]

1500 3000 tc 30.jpg
 
Bob O. Your system is overshooting.

Increase the time constant until it doesn't. Your system looks like it is a lot slower than Ron B's Ramrod or hotrod. I assume that your numbers are in x10 format so 3000 is 300 degrees.

Ron B, the real issue now is the gains and time constants I have for your system. I don't think they are the same as you ram rod system. What are the gain and time constant for your ram rod system? Can you supply a .dbf file of at step jump? I think we have been comparing apples and oranges. I need a copy of your systems .dbf file, or model paramaters ( gains, and time constants). Better yet would be the coefficients for the difference equation for the ram rod system. At least then we can compare the same apples then.
 
Peter,

I’ll go back and confirm this over the next few days (and I’ll let you know if I’m making a mistake here) ... but I am 100% convinced that I have NEVER posted ANY data from my RAMROD (simulator) on ANY forum ...

instead ... ALL of the data ... and ALL of the graphs that I have shared on ANY forum have always been from the real-world (hardware) HOTROD ...

I’m sorry if even mentioning my RAMROD (simulator) has caused any confusion ...

no, you don’t have to tackle two problems at one time ... if I were you, I’d just focus on simulating the real-world Hotrod ... trying to “simulate-the-Ramrod-which-simulates-the-Hotrod” is WAY more complicated than we need to worry about ... let’s don’t go there ...

PS edit: I just double-checked this current thread ... ALL of the graphs that I've posted in this one have DEFINITELY come from the real-world Hotrod (hardware) ... none have come from the Ramrod simulator (software) ... we're still on course ...
 
Last edited:
why didn't I do this a long time ago?

Greetings to Peter and all,

for anyone who's been wondering, this is what the Hotrod looks like ...

[attachment]

the soldering iron is mounted in the blue enclosure ... the air stream from the two muffin fans at the left flows through the clear tube and then through the enclosure - across the "rod" - and then exits at the right side of the enclosure ... either damper (pneumatic or gearmotor actuated) can be used to restrict the air flow and change the "load" on the heating system ...

maybe this will help everyone visualize what's going on ...

hotrod crop.jpg
 
Last edited:
Well then,

Can you make a few simple temperature changes on you hot rod system and save the trend in a .dbf file? Then I can use my 'Kung Fu :)' to compute the hot rod model. I don't think the values I have really match those of the hot rod. Last summer in the 'For the PID challenged' thread a couple time constants and gains were mention. I think I would prefer to calculate my own model from the .dbf file rather than rely on any manual method or RsTune.
 
the Hotrod continues ...

Greetings Peter,

see if this will help ... if not, just give me some specifics on what you need and I’ll try to make it happen ... all of the graphs are 22 minutes in duration ... PETERA through PETERE use a scale of 0 to 500 degrees ... I increased the resolution in PETERF through PETERH to use raw data from 0 to 16383 ...

PETERA.DBF is an “open loop” step change from 10% drive to 80% drive; the air flow was maintained at 20% throughout the test;

PETERB.DBF is an “open loop” step change from 10% drive to 80% drive; the air flow was maintained at 40% throughout the test;

PETERC.DBF is a “closed loop” test to measure the Hotrod’s period of oscillation; tuning was Kc=327.67 Ti=0.00 Td=0.00; setpoint was 200 degrees; the air flow was maintained at 20% throughout the test;

PETERD.DBF is a “stepped setpoint” change; tuning was tuning was Kc=2.20 Ti=3.06 Td=0.61; setpoint was stepped from 100 to 200 degrees; the air flow was maintained at 20% throughout the test;

PETERE.DBF is a “stepped load” change; tuning was Kc=2.20 Ti=3.06 Td=0.61; the setpoint was maintained at 200 degrees; the air flow was stepped from 20% to 40% during the test;

PETERF.DBF is an “open loop” step change from 10% drive to 80% drive; the air flow was maintained at 40% throughout the test; data is 0 to 16383 (represents 0 to 500 degrees)

PETERG.DBF is an “open loop” step change from 10% drive to 80% drive; the air flow was maintained at 20% throughout the test; data is 0 to 16383 (represents 0 to 500 degrees)

PETERH.DBF is a “closed loop” test to measure the Hotrod’s period of oscillation; tuning was Kc=327.67 Ti=0.00 Td=0.00; setpoint was 6553 (represents 200 degrees); the air flow was maintained at 20% throughout the test;

if you look carefully, you might spot some minor discrepancies from one test to another due to the amount of “system loading” - even when the air flow percentages were kept the same ... I ran these out in the workshop and the temperature dropped a little between dinnertime and bedtime ... I do NOT think that this will affect the outcome of your analysis, however, since there would be little or no temperature change from the beginning of any one graph to the end of that same graph 22 minutes later ... this is one of the little “quirks” of working with a real-world system as opposed to a simulator ...

I’ve also included a quick screen shot of each test ... I doubt that you’ll even need to look at these since you’re more interested in the raw data ... others might want to take a glance at them though so I put them in the ZIP file just in case ...

hope this does what you wanted ... let me know if you need more ...
 
Re: the Hotrod continues ...

Ron Beaufort said:
hope this does what you wanted ... let me know if you need more ...

Thanks, Ron. I am home and will try my 'kung fu' on the the data. The trick is to get the model right. Then the PID gains can be easily calculated. A quick look does show that the system has at least two real poles and what really does appear to be a dead time. Dead times are bad news. Dead times serverly mess up my calculations and make everything more complicated. Normally dead times are the results of transport times such as material on a conveyor and not something that isn't moving like the 'Hot Rod' system.

I am going to use the techniques discussed in this thread Peter Ponders Linearization
I am going to find the program in BrianE's link and try dash's techique on the 'hor rod' data.

I am tired from flying and sitting in air ports. I will get to this tomorrow.

One more thing. I see your SP and PV must be in AtoD counts and the output is in DAC counts. I had my SP and PV in degrees time 10. I will try the PID your way.
 
Update, I finally have a good model of the Hot Rod.

Hot Rod Identification and Simulator Calculations.

The above link is to a Mathcad web page that shows my calculations and verification of my model for Ron's Hot Rod. What this Mathcad work sheet allows me to do is use the RSTrends .dbf files to compute a model which in turn provides the data for the tuning. This is not an automatic process though. The Mathcad worksheet the coefficients for a model given a dead time d and a sample interval T. T and d are manually adjusted so the ISE ( remember the integrated squared error ? ) between the actual position and the estimation is minimized. BTW, this can be done using Excel's LINEST too. Once one has the model it is much easier to calculate the PID gains although systems having a dead time present a problem

Ron has been complaining about my model. I could only use the data I got from last year. Well Ron, is this close enough?

Now I need to rework my simulator to match the Mathcad worksheet.
 
Peter,

Here is the .dbf you requested. Adjusting the TC didn't have much effect on the trends. TC=50 for this data.

Thanks,
Bob O.
 
Greetings Peter,

once again - I can't open the link you've posted ... I also tried the FTP link that you mentioned in an earlier post ... it won't work either ... I've got a hunch that it's my boss' security settings that are keeping me out ...

maybe 93lt1 (or some other kind soul) can do "whatever" was done before so that I can see your files ...
 

Similar Topics

Hi Everyone. I have been reading through the forums, and I have learned a lot! I do have a specific question that I couldn't find. I have a...
Replies
8
Views
5,115
HI - I have a tough process and have been struggling with controlling my PV using a Micrologix 1400. I uploaded the file, changed .rss to .txt...
Replies
9
Views
2,009
I have 2 no.s Micrologix PLCs used for PID control variable output to 7 no.s VFD drives.2 no.s are used as i have no spare analog cards for analog...
Replies
3
Views
1,536
I'm trying to get my PID function to go into manual mode and give the CV a value through a MOV instruction. I can set the Auto/Manual bit, and the...
Replies
3
Views
1,659
Hey guys, After spending most of a day Googling looking for the answer, I finally decided to make a thread and ask the experts. I'm trying to...
Replies
5
Views
3,575
Back
Top Bottom