adccommunitymod (AutomationDirect) asked a question.

Calculating RPM with Pulse Width Versus Pulse Count.

Created Date: September 12,2006

Created By: trevorstripling

**** This post has been imported from our legacy forum. Information in this post may be outdated and links contained in the post may no longer work.****

I have downloaded and got the calc RPM example working for my application, but the input sensor I have only pulses 4 times per revolution and does not give me enough resolution at low rpms. I have a shaft that starts at 0 rpm and ramps up to 8000. I need to sample 100-200 times per second to ensure it is not increasing in speed faster than a predetermined acceleration rate. What I need to do (or at least think) is instead of count the pulses per time period to determine the shaft rpm, is to trap the amount of time between pulses instead. Can anyone give me a good example of how to do this with a DL06 using the high speed inputs? Trevor


  • adccommunitymod (AutomationDirect)

    Created Date: September 26,2006

    Created by: al.kaufman

    I 've had to do the same recently on a PC based control system, but the logic is the same.

    Use a 1-Shot on an immediate input of your pulse. Use the 1-Shot to grab the accumulated value of a timer. Divide 4000 by the accumulated value in milli-seconds to get the RPM, assuming 4 pulses per rev. Also put the 1-Shot as an N.C. contact as the condition to run / reset the timer. That's it.

    Adjust the dividend according to the number of pulses per rev and resolution of your timer. ie: Use 600 for six pulses per rev and .01 sec ticks, etc.

    Expand Post
  • adccommunitymod (AutomationDirect)

    Created Date: September 26,2006

    Created by: Rich1955

    Sp8------------udc 176

    spo Nc---------udc 176

    X3 incoderx4---udc 176

    K9999999

    X3 NC-----------Ld cta 176

    out v2000

    That is the fastest way I know

    Expand Post
  • adccommunitymod (AutomationDirect)

    Created Date: September 26,2006

    Created by: Rich1955

    Sorry ment X2

  • adccommunitymod (AutomationDirect)

    Created Date: September 28,2006

    Created by: twbrock

    Sorry I took so long to get this posted by I have been busy. This works from 1 rpm to 1000 rpm and more as long as the scan rate is less than 60 mS. Only need 1 pulse per rev. Theta can be 1 to 99 but I am using 90 on a couple of units and this seams to work very well.

    Rung 1

    STR SP0

    LD K6000

    OUT V2104

    LD K90

    OUT V2105

    LD K100

    OUT V2106

    Rung 2

    STR X0

    PD C0

    Rung 3

    STR C0

    ANDN C1

    STR C1

    ANDN C0

    ORSTR

    OUT C1

    Rung 4

    STR C1

    AND X1

    STR C5

    TMRAF T0 K30000

    Rung 5

    STRN C1

    AND X1

    STR C6

    TMRAF T2 K30000

    Rung 6

    STRN C1

    PD C3

    Rung 7

    STR C3

    LD V2104

    DIV TA0

    OUT V2100

    OUT C5

    Rung 8

    STR C3

    MATHBCD V2102 "(V2102 * V2105) + ((V2106 - V2105) * V2100) "

    DIV V2106

    OUT V2102

    OUT V2103

    Rung 9

    STR C1

    PD C4

    Rung 10

    STR C4

    LD V2104

    DIV TA2

    OUT V2101

    OUT C6

    Rung 11

    STR C4

    MATHBCD V2102 "(V2102 * V2105) + ((V2106 - V2105) * V2101) "

    DIV V2106

    OUT V2102

    OUT V2103

    Rung 12

    STRN X1

    LD K0

    OUT V2100

    OUT V2101

    OUT V2102

    OUT V2103

    Rung 13

    END

    Expand Post
  • adccommunitymod (AutomationDirect)

    Created Date: September 28,2006

    Created by: al.kaufman

    Originally posted by al.kaufman:

    I 've had to do the same recently on a PC based control system, but the logic is the same.

    Use a 1-Shot on an immediate input of your pulse. Use the 1-Shot to grab the accumulated value of a timer.

    The general equation is:

    Speed (rpm)=60/(n*t) where: n=pulses/rev

    t=time between pulses (sec)

    Example:

    for n=4, t=.030 sec Speed=60/(4*.030)=500 rpm

    Note: If you use a standard input for the pulses, you want 2+ scans per on-off pulse.

    This sets the max speed you can reliably measure at:

    Speed=60/(n*tmin) where tmin= 2*scan time

    Example:

    for n=15, and scan time =.037 sec

    Speed (max) = 60/(15*2*.037) = 54 rpm

    Above that speed you need faster inputs, a faster scan, or a high speed counter.

    I am doing this with a PC based control system which gives very fast scan times.

    A standard prox on a regular input is fast enough for the rpm range I need.

    Expand Post
  • adccommunitymod (AutomationDirect)

    Created Date: October 02,2006

    Created by: stimpsonjcat

    FYI, this is a standard feature of the Hx-CTRIO card. No code necessary.

  • adccommunitymod (AutomationDirect)

    Created Date: September 12,2006

    Created by: trevorstripling

    I have downloaded and got the calc RPM example working for my application, but the input sensor I have only pulses 4 times per revolution and does not give me enough resolution at low rpms. I have a shaft that starts at 0 rpm and ramps up to 8000. I need to sample 100-200 times per second to ensure it is not increasing in speed faster than a predetermined acceleration rate.

    What I need to do (or at least think) is instead of count the pulses per time period to determine the shaft rpm, is to trap the amount of time between pulses instead.

    Can anyone give me a good example of how to do this with a DL06 using the high speed inputs?

    Trevor

    Expand Post