04-01-2012 08:15 AM
04-01-2012 10:04 AM
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
04-01-2012 10:49 AM
04-01-2012 02:04 PM
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.
04-01-2012 02:50 PM
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 🙂
04-01-2012 04:56 PM
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
04-01-2012 06:09 PM
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).
04-02-2012 07:26 AM
04-02-2012 07:27 AM
04-02-2012 11:57 AM
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.