Encoder position to velocity

I am a beginner DAQ user and am trying to use a PCI-6110S to measure the velocity of rotation of a quadrature encoder. i am able to monitor the position change, but do not know what time component i can use to convert the position to velocity and acceleration. pls advise.

Hi ALL,,
i've seen the link that u give to me..
As my picture below..
I've gotten a position value in single sample..
When
i use your advice(it's a N sample method that is formed in array and of
course it uses sample clock method by ither counter)
So how can i easily develop RPM(velocity) value by its position? and even i get fixed time interval i can't..
~my optocoupler just has 2 output:
TTL signal and ground 
Any comment would be appreciated..Thank
Ariawan. 

Similar Messages

  • Encoder Position and Velocity Measurements and Force Measurements

    Hi,
    I am using a USB 6210 DAQ Card and an optical encoder and force transducer together in an MRI room to measure the power ouput of a patient pedalling on a recumbent ergometer. I would like to obtain synchronous measurements and output this to file. I have started working on the code for the encoder. I am struggling to get the frequency measurement and encoder position outputting fast enough. Any idea why this is? For the force measurements will this be with the same configuration just adding Vi's for analog input. Also I know using the write to measurement file vi is quite slow to write to a spreadsheet what is the more efficient method for doing this.
    Regards,
    Darren
    Attachments:
    Angular_Position and RPM.vi ‏46 KB
    Angular_Buffered.vi ‏80 KB

    Hello Darren,
    The fastest file to write to in LabVIEW is a binary file.  The specific file type used by LabVIEW is the Technical Data Management (TDM) file.  The TDMS file is a version of this file specifically designed for streaming applications.  You can find several examples of writing to this file in the NI Example Finder (Click Help -> Find Examples).  By using the search tab, you can use the keyword “TDMS” to search for all of the examples that use the TDMS file type.  The example Cont Acq&Graph Voltage - Write Data to File (TDMS) can be found from the search tab, or by using the path Hardware Input and Output -> Analog Measurements -> Voltage.  While the data acquisition part of this example pertains to analog input, the same file input structure can be used with your counter input tasks. 
    What do you mean that the encoder and frequency measurements are not fast enough?  Each rising edge of the sample clock source will latch the current value of the measurement into the FIFO and transfer this value into the buffer.  At this point, how quickly you can read the buffer will affect how quickly the user is updated with the newest measurement information.  Since you have specified the number of samples to read in your buffered example, the read VI will wait until that many samples are available in the buffer before returning a measurement (this could slow down the update rate for the user).  By specifying -1 as the number of samples to read, you will read all available samples in the buffer.  If there are no samples available, nothing will be returned, but the VI will continue to execute.  Hope this helps. 
    Regards,
    Browning G
    FlexRIO R&D

  • 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 

  • Acquire encoder position with Motion and DAQ

    Hi,
    I am trying to acquire an encoder position with Motion. It seems impossible to set the frequency of the acquisition with Motion and I must poll for the position in a do-while loop.
    I have read in a lot of threads that one can use RTSI lines to retrieve encoder position with a DAQ Board though it is acquired with a Motion board. But there are no examples at all about this.
    To sum up, I need to send Encoder Phase A to RTSI0, Encoder PhaseB to RTSI1 (which I already do), retrieve info with a DAQ device and then calculate rpm.
    Christophe
    PS: please don't answer with measure angular position.vi or explain me in what this Vi can help me

    Hi Christophe,
    I'm not sure I understood well what you need. You have the angular position and you need to know the timing, am I right? Can you use an other counter on your card to get the period (or the frequency) of your signal? From that, I think you should be able to calculate the velocity.
    I hope this helps,
    Charlotte F. | CLAD
    National Instruments France
    #adMrkt{text-align: center;font-size:11px; font-weight: bold;} #adMrkt a {text-decoration: none;} #adMrkt a:hover{font-size: 9px;} #adMrkt a span{display: none;} #adMrkt a:hover span{display: block;}
    >> "Du 11 octobre au 17 novembre, 2 sessions en parallèle : bien démarrer - approfondir vos connais...

  • Time of reading encoder position

    Hello,
    I want to ask you people where can i learn function execution times of NI 7358 board? I'm developing driver for this card on QNX 6.5. When i send read encoder position package to 7358, the first data comes to RDB register after around 10 ms for first time. Is it normal? Is there any documentation file that includes all function execution times (average)?
    Best regards.

    Hi erhan,
    I'm not too surprised that once the motion has started, the "Read Axis Status" function takes more time. The card should devote more resources towards managing the movement. That being said, the timing help document is only in reference to the individual function calls and as you stated the Read Axis Status alone has no latency. 
    Unfortunately, besides this timing help document, there isn't other documentation that is released that discusses the execution timing. If this is a bigger concern, I would try benchmarking the process on multiple computers.
    Paul M
    National Instruments | Applications Engineer | www.ni.com/support

  • 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

  • Read Encoder Position Error -70012

    I am using the "Read Encoder Position" and I keep getting error #-70012.  There are no errors up to this point and it does not SEEM to affect the way my program runs.  Does anyone know what this error is? 
    I did try to look up the error # to no avail.
    Thanks.

    Have you seen this?

  • Use angular Encoder position to trigger Digital out

    Hi,
    I am a beginner labview user, I have access to three modules, two NI9201 and one NI9401.
    I have an angular encoder that is used to measure the angular position of a motors crankshaft, what I'm trying to do is use the encoder to trigger a digital out (spark event in the engine) at a certain angular position.  For example, I would like to trigger at top dead center (or 0 degrees on the encoder), then I want to be able to change this to +5 degrees on the encoder, etc. 
    So far I am able to read in the angular encoder when the motor is running, I am also able to output digital out signals although I can't find a way to link the two together.  
    If anyone has any idea how to do this, it would be greatly appreciated, I have attached my VI.
    Thanks in advance,
    Nick
    Solved!
    Go to Solution.
    Attachments:
    Encoder_Spark.vi ‏40 KB
    Encoder_Spark.vi ‏40 KB

    Hi Nick,
    I hope the attached vi will get you on track.  It's just a general concept.
    The while loop will run until you hit the stop button.
       I take it you will need one spark per revoultion.
    This VI is really just an If/Then
       If the encoder value is equal to (in this example ) zero,
       Then trigger the digital output.
    I know I have a broken wire, but I didn't know how to get the angular position from you DAQmx.
    Let me know if this help. (Also let me know if I'm off target)
    Good luck,
    Bill
    Attachments:
    Trigger spark concept.vi ‏9 KB

  • Encoder position not automatically resetting on z pulse

    I am using a PCI-7344 motion control card with a UMI-7764 break out box. Connected to this is a Pepperl & Fuchs 1024 line encoder.
    Problem 1
    The encoder counts up and down ok but gives 4096 counts between z pulses and not 1024.
    Problem 2
    The position does not automatically reset to zero when the z pulse is seen.
    The encoder connections have been checked via oscilloscope for correct relationships (z is high when A and B are both low), but when mapping the encoder signals to RTSI signals and monitoring them, the signals are inverted.
    I've tried a lot of combinations of polarity and phasing but all to no avail. What's going on??!
    Attachments:
    Encoder_test.vi ‏42 KB

    1. The 7344 rather counts quadrature signals and so the number of pulses it will count will always be 4 times the number of encoder lines. On all encoders I have seen just the number of encoder lines per revolution is specified.
    2. Unless you are using a Find Index command the 7344 won't reset the encoder pulse counter. There is more than one application where the encoder will make several turns during a full motion cycle - remember a geared drive or a worm gear drive. If the motor/encoder has to make more than one revolution to complete its motion cycle resetting the pulse counter each time the index pulse occurs would be quite disturbing.
    AFAIK with the latest firmware/software version it is no more necessary that both A and B are low when the index pu
    lse occurs, you can set the actual state of A and B when index occurs with a special command.
    BTW in cases the encoder/motor will make several revolutions you should use a separate home switch to detect proper zero position of the drive, of course using the Find Home command. It can be combined with (or rather followed by) a Find Index command to detect the zero position more precisely.

  • Encoder position WITHOUT counter input

    Question:
    I have three incremental encoders connected to my M-Series DAQ board (PCI-6229) that has TWO Counter input channels.  I am measuring the position of each encoder.  How do I measure the position of the third encoder if I have used-up both counter inputs?  Is there a manual way to accomplish this using my older version of Labview (version 7 express)?  Any help is appreciated.
    -Clarkam1 

    clarkam1 wrote:
    Ben,
    I'm on an extremely small budget and can only use the items available to me at present time.  That being said, is there no way to use one counter for multiple encoders?  Or could an external device be used to count which the DAQ board would read?  I appreciate your timely responses.  I'm trying to explore all other options.
    So do you work for free?
    If you are determined to get all three counters going with that device, you have a big challenge ahead of you. I'll try to explain. At teh input of your counters you have signal conditioning that feeds the counter itself. To do the same thing using analog input channels (since all of the counters are already used) you will have to develop code that simulates the signal conditioning, converts the analog to digital (this may sound easy but if you need to implement over-sampling its not) and then do the work of the counter, again in software.
    If my customer was forcing this on me I would first review the behavour of the hardware and use it to establish the requirements of my code. So if you do not have an EE background, you will first have to learn the hardware so you can write software that does the same thing.
    So if you work for free then you may want to chase down the examples that NI ships for their FPGA targets that implement serial protocols and the like. You may be able to harvest some code and examples from there. If you don't work for free, then you really have to decide if you want to re-invent in software what you can purchase.
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • Read Encoder Position is too slow, why?

    I am controlling a telescope using close-loop servo mode of 7342. What I want is to use get current position of my motor using encoder and since the position value is critical to my telescope motion system I need a fast read back of that value. However, the action is very slow, about 20ms a cycle. Is there any specification on the speed of this function? Is there any solution to speed it up? Are there any new products which is faster than this card?

    The NI-735x family of motion controllers allows you to read the position much faster. The position is read from a shared register that the motion board updates. Since it is a register read, the host takes very little time to get the position information.
    The NI-733x/4x families of motion controllers do send a command to the motion board that the motion board has to process and then return the data. Typically this should only take a few milliseconds or less for a read. But it is dependent on what else the motion board is doing. Things that can effect the time it takes to respond to a host request are number of axes used in arc moves, and short bursts of multiple commands sent to the board. The board has a FIFO that is 16 commands deep. If you send down multiple commands followed by a read position, each command in front of the read command has to be processed first. Which could explain why you are seeing a 20 ms read.
    In NI-Motion 6.1.x we have changed the driver software to help load balance the host request with the rest of the processes running on the board. In most cases this helps performance.
    What version of our driver software are you using? How fast do you really need to get the position information?
    Thanks,
    Rodger S.

  • 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

  • Encoder Positioning

    I am using a FP-Quad-510 an a quadrature incremental encoder (500lines)position of a step motor. My problem is that when I increase the speed of the step motor the encoder reading is not incremental but rather jumps in numbers as the motor moves.

    Hi Toro,
    I'm not shure, but I think the default update rate is 0.1Hz (100ms), so your result look reasonable.
    Fieldpointmodules are not very fast (low scanrate compared to DAQ).
    Solution:
    -increase the update rate by soft- or hardware
    (or slow down your motor speed ;-)
    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 ǝɥʇ'

  • How to Measure Position and Velocity with a Single Counter with myrio

    Hi Everyone , I need your help .
    I got myrio a few days ago for my project which is a electric vehicle drived by wireless mode so first problem faces me that I have encoder and it give me counts (decreasing or icreasing) which I can't convert it to veolcity any one may help , I will be grateful ???????????????????

    Hey Hesham92,
    As you mentioned the myRIO encoder counts pulses.  These pulses will typically come from some type of encode such as a quadrature encoder.
    Look at your encoder datasheet and it should explain how it works (which mode it uses) and the resolution (ie rotation per pulse).    If the encoder is attached to a wheel you can use some simple math to determine how many cm the wheel moves per encoder pulse.
    Let us know if you have questions about this (please also post more info about your setup such as the encoder, what it's attached to and what you need to measure).
    Thanks!
    -Sam K
    LabVIEW Hacker
    Join / Follow the LabVIEW Hacker Group on google+

  • Position, Velocity, Acceleration From Single Encoder, With TDMS Logging

    I'm still a fairly new user when it comes to Labview.  I started to feel comfortable enough to check out TDMS data logging and I'm kicking myself for not using it earlier.
    That said, I am currently reading angular position from an encoder, and estimating it's velocity and acceleration from the sampling rate & encoder resolution.  I'm using an FGV to do all the calculations and I've fine-tuned it to be as accurate as I would like.
    What I would like to do is implement TDMS logging that records position, calculated velocity and acceleration with the Log and Read option of TDMS.  I'd like these to be synchronized with the encoder reads, and I would like them to be handled by a single DAQmx Read vi.  As far as I can see though, you can only read the position information from the encoder.  I tried to drill down into the DAQmx Read.vi to create a modified version so that I could eploit the TDMS logging, but the subvi uses a call library function vi that currently is beyond my abilities. 
    I've been in MAX and I can't create any additional outputs for velocity and acceleration.  It seems like MAX takes enough information to create approximations from the sampling clock and resolution of the encoder.  Why doesn't it (or if it does, how do I implement it).

    What hardware are you using for reading the encoder? I have recently completed a similar project where the encoder was connected to a counter that was triggered by the counter increasing, so that it would only read on new positions, this worked reasonably well and seems like it should work well for your case.

Maybe you are looking for

  • Auditing non-dba user grants?

    Hi, I'm trying to audit if an user grants a privilege on their objects to another user. ex: show user USER is "TESTUSER1" grant select on mytable1 to testuser2I'm trying with "AUDIT GRANT ANY OBJECT PRIVILEGE BY ACCESS" but it only audit grants/revok

  • 9i Version of Designer

    Is there any information about possible new version of Designer and for that matter a new version of Developer. I've heard that release may be due this month to certify it on 9i, this is not the same as a version that supports 9i features and uses 9i

  • WSUS / SUP - Primary site

    Hello, In the SCCM 2012 R2 environment I manage, most of roles are installed on the same server including WSUS/SUP/MP, etc and SQL. What is the minimum number of clients in order to use a dedicated server for WSUS/SUP ? Also, is it possible to migrat

  • Company Portal issue with Windows 8.1/IE11?

    Hi, I recently started to create an Intune environment for my company. We are migrating to Windows 8.1, however I found some issues concerning Windows 8.1 and the Intune company portal.  I'm currently using a Windows 7 laptop, and I don't have any pr

  • CVS checkout timed out, shouldn't have

    In JDev 10g 9.0.5.1, I am attempting to perform a CVS checkout module. This has worked without problem before in both 9.0.5.1 and 9.0.5, however, I am now seeing some strange behavior. First, it takes approximately 2 minutes for the checkout command