Encoder triggering counter capture

Hi, I'm doing some research into how I can implement the below application. From what I've read, I'm 95% sure I can do what I want with a timer/counter card. But I figured I'd throw it out there to make sure. My application is as follows:
I have (or will have)  a scanning head that rotates through 180 degrees across the sky. The scanning head has a mirror on it that directs light into a PMT (photon-multiplier-tube). The PMT outputs a TTL pulse every time a photon hits it (sometimes you get double hits, but we'll ignore those for now). The idea is that we want to count the number of pulses from the PMT for incremental portions of the scan. 
The scanning head will have an incremental encoder on it, outputing a quadrature signal - which I believe can be put directly into the timer/counter card. I need it so that for say every 1 degree of motion, the PMT pulse counter resets and I get a value for the number of counts from the previous 1 degree increment. The speed of the head will NOT be constant (it will be moving slower at low elevations and faster overhead) so the counting of pulses must be synchronized to the encoder input signal. Actually, there is also the possibility that the speed will be constant, and the position increment to trigger will change. Is it possible to setup events to that it triggers at 1 degree, 2 degree, 5 degree, 11 degree, etc? Obviously this would actually be based on the encoder count (not degrees) and there would probably be ~500 events per 180 degrees. 
So, is this doable? Can I link events to the encoder count value and have them trigger the system to capture the current count and then reset it? I don't know anything about how you setup these events, so any advice would be great!
Thanks!

Actually, I should take a step or two back from the brink.  I still do foresee some monkey wrenches
if you really need dead-on hardware sync of these signals and sampling times.  However, maybe I'm
much too quick to assume the need for that kind of dead-on sync.
If you can approach the app by capturing "sufficient" data within and across all these position bins,
you can probably get a very good approximation with some fairly straightforward software post-
processing, and simple interpolation/curve fitting.  Not sure how much "sufficient" is, but likely a
manageable amount.
And yes, "digital change detection" is simply the ability to detect TTL transitions.  When a transition
is detected, a pulse is generated on the board, and tasks can be configured to use that pulse to
sync up triggers, sample clocks, or other timing signals.  Both the M-series and X-series multifunction
boards support it.  The 6602 doesn't.  If you're going for true dead-on hardware sync, I still suspect
you'll end up wanting the change detection feature.  If the software post-processing is good enough,
you probably won't need it.
One last thing: the ability to filter digital TTL signals has been improved on data acq boards over the
years.  I suspect the X-series will give you better filtering options than the other boards but I can't
speak from direct experience.
-Kevin P

Similar Messages

  • How do I use daqmx to get encoder direction/count on E-series board?

    Hardware:
    PCI-6014
    Labview 7.1
    I have a linear actuator and wish to get distance/direction.  The
    motor has a quad encoder with phase A and B only.  I connected the
    lines according the the E-series, PFI-8 and PFI-6, and ground to
    digital ground. I then attempted to design a control with daqmx but
    failed.  I have tried the daqmx examples but none were attempting
    a reverse in direction.  Most examples given for direction change
    are for traditional daq control; i cant make a correlation on what to
    use to substite traditional daq with daqmx vi's. 
    2 questions:
    How do I use daqmx to get encoder direction/count on E-series board?
    Are there low pass filter vi's recommended for each phase connection to stabilize data?
    Thanks,
    Wayne Hilburn

    Hello Wayne,
    Take a look at the Count Digital Events.vi shipping example.  You can find this in LabVIEW by selecting Help >> Find Examples... then browsing to Hardware Input and Output >> DAQmx >> Counter Measurements >> Count Digital Events.
    If you set the "Count Direction" control to "Externally Controlled", you will be able to count up and down depending on which direction you rotate your encoder.  Make sure you wire Phase A to Ctr0 Source and Phase B to P0.6.  P0.6 is the up/down line for counter 0.
    I hope this helps.  Please let me know if you have any further questions.
    Regards,
    Sean C.

  • How do I use daqmx to get encoder direction/count on M-series board?

    I have an incremental dual channel  encoder from Rotalink. I want to take angular postion and angular speed from this encoder. My NI DAQ card is PCI 6221 which belongs to M series. First, soft-timing was used to get anuglar postion and sampling rate is set at 1Hz. The vi program works well. However, it does not produce  good results when the sampling frequency is increased to 100Hz. So I turned to hardware-timing. The example, "Find example>> Hardware Input and Output>>DAQmx>>Counter Measurements>>Position>>Meas Angular Pos-buff ext Clk.vi" gets the readings. A function generator which can produce pulses at the frequency rang from 1Hz-1Mhz was wired to PFI9 in accordance with "
    You need to find your PFI pin numbers to know what to wire A,B and Z to on your m-series board, to do this go into max right click NI-DAQmx Tasks click Create New DAQmx Task >> Counter Input >>Position>>Linear, and setup the task for your measurement. It will tell you what the PFI lines are. You then need to look at the wiring diagram and connect it to the correct pins." as an external clock. The channel A and B were wired to PFI8 and PFI10 respectively. However, it still gives errors like 200284. Comments are grealy appreciated!

    Hi Zibin
    I have been trying to work out what is not working I need some more information
    What frequency is your function generator actually generating?
    What have you set your time out value to?
    What exact errors are you getting and when do you get the error?
    What would really be helpful is if you could send me your code because by the sound of it, it should just work the card is more then capable of doing what you want so chances are it is the code.
    Regards
    Tim M
    NI UK

  • Doing something the DAQmx way that doesn't fit? (Triggered counter on PXI 6608)

    Hi,
    I want to create a counter with my PXI6608 that is triggered with an external input, then counts up. I then want to be able to read the count in LabVIEW and hence determine the time since the trigger. I have achieved this before with old-style code, but it is not clear how to do it the DAQmx way. In particular, I can't create a task because what I'm looking to do doesn't seem to fit in with any of the pre-envisaged DAQmx task templates.
    Can anyone help? I'm assuming there's some way to create an 'empty' DAQmx task so I can fill in the details with property nodes?
    Cheers
    Lee
    Solved!
    Go to Solution.

    You'll want to make an edge count task and set the source to be one of the internal timebases using a DAQmx property node (set it before starting the task):
    The trigging functionality you're looking for is called an "arm start trigger" in DAQmx.  It's configured through a property node (also before starting the task):
    I'm not sure what you're getting at with regards to the "empty" DAQmx Task.  Typically you'll use the standard API to set typical properties and the property nodes for more advanced functionality so you'll end up with a combination of the two.  In many cases you could replace the DAQmx API with property nodes (for a fun example of this, open up the DAQmx Timing VI), but odds are you might be forgetting something important so I would always suggest using the VIs and then tacking on property nodes for additional functionality when necessary.
    If you're using LV 2012, this example should get you started (or if not, the picture still shows you what the task would look like).
    Best Regards,
    John Passiak

  • Incremental encoder: reset counter on pci 6014?

    I want to connect an incremental encoder with A, B and Z to a PCI 6014 card. I found some VI's for counting A and B (DAQmx->Counter->Count Digital Events; DAQmx->Counter->Measure Posititon) . However I can't figure out what to do with the Z. Is there a way to reset the counters by Z? (I am using labview 2009)
    Thank you very much!

    Sorry, my fault. I didn't see you have an E-Series device.
    Resetting your counter with a digital trigger is possible for Counter/Timer devices but not for your PCI 6014.
    You can reset the counter with DAQmx by stopping and starting the task again. You could read your Z index on a digital input, if the input goes high (or low) you could reset the counter.
    DAQmx: Count Digital Events with Option to Reset Counter
    http://decibel.ni.com/content/docs/DOC-6576 
    I think this is the only way for the PCI 6014. Since you have to go through several software layers, the performance goes down a bit. If it is possible, i would recommend to change to a M-Series device...
    Cheggers
    Sascha E.
    Group Leader Applications Engineering
    National Instruments Switzerland

  • Servo motor encoder pulses/counter data erroneous

    First off, I am very new to using labview.  I am trying to complete a project a former employee was working on.
    For a quick background on what I am working with, I am using a NI DAQCard-6036E connected to a SC-2345.  The SC-2345 is then connected to a load sensor, Omron R88D servo driver, and an omron servo motor.  The servo motor has a incremental encoder with a resolution of around 2048 pulses per revolution.  My labview program includes a counter that records the data from the encoder on the servo motor.  I have been able to get accurate data when testing through the measurement and automation program by manually turning the motor.  Also when running through the specific DAQ assistant I am using for my counter, I am getting correct readings when manually turning motor.  Once I run my complete program, instead of getting 2048 pulses per revolution, I am getting between 34000-36000 pulses per revolution.  The most logical assumption is that I am getting vibration in the motor itself or some sort of noise is interfering with my signal.  I first attempted to change any possible settings through the omron servo driver that might reduce any vibration in the motor.  I attempting changing the rigidity settings, turning on and off the auto-tuning function, and a few other settings specified by the user manual that might cause vibration.  If I turn the rigidity settings as low as possible, I am able to get around 2000 pulses per revolution, but the data is very sporadic. Also, my equipment needs to be very rigid, and with the lowest rigidity setting for the servo driver, I am able to almost stop the motor with minimal force.  My equipment needs to be able to travel at a near constant speed with fluctuations of up to 200 N of force.  Any suggestions on which direction I should go in finding a countermeasure? 
    Thanks
    Solved!
    Go to Solution.

    The model number of the servo motor is R88M-W10030L.  The servo motor rotates at a constant speed.  The program is designed to drive the servo motor connected to a ball screw in one direction.  Once the load sensor reaches a desired load, it will reverse at a constant speed until no load is on the sensor. Throughout, it records load vs. displacement.   I have found a few things that will alter the pulses counts.  If you apply resistive pressure on the servo motor while it is rotating, the pulse output will vary.  Also when you apply pressure to the casing of the servo motor itself, the pulses will often jump around. I was almost certain my false pulses were caused by vibration.  After have no success adjusting settings to reduce vibration(according to the user manual), I ran the program while moving around several wires to see if any were loose, etc... After applying force to the power lines and encoder cable, the program ran several times with an average of 2000 pulses per revolution and would actually subract pulses while going in reverse(what I want it to do); Although the average was around 2000 pulses per revoltion, i saw positive and negative jumps in pulse counts while traveling forward at constant speed.  Today I re-wired the equipment, seperating as many wires as possible.  After the re-wire, the equipment/program is back to sending 34000+ pulses per revolution, and does not subract pulses while reversing.  I have read the 'Using Quadrature Encoders with E Series DAQ Boards' article.  Referring to the article, I am running similar to "method 1".  I am already using a signal conditioning box, but have the counter data run directly through. Do you believe running the signals through a SCC-CTR01 might solve the problems? 

  • Encoder edge counter using analog input

    I have using an 9215A USB (4AI).
    2 AI are logging data in to a txt-file and the other 2AI will be used for counting the edges from a quadrature encoder (A and B pulse train).
    Every edge falling or rising I will write a line in the txt-file also show a egde counter in the VI (total edges read).
    I'm a beginner so I need some help to find out how to do.
    BR
    Johan

    the 9215A do 20kSam/s  , that not too much, so .... your encoder should change state 10k/s max.
    first approach: continious read  (with max speed) with two buffers, while one buffer is filled by the DAQ, analyse the data of the other. Three independend loops : first wait for and read buffer-> send data via queue to second analyse loop -> send data via second queue to third loop that does the file handling.
    second approach: create a trigger so the second loop can be avoided. The DAQmx/Hardware does  might not support the trigger on both edges on two channels, but additional hardware like LS7084 o. HCTL2022 can help you to create the trigger signal. These little bugs are designed for incremental encoders and create a pulse for every change in the A B lines
    Greetings from Germany
    Henrik
    LV since v3.1
    “ground” is a convenient fantasy
    '˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'

  • Velocity Measurement from FPQuad-510 encoder pulse counter

    Hi, I have a quad-510 quadrature encoder counter and a 1024pulse/1rotation encoder. How can I read or calculate angular velocity(accurately and without much delay) from encoder readings?
    Is there a special vi or another algorithm (other than derivative.vi) that could help?
    Thank you.

    Caner,
    What do you see listed for the status of the velocity channels in MAX?
    Also check your channel configuration to make sure you have an appropriate range set.
    Regards,
    Simon
    Message Edited by Simon H on 02-02-2007 06:50 PM
    Attachments:
    MAX_CTR.png ‏26 KB
    MAXDataConf.png ‏11 KB

  • Time remaining counter--capture clip

    Newest version of FCP, in the capture window the value for "Time Remaining to capture" is always at the full length of the clip. Isn't it supposed to count down during capture??
    Thanks

    Looks like it, but complaining here won't do any good.
    http://www.apple.com/feedback/finalcutpro.html

  • Encoder quadrature Count issues

    Hello,
    I'm interfacing a servo motor through an SCB-68 Board with an R series FPGA and my computer. I have a pulse generaton programme to control the stepper motor which works fine. I have hooked up the encoder and used the general example vi   "Quad ctr - R series.lvproj" with the inputs changed to my inputs on the board.
    Now it seemed to work fine, but then I changed the direction of the servo motor. The pulse count does not rise the same when going counterclockwise as opposed to clockwise. I.e if i do one whole revolution both clockwise and counterclockwise i get a different amount of pulses outputted. Does anyone have any idea why this might be? I've tried the SCTL in simulation and the pulse count is fine if i manually change the A and B channels. Also, i've tried a dc motor with a different encoder and the same problem arises.
    Any help would be greatly appreciated,
    Sam 

    How much is it off by? Is it always a consistent number of pulses off? Just to verify it is the same channel you're reading correct, so there's no possibility its a phase issue since pulses are often out of phase on these encoders so you can determine direction.
    CLA, LabVIEW Versions 2010-2013

  • Change encoder output count

    Hi All,
    Anyone know how to change the encoder count for an PCIe-8255R on the fly in C++?
    The following call sets up the output pulse at 40 encoder ticks after the trigger input and works fine.  
    RetVal = imaqIOPulseCreate(m_id,
       IMAQIO_TIMEBASE_ENCODER_TICKS, 40, //Encoder count   IMAQIO_TIMEBASE_MICROSECONDS, 100, //Pulse width   IMAQIO_SIGNAL_ISO_IN, 8, IMAQIO_POLARITY_HIGH_TRUE, //Trigger from TTL8   IMAQIO_SIGNAL_TTL_OUT, 2, IMAQIO_POLARITY_HIGH_TRUE, //output on TTL2   IMAQIO_PULSE_MODE_SINGLE_REARM, &pulseID2); //single shot, requires trigger 
    What I need to do is to change the IMAQIO_TIMEBASE_ENCODER_TICKS value within my program WITHOUT stopping the Pulse Train.
    E.G.
    This encoder output fires at 40 on this rotation, then the next at 45 then 50...
    The imaqIOSetAttribute function in the help says that it's not implimented so I can't use that. Any other way of doing this??
    Thanks in advance,
    DJack

    Hi DJack,
    I have looked into this for you and unfortunately our C API is not as flexible as our LabVIEW API (since it's possible to achieve this in there, I assumed that might be the case in C as well). There is no
    way to dynamically change the pulse properties. If you call the Pulse
    Create function again, it will actually stop the pulse and you will
    have to call start again. So you don't, necessarily, have to call the dispose function,
    but will still need to call the start function to set it back up and get it ready. Hopefully, that is much faster. I apologize for the bad news and wish you luck with your application. Please let me know if there is anything else I can help you out with.
    Adnan Zafar
    Certified LabVIEW Architect
    Coleman Technologies

  • Error 200140 and 200278 in Finite Retriggerable Encoder Triggered Sampling

    Hello,
    I have been using a rotary encoder to trigger a retriggerable sampling task. The encoder will give a pulse once per revolution and this will cause Labview to generate a finite pulse train which will be used to sample an analogue channel. The program will also return the pulse width of the encoder signal once per rev.
    A problem arises if the encoder is run at speed, I receive error 200140. But if I run the program at a lower speed I eventually receive error 200278.
    I am not sure why this is occuring as I am sampling continuously.
    Thanks,
    Ingram
    Attachments:
    Retriggerable_Finite_AI.vi ‏55 KB

    Hi Ingram,
    Thanks for your response regarding this issue. 
    Just to clarify, you are using the PCI 6250 to measure pulses from an encoder which is generating one pulse per revolution and turning at 1000 rpm and you are sampling this at 50kHz.
    You are then taking these pulses and using them to trigger an input on the PCI 6220 which then reads the temperature. Does this mean you are taking 1000 temperature reading per minute?
    Without seeing how you are implementing this in your code it is very hard for me to tell if the crash is as a result of this. Just to confirm, are you still getting the same error message?
    Both the cards you are using don’t have simultaneous sampling; this means that the sampling speed is shared between your tasks.
    If you believe the issue is with your code then please do attach this to your next post.
    Many thanks,
    Aaron. E
    Applications Engineer Team Lead
    National Instruments
    ni.com/support

  • Error use quadrature encoder to count optical mouse position

    Hello, PRO
    Can U explain me how count pulses from optical mouse? I have 2
    quadrature signals (as said in document about Quadrature measure in Edevices
    I connected XA to PFI8/GPCTR0_source, XB - DIO6...and digital ground to the
    DGND).
    I used sample "STCcountWithHWDirControl.C" to count pulses. This sample
    was developed for device with DAQ-STC counting/timer... :-)
    But result of counting = 0. Where is mistake?
    One detail (maybe it help): I connected XA to analog input and read values. This pulse had 0.1volt amplitude , but when I measure voltage between XA and DGND by a oscilloscope. It was 5V.
    Sincerely
    Spivot
    P.S.
    NI Software : Measurement Studio for Visual C++ version VC++ with NI-DA
    Q 6.9.1
    NI Hardware : Multifunction DAQ device DAQPAD-6020E

    Hello;
    The first thing you should test is if the pulses can be counted at all by the general purpose counters of your device. The way to go about that is to connect the pulse to the source of one of the counters and run the simpleeventcount.c example.
    If even that example doesn't work, you will need to condition the pulses before going to the counter.
    Hope this helps.
    Filipe A.
    Applications Engineer
    National Instruments

  • Counter output jumps when power to encoder is cut

    Hello all,
    I am using a PXI-6251 DAQ board and a SCB-68 to read, via a LabVIEW DAQmx task, an optical encoder (720 counts / rev.) in radians.  The data read from the encoder is nice and smooth while the encoder is running, but when the power to the encoder is cut abruptly, there is a jump in the number of radians read (about two or three).  An oscilloscope connected at the SCB terminals shows a voltage spike of unreadable height when the power to the encoder is cut.  How might such a spike cause a sudden increase in the number of ticks/degrees/radians read?
    Thanks!
    Slowpoke
    Slowpoke
    CLAD (believe it or not!), using LabVIEW 8.5
    They don't call me "Slowpoke" for nothin'!

    Hello Slowpoke,
    Large voltage spikes can result in additional counter measurements. The TTL signal that you are measuring has to adhere to certain requirements. A TTL signal is low between the voltage of 0 to 0.8V and a high for 2 to 5V. Additionally, the maximum rise and fall time of the pulse must be less than 50ns. If this requirements is not met, the counter will give erroneous count values. For M-series cards with the DAQ-STC counter asic, the minimum pulse width has to be 10ns. If the signal does not conform to all these specifics, the count value will be incorrect.
    One option you can consider, is if you have a 0-5V signal from your encoder that is high when the power is on and low when the power is cut off. This signal can be wired to the Gate of the PXI-6251. What does your voltage spike look like? Is it one large voltage spike or is there ringing/bounching as it settles?
    Regards,
      Sandra T.
    Applications Engineer | National Instruments

  • Counting edges with dynapar encoder

    Hello,
    I am very new to Labview. To kick off some experience, I am trying to count edges on a Dynapar encoder, Model E14020000303. Here is the data sheet:
     https://ecatalog.dynapar.com/downloads/E14_DS_702489_2_.pdf
    I am using LabVIEW 2011, with a NI USB-6210 DAQ. My white wire on the encoder is connected to PFI0. The red and black wires are connected to my 5V voltage source. I am rotating my encoder to count the revolutions. Supposedly my encoder is a 200 PPR, and it is also quadrature. 
    However, I am not understanding what I am getting when counting edges using DAQ Assistant. I am using the Edge Count on ctr0. I can set the DAQ assistant to run on 1 sample acquisition mode and count the rising edge. When I turn the encoder 100 times, the measured value on the DAQ Assistant is usually around 76500, which would mean 765 edges counted per revolution. I can also change things around and go to continuous acquisition mode. I set up PFI2 as the external clock source with a rising edge and put the green wire in PFI2. I set it to read 1 sample at 1k Hz. This usually results in counting around 820 edges.
    I don't understand why I am getting these readings. The DAQ Assistant should only be counting rising edges because that is what it is set at. Why am I getting numbers so high? 
    Thanks!
     

    Hey guys,
    Sorry for the late reply, I have been put on other tasks. You all were right about the ground, that indeed was the problem. With the daq grounded, the encoder measures 200 edges per revolution.
    Thanks!

Maybe you are looking for