LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Reading the Pulse Count for Incremental Encoder

Solved!
Go to solution

Hi GerdW,

Thanks for you constant valuable time. 

I followed the way you said but the counter values is not increasing, right now I am manually switching the Pin A an Pin B value from the front panel nothing changed in the counter value. 

tner.PNG

asdfas.PNG

 

 Does it is worked for you ? 

0 Kudos
Message 31 of 50
(123 Views)

Hi GerdW, 

Thanks for your constant support.

I followed the way you suggested but the counter value does changed. What I did is I manually Changed the Pin A and Pin B value from the front panel while running the VI. 

 

 

tner.PNG

asdfas.PNG

 

does it is working for you ?

0 Kudos
Message 32 of 50
(123 Views)
Solution
Accepted by topic author rishab_kr

Hi rishab,

 


@rishab_kr wrote:

I followed the way you suggested but the counter value does changed.


Why do you think setting Rest to TRUE (all the time) is a good idea?

 

What happens for Reset==TRUE? Please examine the code on your own…

(The code is simple and quite easy to understand. Do some debugging to understand the code.)

Best regards,
GerdW


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

Hi GerdW, 

Thanks for your constant support.

 

After working a lot more days on this I have successfully able to validate the number of Increment. 

 

As already said I am using Faulhaber Motion Manager 6 to give the command to the motor, I used my motor in Profile Position mode which basically give input to motor as (Increments) and I was able to read the same reading through my Host code of Encoder.

 

I encountered to problems,

 

1. sometimes in my FPGA code the output does not give count value and it remain at 0. I wanted to figure out the reason for it, though the FPGA is running and simultaneously my motor is also. Therefore It should give the count value continuously.  

what's wrong.PNG

 

2.  I am not able to figure out that, when I am running my motor in Velocity Profile Mode through the motion manager and giving the velocity as an input (1/min). The value from 0 to 150 as an input gives the correct output through the host file, but when I am giving any negative value of velocity or velocity more than 150, my host file value is coming some random value. 

 

 

Pls, The Faluhaber Motion Manager gives reading of Encoder as well so I used to validate it with my Encoder (Host) Output.

faulhaber.PNG

 

 

 

Download All
0 Kudos
Message 34 of 50
(100 Views)

Hi rishab,

 


@rishab_kr wrote:

1. sometimes in my FPGA code the output does not give count value and it remain at 0. I wanted to figure out the reason for it, though the FPGA is running and simultaneously my motor is also. Therefore It should give the count value continuously.  


If you would not maximize the frontpanel you could show the same information with much less "whitespace" around!

 

There is a "STAT" indicator and it shows an error flag! Try to analyze where that flag is set…

Best regards,
GerdW


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

        

Hi GerdW, 

 

I am not able to figure it out. What's wrong with STAT ??, addition to this I added three more control (Since the SubVI "ENC SPLIT CNTL LINE " is taking five control input, but I was not able to interpret the output? 

 

Could you help me on this specifically? and what's wrong with the velocity?

0 Kudos
Message 36 of 50
(69 Views)

Hi rishab,

 

there's an explanation for each bit in the STAT indicator.

And the STAT indicator itself is set to binary display mode so you can even see the state of each bit instantly…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 37 of 50
(66 Views)

Hi Grewd, 

 

If I correctly understand, I need to do Encoder Configuration so that the output is count value and the Encoder Status. 

In Encoder Configuration these are not being used - 

Bit 7:5 : Reserved

Bit 4 : Clear Overflow

Bit 3 : Clear Error

Bit 2 : Signal Mode  

 

I am actively looking for some short of support on the community because I don't have understand how to use these things. Also, your hints are very less for a starter like me. Please be specific and if not please let me directly.

 

 

0 Kudos
Message 38 of 50
(56 Views)

Hi rishab,

 


@rishab_kr wrote:

If I correctly understand, I need to do Encoder Configuration …


In my last message I mentioned the STAT indicator twice, but you understood "I have to work with Encoder Config register"!?

 


@rishab_kr wrote:
Also, your hints are very less for a starter like me. Please be specific and if not please let me directly.

I was specific, but it seems to me you don't read my messages (carefully)…

Best regards,
GerdW


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

Hi GerdW,

 

the status output 0000010 indicates that there is an error detected in quad-phase mode. the question is what changes I shall ensure for the proper operation of the encoder in quad-phase mode and achieve accurate position and velocity tracking.

0 Kudos
Message 40 of 50
(49 Views)