While I am still waiting for some of the parts I need to proceed with my robot, I’ll try to explain the design of my robot in this post.

Frobot will be a semi-advanced self-balancing two-wheeled robot. It will have a web server that hosts a user interface, making the robot controllable using the web browser in a smartphone. It will be fairly big, probably weighing somewhere around 10 kg and some 70-80 cm tall. I plan to use parts that are as cheap as possible, but not too cheap.

$30 wheels, gears and motors

I’ve selected a couple of low cost cordless drills from my local hardware store. They run of a 11.1V li-ion battery and provides 15 Nm of torque out of the box, each. The wheels I’ve salvaged from a small discarded trolley and the shaft for the wheels is simply a couple of large bolts that happened to fit in the drill chuck.

Parts:

Two 1.3 Ah li-ion batteries at 11.1V.

Two chargers.

Two brushed DC motors.

Two gearboxes.

Two drill chucks, allowing me to attach any drive shaft up to 10 mm in diameter.

Two large bolts.

Two rubber coated wheels.

Motor Control

I bought two medium sized brushed motor controllers from ebay, called IMS-1 50A. I found the above video on Youtube showing them in action. They can handle 50 amps of current at 12 volts, much more than what’s required for the motors I’ve selected.

Features:

50 amps

12 volts

Two directions

Pulse-width modulated speed control

Braking

Each motor controller has two PWM pins (one per direction) and a brake pin. I’m a bit worried about what happens if I accidentally send a PWM signal on both pins, so I’ll try not to do that. I think it would be a lot better to have a simple direction pin, and a single PWM input instead.

Velocity Control

Two different DC motors will provide different speeds when they receive the same amount of power. It’s virtually impossible to construct two motors that are completely identical. There may also be other mechanical reasons making the wheels spin at different rates given the same amount of power. To solve this, I need a way to read the rotation rate of each wheel. There are several different methods, and I am not sure about which method is the best.

Hall effect sensors and magnet quadrature encoder

Hall sensors are simple analog sensors that gives you an voltage reading corresponding to the strength of a magnetic field. A single magnet attached to the motor shaft, and a hall effect sensor would provide one count per revolution. Two hall effect sensors would give me direction. With three hall effect sensors, I could probably deduce the absolute position of the wheel quite accurately.

I found this blog post from profmason.com describing a quadrature encoder using hall effect sensors.

I’ll probably look into using three hall effect sensors, and try to detect the absolute direction of the wheel – just because it’ll be cool, and the BeagleBone Black.

Optical quadrature encoder

An optical quadrature encoder is simply an IR led and a couple of photoreceptors, directed toward a printed black and white encoder wheel. White surfaces reflect more light than black surfaces, and the photoreceptors should be able to provide similar signals to the hall effect sensors described above. I’m also pretty sure I would be able to deduce the absolute direction of a wheel, using three photoreceptors.

This blog post describes an optical resistor quadrature encoder.

Optical Mouse Encoder

An optical mouse works by using a camera to taka a picture of the surface it’s working on, hundreds of times per second. They use a LED or a laser to light up the surface, and a specialized chip compares the picture with the previous picture and tries to work out how much the surface has moved.

I considered simply directing the mouse towards the wheel, and reading the movement out directly. It will probably work quite well for low speeds. The problem occurs when the wheel is spinning faster than whatever the mouse can handle.

Expected problems

Regardless of the method I select, I expect to get into trouble when working with this. If the motor is rotating at perhaps 1000 RPM, I need to be able to count every cycle. Constantly reading the GPIO pin fast enough will be taxing for the CPU, and since Linux is not a real time operating system – this will not be reliable. I expect I have to look into a specialized circuit, or use a dedicated Arduino Pro Mini board for the task. I’ll get back to this in a later blog post.

Power Supply

I’ve spent a great deal of time researching how to power the robot. One of the first items I bought was a sealed lead-acid battery at 12 V, 6 Ah which is more than enough to power the robot for quite a while. The price was around $15. Basically, any 12 volt battery that’s able to supply the required current will do the job.

I decided to use the two li-ion batteries from the drills to power the robot for now. I have one battery that I can be charging, while the other battery performs its duty.

The electronics can’t run directly off 11.1 volts, so I bought this adjustable Step-Down Module (DC-DC 5A) Deal Extreme. Using a screwdriver I can adjust the voltage I want, while measuring it with my voltmeter. It can handle up to 5A, which is more than enough for the BeagleBone Black and more. There is a chance I need two of these.