LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

ENcoder Index Z

I think you are misunderstanding what Encoder Z is.

 

It is not a "position".  It is a once per revolution index pulse.  It can give you a rotation speed.  It can tell you where your encoder is in its revolution when you see the index pulse go by.

 

If you spin an encoder a short distance, you'll know how far it travelled based on counts in the A and B channel.  You'll know whether it turned clockwise or counter clockwise based on whether A led B or B led A.  But you don't know your original position.  It could have been a 1/4 turn , 1/2 turn or something else from whatever you consider your "index position".  Once the index pulse goes by, Now you know where in the revolution the encoder is currently at.  You can than synchronize all your pulses to it.  Note where you are, and now your count of A and B pulses can add or subtract so no matter how far you turn, you know what part of the revolution you are in.  If you go around more than one time, then you'll know that as well.

 

I can't tell you how to correct your logic.  That is more work than I have time to do when I need to be doing my own work.  But it can be done.  Depending on your module, counter modules often have an encoder mode that will take care of that for you and let the DAQ device worry about the count, and you can just query the device for the current count and position.

 

I suggest doing a goodle search on encoders to get a better explanation than I can give on exactly how they work.

Message 11 of 12
(760 Views)

I feel the same that i get a better understanding of encoder to correct my code.Thanks much.

0 Kudos
Message 12 of 12
(754 Views)