Ml1400 pid

PortenoSuenos

Member
Join Date
Dec 2014
Location
Buenos Aires
Posts
8
Hi All...

Using a AB MicroLogix 1400 and I am in need
of a example of a working PID using an 1762-IF2OF2.

I want to use an existing analog input but I want to add
an analog output but control it using a PID instruction.

Thanks
 
this will be a LOT easier if you can post your existing code (RSS file) ... you'll have to zip it first (forum rule) ...

and welcome to the forum ...
 
I wiould if I had something.
All I have is my SCP bringing in my Thermocouple
into an SCP and scaled for the temperature.

I dont how how to start the file using the PID.
 
if you have ANYTHING (an SCP, etc.) then you have SOMETHING ...

basically what would help us most would be the I/O addresses - and existing memory assignments - and so on ...

without that SPECIFIC information - all that we can do is basically give you general hints (pretty much the same thing that you'll find in the Instruction Set Reference Manual) ...

as in Chapter 20 of the manual linked below:

http://literature.rockwellautomation.com/idc/groups/literature/documents/rm/1766-rm001_-en-p.pdf

on the other hand, if we have your existing program file, then we can offer DETAILED information (including the ladder rungs if you need them) ...

bringing in my Thermocouple into an SCP and scaled for the temperature.


just for starters - IF (big IF) you're scaling the Thermocouple signal into "temperature" (degrees F or C) - then that scaled signal should NOT be fed into the PID as the Process Variable (input signal) ... instead the PV signal should be scaled to a range of 0 to 16383 before being presented to the PID instruction ...
 
Last edited:
Ok
Here is the attached zip file

It is just a test file that I want to get
the PID working here on bench first.

See LAD3 Comments for added descriptions..!!

LAD2 is just some prelim stuff
LAD3 is where Im scaling my Type K thermocouple
that is coming into my 1762-IT4 in slot 3.
LAD4 is where I want my PID output to my 1762-IF2OF2
I want the output to represent 0-500 degrees
I think the scaling on the 1762-IF2OF2 output is
3120 for 4mA and 15600 for 20mA

Like I said its not much, but its all I currently have.
 
Last edited:
Like I said its not much, but its all I currently have.

actually it's quite a lot ... it shows us the SPECIFIC hardware that you're using – and the ADDRESSES of your inputs, outputs, and available data files ... without that type of information, all that we could give you were "general hints" ... but now that we have the existing file, we can go into more DETAIL ...

here are some notes on what I did ...

DISCLAIMER: this is all based on what I THINK that you're asking for ... you're there with the system – and I'm not ... but I think that this will at least get you in the ballpark with what you're trying to accomplish ...

(1) made a copy of your file and named it "PID TEST B.RSS" ...

(2) changed Thermocouple input configuration for I:3.0 to "Scaled for PID" ... (this is a lot simpler than the way you were shooting for) ...

(3) changed Analog Output configuration for O:1.1 to "Scaled for PID" ... (again - this is a lot simpler method than the way you were shooting for) ...

(4) set up a PID instruction to use existing PD11:0 data ... (it was available but previously unused) ...

(5) set up PID's Process Variable for I:3.0 ...

(6) set up PID's Control Variable to use O:1.1 ... (O:1.2 that you mentioned in your rung comment does not exist) ...

(7) set up PID's Setpoint MAX for 2498 ... (DegF for K-type thermocouple) ...

(8) set up PID's Setpoint MIN for -454 ... (DegF for K-type thermocouple) ...

(9) set PID's Setpoint to 100 ... (DegF – just to get you started) ...

(10) set up PID's Time Mode to TIMED ... (not the default of STI) ...

(11) set the PID's Loop Update entry to 0.50 ... (one-half second between PID executions ... this should be OK for most temperature control applications) ...

(12) set the PID's RG (Rate Gain) bit to 1 ... (for better resolution of Kc and Ti entries) ...

(13) set the PID's Output Max to 100 ... (just in case you ever decide to Limit the CV in the future) ...

(14) set the PID's Kc (Proportional setting) to 1.00 ... (just to get started ... the rest of the turning is up to you) ...

(15) deleted your RET instruction ... (those aren't needed – a JSR will "return" automatically) ...

(16) changed your SCP to use the new "Scaled for PID" configuration of your thermocouple input ...

(17) I did NOT make any changes to your comments ... (that's up to you) ...

see if this helps get you going ... if you need more help, save another version and post that with detailed questions ... I'm teaching next week so I won't have any spare time to help after this weekend ... good luck with your project ...

.
 
Last edited:
I noticed now that you said I should NOT use the temperature in degrees
as my PV so should I add an SCP to scale this to 0-16383..???
Currently my PV is I:3.0 which is my Thermocouple Input.

Just making sure..!! :)
 
I noticed now that you said I should NOT use the temperature in degrees
as my PV so should I add an SCP to scale this to 0-16383..???

no ... now that you've changed your input module to give you a "Scaled for PID" signal – the signal located at I:3.0 should now automatically range between 0 to 16383 ... this is PERFECT for sending directly into the PID instruction as the PV (input) signal ... specifically, no SCP or other scaling is required for the PID's Process Variable (input signal) ...

now then ...

suppose that you also want a separate temperature signal to (for example) display on an operator's HMI screen ... that is "usually" done by using an SCP to take the 0 to 16383 signal from the input module – and then convert it into a range of -454 to 2498 (which is the native range of your K-type thermocouple in Degrees F) ... take a look at the SCP in the "corrected" version of your program which I attached to Post #6 ... (you should already have downloaded that file and looked at it) ... (have you done that yet?) ...

(16) changed your SCP to use the new "Scaled for PID" configuration of your thermocouple input ... OK

you said "OK" - but you didn't really make that change in the "Revised" file that you've posted ...

just for discussion ...

another way (besides using the SCP) to get the temperature reading scaled into "Degrees F" is to use the value of PD11:0.SPV ... since you've now configured the scaling inside the PID instruction to match the range of the thermocouple, the PID will automatically calculate a value for the "Scaled PV" signal every time that the PID gets executed ...

personally I like the separate SCP method – but as long as everything stays set up correctly, it's really a matter of "dealer's choice" ... one advantage to the SCP method is that you can use a Floating Point number as the Destination (example: F8:0) – and get decimal points in your scaled value ... using the PID to do the scaling can't get you down to decimal point resolution – since the destination will always have to be an Integer type memory location ...

so ... moving right along ...

you should now have a PID program ready to try out ... as the PV (input - temperature) signal IN-creases - the CV (output - heater drive) signal should DE-crease ... if that doesn't work, post again ...

but ...

you should NOT expect "good" control (or even "reasonable" control) until you "tune" the PID to match the characteristics of your particular system ... specifically, you're going to need to adjust the values of Kc, Ti, and Td in order to get "good" control ... these values are commonly thought of as the Proportional, Integral, and Derivative settings ...

this "tuning" operation is another ballgame entirely ...

good luck with your project ...
 
Last edited:
Yes...you are right I missed that one ...sorry.

(In a way it seems to me that using the Raw Proportional values of -32767
to 32767 gave me better range for resolution/accuracy)

I also like the Floating points for using decimal points for accuracy.

See attached file..!!

Is there a general rule you would use for tuning the P, I and D..???
 
Last edited:
In a way it seems to me that using the Raw Proportional values of -32767
to 32767 gave me better range for resolution/accuracy

the problem with that approach is that the PID equation used in RSLogix500 systems ALWAYS (I repeat: ALWAYS) interprets its Process Variable (input signal) in terms of a range of 0 to 16383 ... force-feeding the PID anything other than a range of 0 to 16383 is going to "skew" the PID's interpretation of the input signal ... it'll give you "sort of kind of" control – but it's going to be "less-than-optimal" control ...

and consider this:

your K-type thermocouple gives a range of values between 2498 to -454 ... that's a full scale of 2952 degrees F ... (basically from "metal is glowing" to "freezing your butt off") ... divide that range by 16384 steps (zero is a step too) and you get about 0.18 Degrees F per step ...

the point is:

most heating applications don't require better accuracy or precision than that ...

I also like the Floating points for using decimal points for accuracy.

a lot of programmers have that same misconception ...

the trick involved here is that your thermocouple module can only put out INTEGER (whole number) values ... so when you try to turn those integer numbers into a floating point format, the floating point numbers will move in "stair step" fashion ... in simple terms, your new floating point numbers will NOT be "smooth and creamy style" ... instead they'll be "chunky style" just like your old integer numbers ...

you'll see a lot of programs that have been written to take an input module's integer value – and then immediately shoehorn that number into a floating point format ... that's usually the programmer just piddling around ... any decimal points that result are just an ILLUSION of better accuracy ... I'm tempted to use the term: "garbage in – garbage out" ... but it isn't really garbage (as I explained above) ... let's just say "chunky style in – chunky style out" ...

there's a lot to discuss here – and I've only gotten about 2 hours of sleep all night – and I'm still working on my project - but basically you should experiment on your own to confirm what I'm telling you ... other forum members will be able to help too ...

TConnolly is one of the best when it comes to discussing number systems ... maybe he'll show up and go into greater detail ... (and correct any mistakes that I might have made) ...
 
Last edited:

Similar Topics

Stuck at home and need to adjust the CVH on a PID loop. I can build an AdvancedHMI HMI to read write the valeus, but I cannot VPN in. Is there...
Replies
5
Views
1,663
I'm trying to figure out if there is a relatively easy way to freeze the integrator in the Micrologix 1400. We've used some loop controllers that...
Replies
4
Views
2,124
May be my question is too childish, but can i get all the answers please? For PID of ML1400, if I right loop update as 0.02 & time mode as STI...
Replies
4
Views
4,761
Hi, I know it has probably been before posted before, but where can I get a sample program for a ML1400 or similar showing a working simple PID...
Replies
1
Views
3,663
Hi All I'm Just working my way through setting up a PID loop in an ML 1400 but not sure of the timebase/sample of the Ti. The Td appears to be...
Replies
2
Views
1,920
Back
Top Bottom