Sign in to follow this  
Followers 0
Conor

Analogue input checking

16 posts in this topic

Hi all, I was wondering if you could help me. I have a pressure transmitter and it has crapped out before and given false readings. The process runs up to 6 bar from 0, and then back down to 0. This decrease is gradual, i.e. it should take 2 mins. If my pressure goes haywire, or directly down to 0, this can cause damage to the next step of the process. I am getting an analogue signal back in from this transmitter, and then using a SCP to scale the data before I send it on to Scada. Hopefully one of you guys can help me out with this. Thanks

Share this post


Link to post
Share on other sites
What exactly is your question? Is it how to check if the analog input is reading OK? Since you know that the signal should change very slowly, I would suggest some sort of rate of change check. For instance if you see a count increase or decrease of x within so many seconds then flag the signal as suspect and alert the operator. If there is a "safe" reading, you could then move this value into the register or latch a bit to inhibit the process from continuing until the reliability of the reading is confirmed. This would be similiar to how a thermocouple reads upscale when a burnout occurs. Another thought would be to have a second sensor on the machine and brought into the PLC to use as a comparison and then give the operator the ability to select which sensor would be used for the process.

Share this post


Link to post
Share on other sites
Thanks Devo That is exactly what I need, sorry I didn't word my post that well. What code do I use for a rate of change check?? Thanks again DO I use a CMP. What would the expression be?? Edited by Conor

Share this post


Link to post
Share on other sites
Ok If I use a timer and then use a cop function to copy the value into an array of 10 bits. Then do a sub function to subtract first from last in the arrray to get a difference. If then I do a compare with the difference that is less than x Or is there a better way to do it?? Any help would be most grateful

Share this post


Link to post
Share on other sites
You sound like you're right on target to me. Only thought is if you have the memory also use a FIFO and load each successive read value into a history chart. This would allow you to see the entire or a larger portion of the drop off curve.

Share this post


Link to post
Share on other sites
Thanks Bob. Could you tell me how I would implement the FIFO into a history chart Thanks

Share this post


Link to post
Share on other sites
I agree with BobLfoot, what you wrote sounds right. As for creating a history chart, since you did not mention which PLC you are using so I will us the SLC500, what I have usally done is to select an area of memory for these readings, say N7:0-99, this would allow you to store the last 100 readings. You could either create a pointer and use index addressing, so the first reading goes into N7:0 then increment the pointer and the next reading will go in N7:1, etc.. Once you reach N7:99, you would reset the pointer and start back at N7:0. Or if you want N7:0 to always have the last reading, then you would need to move the values from N7:0-N7:98 into N7:1-N7:99, not too hard with indexed addressing. Then store your latest reading in N7:0.

Share this post


Link to post
Share on other sites
Two ways I can think of and both work on all three platforms {SLC. PLC5, CLGX}. 1. Use the FFL {FIFO Load} and FFU {FIFO Unload} instructions. You will need a block of integers N17 for example on a SLC or PLC. The RSlogix Help pretty much explains it. Each new data gets added to the FIFO by FFL and can be removed by FFU or looked at byn a direct reference. N17:12 for example. 2. DEVO's suggestion will alos work. It can implemented with only a COP {Copy} instruction. Borrowing from his example I would recommend to push the new valvue to N7:100 and then use COP N7:1 N7:0 100. This will leave you newest value in N7:99 and give you a stack of values down from there. P.S. - The FLL Instruction can be used to load the stack with eitehr zeros or a fixed null value.

Share this post


Link to post
Share on other sites
Is your SLC in command of the pressure setpoint? If so, then you can have a much simpler error check. You can simply calculate the difference in the command and the actual, and if the result is outside of prescribed limits for a predetermined period of time, then indicate a fault and take appropriate action. If you use COPy to generate a FIFO, jsut be sure to do as Bob L Foot suggested and COPy in the downward direction. If you COPy Source N7:0 Destination N7:1 Length 100, then 100 elements will be overwritten with the contents of N7:0, because the SLC will perform the operation one address at a time. If you copy from N7:1 to N7:0 you avoid this overwrite issue. Paul

Share this post


Link to post
Share on other sites
Thanks guys. Yes it is an SLC. As for wheather it is in command, I will need to check on Monday. I will let you guys know how I get on, or if I need you to give me some more info (thanks again)

Share this post


Link to post
Share on other sites
The simplest technique I know of is to calculate a slope. Let's say you read data values periodically say once every 10 seconds. Do something like this: when 10 second timer fires, RateOfChange = CurrentValue-OldValue OldValue=CurrentValue If RateOfChange > xxx or RateOfChange < -xxx then latch BadDataFlag The check on RateOfChange can be a simple LIM instruction with the limits inverted which means to check that the value is OUTSIDE the specified range. Since you specified 6 bar over a period of 2 minutes, that's 6/(120 seconds)*10 second intervals = 0.5 bar per interval so that would be your limit. However, if the rate of change isn't linear, then you'd increase this. One possible problem here is what happens if your pressure sensor fails when it is close to zero? You probably want to implement checks to verify that it is rising when it should be or falling when it should be as well. Another possibility is to install two pressure sensors. A failed sensor alarm triggers when the two readings are very different. If you have 3 sensors, then you can take the closest two as valid and flag the third sensor as bad and continue to operate (best 2 out of 3). This increases your maintenance cost but increases your overall process reliability.

Share this post


Link to post
Share on other sites
Attached is what I have done so far. I had to use F8 for the array as the pressure is measured to two decmal places What is now the best way in Unlatching the bit B3:23/0? Or maybe one of you guys have a better way for me to inplement the code reactor_pressure.doc

Share this post


Link to post
Share on other sites
So, if the pressure drops by more than 0.5 in a period of time less than 9 seconds, you will latch your fault bit, at the end of the duration of the FIFO. If the pressure drops by 2.0, nine seconds later, the fault bit will latch. EDIT: I just noticed your timer preset is zero, not one, so it would be 18 PLC scans later... Does that sound like what you want? Edited by OkiePC

Share this post


Link to post
Share on other sites
That is the way I am trying to work it, a 0.5 bar drop in less than 9 secs the latch the fault bit. Again, what is the best way to unlatch the fault bit? I made a mistake there with the timer. I should have put a Preset in of 1.

Share this post


Link to post
Share on other sites
After you have take whatever action you need to take based on the fault bit, typically, a fault reset momentary button (on the HMI?) is used to reset the fault. Paul

Share this post


Link to post
Share on other sites
Cheers Paul. I can use a push button on Scada to do this then

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0