Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

Quadrature encoder with a non-NI board

Hello Mystery,

The terminal count for your counter is the maximum count of your counter before the counter rolls back over to zero.  Since your counter could roll over to zero during one velocity interval, you would get an incorrect count during that measurement period if you did not keep track of the counter value rolling over.  I asked because I thought it was strange your counter was rolling over at the same value as your counts per revolution value. 

As the RPM value of the motor changes, does the count value change?  If the count value does not change, then your VI will not note a change in velocity or acceleration. 

This VI is ideal for fairly high speed applications because it is counting the number of edges that occur during a known period of time.  If only a few encoder pulses occur during one period of time, large errors can result if an edge is missed or added.  For example if you acquire 4 edges during a single measurement period and then the next measurement period you acquire 5 edges over that same period of time, you will have a 20% difference in velocity measurements.  By increasing the RPM of the measurement, you will increase the timing resolution of the measurement.  This VI will return the average of your speed over the velocity interval, so if the average speed during the velocity interval is not changing you will not see a changing velocity measurement. 

Regards,
Browning G
FlexRIO R&D
0 Kudos
Message 11 of 13
(1,425 Views)
Since this discussion has spanned a page already, let me restate the problem. I can measure angular position with the encoder. I have the number of points locked at 132500 so that it would roll over it reached that number, since that is the CPR. I believe that I may have misstated the application of the encoder, initially. You are assuming that in my application I am attempting to measure velocity because the shaft is rotating a full 360 degrees and moves at a set number of rpms; this is not the case. The shaft I am using rotates 180 degrees, stops, and then rotates 180 degrees in the opposite direction, and then repeats. It never makes a full rotation. I am attempting to measure the angular velocity of the shaft in degrees per second.
0 Kudos
Message 12 of 13
(1,416 Views)
 

Hello Mystery,

 

Does the counter count up when you rotate the encoder in one direction and count down when you move the other direction?  If so, whenever you read the counter, this is the current position of the encoder.  Each tick on the encoder will represent an angular position.  If you sample at regular intervals (using a sample clock if hardware timed counting is possible), the difference between two counts will represent an angular velocity.  The count change over a period of time will represent an angular velocity.  This is still the same functionality from the devzone  I sent you before.  The equation will need to change to represent angular velocity (the tutorial goes over RPM).  Please note that if the average velocity over the measurement period (from you VI it looks like 5 seconds) remains constant, the velocity measurement will not change. 

Also, take a look at the Data Acquisition (DAQ) Hardware Page.  On this page you can view many of the NI DAQ products.  From there you can sort by measurement type and form factor.  Converting a quadrature encoder input to angular position is built into the DAQmx driver and NI even has several examples on how to do this.  With many of the devices you can enable a buffered position measurement (requires hardware timing) and use this to provide more accurate velocity and acceleration measurements. 

Regards,
Browning G
FlexRIO R&D
0 Kudos
Message 13 of 13
(1,401 Views)