Author Topic: TMD low frequency measurement  (Read 6100 times)

nicad10

  • Newbie
  • *
  • Posts: 1
  • I'm a llama!
    • View Profile
TMD low frequency measurement
« on: March 07, 2009, 08:59:02 AM »
Hi,
I have a T100MD trying to evaluate if it will fulfill all our needs.
I have a query on measuring frequency.

I will be connecting the output pulses from a flowmeter to the PLC and would like to measure the frequency to determine the flow.
Problem is that the frequency is pretty low, from 0.16Hz at low flow to 13.9Hz at high flow.

Can the PLC measure such low frequencies using the pulsefrequency facility?
What is the resolution of measurements?

If pulsefrequency will not do it, is there a better way, using PLC? Or do I have to start looking at ways of increasing the pulsetrain frequency externally?

Any help appreciated.

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3171
    • View Profile
    • Internet Programmable PLCs
Re:TMD low frequency measurement
« Reply #1 on: March 07, 2009, 11:06:41 AM »
Use PULSEPERIOD which returns period of the measured pulses in microsecond.

You can get a higher resolution of the frequency by the following formula:

 A = PULSEPERIOD(1)
 F = 1000000000/A         ' constant = 100 million microseconds

The value in F is therefore expressed as 0.01Hz for every unit.

However, this would not work properly for period longer than 3.5 seconds because the CPU would treat it as no incoming pulses and set the result of PULSEPERIOD to maximum integer value and PULSEFREQUENCY to zero. This means the lowest frequency measurable is about 1/3.5 = 0.28 Hz.

If you need to measure from 0.16Hz to 0.28Hz you may have to parallel the signal to another input defined as interrupt input, and then you can measure the time difference between two interrupt occurrences. You can get reasonably accurate timer value by setting up a high speed timer to restart itself periodically. A bit more work here but may be a good exercise to learn how to use the various features in this PLC.
Email: support@triplc.com
Tel: 1-877-TRI-PLCS

nicad1

  • Newbie
  • *
  • Posts: 1
  • I'm a llama!
    • View Profile
Re:TMD low frequency measurement
« Reply #2 on: March 09, 2009, 08:43:25 AM »
 ???
Hi again,

That sounds good, that I may be able to utilise the TM100 for our product but....
Being a complete novice with T-Basic and under intense pressure to give a yes/no on the suitability of the PLC I am struggling to keep up with the required learning curve.

Any one-off help in what I need to do programming wise would be most appreciated. I could burn endless hours experimenting, but on this occasion I can't unfortunately. I've figured out how to use the PLC to perform all our other tasks but this is the last sticking point.
Sorry to be a real pain but if you could assist just this once I'd really appreciate it.

Thank you.

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3171
    • View Profile
    • Internet Programmable PLCs
Re:TMD low frequency measurement
« Reply #3 on: March 09, 2009, 02:11:50 PM »
To use the PULSEPERIOD part it is extremely simple:

        1st.Scan                              INIT
|------||------------------------------{dCusF}
        IN1                                     getFreq
|------||------------------------------{dCusF}


Inside INIT custom function, define the following:

   PMON 1

Inside the getFreq function, define the following:

   A = PULSEPERIOD(1)

IF A <> 0  
    F = 1000000000/A
    SETLCD 1,1,"F="+STR$(F/100)+"." + STR$(F MOD 100)
ENDIF

That's all. You can connect your pulse input to input #3 (which maps to PMON 1) and everytime you press the IN1 input the incoming pulse frequency is displayed on the LCD from 0.28 Hz to 10000.00 Hz.





   
Email: support@triplc.com
Tel: 1-877-TRI-PLCS