Speeding up quadrature encoder read out

Hi,
I`m using a quadrature encoder together with a 6259 DAQ Card and BNC2110 Terminal Block.
I managed to have it working with the DAQ-Assistent at 80Mhz using the Counters and reading one value at a time. Before the DAQ-Assistent I used a DAQmx command to connect PFI10 and PFI9 as the BNC2110 Terminal only outputs PFI0-9. This works but it is really slow, the distance between each measurement point is around 6 us. The VI is in the attachement (AquadB_one_value.vi)
So I thought I might use the n-values version with the DAQ-Assistent but this does not work and I dont see any reason why, it is complaining about that connection between PFI10 and PFI9 which it didnt do before in the one-value-version. The VI is also in the attachement (AquadB_n_values.vi)
I also tried another method using a VI I was given some time ago and modified it but here the distance between each measurement point is also around 6us. This VI is also in the attachement (Counter - Read Encoder.vi)
Or am I missunderstanding something? The minimum achievable time distance between measurement points should be 1/80.000.000 s where of course the value can only differ 1/0/-1 because it has only calculated one new change in the A and B Signals right? I thought with using the n-values it is storing all the calculated values in the memory and I am transferring them afterwards for doing all the "post-processing"?
If I am wrong, how can I spped up the read-out of the calculated values any other way?
Best regards
Attachments:
AquadB_n_values.vi ‏56 KB
AquadB_one_value.vi ‏49 KB
Counter - Read Encoder.vi ‏98 KB

Hi Dani_munich,
I just realized that you asked the same question in our Service request. In the service request, I was missing out more information which I found them here by chance . I will further assist you in the SRQ you have created. I also sent you an email.
Regard
Anoj
Anoj Mubarak
National Instruments

Similar Messages

  • Quadrature encoder read

    Hi.
    I'm a new user to labview, so try to be as soft as possible.
    I want to control an electric motor(24v, 3I) via labview.
    I use labview 6i(budget,budget) and a pci6024e board.
    I have a quadrature encoder connected to the motor and I've build
    the pid vi to control it.
    1.what is the best way to connect the encoder?
    i have tried to use software counters, with no luck so far.
    2. I need to find a way to build a vi that can give me the response of a known transfer function to a pulse.is there a vi example or do I need to build it by solving the DE?
    Thank you
    ran

    Hi Ran,
    There are a few examples of either counting digital pulses on your quadrature encoder, or measuring the revolution frequency (frequency measurement). Depending on your application you will need to connect your device to your E series card to either the gate (frequency, period and time measurements) or the source (simple event counting) of the counters. These are decribed clearly in the E Series Help File. http://digital.ni.com/manuals.nsf/websearch/0E0DFDBB7706687A86256F6300560584?OpenDocument&node=10968_US
    In addition, we have a few examples and tutorials on this website. You can simply make quick searches with the few key words i have just mentionned.
    You also have to make sure that the signal coming out of your encoder is in the appropriate format (5V digital). In some cases, you would need a voltage divider.
    As for the second question, I would need some clarification. You can definately process the information you have acquired in any way you want. You can search for our VIs by selecting the search button in the function pallette. Most data processing VIs are for analog signals.
    Best regards,
    Nathan Yang
    Applications Engineer
    National Instruments

  • Speeding up Quadrature Encoder Implementation in cRIO FPGA

    Hi All,
    I've got a bit of FPGA code here that I've been running on the cRIO 9073. We've been using 250/500 count quadrature encoders just fine with it, but have recently moved up to a 2000 count encoder and it seems to be missing counts. I'm not using a machine to rotate the encoder, just my hands. Is there anything I can do to speed up the operation of this loop in the FPGA?
    Regards,
    Ken
    Attachments:
    quad_encoder.png ‏51 KB

    Ken,
    What if you tried using a single-cycle timed loop instead of a while loop and set the speed of the loop with an FPGA derived clock? Also, have you tried using the FPGA wizard to generate Quad Encoder code? To do this, right-click on the FPGA target in your project and select "Start FPGA Wizard". You can select a timing engine for Single Point Continuous and then a functions for Quadrature Counter. 
    Hope that helps!

  • 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

  • Reading Angles From a Line Driver Quadrature Encoder

    I currently have a Quadrature Encoder (Line Drive) and am trying to interface it with a PCI-6602 Counter/Timer Card. I have currently had no luck in correctly hooking it up and reading the angle. Past experience with Quadrature Encoder have all been open collector; I have been able to to successfully hook up an open collector encoder with the 6602.
    Any help in hooking up the Line Driver encoder with the PCI6602 would be appreciated.
    Thanks.

    Justin,
    Normally, the mfgr. would include a recommended "Line Receiver" interface circuit for the encoder. I've found that some line-driver encoders actually can be successfully connected directly to the 6602 for quick-and-dirty testing, though you wouldn't want to wire that up arbirtrarily or rely on it for the long term. In any event, it sounds like you'll need to add a line receiver interface.
    -Kevin P.

  • Read Out Loud: Setting voice speed?

    Setting voice speed in Read Out Loud doesn't work right. When I choose Adobe Reader > Preferences and uncheck the “Use default speech attributes” checkbox, and then change the number in the “Words per minute” field within the allowable range, click OK and then choose View > Read Out Loud, the reading rate DOES NOT CHANGE, no matter what numbers I set in the  “Words per minute” field.
    This worked in previous versions of Adobe Reader. Why doesn't it work in the current version? I used to use this feature a lot, and it is very annoying that it reads at the same slow, plodding rate no matter what I set it to.
    Adobe Reader 9.5.0
    Mac OS X Lion 10.7.3
    Voice: Ryan Infovox Ivox HQ

    Same problem here.  I can change the voice* but even with the "use default speech attributes" button unchecked, changing the pitch or WPM does absolutely nothing.  Bug?
    * even though I can change the voice, they all sound awful and mechanical - barely like the actual voices when played using other Mac apps.  I figure maybe this has something to do with using an incorrect pitch, but since I can't change the pitch, they all just sound awful. 

  • Can't speed up read-out-loud speed

    Hi, I'm experiencing the read-out-loud making long pause between words when it is activated. I tried with "Edit=>Preferences=>reading=>words per minute" but it didn't not really work. It only made each word being read faster, but it didn't shorten the pause between words. Does anyone have similar experience and know how to fix this?
    Thanks

    do people want to use adobe reader while driving? jogging? working in the kitchen, etc.?

  • Simulate quadrature encoder output without hardware

    I am brand new to Labview and have not had any training other than youtube and this fine forum. I am a mechanic trying to solve a problem using labview. I am posting this new question because I don’t have any hardware so I can’t use the examples I’ve seen others pointing to.
    I’m trying to simulate the output of a quadrature rotary encoder. Once I have done that I want to use Labview to program an instrument that reads that signal and makes mathematical calculations to it but I need the signal first. The encoder will attach to a shaft that will rotate clockwise and then counterclockwise at a rate of about 122 times a minute.  The total shaft rotation will be between 0 - 18 degrees. It is important to me to know the direction of the shaft. The quadrature encoder will send out 2 square waves with one wave behind the other. The way I’ve tried to do this is by using 2 Simulate Signal modules each sending out a square wave at 2 Hz. I’ve connected a single knob controller to the both frequency inputs of the signal modules to simulate the speed the shaft rotates back and forth. I’ve done the exact same thing to the amplitude input to simulate the degrees the shaft turns before changing directions. My problem is the changing directions. I can delay the phase, which is what I want to do, but I can’t do it in real time and I can’t do it in a single 180 degree step. What I would like is a switch to change the B channel from +90 to -90 when it is toggled. If I could then toggle the switch when the amplitude reaches 18 degrees or less I will have an encoder signal. Thanks for any help you can provide.
    steve
    Attachments:
    Rotory Encoder.vi ‏59 KB

    Steve,
    From what I understand, you want to make a 180 degree phase shift every N intervals?  I modified your code to do this.  Let me know if that gets at what you are doing.
    Cheers,
    Chris LS
    National Instruments
    Applications Engineer
    Visit ni.com/gettingstarted for step-by-step help in setting up your system.
    Attachments:
    Rotory EncoderEdit.vi ‏61 KB

  • RPM Measurement using Quadrature Encoder and PXI 6602 counter

    Hi,
    I am on a project at work where I need to verify the speed (in RPM) of an unloaded motor which can operate up to 1400 rpm.  After doing some research, i determined that a quadrature encoder could be used to make the measurement.  I am looking at this encoder  http://sine.ni.com/nips/cds/view/p/lang/en/nid/205321.
    I have a PXI 6602 counter/timer module in which I would like to interface to the quadrature encoder.  I would like to create a VI that allows me to calculate the speed using the encoder.  Can someone provide me with details of what needs to be in the VI or an example which can do this?  At the most basic level, i want to calculate the speed on demand.  After doing this, i would like to figure out how to quickly calculate the speed so that i can determine response time of the speed changing within sub-millisecond resolution (1 ms resolution max).
    Further, i created a VI that allows me to change the pulse width of a 100 Hz pulse train at run-time which tells the motor controller the desired speed.  I would like to be able to use this VI to change the speed of the motor and the first VI (that I am seeking help about) to calculate the response time (time between the initial speed and settling at the new setpoint).
    I am familiar with the NI example finder, but have not been able to find an example that I can use.
    Thanks,
    Gary

    Hey Gary,
    I think for you setup, you should try using the Meas Dig Frequency - Low Freq 1 ctr. You can find it by searching example finder with 'low freq'. This vi tells you the frequency of a digital signal by sampling between two pulses and inverting the time between pulses. If you hook up your encoder to a counter and have that counter specified in the vi, it will be able to give you on demand readings of frequency (you can do some multiplication to get the rpm value, freq*60/pulses per revolution of encoder). A simple way to take continuous readings is to put a while loop around the daqmx read and the data output of the read. You can also replace the numeric indicator to a waveform chart to graphically display the change of frequency or rpm readings over time.
    You should be able to integrate this as two separate tasks with the pulse train vi you created earlier.
    Hope this helps
    Luke W

  • How do I use a quadrature encoder as an external clock (PCI 6229)

    Hello, ( a similar post has been placed on DAQ forum apologies as I did not know best place)
    I have a PCI 6229 M Series data acquisition card. I want to use a quadrature encoder to be the external clock driving the acquisition of a number of signals. I have set up reading 24 signals each time a clock pulse is received using the DAQ assistant and set my external clock to pin pfi8 (I think) this is then connected to an encoder output. This works well enough until the encoder is run too fast when it appears I am either missing pulses or getting bounce.
    How can I set up to clock using a quadrature encoder? I have seen a number of questions on this forum regarding quadrature encoders and reverse counting but not on using them as an external clock.
    Basically I want to have the stability and "bounceless" nature of using two outputs from a quadrature encoder whilst still using an external clock. Is this just a case of configuring controls to certain pfi's? If so how is it done?
    Any help or pointers would be helpful. So far I have managed very nicely by simply using the DAQ assistant and the interface it has would suggest that if configured for a certain pfi pin I could actually still use it.
    Thanks in advance.
    Kevin

    Hi,
    Well I've had alook into this for you and I'm not quite sure I understand what you are looking for.
    Is it possible for you to phone back in to support?
    The reason you are seeing bounce at high speeds, or indeed loss of points, is due to the sampling rate that you have set up.
    What you will find is that the trigger will start an aquisition of a number of points at a certain rate.  If your sampling rate is too low then you will not finish that sample batch before the next set of samples is recorded.
    It is possible to use an external clock into a trigger or digital line, however this will limit the number of samples you can take to the speed of your encoder.
    If you increase your sampling rates, and then configure a start trigger from a single input from the encoder you will be able to record a number of samples after a rising/falling edge.  (Set the clock as an internal clock)
    Hope this helps
    AdamB
    Applications Engineering Team Leader | National Instruments | UK & Ireland

  • Can I use the 'Export Signal Property Node' on a quadrature encoder?

    Hi,
    So I don't know which counter board I'd be using yet for this (it's used in conjunction with a PCI-6280--the PCI-6280's counter inputs are all taken and so I need another board), but assuming this is possible at all in DAQmx I wouldn't mind knowing whether, say, the PCI-6601 (or any other timer board for that matter) could do this. I'm programming this in LabVIEW 2010 by the way. 
    I want to have a counter which counts the number of pulses on one channel (I'll call this the 'clock' channel) between when another channel goes from low to high (which I'll call the trigger). It's basically a pulse width measurement, but I only care if there are more than n clock pulses between triggers. I need to have a hardware-timed digital signal which goes from low to high if there are ever more than n pulses between trigger changing state from low to high. 
    What I am planning to do is this: 
    Wire 'trigger' to the z-input of the quadrature encoder, and set the z-input value to some arbitrary large value such that, at the quadrature encoder counter task's settings, the counter reaches terminal count in n pulses.
    Configure the quadrature encoder counter using DAQmx Export Signal Property Node (tutorial I was looking at is here: http://zone.ni.com/devzone/cda/tut/p/id/5387 ) to toggle a digital channel ('counter event output') from low to high if the counter reaches terminal count (ie, if the encoder reads n pulses).
    If the encoder ever reads n pulses on 'clock' between two rising pulses on 'trigger', it sets counter event output high.
    Is this possible? Reading through the manual of M series PCI-62xx devices, the index pulse loads the counter with a particular value so it seems like you could conceivably set the counter to the terminal count if you wanted. My only real problem is whether DAQmx Export Signal Property Node works on all counter tasks or just on edge counting tasks. 
    Thanks in advance for your help. If this isn't possible, I can reply with more details on the problem this is supposed to solve so that you can help me figure out an alternate method.
    Solved!
    Go to Solution.

    There is probably a way to do it, but it it may be easier to use an X-series board for the job.   They support a new counter capability for count reset on a digital edge without needing to be configured in encoder position mode.  I am not sure exactly how that feature's been implemented however, so maybe it won't make things easier after all.
    The plan based on the hoped-for behavior: 
    1. Configure an X-series counter for pulse generation based on "ticks" of your clock channel.
    2. Set both initial delay and low time to the critical # of ticks.
    3. Configure for count reset on a digital edge (if possible in pulse generation mode)
    4. Configure the count reset value to be the critical # (or possibly 1 less, if possible in pulse generation mode)
    5. If you want the output to remain high indefinitely, configure the counter task to use its own output as a
    pause trigger, and pause while high.
    The way pulse generation works is to preload a # of "low time" ticks into the count register.  Then every source edge will decrement the count.  When the count reaches terminal count (0), the counter's output is toggled (or can be configured to pulse).  The register is then loaded with the # of "high time" ticks and the process continues.
    You would be perpetually interrupting the count-down process as long as you got your triggers in time.  The count would keep getting reset to the # of low counts, keep decrementing toward 0 without reaching it, and so on.  If ever you did reach 0, the output state would toggle high, then the high state would prevent subsequent clock signals from decrementing the count.
    You can conceivably do a similar thing with a 6601, but I'm pretty sure you'd need 2 counters working together to get it working.
    -Kevin P

  • Quadrature encoder, velocity

    Hi,
    I am using DAQ 6062E, with BNC 2120. I have a quadrature encoder, and I need to get the position, and velocity. I have modified BNC2120_Quadrature_Encoder vi from NI. I can compute the velocity (delta position/time loop) easily, however this is not very accurate. I need to have a high accuracy velocity, and I think I have to use the second counter to measure the frequency of channel. However, I am not able to calculate the velocity with this method. I have attached my vi. I appreciate if somebody can help.
    My encoder is connected to CTR Source 0 (PFI8), and UP_DOWN (P0.6)
    I have connected CTR Source 0 (PFI8) to CTR 1 Gate (PFI4)
    Thanks!
    Attachments:
    try encoder_with frequency.vi ‏58 KB

    I get reasonably accurate velocity from quad encoders by connecting the source of my counter to the internal 20MHz clock then gating said
    counter with my index pulse(Z) or either A or B, depending on the speed at which I am running. This will give you a count of time between
    revolutions if gating with Z, or it will yield time between X degrees if gating with A or B.

  • Quadrature encoder counter with 8 channels

    Hi,
    I need to acquire the signals (A and B) of four quadrature encoders. The signals have a maximum frequency of about 5kHz and should be read out with about 100 Hz. Is there a device that fulfils these requirements? It seems that a frequency of 5kHz is no problem since e.g. the USB-6008 has a counter for frequencies up to 1 MHz. However, I can't find a simple low-cost device that provides several counters. Does anyone know such a device with 4 or 8 counters?
    No other analog or digital channels are necessary, but a USB connection and Matlab support would be ideal.
    Thanks in advance.

    Depending on your definition of low-cost, the 9171+9401 might suit your needs:
    4 counters capable of quadrature encoder measurements (the single counter on the 6008 only does simple edge counting).
    USB connection.
    MATLAB support via the Data Acquisition Toolbox (according to their website).
    I don't believe NI currently has any other option that meets these requirements at a lower cost.  If USB isn't mandatory, you could also consider the PCIe-6612 which provides 8 counters.
    Best Regards,
    John Passiak

  • Need COTS Analog Speed Signal from Encoder

    Hello everyone, need some shopping help. 
    I have a customer who wants to get a scaled analog output corresponding to rotational speed from an encoder instead of doing traditional freq measurements.  We want a stand alone package that does the frequency measurement on board and just puts out a scaled analog output.
    Need < 100 mS latency and ability to resolve 5 rpm to 1000 rpm.  Just don't know where to go to buy one.
    Anyone know of such a device?
    Thanks 
    Wes Ramm
    Wes Ramm, Cyth UK
    CLD, CPLI
    Solved!
    Go to Solution.

    One example of many manufacturers of frequency to voltage converters:
    http://www.dataforth.com/functional.view.aspx?ptypeid=11
    Look at the detailed specs to make sure the unit's input voltage range is compatible with the encoder along with the response time.
    -AK2DM
    ~~~~~~~~~~~~~~~~~~~~~~~~~~
    "It’s the questions that drive us.”
    ~~~~~~~~~~~~~~~~~~~~~~~~~~

  • How to calibrate Quadrature Encoder signal

    I have PCI-6601 and CB68-LP connector. How can I use these to interpret quadrature signals coming off an optical encoder (to sense the angular position of an-observatory dome). The encoder is 16-bit(don't know what this means in terms of PPR). I want to have a display in Labview that will show me the position of the dome in a fraction of 360 degrees with some reference(true north?), the dome rotation controlled by a three way switch(clockwise-off-anti-clockwise). I don't have much experience with labview and any help will be appreciated.

    If the encoder is 16 bit then it would seem that: -
    360/65536 = 0.0054931640625° or there abouts.
    You can break the project down into two halves nicely.
    1) Hardware interfacing.
    2) Software read out.
    The hardware interfacing means two basic things:
    1.1 What is the encoding technique
    1.2 How are the signals conditioned for output to an external device.
    The software is classic:
    2.1 Input
    2.2 Process
    2.3 Output
    The optical encoder could be one of a few types and you need to understand both the signalling / interface and the coding technique to progress further. A good start will be the manufacturers data sheet for the product. Contact the manufacturer.
    Once you understand the coding technique you will then know if the unit is absolute or relati
    ve. This will then allow you to determine how you can point to true north (easily with an absolute encoder, it always tells you exactly where it is).
    If it is a classic quadrature encoder then the relative phase of the reference and movement signals gives you direction. Counting transitions gives you realtive movement. But if the power went off on the PC. you don't know where you are unless you go to a home position! That could be 359° round !!!
    Good Luck

Maybe you are looking for

  • Flex SDK and commercial Websites

    Hello, I have to build and RIA for a Companys Intranet and i am not sure, if it is legal or possible to do so for free with the Flex SDK? I also would like to know, whats the difference between the Free Adobe Flex SDK and the OPen Source Flex SDK? Wh

  • How to get screen size or user's resolution?

    Hey, i want to know how to get the sreensize. Incase my program get's bigger then the screen. thanks 4 ur help

  • Using Preview with Safari instead of Acrobat

    I have Acrobat installed. All downloaded PDFs are opened with Acrobat in a browser window. I would much prefer that they be opened in Preview. How can I make this happen? Thanks.

  • How to draw vector shape?

    I use following statement to draw a shape [CODE]for(....){   sprite.graphics.beginFill(..);   sprite.graphics.drawRect(x,y,1,1);   sprite.graphics.endFill(); }[/CODE] But I find above shape is not vector shape.Because I change the IE size,I find the

  • Subcontracting(Internal)

    Hi, I'm having the scenario of Subcontracting(Internal). Here Finished and semifinished product need to produced. Sales order will be created for finished product. The customer will give the raw materials. So, we are receiving the stock as customer s