Is the Arduino platform better than the Basic Stamp for UAVs?

Jordi has opened my eyes to the Arduino platform, which is being described as a "Basic Stamp killer". Is it a good candidate for autopilots? Well, let's look closer.

Arduino is an open source embedded processor platform, based on the ATMega168 CPU, which has more memory than the Stamp and is a lot cheaper. There's proper development software available and SparkFun has a full line of dev boards and other accessories. Its programming language looks like C but should be easy enough to learn for people who know Basic.

It started as an Italian project (it's named after an Italian king) and still has a European flavor, so that may explain why we in the US don't know it well. But Jordi, in Mexico, had done some very interesting work in exploring its potential as an autopilot platform.

His main project is the "Arducopter" (shown at right), which has resulted in some very nice code, such as this navigation routine.

In his comments, Jordi (BTW, he's just 21) described some of the cool things he's doing with it, which I'll simply quote with links here:

"This is my first test with Boarduino (a breadboardable version of Arduino) controlling servos and using an accelerometer from a Nintendo Wii. Right now I'm using Gyros and Kalman filters. I even wrote code to read PMM signals, the GPS is finished and working pretty well, the IMU is in beta, and I'm developing an altimeter using I2C technology and high quality pressure sensors."

Here are some links he provided:
I'm intrigued. I don't see anything here we can't do with Basic Stamps with a little fiddling, but I have to admit that certain projects look like they would be easier with the Arduino, mostly thanks to its greater memory and full range of variable types, including floating point. Anybody else looking seriously at Arduino?

Views: 3179


3D Robotics
Comment by Jordi Muñoz on January 13, 2008 at 6:23am
WOW. You took me by surprise, I have the second and final version of the GPS, with ground station, using labview:
http://arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1199022761
And you can make your own arduino:
http://arduino.cc/en/Main/StandaloneAssembly
The programing language is super easy, actually was develop by UCLA, called Wiring, the big brother of Arduino, and is open source too. The good thing about arduino, is that your able to use complex library's, like AVR libc, for complex math formulas, TWI, interrupts, etc:
http://nongnu.org/avr-libc/
Good luck!!! and thanks!!!
Comment by Mike Frieze on January 13, 2008 at 7:54pm
Yes, I just became aware of the Arduino and am evaluating this. My review is based on the book "making things talk" by Tom Igoe. Not conviced the programming environment of Processing will do but I do like the fact that java code can be inserted directly. My development is in PIC's with MPLab and the ICD2 programmer / debugger. However to see a book show how to do big things (ZigBee) with an Arduino I get excited. Anytime development can be sped up its worth a look.
Comment by Jason Striegel on January 13, 2008 at 9:39pm
I've made a GPS waypoint guided RC car in the past with a BS2 and I recall having to really whittle things down in order to get the code to fit in the Stamp's memory footprint. Depending on what other routines I had running in the service loop, I also remember higher baud rates on the incoming NMEA data were sometimes unreliable.

2400 was most reliable, but just slow enough that it took the Garmin more than a second to split out all of the data. This meant that it was 2 seconds between data points, which is an awfully long time. I think I ended up running things at 4800 and just dealing with the occasional error. The vehicle had to wait half of the data transmission time, on average, waiting for NMEA data instead of monitoring other sensors or steering the vehicle, so getting things under a second helped a lot.

I haven't tried the Arduino hardware yet (a device is in the mail), but I figure a little more speed and additional memory space for reading and processing more sensor data would really make all the difference, especially for more complicated vehicles like a helicopter.

3D Robotics
Comment by Chris Anderson on January 13, 2008 at 9:53pm
Jason,

I think Basic Stamps have improved since then. We're using the BS2p, which is 3x faster than the BS2, and all of our serial at 4800 and 9600 is rock solid. If need be, we can move to the BS2px, which is 5x faster than the BS2.

That said, the limited memory (especially the variable space) is still a problem and requires some clever coding, using multiple program slots, scratchpad RAM, and reading and writing to EEPROM memory. I'll be interested to work with Arduino to see how that compares in this respect.

3D Robotics
Comment by Jordi Muñoz on January 13, 2008 at 11:36pm
Your can make arduino serial run at 57600pbs or less, like 9600, 4800 etc, with UART. There is a library to use any pin for serial com (max 9600bps). Arduino also supports I2C (TWI) and SPI communication. I love I2c (Two Wire Communication) is the same used by Wii accelerometer, and you can attach 128 devices in the same bus (2 wires) running at 40mhz, and requesting data only when you need it :), there is a lot of i2c hardware, including gps and ADC's with 16bit of resolution.
Comment by Jason Striegel on January 13, 2008 at 11:38pm
Chris,

I'll have to look into the newer Stamp hardware, especially since I've gotten familiar with coding for the platform. That said, the cost of the Arduino is pretty compelling.

If more power and memory is needed, I was thinking the best thing might be to use an embedded Linux computer like the gumstix for the main program logic and just offloading the sensor input ppm servo output to a Stamp or Arduino.
Comment by problah on January 14, 2008 at 7:28pm
The Arduino was the route I was thinking about using. I am also contemplating a python interface via gumstix, and realtime linux. We'll see how it goes, but for basic nav, the arduino should run just fine.
Comment by Gareth Farrington on February 22, 2008 at 9:57am
Looking at Wiring vs. the Arduino. Wiring has more RAM, Flash and IO pins which could be really useful. Also they are about to come out with a 'Wiring Mini' thats even smaller than the Arduino and costs roughly the same. That would be a suitable flight platform. see: http://wiring.org.co/cgi-bin/yabb/YaBB.pl?num=1203441602

Near as can tell its almost the same CPU and code from the Arduino should run on Wiring and vis versa. One big thing these platforms have going for them for a micro UAV is that they can read 8 analog inputs and drive 6 servos. The Propeller can only drive 4. Also the tool chain is mature, you can code in Wiring or C and have things compiled and run fast.

Is there a good reason to use the Arduino over Wiring, aside from Cost?

3D Robotics
Comment by Jordi Muñoz on February 22, 2008 at 11:27am
The size, always the size. Actually i was planing to use two boards (dual core), to separate the navigation part from the AutoPilot, if something goes wrong with the navigation the autopilot still flying. The navigation part i was thinking to use a wiring board (includes gps, parse gps data, waypoint navigation, altimeter), and make inside it a small OS to change settings on fly, the autopilot part will be just an arduino (and receive data "ready to use" throw SPI or TWI(i2c)), and in the the hand, arduino will process the IMU (gyros and accelerometers) and control the servos. Another excellent thing about wirings is that the ADC's are 12-bit and not 10-bits like arduino.
I wrote the last month an email to wiring, to ask were can i buy the mini board, (SparkFun maybe), but never answer me.
About the servo, we can save a lot of CPU power if we use this:
http://www.pololu.com/catalog/product/207
Good price and excellent performance. I can control any servo just sending three bytes in serial.
What is your opinion? =)

3D Robotics
Comment by Chris Anderson on February 22, 2008 at 11:35am
Jordi makes a good point: it's really inefficient to be generating and sending PWM servo commands directly from the CPU. (In fact, I think it's probably impossible to input and output six channels with one of these and still get a reasonable frame rate, to say nothing of actually doing any other processing). That's why we use servo and motor driver chips or miniboards, which are all controlled with a single serial out. So from my perspective, the number of servo outputs is irrelevant in the selection of a processor platform,

Comment

You need to be a member of DIY Drones to add comments!

Join DIY Drones

© 2014   Created by Chris Anderson.   Powered by

Badges  |  Report an Issue  |  Terms of Service