Real-Time Measurement and Control

cancel
Showing results for 
Search instead for 
Did you mean: 

reading Speed of the vehicle by encoder

Solved!
Go to solution

Goodmorning Labiview Users,

 

I Need to get the speed information from a encoder put in a eletric vehicle. It is a quadrature encoder (64 pulse) with two signals: A and B (and obviously gnd). My equipment is:

-Compact Rio ni9024

-module NI 9401 (FPGA)

I wasn't able to find an example for my situation, 

I will be you thankful if you help me. Thanks, cheers.

 

 

 

0 Kudos
Message 1 of 2
(5,436 Views)
Solution
Accepted by topic author antoniolc

In LabVIEW 2012, there is an example for a Quadrature Decoder with Position and Velocity on a CRIO. I have attached a screenshot incase you do not have access to it. 

 

The example uses an index input, however if you are not using it you can wire that output to a constant false and the code will work just fine. 

 

On every clock cycle, the FPGA will read the quadrature inputs. If it notices a change, it will calculate the direction (based on the last values on the inputs) and either increment or decrement the position. It will also check the tick count of the FPGA to compute how many ticks are passing between the counts of the encoder. You can then read these indicators in your RT program.

 

You will need to setup your project accordingly so that the encoder inputs are mapped to the pins of your device. This VI should give you a very good jumpstart into the problem.

Message 2 of 2
(5,426 Views)