How to measure RPM using digital I/O

Please tell me how to measure RPM using Digital Input or please give me a code for this.

You probably aren't going to find anyone to just give you code. Especially because you don't specify the hardware you're using. Doing this on FPGA is different than using DAQmx to do it. With FPGA you count pulses over a specified time. Using boolean logic from the digital DI node is a common way but there are others. (if you are using FPGA I can draw up an example, but I believe there is one on NIs website if you search google for it),. Then, if you want, you can run the data through an IIR filter, especially if you have a low resolution or slow moving encoder. Either of these conditions can result in very large difference of RPM even if the actual speed is not varying much (if you need an example why I can provide more detail, but some simple math calculating RPM should explain this. Obviously lower resolution will giv eyou less accurate results).
If you use DAQmx you can set up a frequency task and it will return the number of pulses in a specified time frame; then you can convert this to RPM based on your encoder resolution and take the same steps of running it through a filter to smooth it out if need be.
CLA, LabVIEW Versions 2010-2013

Similar Messages

  • I want to measure rpm using 100 ppr incremental encoder via digital input

    i want to measure rpm using 100 ppr incremental encoder  via digital input max speed (4000 rpm)
    am using 9178 c-DAQ chassis and 9426 digital input module
    pl provide me example code for this

    Hi asaccullo.
    The recommended settings for encoders are using the counters in the daq cards. Using digital I/O’s is not recommended, the encoders send digital signals but one of the main differences between using digital IO vs counters is that counters are designed to handle these type of events.
    Here I found several examples in ni.com/code that you might check:
    Imitation Quadrature Encoder with DAQmx Counter Tasks
    Use Counter Frequency to obtain an Encoder Rotational Speed
    An Elvis is a daq device, so this should work for you.
    I also found an example for myDAQ, it uses the DIO but with a counter task in the set up.
    Regards,
    steve.bm
    AE | NI

  • How to measure ripple using DVM

    Hi,
    What's the best way to measure ripple using DVM (PXI-4072)? My customer's limits are Vp-p so I think digitizing it would be the best way, but I also think that measuring true RMS would also be a good way to measure it. With digitizing the signal there's some post-processing required. Would calculating just V peak to peak in acquired signal be sufficient?
    Thanks for any comments,
    CT.

    Hi CT,
    To measure ripple, you should be able to use the digitzer mode of the 4072 to measure signals up to 1.8 MS/s.  As long as your ripple voltage is not a higher frequency than that you will be able measure it.  The Developer Zone article linked here gives some more information about DC power  supplies and some considerations for measureing ripple.
    Regards,
    Jim Schwartz

  • Measuring rpm using DAQ device

    How to measure the count value determined from the encoder to rpm value?Cn anyone pls explain?

    1. Write a program to read a count every second.
    2. Find count differene between this loop and previous loop.
    3. rpm=count difference*60/pulse per round.

  • What is the correct way to measure RPM using Visual Basic?

    I have something that works now, but I want to know if there is a better way. I am using a 6023E, I have a Hall Effect switch that goes low then high each rev when a magnet goes by. I have the signal connected to the GATE pin on counter0. I poll the card for the RPM over and over using code based closely on the example STCsinglePeriodMeasure. While this works, I'm not sure exactly what this code is doing. Do I need to call the entire thing every time? The problem is I need to reset and arm the counter each time before starting the counter, and calling everything was the only way I could get it to work. I'm looking for a way to either trim this down, or maybe there is another way altogether that is more apporpriate. Here's the code:
    iDevice% = 1
    ulGpctrNum& = ND_COUNTER_0
    ulArmed& = ND_YES
    ulTCReached& = ND_NO
    iYieldON% = 1
    iStatus% = GPCTR_Control(iDevice%, ulGpctrNum&, ND_RESET)
    iRetVal% = NIDAQErrorHandler(iStatus%, "GPCTR_Control/RESET", iIgnoreWarning%)
    iStatus% = GPCTR_Set_Application(iDevice%, ulGpctrNum&, ND_SINGLE_PERIOD_MSR)
    iRetVal% = NIDAQErrorHandler(iStatus%, "GPCTR_Set_Application", iIgnoreWarning%)
    iStatus% = GPCTR_Change_Parameter(iDevice%, ulGpctrNum&, ND_SOURCE, ND_INTERNAL_100_KHZ)
    iRetVal% = NIDAQErrorHandler(iStatus%, "GPCTR_Change_Parameter/SOURCE", iIgnoreWarning%)
    iStatus% = GPCTR_Change_Parameter(iDevice%, ulGpctrNum&, ND_GATE, ND_DEFAULT_PFI_LINE)
    iRetVal% = NIDAQErrorHandler(iStatus%, "GPCTR_Change_Parameter/GATE", iIgnoreWarning%)
    iStatus% = GPCTR_Change_Parameter(iDevice%, ulGpctrNum&, ND_INITIAL_COUNT, ulCount&)
    iRetVal% = NIDAQErrorHandler(iStatus%, "GPCTR_Change_Parameter/INITCOUNT", iIgnoreWarning%)
    iStatus% = GPCTR_Control(iDevice%, ulGpctrNum&, ND_PROGRAM)
    iRetVal% = NIDAQErrorHandler(iStatus%, "GPCTR_Control/PROGRAM", iIgnoreWarning%)
    ' Loop until 'ulGpctrNum' is no longer armed, or run window is closed.
    Do
    iStatus% = GPCTR_Watch(iDevice%, ulGpctrNum&, ND_ARMED, ulArmed&)
    DoEvents
    Loop While ((ulArmed& = ND_YES) And (iStatus% = 0)) And RunWindow.ExitStatus = "Running"
    If RunWindow.ExitStatus = "Running" Then
    'Run window wasn't closed, so read data.
    iRetVal% = NIDAQErrorHandler(iStatus%, "GPCTR_Watch/ARMED", iIgnoreWarning%)
    iStatus% = GPCTR_Watch(iDevice%, ulGpctrNum&, ND_COUNT, ulCount&)
    iRetVal% = NIDAQErrorHandler(iStatus%, "GPCTR_Watch/COUNT", iIgnoreWarning%)
    iStatus% = GPCTR_Watch(iDevice%, ulGpctrNum&, ND_TC_REACHED, ulTCReached&)
    If (ulTCReached& = ND_YES) Then
    MsgBox "Counter reached terminal count! RPM value may be incorrect"
    Else
    'ulCount is the period in microseconds, RPM = 1/val*(100000ms/s)*(60s/min)
    RPM = 6000000 / ulCount&
    ' Debug.Print RPM
    RunWindow.RPM.Text = Str(RPM)
    End If

    Finally getting around to this again. My previous post is incorrect, as the code I am using is based on the single period measure (it's right there in the code). I am having a problem with the values returned with this method. Occasionally, the card will return a lower than expected count, resulting in a very large (and incorrect) RPM value. I'm thinking this must have something to do with arming the counter at some unfortunate and coincidental point on the gate signal, resulting in a short count. It must be an unlikely event, because I get thousands of good, consistent values for every one bad one.
    To resolve this, I am thinking of going to the single buffered period measurement as suggested above. My idea is to set up a buffer with two values,
    and always take the second one (to avoid coincidental arming and short counts). I could also set it up to return more values, and the application could choose the most likely one (ie return three values, throw out the largest and smallest, etc.)
    I would rather just use the buffer in continuous mode, since the RPM varies much more slowly than the counter counts, and any snapshot of the buffer at any time would be sufficient, even in the presence of overwriting, etc. This would allow me to arm the counter once and poll it on the fly.
    My concern is that in continuous mode, the counter will be throwing a lot of errors which will interefere with the program flow. Can I just set the counter to suppress all errors when I do a buffered read? Worst case, I get a value as it is being written to by the counter, which will have some garbage value (hopefully a recognizable signature) which I can throw out in favor of the other values.
    Thanks,
    Doug

  • How to measure rpm

    I have an NI 9401, labview 8.6 and a 9172 chassis and I am trying to measure the rpm of my rotating shaft. The code I wrote works at low speeds but is not accurate at high speeds. Does anyone have a standard labview 8.6 code for obtaining the angular velocity of a rotating object?

    Hi Eluan,
    What part of the code is inaccurate?  Is it the calculation or do you think you need to sample faster to gain more accurate measurements?  It is possible that there is noise in your data that you could average out to obtain more reliable measurements.  Is the measurement being taken with a specific type of device (eg: hall effect sensor, rvdt, encoder)?  There are a lot of different methods for measuring angular velocity of a rotating shaft, so please let us know what method you are using.  We will be better able to help you if we know a little bit more!
    | Zach J. | Applications Engineer | National Instruments |

  • How to measure freq. using usb6008 daq?

    hai,
    i have to measure the frequency of the o/p pulse from the proximity sensor. which is the best method to measure the frequency. do u have any example code.
    thank u.

    Hello visswa,
    The only counter operation you can do with the USB-6008 is simple event counting. But, you can use that example, along with some software timing to calculate the frequency of your signal. Take a look at the example attached. It isn't as accurate as doing a hardware frequency measurement but with the USB-6008, it's probably your best option.
    -Alan A.
    Attachments:
    Count Digital Events_Calculate_Frequency.vi ‏73 KB

  • How to measure frequency using daq 6009

    HAI..
       Im using PFIO line to measure the frequency..i have attached my vi along with this..output is read approximately to the given input when i highlight the execution,but when i use run and run continuosly alone,am getting incorrect values..im totally confused..suggest some ideas..
    another doubt, may i use analog port to measure the frequency of an oscillator?if so kindly help me to create a vi for this also..
    Attachments:
    counter.vi ‏19 KB

    From your VI, one thing is clear, you are creating a task, but you are not clearing it. Please take a look at this example:http://decibel.ni.com/content/docs/DOC-8172

  • How to measure diameter using vision system

    sir
             I am new to vision system, i want to measure diameter of a cylinder please send some example vi's

    Hello ksr,
    You can use a function called Clamp to determine the distance between two edges in an image.  If you have any specific questions regarding this, please respond and provide more details regarding your project.
    Regards,
    Jasper S

  • How to achieve image using digital camera of USB-type interface through IMAQ PCI-1424 board.

    1.Is it doable?
    2.How to connect USB-type interface with IMAQ PCI-1424 board.
    Thanks!

    See the Developer's Zone (www.ni.com/zone) for specifics on USB (search for "USB").
    "1.Is it doable?"
    - In short "no".
    - USB is similar to FireWire (IEEE 1394), and no framegrabber is required. We offer an IEEE 1394 IMAQ driver to interface FireWire cameras with LabVIEW & CVI.
    "2.How to connect USB-type interface with IMAQ PCI-1424 board."
    - You will need a USB driver for the camera. The 1424 is not required.

  • How to measure the frequency of a pulse being generated by a counter

    Hi,
    I am using labview 8.6 to generate 5 evenly spaced pulses for every 1 revolution of my shaft. However, I would also want to know the frequency of these pulses so I can determine the shaft speed. Since I am already generating the pulses using one of my counters, can I still tap into that or task another counter to measure the pulse frequency? If so, how? I have attached my code for generating the pulses and I am using an Ni 9401 module and an NI 9172 chassis. If someone can helo me modify the code to measure and tell me the pulse frequency as well, that would be really appreciated
    Attachments:
    autotrain2.vi ‏19 KB

    You'd probably get a more coherent answer if you didn't bounce around from thread to thread so much...
    How can I generate a pulse train from shaft encoder? (5/13)
    pulse train from encoder (5/15)
    how to measure rpm (5/20)
    How to measure rpm using shaft encoder and labview (5/23)
    This thread (also 5/23)
    I see you ignored my suggestion from the other thread--Kevin's solution is good too but using an encoder task offers more noise immunity (I think this is probably the cause of the problem you reported on the other thread).  You can fix it with digital filtering if you want to keep using a counter output instead of an encoder task.  Noise during transitions is pretty common for a quadrature encoder.
    A finite counter output task uses 2 counters on the 9172 (although you said 9174 earlier at one point--this wouldn't be the case on a 9174) so you wouldn't have one left to make your frequency measurement.  With the solution you have now, you can change to continuous to free up a counter if you don't care about outputing an exact number of rotation's worth of pulses (I'm not sure if you do or not--I didn't read through all of the various threads relating to this application to find out).
    For your actual question in this thread...  Have you tried running one of the frequency measurement examples?  From the code here I can't tell what you have tried (it just looks like a mangled version of the code Kevin gave to you in your other thread).
    Best Regards,
    John Passiak

  • How to measure the rpm using NI 9411 and counters

    How to calculate the rpm of a shaft using NI 9411 and counters?

    http://forums.ni.com/t5/Signal-Conditioning/measuring-rpm-using-DAQ-device/m-p/2571131#M7353
    Additionally, if you set it to read a degree instead of pulse, your calculation will change a bit, but I'll leave that to you.

  • Using a 9205 to measure RPM

    I have not used labview in over 10 years but now have an application that requires but I am more then rusty. I am trying to measure RPM using a 9205 module and I am sure there is a way to do it. I have a pulsed voltage output from my measurement circuit and so far I am capturing the voltage. Can someone suggest a way to convert these voltage pulses to an RPM value. I am sure some type of leading edge counter would work.
    Thanks

    Not the cheapest route but there is a SCXI card that measures frquency.
    http://sine.ni.com/nips/cds/view/p/lang/en/nid/1661
    There may be some other frequency cards this is one I have used in the past.  With this card you can create a virtual channel and ask it what frequency the analog signal is going into it.  From here there is a conversion from frequency to RPM depending on the type of resolver or hall signal you are using to generate that signal.
    This method is the easiest but the cheapest would be to get a cheap AI DAQ device that can measure several times faster than the generated signal (nyquist theorem) then analyze the series of AI reads to determine the frequency.  Then convert frequency to RPM.  Depending on the signal a USB DAQ device might work, if not a PCI or PXI + MXI card would still probably be cheaper than the SCXI route.
    Unofficial Forum Rules and Guidelines - Hooovahh - LabVIEW Overlord
    If 10 out of 10 experts in any field say something is bad, you should probably take their opinion seriously.

  • Measure rpm and PWM signals using digital input of NI9401 module

    Hi, is there a simple way how measure rpm (to 5000 rpm) and PWM (about f=3kHz) signals using digital input of NI9401 (ultrahigh-speed digital I/O)  module plugged in NI 9172 ?  I will wellcome any suggestions and VI examples (bether still). I'm begginer using LView 8.2. I apologize for my poor English. Many thanks.

    Hi CUA,
    Since you have already the right tools, you just need to get started with the software. The NI-9401 will give you access to the counters that are inside the cDAQ chassis 9172.
    You need to place the module in slots 5 or 6. You can read in how they work and how to configure them in the counters section of the user guide found here.
    Now to measure rpm, you can either measure the period of the signal (seconds) and multiply by 60 to have minutes and the number of ticks per revolution. You can find a shipped example to read period called “Meas Dig Freq-Buffered-Cont-Large Range 2 Ctr.vi” found under Hardware Input and Output » DAQmx » Counter Mesurements
    To measure PWM, it is similar procedure and you can read the semiperiod (high time or low time). There is also a shipped example called “Meas Semi-Period.vi” found under the same location.
    There is great information for these kind of task at this page or just post back if you need to.
    Hope this helps.
    Gerardo O.
    RF Systems Engineering
    National Instruments

  • How can I measure RPM with CTR-500 module?

    I have used  the CTR-500 module for mesurement of  motor RPM. But it doesn't have direct option to measure  RPM ,
    so i have count pulses for  1sec (then reset the counter) and  by calculation show the result for 1min. But it varies every time ,cant give me fix RPM.
    I want reliable solution for this.

    min
    You have not said how much the RPM actually varies from reading to reading and what the range of measured RPM is for the process.  This variation can be caused by a couple of things.  One would be actual variations in RPM due to changes in motor loading.  What is this motor driving?  Most RPM readouts use some form of sample averaging to smooth out the readings.
    A second cause could be your vi.  Suggest you post a copy of your vi. 
    In case you have not seen it, here is a link to a KB about measuring frequency with cFP.  It also links to several other docs on the same subject .  http://digital.ni.com/public.nsf/allkb/D8DB42F9FDC3607E862568640047F144?OpenDocument 

Maybe you are looking for

  • Problem in calling a WS with complex type

    Hi all... I have to invoke a WS that has as input type a complex type defined in the wsdl... <complexType name="LoginInfo"> - <sequence>   <element name="appCode" nillable="true" type="string" />   <element name="login" nillable="true" type="string"

  • QT video export with Embedded QT video

    I had a whole series of problems in exporting my slide show to QT after I embedded a QT movie. Transitions got messed up. Some bullets stopped working and I have been trying to debug for 3 hours. I saw a number of closed but unresolved posts on this

  • Email ID in Contract form

    Hi, I am working in adding the new fields in standard Contract form (BBP_CONTRACT). In W_CONTRACTDETAILS window, there is a field call E-mail in text 'TE_CONTACT'. The value for this field is coming from  field &SF_CTR-RESP_EMPLOYEE-E_MAIL&. When I a

  • Need help serializing an AbstractTableModel for a JTable with cell editing.

    Fun times are ahead. Here we go! I have a JTable that contains data I'd like to serialize out to a file to be restored and viewed later. So I tried saving the AbstractTableModel subclass out to a file. Whenever I do this, I get the following error me

  • Unable to navigate from one screen.

    Hi All, I am new to this customization in Oracle Identity Manager Self service control. I have to create a new tab in OIM Self service console from which it should navigate to a popup screen. I gone through some code as given below. Due to this I am