Reading RPM of a motor

could someone help me how to read speed from a motor. I tried to built one using the example on the help menu but I get either 1 or 0. this motor runs up to 400 RPM and I want the vi to dispaly me the exact reading. there are three wires coming from the motor. one power ,one ground and the other speed sensor. when I looked some examples they use "AO voltage" on the "DAQmx create channel". do I need any analog function to build?
I am using labview 7.0 and pci-6602.
thanks
casu

Hi casu,
Since you have a 6602, you will not be able to us analog measurements. The 6602 is a counter timer card. So you will need to measure the RPM of your motor using a counter.
The speed sensor of the motor should output a square wave whose frequency is dependent on the speed of the motor. If it does not output a square wave, you will have a problem. The 6602 can only input TTL logic signals (high/low, square waves).
In LabVIEW go to Help >> Find Examples >> Hardware Input and Output >> DAQmx >> Counter Measurements >> Digital Frequency
In here you will see several examples. Start with Meas Dig Frequency - Low Freq 1 Ctr.vi
Connect your signal to the gate input of your counter. Run the program and you will see that it gives you the frequency of the input square wave.
Check out the other examples in that directory to do high freq, high range or buffered measurements.
-Sal

Similar Messages

  • Read RPM from Quadrature Encoder

    Hi Everyone,
    I wish to measure the RPM of a shaft using a quadrature encoder and a PCI-6259 card. I've seen a few examples on reading position, which i have managed to get working, but Im not sure on how to get RPM. Any tips or code examples would be greatly appreciated.
    Thanks,
    David

    Hi All-
    Thanks for the suggestion DJ, but your VI will not work as it is written using the Traditional (Legacy) NI-DAQ driver and David's M Series card is only compatible with the NI-DAQmx driver.
    To answer David's question, it is not possible to directly measure position and count edges at the same time.  What you can do is count edges with external Up/Down control (basically the same as a X1 encoder) and then use the edge counting to calculate both frequency and displacement in ticks/degrees/RPM/etc.  I have attached an example I did recently that shows how to use an edge count with external Up/Down control (i.e. PFI10 or PFI11 for M Series ctr0 or ctr1, respectively) provided by the 'B' phase signal and the 'A' phase provided to the counter source.
    Hopefully this helps-
    Tom W
    National Instruments
    Attachments:
    32bit_Cnt_Edges_to_Quad.vi ‏73 KB

  • Adobe Reader RPM has too many provides

    $ rpm -q --provides AdobeReader_enu
    2d.x3d
    3difr.x3d
    ADMPlugin.apl
    Accessibility.api
    AcroForm.api
    Annots.api
    DVA.api
    DigSig.api
    EFS.api
    EScript.api
    HLS.api
    MakeAccessible.api
    Multimedia.api
    PDDom.api
    PPKLite.api
    ReadOutLoud.api
    Real.mpp
    SaveAsRTF.api
    SearchFind.api
    SendMail.api
    Spelling.api
    checkers.api
    drvOpenGL.x3d
    drvSOFT.x3d
    ewh.api
    libACE.so
    libACE.so(VERSION)
    libACE.so.2.10
    libACE.so.2.10(VERSION)
    libAGM.so
    libAGM.so(VERSION)
    libAGM.so.4.16
    libAGM.so.4.16(VERSION)
    libAXE8SharedExpat.so
    libAXE8SharedExpat.so(VERSION)
    libAXSLE.so
    libAXSLE.so(VERSION)
    libAdobeXMP.so
    libAdobeXMP.so(VERSION)
    libBIB.so
    libBIB.so(VERSION)
    libBIB.so.1.2
    libBIB.so.1.2(VERSION)
    libBIBUtils.so
    libBIBUtils.so(VERSION)
    libBIBUtils.so.1.1
    libBIBUtils.so.1.1(VERSION)
    libCoolType.so
    libCoolType.so(VERSION)
    libCoolType.so.5.03
    libCoolType.so.5.03(VERSION)
    libJP2K.so
    libResAccess.so
    libResAccess.so.0.1
    libWRServices.so
    libWRServices.so.2.1
    libadobelinguistic.so
    libahclient.so
    libcrypto.so.0.9.7
    libcurl.so.3
    libdatamatrixpmp.pmp
    libextendscript.so
    libgcc_s.so.1
    libgcc_s.so.1(GCC_3.0)
    libgcc_s.so.1(GCC_3.3)
    libgcc_s.so.1(GCC_3.3.1)
    libgcc_s.so.1(GCC_3.4)
    libgcc_s.so.1(GCC_3.4.2)
    libgcc_s.so.1(GCC_4.0.0)
    libgcc_s.so.1(GLIBC_2.0)
    libicudata.so.34
    libicui18n.so.34
    libicuuc.so.34
    libpdf417pmp.pmp
    libqrcodepmp.pmp
    librt3d.so
    libsccore.so
    libssl.so.0.9.7
    libstdc++.so.6
    libstdc++.so.6(CXXABI_1.3)
    libstdc++.so.6(CXXABI_1.3.1)
    libstdc++.so.6(GLIBCXX_3.4)
    libstdc++.so.6(GLIBCXX_3.4.1)
    libstdc++.so.6(GLIBCXX_3.4.2)
    libstdc++.so.6(GLIBCXX_3.4.3)
    libstdc++.so.6(GLIBCXX_3.4.4)
    libstdc++.so.6(GLIBCXX_3.4.5)
    libstdc++.so.6(GLIBCXX_3.4.6)
    libstdc++.so.6(GLIBCXX_3.4.7)
    nppdf.so
    prcr.x3d
    tesselate.x3d
    wwwlink.api
    AdobeReader_enu = 8.1.1-1
    Almost all of these except the last should be removed. These are installed in a private directory and are not usable by any other programs. rpm's automatic provides generation can be turned off in the .spec by doing:
    %define _use_internal_dependency_generator 0
    Hopefully this makes it to someone who can make this change....

    Hi Orion,
    We could not get to this issue in the dot release of 8.1.2 but we do have it planned for the next major release of the reader. We appreciate your patience and thank you for your feedback.
    Thanks,
    Gaurav

  • How reading Rpm speed from fp quad 510

    I have an encoder of 2500 ppm quadrature differential signal, and i link
    this with a FP_quad_510
    The value reading count/microsec how is possible to transform in RPM?
    Why if i use the FP configurator in the edit device/channel if i setting a
    range of -1,25_1,25 coerce the value range at the default range setting?
    Courtesly i would like information of field point quadrature encoder end
    reading position,speed,reset on the revolution exc.
    Thank for answer Nicola

    Thank's for answer,
    Now i have try to coerce the 1,25 range and i select customer value.This
    mode bring the 1,25 range.
    Nic
    "Pravin B" ha scritto nel messaggio
    news:[email protected]..
    > Nicola,
    > As for converting the count/us into a RPM reading,you will have to do
    > it inside your software program. It's gonna depend on the
    > counts/revolution on your quad encoder. You can then mathematically
    > calculate the RPM and display that on your panel.
    > Ex: 'count/us value' / (1,000,000*60) = counts/min
    > > 'counts/min' / (counts/rev of your encoder) = RPM
    >
    > I am unable to follow the second question but if you mean that your
    > count values coerce when set to +_ 1.25 velocity range setting, it
    > could probably be
    becuase the velocity resolution at that range is
    > 38.15 counts/s and so you may not be able to see smaller counts.
    >
    > You can find more information about the position counters, velocity
    > measurement(speed), index status etc in the FP QUAD-510 Operating
    > Instructions Manual at : http://www.ni.com/pdf/manuals/322633b.pdf
    >
    > To program the QUAD-510 'Reset', right click on the FP-QUAD-510 @x and
    > choose Edit This Device. Then click on Channel Configuration. In the
    > Channel Commands box, press the button that says Create Item. This
    > will create a channel named "Control @Ch0". You can then write to the
    > "Control @Ch0" item as if it was a normal output. Anytime in your code
    > that you write a value of 1 to the "Control @Ch0" item, it will reset
    > Axis 0 (channels 0 and 4). To change which channel you are resetting,
    > simply change the checkboxes before pressing the Create Item button.
    >
    > Hope this helps,
    > Pravin

  • Hi Guys I want to measure the rpm for dc motors?

    Hi
    could you please some one help me to generate a code to convert count edge to rpm?
    Regards

    Hi,
    The method you use for doing this does depend on what hardware you are using. You need to be sure that you can sample the encoder fast enough to catch all of the digital edges.
    Please find attached a good example if you are simply using a digital input device:
    https://decibel.ni.com/content/docs/DOC-18586
    Thanks,
    Aaron
    Aaron. E
    Applications Engineer Team Lead
    National Instruments
    ni.com/support

  • Stop and start counter set to frequency read

    Original question posted in the counter forum but no response so hope its ok to try here?
    I am using a 6024E interface to operate a PID loop that keeps the RPM stable of a servomotor but having problems when attempting to read frequency at the same time from a flow-meter.
    Basically the operation of the system is as follows;-
    User sets an RPM demand, say 5000RPM, an analog signal is sent out to the motor controller and motor runs up to this value after a brief delay. The feedback from the motor is from its shaft encoder which gives 1000 PPR, after signal conditioning in hardware this signal is applied to the gate of timer 0 and after scaling applied to a PID loop. The PID loop is quite stable and responds well to operator demands.
    However the first problem was noticed when the RPM demand was taken to zero and an attempt to halt the program was made. There was a delay in shutting down that was roughly equiv to the time out value which was set on the DAQMX read Vi.
    Things became much worse when a further loop was added to read a flowmeters frequency output (approx 50 to 300Hz max, counter 1) that varied with the servo motors RPM demand. This additional routine has almost stopped the whole program initially starting as it appears that counter channel 1 is waiting for an input before letting the rest of the program run.
    I have attached the part of the program that I am using now to read the frequency of the flow meter, similar routine also being used to monitor the RPM of the servo motor.
    Basically when the operator increases the RPM demand and reaches a demand of 10RPM a compare function places an output line, which is connected to the input OPR1/PFI7 (see attached vi ) to logic 1. This then triggers the counter to start reading the RPM of the motor. A similar method is used for the flowmeter but in this instance it does not try to read the flow until the motor has reached 3000RPM as the flow being measured is very low and below 3000RPM it is only about 2cc/min = 40Hz.
    Problem occurs though when the RPM is reduced to zero and the flow/RPM stops. If the RPM demand is increased again the motor sometimes will not respond and suffers delay. Removing the loop for the flowmeter cures this problem. Seperate loops are used for the flowmeter, motor RPM and PID loop that controls the motor RPM. 
    The problem, as I see it, is that I need to be able to stop the counter for the flowmeter aquiring data when it falls below a certain value but be able to restart it again when the the flow increases?
    Also is there any way I could sync the analog output signal (motor RPM demand) to the counter freq read signal (motor encoder feedback)? I found examples in the help files for this but using 'count edges' not frequency or period mode.
    Thanks John
    Labview Version 8.5
    Labview Version 8.6
    Labview Version 2013
    Attachments:
    arm triggerver1.vi ‏38 KB

    Hello,
    First of all thanks for posting on our forum.
    I may be lazy but I think your question is very long and not very clear... Next time try to be more precise and to post shorter messages, this is just an advise, but short questions often get quick answers.
    now let's talk about your problem, the first thin I'll say is why don't you use NI-Motion hardware, that would be really appropriate to you application, then if you can't (which I understand) you should really use Real-time programming, when you're using a PID, real time is really advised.
    My only question will be : What is the problem?  can you be a little bit clearer? what can we do for you?
    I'm sorry but I'll really be glad to help you but so far I did not understand.
    Regards
    Richard Keromen
    National Instruments France
    #adMrkt{text-align: center;font-size:11px; font-weight: bold;} #adMrkt a {text-decoration: none;} #adMrkt a:hover{font-size: 9px;} #adMrkt a span{display: none;} #adMrkt a:hover span{display: block;}
    >> Découvrez, en vidéo, les innovations technologiques réalisées en éco-conception

  • How do you convert the encoder counts to RMP of the motor using a myRIO in LabVIEW?

    My intent is to gain hardware interfacing and general Labview experience. I am using a myRIO to control a Pittman 8222 34V Brushed DC motor (Motor Specs).
    I recently created a code to control the angle of this motor using PID, which was visually implemented using the black disc with a white tick mark on it (see attached picture: "IMG_2523"). 
    I now want to control the speed of this motor againg using PID, but I am not sure how to properly convert the encoder counts to RPM of this motor. I have attached 2 screen shots of my block diagram and my front panel for reference ("Capture" and "Capture2"). In the front panel picture, you can see my "actual" speed of the motor is a very choppy signal when it should theoretically be a flat line. To get the RPM, I currently use a shift register to store the current count value (which I converted to deg, then to radians), and then subtract the previous run's value, then divide by the while loop sampling time (10 ms). This would give me rad/s, which I then wrote a subVI to convert it to rpm. 
    Any help would be greatly appreciated, thanks. 

    Hi,
    One thing you could try doing is verifying that the conversion from rad/s to rpm is working correctly. 
    This tutorial might also be helpful. It's not using the same hardware that you are, but goes through the general steps using PID control. 
    CompactRIO Motor Control Basics Tutorial: http://www.ni.com/pdf/labview/us/compactrio_motor_control_basics.pdf
     

  • Rpm measurement

    Hei! I have a school project on making a steering system on a scale model boat. Now we been working around the clock to get this thing working but there is one problem/challenge left.
    So i have a Myrio, hall sensor and a dc motor and im trying to measure the rpm on the motor.
    The Hall sensor gives a pulse when the motor turns one round. I have conected the hall sensor to a digital input on MyRio and from there i get a True/False signal for the sensor.
    I guess if i measure how many pulses i got in one secund and multiply that by 60, i get the rpm? but im not sure how do to that i labview.
    Does anyone have some idea on how to do this?   Thanks

    PetterMartin wrote:
    I did not get that to work so i must find a nother solution.
    Maybe something like this (picture)  the teori is that the encoder resets every secunds and counts the number of pulses, but its not working..  Any solutions? 
    What didn't work with the other solution?  What isn't working in this?
    So lets say you get that counter reading the pulses.  Do you know how much time has elapsed between pulses?  That is the other half of the equation.  You must have a way to read pulses, and know the time that they came in at.  Reading with DAQ will give you this.  Are you assuming that the loop that this code runs in will iterate once every millisecond?  If so then this could be a working solution.  Use a single sycle timed loop, on a deterministic OS (myRIO is one) to force it to run at a specified rate.
    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.

  • Samples to Read y Rate

    Buenas tardes, estoy trabajando con la daq ni6009, la utilizo para medir las rpm de un motor de inducción, a través de un swicth óptico. Con un samples to read de 10k y un rate de 20k la lectura de la velocidad me sale aceptable, el problema es que me salen solo dos o tres datos por segundo y yo necesito 20 datos/ segundo (en un archivo). Al cambiar el simple to read y el rate toma mas datos (hasta 10/seg) pero el valor de la medición es erróneo y tiene muchos saltos.
    Ah los datos de la medición los guardo en un archivo de Excel, y al guardarlos aquí es que lo hace 2 datos/segundo; ya que la tarjeta si esta adquiriendo bien los datos con el simple to read(10k)  y el rate(20k)
    Que podría hacer para tener una buena medición y más datos por segundo?
    Gracias

    Buen día.
    Le adjunto mi Vi, y unas imágenes en el cual le explico cual es el problema.
    De antemano Muy agradecido por quien pueda ayudarme.
    Attachments:
    Pregunta.docx ‏139 KB
    Tesina2.vi ‏483 KB

  • Erroneous reading of Counter

    Hi,
    I have a Pentium 4 machine that has a 1.8GHz processor speed with 1GB RAM and I am using PCI 6221: M-series card
    I am trying to measure the speed of a small motor running at/around 20 RPM along with some analog signals. I clubbed the analog signals into one task. But I am somehow unable to read the speed properly. It is giving erroneous values.
    [Note: The counter sees only two pulses per revolution]
    I am attaching the entire program.
    Help would really be greatly appreciated!! If you want to make any changes and upload it, that would be great!!
    Thanks a lot!!
    UBAP.
    Attachments:
    ap1.vi ‏146 KB

    I'm afraid I don't quite understand your application. 
    You said that you're using an analog input to measure the RPMs of a motor
    running at 20RPM and then described a problem with the counter task.  I'd
    be happy to help you, but if you could break your application down into smaller
    parts I would appreciate it.
    If the analog input is reading incorrect values I encourage you to use the
    Measurement and Automation Explorer test panels ensure that your card is
    connected properly and reading good values.  I also recommend you to do
    the same for your counter input depending upon what exactly you're using it
    for.
    A number of examples ship with LabVIEW that demonstrate how to setup analog
    input and counter tasks.  You can find these in the Example Finder (Help
    >> Find Examples)
    With a little more information about your application and details about what
    each acquisition task is trying to accomplish I'd be happy to point you in the
    right direction.
    Elijah Kerry
    Senior Product Manager, LabVIEW
    Follow my Software Engineering for LabVIEW Blog

  • RT multi-motor motion control in a closed loop system

    Hello NI Community,
       We have 12 stepper motors with load cells attached in line on each motor that are connected to a RT PXI chassis.  We use an optical system to gather 3D data on the host computer which is used to calculate relative angles between 2 connected objects.  This data is passed to the RT target as one of several feedback based control strategies that are used (relative angles, force on each load cell, motor position, etc.).  Our Labview code is setup to utilize any of these control strategies for any motor, often using multiple strategies for different motors at the same time.  The code deployed to our RT target is currently a single timed loop that incorporates the load cell reads, PID control calculations, motor command writes and position reads.  In determining the timing of this loop we find it to be ~18Hz.  We would like to integrate a new control strategy that is inefficient below 30Hz and are trying to determine how we can achieve this.  It seems that our limiting factor is the constant writing/reading of each motor at ~4.6ms/motor, although this doesn't seem correct with the posted 62us speeds shown in the specs for the motion controllers.  I'm not sure if this there is a setting that I am missing somewhere that is preventing me from achieving these speeds or if this is a function limitation of our hardware setup.  We would like to achieve this with all 12 motors, although not all motors are always in use.  The PXI components we are using are listed below.
    PXI-1050 Chassis
    PXI-8105 RT Controller
    PXI-7344 Motion Controllers
    UMI-7774 Motion Interface
    Would any of the following be more advantageous than the others or is there another method someone has found useful in speeding up their systems. 
    Split motor read/write into another timed loop with a higher priority over the PID loop.  (deterministic approach)
    Create a unique read/write loop for each of the 3 Motion Controllers
    Create boolean activation to ensure only the motors that are being used are incorporated in the control scheme
    Sorry for the long post but I wanted to make sure I included as many details as possible.  Thank you in advance for your help with this.
    Brian

    Hey,
    Have you tried diagnosing where the problem is by seperating the processes and timing them to see what is causing the delay of the motor control to ~5ms?
    Regards,
    A. Zaatari
    National Instruments
    Applications Engineer

  • How to measure current and voltage and rpm with daq device

    i am measuring current and voltage and am wondering should i use shunt resistors or current sensors hall effect sensors. i have a pci 6221 and a scc-68 breakout box. what specifications or size should the shunt resistor/current sensor be or should i use another device to measure the currrent and voltage. do i need any other safety device between the resistors, current sensors and the scc-68 breakout box when measuring the current and voltage. will the daq card pci 6221 pick up a signal from the resistor. what terminals should the wires from the resistors and current sensors be connected to in the scc-68. i am using a proximity switch to measure rpm of a motor. should the proximity switch be 2 or 3wire connection. should it have an analog or digital connection and is a power supply required to power the proximity switch and should it have an npn or pnp connection

    hello,
     i was going to use a 20amp 50mv, or a 20amp 100mv current shunt and connect wires directly into the AI input terminals of the scc-68 from the current shunt would these be suitable. would current shunts such as these be suitable to use http://uk.farnell.com/elc/sh10020/shunt-sh10020-20a-100mv-1-class/dp/1319576 or http://uk.farnell.com/datel/3020-01098-0/shunt-50mv-20a/dp/1339338
    is it ok to use either a current shunt or should a hall effect sensor be used  such as this http://ie.farnell.com/honeywell-s-c/csla2cd/sensor-hall-effect/dp/1082269 . which of them would be more accurate or are both of them fairly accurate.
    when i am measuring voltage can i connect two resistors between the positive and negative of the wires going to the battery and connect two wires from either side of the resistor directly into the analog inputs of the scc-68 and measure the 12-15 volts directly would the pci6221 and scc-68 be able to measure the voltage drop across the resistor.
    i wanted to measure rpm also does it matter whether the proximity switch has 2 or 3 wires and should it have an analog or digital/frequency output for cponnecting to the scc-68

  • Input and output reading from quanser board

    My department recently gave my senior design group a Quanser board to use for a project. We are having trouble reading data from the motor sensors in Labview. We are using Labview 2010. Can anyone tell me what channels I should be looking at and what kind of inputs they would read? Thanks.

    OK, can you post a .png format screen shot of your code (block diagram) so we can see the broken wires. And what the error message is? Quanser is located in Quebec, Canada so they probably have gone home for the day.
    Putnam
    Certified LabVIEW Developer
    Senior Test Engineer
    Currently using LV 6.1-LabVIEW 2012, RT8.5
    LabVIEW Champion

  • Quanser DC Motor Control Trainer Inputs

    My department recently gave my senior design group a Quanser board to use for a project. We are having trouble reading data from the motor sensors in Labview. We are using Labview 2010. Can anyone tell me what channels I should be looking at and what kind of inputs they would read? Thanks.

    Hi Mouafi, 
    Can you create a new post since the OP was regarding a different question? (trouble reading data from the motor sensors in Labview)
    Thanks, 
    Dave T. 
    National Instruments
    FlexRIO & R-Series Product Support Engineer

  • Can I control a stepper motor by a time varying velocity input?

    I want to control the motion of the stepper motor by a velocity input that looks something like a Sine wave.The velocity is changing as a function of time. Can I change the velocity of the motor at a prescribed time interval?
    Thanks in advance
    Kevin

    Thanks for getting back to me on this. The controller card that I have is the PCI-7342 controller card. The time of a cycle is about seven minutes. I want to ramp the RPM of the motor from zero up to a max value then return it to zero and then go in the opposite direction . A graph of the RPM vs Time is attached.
    I thought that I could input an array of velocities into a Load RPM VI and specify the time for each input.I have not been able to do this as of yet, because the load RPM VI will not take an array input.
    All these inputs would be made in labview so they are inputs for the controller card. I was under the impression that the controller card generates the steps and direction from the data entered in labview and sends the step and direction impulses to the driver. Do I have the method of operation right?
    Do you think this is possible?
    Thanks again

Maybe you are looking for

  • WCCP assignment method mismatch

    Hi all, I am using a Cisco 3825 running 12.4(25G) code. I just upgraded my WAE (oe674) to 5.1.1c. The WAE and router wouldnt peer due to assignment method mismatch when i do a show wccp router. Router Information for Service Id: 61         Routers Se

  • SendFailedException: 554 - Access denied ?!

    Hi people, The following is a piece of code, my first try on JavaMail API.... public class SendMail { public static void main(String[] args) { try { String host = "smtp.vsnl.com"; String from = "[email protected]"; String to = "[email protected]"; //

  • Sort by arbitrary value of object inside Map

    I have a HashMap full of user objects, let's say. I want to sort the user objects in different ways. So if the user object contains name, age, height, weight, etc., I need to sort on any one of those at runtime. I've seen some example in the forums f

  • SAP PM - Validate Tables

    Dear PM Gurus, TDMS copy from ECR(readiness) to ECS(sandbox) is successfully completed in our site, I need to validate the data in the tables for module PM/QM in ECS box to have replication from ECR. Please guide me on this.

  • Mac/forfox/ebay issue

    I am having a problem with ebay.de on firefox running on a mac. It started when you developed and launched the 4.0. It doesn't show the ended button. only when I reload it appears for a split second. If I open it in a external window its working and