Can I Use the NI-9361 Module for Measuring the DC Motor Phase Shift of the Encoder Signals?

Updated Dec 29, 2022

Reported In

Hardware

  • NI-9361
  • C Series Voltage Input Module

Issue Details

I want to measure the phase difference of the Encoder A and B signals with the NI-9361 C Series Counter Input module. I have written a simple program that should measure this difference (which should be 90° according to the characteristics of the encoder signals), but I receive incorrect data.
Is it even possible to reach the correct result?

Solution

The Encoder is a device used for measuring and calculating the motor's speed and rotation. Usually, it has 3 outputs, A and B signals, for measuring the rotary speed and the direction of the motor), and a Z-Signal or Index Signal for calculating the number of rotations of the motor.
image.png
The phase difference between A and B signals is always 90° (there should be also counted the possible phase error of the device itself).
image.png
The signals themselves are digital signals, and the counter signal's characteristics are close to the digital signal's characteristics. The methods of measuring the phase are based on analog signal characteristics when there are real and imaginary components in the signal, but the digital and counter signals do not contain an imaginary component, so it is not possible to measure the phase shift with the NI-9361 Counter Input module.
As an alternative, you can use Analog Voltage Input Module and measure the phase shift with it. The measurement accuracy is dependent on the bitness of the device and the number of samples to measure during one iteration of the loop. You can use the attached VI as a base for calculating the phase shift of the encoder signals.