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

Similar Messages

  • Generate trigger on n counts of quadrature counter?

    Hi,
    I have 6212 card. I use one counter to produce pulse train that drives a motor. The second counter reads position with quadrature encoder. Is there a way to configure the encoder counter to automatically send a pause/reference trigger to the first counter after a specified number of quadrature counts?
    Thank you

    Igor,
    I have attached the two VIs that I was using to test the simple count edges case.  You should run the Gen Dig Pulse Train-Finite-Retriggerable.vi first and then run the Count Digital Events.vi because it will send the pause trigger when the terminal count is reached.  I also looked at the Device Routes for the 6212 and you should be able to route ctr1internaloutput or ctr0 internaloutput to its respective trigger source terminal.  Please let me know if you are succesful.
    Thanks,
    Gio L.
    Digital Support - Product Manager
    National Instruments
    Attachments:
    Count Digital Events1.vi ‏32 KB
    Gen Dig Pulse Train-Finite-Retriggerable1.vi ‏38 KB

  • 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.

  • Counter issues with 2D raster scan and count acquisitio​n

    I am building a confocal laser scanning microscope and am currently attempting to develop labview controls for it. I have a fast steering mirror (FSM) which takes analog voltage inputs to control it's x and y angle and I have an avalanche photo diode (APD) which sends a TTL pulse for each photon detection event. For now, I am trying to create a program which will send out two analog signals to create a 2d raster scan with the FSM and count the number of pulses from the APD per pixel. I have been trying to make the program from https://decibel.ni.com/content/docs/DOC-5779 work, but I keep running into counter issues. I am using a generated pulse train from the other counter on my device (NI 6011E) as the period.term input, but I get a "Two consecutive input signals occurred without a counter timebase edge" error if I increase the frequency of the pulse train too high. Unfortunately, the number of pixels I can acquire seems to be limited to twice the frequency of the counter, so I cannot just use a lower frequency train. I believe that the error is occurring because the count rate from the APD is very low and that there are simply no photons hitting the detector in the time period between pulses.This is not a problem, but I would like to know how to simply record a 0 and continue with the scan, rather than have the entire program exit with an error.
    Alternatively, if this does not seem like the correct way to accomplish what I am trying to do, I am open to new directions.

    So simply ignoring the error did not work, because the DAQmx subroutine stops collection when the error is detected. I think I may need to come up with a different approach to synchronize the counting of TTL pulses with an analog output. Attached below is the code I have been working with.
    Attachments:
    Raster_2DOutput_wCounter_82.vi ‏45 KB

  • Play Count Issue

    Dear all mac geniuses out there!
    Today I uploaded my music from iPod to my MacBook via Senuti. After transferring my songs to my iTunes, I noticed all my songs have random play count numbers that are like in the millions or in the negatives. Could this be a virus? Please help!! Also how can I reset my play count number for all my music?
    Thanks a lot!!
    Desiree

    I don't know if this will work or not fixing the play count issue, but you might try this article on how to recreate your library...
    http://docs.info.apple.com/article.html?artnum=93313
    Patrick

  • IPod Touch Play Count Issue still occuring!!

    Guys,
    Are there any new updates on a way to fix the play count issue besides 'automatically syncing' the iPod? It's driving me insane. I paid AU$13 for the 3.0 iPod Touch software update and the play counts of my songs are rediculous when I have listened to the song once! ie. 295 play counts for 1 song, when I've listened to it 5 times!!
    Thanks in advance

    I'm in agreesance.

  • 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

  • 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 ǝɥʇ'

  • Quadrature counter dividing and triggering

    I'm currently looking into using an NI USB 6353 device in a project, and I'm confused about its capabilities. Here is what I'm trying to achieve:
    1. Reading an A/B (no Z) quadrature input to increment/decrement a counter (preferrably in X4 mode).
    2. Produce a digital output signal with transitions on each counter increment/decrement.
    3. Frequency dividing the counter transitions to produce a digital signal used to trigger various external hardware. The divider should be specifiable (probably around a few thousand).
    4. Using another frequency divided version of the counter to trigger simultaneous analogue/digital sampling on the device.
    5. Have the ability to make the counter time based (just incrementing at a set frequency), rather than using the quadrature input. The resulting signals should all still be divided and output correctly.
    Being able to use the digital outputs on the device independently (on demand, timing isn't particularly important here) would be great, too.
    Is this possible using the DAQmx C or C# API? Are there any other devices I should be looking at?

    Hi Matthew,
    Matthew S wrote:
    Wouldn't the change detection mean that I couldn't sample the digital input lines at a divided rate? Or can I simply implement the change detection using a single DIO port and still have the remaining DI lines to use?
    I'm glad you brought it up--I guess I overlooked that you were planning to use clocked DI.  If you're using DI change detection you cannot sample the DI lines off of another clock source.  Unfortunately, port 0 is the only port that supports change detection (even though the manual currently implies otherwise) as well as the only port that supports clocked DIO.  You can still do static DI on other lines, but the clocked DI subsystem can only have one timing source.  You can always oversample your DI using the change detection, then index out 1 out of every N samples in software (the DI should be good at rates of up to at least 1 MHz continuously).
    Matthew S wrote:
    It sounds like the X-Series can do what we need. We'll probably stick with the 6353, because we need at least 20 analogue inputs, and sampling rates of at least 1MSps.
    Keep in mind the 6353 is multiplexed--the aggregate rate is 1 MHz, but sampling 20 lines at the same time would only give you 50 kHz per channel.
    Matthew S wrote:
    I'm slightly confused as to how to use the change detection to implement what we want. Essentially, we'd like to take the X4 quadrature input and convert it to a step signal (as in, step/direction) that will be used to control a hardware variable antialiasing filter. Will this require another counter? If this can't easily be done on the USB DAQ device, we can do it using external hardware.
    You can get the step from your x4 encoder with change detection easily enough, but I don't think there is a good way to get the direction as an external hardware signal.  I think the better option is to use a flip flop to latch the encoder state (either latch A using B as the clock or vice-versa) to obtain the direction.
    Matthew S wrote:
    How hard is it to get the direction and also speed (or frequency) of the
    original quadrature input for each AI and DI sample taken? I assume
    that the frequency measurement would require another counter? How about
    direction?
    If you're using a latching circuit to output the direction, you could just sample this off of one of the DI lines (assuming you have one available).  To measure the frequency of the encoder, I suggest looking into the method described in Figure 7-15 of the X Series User Manual to use another counter to measure the frequency of either A or B.  During each sample clock period the counter counts the number of encoder pulses as well as the number of internal timebase ticks that occurred during those pulses.  The driver uses this information to return the average frequency of your signal in between sample clock pulses.
    So... you were right to have some concerns about using change detection alongside clocked DI.  You'll have to pick one or the other--I think I'd prefer to oversample DI and throw away samples, depending on the maximum frequency coming from your encoder.  Also of concern is the number of counters (there are 4 available on the board).  In addition to the 4 counters, keep in mind taht there is a Frequency Generator that can be used to output specific frequencies:
        {20 MHz, 10 MHz, 100 kHz} / {1:16}
    Please don't hesitate to post back if you have any questions--there's alot you need to do so you might have to make some compromises.  We're starting to get into territory where an FPGA might be more suitable for your digital requirements.
    Best Regards,
    John Passiak

  • 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

  • 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

  • Media encoder cc export issue

    i got a user that have issue export with media encoder
    when she encode she get this error
    any idea
    Thanks

    Any one ?

  • 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

  • Count issue of output in Web I report

    Hi,
    We are using Web I XI R2 and facing issue with the ouput while using count formula as described below.
    I am able to get the right output for below formula when used without breaks
    Formula      
    =Count([Risk ID*] Where (([Risk Impact] = "High" Or [Risk Probability]="High") And [Risk Status] <> "Closed" ))
    Project ID*     Risk Impact     Risk Inherent Severity     Risk ID*     Risk_Fact_Status     Output when applied without breaks
    11001040     High     Medium                          RI004853     Red                              0
    11001040     High     Medium                          RI004856     Red                              1
    11001040     Medium     Low                          RI004855     Red                              0
    I am using the same formula in a Report tab that has two tabs to it  without Risk ID that gives a wrong result.
    Expected result is 1 however i am getting 0 as the output. Can any one please advise
    Thanks,
    Eswar

    Hi,
    I'm not too familiar with XIR2, so not sure of the differences, but try this:
    =Count(Risk ID* Where ((Risk Impact = "High" Or Risk Probability="High") And Risk Status "Closed" ) ForEach(RiskID*))
    Otherwise, you can try and simplify things by adding a dimension variable "status" =(Risk Impact = "High" Or Risk Probability="High") And Risk Status "Closed" then "Include" else "exclude". Then try =count(RiskID where Status="Include")
    There's no reason it should work any differently, but it may help you trouble-shoot.

Maybe you are looking for

  • Airplay sound not mirroring after first time until restart

    Anyone else seeing this issue? When we connect either the iMac or the MacBook Pro to our 2nd generation apple tv via airplay the first time, the sound goes to the tv as expected. If we try to use airplay a second time, the sound stays on the computer

  • Upload photo & MYSQL

    Hi I wanna create php code ton insert some info in MYSQL BDD, dreamweaver do that but I must upload image too with this, I choose file for this but it juste take name and I wanna upload photo in "images" directory with PHPMYADMIN, defaut value for im

  • Black screen on iMac i7 2,93 when warm

    Mid on 2010 imac 27 " Processor: 2,93 GHz intel core i7 GPU: ATI Radeon HD 5750 Memory(Report): 4 Go 1333 MHz For 1 month, my imac presents signs of weakness at the level of the display(posting). In normal functioning, everything takes place well. Wh

  • How could i open maps in ios 6 in india

    Hello can u say me how vould i use maps in india with using the operating ios 6.0.1 Im not able to use that thing please say u as sooon as u can Thank q

  • Upgrade: Finding ALL obsolete function modules in ECC6

    Hello everyone, Is there a way to find ALL obsolete function modules in ECC6? I have seen a few web pages posting a small list of obsolete function modules but they are not complete. I have also tried querying table TFTIT for short text such as 'OBSO