LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to use labview to read an encoder using a multimeter?

Hi,
Im new to labview.
Im trying to count revolutions/ calculate rev. Speed using an encoder. The encoder is connected to a keithley multimeter.(A,B,index)
I only found information on encoders and the DAQ.
So how can i count it?
0 Kudos
Message 1 of 25
(3,834 Views)

multimeter cannot be used to measure position from pulse encoder.

Tushar Jambhekar
tushar@jambhekar.com

Jambhekar Automation Solutions
LabVIEW Consultancy, LabVIEW Training
Rent a LabVIEW Developer, My Blog

0 Kudos
Message 2 of 25
(3,826 Views)
I dont need the position. i just need to count the revolutions (isnt that completely different?) I have had some success in converting the measurements into an analog signal and counting the peaks for the index channel. cant i do something similar with A, and B ? the accuracy is rather flexible. i only wish to know the number of revolutions (and revolution speed )
0 Kudos
Message 3 of 25
(3,821 Views)

you can turn the analog signal into a digital one by comparing it to a threshold value (e.g. is this array of analog values greater than "2" --> outputs an array of Boolens).  The logic to turn that into a count is

 

1] check to see if either channel has changed state

    a] if so, compare the current value of channel "A" to the past value of "B"

       i] if A(i)=B(i-1) then increment a counter variable

       ii] if A(i)<>B(i-1) then decrement

    b] if A and B both have not changed state, do nothing to the counter variable

3] the rate of change of the counter variable is your speed in counts/unit of time

4] use the quotient/remainder function and your "tick counts per rev" to get position or integer number of revs.

 

 

0 Kudos
Message 4 of 25
(3,813 Views)

ok, so your answer seems really helpful. though im really new to labview so can you be a little more specific regarding the functions i should use? 

 

by the way, is there a way that labview can "figure out" the threshold value by itself ?

and how do i calculate the rate of change?

should i use a for loop for all of this ?

 

thank you very much 🙂 

0 Kudos
Message 5 of 25
(3,808 Views)

The first questions are: Can the mulitmeter read two channels and do it fast enough to capture all the transitions?

 

If you can capture the data, look at the Min and Max of the array of data.  Make the threshold be midway between them.

 

Lynn

0 Kudos
Message 6 of 25
(3,801 Views)

Lynn -- good point about the speed of the meter.  Re: the averagin the min and max, I like to plot the data and visually pick the threshold (or use statistics) as a single point of noise in the min or max direction can significantly skew the min or max reading.

 

Sitz -- what kind of hardware are you using to get the data into LabVIEW? Please let us know the DAQ hardware and the meter you mentioned.

 

Yes, you would use a FOR loop and shift registers to do the logic surrounding the count. I've attached a VI, all set up to act as a sub-VI in your program if you can get the analog data in as an pair of arrays.   I sounds like you're new to LabVIEW -- please take the time to understand what I did and why. 

 

As for rate of change, it is the change in "count" divided by the change in "time".  Literally (countEnd-countBegin)/(timeEnd-timeBegin) to get the average rate of change over the entire time interval in question.  It's up to you to convert the count into something meaningful (e.g. use "200 counts per revolution" to convert the "count" data into "revolutions" data).

 

0 Kudos
Message 7 of 25
(3,795 Views)
I am using keithley 2000 multimeter, link below:
http://www.keithley.com/products/dcac/dmm/broadpurpose/?mn=2000
i connect to the computer via gpib to usb.

Its my first time working with these instruments so im probably looking at it all wrong.
I was unable to open the vi you sent. Its sais that its from a future version. Im using labview 2009. Can you save it in a compatible file and poat it again?
Thank you.
0 Kudos
Message 8 of 25
(3,771 Views)
Forgotvto mention the soeedv- 2000 readings per second.
Is that good enough?
0 Kudos
Message 9 of 25
(3,770 Views)

Haven't had a chance to look at the specs thouroughly, but from your mention of GPIB I'm guessing you're transferring the analog data that way.  As for 2000 samples/second being enough, that would depend on the motor speed you are trying to quantify and the number of encoder ticks per revolution.   The higher the speed, the faster you'll need to sample to accurately describe the signal.  Same for encoder resolution -- more ticks means a higher sample rate required for a given motor speed.

 

I will save the VI as <=2009 and re-post later.

0 Kudos
Message 10 of 25
(3,754 Views)