Dec 15, 2010 - Robot: The Search for a Brainstem
And so, the search for a microcontroller to be the I/O controller for my robot begins. The current architecture uses two micros, an ATMega32 on a Polybot Board 1.0 to monitor and control the steering and speed, and a Parallax Propeller on a Propeller Proto Board to do most of the I/O to control and read the sensors. The Propeller board also communicates with a bluetooth serial module that sends all of the sensor data to an android phone, and which processes the data and sends back control commands. Unfortunately, the android phone was borrowed, for a quarter project, and I had to return it at the end of the quarter. Hence, a new brain and a search for a new brainstem.
I suppose introductions are in order.
The Robot:
The Polybot Board:
The Propeller Board, hidden behind all of the interconnect wiring:
The glue logic, on a breadboard:
Since I'm adding yet another board to the robot, and it's already pretty crowded, I think it's time to consolidate the two microcontroller boards into one. Requirements for my ideal controller board are:
- 1 analog input to sense battery voltage
- 5 digital outputs to trigger sonars
- 2 servo outputs
- 4 digital inputs for wheel encoders
- 2 digital inputs for bump sensors
- 1 digital output for a battery cutoff
- 4 digital I/O to read the compass
- 3-4 UARTS for:
- Communication with the brain
- Reading data from the GPS
- Reading data from the sonars
- Sending and receiving data from a bluetooth serial module (optional)
This totals to 27 I/O pins, with at least 3 UARTS (ideally in hardware), an A/D converter, and possibly servo PWM hardware or timers. Finding a microcontroller with 3-4 hardware UARTS is tricky, and it makes the propeller an option.
Propeller
Advantages:- 8 cogs
- 4-uart module
- Completely re-assignable I/O pins
- Lots of user-contributed pre-existing code
- No hardware UARTS
- No A/D converter
- The default IDE sucks
- Language options all suck (spin, assembly)
- C compiler is inefficient and unwieldy
Polybot
As much as I love the AVR architecture, the Polybot board doesn't have enough UARTs to even talk to the brain and the sonars, so it's out.Sparkfun XMega
Advantages:- 8! Hardware UARTs
- A/D converters
- 128k of flash!
- AVR architecture (a familiar toolchain)
- Low-voltage supply, 1.6 to 3.6V
- Hardware timers for PWM
- Small-ish; 2+" by 2+"
- New hardware to buy: $25
- New programmer to buy
- Almost no on-board components; will probably need a support board with a crystal, voltage regulator, etc.
Arduino Mega 2560
Advantages:- 4 Hardware UARTs
- AVR architecture
- Arduino compatible; on-board USB
- Arduino footprint; lots of add-ons available
- Hardware A/D
- All support components on-board
- 256k flash
- 7 to 12V input, matched to robot
- Hardwre timers for PWM
- New Hardware to buy: $65
- Big-ish, 2+" by 4.5"; still smaller than the brain
Xilinx II Board
Advantages:- Incredibly configurable and flexible
- 32 IO pins
- Analog input card
- More development time
- Windows-only software; no chance of escape
And with that analysis, I'm still a little torn. The development environments for the Propeller board and the Xilinx board are both windows-based, which isn't something I want for a long-term project. With the Xilinx board, there's pretty much no chance that I'll be able to work with it from my linux machine. That leaves me with two choices:
A Second Look
Arduino Mega:The Arduino Mega is incredibly appealing, but it's still more new hardware to buy, which is a big disadvantage on my budget, but as long as I'm buying hardware I'd go for the better of the two.
Propeller:With the propeller, there are development tools for linux, but they require a significant amount of learning, I'm still stuck with either Spin or assembly, and I'm not a big fan of Spin, and while assembly is fun, it's a bit too low-level for the programming I need to do. A C compiler for the propeller exists, but it requires an external memory to write anything much bigger than Hello World, and if I'm going to purchase something, I'd rather buy a complete board.
The jury's still out.
EDIT: I made my decision and purchased the Arduino Mega 2560.
Home