profmason.com

January 17, 2009

Hardware solution to reading quadrature encoders

Filed under: Daily — profmason @ 11:29 am

The 74xx74 is a Dual D flip flop.  It can be used to determine the direction of rotation of a quadrature encoder.

In my previous design I had used the arduino to read the two channels from the encoder, compare them and calculate if they were going foward or backward.  At the december RSSC meeting, someone suggested that I use a dual D flip flop to determine the direction of rotation, and then the micro only has to count pulses. This requires much less overhead and code. 

Here is a link to an explantion of how this works.  Scroll down to where it describes the up down counter. 

I hooked up a pair of LEDS to the outputs so that one of them flashes when it is going forward and the other flashes in reverse.  Here is a short movie of it in action:

Video of 7474 tied two quadrature encoder

Note I am using the vex encoder, so if you are interested in using the vex encoders in your project, I can assure that they work just like any other quadrature encoder.  Since they have a nice square hole in them, this makes them easy to interface to the vex motor shafts.  They have two 3 0.1 male connects which want want power and ground and provide the encoder signal.   These are very easy to interface to your robotics project and are cheap!  (2 encoders for $20) The only problem is that they are pretty low resolution (~90 counts per revolution.  With my wheels and gear train, that means that each count is 3mm.  This is not very good, but much better then nothing.  

Here is the diagram associated with the circuit.

2 Comments »

  1. [...] am still working on the Mark 2 PID controller for Wuffie.  I will probably use DFlipFlops to pre process the quadrature encoders as I described earlier.  Right now there is an arduino chip talking to leaf via the serial port. [...]

    Pingback by profmason.com » Mini Leaf bot preview! — January 18, 2009 @ 12:12 am

  2. [...] routed back the the ADC on the micro for the closed loop control.  In addition there will be three interfaces for quadrature encoders based on a 74XX74 flip [...]

    Pingback by Motor Driver Board « profmason.com — June 4, 2010 @ 12:51 pm

RSS feed for comments on this post. TrackBack URL

Leave a comment

You must be logged in to post a comment.

Powered by WordPress