Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

Quadrature encoder waveform using NI 9411

Hi,

 

I am currently using NI 9411 to measure the position(counts) of an encoder using FPGA programming. I have attached a vi of which I managed to get a digital waveform however, when I turn the encoder clockwise, it seems that the counts seems incorrect as my encoder is 2000 per revolution which means it can count up to 2000 but it gone beyond 2000. May I know whats the problem and regarding the reading of waveform, it seems weird. Can anyone help me with this??

0 Kudos
Message 1 of 9
(5,725 Views)

Hi Afai,

 

Please post only once. We will reply you as soon as possible.

 

You mentioned that your encoder is 2000 count/rev, which means 1 revolution or 360 degrees are actually 2000 counts. If you have more than 2000 count, it means it has rotated more than 360 degrees right?

 

Sincerely,

 

Krisna

 

Certified LabVIEW Developer (CLD)
Certified TestStand Developer (CTD)
Using LabVIEW 8.5.1 (2008) to LabVIEW 2024
0 Kudos
Message 2 of 9
(5,705 Views)

Hi Krisna,

 

So sorry that i posted 2 times. Yup, more than 2000 means more than 360 degree. Do you know a way in which I could make this correct as in the maximum count i could go up to is 2000?

0 Kudos
Message 3 of 9
(5,694 Views)

hi afai,

 

I am not sure why you want to do that, but I guess you can use quotient & remainder to do that, the example below is limiting number up to 5 only:

example.png

Certified LabVIEW Developer (CLD)
Certified TestStand Developer (CTD)
Using LabVIEW 8.5.1 (2008) to LabVIEW 2024
0 Kudos
Message 4 of 9
(5,689 Views)

I am currently programming it using FPGA

0 Kudos
Message 5 of 9
(5,686 Views)

I am so sorry i am not sure what you are trying to tell me. I need to do that because when i convert the counts, it go to way beyond 360 degree. Do you know how to convert the counts to degree? 

0 Kudos
Message 6 of 9
(5,682 Views)

Hi Afai,

 

My previous reply was centered to answer this question:

"Do you know a way in which I could make this correct as in the maximum count i could go up to is 2000?"

--> above code should work in FPGA, the algorithm to make it count only to a maximum number (in the example i put 5)

 

Do you know how to convert the counts to degree?

--> its easy, your encoder spec said that, 2000 counts per rev.Which 1 rev is 360 degrees, simple math should give you: 2000/360 = 5.55 degrees in each count.

Certified LabVIEW Developer (CLD)
Certified TestStand Developer (CTD)
Using LabVIEW 8.5.1 (2008) to LabVIEW 2024
0 Kudos
Message 7 of 9
(5,675 Views)

Hi krisna,

 

Thanks for your reply and making me understand. But do you know how can i implement the algorithm you gave it to me as in where should i modify it? Thanks 

0 Kudos
Message 8 of 9
(5,673 Views)

Hi Afai,

 

You should try the example that I attached previously. You can implement the same algo in FPGA as well, just replace constant 5 with 2000 and you are good to go. Divide by 360 if you want to convert it to degree.

Certified LabVIEW Developer (CLD)
Certified TestStand Developer (CTD)
Using LabVIEW 8.5.1 (2008) to LabVIEW 2024
0 Kudos
Message 9 of 9
(5,665 Views)