3pi Encoders

Hi all,

Theres a few people asking on here about encoders for the 3pi and I thought id share how I went about it…
I bought an expansion pack and soldered two QTR-1RC ir sensors to look from the outside in towards the wheels and count the spokes.

I’ve uploaded the avr studio project I used to read in and travel. There are a few things to be aware of:
Its for a Baby Orangutang 168 master - although I’m sure its easily adaptable to run on the 3pi
After the initial calibration if the environment becomes very sunny it can throw it off.
If the robot moves forward with one wheel faster then the other when the faster wheel has finished the robot spins leaving it facing the wrong direction. To deal with this I made process_right/left_whl_adjust. CLICK_ADJUST mode is far better then SPEED_ADJUST mode, but its all hacked together so someone else could probably get it going far better :unamused:
any hints on how to improve my code would be great

The reason I needed encoding was because I want to use the wavefront algorithm to travel around, ive got a Sharp IR rangefinder on a servo lashed on top :slight_smile:

hope this is useful to someone
Marcus :slight_smile:

Code: files.me.com/marcus_wood/c65ykr
Really useful site: societyofrobots.com/sensors_encoder.shtml



Hi Marcus,

Cool idea, and thank you for posting your code! If you get the wavefront algorithm working, it would be cool if you posted a video.

- Ryan