SLC analog output problem

rta53

Lifetime Supporting Member
Join Date
Feb 2003
Location
North Carolina
Posts
619
I normally do all the PLC programming for our small company but occasionally we have farmed out some of our programming. Attached (if it works) is 2 ways someone programmed analog outputs for a
Level Control Valve and a Pressure Control Valve. The 1st 2 rungs are for the LCV and the next rung shows what he did for the PCV. Is it possible to use a PID instruction as he did without rescaling the output?

Anyway, the LCV is working fine but the output to the PCV never seems to go above 10 mA or so even though the Control Output CV is showing 100% in the PID setup. I confirmed this by looking at the Output data file and O:16.3 is at 16383.

Should I use an SCP instruction and rescale the analog output to the PCV? The module I am using is a 1746-NO4I. According to the manual it looks like a 4-20mA module shouled be scaled 6242 to 31208. Is this correct?

For the LCV the guy used 0 to 32767 to scale the output.

I really don't want to get into why I don't ask the person who did the programming to explain. I need to fix this myself.

[attachment]

ladder 3.jpg
 
Should I use an SCP instruction and rescale the analog output to the PCV? The module I am using is a 1746-NO4I. According to the manual it looks like a 4-20mA module shouled be scaled 6242 to 31208. Is this correct?

stated as simply as possible: yes ... that is the way it is usually done ...

PS edit ... it would also be a good idea to post the PID's "Setup Screen" ... in fact, if it's not proprietary information, why not post the entire program? ... you never know what else will turn up ...
 
Last edited:
Here is the PID setup:

[attachment]

What we are doing with this is trying to maintain 50 PSI in the return line to a storage tank in a Purified Water system. My pressure is staying in the 30s because the control valve never gets more than 10 or so mA from the output module.

pid.jpg
 
Last edited:
According to the manual it looks like a 4-20mA module shouled be scaled 6242 to 31208. Is this correct?

The short answer YES.......thats usually pretty close for a true 4-20ma output. Change the output min and output max to those numbers. It may vary a few counts if you are anal about your loop calibration.

Dave
 
Last edited:
The reason it is done this way is that the PID block in the SLC EXPECTS the CV and the PV to ALLWAYS be scaled from 0 to 16383.

From the online help file:

"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."

So if your input/output modules do not support the "scaled for PID" range settings (Like the NIO8 does) then you will need to use the SCP to scale the input & output values to match the ranges of the appropriate hardware.

Darren
 
Last edited:
rta53 said:
According to the manual it looks like a 4-20mA module shouled be scaled 6242 to 31208. Is this correct?

I hate that part, but your calculation looks ok. That +/- 21mA thing throws me off because it never seems to be documented that 32767 = 21mA, not 20. Grrrr...
 
rta53,

this is just a minor point ... but as long as we're working on it ... if you'll change your RG bit to a "1" then you'll get an extra decimal place of resolution on both the Controller Gain and the Reset parameters ... there's no real downside to this ... just make sure that you re-enter the two settings to take the extra decimal place into consideration ... sometimes the extra resolution makes "fine tuning" a ticklish system just a little bit easier ...

rg bit.jpg
 
rta53,
You definitely should scale your CV output from the PID block to the range 6242-31208. That is the range understood by the Allen-Bradley Analog OUTPUT module, whereas the Input Modules send 0-16383 to the PID block! Confusing as heck, but that is the way they started out back in the old days. It would make sense that your valve only gets about 10 miliamps because you are sending only 16383 with the CV at 100%, which is about 50% of 31208. Rescale to bring your output up to 31208 at 100% and then watch it work! You can scale many different ways. Although the SCP command is easiest, I started using the CPT (Compute) long before the SCP command was invented, so I still use CPT sometimes to do my scaling.
 
PID tuning

rta53

Looking at your PID values I wonder whether you could tune your system better. The values seem to be for a very fast control loop like a motor speed control rather than a level/ pressure control with valves.

Have a look at the Micrologix 1500 Instruction set reference manual

1762-RM001C-EN-P chapter 19 pages 22-26. This is a useful guide to PID tuning.

:cool: 📚
 
Thanks guys for all the help. The loop seems to be working fairly well now, I did a little more fine-tuning.

John W, This is a somewhat fast loop because I am trying to maintain a constant pressure in the purified water loop. When the customer starts drawing water from the loop the pressure control valve needs to respond quickly to maintain SP. Below is my current settings. I still get a 3 or 4 PSI pressure rise for a few seconds when the customer stops drawing water from the loop although this is not really a problem. I am definitely not an expert when it comes to tuning PID so any advice is appreciated. :)

[attachment]

pid2.jpg
 
hi everyone,

I want to control the vfd delta l-series from the analog output(4-20ma) of my s7 1200 analog module I need a help to write the code to the plc ,
the range of the frequency is 0-50Hz and the analog output is 4-20ma
waiting for your suggestions

best regards
 
It's not obvious to new users how to create their own new thread once they're browsing existing ones.

Go to the "Top Level" of the PLCTalk Q&A Forum:

http://www.plctalk.net/qanda/forumdisplay.php?f=2

and click the "Start a New Thread" button:
newthread.gif


I see that Khaled did start his own, so I'll add one more bit of advice; a concise title helps a lot. "S7-1200 Analog Scaling to AC drive" is good, while "Hello" or "Question abt PLC" doesn't help draw in viewers as much.
 

Similar Topics

Hello, I'm looking for some ideas on choosing some simple analog input and output devices. I have a analog input card (1746-NI4)for either -20mA...
Replies
17
Views
11,804
Hi, Anybody with useful information on how to calibrate analog input and output module of SLC RSLogix500. Thanks
Replies
1
Views
4,135
I have project using slc 500 and have to add two 4 to 20 Am signal in to one 4 to 20 Am analog out so that i can get total generator Kw I...
Replies
2
Views
11,868
I have a SLC5/05 with a 1746-NI16V. I am trying to configure it for single ended inputs. Please notice in the screenshot the upper SCP is...
Replies
21
Views
5,454
Hey guys, Well, the troubleshooting continues for the client who got hit by lightning. New CPU has been installed, and is working! That's the...
Replies
12
Views
3,295
Back
Top Bottom