# Measuring pressure peaks very fast

Discussion in 'Programmer's Corner' started by Spek, Feb 6, 2009.

1. ### Spek Thread Starter Member

Feb 6, 2009
20
0
Hi,

Don't know if this is exactly the right place to ask, but let's give it a shot.

I made a (OMRON) PLC control system for a pharmaceutical machine. One of its main tasks is measuring pressure. Everytime a tablet is "punched", a digital pulse is made and the current pressure on that tablet must be stored for that "punch". (Punch[0] = 20 kN, Punch[1] = 22 kN, ....

To make it difficult, the machine rotates very fast. Once engaged, the PLC could have less than 20ms between 2 punch pulses. And, the pressure acts like an aggressive sinus with a high frequency and amplitude. That means the timing (when to measure) is crucial here. Read the value 1 ms later and you will have the wrong pressure. The question is, how to read such quickly changing values?

So far I tried this:
- The punch pulse activates an interrupt. At this point the highest peak value from the last ~10 ms will be used. So, if the pulse comes 2 ms too late, it wouldn't hurt since the peak value won't be different. We actually give the pulse slightly after the sinus peak (when the pressure is dropping again).

- A second interrupt pulse resets the peak in between 2 punch pulses (at the sinus bottom).

- Measure the pressure every ms with a cyclic interrupt (however, the OMRON analog module needs 2 ms to refresh, so making it faster won't help anymore...). We store the peak value.

It works until the machine rotates very fast again. My guess is that the readings are just not quick enough.
- Sensor (measures metal curve)
- Sensor signal gets amplified (don't know how fast this one goes)

I'm afraid I can't fix this in the software. An obvious weak link here is the analog input. Is a refreshrate of 500 times per second slow? Anyway, I was thinking about an electronic solution. Is it possible to keep the peak signal for, let's say 6 ms? After that the signal can drop again. If this is possible, the PLC has enough time to read the peak for sure. Any other suggestion is also welcome!

Greetings,
Rick

2. ### beenthere Retired Moderator

Apr 20, 2004
15,808
293
I would suggest that your hardware is not up to the job. Read the speccs on something like a Dataq DI-720 that will take 100K samples/sec with 14 bit accuracy.

You don't state the necessary resolution, but the answer sounds like being able to read continuously over the stroke, and use software to throw out all but the peak values.

3. ### Spek Thread Starter Member

Feb 6, 2009
20
0
The PLC samples every millisecond, but the analog input module is somewhat slower. According to the papers, it needs 2 ms to refresh. I have no idea if that is slow or fast nowadays.

Making an addition module that does nothing but sampling and storing peaks at high speed is a good idea, although I was hoping maybe there are (simple) ready-to-use (electrical) components for this kind of task...