Monday, January 22, 2007

Since my last posting, I've been working on robot-body itself. This has proved to much more difficult than I had originally thought.

I tried making a body with the lego parts and motors that I already had, but this didn't work out too well. It looked like a very lumpy tricycle; it had two (powered) rear wheels, and one (un-powered) front wheel. It also had a four-speed gear-box (controlled by a servo), which was supposed to enable the relatively weak 4.5volt lego-motors to move the robot at a decent speed. This body failed on several counts:
- It was slow and noisy.
- The four-speed gearbox was overly complicated, and would probably have been unreliable.
- When the robot hit a door-sill, it didn't manage to climb it. The rear wheels just spun.
- It looked like an obese tricycle that had been assimilated by the Borg.
I also discovered that my two remaining servos were also starting to malfunction (they are 10+ years old)
Unfortunately, I forgot to take a picture of it before I dismantled it.

I obviously needed a new approach, so I used the old proverb "If in doubt, use brute force. If that doesn't work, apply more brute force.".

Time to go shopping for new parts:-)

This is what I bought:
- Four 9V lego technic motors (lego nr. 8287). These are several times more powerful than my old ones, and I planned to use four of them, as opposed to the two motors in the old body.
- Two new servos, which the guy in the shop claimed should be perhaps twice as fast and strong as my old ones. I haven't measured it, but he seems to be right.
- A 9.6volt 2500mAh NiMh battery-pack (designed for a RC boat, I think). This replaces my ancient 7.2volt 1200mAh NiCd battery-pack.

The new lego motors have a built-in gearbox, which greatly simplifies the gear-chain that I need to build. After some experiments, I found that I only needed a single extra reduction. The new body has four wheels, each with its own motor. Each of the two front wheels is steered with a servo. The robot is (for now) manually controlled by a pair of cobbled-together joysticks, so that I can easily test the mechanics.

Here is a picture of the robot (with a beer-can to show the scale).


Close-up of the front wheels:


Close-up of the rear wheels (the new-style heavy-duty gears are visible on the right side):


The battery-pack (which is usually hidden below the electronics-board):


The manual (RC-style) controller:
This is basically two potentiometers connected to a couple of levers so that I can control the robot the same way as a radio-controlled car. The potentiometers are wired to the microcontroller, which uses its build-in analog-to-digital converters to read the position of each of the control-levers. The microcontroller then uses this information to position the servos, and to apply power to the motors.


So what are the results?
In a word: great!

The new body is far, far superior to my first attempt. The new motors are awesome. At full throttle, the robot moves at a fast walking pace, which is more than enough. It has enough torque to push small chairs around. The four-wheel drive enables it to easily climb over the door-sills.


I'm not quite sure what the next step should be. Most of the brawn of the robot is now in place, but quite a lot of the brains are still in the mail. I'm still waiting for the shipment of sensor-, bluetooth- and motor-control parts from www.sparkfun.com. Hm, maybe I should start on the beer-dispenser thingy that will sit in the fridge.

Monday, January 8, 2007

Argh! Broken servo!

I spent a lot of time yesterday trying to get the microcontroller to control a servo. Today I hooked up the oscilloscope to check out the servo pwm-signal, and it looked perfect. Hmm, lets try with another servo. Bingo! It seems that the old Acoms servo has died :-(


Oh, well. Life must go on, and luckily I had another couple of servos laying around. With the new servo, everything worked like a charm. In the picture below the controller is using an ADC-port to read the value of a pot-meter. This value is then used to control the width of the servo-pulse, so that when I turn the dial of the pot-meter, the servo moves accordingly:

Sunday, January 7, 2007

It lives!

I've finally gotten the ICD2 programmer/debugger hooked up to the pc and a PIC. At first, nothing worked, but then I discovered that I had reversed the wiring-scheme from the ICD2 to the breadboard. Once I got that sorted out, everything worked fine.

Here is a picture of the breadboard with the PIC connected to the ICD2 (Note the weather-beaten batterypack on the right; it is at least fifteen years old, and is starting to show its age :-) :

And here is a picture of the PIC running in stand-alone mode.

All that this first program did was to blink the red LED on and off. Not very exiting, but it tells me that everything is set up correctly. I really like the MPLAB IDE software and the ICD2 debugger: You can specify breakpoints in your code, single-step through the program, watch/modify variables, etc, just as you can when debugging a pc-program in VisualStudio.

The next goals are:
- hooking up at least 8 LEDs (for debug output)
- hooking up some switches and a couple of pot-meters
- controlling a servo
- reading an ADC input port

Friday, January 5, 2007

The first batch of robot-parts have arrived!

Happy days! I received the shipment from www.microchipdirect.com this morning. This contains the ICD2 programmer/debugger and miscellaneous PIC microcontrollers.

The packages:
The goodies:

Not too exciting to look at for most people, I guess, but I'm looking forward to playing with it:-)

One or more of the microcontrollers will act as the brain of my beer-fetching robot. I'm still waiting for another shipment of parts (from www.sparkfun.com), which will contain sensor-, motor-driver and radio components. But I have enough to keep me occupied for a long time already, since I have never programmed a PIC microcontroller before. I also have to build the robot's body, but that will probably be the easiest part (I have a black belt in lego :-)

First posting

Hello? Is this thing on?
Yep it seems to be :-)