Using a rotary angular encoder to measure period of pendulum

Hi,
I'm new to Labview (I hope I've posted this in the correct section) and am trying to measure the period of a physical pendulum. I'm using an Omron rotary angular encoder (E6D-CWZ 2 C) and the SCB-68 NI card. Basically I'm trying to interface my pendulum to the PC in order to analyse the motion.
I'd appreciate if anyone has any advice or can point me to a tutorial that might help.
Thanks,
Sarah

Hi Sarah,
Interesting application--I think your best best is to use the counters on the 6024E as follows:
1.  Configure a Count Edges Task (the E Series cards don't directly support quadrature encoder tasks).
2.  Use the A output as the edge to count, and the B output as the direction control line.
3.  Set an initial value such that the bottom of the arc is your "0 reference" (e.g. if you are starting the pendulum 1000 encoder ticks above the bottom of the arc then your initial count should be -1000).
4.  Every time the counter rolls over it will produce a pulse on its internal output.  This will be every time the pendulum reaches the bottom of the arc.
5.  You can perform a period measurement using the 2nd counter on the 6024E.  The line that you want to measure will be the other counter's internal output.
This isn't the most straightforward configuration so you should probably start out by combining shipping examples.  I would start with the following two examples (which can be searched for in the Example Finder by navigating in LabVIEW to Help >> Find Examples...)
Count Digital Events.vi
Meas Pulse Width-Buffered-Cont.vi
I would start out by getting the Count Digital Events example to work so that the value is 0 every time the pendulum reaches the bottom of the arc, then you can try adding in the Meas Pulse Width example to perform the period measurement.
Best Regards,
John Passiak

Similar Messages

  • 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 

  • 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

  • I want to measure rpm using 100 ppr incremental encoder via digital input

    i want to measure rpm using 100 ppr incremental encoder  via digital input max speed (4000 rpm)
    am using 9178 c-DAQ chassis and 9426 digital input module
    pl provide me example code for this

    Hi asaccullo.
    The recommended settings for encoders are using the counters in the daq cards. Using digital I/O’s is not recommended, the encoders send digital signals but one of the main differences between using digital IO vs counters is that counters are designed to handle these type of events.
    Here I found several examples in ni.com/code that you might check:
    Imitation Quadrature Encoder with DAQmx Counter Tasks
    Use Counter Frequency to obtain an Encoder Rotational Speed
    An Elvis is a daq device, so this should work for you.
    I also found an example for myDAQ, it uses the DIO but with a counter task in the set up.
    Regards,
    steve.bm
    AE | NI

  • Can I measure period with USB 6501?

    Hi,
    I was told that I can use the one counter in the NI USB 6501 to measure period.  So, I wrote this little VI, modeled after the VI I have that measures encoder period using the counters built into the NI cDAQ 9174 with the NI 9401 digital I/O module.  I have my encoder wires GND and 5VDC on terminals 1 and 2, respectively.  Also, I have encoder channel A and Channel B wires connected to terminals 9 (P2.7) and 24 (P0.7) respectively.  With the MAX, I can count edges with this wiring.  The purpose of this VI is to display an average value of 25 period measurements of the encoder.  The encoder (120 cpt) is turning at about 2-5 rev/second, so, not that fast, maybe a total of 500 period per second; should be easy for this counter.  I'm just spinning it with my finger, so, not that fast.
    Please advise how to use the USB 6501.  I can't find any wiring instructions, other than the pinout, but, the pinout doesn't tell you which channel is the counter gate on the USB 6501, so, I found a response on MAX at channel 24.
    When I run this, the array is correctly initialized to 0.5, but, then I get this error, 200431. I found some things on the forum that suggest I cannot measure period, that I can only count edges.  Should I throw this 6501 away?
    Thanks,
    Dave
    Attachments:
    USB 6501 error.docx ‏24 KB
    USB 6501 period measurement.vi ‏26 KB

    The 9178 also only has 4 counters.
    Do the 5 period measurements actually have to take place at the same time?  Sometimes it might make sense to cycle through the channels to reduce the number of counters used (you wouldn't have to rewire connections or anything as the input terminals are software-defined).  Switching from channel to channel in software should take on the order of ms depending on which hardware you end up using.
    The 9171+(9401/9402) is a relatively cheap way to add additional counters to a system as the 9171 chassis has 4 counters just like the 9174 and 9178.
    Best Regards,
    John Passiak

  • Custom scale with Create Channel CI Position Angular Encoder

    Hi!
    In my application I use angular encoders for position measurement. I programatically create channel (task) using DAQmx Create Virtual Channel, CI Angular Encoder instance. Prior to that I use DAQmx Create Scale to create custom scale for the measurement, to convert from degrees directly to meters. The problem is that when I use the task (Start Task for instance) I get the following error message:
    Error -200378 occurred at DAQmx Start Task.vi:4
    Possible reason(s):
    Measurements: Custom scale specified does not exist.
    Custom Scale: RowCounter
    Task Name: _unnamedTask<66>
    Maybe somebody can help me out with this one.
    I use the same principle to create custom scales for AI measurements, and everything works without any problems. I know the scale is created properly, as I tried saving the custom scale to max after I create it. I then used the scale without a problem when I wired it as a constant to the custom scale input of the DAQmx Create Virtual Channel vi. It only gives me problems when I create it dynamically, using Create Scale vi.
    Some technical info: I use USB-6210 Daq card for signal acquisition.
    I will appreaciate any help!
    Jernej

    Hey!
    The error message I get is as follows:
    Error -200378 occurred at DAQmx Start Task.vi:4
    Possible reason(s):
    Measurements: Custom scale specified does not exist.
    Custom Scale: RowCounter
    Task Name: _unnamedTask<66>
    I use USB-6210 Daq card for signal acquisition. The error occurs right after the DAQmx Start Task.vi on the counter task.
    As I said, the code runs sometimes without problems and then sometimes it returns an error. I noticed that if I run the CustomScaleProblem.vi on its own it runs ok. When I open the project with mine application, from where I extracted CustomScaleProblem.vi part, and then try to run the CustomScaleProblem.vi, it stops working. It looks like when I open the project it allocates some space which is in conflict with the scale part of the code. Then if I close the Labview environment and open CustomScaleProblem.vi and run it, it runs again without any problem. Well, for now I did a work around the problem by saving the scale in the program and then using it. This approach works fine.
    About the arm start trigger. I use it because I dont want the counter to start counting before the AI task starts. I noticed that if I use the AI as a start trigger, and I move the encoder before AI starts, the counter will not start with 0, but will start with a number indicating the encoder movement before the AI start. Is that the right approach if I want the encoder to start
    counting from 0 when AI starts?
    Thanks and kind regards
    Jernej

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

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

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

  • How to connect an angular encoder to NI9401 for velocity?

    I have an angular encoder connected to a NI9401 daq. I put line A of the encoder to one of the digital inputs and the same with line Z (line B is not conected because direction is not relevant). However I'm having a hard time trying to get the velocity because I haven't been able to count the pulses and all the examples that I have seen they use counter that the NI9401 doesn't has.
    Can anyone help me????

    Hello,
    What system do you have the NI 9401 module in … a compact DAQ or a compact RIO?  Please provide this information.  If you have the NI 9172 compact DAQ chassis, then placing the NI 9401 module in slots 5 or 6 will give you access to the counters on the back plane of the chassis.
    NI cDAQ-9172 User Guide and Specifications
    Samantha
    National Instruments
    Applications Engineer

  • Measure Period with error out.vi

    I am using LV6.0. Can Measure Period With Error Out be found in the functions panel? If not where it is? If not there can it be imported into LV6.0?

    labview1958,
    Are you looking for a specific VI called Measure Period with Error Out.vi or are you asking about any general function that can be used to measure the period of a signal and includes error handling? If you are looking for a specific VI, I'm unaware of it, so I won't be much help there. If you're looking for any function to do it, have you looked at the VIs called Measure Pulse Width or Period.vi or Pulse Width or Period Meas Config.vi? They are located in the Data Acquisition>>Counter palette. The Measure Pulse Width or Period.vi does not include error handling, but it would be extremely easy to add it. The Pulse Width or Period Meas Config.vi DOES contain error handling, but it only configures the counter to measure the period, it doesn't actually measure it. These, of course, are for TTL signals coming into your hardware device. If you are reading waveform data from a file and want to calculate the period of that signal, these won't do much for you. So what exactly are you wanting to take a period measurement on, a physical signal, physical signal data points from a file, or some other method?
    Tyler S

  • Measuring period of a pulse

    Hi
    I m measuring period of a pulse coming from a magnetic proximity sensor. There r two porblems.
    1. I want to monitor the data coninuosly in a while loop but the moment it waits for pulse it doesn't stop and hangs for some time....
    2. While monitoring the data , sometimes high values appear ....... but these values are unwanted. Once if i want to filter out thse values and see only the exact pattern , how to make it...
    PLz. do answer these queries at earliest......
    Thanks and regards
    GNS

    Hi,
    To monitor data continuously without hanging:
    1. Configure your counter to do "buffered period measurement"
    2. In your loop, query the counter for "available points" using "Counter Get Attribute.vi"
    3. When == 0, do nothing. When > 0, read that # of points from the counter buffer. This way, you're never asking for any data that isn't already there and your loop won't ever have to hang and wait for it.
    4. Accumulate/store/graph your data according to the needs of your app.
    To filter out unwanted high values:
    First, I'm assuming that your "high values" are high frequencies, thus small periods. If so, these may be caused by sensor and/or electrical noise. The best thing to do first is try to reduce/eliminate the noise at its source. Failing that, there *may* be a way to make good estimates of the correct data, but it could get pretty tricky. Here's an outline of a way to think about and deal with the simplest case -- where you know the expected measured frequency and it's very nearly constant over time.
    The characteristic of such a noise glitch would be a a pair of transitions in rapid succession, either low-->high followed by high-->low or vice versa. Either way, you'll pick up one of those transitions in your buffered period measurement. The trouble is that it may happen anywhere within the nominal period, possibly more than once.
    Let's first look at a case where the nominal period is 1 msec +/- 20% and there is one glitch of duration 0.1 microsecond, occurring at the 70% point of the real period. The measurement should show one period of duration 1.0 msec, but the noise glitch will cause you to receive instead two periods of duration 0.7, and 0.3 msec.
    The simplest correction would be to simply trash all measurements outside the acceptable range of [0.8, 1.2] msec, including these two. Note however that a noise glitch occurring at the 90% point would lead you to trash the 0.1 msec measurement, but believe and keep the 0.9 msec measurement. Note also that if noise glitches are distributed randomly in time, you would end up keeping 40% of such erroneous data (glitches in either the first 20% or final 20% of the real period).
    Another correction would be to estimate the period interrupted by the glitch. Start by assuming no more than one glitch per legitimate period. Since the glitch subdivides the true period into a pair, you can re-create the true interval by summing the pair of periods. The catch is to identify which pair needs summing.
    The smaller of the pair will show a period <= 50% of the real period, and can be identified. However, the larger of the pair cannot always be identified. The larger of the pair can be anywhere from 50%-99.999% of the real period and may located either right before or right after the smaller of the pair. If you wish to recreate the real period, you'll need to make a mathematically educated guess about which adjacent period to consider as the "larger of the pair."
    This is tricky enough as a post-processing exercise, but it's even worse when you process the data as it comes in. Then there will be times where the last element in the buffer is the "smaller of the pair" and you don't yet have the "larger of the pair" data. There will also be (rarer) times when the last element is the "larger of the pair" but you can't yet know that it needs to be summed with the next "smaller of the pair" measurement.
    Now consider a case where there could be two or more glitches inside true period. You'll need to evaluate the best choice of summing any two, three, four, etc. consecutive periods to reconstruct the real period. {note that for n glitches and a +/-20% acceptance criteria, then (2/5)^n of the glitched intervals will produce one measurement within the +/-20% bounds.} In such a scenario, I would advise working *really hard* on eliminating the glitches at the source.
    Whew, that's a mouthful and a half! Reply if you'd like an outline for an alternate approach, involving buffered semi-period measurement...

  • Counter roll-over when measuring period

    Hi,
    I'm using PCI-6251 counter 0 to continuously measure the period of a signal, and I notice there are occasionally  error readings. Since the counter can roll over when it reaches 2^32-1, I need to know what will happen to the period measurement when counter roll overs. Would anyone please help me?
    Thanks.
    David

    The count value will simply wrap-around back to 0 and then continue to increment.  I can think of a few ways to handle this:
    1. Specify a slower timebase for the measurement.  If you go from, say, 80 MHz to 100 kHz, it'll take 800 times as long a period to cause rollover.  This method is pretty simple to implement, but not all apps can accept the loss in precision.
    2.  You can use a 2nd counter to be sensitive to the 1st counter's "terminal count".  This gets a bit complex, so you may need to do more research on some of the terms that follow.
    An internal pulse signal is generated on the board when the 1st counter rolls over from 2^32-1 back to 0.  It's commonly known as "terminal count" or TC.  You'll need to configure a 2nd counter that also measures periods of your external signal, but which uses those TC pulses as its timebase signal.  You may need to fiddle with the "Duplicate Count Prevention" property on the 2nd counter so that it will buffer values of 0 during the majority of intervals where no TC pulse occurs.  During the intervals where rollover happens, the 2nd counter will count how many times it happens.
    You would further need the 2 counters to be started off a common "arm start" trigger to keep their data sync'ed.
    3.  Software method.  You can query the DAQmx Channel property "Counter Input -> General Properties -> More -> Terminal Count Reached".  When you get a 'True' output, the property resets such that subsequent calls will return 'False' until the next rollover occurs.  The problem here is trying to correlate this software-detected rollover with a specific period in the 1st counter's measurement buffer.  You'd probably also need to be querying and tracking the DAQmx Read property for Total Samples Acquired both before and after the TC event.  Even then you might not always be able to determine unambiguously which interval had the TC event.
    -Kevin P.

  • Which table i can use to get standard price of previous periods ?

    Hello, all.
        Which table i can use to get standard price of previous periods ? Example, current period is 2008/11, i want to get the standard price of period 2008/05 .
    Thanks.
    Xinzhou.

    Look in MBEW and MBEWH.
    Regards

  • Can any one tell me when i use adobe flash media encoder how can i see my live vidoes on flash media

    can any one tell me when i use adobe flash media encoder how can i see my live vidoes on flash media server . thnx

    Flash Player version 10.1.102.64 is the last version available to PPC Mac users. However, this Flash version won't work for many videos on Facebook, YouTube and other sites. Adobe's latest version, 10.2.x or later, is only for Intel Macs. Adobe will not provide a newer Flash version for PPC Macs.
    The message requesting that you download Adobe Flash Player takes you to Flash Player requiring an Intel processor. Doesn't work on a PowerPC processor. I found a hack, installed it & it works with Firefox, TenFourFox & Safari.
    Download this http://www.steelbin.com/FPforFBPPC.zip to your desktop, unzip it, and replace the current Flash Player plug-in which is in your main/Library/Internet Plug-Ins folder, (not the user Library). Save the old one just in case this one doesn't work.
    Hack Allows PowerPC Macs to Access Flash 11 Content
    http://lowendmac.com/ed/royal/12sr/flash-11-and-powerpc.html
     Cheers, Tom

  • [svn:fx-trunk] 8531: If using an embedded font, need to measure the text with it so that if auto-sizing, the correct amount of space is allocated.

    Revision: 8531
    Author:   [email protected]
    Date:     2009-07-13 12:25:57 -0700 (Mon, 13 Jul 2009)
    Log Message:
    If using an embedded font, need to measure the text with it so that if auto-sizing, the correct amount of space is allocated.
    QA Notes:
    Doc Notes: SDK-22205.
    Reviewers: will be Gordon
    Ticket Links:
        http://bugs.adobe.com/jira/browse/SDK-22205
    Modified Paths:
        flex/sdk/trunk/frameworks/projects/spark/src/spark/primitives/RichEditableText.as

    Revision: 8531
    Author:   [email protected]
    Date:     2009-07-13 12:25:57 -0700 (Mon, 13 Jul 2009)
    Log Message:
    If using an embedded font, need to measure the text with it so that if auto-sizing, the correct amount of space is allocated.
    QA Notes:
    Doc Notes: SDK-22205.
    Reviewers: will be Gordon
    Ticket Links:
        http://bugs.adobe.com/jira/browse/SDK-22205
    Modified Paths:
        flex/sdk/trunk/frameworks/projects/spark/src/spark/primitives/RichEditableText.as

  • Error Useing with LSMW recording Maintenace Plan Schesule period update

    Hi Experts,
    I have one quary i am using Lsmw recording methode to update schedule period of around 4000 ,aintenamce plans, i created Lsmw but it is reading when i want batch input session Overview time i get following message. please help me
    "LEAVE TO TRANSACTION" 1 is not allowed in batch input
    Message no. 00352
    Diagnosis
    The specified system functionality cannot be used in batch input mode.
    Procedure
    Change your application so that it can be used in batch input mode.
    Thanks and Regards,
    Raj

    Hi,
    It seems thereis a problem with the recording.
    Please try to create a fresh trecording and the excel file which you are using check it also.
    regards
    Amit Parkhi

Maybe you are looking for