Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

Quadrature encoder with a non-NI board

I am attempting use an encoder with a non-NI board (Measurement Computing) and I am unsure how to interface the encoder output from the board with LabView. I have the VIs for the board which allow the board to interface with LabView,. I essentially need a VI to decode the quadrature, the ones in the tutorials were not very helpful or insightful.
0 Kudos
Message 1 of 13
(6,186 Views)
 

Hello Mystery,

I was poking around the Measurement Computing website and found a few things that could help you out.  The first was a knowledgebase on how to configure and wire a quadrature encoder.  Here is also a link to the product manuals site for more information regarding your specific device.  I also found the manual for the Universal Library for LabVIEW that provides some more information on what each VI in the example programs does.  Hope this helps! 

Regards,
Browning G
FlexRIO R&D
0 Kudos
Message 2 of 13
(6,164 Views)
Let me rephrase the problem. I am very familiar with Measurement Computing and the information contain on their website. The problem that I am having is interfacing the encoder to Labview. MC gives me a generic VI for the board: I am using the Digital Input VI. What I need is a VI for the board VI to sit in to process the encoder quadrature. I have so far been unsuccessful in generating the VI myself and I was wondering if their might be a tuturial or an example VI that would be able to help me. 
0 Kudos
Message 3 of 13
(6,155 Views)
 
 

Hello Mystery,

I looked through the help file for the Universal Library and it indicates that you will need to refer to counter chip manufacturer’s data sheet to perform anything more complicated than the simplest counting VI.  The links to the data sheets can be found in the help file.  The link Encoders and Quadrature Encoder Example DAQ Personality both provide some starting information on how encoders work.  The second link focuses on LabVIEW FPGA, but Figure 3 provides some great insight on how to monitor the counter registers to determine direction and position. 



Message Edited by BrowningG on 01-30-2008 05:51 PM

Regards,
Browning G
FlexRIO R&D
0 Kudos
Message 4 of 13
(6,142 Views)
Um, I am aware of that. Here's the deal, I have the encoder connected and the MCCDAQ LabView vi is functioning properly so it gives me an output of the counter. The output of the counter is all it gives me. My problem is that I am not sure how to translate the counter output into angular position and angular velocity. All of the tutorials, examples, etc all use the Ni-DAQMX to take care of these things for you. Unfortunately, NiDAQMX is completely incompatible with the board that I am using. Suggestions? 
0 Kudos
Message 5 of 13
(5,615 Views)
 

Hello Mystery,

Take a look at the section “Velocity and Acceleration Calculations” in this devzone [broken link removed].  While the article itself applies to CompactRIO, the equations used in the above section can help you determine how to convert the counter output into a velocity measurement. 

Does the counter value increase when you rotate the encoder in one direction and decrease when you rotate in the other direction?  This is essentially position measurement.  By knowing the number of ticks per revolution as well as the starting position of the encoder, you can determine the current rotation position.  For velocity, there is a little more to the measurement.  The concept relies on taking a counter measurement in a periodic manner.  Then you can use the number of encoder pulses that have occurred over that period of time to calculate velocity.  The document I linked about shows how to convert the number of encoder pulses over a fixed period of time into RPM which can be later converted into angular velocity.  Hope this helps. 

Regards,
Browning G
FlexRIO R&D
0 Kudos
Message 6 of 13
(5,601 Views)
All I am trying to accomplish is to get the encoder to register position and velocity. I looked at the tutorial and I created a block diagram similiar to the one shown in figure 8 using the MCI vi for the counter section. Unfortunately, I cannot get an accurate reading out of it. The block diagram has little to no comments, I can't even tell if I connected to the correct output on the Tick Count.
0 Kudos
Message 7 of 13
(5,479 Views)
You know, I think I need a second opinion directly on the program. I think that maybe I have been staring at the computer monitor for too long. The vi is essentially the one in the tutorial. All I did was alter it a little for my purposes. The upper section of the block diagram is the equavalent counter from MCCDAQ, which outputs the counter value. The counter rolls over at the CPR value. I cannot for the life of me get accurate readings. I set the CPR to 132500 and the velocity interval to 100000uSec which will bring it closer but not exact. It is strange, though that if the RPMs of the motor changes, the velocity measurement does not update itself.
0 Kudos
Message 8 of 13
(5,476 Views)

Hello Mystery,

You want to make sure to set your velocity interval to a long enough period so that your measurements do not become erratic.  Basically you are taking the total number of counts over a period of time (velocity interval) to determine the average velocity over that time period.  The shorter the time period, the more often the velocity measurement will change.  However if you choose a value that is too short, the reading can become erratic since adding or dropping a single edge per time period could result in a large count error (this would translate to a large velocity error). 

Is the value of counts per revolution the actual number of points on the encoder, or is it the terminal count for your counter?  This value needs to be set to the number of points on the so that the velocity measurements can be properly made.  You might also consider having something in your code to see if the terminal count on the counter has occurred.  That way if the terminal count occurs during a single velocity interval you will not lose the count information (which would result in incorrect velocity measurements). 

Regards,
Browning G
FlexRIO R&D
0 Kudos
Message 9 of 13
(5,445 Views)

The 132500 counts per revolution is the number the MCC vi spits out for the counter value after one full rotation of the shaft. The application that the motor is being used for is low RPMs (less than 50 RPMs). The spec sheet for the encoder does not specify a CPR. I have specifically noted that the tutuorial says its is for high velocity applications only.

I don't understand what you mean in the second part of your response. It does not make sense.

In the vi, what terminal do I connect to on the tick count? I think that part of the problem may be that I am connected to the wrong terminal or else the time interval is wrong.

0 Kudos
Message 10 of 13
(5,432 Views)