11-04-2025 02:36 PM
I have VR sensor with a diode and a tooth count of 60. "Configure Edge Counting Simple" Gets me 1 pulse per tooth pass, but want to configure as X2 encoding to get double the resolution--that is, to double my resolution.
"Configure Quadrature Encoder Position" seems promising, but requires B terminal to be wired in. I am using all my channels independently. How can I count the rise and falls on a single channel? Surely it can be done without have having to have a hard wired B terminal as on or off?
Solved! Go to Solution.
11-04-2025 03:21 PM - edited 11-04-2025 03:24 PM
Hello elibarber,
@elibarber wrote:
How can I count the rise and falls on a single channel? Surely it can be done without have having to have a hard wired B terminal as on or off?
With only one channel (A), you can only keep track of the edge change i.e., rising edge do something, falling edge do something. You will have no way to tell if you are going clockwise or counterclockwise.
Last value is false & New is value true = Rising Edge = Count up or down (choose one).
Last value is true & New is value false = Falling Edge = Count up or down (choose one).
Edit: Use FPGA, if you can for best results and do some googling to find tons of examples on how to do this in LabVIEW.
Channel/ Track B is used identify the direction of the rotation. For example, leading with a rising edge on B, followed by a rising edge on A increment the count. If opposite, decrement the count.
Some quadrature/ incremental encoders have a Z channel, this helps you set a reliable 0 position. You would typically use Z to reset your counting.
With one channel, you will only know you are going somewhere but you will not know where.
11-04-2025 03:58 PM
Xonmyth,
Yes, I only care about the pulse count. Not about the direction. Right now if i have a low speed i can bounce between 10-11 pulses per measurement which shows up on my gauges and charts. If I measure Rising and falling then divide by 2, I "think" the result should be 10.5. Measuring rising and falling seems to be to be an easy way to increase resolution, especially since with my gear its on 50% of the time regardless of speed.
I thought about using FPGA instead of the counter. this limits me to the 40MHz clock instead of the 100Mhz clock internal to the card. But would still work? Something like this?
11-04-2025 04:15 PM
It will look something like this:
You will use single cycle timed loop. I have only seen a default clock of 40Mhz for these. If you right click on the "Source name" terminal of the SCTL, you will be able to see the default clock your system has. If you do not see 100Mhz, use can use a derived clock.
Personally, I do think it would be a bit of overkill. But if your application requires it, sure, use it.
11-04-2025 04:32 PM
Genius!
Yes I think i will do that. + I will add a 2nd loop for safely writing to a user defined variable without violating any timing restraints. Luckily the NI-9361 has a digital filter built in.
11-04-2025 04:37 PM
Sweet! Good luck!
11-06-2025 03:29 AM
Hi elibarber,
@elibarber wrote:
I thought about using FPGA instead of the counter. this limits me to the 40MHz clock instead of the 100Mhz clock internal to the card.
Is that limit so crucial?
So why do you think the FPGA system clock will be limiting your speed measurement?