Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

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

0 Kudos
Message 1 of 4
(6,201 Views)

Hi Sarah,

 

What card do you have in your PC that is connected to the SCB-68? The SCB-68 is a connector block which effectively expands the 68 pin cable to individual screw terminals to make it easier to interface with bare wires. For this to connect to your PC, you will need to have a Data Acquisition card in the PC. In order to find this out, either open the Device Manager and expand Data Acquisition Devices, or open Measurement and Automation Explorer (MAX) and expand devices and interfaces. Once you have found out what card you have in your PC then we should be able to help you interface your pendulum. 

 

Kind Regards,

Jas.W 

Jason W.
Applications Engineer
National Instruments UK & Ireland
0 Kudos
Message 2 of 4
(6,173 Views)
Thanks for that Jas - I'm using a E6D-CWZ2C rotary encoder connected via a SCB-68 connector to a NI PCI-6024E card.

 

I need to measure the periodic time for each swing of my pendulum as the mass of the pendulum continuously reduces.

 

I’ve been thinking that the simplest way to do this is to monitor the A & B outputs from the encoder and record the time taken from the point where the B output lags the A output (pendulum swinging clockwise) to the point where the B output leads the A output (pendulum swinging counter clockwise).

 

If I feed the A output into the clock input of a D-Type flip flop and the B output into the Data input of the D type, then the outputs will reflect the direction of the pendulum. Each output will start a timer. However, if I am to do it this way, I am not sure how to record and log the times from the timers?

Furthermore , I’m not even sure how to set up a D-type flip-flop in Labview. I have tried using the Help files but to no avail.

 

Can anyone tell me if I’m going along the right track, or if there a simpler way of  measuring the period for each swing?

 

Thanks,

Sarah
0 Kudos
Message 3 of 4
(6,073 Views)

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
0 Kudos
Message 4 of 4
(6,070 Views)