Beagle II
From WFFwiki
Beagle II is a project to create a floor roving robot. It is named after the ill-fated unmanned British mission to Mars.
The robot is a completely custom design both mechanically and electronically. I wanted to see what was possible, so decided to start with a fairly simple robot platform to allow me to experiment with control software.
The robot is based around the Microchip PIC16F887 microcontroller, which is a completely self-contained computer on a single chip. The USB control system is based around a Microchip PIC18F4550 microcontroller (which has on-board USB).
Contents |
Building the robot
The rolling robot base
The base of the robot is made using a 3mm thick piece of precut plexiglass. The robot is powered by 2 Futaba S3003 servos which I modified for continuous rotation (this hack is widely documented on the Internet). The servos are held in place by 2 aluminium brackets cut from an L shaped bar. The plexiglass was then drilled and the brackets attached.
The front wheel is just there to hold the unit off the floor. Steering is provided by independent control of the two drive servos.
The rear wheels are made from modified Lego parts, in this picture you can see my first attempt which proved to be too weak. Later you will see how this was solved.
Panel and mainboard
In the picture you can see the basic layout of the mainboard (I simply soldered in the main components to check to all worked out before continuing). The control panel is made of an identical piece of plexiglass supported by struts made from M3 threaded rod.
On the panel I decided to mount 2 high intensity blue LEDs, two push buttons, an on/off switch and a 4x24 character white-on-blue LCD panel. Since the robot was to help me learn a little about the software side of things, I wanted to have a fairly flexible interface on board the robot.
You can also see the ICSP interface to my PICkit2 which will allow reprogramming of the microcontroller without requiring any disassembly of the robot.
The LCD is connected to the main board via a low profile plug on the back of the screen and header pins rising up out of the mainboard. Since the struts allow the panel height to be changed, it is very easy to construct and adjust so it all fits.
In the next image you can see the (almost complete) mainboard (the radio receiver board is missing). As you can see all the panel and servo connections are on plugs to allow the robot to be easily disassembled.
The large potentiometer at the back is to adjust the LCD contrast, the long shaft makes it easy to access even with the panel in place.
Once the connections were all made I powered up the mainboard using the PICkit2 and tested the screen, LEDs, servos and push buttons with some simple code. Everything fired up first time; nice even if very unusual :)
The final mainboard picture shows the completed circuit mounted on the robots base. You can also see the radio receiver unit in this picture which has a red socket for connecting the antenna. Under the board there is a 9.6V 2000mAh battery pack (a standard radio control pack using NiMH batteries). This connects to the mainboard using a standard clip-connector.
The mainboard is fairly simple since most of the hard-work is performed by the PIC16F, the rest of the components are basically to do with power regulation and pull-up/pull-down of the switches mounted on the panel. There is also a 20Mhz crystal oscillator to provide accurate timing for the PIC.
Wheels
My initial attempts at gluing a servo mount to the back of some lego wheels was pretty unsuccessful, the glue would snap off too easily. I solved this by using a slightly different style of wheel. I glued the servo mount to the back of the wheel and then, after the glue was dry, drilled three holes in the servo mount and strengthened it with 3 M3 stainless steel bolts. The result was pretty good, it's very strong and looks pretty nice too.
Batteries
The servos draw quite a bit of power when they are both running under load, so a fairly powerful battery pack is required to power the robot if you don't want to constantly be recharging it. I chose a straight-forward NiMH R/C pack supplying 9.6V at 2000mAh. The battery is attached to the underneath of the base using two zip-ties so the pack can be easily replaced when required.
I charged the battery pack using a microprocessor controlled charger which I use with my R/C models.
Initial testing
In the picture you can see the robot going through its paces as I tested all the basic functions of the mainboard. Since I already had libraries for driving the LCD from other PIC projects, this was fairly simple to get going. Everything looked good, so then it was time to write some software to get the servos moving.
Once I had the basic control software written I had Beagle II running through some simple servo control sequences. The turning isn't accurate yet, but the test sequence runs both motors in all directions and also runs them in opposing directions to turn the robot. In the video the robot is completely controlled by the on-board processor as the serial radio link was still awaiting the transmitter to be built.
The motion is very smooth, as is the turning, overall I was very please with the speed and performance of the servos.
Control system
The control system is a USB powered box which contains a PIC18F, a USB port, two LEDs, a reset button, a on-on switch, a 20Mhz crystal oscillator and a digital 433Mhz serial transmitter board for communication with the robot. I based the circuit around the Microchip USB demo board, which made it very easy to adapt the demonstration USB communication software libraries which Microchip provide.
It works by simulating a USB to RS232 converter (on the 18F chip) which allows you to connect a serial terminal to the box (it appears on the PC as COM4 - a standard serial port). The software then allows you to enter commands which are validated by the control system and then sent to the robot for processing.
It should be possible to build a custom USB driver for the control system, but since this requires some Vista development it can wait for a later date! The USB to serial conversion allows the robot to be controlled with no custom software on the PC (you just need hyperterminal or some equivalent).
Since the USB driver is 'polling' (running around a loop constantly) the robot control CLI is a simple state-machine which switches from idle->prompting->collecting->executing and then back to prompting with out 'blocking' the polling loop. The green LED indicates that the circuit is powered up and the yellow LED lights up once successful USB communication is achieved. The PIC can be programmed via an ICSP connector mounted on the board.
Apart from the reset button all of the switches and LEDs are completely controlled by the PIC, so I can reassign them to show/do other things at a later date (I may make the yellow LED show when data is being transmitted over the radio link).
Most popular pages:
- Home (29,354 views)
- Projects (14,481 views)
- Open Source Framework for USB Generic HID devices based on the PIC18F and Windows (11,833 views)
- PIC USB Development Board (9,970 views)
- C64 VICE Front-End (8,239 views)
- USB Performance Monitor (8,044 views)
- Open Source Visual C++ Class for USB Generic HID Communication (6,695 views)
- 3D House (5,995 views)
- USB RGB LED VU Meter (5,081 views)
- Blog (4,697 views)
- News (4,406 views)
- 16x8 LED Matrix Display (4,380 views)
- 4-Bit Computer (4,094 views)
- Reverse engineering an MB Electronic Simon game (3,925 views)
- Links (3,820 views)
- DIY Arcade (3,805 views)
- UltimateSIMON (3,749 views)
- Retro Computing (3,330 views)
- Retro Computers (2,966 views)
- Restoring an Acorn A3000 computer (2,856 views)
