profmason.com

December 26, 2008

Using an UGN3503 Linear Hall Effect Sensors to make a quadrature encoder

Filed under: Daily — profmason @ 7:31 pm

I spent quite a bit of time working on building encoders for the large robot.  I ended up taking apart an old serial mouse, removing the encoder wheels and opto-interrupters and gluing the encoder wheels to the back of each motor.  This works but is less elegant then I might like.  Since I am taking the reading off the motor before the gear head, I have OVERKILL on encoder resolution.

I received a pair of UGN3503 Linear Hall Effect Sensors.  these are available from futurelec at $1.50 each.  Here is a link to the datasheet for these parts. ugn3503 datasheet

The hall effect works as follows: Moving charges experience a force in a magnetic field that is perpendicular to the direction of motion of the charge.  If the charges are moving in a semiconductor, the magnetic field can push the electrons either up or down.  This means that there will be an excess of one type of charge on one face of the semiconductor causing a potential difference across the semiconductor.  This is a very small effect.   However the UGN3503 contains a sensitive amplifier that amplifies the potential difference out to between 0 and 5 Volts.  0 Magnetic field corresponds to 2.5V and there is a deviation of 1.3 mV/guass.

First a single sensor is attached to the motor with foam tape.  A permanent magnet is attached to the motor. here is a graph of the sensor output as a function of time in ms.

In this application, two sensors are attached 90 degrees out of phase around the motor.  A small permanent magnet is attached to the motor shaft.  Each of the sensors is fed to an ADC on a picaxe 08M.   Here is the resulting graph.

As per standard quadrature encoders,  the leading pulse tells us the direction of the rotation while the number of pulses tells us the distance rotated.  For example, here is a pulse train for the encoder rotating the opposite way.

No Comments »

No comments yet.

RSS feed for comments on this post. TrackBack URL

Leave a comment

You must be logged in to post a comment.

Powered by WordPress