Jump to content

Quadrature Encoder counter with FPGA


Neville D

Recommended Posts

Hi all,

working on my first reconfigurable IO project using a PXI 7811R with LabVIEW RT. I am building a quadrature encoder counter using a couple of the NI examples, and was wondering if there were any caveats to changing it to use an I-64 as the counter output? The NI example uses a 32 bit integer for the count.

In my version, I changed it to an I64 count output and added a speed (counting ticks between pulses) output as well.

It seems to work fine, but would appreciate any cautions that experienced FPGA users might have.

Neville.

post-2680-0-39495600-1316108447_thumb.jp

PS. Cross posted to info-LabVIEW as well.

Link to comment
  • 5 years later...

would you be able to share at least a screen shot of the true case of this function?

I have been able to successfully get the position count.

Iam trying to get the ticks/count for a similar application and have not been successful so far.

I would like to obtain angular position,velocity and acceleration of a stepper motor which has a quadrature encoder with 300 pulses/revolution.

 

any help in this will be greatly appreciated.

Link to comment

First, calculate how long it's been since the last encoder event. Then you need to latch that number when there's a new event to get the period between the last two events. What you do with the period from there is highly dependent on your application and available resources. If accuracy is of utmost importance, you can store all your periods in a FIFO and then integrate to get times and apply a quadratic fit to get the velocity and acceleration.

Vel and accel.png

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.