Ratio between value at different instances. Part of bachelor thesis.

Erik&Robin

Member
Join Date
Mar 2014
Location
Bergen
Posts
5
We are working on an automatic system for pressure testing and flushing of hydraulic tubes. We are using an Omron PLC with Cx-one.
There will be different demands for how much the pressure is allowed to drop, according to different standards. They will be on the form X% drop in Y minutes. Our problem is to find a way to know when for instance the current value divided by the same value 5 minutes ago, will be more than the required percent.

The time the process takes is not very critical, so one idea is to assign the value to a variable every minute. This way you only need to store 5 values. Does anybody know how to accomplish this the way I just described, or a totally different way?

We are pretty novice working with PLC´s, but have some experience from earlier education and programming in general.

Skjermbilde%202014-03-07%20kl.%2017.21.29.png
 
It has been a long time since I have been in school, but we used to use "Mathematics" for that. If that does not get you a close answer maybe try "Calculus".

Sorry, I'm such a cynic, or maybe just a bit jealous that my generation didn't have the internet for these types of personal projects.

Is more expected of this generation too?

This may be a helpful hint on the PLC:
"Whenever one receives a new tool it is advisable to read its instruction manual."
 
Last edited:
Hello. I´am sorry if what i wrote was a bit unclear. To calculate this is NOT the problem, but how to assign values to variables with the ex-one program, which function block to use etc. Or maybe solve it a totally different way, without variables. Another example would be to calculate the area under the curve of the double derivative of the pressure values. But I think using variables would be an easier solution.

Erik.
 
Last edited:
if i understand what you want.

pressurize the system
give a time delay to stabalize (5-10 sec depending on the size).
start your test.
initialize the time and pressure data
wait x seconds
store the data again
repeat until the test is complete.
i would use indexed addressing.

regards,
james
 
There are at least one or two users of Omron that frequent the forum. I expect you will get more specific answers if you give it some time, for those folks to have a look at this. It is good that you posted the reason for the question. The fact that it is a school project is always going to generate some amount of cynicism. Just hang tough, and post as much as you can. Be as specific as possible about the hardware you intend to use. It would be good to include that in the title, and the fact that it's for school in the details. Some of us will not even look at school stuff unless we get really bored (like me).

I have not worked with Omron, so I can only agree with what has been said already. You will want to store some values based on the time accumulated, by incrementing a value or perhaps using the accumulated value to calculate an indirect address pointer. Of course with Cx-one, there may be some other slick trick method.

Paul
 
That is correct James, but what determines when the test is complete, is the ratio between a value and what that value was, say 5 minutes ago. This is done to make sure we can prove the tube has kept the pressure within the allowed drop. This data will be part of the certification of the test.
We will have a look at indexed addressing. Thank you:)

Erik.
 
Thanks for the answer Paul. The reason why we post this here, is that we don´t get the support we were supposed to from our school. One of the reasons for this is that they are moving to a new campus, and will naturally be busy with that. The reason we do need some support is that we are studying to be subsea engineers, not automation engineers. But we do have enough experience to do the rest of the task, but the problem posted here it whats critical at the moment.
Also thanks for your suggestion, we will look in to that as well:)

Erik.
 
The problem is filtering out noise. What if the noise is greater than 1%? Also sampling only every minute probably isn't good enough. Then you will never be stopped. However, you do have a definition for the rate of change and that is 1%/5 min or 0.2%/min.

This is what I would do. I would sample more often and compute a least squares fit at every sample period for the last 5 minutes or maybe even smaller. When the slope of the least squares fit is below 0.2%/min the test is complete. If you use a circular queue you won't need to recompute and everything each iteration.

The advantage of using the slope of the least squares fit is that it removes the noise issue. The more sample points you use the more tolerant the slope will be to one or two stray measurements.

After thinking about this more you could use the standard deviation from the line to compute confidence levels that the slope is statistically 0.2%/min with a 95% confidence.
 
Last edited:
Why calculate the pressure falling curve for a simple pass/no pass quality test?
I see no need in any timed sampling and cumulative/integral calculations.
Keep things as simple as possible.
Prefill with start pressure, then start a timer while continuously measuring the pressure and calculating its drop % from the start.
Wait until the first of the following occurs:
- Y minutes elapsed. Pass.
- Pressure drops more than allowed X% per Y minutes. No pass.
In both cases, the resulting drop per time may be calculated at the test end, if necessary for documenting the test results.
Or allow Y minutes unconditionally, calculate drop% per Y minutes, and make pass/no pass decision.
 
Last edited:
Why calculate the pressure falling curve for a simple pass/no pass quality test?
I see no need in any timed sampling and cumulative/integral calculations.
Keep things as simple as possible.
Prefill with start pressure, then start a timer while continuously measuring the pressure and calculating its drop % from the start.
Wait until the first of the following occurs:
- Y minutes elapsed. Pass.
- Pressure drops more than allowed X% per Y minutes. No pass.
What happens if there is a low reading due to noise?
 
You could require a few consecutive readings below the limit.

One wouldn't expect that a pressure drop curve like this beeing very noisy.
Hart or fieldbus wiring presumably?

@Erik&Robin:
How do you intend to document the check?
A certificate with a printout of the drop curve?

Kalle
 
kalle it is codesys, so you can help them in your language.

take a reading
like startreading:=input1 (%IW0)
wait 5 minutes
take endreading:= input1
difference := startreading-endreading
if (difference > (0.01* startreading))then failure =true else false
 
What happens if there is a low reading due to noise?

Signal noise is always a concern but not always a problem. It can be determined very quickly in practice if the signal fluctuations are a problem. If so, I have had good luck with a simple filtering algorithm.

Yn = Yn-1 + (1/k x (Xn - Yn-1))

I have used some process control algorithms where rate of change limit was important. Rather than actually calculate the slope I found it easier to multiply the allowable rate by the time interval, and at the end of the interval calculate the actual change and compare it to the allowable. This is essentially the same as Shooter's method.
 

Similar Topics

We have a slave axis following a master axis in degrees. There is a Ratio between the two. The issue is that we need to read the actual position...
Replies
4
Views
1,380
Well, i seem to run into this every few years when I have to update the software on older HMI. Otherwise I barely notice the topic. I wonder how...
Replies
9
Views
2,963
Hi, guys, how are you? If we want to install a new/different gearbox on the line, could you tell us where and how to set up gear ratio in...
Replies
12
Views
2,755
Hi I have a scenario where I am controlling ratio of an additive into a uncontrolled Product stream to achieve a certain reading in a pressure...
Replies
0
Views
1,253
Our motion project uses a MAG instruction to gear a motor to a CIP encoder. That works great now. We now want to adjust the gear ratio based on...
Replies
2
Views
1,368
Back
Top Bottom