PID - MicroLogix Temperature Control

Peter,

Here is a the .dbf for On/Off control I ran this morning. If I need to change something just let me know.

Thanks,
Bob
 
There is still some confusion

Most if it is cause because I swith between the RG bit being on and the RG bit being off. Kc should be 20.2 not 2.02. That will make the response a little more snappy. I am basically using the techniques used in the lambda tuning docuement you bought last year. I can choose a lambda to make the system response faster or slower. However there is a limit to how fast I can make the system due to the dead time. We can compenstate for the dead time and get faster response with higher gains. Do you want to try to predict the future?

Attached are my estimates of how your system should work with my gains. Since I have higher gains I can use ( barely ) a 10 minute plot. The RG bit is off. I like the way the output makes one gentle curve when coming out of oscillation.

Ron, could you post your program? I would like to see what you do differently. I have a SLC5/05 too.
 
There is something to change

Bob O said:
If I need to change something just let me know.

Thanks,
Bob

Bob O, I bet you have the heater sensor very close to the heater unlike Rons. A quick glance show your system has no detectable dead time and that the sensor responds MUCH faster than Ron's. I tried fitting your data to the same model as Ron's HotRod but I think you system will actually be just a first order lag that can be simply controlled with on-off control.

The question I have is why are the data points two seconds apart? I think your system would respond better if the update rate was faster.
Consider 1 second updates like in my examples or even .5 seconds. I hope you got the SSRs installed. Your system responds TOO quickly to be using two second updates. SMC and simple on-off control works better with faster updates. Your gain is much higher than Ron's HotRod. I will post a PDF file after I check to see if your system fits a first order model better. It looks like it will work very well with a faster update.

One, more thing. I am going to try doing the control in AtoD counts in stead of in degrees * 10. This way each count represents 1 in 16384 as instead of 1 in 5000. This should make the derivative term in a PID and the Rate term in your SMC more sensitive and function better. I will convert my SMC-TEMP-ML to use Bob's data. BoBO. 0-16383 corresponds to how many degrees. I need this for proper scaling.
 
Last edited:
Peter,

Your are correct about the TC being right next to the heater and the 2 seconds is just data logging intervals that I can change in RSView.

The on/off control is running all the time with the SSR hooked up.

I only like to test to about 300F because of my test bench set-up and so if I understand you right 0-16383 would be 0-300F. If this is not correct let me know.

Thanks,
Bob

Edit. I can install another TC in a position that will add deadtime if you wanted to test with it.
 
Last edited:
Greetings Peter,

you said:
Ron, could you post your program? I would like to see what you do differently. I have a SLC5/05 too.

I’m sure that you just overlooked it ... but I (briefly) discussed the PID_ONLY.RSS program in my post #59 ... and I included a copy of it in the .ZIP file attached to my post #60 ... this stripped down program is the one that I’ve been using to test the Hotrod with your tuning suggestions ... incidentally, the other controls for the Hotrod (fans, air flow, etc.) are all being handled by a separate program running on a PLC-5 which I already had wired up ... all that the SLC-5/04 is doing is controlling the temperature loop so there's not much to it ... just three rungs ...

one SCP rung to scale the input ...
one rung for the PID ...
one SCP rung to scale the output ...

I think that this is what you're asking for ... let me know if you need more ...
 
Scaling

What temperature corresponds to the input min and input max on the SCP block in Rung 000? This is important. Does the hardware board have a separate scaling mechanism? I know NOTHING about AB AtoD boards.

I notice that your set point is 3277 counts. I assume this corresponds to 100 degree. I assume that the AtoD board returns
5898 counts when the temperature is 100 degrees.
 
Bob O, this is what I have so far.

The attached file shows best best results I could get for your system given the data. However, the model is suspect because it predicts a very high ambient temperature of over 200 degrees. Just because the model can estimate the temperature well doesn't mean the model is accurrate. The model must be sanity checked. The first check it to check what temperature would result if the output was set to zero for a long time and then to 100%. This model does not pass that test. I think I could get better results if the data started from a constant temperature and then did a step change from the low temperature to a higher temperature like what Ron B did for the HotRod data.

The good news is that you can see there is no detectable dead time. Every time the heater is on you can see both the actual temperature and the estimated temperature rise in phase. This is good.

Back to the HotRod gain confusion. The gain I calculated was 2.02 %output/degree of error. Since I was representing temperature in a *10 format I had to multiply the gain by 10 for my system. When using scaled PV and SP one must be careful to scale the gain to make sure it is truly unitless. The output scale of 16383/100 and the input scale of 500 degrees/16383 must be applied.

Code:
2.018%  16383 counts 500 degrees
------*------------*------------=10.09
degree  100% output 16383 counts

I hope that Ron did not just put 2.02 into his Kc.

I have my system converted to operate in PID counts instead of in tenths of degrees. This provides better resolution.
I still have a problem with the RG bit. I still gets results similar to the first trend graphs. I will convert the program to run on a SLC and see if the RG bit problem exists there.
 
regarding scaling issues ...

sorry, Peter, I guess I should have been more specific ... but the answer to your “what the heck cards are these?” question can be found under the Configure I/O feature ... there is a 1746-NI4 analog input module in slot 7 ... and a 1746-NO4I analog output module in slot 8 ...

[attachment]

using the 1746-NI4 input module ...
0 degrees temperature = 4 mA current = 3277 data
500 degrees temperature = 20 mA current = 16384 data (not a typo)

using the 1746-NO4I output module ...
6242 data = 4 mA current = 0% drive to the heater
31208 data = 20 mA current = 100% drive to the heater

if you need any more specific information (for example: where on earth did AB come up with these wacky scaling numbers?), then this might come in handy ...

SLC-500 4-Channel Analog I/O Modules User Manual

as you are already aware, the PID instruction for an SLC or a MicroLogix 1500 system MUST have its PV (input) and CV (output) signals scaled from 0 to 16383 (not a typo) ...

you said:
I notice that your set point is 3277 counts. I assume this corresponds to 100 degree. I assume that the AtoD board returns
5898 counts when the temperature is 100 degrees.

(3277 / 16383) * 500 = 100 degrees (your assumption is correct) ...

(100 / 500) * (16384 – 3277) + 3277 = 5898 (your assumption is correct) ...

sorry for all of the confusion ... but this is “par for the course” on most PID applications on an SLC platform ... the MicroLogix 1500 analog modules usually provide a “scaled for PID” setting which eliminates most of this hoop-jumping ... specifically, the input module can be configured to automatically provide a 0 to 16383 PV signal ... and the output module can be configured to automatically use a 0 to 16383 CV signal ...

finally, I'll try to dig through the RG issues you've raised sometime this weekend ... in the meantime ... as stated in my post #20:

so my present position is that turning the RG bit ON does NOT alter the operation of the PID ... all it does is allow us one more decimal point of resolution when we enter the Kc and Ti settings ... and so (even in SPITE of the evidence offered above) I still maintain that:

Kc=41.00 Ti=2.70 Td=0.63 with the RG bit turned ON ...

will give exactly the same results as:

Kc=41.0 Ti=2.7 Td=0.63 with the RG bit turned OFF ...

I still haven't changed my position ... and I proved (at least to my personal satisfaction) my position to be correct in my post #32 ...

I'm still not sure why you're having such radical results with the RG bit ... basically you should just set it and forget it ... specifically, if you have (for example) "good" response with the RG bit OFF using the settings Kc = 1.2; Ti = 2.3; Td = 0.34 ... then you should get the same "good" response with the RG bit ON using the settings Kc = 1.20; Ti = 2.30; Td = 0.34 ... specifically, you should NOT have to alter either the Kc setting or the Ti setting by a factor of 10 ...

see you soon ...

hotrodio.jpg
 
Last edited:
I think there is a difference between the ML1500 and the SLC5/05

I will test the SLC5/05 next week to see if setting the RG bit is the same. I stand by my statement that there is a problem with setting the RG bit on the Micro Logix 1500. I think the problem occurs because the individual PID terms are limited to 100% instead of limiting the total ouput to 100%. I have updated the model and the gains for the HotRod. See the HotRod.pdf I will post in the shared data area.

G=3.77 degress/%output
Tau0 = 44.98 seconds
Tau1 = 169.454 seconds
dead time = 12 seconds. Same as before.

The resulting PID gains for my desired response are:

K =1.41 %output/degree error
Ti=2.527703
Td=.519066

These gains are a little lower. These should handle the step jump better, but maybe not the change in load. Everything is a compromise. I will post a HotRod.zip to the shared files area. I will include some bit maps that you have provided and the .dbf files.

I will also post a SMC.zip with the SMC related files. I will update these files as needed. I still need to do the SLC5/05 testing and the feed forward example.
 
Greetings Peter,

I don't see anything related to our PID thread in the "shared programs" area ... but then again, this is the first time I've even gone there so maybe (probably?) I'm just doing something wrong ... anyway, I hope to have time to check back again this afternoon and possibly run whatever you need this weekend ...

regarding your suspicion of a PID difference between the MicroLogix 1500 and the SLC processors ... there certainly COULD be one ... you’ll note that the SLC processors ONLY support integer control blocks for PID ... but the MicroLogix 1500 ONLY supports the new (and improved?) PD file format for its PID control block ... so maybe there IS something weird going on there after all ...

I don’t have a MicroLogix 1500 handy ... but I might be able to come up with one next week ... I’ll let you know ...

by way of apology ... last weekend I “cleaned” the ceramic tile in one of my bathrooms with an eight-pound sledge hammer ... now this weekend I’m tearing out rotted wood floor joists and sills ... I knew that the shower stall was leaking when we bought the house several years ago ... it’s finally time to rip out the old and put in the new ... believe me, I’d MUCH rather be doing PID ...

finally ... I’m not 100% sure about this so I’ll ask it straight up ... ARE you ... or are you NOT ... presenting your PV data to the PID in the range of 0 to 16383? ... I’m sorry that I haven’t had time to dig through the programs you’ve posted ... I’m sure the answer to my question is in there somewhere ... BUT ... if you’re NOT using the 0 to 16383 range, then that might be where most of our problems are coming in ... that little man inside the PID box is very stubborn ... anything other than a 0 to 16383 input range usually (always?) causes trouble ...

just in case you are NOT already using a 0 to 16383 range for your PV, let me make a suggestion ... I'd start out by using the recommended 0 to 16383 range for all of my experiments ... then (and only then) after I got everything working as well as possible, I MIGHT try to "fine tune" the PID by tinkering with the input range ...
 
Last edited:
HotRod.zip is in the download area.

Ron Beaufort said:
Greetings Peter,

I don't see anything related to our PID thread in the "shared programs" area ... but then again, this is the first time I've even gone there so maybe (probably?) I'm just doing something wrong ... anyway, I hope to have time to check back again this afternoon and possibly run whatever you need this weekend ...

HotRod.zip is there now. I will update HotRod.zip with an index.txt or files.txt that describe the files. I hope you don't mind me including some of your files. I realize now I forgot to add the .dbf files. I will add them later.

Ron Beaufort said:
regarding your suspicion of a PID difference between the MicroLogix 1500 and the SLC processors ... there certainly COULD be one ... you’ll note that the SLC processors ONLY support integer control blocks for PID ... but the MicroLogix 1500 ONLY supports the new (and improved?) PD file format for its PID control block ... so maybe there IS something weird going on there after all ...

I don’t have a MicroLogix 1500 handy ... but I might be able to come up with one next week ... I’ll let you know ...

See my comment in the last post about limiting the individual PID terms to 100%.

Ron Beaufort said:

by way of apology ... last weekend I “cleaned” the ceramic tile in one of my bathrooms with an eight-pound sledge hammer ... now this weekend I’m tearing out rotted wood floor joists and sills ... I knew that the shower stall was leaking when we bought the house several years ago ... it’s finally time to rip out the old and put in the new ... believe me, I’d MUCH rather be doing PID ...

Me too. I must take time out to exercise. "I exercise therefore I am."

Ron Beaufort said:

finally ... I’m not 100% sure about this so I’ll ask it straight up ... ARE you ... or are you NOT ... presenting your PV data to the PID in the range of 0 to 16383? ... I’m sorry that I haven’t had time to dig through the programs you’ve posted ... I’m sure the answer to my question is in there somewhere ... BUT ... if you’re NOT using the 0 to 16383 range, then that might be where most of our problems are coming in ... that little man inside the PID box is very stubborn ... anything other than a 0 to 16383 input range usually (always?) causes trouble ...

just in case you are NOT already using a 0 to 16383 range for your PV, let me make a suggestion ... I'd start out by using the recommended 0 to 16383 range for all of my experiments ... then (and only then) after I got everything working as well as possible, I MIGHT try to "fine tune" the PID by tinkering with the input range ...

I like to use engineering units. Up until NOW I have had the SP and PV scaled in degrees*10. The files I just posted use the scaled SP and PV in PID counts in the range of 0-16383. I can see that the PID needs all the resolution it can get because the math is done using 16 bit integers. I also wanted to follow your lead on how to use the PID as you have actually used the AB PID. At the bottom of the HotRod2a2bc.pdf I show how I scaled the degrees into PID counts.

I also included a version of the PLC program that uses proportional only with bias. The proportional gain is very low as most of the work is done with the feed forward. The point I am trying to make is that one can EASILY compute the gains using a paper and pencil from the data provided. Just added a little proportional gain and run.

Check out the Hotrod.zip and tell me if there are any additions or corrections you want to make.

I am going to get some exercise and check out a volcano. The media is making a big deal out of it.
 
Micrologic 1500 Gain/Reset/Derv

HI:

Could someone please help me to understand the gain Kc of a 1500 Micrologic.

I Have worked with other types of stand alone controllers, the controllers works based on the PB. For example a proportional band setting of 5% is calculated as follows:
Set point = 500
Measurment range = 0-1000
5% PB=5% of 1000 =50
100% output @ 475 (2.5% of 1000)
0% output @ 525 (2.5% of 1000)
If the process variable equals the set point(500), there is a 50% output. As the temperature decreases, the proportional band increases the output linerly toward 100% as the temperture falls toward 475. The output decreases below 50% as the temperature rises toward 525.

How does this translated to Kc of a 1500 Micrologic, assuming I want to keep the same PB as above? I have selected Kc=4, I=4.0 min, D=1 Min, I can't control the process as the process variable oscillates. The PID is controlling Heaters on the extruder machine.

When I start the extruder, The heaters are cold and assume I want to get to a Set point of 150. I have a low cutoff point of 125, when the temperature get to 125, I will start ramping the Setpoint 3 degrees/min until it gets to 150. The temperature keep oscillating around setpoint (10-15 degrees) until eventually settles.

Could some one help to figure the Kc? I am not sure if I understand it.
Anyone has a good way of controlling heating/cooling of a extruder using ordinary 1500 Micrologic PID?

Thanks

Sam
 
Re: Micrologic 1500 Gain/Reset/Derv

kash75 said:
HI:

Could someone please help me to understand the gain Kc of a 1500 Micrologic.

I Have worked with other types of stand alone controllers, the controllers works based on the PB. For example a proportional band setting of 5% is calculated as follows:
Set point = 500
Measurment range = 0-1000
5% PB=5% of 1000 =50
100% output @ 475 (2.5% of 1000)
0% output @ 525 (2.5% of 1000)
If the process variable equals the set point(500), there is a 50% output. As the temperature decreases, the proportional band increases the output linerly toward 100% as the temperture falls toward 475. The output decreases below 50% as the temperature rises toward 525.

How does this translated to Kc of a 1500 Micrologic, assuming I want to keep the same PB as above? I have selected Kc=4, I=4.0 min, D=1 Min, I can't control the process as the process variable oscillates. The PID is controlling Heaters on the extruder machine.

I am assuming when you say measurement range you mean degrees.
If so your AtoD card must map 0-1000 degrees into 0-16384 counts.
Tel me if that isn't so. You didn't specify above.

Your gain is 100 percent per 50 degrees. To convert to Kc which is a unitless gain one must multiply your gain in %/degee by the input and output scaling as follows:

Code:
100 percent 1000 degrees 16384 counts
-----------x------------x------------ = 20
 50 degrees 16384 counts  100 percent

A Kc of 20 is higher than the Kc of 4 you said you are using now so a proportional band of %5 is is too small, it will probably oscillate even more. This is not good. In any case you should reduce Kc until the system doesn't oscillate any more.

We normally do motion control and we get this the question about what gains to use all the time. That is impossible to answer that equation until we see a trend chart or the .dbf data. Each system is different.

kash75 said:

When I start the extruder, The heaters are cold and assume I want to get to a Set point of 150. I have a low cutoff point of 125, when the temperature get to 125, I will start ramping the Setpoint 3 degrees/min until it gets to 150. The temperature keep oscillating around setpoint (10-15 degrees) until eventually settles.

Could some one help to figure the Kc? I am not sure if I understand it.
Anyone has a good way of controlling heating/cooling of a extruder using ordinary 1500 Micrologic PID?

Thanks

Sam

Have you read the whole thread or searched the whole forum? If you provide a .dbf file from a trend graph in RS500 like Ron Beaufort did then I may be able to calculate a Kc, Td, and Ti for you. You can also try the Sliding Mode Control (SMC), instead of PID, like Bob O used. It is very easy to get SMC going.
 
Pete:

The above was just an example. My actual range for the extruder I am working with is 500 C.
The signal is a thermocouple that has much higher temperature range than 500. I scaled the PID block for only 500 degree because of the range of the set point the extruder will be operating at. We will not be running the extruder any higher than let's say 275 C. Therefore 0-500 degC is 0-16383 counts. The parameter I mentioned in my post was for the 500C range.

I will try to get some trend of the variables. Now let me use your equation for a 500C.

Gain=10

Are you saying that a gain of 10 causes more volatility than 4?

What is SMC? Is that an added hardware or software? I do not remember seeing it in 1500 Micrologic.

Thanks;

Sam
 
kash75 said:
Pete:

The above was just an example. My actual range for the extruder I am working with is 500 C.
The signal is a thermocouple that has much higher temperature range than 500. I scaled the PID block for only 500 degree because of the range of the set point the extruder will be operating at. We will not be running the extruder any higher than let's say 275 C. Therefore 0-500 degC is 0-16383 counts. The parameter I mentioned in my post was for the 500C range.

I will try to get some trend of the variables. Now let me use your equation for a 500C.

Gain=10

Are you saying that a gain of 10 causes more volatility than 4?

Yes, a Kc of 10 means you will get 10 counts of corrective output per 1 count of error. A kc of 4 means you will get only 4 counts of corrective action per count of error. A Kc of less than four will make the system respond slower but it may be more stable. How did you come up with Ti and Td?

kash75 said:
Pete:
What is SMC? Is that an added hardware or software? I do not remember seeing it in 1500 Micrologic.

Thanks;

Sam

Do not pass go. Do not collect $200. Down load the zip files
linked in the first post and go to the down load\misc section and download the hotrod.zip. If you have a spare ML1500, download these programs and test them out. They have a simulator in them that will simulate a temperature system.

Sliding mode control requires only a few rung of ladder. A MicroLogix 1500 Sliding Mode Control Program is included in the first .zip files referenced by the first post in this thread. SMC is basically a simple on-off control with a rate term. A normal On-Off control turns on when the PV is less than the SP and off when greater than the SP. The rate term keeps the PV from changing so quickly that the PV will overshoot the SP. Basically the equation is this:

Code:
s=tau*e'+e
if s > 0 then
  heater on
else
  heater off

e is the error SP-PV
e' is the rate of error, e(n)-e(n-1)/T
tau is a time constant. The smaller the faster the response.
s is the switching variable.
T is the update period.

because we don't need to ramp the SP we can simplify the equation to:

Code:
s = (PV(n-1)-PV(n))*tau+(SP(n)-PV(n))

See the SMC-TEMP-ML.RSS in the .zip files pointed to by the the link in the first post. Notice that there are NO gains and only one time constant to adjust. SMC is also very robust and responds well to load changes. NASA uses SMC for many control applications.
 

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,134
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,035
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,545
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,662
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,620
Back
Top Bottom