LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Reading the Pulse Count for Incremental Encoder

Solved!
Go to solution
Solution
Accepted by topic author rishab_kr

Hi rishab,

 


@rishab_kr wrote:

the status output 0000010 indicates that there is an error detected in quad-phase mode.

 

what changes I shall ensure for the proper operation of the encoder in quad-phase mode


That flag indicates an invalid state in quad-phase mode: you need to detect that invalid state to know when/why it happens. Once you know this you can handle the problem!

 

(We don't have your hardware so you need to debug on your own. We can only run the encoder VI with simulated signals: as long as the signals simulate regular/expected encoder behaviour the encoder VI will also output correct counter values…)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 41 of 50
(398 Views)

The errors which it is throwing during the rapid transition, which results inappropriate motor velocity reading. I am not getting how to rectify the Encoder Error status; encoder configuration and status is being dealing with bits. It is encountering the error when the current value of both the signal is totally different from the previous value. let say the previous phase is TT and current phase is FF it will throw an error. 

I have been trying this from past 2 weeks, as far as my expertise and limited time is concern. I am looking for its solution, I am trying to count the pulses of incremental Encoder using SbRIO-9627.   

0 Kudos
Message 42 of 50
(364 Views)

There are two other vi's that are not present in your code.  As such, I have no concept of their true functions.  

 

  1. Why do you build an array of 4 booleans then expect to separate out 5 booleans?
  2. Why does direction matter for the case statement?
  3. Why does the state of Channel A when enabled output backwards or not backwards?  It will only reflect the state of Channel A if direction is positive.
Help the Community (and future reviewers) by marking posts as follows:
If it helped - KUDOS
If it answers the issue - SOLUTION
Message 43 of 50
(358 Views)

This is the Customized FPGA code of myRIO which I am taken as a reference for building Encoder counting VI for SbRIO.  Please directly open the Encoder.vi, there you will find it. 

0 Kudos
Message 44 of 50
(355 Views)

There is no one who have used Incremental Encoder using SbRIO-9627. 

Can anyone help with the VI ?

0 Kudos
Message 45 of 50
(341 Views)

Hello community members,

 

I have been struggling to take the reading of IHR3-4096 Faulhaber Incremental Encoder, I tried using an myRIO customized sub VI code for Encoder, but it is not giving correct values most of the time when there is a sudden change in the pulses. Since I have been trying this from past 3 weeks, I am not able get the accurate reading of velocity. 

 

I need your help in getting a proper VI which counts the pulses of phase A and B of the Encoder. 

I am also attaching the myRIO Encoder FPGA VI which, I was using as a reference to make a usable VI for SbRIO-9627. There I was failed to understand the configuration of encoder and status. 

0 Kudos
Message 46 of 50
(376 Views)

Hi Rishab,

 

I don't have an answer to your question. However, this board (the LabVIEW Project Providers board) is not the right board for your question.

 

You have better chances of getting a reply if you post the question again in the LabVIEW board: https://forums.ni.com/t5/LabVIEW/bd-p/170 .

0 Kudos
Message 47 of 50
(342 Views)

Hello community members,

 

I have been struggling to take the reading of IHR3-4096 Faulhaber Incremental Encoder, I tried using an myRIO customized sub VI code for Encoder, but it is not giving correct values most of the time when there is a sudden change in the pulses. Since I have been trying this from past 3 weeks, I am not able get the accurate reading of velocity. 

 

I need your help in getting a proper VI which counts the pulses of phase A and B of the Encoder. 

I am also attaching the myRIO Encoder FPGA VI which, I was using as a reference to make a usable VI for SbRIO-9627. There I was failed to understand the configuration of encoder and status. 

 

Here is the sequence of the file is Sub VIs > Encoder > Encoder.vi

0 Kudos
Message 48 of 50
(387 Views)

Thank you for attaching some of the VIs in your LabVIEW Real-Time Project.  You noted that you were using some code designed for the myRIO for the Encoder logic, but then talked about developing code for the sbRIO-9627, which (almost certainly) use other sub-VIs.

 

In any case, we do not see the entire Real-Time Project.  Can you attach the entire LabVIEW RT Project that you are trying to run?  I'm assuming that you have a folder that includes the LabVIEW Project file (maybe called Encoder.lvproj -- in any case, it has the extension .lvproj) and all of the VIs and sub-VIs that you included with the Sub-VI zip file you attached.  It may have almost everything we need to see except the Project File, which shows us how the Host (PC code), Target (sbRIO or myRIO code) and FPGA (FPGA code) fit together.  Make it clear to us whether you are attaching code to be run on the sbRIO or the myRIO.

 

Bob Schor

0 Kudos
Message 49 of 50
(346 Views)

Here, I am attaching the entire file which consist of one host file, one FPGA file and one myRIO customized file which include all the dependencies for the FPGA. 

 

0 Kudos
Message 50 of 50
(316 Views)