Arduino vs. BeagleBone/Raspberry Pi for Quick Gyro/Accelerom

General project help for Adafruit customers

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
pinkeye
 
Posts: 1
Joined: Mon Sep 01, 2014 6:42 pm

Arduino vs. BeagleBone/Raspberry Pi for Quick Gyro/Accelerom

Post by pinkeye »

In a certain project, we have a need to take quick readings (order of ms) from a Gyro, Accelerometer, and possibly a third sensor and do some other things.
last year, I worked on this project with an Arduino uno r2, but in addition to the Arduino having several pieces of it break off for reasons that are still a mystery, it was also quite slow just at running our code. Now is the time for new hardware, whether I like it or not, so I want to enlist the help of you smart people in what microcontroller or small computer would be best (immediately, I think of Arduino (which one as well) vs. Beaglebone vs. Raspberry Pi.

Im going to describe the needs of the project as best as i can :)
In addition to what I mentioned above, the thing will be an autonomous unit that runs off a battery and gets recharged once a day. Based on my calculations, the power draw from all of them will not be a problem at all.

From what I have been reading, there are some quirks to getting sensors like the gyro/accelerometer interfaced to the mini computer devices (Beaglebone/RaspberryPi). I by no means expect a plug and play solution, but I would like to see which one is best for sensor applications like this.

The basic application is to read data very quickly (ms order) from the Gyro and Accelerometer, as well as some floating point arithmetic and pattern matching. As i said, the Arduino was pretty slow when we were using it for this.

We will need to collect tons of data from these sensors! Back when we were using the Arduino (rest his soul), it was a pain in the ass to take reading because we would use this 20ft usb cable and we would have to read it over serial. Blast it. If we were to use the Beaglebone, or Raspberry, I would be happy to have our program/script spit out a quick log file for happy analyzing! How I could get that log off of the computer is another story though which i am not familiar with :(

Version control is highly valued for this project and would like to be able to deploy changes pretty quickly.

If theres some critical information I may have left out, let me know. My attitude is that the grass is always greener on the other side, so I'm happy to listen to y'alls advice :)

Thanks

User avatar
adafruit_support_mike
 
Posts: 67446
Joined: Thu Feb 11, 2010 2:51 pm

Re: Arduino vs. BeagleBone/Raspberry Pi for Quick Gyro/Accel

Post by adafruit_support_mike »

Neither the RasPi nor the BBB can do millisecond timing reliably.

Both devices run Linux, which is a time-slicing operating system. Each process gets 10ms of time on the CPU, then is suspended and archived, and the next process in the priority queue gets its turn. The order and frequency of time slices for a given process depends on the overall state of the system.. there's a whole complicated set of rules for which jobs need to be handled with the highest priority and how long it's acceptable to let them wait.

Bottom line though: Linux can't guarantee timing better than "within a few hundredths of a second".

An Arduino is good at real-time tasks because there's only one process on the CPU. The code has complete control of the hardware, so it can resolve time down to roughly a microsecond.

It sounds like you want a hybrid approach: use the Arduino to collect information from the sensors and buffer it, then let the RasPi or BBB pull data from the Arduino whenever it can. Don't do any major number crunching on the Arduino, just let it be a sensor driver and hardware data buffer. Do all the heavy calculation on the RasPi/BBB because those have CPUs with all the bells and whistles like floating point math units.

Locked
Please be positive and constructive with your questions and comments.

Return to “General Project help”