Angular position measurement

how to used encoders to angular position measurement of rotating shafts 
Attachments:
IRC305.pdf ‏303 KB

Hi Sabry,
what is your question? Good starting point is to open LabVIEW Example Finder and check code examples located in Hardware Input and output » DAQmx » Counter Input section. You can also try to search at NI Developer Community web. This table shows Default NI-DAQmx Counter Terminals on your C-Series module NI 9401 - http://zone.ni.com/reference/en-XX/help/370466W-01/device_pinouts/9401cdaqpinout/
I also recommend you to read this White Paper which can give you good outlook on Encoder Measurements.
Regads,
Ondřej K.
NIEE AE

Similar Messages

  • 3-Channel angular position measurement

    Hi,
    I have the PXI-6230 available in my PXI system. What I am trying to achieve is to read the outputs of a stepper motor driver and determine the corresponding angular position and direction (i.e.. like a stepper motor simulator). The driver outputs 3 pulse trains (3 coils). I am wondering if it is possible to use the counters on the PXI-6230 for this application? I've read some info on the M-Series Counter X1/X2/X4 Encoding for position measurements. But such methods require only 2 input channels A & B to detect the pulse counts and direction. Is there a workaround to apply this encoding method for my application? Any help/advise is greatly appreciated...

    Dunno if there are new ways in newer DAQmx versions since I'm not near a machine I can double-check.  Meanwhile,
    I'll describe a way I've often handled it:
    1. First of all, the M-series counters have true quadrature decoding built into the board so that direction is handled properly.  When you move one direction the count increments and when you move the other, the count decrements.
    2. I don't know of a method to "retrieve" the direction itself with a software query.  You might need to remember (think "shift register") the previously queried position so you can figure out direction yourself after retrieving the current position.
    3. Most of the time I read my counter values as u32 datatypes rather than as scaled floating point values.  Kind of an old-school habit since I "grew up" under the older "traditional NI-DAQ" driver.  However there's one little gotcha to look out for.
       Since most tasks start with default count value of 0, it's very common for quadrature motion measurements to decrement below 0.  However, u32's cannot express negative numbers so the count will suddenly jump from 0 to 4 trillion something (specifically, 2^32 - 1).  If you pass any u32 readings through an i32 data conversion function (numeric-->conversion palette), the bits get reinterpreted in the expected way so that a decrement from 0 reads as -1.
    -Kevin P

  • Measure Angular Position using quadrature encoders

    Hi I’m new to LabView and NI and would like to know whether the angular position, measured using two quadrature encoders can be measured (and interfaced with LabView) using the following National Instruments hardware:
    NI cRIO-9014 (CompactRIO Real-Time Controller)
    NI-9403
    NI-9215
    NI-9263
    If it can be done I would really appreciate some pointers or suggestions of how to start either setting the hardware up or writing the LabView program.
    Many Thanks
    Alex

    Hi Alex
    Welcome to the world of LabVIEW and NI. You're off to a great start with the hardware and software that you already have. It sounds like you just need a bit of extra knowledge to get you started. A great place to look for help is in the LabVIEW  Find Examples.. This can be found on the LabVIEW splash screen pictured in the attached image.
    For your specific set up I would also suggest navigating to the following links:
    NI CompactRIO Starter Kit and Hardware Setup Wizard Frequently Asked Questions (FAQ)
    It may well be an idea for you to attend one of our customer education courses which would really give you a headstart in your application. Information regarding this can be found here:
    LabVIEW Real-Time training
    I hope this information is of some help to get you started.
    Kind regards,
    Daniel T
    Applications Engineer
    National Instruments UK & Ireland
    Attachments:
    Find examples.PNG ‏253 KB

  • Hw-trigger​ed angular position measuremen​t

    Hello,
    I'm trying to measure wear "on the run" by calculating mass difference from increasing flank tolerance.
    Therefor, I'm using hw-triggered angular position measurement (position of the pinion at a certain position of the gear).
    I tried the DAQmx task on the M&A Explorer (18.000 increments,4x,A High,B High), triggered by the square pulse (+5V) from the incremental encoder of the gear.
    I've got some noise on the signal, but nothing that would hurt.
    With a gear transmission ratio of 41:2 I should get two results each differing with 180deg at an constant interval (depending on the number of revolutions).
    But what I get are senseless results at no visible interval.
    I used another DAQmx task to count the flanks of the trigger signal which works very well (at a constant interval) so obviously the trigger signal is all right.
    I'd be very glad to hear of any ideas or another possibility to solve that problem.
    Thanks in advance,
    A.Monz

    Sounds like a tricky app.  There tend to be a lot of frequency components in rotational measurements on geared shafts.  These will influence your measurements.  Also, inferring wear mass via flank tolerance sounds like a very subtle measurement requiring very high signal to noise.  So I think you've got your work cut out for you from a physics standpoint.
    In the data acq world, however, maybe I can help.  First, the terminology.  It sounds like you've got some reference position that produces 1 pulse per rev.  You'd like to grab 1 sample of position on each of these pulses.   You're calling this pulse the "trigger."    However, in the data acq world, that sort of operation would usually call the pulse an "external sampling clock."  
    Step 1: Make sure you're treating that 1-per-rev pulse as an external sampling clock, not as a trigger.
    Next, how's your resolution?  An 18k incremental encoder is pretty high-resolution, but is it really enough to detect the small angular difference caused by mass loss through wear?  Have you worked out the geometry to know the linear distance (at the pitch diameter) represented by 1 encoder count?  For good trending and measuring, it's typical for the measurement device to have 10x the resolution that you need to discriminate.
    A different approach to try to gain resolution might be to measure time between pulses.  Depending on your board, you can get either 20 MHz or 80 MHz time resolution.  Then, depending on your linear speed at the pitch diameter, you can figure out how much linear distance is represented by 1 time count.
    -Kevin P.

  • How do i use my NI 6216 daq to find a angular position of an incremental encoder

    i have a ni 6216 daq baord and an incremental encoder (i dont know the pulses per revolution of encoder). How do i write a labview code to get the angular positon of a motor wihch is interfaced with the encoder. How can i know the pulses per revolution of the incremental encoder.
    Thanks.

    Hi, 
    My name is Thomas and I am an application engineer at National Instruments.
    I looked through some of the information we have on file for incremental encoders and found a couple of documents that may be of help to you. 
    Follow this link for some general documentation on setting up an incremental encoder to measure the angular position of your motor.
    Follow this link for some example code off of which to build your application.
    As you alluded to, we are going to need to know at how many pulses per revolution your encoder runs. Which encoder are you using? With a bit of research we can hopefully learn the specifications for your specific encoder. 
    Best Regards,
    Thomas B.
    National Instruments
    Applications Engineer

  • Synchronization 9172 9411 / Angular acceleration measurements

    Hello,
    I'm trying to setup a measuring system for a wind power plant test bench.
    As it is essential for measuring the power, I need to measure the rotational speed (up to 4000rpm) and acceleration of the device. (The rotor only powers a flywheel)
    I'm using a cDAQ 9172 with a 9411 and a angular encoder with 2048 steps.
    I don't have problems to measure angular position, speed or acceleration at small sampling rates, using a while loop with shift registers for time, positions and speed.
    Problem is I only get a half to one sample per revolution in the interesting area of 2500 rpm. (41 rev/s => 25ms/rev)
    How can I get faster angular/counter measurements? I read something about using the 9172's counters as sample clock, possibly giving angular measurements with a precise timestamp, but couldn't get it to work. I have no idea which clock I could use, as examples say neither 20MHz, 80MHz nor 100kHz work.
    Can you help me to figure out how to setup this system?
    Later on a temperature sensor, a differential pressure sensor and a stepper motor for the break shall be included using a 9401 and a BNC 2115, a 9472 is still available if it would be needed. (I think I can do that alone, when the acceleration measurement works)
    Program in the attachment, "Winkel" = angle, "Geschwindigkeit" = speed, "Beschleunigung" = acceleration. (makes it a bit more readable, I hope)
    Attachments:
    Winkelpos_ohne_Temp.vi ‏86 KB

    There are two ways one might decide to measure rotational speed given an encoder input:
    1.  Sample an encoder task at a fixed time interval--the speed is the difference in position divided by the time interval.  This is basically what you are doing now, except your fixed time interval is software-timed (which cannot be as fast, nor is it as accurate as a hardware sample clock).  
    You may configure a sample clock on your encoder task to address the shortcomings of using software-timing.  Typically the clock would be generated by the second counter on the 9172 (or if that is in use, use the "frequency generator" instead).  If your clock is faster than the software loop can keep up, you would need to modify the code to read back multiple samples per loop (there is an overhead with each read call so reading more samples at a time would allow for faster rates).
    The rather significant downside to this method is that the measurement resolution (in Hz) would be the inverse of the sample clock rate--remember, speed is calculated as some integer count divided by the sample clock interval.  If you speed up the clock too much, your measurement resolution might not be good enough (as reference 4000 rpm => ~136.5 kHz).  If you do use this method, you'll want to use x4 decoding which effectively quadruples the steps per revolution (so 4000 rpm would now become ~546 kHz).
    2.  Measure the time between consecutive encoder pulses (pick either A or B) using a known timebase--the speed is the inverse of this time.  DAQmx does this for you when you set up a Frequency measurement task (although you'll need to convert Hz back into rpm or whatever equivalent unit you prefer).
    Here, you would get a fixed 2048 samples per revolution (one sample for each edge of the encoder).  You would use the 80 MHz timebase on the 9172 to measure the duration of each sample, so you would have a 12.5 ns time resolution (1/80 MHz).  At the maximum 4000 rpm (~136.5 kHz as mentioned above) your measurement resolution (in terms of frequency) would still be well within 1% of the value (approx. 0.17%).
    The issue most people run into is not gracefully handling the case when the encoder stops and no samples are available (or more generally, the issue is that the sample rate is now a function of motor speed).  Allowing DAQmx Read to timeout and reporting an error to the user is bad form--you'll want to handle the timeout in a more graceful manner.
    The downsides to this method are that you cannot read back the absolute position of your encoder, nor does this method account for direction changes (i.e. there is no concept of 'negative' speed).  This method is also less tolerant to noise (since we are not using both A and B) but this can usually be overcome by the use of digital filtering if necessary.  
    It sounds to me like #2 would be better for your use case, although I guess it depends on how you would like to present your measurements.
    Best Regards,
    John Passiak

  • How to use pci-6230 as position measure

    Can i use the following method to realiate position measure function?
    *  gpct_ex7.cpp
    *  Quadrature encoding
    *  Read a quadrature encoder using counter 0.  The counter is configured for X4 mode
    *  The initial value is loaded into the counter from the Load A register.
    *  Attach the quadrature encoder's A signal to pin 2 (PFI 39) and the B signal to
    *  pin 40 (PFI 37).
    *  $DateTime: 2006/07/27 23:51:45 $
    #include "stdio.h"
    #include "osiBus.h"
    #include "tTIO.h"
    void test(iBus *bus);
    void initMite(iBus *bus);
    int main()
     iBus* bus;
     bus = acquireBoard("PXI0::0::INSTR");
     if(bus == NULL){
      printf("Error accessing the PCI device.  Exiting.\n");
      return 1;
     //Intitialise Mite Chip.
     initMite(bus);
     //Calling test function
     test(bus);
     releaseBoard(bus);
     return 0;
    //Tell the MITE to link the  BAR1 address to the DAQ Board
    //You must initialize the MITE before you write to the rest of the PCI board
    void initMite(iBus *bus)
      tAddressSpace  bar0;
     u32 physicalBar1;
     //Skip MITE initialization for PCMCIA boards
     //(which do not have a MITE DMA controller)
     if(!bus->get(kIsPciPxiBus,0)) return;
     bar0 = bus->createAddressSpace(kPCI_BAR0);
     //Get the physical address of the DAQ board
     physicalBar1 = bus->get(kBusAddressPhysical,kPCI_BAR1);
     //Tell the MITE to enable BAR1, where the rest of the board's registers are
     bar0.write32(0xC0, (physicalBar1 & 0xffffff00L) | 0x80);
        //bar1 = bus->createAddressSpace(kPCI_BAR1);
     bus->destroyAddressSpace(bar0);
    void test(iBus *bus)
     tAddressSpace  cardSpace;
     tTIO *board;
     cardSpace = bus->createAddressSpace(kPCI_BAR1);
     board = new tTIO(cardSpace);
     //Reset
     board->G01_Joint_Reset_Register.writeG0_Reset(1);
     //Disarm
     board->G0_Command_Register.writeG0_Disarm(1);
     //load initial value of 0
     board->G0_Load_A_Registers.writeG0_Load_A(0x00000000);
     board->G0_Command_Register.writeG0_Load(1);
     //set the counting mode to quadrature encoding X4
     board->G0_Counting_Mode_Register.setG0_Encoder_Counting_Mode(3);
     board->G0_Counting_Mode_Register.writeG0_Index_Phase(3);
     //set source to the internal timebase (20 MHz)
     board->G0_Input_Select_Register.writeG0_Source_Select(0);
     //set gate
     board->G0_Input_Select_Register.writeG0_Gate_Select(2);
     board->G0_Mode_Register.writeG0_Gate_Polarity(0);
     board->G0_Mode_Register.writeG0_Gating_Mode(2);
     board->G0_Mode_Register.writeG0_Trigger_Mode_For_Edge_Gate(3);
     //set counting direction to Gate IO connector
     board->G0_Command_Register.writeG0_Up_Down(2);
     //arm counter
     printf("counter value is 0x%08lx\n",
       board->G0_Save_Registers.readRegister());
     board->G0_Command_Register.writeG0_Arm(1);
     //delay long enough for the quadrature encoder to turn a few times
      long int i,j;
      printf("waiting...\n");
      for(i=0;i<1000000;i++)
       for(j=0;j<3000;j++)
     //read counter value
     //Use this method to read the value of an armed counter
     //during non-buffered counting.  Since the value of the counter may
     //change during the read, we make sure that the value is stable.
     unsigned long counterValue1, counterValue2;
     counterValue1 = board->G0_Save_Registers.readRegister();
     counterValue2 = board->G0_Save_Registers.readRegister();
     if(counterValue1 != counterValue2)
      counterValue1 = board->G0_Save_Registers.readRegister();
     printf("counter value is now 0x%08lx\n",counterValue1);
     //Disarm
     board->G0_Command_Register.writeG0_Disarm(1);
     delete board;
     bus->destroyAddressSpace(cardSpace);
    when this sentence  "board->G0_Load_A_Registers.writeG0_Load_A(0x00000000);" is excute i cannt use AO function again,can anybody tell me why? and there is another question

    This used to be a problem with Excel 2003 though I thought it had been fixed with the more recent versions. I've only seen this issue when using named sets in a calculated measure and not when the set is defined within the calculated measure and that's corrected
    by declaring EXISTING before the named set reference as below.
    SET [Member Descendants] AS
    [Calendar].[By Year - Quarter - Month].CurrentMember.CHILDREN
    MEMBER [Measures].[Estimate] AS
    IIF(
    ISLEAF([Calendar].[By Year - Quarter - Month].currentmember),
    IIF(
    1=1, // Simplified for examples sake
    [Measures].[Actual],
    [Measures].[Budget]
    SUM(
    EXISTING [Member Descendants],
    [Measures].[Estimate]
    EXISTING will force the named set to be evaluated with the context of each cell evaluation.
    Martin Mason Wordpress Blog

  • Using a Counter(PC-TIO-10) to Perform Quadrature Encoder Buffered Position Measurement in Visual C++

    I have Driver Ni-Daq 6.9 and Using a Counter to Perform Quadrature Encoder Buffered Position Measurement in Visual C++ 6.0
    (I think Ni-Daq not support PC-TIO-10 because card not support pulg&play, you can hint me driver for support this card. ) and i want example program for read counter. i use Visual C++ for run,i don't use Measurement Studio.

    NI-DAQ 6.9 supports the PC-TIO-10.
    I attached an example that will show you how to do it in CVI (ANSI C).
    Attachments:
    Cviencod.zip ‏19 KB

  • What function is used to read Angular Position form a Task?

    I have created a DAQmx task in MAX. This task configures a counter on a PCI-6259 to take the A and B counts from an encoder and give the Angular Position. What function do I use to read the value since I am no longer reading counts I am reading the position?
    Thank you in advance for any advice!
    John O'C
    Staff Test Systems Engineer
    Woodward, Inc.
    Skokie, Illinois, USA
    "Life is not a journey to the grave with the intention of arriving safely
    in a pretty and well preserved body, but rather to skid in broadside,
    thoroughly used up, totally worn out, and loudly proclaiming...
    Wow...What a Ride!"
    Solved!
    Go to Solution.

    Hi Izzy,
    I have Created the task in MAX. The task takes input into the counter from an encoder and converts it to angular position. Do I still use the DAQmxReadCounterF64 function to read the counter? I am guessing that I do and that the function returns the angular position rather than the raw counts. Not sure though.
    Thanks for taking the time to respond.
    Regards-
    John O'C
    John O'C
    Staff Test Systems Engineer
    Woodward, Inc.
    Skokie, Illinois, USA
    "Life is not a journey to the grave with the intention of arriving safely
    in a pretty and well preserved body, but rather to skid in broadside,
    thoroughly used up, totally worn out, and loudly proclaiming...
    Wow...What a Ride!"

  • Are there any corrections to be made on the Reset Angular Position Encoder VI ?

    Are there any changes to be made for the Reset angular position encoder vi diagram?

    What are you looking for? You need to be more clear about the problem you are facing and what you want to do.
    Adnan Zafar
    Certified LabVIEW Architect
    Coleman Technologies

  • Position Measurement with PCIe-6321

    Hi,
    I have PCIe-6321 card and I want to use it for linear position measurement. I have an interpolation device that provides A and B channels that I`m going to put in the counter inputs of the card. Are there any examples of using the position information with LabView (Graphing the position, using it for control purposes etc.) There are some examples in the example library of LabView but in most of the, PCI6321 isn´t on the compatible cards list although most PCI62xx cards are. Can I still use these examples? Thank you in advance.

    Hi
    You can try it with this examples, but there is another easy way. Please do not forget that you need at least the DAQmx 9.0 driver.
    1. Open the MAX and create a task  for your linear position measurement with the PCIe-6321
    2. There you can see all the connections you need and you can set all parameters fot the acquisition
    3. Save the Task
    4. Close MAX and open LabVIEW
    5. In the block diagram go to  Measurement I/O >> NI-DAQmx >> insert Task Const (DAQmx Task Name)
    6. Right click on the task constant and choose  >> Generate Code >> Configuration and Example
    7. Run your VI and have fun
    Kind regards
    Beat
    NI Germany

  • Design and develop an ANGULAR DISPLACEMENT measurement using an appropriate SENSOR

    Hello everyone 
    in the beginning I am very grateful for this useful website and discussion and I have certain inquiries about 
    Design and develop an ANGULAR DISPLACEMENT measurement using an appropriate SENSOR using labview as controller and I don't have much knowledge about labview any basic ideas that help me I will be thankful for you 
    thank you very much 
    Attachments:
    6. Assignment Question Paper (cover).pdf ‏27 KB

    '4. Cases of plagiarism will be penalized'
    If we do it all for you and you cut and paste the answers, isn't that plagiarism?
    I think it's reasonable to come to the forums to ask some directed questions where you're stuck, but you
    don't seem to have put any effort in so far.
    First read the LabVIEW help and study some introductory LabVIEW courses. Only then will you have the skills to
    approach the exam question.

  • Why 99% cpu load when running buffered position measurement

    I'm getting 99% cpu load while performing a buffered position measurement with a 6602 in a PXI system.
    I am running the example provided with Labview itself.
    What am i doing wrong here ?

    This is a known problem. The reason for this is that the counter buffered operation uses a blocking method, so that buffer object spins in the kernal while waiting for the buffer to fill.
    A workaround is to continually check the backlog and then just read exactly what is in the backlog. You can read the backlog by using a shift register within the while loop. Connect the backlog output of the Counter Read Buffer VI to the shift register on the right side of the while loop. Then use the shift register on the left side of the loop for the number to read input of the Counter Read Buffer VI. This will assure that you are only reading what is in the buffer and you are not tying up the CPU waiting for the buffer to fill. I hope this helps.
    Regards,
    Todd D.
    App
    lications Engineer
    National Instruments

  • Selection of daq board to find angular position of 6 motors using encoder

    can you suggest me best daq board to use 6 motors positions as outputs using encoders attached to the motors. i will be using single counter for each motor. Or can i use a single counter for all the motors encoders??
    Solved!
    Go to Solution.

    Hello Prabhakar7117,
    You would need a counter for each encoder. Since you will be using 6 encoders, you should get a DAQ device with 6 or more counters. Take a look at the PCI-6624 or PCI-6602. Another option would be a CompactDAQ chassis with modules that are able to access the counters. Take a look at them.
    PCI-6624
    PCI-6602
    KB Which cDAQ Modules can be Used to Access the On-board Counters?
    Best Regards,
    Alina M

  • I am using an XY Graph in LabVIEW to plot magnitude vs angular position. When the angle rolls over from 360 to 0, the plot i

    s continuous and a line is drawn all the way across the plot from 360 back to 0. I was wondering if I could turn off this roll-over somehow so I could still have a continuous plotover the 0 to 360 span? Or is there something else I can do or use? Thanks

    s continuous and a line is drawn all the way across the plot from 360 back to 0. I was wondering if I could turn off this roll-over somehow so I could still have a continuous plotover the 0 to 360 span? Or is there something else I can do or use? ThanksYou could also wrap the second half of the data around such that visually it's going back towards the 360/0 point.
    The attached VI shows how this might work with a sinewave. First run it with the boolean switch off to demonstrate the problem, now then turn the switch on and run the VI again.
    Mike...
    Certified Professional Instructor
    Certified LabVIEW Architect
    LabVIEW Champion
    "... after all, He's not a tame lion..."
    Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps
    Attachments:
    plotting_wraparound.vi ‏34 KB

Maybe you are looking for

  • REGARDIND REPORTS.

    Hi experts.         i m new in abap, i m preparing one purchase register report in which i need to display invoices number and material code against one purchase document number. i m fetching invoice from rseg table n material code from ekpo problem

  • 2 easy questions - one on file size, teh other on sound reduction

    Hi, hope you can help: 1. If I make a 30 second movie clip in imovies that I would like to put on myspace it is 600MB and the limit is 100MB. How do I reduce the file size or what other options do I have? 2. When I overlay music from itunes onto a mo

  • Local mods - upgrading to Solaris 8

    Hi I will be upgrading from Solaris 2.6 to Solaris 8. How much will I have to re-do in the way of the configuration of things like cron jobs, rtel printers, lpadmin printers, serial port (aurora) configuration and ?any other local modifications? Will

  • Saving changed  pictures in iPhoto does'n work

    When I retouch a foto in iPhoto the changes are not automatically saved. I tried several times to zoom a picture, read in the help section that all changes are saved unless "back to original"-button is hit, but my photo is back to the original one. T

  • My profile is "reset" after last security update.

    Hi, yesterday I applied last security update but without rebort right after that. Then later (very long) shutdown. Today started up, logged in and shocked - the profile is reset: desktop, all apps settings (as in "brand new" profile). Already tried: