PID Help

Hey guys, I'm back from my honeymoon and ready to work on the project. Sorry for the delay but she wouldn't let me take my laptop with me... And Ron, thanks for the encouragement. I hope to be as happy as you and your wife.

Project status: Allen Bradley Thermocouple module/mV Input Module (#1762-IT4) has arrived and is hooked up. HAd difficulties getting it to communicate though. But it is working now.

We did a small test with the K thermocouple to veritfy the code and TC were working properly. I would like to put the code on here for you you guys to see it so that you can give me suggestions but, I am not sure how to do it. Any suggestions?

The next phase of the project is next Friday. Between now and then I have to figure out how to use a resistor with the anaolog control of the PLC: to heat the project. Any suggestions would be appreciated. I still have to check the current limits of the PLC so I don't toast it.

Well that is the status... talk to you guys soon.

Matt
 
I have continued with the project and made a litte head-way. I hope the delay between threads has not discouraged you guys from helping me but I have limited access to a computer with RSLogix.

My Analog inputs and outputs are working using two "SCP" instructions to vary my output as my input varies (As the temp incresed so did the voltage output). I wanted them to be inversly related but the only way I could figure how to do it was to reverse the Pos & Neg leads of my TC. This way as the temp rose the TC readings dropped which made my voltage decrease. I am not sure if this is the correct way to do it or not? Does anyone have any other suggestions how to make this occur through the use of RLL Instructions?

Secondly, you guys were correct when you questioned if the PLC Contacts could handle a heater output. My Resesitor does not get enough current to make it raise in temperature and cause a change in my TC. Any suggestions? Ron, I saw in your thread about using the two Omron pieces but are they overkill? I am only trying to control a simple resistor? But I understand the value the real life parts me.

Thanks for the feedback.

Matt
 
From the help file on the SCP instruction
"If the scaled min is greater than the scaled max, the controller will scale the values with a negative slope.
Rockwell Software 2005"
haven't done this myself but try it and see.
 
NEVER reverse leads on a single thermocouple - you get the goofiest readings. Why I do not comprehend just the school of hard knocks that must be why they color code for polarity and type.

Now I do not know if you can do this BUT
Thermocouple readout temp is -450 to say 500 F in bits this is 0 to 32,xxx (ie 2 to 15th power). Now if you reverse these make -450 correspond to 32,xxx and + 600 correspond to 0 you should have inverse relationship.
Whether is is easier to do this reversal on teh input or on the output I do not know. I think the output would be better - at least more easy to comprehend.

Am I crazy (?)) - one of you more experienced guys either support me or show me my error.

Dan Bentler
 
Greetings to all,



Mickey’s idea to “reverse” the SCP is an easy way to do the “when-the-input-goes-up-the-output-goes-down” operation ... and Dan, if I understand you correctly, yes your approach would also give the “inverse” action that Matt is looking for ... and that’s pretty much the way the math would be done on a platform that doesn’t support the handy SCP instruction ...



but now ... I’ve reread this whole thread and I think that we’ve got some much bigger issues at hand ...



Matt, you need to go over your setup step-by-step and tell us how you have things hooked up ... my best guess is that you’re trying to simply connect a resistor to the output of an analog output module - with the hopes that the analog output will heat the resistor up ... is this what you’re trying to do? ... if so, I don’t think that it’s going to work ... basic idea: the analog output module will not provide enough current to make the resistor get hot ...



but let’s just say (for discussion) that you’re eventually planning to connect to something with a lot more current capability to power up your resistor/heater ...



big question: what is the wattage rating of your resistor? ... even a “substantial” sized resistor is usually in the range of something like a couple of watts ... the problem is that two watts won’t amount to enough heat to make a realistic experiment ... and even if it would, the analog output module won’t provide two watts of power ...



think about this: before there was Hotrod - there was Hotbox ...



I was trying to come up with a benchtop-sized process for my PID students to use ... keep in mind that my PID classes are NOT intended to be engineering-level classes for the type of people who design, and build, and program PID-controlled systems ... instead they are designed for technicians who work on (or around) PID-controlled equipment ... basic idea: the system was working fine yesterday ... today it’s broken and the plant can’t make any money ... the problem might (or might not) be associated with the PID control part of the program ... the technicians (my students) need to understand enough about how PID works to systematically troubleshoot the system - and hopefully get it running (safely) again without having to call in outside help ...



in other words, we’re not doing rocket science with the Hotrod ... we’re just trying to give some hands-on training to nail down the basic ideas behind PID control ... now back to the Hotbox ...



one of my first ideas for a PID process was to turn a simple steel electrical junction box into a heater application ... the box was something along the lines of 8 inches on a side ... the heater was a 150 watt lamp bulb mounted inside the box ... the temperature sensor was a thermocouple firmly mounted to one side of the box ... this worked - sort of - but only up to a certain degree ... I was able to turn on the lamp and watch the temperature rise - but the temperature fluctuated and was very erratic ... I solved that problem by mounting a small computer ventilation fan inside the box to stir the air around ... now the temperature was much less “flashy” ... I was now able to set up a PID control scheme for the Hotbox ... and I was able to tune it for decent control of the temperature ...



but ...



it was totally unusable for the students to work with ... the problem was that the system’s natural period of oscillation was much too long ... take a look at this figure from the Hotrod (NOT the Hotbox) shown in this post ...



other graphs for the Hotrod’s characteristics are available in other posts in that same thread ... it would be a good idea to study all of the posts there ...



anyway ... the total time shown in this figure is 22 minutes ... note that there are about 6 oscillations on the graph ... that calculates out to a natural period of oscillation for the Hotrod of about 3 to 4 minutes (per cycle) ... now that’s ok ... but the natural period of oscillation for the Hotbox (NOT the Hotrod) turned out to be about 25 minutes ... ouch! ... in real nuts-and-bolts terms, that meant that every time a student made a change to the Hotbox tuning parameters, he had to wait at least an hour and a half to get any idea as to whether he had improved (or degraded) the system’s performance ... obviously this was much too slow for student exercises in a week-long class ...



so what does all of this have to do with your project? ... well, before you start trying to CONTROL something - you need to come up with something reasonable TO BE controlled ... now something like the Hotbox idea (steel junction box, lamp bulb, internal circulating fan) might work just FINE for what you want to do ... basic idea: if you’ve got enough time to tune it, then YES, you can control the thing ... but I’ve got a hunch that your “resistor in a plastic box” idea isn’t going to get you where you want to go ...



plan of attack: manually control your system and crank it wide open ... see how hot it gets ... and how long it takes to get that hot ... note that the “Hotrod characteristics” graphs in the link above should help you understand what you’re looking for ...



once you know “how-hot-it-gets” and “how-fast-it-gets-that-hot” then determine the system’s natural period of oscillation ... you can use a simple “Fred Flintstone” approach to do this ... just pick a reasonable “target temperature” on your graph ... manually turn the heater on full blast ... watch the temperature rise ... as soon as the temperature rises above the target line, manually turn the heater completely off ... watch the temperature drop ... as soon as the temperature falls below the target line, manually turn the heater back on again ... graphing the system's "wave-like" response should give you a fairly accurate idea of the system’s period of oscillation ...



once you’ve got a few graphs along the lines of those in the thread I linked above, then post them and let us take a look at what you’ve got ... and don’t forget to nail down exactly how you’re trying to connect all of your components ... a block diagram and/or wiring schematic would be really nice ... the more we know about your system, the more we can help with the details ...
 
Last edited:
Thanks for the help guys.

Mickey: "If the scaled min is greater than the scaled max, the controller will scale the values with a negative slope."

It works, my output went down as my input went up.

I am working all of the information that you wanted Ron.

Though guys I have a stupid question. How do I make the PLC turn on an Analog output, thru an analog I/O module, to a constant 5vdc. I know I how to scale the output with the SCP instruction and it varies as my input does. But, I need to turn on the output to a constant 5vdc so that I can see if it carry enough power to heat up my heating element (a smaller reistor).

I know I can do it with the discrete I/O of the AB 1200 and a 5vdc pwr supply, but I would like to us the Analog module if possible thanks

Matt
 
Greetings Matt,



I still haven’t seen that list - and how you’re hooking everything up ... so maybe I don’t understand exactly what you’re doing ... if so, feel free to ignore this post ... once I get the full information, I’ll try to do better ...



but ... I’m afraid that you’re still barking up the wrong tree ...



watts.JPG




if you’re using the hardware that I think you are, then Ohm’s law says you’re only going to get a maximum of 0.10 watt out of that analog output module - with a tailwind - and a healthy breakfast of Wheaties under your belt ... sorry, kid - but this won’t heat diddly ...



or am I just missing something? ... (it wouldn’t be the first time) ...

but to answer your specific question (or at least what I think you're asking) ... the most straightforward way is to delete/disable/deactivate the logic that is currently controlling the analog output ... I'm guessing that the logic is an SCP ... then click on the analog output address (something like O:8.0) and type in a big number ... play with the number till you get the output signal that you want ... you should be able to raise and lower the output signal this way ... check this with a meter ... but don't expect the resistor to heat up ... that just ain't going to happen ...
 
Last edited:
Ron you're right. I was trying to use a smaller resistor (48ohmns) and it still ca not get it to heat up enough. I just wanted to give to it one last try before I scrapped it and went to something else because I saw this same setup work using a BasicStamp and figured the current outputs could not be that different, but I must be wrong. I did not ignore your last two emails, I just wanted to give it that last college try....

I am working on the information you wanted and I will get back to you in after the weekend when I start form scratch and try to figure something else out.

Thanks for you help Ron.

matt
 
Matt,



have you looked into using a “time proportional” signal to control the output? ... that way you can use a regular digital/discrete output module to drive the output ... the biggest thing to do FIRST is come up with something to control ... if you want to stay with a resistor in a box, then you MIGHT be able to do that ... it’s just that you’ll need a heavy (wattage) resistor to give enough heat for a reasonable experiment ... and you won’t be able to drive the resistor with an analog output module ... they’re just not made to handle that type of load ...



so ...



if you can put something like 120VAC into a resistor ... and make it get hot enough to give a good show ... and not so hot that it blows the resistor up ... or melts the box ... then we can probably work something out ... there are some posts about using “time proportional” output signals on the forum ... we’ll work on it next week ...
 
I didn't read through this whole thread, but if you want the output to decrease as the input increases why don't you change the control action of the PID from PV-SP to SP-PV?
 
Thanks for the info Ron, I will look thru it tonight and get back to you soon. And yes you are right, I do not have a PID instruction in the code yet.

Thanks.. talk to you guys soon
 
It has been a while

Hey excuse the delay in replying but the Semester ended and I was trying to decide what I was going to do for an output. Ron, I understand the value in what you are saying about using an output that will give a good show and a valuable experience at the same time, but I am limited to what I have to work with. And I really need to keep this as simple as possible. For my next project I will take it the next step.

So, we figured something out that works... after a lot of tweeking. We also verified current loads as to not toast the Analog Module.

The resitor(the heater) for my temperature module is hooked up through a very simple piece of cicuitry to a resistor, a 3904 Transistor, and an additional power supply to form a working heat system. If anyone wants to see it let my know I'll figure a way to show you. I tried it and it works. The temperature change was not amazing, but it was enough and the time was little long but, I can live with it.

So now comes the time that I have been trying to get to for a while. It is time to implement the PID block. I have my TC module (input) and my analog module (0-10vDC Output) scaled for PID. I should just be able to plug them in to the PID function block since both the signals are already conditioned ... Yes/No?

I also am trying to get my PID block setup right and I keep running into error messages.

"An invalid value is being used for a PID instruction parameter."

I know I probable am not setting something up right. Any suggestions, beside the manual to reference for help. Can anybody give me a better explanantion as to what functions in the setup block that I want to change.... or what a correct one should look like.

I know I asking you guys to shoot blind here since you can't see what I am actually doing but, a little guidence in the right direction to find some more information is all that I am asking for. Once I have a firmer grip at what pieces of the setup block I need to change I ask a better question.

Thanks for the help

Matt
 
Matt,

I know you don't have access to RSLogix except at school, but does your school computer have a floppy disk drive or a pen (memory stick) USB port? If so, make a copy of your RSLogix program, and then ZIP (compress) it and attach it to your next post. Many of us can then tell exactly what your problems are and point you in the right direction.

Just guessing, some common problems are using the wrong type of numbers for PID inputs. Use Integer numbers (file N7 is a good place to start). You must set your Thermocouple Input module so that it is scaled for the correct type of Thermocouple (J, K are most common) and so that it is producing the desired input to the PLC. Here is an example of how to set it. Basically, you send an "output" number to the Input module! The value of the number depends on your T/C type and your desired Input range.
Oxidizer0.jpg


Once the module is set properly, then INSIDE YOUR PROGRAM you must scale the input from the T/C module before sending it to the PID block. To scale a Type K T/C from actual temperature of range of (0 to 2200 degrees F) up to the PLC PID integer range of 0-16383, I had to multiply the Analog Input I:16.1 by 7.4468. Notice that if the Control Block starts at N9:27, then the Setpoint will be N9:29 (second word of the Control Block). N9:29 must also have a range of 0 to 16383 (0= 0%, 8192 = 50%, 16383 = 100%). The Control Block must have 23 words. N9:27 + 23 = N9:50. So the next available Word for the Process Variable is N9:51, and the Control Variable is N9:52. Here is an example:
Oxidizer2.jpg



PID [Proportional/Integral/Derivative] Closed Loop Control
Rockwell Software 2000

Entering Parameters
PID File - (MicroLogix 1200 and 1500 only) Specify a PID file. If you have not already defined a PD filetype among your data files, it will be created for you. The file length is fixed at 23 words. The PD file replaces the old integer file control block.

Control Block Length - (Not valid with MicroLogix 1200 or 1500) Specify an integer file, for example N9:27. The file length is fixed at 23 words.

Process Variable PV - The element address that stores the process input value. This address can be the location of the analog input word where the value of the input A/D is stored. You can also enter an integer address if you choose to pre-scale your input value to the range 0-16383.

Control Variable CV - The element address that stores the PID output. The output value ranges from 0-16383, with 16383 being the 100% "ON" value. This is normally an integer address, so that you can scale the PID output range to the particular analog range your application requires.

Setup Screen - Double click Setup Screen on the instruction to bring up a display that prompts you for other parameters you must enter to fully program the PID instruction.
Click below for more information about the PID instruction
Rockwell Software 2000
 
Last edited:

Similar Topics

Hello all, I have an issue with a PID block in RsLogix 5000. The parameters are P: 3.25 I: 0.11 D: 0.01 The Set Point is 71 psi This loop...
Replies
63
Views
14,920
hey guys - I'm a novice PLC enthusiast, so this may be a simple one. I'm running a PID on a Micrologix 1200 PLC and I want to change the Gain for...
Replies
18
Views
4,269
I need a little help with a project I have been thinking about. We have a belt line that is fed by a gravity door (pretty much a hydraulic...
Replies
14
Views
2,756
Hi all, I have a request from client as follows, There's one PID for Control valve which would be controlling on basis of temperature. One...
Replies
1
Views
1,533
Hi, I am trying to automatically regulate a process ( liquid ) in a tube using an ultrasonic sensor, differential level meter, control valve...
Replies
3
Views
3,174
Back
Top Bottom