Linear encoder

Hi All
I want to record the position(rotation) signal. If there are 1024 pulse per revolution, I want the position signal to increase linearly(1023,1024,1025......). Shall I use Linear encoder or Angular encoder (From DAQmx creat virtual channel).
I am using NI-9411.
Thank you!
Solved!
Go to Solution.

Hi lvymerciqq,
For Devices without Counters:
Your module, the NI-9411 doesn't have any on board counters, so unfortunately you cannot use counter functions such as the Linear/Angular encoder DAQmx channel VIs. If you're using a Compact RIO, you can make use of Counters for the device via the use of Scan Mode (You can see this in the NI Example Finder). However, if you're using a Compact DAQ then there are no Counters to make use of so we'd have to implement our own methods in order to clock the signals. For now, I'd think that this application would be limited by being software driven (i.e. making the OS check that a rising edge has occured) however I'm going to do some research and see whether or not there are other possibilities that can be explored; however it won't consist of such a simple solution as just dropping down a single polymorphic VI.
For Devices with Counters:
You can configure a Counter task to count the number of rising edges recieved from the encoder; therefore this number will increment on every increased rotation of the encoder. You'll have to be careful with respect to this number rolling over, however. This is when you reach the maximum count of your counter task and then it resets back to 0; this changes from device to device as different counters have different resolutions.
Alex Thomas, University of Manchester School of EEE LabVIEW Ambassador (CLAD)

Similar Messages

  • Linear Encoder and Configure Logging

    Hi All,
    I am currently using a PCI-6280 M-series board with LV2010.
    I have a Linear Encoder in X4 mode connected to Counter 0 and I was wondering if it is possible to stream the values on the counter as it keeps track of the distance into a TDMS file using "DAQmx Configure Logging" .  I tried this using MAX to configure this, but it does not seem to work, so I'm just wondering if this is even possible as I couldn't seem to find anything online about doing this.
    Thanks,
    Lester
    Solved!
    Go to Solution.

    Hi Lester,
    My apologies, I tried it out on a different board. It can work with yours, too, though. There is an example of a buffered counter task that should allow you to log the data by adding in the Configure Logging VI like we did before.
    Open LabVIEW and go to Help >> Find Examples... it will open the Example Finder. In the Example Finder, expand the folders to get to Hardware Input and Output >> DAQmx >> Counter Measurements >> Count Digital Events >> Count Digital Events-Buffered-Countinuous-Ext Clk.vi
    Put the correct counter channel and PFI channel in the controls, and run the VI to see what it does. Then you can modify the block diagram to add the Configure Logging VI (the same way as before) and run the VI again. You will end up with a TDMS log saved at the path you wire into the Configure Logging VI.
    I hope that helps.
    Regards,
    Daniel H.
    Customer Education Product Support Engineer
    National Instruments
    Certified LabVIEW Developer

  • Do I have to use an external clock with a cDAQ-9188 and NI 9401 to read a linear encoder? I'm seeing error message that implies that but the example code doesn't show it.

    We can set up a task that works on demand but when we go to continuous sampleing we see Error -200303, which claims an external sample clock source must be specified for this application.  However, some of the NI linear encoder example code doesn't show that (uses the cDAQ 80 Mhz clock) and the documentation didn't mention that. 

    It's mentioned in the 918x user manual:
    Unlike analog input, analog output, digital input, and digital output, the cDAQ chassis counters do not have the ability to divide down a timebase to produce an internal counter sample clock.  For sample clocked operations, an external signal must be provided to supply a clock source.  The source can be any of the following signals:
    AI Sample Clock
    AI Start Trigger
    AI Reference Trigger
    AO Sample Clock
    DI Sample Clock
    DI Start Trigger
    DO Sample Clock
    CTR n Internal Output
    Freq Out
    PFI
    Change Detection Event
    Analog Comparison Event
    Assuming you have at least one available counter (there are 4 on the backplane), I would suggest to configure a continuous counter output task and use its internal output as the sample clock.  Specify the internal counter using an "_" for example "cDAQ1/_ctr0".  The terminal to use for the sample clock source would be for example "/cDAQ1/Ctr0InternalOutput".
    Which example uses the 80 MHz timebase as a sample clock?  It is far too fast for a sample clock on the 9188 according to the throughput benchmarks (80 MHz * 4 byte samples = 320 MB/s).  There is also no direct route between the 80 MHz timebase and the sample clock terminal for the counters--making this route would use a second counter anyway.
    Best Regards,
    John Passiak

  • How to read the position in an linear encoder, model AT112 from mitutoyo?

    Hello,
    any one knows how to read the positon in a linear encoder, model AT112 from mitutoyo, that have the signal out in the sinusoidal form?
    thanks

    Hello Hugo,
    In order to help you efficiency, please contact National Instruments (01.48.14.24.24) with the reference number 409230.
    I will personnally help you to connect your linear encoder.
    Regards.

  • Renishaw Linear Encoder (Find HOME)

    I have Renishaw RGH22X Series Readhead optical linear encodes on the X&Y Axis. The encoders provide 25,400 pulses per inch (1000/mm) and are about 16 inches in length. I am working in "Open Loop Pulse Mode" sending step/direction.
    These encoders share a forward and reverse limit switch. Basically, a 0.25 VDC output is measured if the drive is between the limit switches, but if the drive hits a limit (either one), the voltage drops to zero.
    The encoder is also equipped with a "reference" switch which provides a single pulse between X and Xnot. The limit swith is suppose to be used to accurately "home" the axis. Unfortunately, I am having trouble trying to "home" the axis. The X or Xnot trigger has not been sensed when wired to t
    he "home" input on the UMI-7764. I have verified, that if a standard 5 VDC Signal, or 0 VDC depending on the Axis setup, is used, the "home" state is sensed. However, the reference pulse is not being seen (either X or Xnot) when wired directly to the "home" input.
    I tried to find a "reference" pulse to home the drive but the drive needs to move further than a single rotation since the refernce pulse is located on a single end of the encoder. I have not been successfull using this approach and then learned that find reference is not supported in Open Loop Stepper Mode.
    Is it possible to "home" this system using the signals available from the Renishaw encoders? What must be done to establish home?
    Regards,
    Guy

    Guy,
    Thank you for contacting National Instruments. I believe that you were able to speak with another engineer over here to get that question resolved, but I just wanted to post the results in case you had other questions or other users are interested.
    Because the encoder you are using is very fine, it returns a large number of pulses every second; this obviously will make the pulse width very small. If you look at the specifications for the Home inputs of the 7344, then we can see where it requires a 1 ms minimum pulse width. In your current setup, the system is moving fast enough to where that pulse is coming in too quickly for the motion controller to detect.
    In order to correct this, we can develop an application where we slow down the velocity of the mo
    tor. By doing this, we should be able to successfully detect the pulse and reliably find the home switch in your system.
    Regards,
    Michael
    Applications Engineer
    National Instruments

  • Linear encoder (newall SGH) controlled with motion cotnroll UMI7764 and LabView

    Hi,
    I would like to intsall my linear encoder (SGH PC) onto the motion controll box (UMI7764). After that I have to use LabView to controll the encoder. It should give me the position of a piston and also the limits for this piston. So at first I just want to controll the position of the piston and then give the limits or controll the piston with it.
    My problem is I have no idea how? How can I get my signals out of the encoder into my LabView programm? I got the key for the pins but still unclear how to get my signals and what to do with them.
    Sorry, I am not used to use LabView. 
    Thanx

    Oh, ist mein Englisch so schlecht
    Dann formuliere ich meine Aufgabe einfach noch mal auf Deutsch um Missverstaendnisse auszuloeschen.
    Meine Aufgabe ist es einen Linear Encoder (SGH PC) an einen Piston (wie heisst das auf Deustch?) anzubringen und anzusteuern. Zunaechst soll nur die Position des Piston damit bestimmt werden, danach aber auch Vorgaben gesetzt werden. Heisst, ich gebe eine Routine vor und der Piston macht das dann hoffentlich auch.
    Um den Encoder ansteuern und auslesen zu koennen stehen mir eine Motion Controll Card (UMI 7764) und eine PCI 7324, sowie LabView 8.6.
    Zur Zeit sind wir noch mit der Installation des Encoders beschaeftigt, doch bald werd ich auch programmtechnisch handlegen muessen. Leider hab ich noch nie mit einer PCI oder all dem Anderem gearbeitet und kenne mich daher nicht damit aus. 
    Fang ich also mit einer Grundlegenden Frage an: Hat LabView ein VI was es mir ermoeglicht die benoetigten Kanaele aus dem PCI auslesen zu lassen und wieder zu schliessen? Dann waere die Positionsbestimmung ja hoffentlich nciht so kompliziert.

  • Linear encoder in LABview

    I've managed to get three seperate sine waves out of my encoder. At this point i'm wondering what i have to do within labview to translate these three sine waves into some sort of position indication.
    Here is some information:
    The DAQ card that I have is a PCI-MIO-16e-1 The linear encoder that i'm attempting to use it a RSF Elektronik MS 6x i can't find the data sheet for the exact model but i've attached a pdf which talks about the variouis signals that it outputs. Also the table below is a table that I found in the documentation for the MS 6x that I have which explains the various pin outputs of the encoder. I hope this help please let me know if you need any further information.
    Pin                   Signal
    1                      +5 V                                                                Supply
    2                      V Gnd              Analog ground              Output 2,5 V typical
    3                      R1                    Analog voltage signal
    4                      A2                   Analog voltage signal                2 Vss typical
    5                      A1                   Analog voltage signal                2 Vss typical
    6                      0V
    Attachments:
    44769_5.pdf ‏124 KB

    Duplicate post
    Regards,
    André
    Using whatever version of LV the customer requires. (LV5.1-LV2012) (www.carya.nl)

  • Linear Encoder, Counting Ticks

    To all,
    I have the VI created for the linear encoder and everything works fine, except when it comes to counting ticks.  When the encoder moves in the positive direction from initial position, the ticks are counted correctly, but when I move the encoder in the negative direction from the initial position, the encoder immediately reads "4.29E+9".  It continually reads this value moving backwards, and will not accurately measure position until the encoder has been moved an equal distance forward, back to its initial position, then it counts forward correctly.  Any speculation as to why it reads this number?  Any suggestions for fixing?
    Thanks,
    Owen

    Could you please make a trial with an example from NI ?
    LV Menu >> Help >> Find Examples... >> Hardware Input and Output >> DAQmx >> Counter Measurements >> Position >> Measure Angular Position.vi
    You can easily adapt it for a linear encoder but even the original version will allow you to check your setup. Please read the NI-DAQmx help for the default terminals for your DAQ card.

  • DAQ device for linear encoder & labview 7.0

    Ok, I am in a bit of a bind, so the quicker the response the better =).    I currently have Labview 7.0, and am needing to read the pulses of a MicroE hi-res encoder.  I know I am in need of a DAQ device, so I just want to know which one would be the best (cost-effective & easy to manipulate with Labview).   Also, I need three analog inputs as well.  Preferably the range of the analog inputs would be 0-10 volts (well, preferably 0-10mv, but that is unikely).  I am very unfamiliar with programming Labview, but will learn what I need .
    Thank you VERY much!

    Hello heepofajeep,
    I would highly recommend you go with an M-Series Mulitfunciton DAQ Device for this application.  The two counter channels on these devices have expanded support for two phase relative linear and angular encoders, compared to older E Series devices.  In addition, these devices are capable of performing analog input, analog output, and digital I/O operations.  They contain a minimum of 16 analog input lines, with a programmable gain amplifier that will allow you to programmatically set the range anywhere as large as +/-10V to +/-0.1V in order to take full advantage of the resolution of the ADC on the device.  These devices can be programmed in LabVIEW 7.0 or later with the NI-DAQmx driver, and there is the DAQ Assistant and many great example programs for getting up and running with your application quickly.
    I hope this information helps and let us know if you have any further questions.
    Regards,
    Travis G.
    Applications Engineering
    National Instruments
    www.ni.com/support
    Message Edited by Travis G. on 08-18-2006 04:55 PM

  • DAQmx Quadrature Encoder Initial Position

    Hello, 
    I am building an application that requires trackig the raw counts from a quadrature encoder connected to a NI USB-6212.  In order to count each rising and falling edge of both channel A and channel B, I have configured a DAQmx Linear Encoder Channel for 4X decoding with the units set to ticks.  In order to prevent the counter from rolling over when the ticks become negative, I convert the U32 value from DAQmx Read to I32.  So far this all works as expected.  I would additionaly leik to retain to position of the encoder if the VI is stopped but remains in memory.  For this reason I wire the value of the raw counts to a shift register which is read into the initial position input of the DAQmx Create Channel VI.  For some reason, the DAQmx Create Channel VI quadruples whatever value is wired to the inital position input.  I solve this by deviding the previous counts by 4 before writing to initial position.  However, the problem occours that if the value of the previous count was not an even multiple of 4, the inital position must be rounded to the nearest integer, causing the count to jump when restarting the VI.  How can I reset the inital postition to the exact value of the encoder at the end of the previous iteration?

    Yes, It does. In 1X decoding mode, the starting count equal to the supplied initial position, but then I only count 1/4 of the pulses I expect to see.  Perhaps I am misunderstanding the meaning of 'inital position'?

  • Measurement error in reading Encoder Pulses

    I am using PCI-6601 card to read a Linear Encoder which gives 2000 pulses per mm of distance.The accuracy of the Linear encoder is 2Microns.In my application I am measuring a distance of 7mm.But the card is reading with an error of 30 to 50 Microns error.We had checked up all the factors related to mechanical and Encoder.In fact the same application was earlier working with Advantech Encoder card which has provisons to connect the A,B,A Bar,B Bar inputs from Encoder.There was an accuracy of 0 to 5Microns.But the application was replaced with NI Card because of the continuous problem of the Digital I/O Card used from Advantech.
    Mail me the possible causes and also the troubleshooting procedures for correcting the above problem

    Hi,
    What I think is happening is there might be some noise on your signal lines. The PCI-6601 counters are capable of detecting a pulse as small as 20ns. If the Advantech card can't detect pulses at that small a resolution, it might be ignoring "noisy" pulses that shouldn't be there. Are you reading more pulses than you should be or less?
    There are a couple things I might be able to suggest to clean up your signal. The counters support several different encoder modes. Try using X4 Encoders. An X4 encoder counter increments or decrements on each edge of channels A and B. Whether the counter increments or decrements depends on which channel leads the other. Each cycle results in four increments or decrements. I believe this X4 mode is more noise resi
    stant than the standard mode.
    Another thing you might want to consider is applying a filter to the input signals (debounce or deglitch filters). Each PFI line coming from the I/O connector can be passed through a simple digital filter. The filter operates off a filter clock and a fast internal sampling clock. It samples the signal on the PFI line on each rising edge of the sampling clock. A change in the signal is propagated only if it maintains its new state for at least the duration between two consecutive rising edges of the filter clock (one filter clock period). The frequency of the filter clock determines whether a transition in the signal may propagate or not.
    6601/6602 User Manual
    http://digital.ni.com/manuals.nsf/webAdvsearch/DD0DBB6404BC139886256721007CF16D?OpenDocument&vid=niwc&node=132100_US
    Hopefully one of these suggestions will do the trick. Have a good day.
    Ron

  • 6602 as X4 encoder/ex​ternal clock

    Hello,
    Im trying to use a PCI 6602 to read the output of a linear encoder.  I have a few (I think simple) questions about setting things up...
    Right now I am only using CTR 0 (channel A hooked up to pin 2, B to 40, and Z to 3).  I have been trying to use the DAQ assistant to set up the code.  When i change the acquisition mode to continuous, it asks me to specify a clock type and source.  The only option I am given for clock type is external (is this right?), and for source I have options like PFIxx or RTSxx.  None of these source options seem to allow me to acquire data in continuous mode (The "test" routine doesn't read back anything).  Any suggestions on what I should be doing differently?  Don't feel bad about "dumbing down" your reply :-)  Any info is useful, I'm pretty new to Labview...
    Thanks

    I don't have an LV machine available near my network PC and have only been able to look at the screenshots.  To be perfectly frank, I see far too many issues to address and tutor individually with the limited time I have.  As friendly advice, I would *strongly* recommend backing up several steps and first make an app that works with 1 encoder.  Once you get through that part of the learning curve, *then* add the other encoder channels to your app.  Then my prior post about DMA and interrupts will become relevant again.
    Other things:
    1. I really, *really*, think you've got the wrong idea about how the counters measure encoder signals.  You do NOT need to sample at 2x the encoder pulse rate, the Nyquist theorem does NOT apply here.  The hardware count register tracks encoder position accurately with your 400 kHz encoder signals.  Your app is free to choose how often to sample that count register according to your needs.  This may be anywhere from 1 Hz or less to several kHz.  It does NOT need to approach 1 MHz and even if you tried, the system is almost certain to be incapable of such a rate.
    2. After all the talk about sampling at 1 MHz, you have a software loop that reads 1 single value at a time from each encoder and has a timer to run it only once every 10 msec.  There is a *very* fundamental disconnect here.  (It also appears that you have optional file writes inside the same loop, another factor that'll slow you down.)
    3. The encoder readings are not hardware-sync'ed in time -- the first value read from each represents their positions at different points in time.  With such high-precision encoders, I'd think you would need hardware sync on the read times.
    Finally, why not give us an overall description of your app's needs?  Kind of a big picture description.  I know you've told us what you think the problems are, but I'd wager my NI screwdriver that the 1 MHz sampling rate you think is your main problem will turn out not to be relevant. 
    -Kevin P.
    I don't have an LV machine available near my network PC and have only been able to look at the screenshots.  To be perfectly frank, I see far too many issues to address and tutor individually with the limited time I have.  As friendly advice, I would *strongly* recommend backing up several steps and first make an app that works with 1 encoder.  Once you get through that part of the learning curve, *then* add the other encoder channels to your app.  Then my prior post about DMA and interrupts will become relevant again.
    Other things:
    1. I really, *really*, think you've got the wrong idea about how the counters measure encoder signals.  You do NOT need to sample at 2x the encoder pulse rate, the Nyquist theorem does NOT apply here.  The hardware count register tracks encoder position accurately with your 400 kHz encoder signals.  Your app is free to choose how often to sample that count register according to your needs.  This may be anywhere from 1 Hz or less to several kHz.  It does NOT need to approach 1 MHz and even if you tried, the system is almost certain to be incapable of such a rate.
    2. After all the talk about sampling at 1 MHz, you have a software loop that reads 1 single value at a time from each encoder and has a timer to run it only once every 10 msec.  There is a *very* fundamental disconnect here.  (It also appears that you have optional file writes inside the same loop, another factor that'll slow you down.)
    3. The encoder readings are not hardware-sync'ed in time -- the first value read from each represents their positions at different points in time.  With such high-precision encoders, I'd think you would need hardware sync on the read times.
    Finally, why not give us an overall description of your app's needs?  Kind of a big picture description.  I know you've told us what you think the problems are, but I'd wager my NI screwdriver that the 1 MHz sampling rate you think is your main problem will turn out not to be relevant. 
    -Kevin P.

  • Encoder Counter Intermittently Set to 0

    I am using Labview on a windows XP box with a 6221 DAQ board connected to a 7330 motion controller via a RTSI bus.  I believe I have everything roughly working, but there is a behavior that I would like to explain before I go live.
    I am sampling an analog input in lock step with a counter that is fed by the encoder signal from the motor.  So I have a series of 2 numbers that I record to file, and the sampling starts at the same time, the sampling is done by the same clock.  This all seems to work.
    If I look at my series of #s regarding the counted ticks that the counter has generated from the linear encoder task that I set up to keep track of the encoder position, I'll get what I expect, but once in awhile there will be a 0 stuck in there.
    For example:
    1000
    1001
    1002
    1003
    1004
    1005
    1006
    1007
    1008
    1009
    1010
    1011
    1012
    0
    1014
    1015
    1016
    1017
    1018
    1019
    1020
    1021
    1022
    1023
    I cannot seem to discern when this happens and when it does not.  My first guess is it has to do with motor speed/acceleration and sampling rate of the DAQmx Create Channel T(AI) I used to sample the analog input which is the same sample clock that is used for the DAQmx Create Channel (CI-Position Linear Encoder), but I have not had this behvior be reproducible based on sampling frequency or motor speed.
    I appreciate any ideas.
    Thanks

    Sorry for the delay, I've been working on other items.
      OK so as I understand it you are trying to control a stepper motor (based on that's what the 7330 does) and you have it in closed loop (which is why you have an analog and digital signals) and are reading back the analog and digital position data. 
    Clarification: I am reading the digital position data from the encoder and analog voltage from a force transducer that will vary over the course of the movement (the force will be all over the place during move)
    Both of which are being read back by the 7330 and then the digital signal from the encoder you are passing via RTSI to the DAQ board and that is where you are reading and recording those values. 
    Further Clarification:  Only the digital encoder signal goes back to 7330 and then is routed over the RTSI. The analog signal goes striaght into the DAQ.
                                Additionally, the digital encoder signal gets routes over RTSI to PFIs 8,10,9 that are counter 0's inputs.  I then set up a DAQmx Create Channel (CI Linear Encoder) event to sample the counter in step with the analog input.
        I guess it would be pretty hard to see if there is a missing pulse looking at the TTL signal on the 7330's user defined digital lines...but what if you wire the siganl directly up to the DAQ board? any change?
    Have not tried, and probably won't (I'll explain why I won't try below)
    and in your example the count goes from 12 to 14 and there is the 0 where 13 should be...is this always the case? does it keep the correct count? and is it always at the same number? 
           The count doesn't skip #s, it just goes 12 12 12 12 0 12 12 12 13 13 13 14 14 14  (I need to check this behavior more, will do that next week)
           Count is correct
           Not at the same #
           -Since there is no # skipping, or I can just interpolate what 0 should be, I'm hesitant to rewire things.
    Also, does the analog signal have anything to do with the digital signal you are sending to the counter (other than that you want them to have the same sample clock)
        The signals have nothing to do with each other at this point because I am just debugging the system with a fake input
    Seeing that I am sampling a counter, all I can think of is that there is a mismatch somewhere in the counter sampling event.  That is to say, the counter value is always at a value, when it gets latched and how many times it is sampled and how many times I read it out might give some mismatch where I think that I have recorded X events, but because of timing, only X-1 samples have made it into the buffer?  Could it be something like that, that would be my only explaination of why a 0 gets in there, because as I said I am sampling a counter.
    Thanks

  • Can I (and if so, how would I) connect two encoders (one linear and one angular) to the same chassis (NI 9401) and get their respective NI MAX tasks to run as simultaneously as possible?

    Sorry, but I am still rather new to LabVIEW and NI MAX. I connected both devices (a linear probe and an angular encoder) to my NI 9401 chassis. I figured out how to create tasks for each and get continous samples readings from each. When trying to run both in LabVIEW, I get the error saying that I cannot run multiple tasks at once. It suggests the Control Task VI, but I did not see any help in that. Any advice?
    Here is some general information, whatever it is worth: Both encoders are operating off of the same clock source, PFI4, which to my knowledge corresponds to CTR 1 A, where the angular encoder's A signal is wired in. The linear's physical channel is ctr0 and the angular's is ctr1.
    Thank you very much for taking the time to look at this and help me out!
    Solved!
    Go to Solution.

    So if I go the Edge Counter route, is there any way for the task to figure out direction of the encoders? It looks like my options are always counting up or always counting down whenever the encoder is read... For my application, I need it to read when the linear encoder goes in and when it goes out... Am I doing something incorrectly with it?
    I am using a probe to measure the contour of a part, and using a motor to spin the part, with one encoder measuring the angle of the motor and the other measuring the displacement of the probe.
    Also I am still not seeing a way to simultaneously read both devices in NI MAX... I cannot use two counter inputs from the same device at once in the same task it seems.

  • Encoder velocity

    I am having troubles measuring the velocity of my linear encoder with PCI-6220 card.  I have read examples that used dx/dt, but I cannot seem to get that to wok-- when I wire that output to a gauge, I get "0".  I have also tried using shift registers to store previous data for position & time stamp to calculate changing position / changing time, but the problem with that is I get a lot of NaN & inf values randomly occuring admidst getting velocity readings that are appropriate. 
    Thanks!

    Hello Paolinooo,
    To get an understanding of how to program an encoder task with the NI-DAQmx VIs and your PCI-6220, I would recommend taking a look at the DAQmx shipping examples found within the LabVIEW Example Finder by going to Help > Find Examples.  The encoder measurement examples can be found under DAQmx > Counter Measurements > Position.  Also, you can search the online example program database, found at www.ni.com/examples. 
    Travis G.
    Applications Engineering
    National Instruments
    www.ni.com/support

Maybe you are looking for