Sign in to follow this  
Followers 0
ahuat

best way to convert pulse into value

17 posts in this topic

Dear All, Does anyone has experience in convert a pulse from a flowmeter into a certain value? Regards ahuat

Share this post


Link to post
Share on other sites
Yes use a F/I converter and a analog input on the PLC. Banker

Share this post


Link to post
Share on other sites
I try to connect the digital pulse into digital input, is it good to count how many pulses in one minute then convert it into a value?

Share this post


Link to post
Share on other sites
What pulse frequency are we talking about ?

Share this post


Link to post
Share on other sites
pdl is right to ask what freq are we talking about, alternatively what is the on/off time of the pulse... secondly .. why don;t you think about how you would do it on a piece of paper first.... then you will see that it is not that hard to implement in the PLC... a bt of logic ... but nut it out first ... or at least show some effort on trying to do so... (reduce your time frame for instance to pulses in 5 sec and multiply by 12 to get the pulses per min.... the flow sensor will also have a scale factor as well ie no. pulses /per litre etc see where i am going...)

Share this post


Link to post
Share on other sites
ahuat, Can I ask what PLC you are interfacing to?

Share this post


Link to post
Share on other sites
Dear All, Thank you for all the reply, I am using Trimec dual pulse paddle wheel flowmeter, the frequency rate is max 88 Hz, I am planning to use CJ1m CPU, and using the high speed counter facility Regards ahuat

Share this post


Link to post
Share on other sites
Hi ahuat. You can make some PLC code for counting pulses and calculate the flowrate. But if you are going to use the flowrate for som PID control a F/I converter is the best way to go. You then have filter option. It give you a smooth flowreading. You can also use the mA signal for a counter. Banker

Share this post


Link to post
Share on other sites
Use the PRV2 Instruction. It works great!! 3-21-3 COUNTER FREQUENCY CONVERT: PRV2(883) Purpose PRV2(883) reads the pulse frequency input from a high-speed counter and either converts the frequency to a rotational speed or converts the counter PV to the total number of revolutions. The result is output to the destination words as 8-digit hexadecimal. Pulses can be input from high-speed counter 0 only. This instruction is supported only by the CJ1M-CPU21/22/23 CPU Unit Ver. 2.0 or later.

Share this post


Link to post
Share on other sites
Thank you for your reply, PRV(881) i think is a good idea, but it has limitation only 1 input, is there any other way to add more input? Regards

Share this post


Link to post
Share on other sites
On CJ1M PLC's with Built In I/O the PRV(881) instruction is ONLY restricted to one input [input 0] IF the P:Port Specifier = 0010hex [High Speed Counter 0] AND the C:Control Data is set to read high-speed counter frequency [C = 0003 or 0013 or 0023 or 0033]. You can read the current value of either high speed counter at any time if C:Control Data = 0000 hex. To read the current value if HSC 0 set P:0010 hex and C:0000 hex. To read the current value if HSC 1 set P:0011 hex and C:0000 hex. One method that works for me is to read the Current value of the HSC input in the timed interrupt [in my case once every second] using PRV(881) followed by an INI(880) that resets the HSC to 0.

Share this post


Link to post
Share on other sites
We are talking about flow... dose it really require the following accuracy ??? using the PRV as a timed interupt? Just curious as to your reasoning....

Share this post


Link to post
Share on other sites
I prefer to use the timed interrupt as it is asynchronous to the normal program scan. Timer accuracy in the standard scan will fluctuate based upon active/inactive rungs. As a result the captured value of a high speed counter [especially at very high frequencies] will exhibit fluctuations based on program scan. Placing the high speed counter capture instructions in the timed interrupt assure more accurate and consistent data. My 2 cents.

Share this post


Link to post
Share on other sites
For high freq.. couldn;t agree more... ...but i think he was only talking about a max of 88Hz (ie period of approx 11.4ms).... and could probably even get away with a standard input.... (mabey)...if the scan time of his program was around 5ms

Share this post


Link to post
Share on other sites
Dear All, Thanks for all the replies, i think using of prv(881) is the best way because of it stability. Anyway what Sleepy Wombat posted about using standard input is also interesting, because the pulse width is not really narrow, i haven't built the complete program so i don't know the scan time, .... I am not sure i can get a stable counter if using standard input for 80-100 hz freq , omron manual say that the minimum of the input is 1 ms, thats mean it will work for counting 500 hz. Does anybody has experience in using standard input for counting pulse ?

Share this post


Link to post
Share on other sites
Your pulse frequency is around 100Hz = 10msec per cycle. What you need to determine is the ON/OFFduty cycle of each pulse. If it is 50/50 then the ON time is 5msec. If the PLC scan rate is less than this you can probably get away with processing your flowmeter logic in standard program tasks. However to play safe, as a general rule I always divide the shortest input time in half when deciding how best to implement an application. So with 50/50 duty cycle of 100Hz assume your input will be on for 2.5msec. As long as your scan stays around this value you can write your logic in standard tasks. Now what if the flowmeter sensor is out of adjustment or there is wear in the flowmeter paddle bushings or gunk on the paddles are causing uneven rotation?? Your pulse duty cycle could easily become 20/80!! On time at 100Hz is now 2msec. Using above suggestion and dividing by 2, if your PLC scan exceeds 1 msec you stand a good chance of missing counts. There are two ways to handle this:- 1. Set up the desired input [0-3 on a CJ1M] for Quick Response. Reliably read pulses with an ON time shorter than the cycle time, such as inputs from a photomicrosensor. Built-in Inputs Quick-response inputs 0 to 3 Quick-response inputs Reads pulses with an ON time shorter than the cycle time (as short as 30 ?s) and keeps the corresponding bit in I/O memory ON for one cycle. Use the PLC Setup to enable the quickresponse function for a built-in input (CIO 2960 bits 0 to 3). 2. Use the Interrupt Function Execute a special process very quickly when the corresponding input goes ON (up differentiation) or OFF (down differentiation). (For example, operating a cutter when an interrupt input is received from a Proximity Sensor or Photoelectric Sensor.) Built-in Inputs Interrupt inputs 0 to 3 Interrupt inputs (Direct mode) Executes an interrupt task at the rising or falling edge of the corresponding built-in input (CIO 2960 bits 00 to 03). Use the MSKS(690) instruction to specify up or down differentiation and unmask the interrupt. As discussed in my previous post my preference would be to increment a count with the Input Interrupt task, using the Binary Increment instruction ++B (590). Examine the accumulated count value and reset it to Zero in the timed interrupt task. In this fashion you can be assured that the standard PLC Task scan time will have no effect on your count accuracy. My 3 cents!

Share this post


Link to post
Share on other sites
Bits N Bites, Thanks for your explaination. Best Regards ahuat

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