Incremental encoder, velocity, position and direction

hi,
A incremental encoder(With channel A and B)
I know that the velocity is proportionate with the frequence of the pulses and we can find the position with a simple edge count. But it's a bit difficult to find out the rotating direciton even if the principe is very evident.
are there any exemples for these kinds of application?

PCI-MIO-16E-1 --> DAQ-STC --> see paragraphs concerning DAQ-STC in this
file
Unfortunately I have never used a SC-2345. But after a short overview of its specifications, it seems that you will need one SCC-FT01 to connect the A channel to the counter source and the other to connect B to the auxiliary line that will set the direction. See schematic in the file mentionned above. So your hardware will allow you to take this measurement.
See this example to see how to configure a DAQ-STC counter for position measurement.
1) Simple event counting
2) Up/down counting. Direction is given by hardware --> auxiliary line of the counter (DIO6 for counter 0 and DIO7 for counter 1)
3) Start the counter
4) Read periodically the counter value
5) Reset the task when finished
Don't be troubled by the BNC-2120. Use your SC-2345 instead. Obviously you will need to adapt the number of encoder pulses/rev to suit your encoder.
Add a shift register to store the position from one iteration to the other and compute the difference to determine the direction.
If you want to add the velocity, than you have two options :
1) If the accuracy must not be very high, then you can compute it (delta position / loop time).
2) If you need high accuracy, then it will necessary to use the second counter to measure the frequency of channel A. In order to avoid errors due to vibrations it is recommended to use the LS7084 in this case.
As you can see here, there are 3 methods to measure a frequency.
Obviously, the examples will not work with your DAQ-card because the 660X is a NI-TIO type counter.
If you want to measure the velocity at the same time than the position, then you will need to use the first method (Inverse period measurement) because the others will need 2 counters. (your card has only 2 counters and one is already used for the position measurement).
There is an example of period measurement for DAQ-STC that ships with LV (Measure Period (DAQ-STC).vi).
1) Single period measurement
2) Source specification --> internal timebase
3) Gate specification --> channel A
4) Start task
5) Wait for one pulse on Gate. I recommend to add a timeout to not enter in an endless wait if there is no pulse.
6) Read number of pulses of the internal timebase.
7) Check if counter overflow
8) Reset task
You will need to combine both examples in one vi.
I hope this is clear enough to help you.

Similar Messages

  • Encoder velocity + min and max of velocity

    Hello!
    I use incremental encoder and PCI-6220 card. I need to measure angular position and angular velocity of shaft (rotation angle of shaft is from -80 to + 80 degrees (there is no complete revolution). For measuring angular position I am using DAQ Assistant (encoder is for position measurement) (see attached file LabView 7). But I do not know how to measure angular velocity of shaft and also maximum and minimum values of velocity (of course minimum value of velocity have to be zero, because rotation is clockwise and counterclockwise)
    Sergey

    My attachment
    Attachments:
    ENC.vi ‏48 KB

  • Incremental Encoder Velocity VI Help

    Howdy Everyone,
    I am currently working on a project that requires me to get the velocity of an incremental encoder with 2 channels A and B. I already have the counts for A and position but I still did not find any VI that calculates velocity. I am currently using a Wireless Data Aquistion System "WLS-9163" with NI-9215 module.
    Any help would be really appreciated.
    Thanks.
    Mechanical Engineer

    Velocity is:
    Actual Sample - Previous Sample / Sampling Rate.
    1.Create Channel: CI - Position Linear Encoder
    2. The sample rate can be set using the Sample Clock Vi. One of the inputs is Rate.
    3.Use Counter 1DBL 1Chan N Samples in order to set the number of samples read.
     This way you'll get an array with "position values" sampled using the specified rate (at 2.). So you have to compute:
    pos[i] - pos[i+1] / rate  =>> velocity
    Paul
    PS: Sorry for VIs in German but I think it's easy to find them also in English, in DAQmx

  • Use incremental rotary encoder to measure the absolute position and velocity

    Hi all,
    I faced a problem by using incremental rotary encoder to measure the absolute position of the rotation. 
    I'm not using NI-Daqmx but NI-motion module. In NI-motion module, I use read encoder position.vi to read the position of the encoder. 
    However, the readings is in incremental form. I'm doing the feedback control, so I need the absolute position and velocity.
    Is there any functions or vi in the labview that can be used to transform the information of incremental encoder to the absolute one?
    Thanks
    Jun Wong

    Jun,
    1. The incremental encoder provides incremental position. After switching on the encoder power the encoder counts upwards or downwards. For the absolute position you need the index (R or I) signal. I don't know which type of incremental encoder you have but there should be A, B and (I or R) signals. The index signal should reset the counter to zero setting this way a pseudo-absolute-position (which is lost after the first switch of). Most of the motion controllers have a mode, just after switch on, in which the controller search for the Index. This mode is called Homing. 
    2. Velocity. It's very simple. You sample the position with a fix sampling clock. Let's say: 10kHz. The speed is: (Actual Position - Previous Position) / Sampling Period. Pos[n] = 10.000inc, Pos[n-1] = 9.900inc. Speed = 10.000 - 9.900 / (1/10kHz) = 1.000.000 inc/sec. If one increment is 0.0001mm then the speed is 100mm/sec.
    Paul 

  • NI Motion with incremental encoder and precise position

    I am currently working on a project that requires me to get the precise position (mesure) with an incremental encoder with 2 channels A and B. I am Using NI Motion, NI UMI-7774,NI PCI 7550, and Labview 10 

    That should work!

  • NI Motion witth incremental encoder and precise position

    I am currently working on a project that requires me to get the precise position (mesure) with an incremental encoder with 2 channels A and B. I am Using NI Motion, NI UMI-7774,NI PCI 7550, and Labview 10

    Hey that's great!
    I think you're in the wrong forum: http://forums.ni.com/t5/Motion-Control-and-Motor-Drives/bd-p/240
    jigg
    CTA, CLA
    teststandhelp.com
    ~Will work for kudos and/or BBQ~

  • 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

  • Controling Position and Velocity of trolley

    Hey,
    I am working on an application for a engineering design project that requires me to control the position and velocity of a trolley on a linear track.
    I have done some work in LabWindows before controlling the speed and position of a linear movement but am having some troubles shifting my knowledge from a small application to what I am working on now. This is what my plan is; I currently have a motor (DC 24V 88A), String potentiometer to determine linear distance travelled (there was risk of slip and need of high precission), sufficiently sized power supply and BNC-2110 DAQ.
    My plan (which I am looking for some feedback on ... no pun intended) is to use LabView to create a PWM (which has already been done) to control the speed of the motor via the counter turning on and off a power mosfet completing the Motor's circuit. By varying the time on and off I hope to control the speed. 
    After this has been completed I hope to hook up my string potentiometer to the Trolley and see how it's position changes over time (i.e. determine the speed at which the trolley is moving at for a variety of different % time on and off). This will act as an open loop test, which I was hoping to then figure out a practical transfer function for the motion of the trolley and then somehow use the String Pot as a feedback sensor to complete the loop and create a PI controller. I am having a hard time wrapping my mind around how I am suppose to put the later bit into practice. It all sounds fine on paper but actually approaching an implementation of this idea is boggling my mind.
    Any input or pointers would be greatly appreciated. Am I on the right track or am I looking at something completly wrong... being a student I guess I don't know exactly how things are done in practice in industry, just what is written in books so any help would greatly appreciated.
    Thanks!
    Mac

    Mac,
    starting with an open loop system, determining the transfer function and designing the control algorithm is a reasonable approach albeit a little bit academic.
    A more empiric approach is tuning the closed loop motion control system by means of test functions like white noise or a setpoint step. Here you can find some information about tuning a motion control system by analyzing the step response of the closed loop system (Please note, that this document refers to NI motion control boards, but the general approach of the tuning process is universal).
    This brings me to something very essential. Stable control systems require a deterministic real-time environment. You haven't provided explicit information about the environment that you are intending to use, but it sounds like you are planning to use a Windows based system with LabVIEW. This is not recommended, as such a system can't guarantee stable control loop timing, which is at least as important as the right set of PID parameters.
    So my recommendation here is to use either a motion control board which runs the control algorithm onboard or to run the application with the DAQ board under LabVIEW RealTime (could run on a PXI-system or on desktop PCs that meet certain requirements). If you are going for the second approach, you may also consider using the NI SoftMotion Development Module.
    If there is any kind of campus license of NI-Software available at your university, all the required software components should be already available for you.
    Last but not least here are some considerations about the power circuitry. You have suggested to use a PWM signal that controls a single mosfet. This approach is not feasible in most applications, as it doesn't allow you to control the position and the speed of the motor accurately. To do this, you need to be able to drive the motor in both directions. You could do this by using an H-bridge circuitry, but this requires some more considerations when designing the control algorithm. In fact in most cases you would work with two cascaded control loops. The inner control loop is the current control loop, that generates the signals for the H-bridge, while the outer control loop is the position/velocity control loop.
    Depending on the focus of your project, you may also consider using a commercial motion drive that provides the power circuitry and the current control loop. Those devices typically provide a +/- 10 V input for an external control signal that is provided by the outer control loop.
    I hope this information provides some ideas to getting started.
    Kind regards,
    Jochen Klier
    National Instruments

  • 'Hierarchy Based Login' and 'Direct Reports' field in Dim - Position table

    Hello -
    I am trying to build a "My Team's" report, which basically shows the logged in Managers ( and his subordinates) revenues rolled up by default. Then the manager needs to drilldown on his name and see revenues grouped by his direct reports. I am using OBIEE 10G. In the out of the box RPD, there are two fields in the BMM layer called 'Hierarchy Based Login' and 'Direct Reports'.
    1. The 'Hierarchy based Login' field uses the INDEXCOL method to get relevant column from the W_POSITION_DH table based on the the Logged in users hierarchy level (the hierarchy level is stored in a session variable (HIER_LEVEL). This session variable works fine and i have tested the SQL)
    2. The 'Direct Reports' is using the same INDEXCOL method, just that it uses the formula HIER_LEVEL - 1. This works fine as well.
    The issue i am facing is neither of these out-of-the-box fields are assigned to the Position dimension (the position dimension also exists OOTB).
    So basically, i am able to create a manager and his direct subordinate report, but without any drill functionality.
    I am trying to get the report to drill all the way down to the bottom most level of the heirarchy.
    Any help to get this working is much appreciated

    What i meant was neither of these out-of-the box fields are assigned to a Dimension Hierarchy ( there is a hierarchy called 'Position' that already exists out-of-the box). Other fields in the 'Dim-Position' table are assigned to a level in this position hierarchy, except these two. I guess what i am trying to achieve is to dynamically assign the hierarchy level based on the users Hierachy level in W_POSITION_DH table.
    Thanks for spending time to look into my issue

  • Determining position and velocity using an accelerometer

    I have a test subject (elevator), and I'd like to use an accelerometer and graph out position v time, velocity v time, acceleration v time. Has anyone ever done this? I am getting stuck on how to obtain my velocity and position when the elevator is at a constant velocity. I tried to use statistical analysis and determine the velocity based on the length of time during acceleration but the timer for max value seemed to keep increasing even when velocity was at zero. Can anyone give me insight on this project?

    Zero acceleration is NOT the same as zero velocity.
    Zero acceleration just means your velocity is not changing.
    I set up a test that used an array stating I had a constant acceleration for a given period of time, then 0 acceleration for a given period, and then a negative acceleration. This was so simulate the elevator moving from the ground level to the top floor. 
    In a simulation, if your +accel is the same magnitude as your - accel, and the +accel time is the same as the -accel time, and if you start from a velocity of 0 and a position of 0, then it seems like your simulation would be correct: the elevator is at rest, it takes off at a certain accel rate until it reaches "cruising speed",it cruises for some time, then decelerates to where velocity = 0, and remains there.  Position is somewhere other than zero.
    Maybe you can post your simulation code?
    Steve Bird
    Culverson Software - Elegant software that is a pleasure to use.
    Culverson.com
    Blog for (mostly LabVIEW) programmers: Tips And Tricks

  • How to check a incremental encoder by multimeter

    hi
    i have a robotic machine i am facing problem in one convyer that convyer not taking step i have a dout on encoder i want to check that encoder  by multimeter how i can check it encoder make -- Baumer GI342 A707123. so help me to check this

    Hi amit1980,
    Let me make sure I understand you correctly-
    You have a machine that includes a conveyer. You have an incremental encoder and you would like to debug your system using a multimeter.
    When you wrote "that conveyer not taking step" do you mean that it is a stepper motor that is not moving at all?
    An incremental encoder generates pulses that overlap on the two lines. By counting the pulses and which order they occur on the two lines you can determine the distance, speed and direction travelled.
    If the motor is not moving at all then the encoder will generate no pulses.
    You can do a sanity check of your encoder with a multimeter. You can read the voltage of one of the tracks while you very slowly turn the shaft of the motor. Very very slowly. The rotor has to turn slowly enough that the multimeter will have time to detect the change in voltage. If you just spin the motor the pulses will happen too quickly for the multimeter to see them. This encoder has 2048 pulses per revolution. To be able to see one transition you would have to move the shaft 1/2048th of a turn.
    If you just want to make sure that the encoder is producing any pulses at all then you can just set your multimeter to AC mode and spin the motor. A non zero voltage while spinning will mean that pulses are being generated.
    If you need more information that this- such as the direction, whether the tracks are overlapping properly, or especially velocity- you will need to use a scope rather than a multimeter.
    Since the encoder only produces pulses when it rotates, if your motor really isn't moving at all then the encoder is not likely to be the problem and you should investigate further up.

  • Chart Error - scroller positions should be positive and integer

    <p>
    Hello Expert
    I have created a flash chart with two filters on the chart region.
    i) &lsquo;Select list with submit' ----- (:P23_TRC)
    ii) &lsquo;Radio button with submit' -----(:P23_IMPACTC)
    The chart should display as per the filters selection.
    However, I get the error message "<strong>scroller positions should be positive and integer</strong>", once, whenever I load this chart page for the 1st time in a new IE window.
    After I change the filter's value it will work perfectly fine.
    In filters default value is one value from respective filter list of value
    </p>
    <p>
    If I remove the filter conditions from chart query, it works perfectly without error.
    <u>Here are my chart series queries</u>
    select null link, V.LOB label, COUNT(TR) "Customer Care"
    from V_PROCESSTRACKING V
    Where V.ProcessArea like '%Customer Care%' and (V.TR = :P23_TRC) AND ((V.IMPACT = :P23_IMPACTC)OR (:P23_IMPACTC = 'ALL'))
    group by V.LOB
    order by V.LOB
    select null link, V.LOB label, COUNT(TR) "Sales"
    from V_PROCESSTRACKING V
    Where V.ProcessArea like '%Sales%' and (V.TR = :P23_TRC) AND ((V.IMPACT = :P23_IMPACTC)OR (:P23_IMPACTC = 'ALL'))
    group by V.LOB
    order by V.LOB
    <u>Customer XML</u>
    &lt;?xml version = "1.0" encoding="utf-8" standalone = "yes"?&gt;
    &lt;root&gt;
    &lt;type&gt;
    &lt;chart type="Stacked Horizontal 3DColumn"&gt;
    &lt;animation enabled="yes" appearance="size" speed="10" /&gt;
    &lt;hints auto_size="yes"&gt;
    &lt;text&gt;&lt;![CDATA[{NAME}, {VALUE}]]&gt;&lt;/text&gt;
    &lt;font type="Verdana" size="10" color="0x000000" /&gt;
    &lt;/hints&gt;
    &lt;names show="no"/&gt;
    &lt;values show="no" prefix="" postfix="" decimal_separator="." thousand_separator="," decimal_places="0" /&gt;
    &lt;arguments show="no" /&gt;
    &lt;column_chart column_space="3" block_space="12"&gt;
    &lt;border enabled="no" /&gt;
    &lt;block_names enabled="yes" placement="chart" position="left" &gt;
    &lt;font type="Verdana" size="10" color="0x000000" /&gt;
    &lt;/block_names&gt;
    &lt;/column_chart&gt;
    &lt;/chart&gt;
    &lt;workspace&gt;
    &lt;background enabled="yes" type="solid" color="0xffffff" alpha="0" /&gt;
    &lt;base_area enabled="no" /&gt;
    &lt;chart_area enabled="yes" x="215" y="50" width="705" height="500" deep="0"&gt;
    &lt;background enabled="no"/&gt;
    &lt;border enabled="yes" size="1"/&gt;
    &lt;/chart_area&gt;
    &lt;x_axis name="Line of Business" smart="yes" direction="horizontal" rotation="-90" position="left_center" &gt;
    &lt;font type="verdana_embed_tf" size="14" color="0x000099" bold="yes" align="center" /&gt;
    &lt;/x_axis&gt;
    &lt;y_axis name="No. of Process" smart="yes" position="center_bottom" &gt;
    &lt;font type="Verdana" size="14" color="0x000099" bold="yes" align="center" /&gt;
    &lt;/y_axis&gt;
    &lt;grid&gt;
    &lt;values /&gt;
    &lt;/grid&gt;
    &lt;/workspace&gt;
    &lt;legend enabled="yes" x="935" y="50"&gt;
    &lt;names enabled="yes"&gt;
    &lt;font type="Verdana" size="9" color="0x000000" bold="yes"/&gt;
    &lt;/names&gt;
    &lt;values enabled="no"/&gt;
    &lt;scroller enabled="no"/&gt;
    &lt;header enabled="no"/&gt;
    &lt;background alpha="0"/&gt;
    &lt;/legend&gt;
    &lt;/type&gt;
    #DATA#
    &lt;/root&gt;
    <strong>Help please!!!!! It's urgent</strong>
    Sagar
    </p>

    Hi Rima,
    I found the solution,
    My graph is dependent on the page items. What I found was when I load the page, item default value was displayed but it was not stored in the memory. Item value only gets stored in memory when the page is submitted.
    Line: -----
    Soultion : - Create a page level before header process and define the default value over here as well. This will resolve your error.
    Hopefully you understood what I am trying to explain. If not let me know and I will trying to put in picture and email you.
    Sagar

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

  • Use DasyLab to measure torque, rotary position, and RPM

    I'm new to DasyLab and am developing an application to measure torque, rotary position, and RPM.  I'll be using an Interface T8 pedestal torque transducer with a built-in rotary encoder capable of measuring angular position, speed, and direction.  The encoder will be outputting 5V TTL at one pulse per degree.  I'm using an MCC 1608GX USB DAQ device capable of reading analog and digital signals.  I'm looking for insight on reading the TTL output from the encoder and converting it to angle and speed.  Any help would be appreciated.

    OK,
    If you want to go directly to the 1608 you need to take the counter input and use it as a frequency input.  This will give you the Frequency of the encoder that you can convert to RPM but I don't think you will be able to detect the direction.
    To my experience the signal is not very stable due to the software pull but good enough if precision is not a question.
    Another oprion is to buy an additional small frequency to analog converter that will take a dirrential output.  This units can usually be programmed for +/- Frequnecy to +/- rpm.
    There are models out there that are designed fo quadrature encoders.  The link below is a good example.
    www.laurels.com/downloadfiles/LTA-manual-pulse-in.pdf
    Tom Rizzo
    InSyS Corp.
    www.insyscorp.com
    Your DASYLab integrator

  • Incremental encoder rotational acceleration

    I am trying to obtain acceleration velocity and displacement from an incremental encoder using labview 7.0. I am currently using an analogue input and a waveform measurement block to get a time period. The problem is that when the shaft is not rotating i get an error message saying the signal has not crossed the reference point enough times. Is there a way around this?
    I know differentiating the signal produces inaccurate results.
    I have have also tried connecting the signal to a edge count but cant obtain velocity and acceleration signals.
    any suggestions

    Thanks.
    We are setting up a moment of inertia experiment where a flywheel is accelerated by a mass attached to a cord which is wrapped around the axial. We are timing how long it takes for the mass to go from stationary to the time it touches the floor. The current experiment used stopwatches and assumes at time = 0sec velocity =0 seconds. Although I have been able to extract an initial velocity, my supervisor wanted it to start from zero to make calculation simpler for the students.
    Because the experiment is over in around a minute the sampling has been set to 1 second obviously the longer the sample times the less results I get. I want to create some kind of loop that will trigger when the first edge counts the timer starts. I May have just answered my question with this but if you have any suggestions would be useful.
    Do you know what the default number of pulses are that are required to for the waveform vi to work?
    I’ll have a look at the gated count. How do you ignore errors when the period is below a set value and how do you overwrite the signal?
     Thank you for your help!
    Tim

Maybe you are looking for

  • Java Program with Adapter / Facade Pattern

    Hey All: I'm very new to the Java language and have been given a fairly complicated (to me) program to do for a course I'm taking. The following is the scenario. I'll post code examples I have and any help will be greatly appreciated. Let me apologiz

  • Problem with Package Applications

    Ok, I'm trying to migrate an Apex Application from one server to a newer server.... My custom app I used the theme from Go Live CheckList samples.... Well, when trying to install that application I get 'Insufficient space to install application ' wit

  • Header Pricing Condition?

    HI My Client Requirement is like they wants shipping Charges at header level only. and we are maintaing two C.Type for the Shipping Charges at header level and this condition and its values come from Z-Table.and in Z-table we are maintaing C.Type and

  • String-formatting markup search

    The properties for string formatting are many and could support a parsing function that would take a string containing markup and produce a formatted string.  Has anyone done this or know of any code available to implement this? I would like to be ab

  • 60Gb iPod won't play songs with bitrate 80kbps or less

    Hello, My 60Gb iPod will no longer play songs encoded with bitrates of 80kbps or less. I think the problem started after I upgraded iTunes to v7.0.2(15) and the iPod to v1.2. If I try to play one of these songs the iPod screen goes black, then the Ap