PID - MicroLogix Temperature Control

Hot Rod LInk

Peter I couldn`t open this link either. Do you have to have Mathcad to be able to open it got error 425 I think. :confused:
 
Thanks, Bob ... I've got it now ...

Peter, the graphs look EXCELLENT ... even the flat-line deadtime looks good this time ... it will be interesting to see if it will oscillate now ... let us know ...
 
Thanks Bob O. I just got PDF995 installed.

I will use PDF995 and zip the .pdfs in the future. That seems to be the way to go. I just don't want to clutter Phil's server with too many files.

Ron, I think your access to ftp is blocked. I have a ftp site that I use to quickly post data. It would be handy if everyone could access the ftp site.

Ron, I am still baffled by the dead time and why there should be a deadtime in the Hot Rod system. However, your statement about the oscillation made me believe it is real. A system with two real poles without dead time will NOT oscillate forever like your Hot Rod does.
I just had to accept that fact your Hot Rod system really has dead time and include it in my model.

Tuning a system with dead time is MUCH more difficult.
 
Greetings Peter,

regarding your statement:

Ron, I am still baffled by the dead time and why there should be a deadtime in the Hot Rod system.

I’m not 100% sure that I’ve ever fully discussed this, but remember that I designed and built the Hotrods (all six of them) as student trainers. It might help to consider that there are TWO thermocouples installed on the Hotrod.

The first thermocouple is mounted right up against the heating element. I call this one the “base” thermocouple. The response of this thermocouple is pretty close to instantaneous. Specifically, once the drive to the heating element is changed, the temperature as sensed by the base thermocouple starts to change on the graph almost instantly.

On the other hand ...

The second thermocouple is mounted about 1 inch away from the heating element - out at the end of a steel screw. I call this one the “tip” thermocouple. The response of this thermocouple presents a fair amount of deadtime. Specifically, once the drive to the heating element is changed, the temperature as sensed by the tip thermocouple doesn’t change at all on the graph for something over 30 seconds. And incidentally, this “tip” model is the one that you've been working with.

In most of the classes I teach using the Hotrod, the students start out by setting up the air flow loop. This one has a fairly fast response so most of the graphs for this exercise are only about 1 minute long. With just a little bit of coaching, most students can successfully tune the air flow loop using just “trial and error” methods. But we go through a systematic tuning approach anyway ... we’re sure to need it later.

Next we tackle the heat loop with the Hotrod set for the “base” thermocouple. Here the graphs normally run about 20 minutes each. This particular loop (due to its reasonably fast response) oscillates at something around 1 minute per cycle. If the student fails to use a systematic approach, tuning this loop can be somewhat challenging. Specifically, if the student makes a wild stab at the tuning parameters ... and gets it wrong ... then it’s going to take about 3 to 5 minutes before the error becomes obvious.

And next we set up the Hotrod to use the “tip” thermocouple. And as you said:
Tuning a system with dead time is MUCH more difficult.

I can assure you that the students would wholeheartedly agree with you on that particular point. This particular loop (due to its inherent deadtime) oscillates at something around 3 to 4 minutes per cycle. And so if the student gets the tuning parameters wrong for this system, then it could take about 15 minutes or longer before the error becomes obvious.

And so the answer to the question “why would the Hotrod have deadtime?” has a simple answer. I specifically designed the deadtime into the system on purpose. For hands-on exercises, the Hotrod makes a nice little benchtop trainer ... which can offer the students some realistic challenges. Everyone agrees that deadtime should always be eliminated (or at least minimized) when designing a piece of equipment. But as we all know, you sometimes run into systems out in the field which DO have a fair amount of deadtime ... deadtime which can NOT be reduced. Naturally it’s a good idea for the students to have some amount of exposure to these types of systems before they run into them out in the real world.

As always, I’m looking forward to what you’ll come up with next. Let me know if I can do anything more at my end.
 
The Dead Time is No Problem!

Hello Ron and others still following thisļ

The attached file has two .jpg files. HotRod0.jpg that shows how the system oscillates to prove to Ron Beaufort the simulator is accurate. HotRod0.jpg shows the PID with the RG bit set and the gain set to 327.67 and the time constants set to 0. HotRodA1.jpg is included to show that even systems with dead band can be controlled easily if the response is slow enough. HotRod1.jpg shows my tuning using a conservative desired response. The dead time is small and has little effect if I chose relatively long time constants for the response. If I try to reduce the response time in half the dead time becomes more significant and the system will oscillate. Also included is the MathCad file is used for calculations and the MicroLogix program which have printed in .PDF format. PDF995.exe is very handy.

I changed the simulator a little bit to do a better job of compensating for the dead time, the ambient temperature. The simulator now does it calculations in degrees instead of degrees*10. The temperature must be scaled outside of the simulator. I also had to change the coefficients to reflect the new model.

For faster control I have other tricks that I can use. The problem with systems with dead time is that one must be able to predict the future to compensate for the delay in the response in the system. However, if one has an accurate model, the future can be predicted. You can see I can closely predict how the Hot Rod will respond minutes in advance, but it is only necessary to predict as far ahead as the dead time.

Think about this! What if Ron used a simulator, with out dead time, to generate the feedback to the PID instead of the real temperature? The simulator doesn¡¦t have a dead time, it doesn¡¦t have noise and the resolution can be very fine as all the calculations done in floating point. Ron pointed out that just about anybody can tune a temperature system without dead time and the gains can be made much more aggressive for faster response. The output of the PID would go to both the simulator and the real heater output as in my PLC program.

Ron, you showed a picture of your HotRod, but you never mentioned if the output is analog or on off. I also assume your PID AtoD counts for SP and PV. I am still using degrees in integer *10 format for the SP and PV. Let us know if you can duplicate my results.

Ron, try my gains
Kc = 20.18 With the RG bit set.
Ti = 2.65
Td = 0.66

If you use counts for the SP and PV you will need to convert the temperature to AtoD counts by scaling by 16384 counts/500 degrees instead of muliplying by 10 like I did. Kc will also need to be scaled by 500 degrees/16384 counts. My Kc in units of %output/degrees outout.
 
Last edited:
So with model predictive control...

How do you ultimately reconcile the model output with the feedback? If the model was a perfect copy of the plant you wouldn't need feedback and you could use a combination of feed forward and disturbance rejection to drive your output. But chances are your model and feedback won't agree after 5 system time constants.

Keith
 
Re: So with model predictive control...

kamenges said:
How do you ultimately reconcile the model output with the feedback?

You don't. I just wanted to provoke some thought and your response.


If the model was a perfect copy of the plant you wouldn't need feedback and you could use a combination of feed forward and disturbance rejection to drive your output.

YES!!!!! Almost, we still need feedback.


But chances are your model and feedback won't agree after 5 system time constants.
Keith

One can see my model agrees pretty closely many minutes in future but as Keith points out reality and simulation WILL diverge. What needs to be added is a corrector that compares the current measured PV with the estimated PV delayed by the dead time. This means the estimated PVs must be put in a fifo so they can be used to compare against actual PV. One can then update the current estimated PV by:

Est PV(n) = Est PV(n) + K * ( Act PV(n) - Est PV(n-deatime) )
K is a small positive number like .1

This is like the low pass filter we have seen so many times on this forum. There are actually better ways of doing this but I am trying to get across the general idea without too much math. It would be nice if Ron would give this a try.
 
Peter,

I hope to run your suggested tuning parameters on the real-world Hotrod tonight ... if not, I should definitely be able to do it over the weekend ... I'll keep you posted ...

how about the .RSS file for your simulator? ...

as for your questions about the Hotrod ... usually we run the 4-20mA signal from the PLC's analog output module into an Omega Pulse Control Module (part number PCM-1) ... this little gimmick converts the 4-20mA signal into a pulsing output ... the pulses are then used to control a solid-state relay ... the solid-state relay turns the actual heater element off and on ... it sounds like a Rube Goldberg arrangement when you list it out ... but it really does give the students some valuable exposure to wiring up and programming a lot of different types of signals ...

so that's usually the way we do it ... but ... since the wiring for ALL of the Hotrod's devices lands on the terminal strip, we can change things around in a number of ways ... so ...

for students who have the time and are interested, we can also use a 24VDC signal from a discrete output module to control the solid-state relay ... here of course, we program the PLC to provide a time-proportional signal ...

either way, the amber indicator lamp is always wired in parallel with the actual heating element ... being able to SEE when the heater is being pulsed on and off really helps the students mentally "connect the dots" of what's going on ...
 
Oops!! No .RSS

Attached is the .rss file with the HotRod simulator.

Yet another oops. I just realized the HotRod1.jpg didn't have its Kc set correctly. It is a factor of 10 low I must of turned on the RG bit without scaling the numbers up by 10. I thought the response looked pretty tame.

Wait till I post the gains tonight before testing. My ML1500 is at home ( can't play to much at work ) and I need to verify the results there.
 
Re:Re: So with model predictive control...

I get it. That's pretty cool.

When you say there's a better way to do this do you mean a totally different concept of bringing the two together or do you mean the same concept but a more involved equation?

Just curious.
Keith
 
Re: Re:Re: So with model predictive control...

kamenges said:
I get it.
/QUOTE]

Excellent! Hopefully others will too.

kamenges said:

When you say there's a better way to do this do you mean a totally different concept of bringing the two together or do you mean the same concept but a more involved equation?

Same concept, but more involved equations. What I proposed only takes into account the error in temperatures or error in PV. One can also correct for the derivatives of the temperature error ( error in ActPV'-EstPV' ActPV''-EstPV'' etc).

Originally posted by kamenges
Just curious.
Keith

Me too.
 
I will stick with the previous gains

Attached is a file that shows the response I expect from Ron's test. See the HotRod 100 to 350 and HotRod 350 to 100 files.

I will stick with these gains.

Kc=20.1768
Ti=2.650239
Td=.65615

I still like the results with the RG bit off. There may be a difference between the SLC and MicroLogix response when the RG bit is set.
 
Peter tunes the Hotrod ...

Greetings Peter and all,

Sorry, Peter, but I haven't had a chance to even glance at anything you've done since your post #51. I went ahead and ran the Hotrod last night using the parameters that you suggested in that post. The impressive results are posted below. I'll try to dig through the rest of your posts this weekend and I might have time to run any additional tests that you've requested.

Notes on last night's tests:

PID_ONLY.RSS is the “bare-bones” SLC-5/04 program file that I used to control the heat loop on the real-world Hotrod for this series of tests. In addition to the PID rung, the program contains an SCP to scale the Hotrod’s temperature signal (0 to 500 degrees F) from a 1746-NI4 analog input module to make it suitable for the PID ... and another SCP to scale the PID’s output for a 1746-NO4I analog output module. I kept the scaling in its raw format (0 to 16383) in order to record the data at its maximum resolution.

PETERI.DBF is the data collected from the 22 minute graph shown as PETERI.BMP. The air flow (system load) was kept at a constant 20% during the entire test. The PID loop update time was set for 1.00 second. The PID tuning parameters used were Kc = 2.02; Ti = 2.65; Td = 0.66 as suggested by Peter. The RG bit was turned on.

The test shown in figure PETERI.DBF consisted of a step change in the setpoint from 3277 (100 degrees F) to 6553 (200 degrees F).

PETERJ.DBF is the data collected from the 22 minute graph shown as PETERJ.BMP. Note that the Y-axis scaling has been altered in order to increase the detail. The scaling for the temperature signal and for the PID setpoint are both set to range from 4915 (150 degrees F) to 8192 (250 degrees F). The temperature setpoint was kept at a constant 6553 (200 degrees F) during the entire test. The PID loop update time was set for 1.00 second. The PID tuning parameters used were Kc = 2.02; Ti = 2.65; Td = 0.66 as suggested by Peter. The RG bit was turned on.

The test shown in figure PETERJ.DBF consisted of a step change in the air flow (system load) from 20% to 40%.

[attachment]

Personally I think the results are EXCELLENT! The load change (second figure) is most impressive. In fact, without the *5 magnification provided by the scale change to the graph’s Y-axis, the temperature deviation would be barely noticeable. Well done, Peter.

I'll attach the .DBF files from last night's tests and some other stuff in the next post.

peterij.jpg
 

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