Sunday, September 28, 2014

Odometry

I wanted my robot to be able to do dead reckoning, so I needed wheel encoders. There are some encoders on the market that can work with the Dagu yellow motors, as in the Magician chassis, or with the Solarbotics gear motors. And Pololu makes an encoder for their micro metal gear motors that detects wheel motion and direction by detecting white reflective tabs built-in to the wheels.

But I had already decided to use continuous rotation servos, which don't have a second shaft on the non-drive side to mount an encoder disk. Instead, I decided to mount a paper ring of encoder stripes on the inside of a Solarbotics servo wheel. I needed some way to detect the changes between black and white as the wheel rotated.

I found a set of components from Optek on mouser.com that seemed promising. They were a combination of an LED and a phototransistor, packaged together in a trapezoidal case with a screw hole.



Mobile Robot Project

I'm creating a small, mobile robot that will be featured in a robotics class I'm going to teach at my son's Middle School. Since I don't have much background in robotics, this class will be a way to expand my knowledge as well.

The prototype robot:

Robot Components

The robot has several components:
  • Arduino Uno R3 microcontroller
  • Continuous rotation servos to drive the wheels
  • Swivel caster at the back
  • Optek OPB742WZ for wheel encoders – IR LED + phototransistor
  • HC–SR04 ultrasonic distance sensors
  • Starboard HDPE plastic one-level base (7"x7"), and for HC–SR04 mounts (2"x1" each)
  • 9V battery to power the Arduino, plus 4xAA to power the servos; both battery holders have a cover an switch, so that there are separate switches for Arduino and motor power

Construction

Construction of the robot is intentionally low-tech. The servos and the ultrasonic mounts are affixed to the base with Scotch Extreme Mounting Tape. The ultrasonic sensors are pressed into two 5/8" holes in the mounts. The battery holders are attached to the base with velcro tape. The Arduino is screwed directly into the base with #4x1/2" machine screws and 1/4" standoffs. The HDPE base is soft enough that pilot holes aren't needed. The phototransistors are also screwed in with #4x1/2" screws and 1/8" standoffs. And the breadboard is attached using its adhesive back.

The robots used in the class will differ from this prototype only in the placement of the ultrasonic sensors. Testing with the prototype shows that it's easier to follow walls with a side-looking sensor closer to the front. So the final robots will likely use four sensors instead of five. I'll discuss this further in later posts, as well as summarize lessons learned while teaching the class.