08-11-2008 03:40 PM
08-12-2008 05:48 PM - edited 08-12-2008 05:49 PM

08-13-2008 08:36 AM
Our application actually has two read heads measuring position on a Gantry. They are redundant signals used to give position. These two encoders are located at ~40,000 and ~450,000 ticks out of 555,000 total for one revolution. When the home pulse is received from one, we know it is located at 40,000 and likewise for the second, it is at 450,000. Zero is actually not a valid position for us, it goes from 555,000 to 1.
It appears that the home offset provided by NI doesn't really do what it should. It just moves the starting value but doesn't roll over at 0 (I assume even if measuring degrees, it would continue past 360 rather than starting over at 0).
I have already incorporated math to give the proper position, not disimilar to your example except I didn't convert to I32, but thought this functionality should be different.
If I'm still missing something, please let me know. Thanks for the response.
08-14-2008 02:22 PM
Hi SirMutt,
The counter should be reset to the Z Index Value when your home pulse is received on Z. I believe the confusion comes into how the "Pulses per Revolution" input is used for the Angular Position. The "Pulses per Revolution" could give the assumption that the counter would reset to 0 when the pulses per revolution is exceeded, but it is really just used to calculate the Degrees or Radians if you are returning these units. You are correct in assuming that if measuring degrees, you would continue past 360. This information can be useful if you wish to know exactly how many rotations you've completed. Phase wrapping (both in degrees or just in counts) will have to be done manually outside of the DAQmx driver. Please refer to this DevZone for the equation which calculates degrees out of the "Pulses per Revolution" and counter value. As you can see, it does not account for phase wrapping. I hope this information helps. Have a great one!
08-14-2008 02:56 PM
I see. It isn't as easy as the equation implies though. That's all fine and good if you're rotating clockwise and things are counting up. If you're rotating counter-clockwise and thus counting down, the counter goes from 0 to 4294967295. Thus a case for CW and CCW rotation needs to be implemented.
I was hoping it was just a user error but it appears I will need to do that math. Not a big deal.
Thanks.
08-14-2008 06:01 PM