PID - MicroLogix Temperature Control

This is NOT right.

kash75 said:
As for SSR versus contactors, I realize SSR does a much better job, however I will not be able to change it until next year. For now I have to make what I have to work for me.

I doubt what you have will work for you.

kash75 said:

It has been recommended in order to prolong the life of the magnetic relays, the loop could be running at 10-20 Sec.

If they only need to work for a year I would make sure they were worn out at the end of that time and get the loop update time short

kash75 said:

I understand the max loop update is 10.23, here what I did to make a 20 seconds.

That distorts the integrator and differentiator gains :(.

You can see the SLC5 PID does NOT function. One can see the output saturates in the wrong direction. I think there are overflow issues. It looks to me like the three PID terms added up to a number greater than 32767 so the PID treats the output as a negative number which it limits at 0. Clearly this is NOT right.
See the attached image. I used the HotRod.RSS simulation of the HotRod system with the loop update at 10 seconds with the RG bit off. The PID executes every tenth interrupt, but the simulator still executes every second. The simulator just uses the same CV for 10 seconds in a row which is what the real system would see. The gains are those I have posted before, Kc=10.09 Ti=2.65 and Td =.66. I have rounded those to 10.1 and 2.7 because the RG bit is off.

Kash, I would use my PID, but not as it is. I have not scaled it to work for 20 seconds. I need to make my PID more flexible to handle different loop update times. My PID has the advantage of using floating point so overflow, round off and other dynamic range issues are not a problem. Even so, 20 seconds is too coarse. Even with my PID, I still doubt it will work very well if at all.

hotrod 100 to 350 10 sec loop.jpg
 
Pete:

A different approach:

The PID has a variable that is called DeadBand. You can set a deadband of let's 1 degree C. When the PV is within the one degree of the sepoint, it will set a DB bit. This means that it is within the specified deadband. You know as well as I that the integrators sometimes keep integrating even the PV is over or under the setpoint. My understanding is, in the PID there is no way to just stop the integrator. You can put zero in the registers 17&18, in which it will clear the integrator value.

How about this approach?. When the DB bit is set, at that point store the last value in the register 17&18 and writing back into the same register before the PID start updating. Essentially you are freezing the last integrated value so the output would not drive the temperature any further. And as soon as the temperature is out side the deadband (DB=0), then it will start intgrating again by not writting the last value.


Your comments?

Sam
 
USE THE BIAS!!

kash75 said:
Pete:

A different approach:

The PID has a variable that is called DeadBand. You can set a deadband of let's 1 degree C. When the PV is within the one degree of the sepoint, it will set a DB bit. This means that it is within the specified deadband. You know as well as I that the integrators sometimes keep integrating even the PV is over or under the setpoint.

Integrators don't keep winding up after they pass the set point. After they pass the set point they start to unwind. However, integrators do continue to wind up until the time they cross the set point which is usually much too long.

kash75 said:
My understanding is, in the PID there is no way to just stop the integrator. You can put zero in the registers 17&18, in which it will clear the integrator value.

You can set Ti to 0 on the AB PID. This locks the values of registers 17&18 at their current value. You DON'T want to zero registers 17&18. When at the set point and at steady state, the P and D terms are zero. CV is then equal to I term which is stored in register 17.

kash75 said:
How about this approach?. When the DB bit is set, at that point store the last value in the register 17&18 and writing back into the same register before the PID start updating. Essentially you are freezing the last integrated value so the output would not drive the temperature any further. And as soon as the temperature is out side the deadband (DB=0), then it will start intgrating again by not writting the last value.

Your comments?

Sam

I don't like it. If you read the documentation you can see that the DB bit is not set UNITL the PV passes the SP. As pointed out above, the intergrator winds up to much by the time it gets to the SP. The integrator must be turned off before reaching the SP. I would look at the PID-TEMP-ML_FF file. This uses the bias and P term only. The calcuations for computing the BIAS was derived from the data Ron B provided in peterA.dbf. Open this file with Excel. You can see that the HotRod system was at 114 degrees with 10% output and 378 degress with 80% output. Knowing this I can calculate the required output FOR ANY temperature as follows:

Code:
Bias = ( SP - TA ) * Kff  

       80 percent -  10 percent  16384 counts   
Kff = -------------------------x ------------
       378 degrees - 114 degrees  100 percent

Kff = 43.443 counts/degree.

Kff is a feed forward gain.
TA is the ambient temperature. In the HotRod's case the ambient temperature is:

Code:
           378 degrees - 114 degrees
TA = 114 - ------------------------- * 10 percent
            80 percent -  10 percent

TA = 76.28 degrees which is reasonable.

I would still use a little integrator, but very little. The I and P gain should only be needed to correct for changes in load. I rely heavily on feed forwards when tuning motion systems. I feel the bias can be used to get within a few percent of the required CV for any temperature. Now the PID gains can be reduced because the PID only needs to correct that last 3 percent.

Finally, I still think your update time is TOOO SLOOWW.
 
Peter...Congratulations on the best thread in ages!!!

In view of your last post I want to revisit my much earlier contribution:

1. Setpoint Ramping hugely reduces the Integrator issues this whole thread has largely been about. Yes the AB form of PID is not best suited for integrating processes like heating, but it does work and once its characteristics are understood it can be easily adapted to suit most loop controls.

2. Along these lines I once got a Steam Boiler Pressure control to go very well simply by CLR'ing the Integral Words whenever the PV was more than 10% away from the SP. Totally eliminated overshoot and yet controlled to normal load variations just fine.

3. 100% agree with you that using the Bias term for feedforward is ALWAYS a good idea, especially if you have a reasonable model of the loop response to load changes.

My wrap on all this is that the PID form AB uses is ideal for the majority of non-integrating process loops, but with a little insight the PLC allows lots of access to the PID parameters and most times I have found a work-around to get a decent (if not mathematically ideal) result with integrating processes.

Of course it all gets far more complex if the loop deadtime exceeds the risetime, or there are cross-couplings to other variables. I worked for Measurex in the Pulp and Paper industry for some years and I vividly recall "tune a loop time" on machines with huge transport delays, head scratching cross-couplings and complex control strategies.

The traditional DCS technology was evolved to meet this level of control in applications far in excess of what a MicroLogix is intended. ControlLogix however neatly bridges the gap and I humbly suggest that if you feel discontented with the basic PID implementation in the SLC/Micro then maybe the CLX/CompactLogix PIDE instruction is the critter for the job.
 
Last edited:
oops!!!....My Point 2 above is fatally wrong...I looked up the old project...actually what I did was CLAMP the Integral Words to the last value. Clearing them to zero would introduce a dreadful discontinuity in the CV.

And the 10% away from SP was an arbitrary value that seemed ok for the application.
On thinking about it I would guess that the right value depends a lot on the Loop Gain KC.
 
Originally posted by PhilipW
1. Setpoint Ramping hugely reduces the Integrator issues this whole thread has largely been about. Yes the AB form of PID is not best suited for integrating processes like heating, but it does work and once its characteristics are understood it can be easily adapted to suit most loop controls.
/QUOTE]

Yes, but it shouldn't be necessary with a properly implemented PID.
Motion controllers have a trajectory or target generator that ramps the SP from one point to another. Motion controllers also make use of feed forwards that predict the required output very closely.

Originally posted by PhilipW
2. Along these lines I once got a Steam Boiler Pressure control to go very well simply by CLR'ing the Integral Words whenever the PV was more than 10% away from the SP. Totally eliminated overshoot and yet controlled to normal load variations just fine.

Yes, it would keep the integrator from winding up too quickly while the error is large. You just better be sure that you can get within 10% with JUST the P term. In many cases this is not so.

I just saw the correction. You said in the previous post you would clear the integral words when the SP was outside the band. I understood this to mean that the integrator is effective cleared until within 10%. I don't see where this would case a discontinuity. Actually, I like this idea better than the correction. To solve the problen with the proportional term not getting the PV to with 10% I would use the feed forwards or bias trick. This would make sure the PV gets close to the SP. This may work for Kash75 too.

Originally posted by PhilipW
3. 100% agree with you that using the Bias term for feed forward is ALWAYS a good idea, especially if you have a reasonable model of the loop response to load changes.

By hook or crook I get my model. In the past I relied on some guided trial and error. Now I can calculate the model.

Originally posted by PhilipW
My wrap on all this is that the PID form AB uses is ideal for the majority of non-integrating process loops, but with a little insight the PLC allows lots of access to the PID parameters and most times I have found a work-around to get a decent (if not mathematically ideal) result with integrating processes.

Then explain that last trend I posted in post #106. You can see the PV is way below the SP and yet the output is driven toward 0. That is not right. I can see why so many people are confused.

Originally posted by PhilipW
Of course it all gets far more complex if the loop dead time exceeds the rise time, or there are cross-couplings to other variables. I worked for Measurex in the Pulp and Paper industry for some years and I vividly recall "tune a loop time" on machines with huge transport delays, head scratching cross-couplings and complex control strategies.

Huge dead times require what I suggested in post #51 and #53. Ron Beaufort's hotrod does not need any special tricks even though it has a dead time because it is relatively small.

Originally posted by PhilipW
The traditional DCS technology was evolved to meet this level of control in applications far in excess of what a MicroLogix is intended.

That is part of the points I have been trying to make all summer. Sometimes a PID is not the right tool. Even PID is the right tool, it is often not enough. Using feed forwards, ramping, predictive and models can increase response and reduce errors. DCSs are complete control packages with much more capabilities. DCSs often include an installation engineer that knows how to use these features.

Originally posted by PhilipW
ControlLogix however neatly bridges the gap and I humbly suggest that if you feel discontented with the basic PID implementation in the SLC/Micro then maybe the CLX/CompactLogix PIDE instruction is the critter for the job.

I will analyze the Contrologix's PIDE sometime. I have a Contrologix. However, I don't use PLC PIDs. I don't do motion control. I write my own embedded control software on microcontrollers or DSPs for motion controllers. I just wanted to analyze the MicroLogix's PID and its use. I chose the ML1500 because it is cheap and I thought more people would have access to one or at least a SLC so they could follow along. I also chose the RS500 because it has trends that can be posted and the data files can be exchanged. Finally I chose the RSLogix500 because I knew Ron Beaufort has a real system and RS500 and was nice enough to provide data that we can use as a model.

Now anyone with a ML1500 can practice tuning Ron Beaufort's 'Hotrod' even with just a ML1500 or SLC and RS500. A physical system is not required.
 
Last edited:
To solve the problen with the proportional term not getting the PV to with 10% I would use the feed forwards or bias trick. This would make sure the PV gets close to the SP. This may work for Kash75 too.

Are we saying that instead of clamping the integral word when the PV is over the sp by 10%, just zero the feedforward? This will reduces the output by the feedforward amount?

My understanding of feedforward is that it will be added to the output on its way up (INTEGERATING UP). Now, if the PV is over the SP by 10%, is this mean that It would automatically reduce the feedforward amount from the output or should I disable the feeforward amount in which it will reduce the output quicker?

In response to Philip:
oops!!!....My Point 2 above is fatally wrong...I looked up the old project...actually what I did was CLAMP the Integral Words to the last value. Clearing them to zero would introduce a dreadful discontinuity in the CV.

If the PV is over SP by 10%, would'nt the integrator be unwinding? Were you concerned that it was unwinding too fast and your PV would be below your SP when it is all done? Is that why you were clamping it?

Sam
 
kash75 said:


Are we saying that instead of clamping the integral word when the PV is over the sp by 10%, just zero the feedforward? This will reduces the output by the feedforward amount?

DON'T ZERO THE FEED FORWARD. IT IS YOUR FRIEND. IT WON'T CAUSE YOUR SYSTEM TO OSCILLATE!

What I was saying is leave the integrator off until the PV is very close to the SP and THEN turn the integrator on. This way the integrator doesn't windup up too much because the bias or feed forward is supplying the output.

For instance. The HotRod system requires about 72% output to maintain 350 degrees. If the system does not reach 350 degrees with 72% output because the load has increased and instead reaches only 340% then the integrator need only wind up to about 3% out to make up the difference. The integrator would not need to be turn on until the PV gets within about 15 degrees of the SP.
 
Last edited:

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,110
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,004
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,531
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,655
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,573
Back
Top Bottom