Using the Bourns ACE Encoder with a PIC
Bourns(tm) have introduced an absolute position input device. The Absolute Contacting Encoder (ACE-128) provides 128 angular positions, emitted as an 8 bit grey-code output, that can be linked directly into a Microcontroller.
Advantages of the ACE-128:-
- No A/D convertor is required, as would be with potentiometers.
- Being absolute, on power-on the position is known without having to move back to a reference position, as would be required with incremental encoders.
- Low cost (< $5 100off) and small, compared with more complicated multitrack (eg optical) encoders.
- Sample rates can be much lower than required with quadrature incremental encoders. You can sample when required, without needing a external up/down counter.
- As it is absolute, you only have to power the encoder when you want to read the position. Or,
- With the encoder powered continuously (0.5mA max using PIC portB pull-ups) and the PIC asleep, a wake-up will occur within 6 position changes (16 degrees) on altering the encoder.
- +1 to +125 degrees C operating range (Note:- latest range quoted is -25 to +125 degrees C but not confirmed)
Bourns give more info. for those interested
A summary of the Full Spec.:-
Electrical Characteristics
Output 8-bit gray code with 128 absolute states,
Closed Circuit Resistance 5 ohms maximum,
Open Circuit Resistance 100K ohms minimum,
Contact Rating 10 milliamp @ 10 VDC or 0.1 watt maximum,
Electrical Travel Continuous,
Contact Bounce (60 RPM) 2.7 milliseconds maximum,
RPM (Operating) 120 maximum
Mechanical Characteristics
Mechanical Angle Continuous,
Weight Approximately 0.50 oz.,
Torque 0.75 to 2.50 oz-in.,
Mounting Torque 7 in-lbs. maximum,
Shaft Side Load (Static) 10 lbs. minimum (what's all that in metric??)
Bourns(tm) tell you to just use a 256 byte look-up table to convert the grey-code of the encoder to a position number (0-127 clockwise).
My copy of the look-up table for the PIC for those who have wads of code space spare.
Where the prospect of devoting up to half your PIC's code memory to the look-up table causes a heart attack, try one of my shorter conversion routines:-
Version B(hex) takes up 91 bytes, and requires between 19 and 61 cycles to convert (Invalid codes up to 62 cycles).
Not got that many bytes left? Try
Version 8 takes up 76 bytes, and requires upto 153 cycles to convert (Invalid codes up to 171 cycles).
Got even less bytes left? Try
Version 5 takes up 63 bytes, and requires upto 300 cycles to convert.
Not even got that... oh dear.. Try
Version 1 takes up 43 bytes, and requires upto 2000ish cycles to convert!.
Hardware:-
Need to reduce the number of pins - use a 74HC597 to convert the bourns encoder to serial, requiring 2 or 3 pins instead of 8 pins. Bourns is planning a parallel to serial converter IC; we'll just have to wait to see if its cheaper than a 74HC597.
Back to microcontroller projects
Last Updated by Steve Lawther on Saturday, 1 March, 1997 at 11:04 PM.