Adaboard Anyone?

by randomvibe on Thu Jan 10, 2013 5:29 pm

Frustrating by all the new single board computers boasting power, speed, RAM, awards, yet prove to be incomplete power hogs that run very slowly when real life sensors are included? Frustrated by poor documentation and myriad of scattered wiki links and forums? The usual response to this criticism is education - you'll learn. I think the main education has been how to sell and hype. Maybe they'll be knighted next year.

That said, one thing very enticing with new boards is the ability to program your project in Python. Even better, it would be nice to program in Octave! Octave is the GNU version of basic Matlab, arguably the best language for engineering and feedback control systems - absolutely perfect for robotics. Clean concise programming and vector math! Every engineering student and professional knows what I'm talking about.

I'm not an adafruit representative by any means. I am a customer impressed by Adafruit's ability to pick the right component or sensor and integrate it with a simple to use breakout board at a very reasonable price, cheaper than sparkfun. Now adafruit claims to be engineer, but I've mostly seen selling and hacking. So here's an engineering challenge: design the Adaboard - a microcontroller or single board computer module using an off-the-shelf chip with at least 12 native ADCs!!! (at least 12bit), 12 or more PWM, 36 or more digital I/O, at least 2 SPI, two I2C, 4 hardware serial, ethernet, etc., programmable in Octave, Matlab, or at least Python, for $45 USD. So basically something similar to the Arduino Due, however programmable in a much more powerful and more popular language without boring low-level register instructions. So in other words, a basic line to read an ADC on pin 11 would be: volt = readadc(12); . Use your salesman chops to market them to universities and high schools for valuable exposure and interest. Eventually, I can see these boards at radioshack, fry's, hobby stores, even toys 'r us. Adaboard anyone?
randomvibe
 
Posts: 36
Joined: Tue Jan 24, 2012 6:26 am

Re: Adaboard Anyone?

by adafruit on Thu Jan 10, 2013 5:56 pm

thanks :)
User avatar
adafruit
 
Posts: 11666
Joined: Thu Apr 06, 2006 3:21 pm
Location: nyc

Re: Adaboard Anyone?

by westfw on Thu Jan 10, 2013 11:00 pm

There's a python that runs on boards as small as the Arduino MEGA.

incomplete power hogs that run very slowly when real life sensors are included?
:
The ability to program your project in Python. Even better, it would be nice to program in Octave!

I think I see the root of your performance problem... :-)

Really: there are boards (beagleboard, Raspberry Pi, STMF4 Discovery, Arduino Due, Teensy3) that OUGHT to have the raw hardware performance to do the sorts of things you're asking for. Some of them also have the advantages of being mass produced on a scale that yields end-user costs that would be hard to duplicate with a more specialized platform. Getting better software working on these would probably be easier than designing new hardware AND software...
User avatar
westfw
 
Posts: 1373
Joined: Fri Apr 27, 2007 12:01 pm
Location: SF Bay area

Re: Adaboard Anyone?

by randomvibe on Fri Jan 11, 2013 4:26 am

adafruit wrote: Some of them also have the advantages of being mass produced on a scale that yields end-user costs that would be hard to duplicate with a more specialized platform.


I don't see why a specialized platform is needed. The adaboard platform could be the Arduino module itself. Keeping the Arduino form factor is probably a good idea to be compatible with shields, although I don't care for this.

The difficult part will be software, especially if the board can be programmed in Octave (Matlab clone) - this would be a huge discriminator and advantage for an adaboard. No one has done this, at least not in a production capacity. Two people claim to have done it in the Raspberry Pi, but I haven't confirmed it:

http://www.raspberrypi.org/phpBB3/viewt ... 27&t=24687

If not Octave or Matlab, at least Python with Numpy would be very nice. The now defunct 32bit Maple from leaflabs had some partial success with PyMite (diluted python without Numpy):

http://leaflabs.com/2011/09/pymite/

Another company called Synapse is selling the 32bit SM700 pyXY board ($69.95 too much) that sports a very watered down version of Python called SNAPpy. Unfortunately, it does not include any numpy functions for matrix math, and not even floating point math for scalars! They almost had it right.

http://www.synapse-wireless.com/snap-co ... ols/portal
randomvibe
 
Posts: 36
Joined: Tue Jan 24, 2012 6:26 am

Re: Adaboard Anyone?

by westfw on Fri Jan 11, 2013 8:02 pm

Octave or Matlab, at least Python with Numpy

Since you seem familiar with what you want to do, can you place a lower limit on the amount of RAM needed to do the sorts of calculations you had in mind? Just from a data array point of view. When you start talking about languages with built-in matrix and vector support, I think "large amounts of data." I have no idea whether that's true; I predate all modern languages :-(

It would be EXTREMELY useful to eliminate, say, any board with less than 640k of RAM, for example ("640k isn't enough for anyone to do anything." (someone younger than Bill Gates)) That would immediately disqualify all of the microcontrollers without an external RAM interface, for example, and immediately increase the board complexity. (well, excepting the SiP devices such as used on BeagleBoard that piggyback the RAM into the CPU package, even though the CPU chip itself doesn't have that sort of internal RAM.)

On a related note, does anyone know of any online EE classes that specifically cover the use of simulation and matlab-like software? When I was an EE, we didn't even have spreadsheets, and I'm feeling left out by the natural ease that younger folk seem to have when suggesting that a circuit be simulated. (preferably, such a class should use software that is cheap or free. (Spice and octave rather than MultiSim and MatLab, for instance.)
User avatar
westfw
 
Posts: 1373
Joined: Fri Apr 27, 2007 12:01 pm
Location: SF Bay area

Re: Adaboard Anyone?

by randomvibe on Sun Jan 13, 2013 6:12 pm

westfw wrote:can you place a lower limit on the amount of RAM needed to do the sorts of calculations you had in mind? Just from a data array point of view. When you start talking about languages with built-in matrix and vector support, I think "large amounts of data."


Matrix/vector programming does not necessarily mean large data sets. Here, it means very clean, concise, highly legible programming. For example, the Kalman Gain Matrix shown below involves several matrix multiplications, inversion, and transpose (denoted with apostrophe).

K = Pp * H' * inv(H * Pp * H' + R);

Let's not worry about the definition of the Kalman Gain Matrix. The point here is this... imagine implementing the equation above in C or C++ language - it'd be very messy. Each term above could be a 2x2 matrix, 6x6, or more. In Matlab or Octave, the program expression is literally the above equation. I literally copied it from one my programs. No for-loops, no while-loops, no subroutine calls. The python version is not as elegant, but still better than C or C++ :

K = Pp * H.T * linalg.inv(H * Pp * H.T + R);

westfw wrote:It would be EXTREMELY useful to eliminate, say, any board with less than 640k of RAM, for example ("640k isn't enough for anyone to do anything." (someone younger than Bill Gates))


So in terms of ram, assuming each term in the K equation is a 6x6 matrix (36 elements, 8 bytes per element, 288 RAM), the total ram required is 1,728 RAM (based on 6 terms, 288 RAM each) - tiny compared to Arduino Due's 96,000 RAM.

Can python or Octave fit on the Arduino Due? I can't say for sure, but I know the leaflabs people successfully ran a watered-down version of Python called pyMite on their Maple board (32bit, 20KB RAM, 120KB flash). pyMite does not support matrix math, but I can't imagine that matrix addition, multiplication, transpose and division would require much more flash.

http://leaflabs.com/2011/09/pymite/
randomvibe
 
Posts: 36
Joined: Tue Jan 24, 2012 6:26 am

Re: Adaboard Anyone?

by westfw on Mon Jan 14, 2013 5:26 am

K = Pp * H.T * linalg.inv(H * Pp * H.T + R);

I'm not a C++ programmer, but I'm pretty sure you couple implement that syntax in C++ as well. Classes, types, operator overloading...

in terms of ram, assuming each term in the K equation is a 6x6 matrix (36 elements, 8 bytes per element, 288 RAM), the total ram required is 1,728 RAM (based on 6 terms, 288 RAM each) - tiny compared to Arduino Due's 96,000 RAM.

But presumably that's a relatively small piece of any actual program. It's not "my program only needed 2000 bytes of RAM", but "one statement of my program ate through 2k of RAM and my program is xxx bytes long." Does MATLAB/OCTAVE report memory usage? Do you have a real and useful program that can be studied (but would be more useful if it fit on a Due...)?
User avatar
westfw
 
Posts: 1373
Joined: Fri Apr 27, 2007 12:01 pm
Location: SF Bay area

Re: Adaboard Anyone?

by BruceF on Mon Jan 14, 2013 1:12 pm

westfw wrote:
K = Pp * H.T * linalg.inv(H * Pp * H.T + R);

I'm not a C++ programmer, but I'm pretty sure you couple implement that syntax in C++ as well. Classes, types, operator overloading...

I'm not much of a C++ programmer, but even I have implemented that syntax in C++. That said, if learning the guts of numerical programming isn't what you're up to at the moment I'd recommend using one of the hundreds of existing implementations like Eigen instead of rolling your own.

randomvibe wrote:Can python or Octave fit on the Arduino Due? I can't say for sure, but I know the leaflabs people successfully ran a watered-down version of Python called pyMite on their Maple board (32bit, 20KB RAM, 120KB flash). pyMite does not support matrix math, but I can't imagine that matrix addition, multiplication, transpose and division would require much more flash.

I just gave this a go on my Mac:

Code: Select all | TOGGLE FULL SIZE
port -y install octave-devel +atlas+docs | grep ^For | wc

54 dependencies, on top of the large number of existing packages I've already got installed. I've got too many unfinished projects already to want to push that any further, but I suspect that Octave is not likely to fit on a smaller micro, and if you could squeeze it in it probably wouldn't have the RAM or clock speed to do the things you want. I'd stick to running it on a Raspberry Pi or a BeagleBone, which are both relatively affordable, fast and gifted with plenty of flash and RAM.

I like the idea of having something like Octave on a board like this, though. Even if C++/Eigen would give you much better space efficiency and performance in your physical computing projects, it wouldn't be a good starting place for anyone who isn't a software geek.
- Bruce
BruceF
 
Posts: 212
Joined: Tue May 03, 2011 3:51 pm

Re: Adaboard Anyone?

by westfw on Mon Jan 14, 2013 5:48 pm

"one statement of my program ate through 2k of RAM and my program is xxx bytes long."

The other problem is the three (probably, at least) matrices of intermediate results that have to be (probably) dynamically allocated to store intermediate results of that one statement.
User avatar
westfw
 
Posts: 1373
Joined: Fri Apr 27, 2007 12:01 pm
Location: SF Bay area

Re: Adaboard Anyone?

by randomvibe on Tue Jan 15, 2013 12:28 am

BruceF wrote:I'm not much of a C++ programmer, but even I have implemented that syntax in C++.

Yes, I'm sure it can also be implemented in fortran, pascal, basic and even assembly language, but not necessarily the quickest & cleanest approach. I've programmed all those languages (except assembly), and after discovering Matlab and Octave, there's no going back. Python is okay too.

A few months ago I visited JPL in Pasadena, CA. To my surprise, the engineers there were programming planetary rover prototypes in Python! I think it's here to stay. Just so that everyone knows, the goal of this thread is to raise awareness for the possibility of an Arduino Due-like board or single-board-computer programmable in Octave (free Matlab) or Python - this might be the future.
randomvibe
 
Posts: 36
Joined: Tue Jan 24, 2012 6:26 am

Re: Adaboard Anyone?

by BruceF on Tue Jan 15, 2013 1:26 am

Well hey, like I say, I like the idea of something like Octave on an embedded board. Having access to C++ is also great for those who can use it, but that seems to me more like an extra than a core component of the platform I think you're defining. And if it's Python you want, both the Raspberry Pi and the BeagleBone have you covered already. No cut down, matrixless PyMite required.

I don't think the Due is a good choice for this sort of software. It's basically a beefed-up version of an 8-bit microcontroller board, which is computationally a different animal than the "smartphone class" processors you can get in the same price range. The BeagleBone wins out on GPIO over the Pi, if that's important to your application, so lets compare the BeagleBone to the Due:

720MHz Cortex-A8 vs 84MHz Cortex-M3
256MB vs 96kB RAM
SD card vs 512kB flash
Ethernet vs none
FPU vs integer only

The Pi comes out looking even better on those specs, but in either case it looks like at least an order of magnitude better compute and storage vs the Due, and the lack of an FPU on the Cortex-M3 would drag things down even more. Don't get me wrong, the Due is a great uC platform, but it doesn't give you the headroom I think you'd need for a comfortable Octave (or numerical Python) environment. You may be able to get *something* to run but as westfw points out, with 2k RAM here and 2k there, it wouldn't take long before you run out of space.

So maybe you get, say, a simple Kalman-based sensor fusion IMU running on the Due in "Octave lite" - that's great, but it doesn't mean you've created a platform for merging ease of use, numerical methods and embedded computing. Which is what it sounds to me like you're aiming for here.
- Bruce
BruceF
 
Posts: 212
Joined: Tue May 03, 2011 3:51 pm

Re: Adaboard Anyone?

by Chuckz on Tue Jan 15, 2013 11:14 am

randomvibe wrote:Frustrating by all the new single board computers boasting power, speed, RAM, awards, yet prove to be incomplete power hogs that run very slowly when real life sensors are included? Frustrated by poor documentation and myriad of scattered wiki links and forums? The usual response to this criticism is education - you'll learn. I think the main education has been how to sell and hype. Maybe they'll be knighted next year.

That said, one thing very enticing with new boards is the ability to program your project in Python. Even better, it would be nice to program in Octave! Octave is the GNU version of basic Matlab, arguably the best language for engineering and feedback control systems - absolutely perfect for robotics. Clean concise programming and vector math! Every engineering student and professional knows what I'm talking about.

I'm not an adafruit representative by any means. I am a customer impressed by Adafruit's ability to pick the right component or sensor and integrate it with a simple to use breakout board at a very reasonable price, cheaper than sparkfun. Now adafruit claims to be engineer, but I've mostly seen selling and hacking. So here's an engineering challenge: design the Adaboard -


I have several microcontrollers but ARM is my microcontroller of choice but the ARM board I like is the STM32 which has plenty of RAM and I/O. It is probably harder on the learning curve because a book is probably needed unless you are versed in C and know what to do.

Who is the audience here? The audience is people who want to learn, people who want to make creative new things, children, etc. Adafruit knows their audience better than me but I think their audience is a reflection of the products here. There are also different categories of their audience: Consumers and Makers. I'm not sure consumers have the same goals as professionals and engineers. Arduino is here because it is probably the easiest to learn. Some of us are also not well off enough to buy an oscilloscope so we are also limited in what we can create which means that some of the things your board can do might go unused by the average person.

The price difference is about $16 for an ARM board verses $49 for the board you suggested according to the price you gave. I basically had to put out $50 for a USB to Jtag connector, around $40 for a book, around $40 for a development board off of ebay to learn someone's tutorials and books on C and Linux. I also bought several LCDs. I also bought an FTDI cable because others want to develop ARM with the FTDI cable. If I were to buy your board, there are development costs or unknown costs to me. I'm not sure why I have to learn PYTHON when there are other adequate languages and each language requires that I have downtime and I have a busy life. As a beginner, it is easier for me to damage several $16 dollar ARM boards than a $49 dollar board because of the costs involved. My way is more forgiving in learning.

Your audience is "...every engineering student and professional". In other words, I would have to learn Python, Octave, Matlab, and vector math; it is so much studying for me and little reward in return for what I want to do.

The staff here was really nice in answering you, in my opinion but there are different costs, different languages and things that you want to do than I want to do. As a customer, I am not pulling in the same direction as everyone else. I also hope you enjoy doing what you want to do.
Chuckz
 
Posts: 159
Joined: Mon May 30, 2011 10:54 am

Re: Adaboard Anyone?

by westfw on Tue Jan 15, 2013 12:41 pm

The staff here was really nice in answering you

I don't think that any of the discussion has come from Adafruit "Staff." They're the ones with the pink-highlighted posts...

I'm sure it can also be implemented in fortran, pascal, basic and even assembly language

Huh? Not at the syntax level you're looking for. Presumable you could modify compilers to do it, at the expense of becoming non-standard, but that's not what I'm talking about when I say you could implement it in C++.
C++ has the ability to define a class/datatype (eg "Matrix" or "Vector"), and then to provide custom functions that are associated with the standard operators (+, -, *, /, etc) So you can have code that looks like:
Code: Select all | TOGGLE FULL SIZE
     Matrix A(3,3), B(3,3), C(3,3);
     A = B * C;  // matrix multiplication.

I see that some libraries have used "~" for Transpose and "!" for invert (Normally C's bitwise and logical inversion operators), so your equation could become
Code: Select all | TOGGLE FULL SIZE
K = Pp * ~H * !(H * Pp * ~H + R);

http://www.techsoftpl.com/matrix/doc/binaryop.htm
User avatar
westfw
 
Posts: 1373
Joined: Fri Apr 27, 2007 12:01 pm
Location: SF Bay area

Re: Adaboard Anyone?

by randomvibe on Sat Jan 19, 2013 3:40 am

BruceF wrote:So maybe you get, say, a simple Kalman-based sensor fusion IMU running on the Due in "Octave lite" - that's great, but it doesn't mean you've created a platform for merging ease of use, numerical methods and embedded computing. Which is what it sounds to me like you're aiming for here.

What I'm aiming for is basically an Arduino Due like board (12 ADCs, lots of GPIO, hardware serial, I2C, etc.) programmable in Octave for "...artists, designers, hobbyists, and anyone interested in creating interactive objects...", not for numerical methods, not for low level embedded computing, not for learning linux. I want to make stuff, without having to worry about registers, makefiles, etc. I want "...easy-to-use hardware and software..." That said, I think an Octave-based platform fits that bill much better than C-based platforms. Python is okay too if Octave can not be had.

This goes without saying, but the vector programming capability would further extend the "easy-to-use hardware and software..." idea to matrix intense operations, such as the Kalman filter.

BruceF wrote:...the Due is a great uC platform, but it doesn't give you the headroom I think you'd need for a comfortable Octave (or numerical Python) environment. You may be able to get *something* to run but as westfw points out, with 2k RAM here and 2k there, it wouldn't take long before you run out of space.

Sadly, that is probably true. Someone would have to invent an Octave-lite version. On the other hand, leaflabs has demonstrated Pymite on the 32bit Maple (less capable than Arduino Due) - my guess is that a few basic matrix functions won't kill space.

I think the adaboard would probably have to be a single board computer like the R-Pi and Beaglebone, however with an R-Pi like price, with ArduinoDue like peripherals, with zbasic like documentation ( http://www.zbasic.net/doc/ZBasicSysLib.html ). Is this possible? Would you buy it?
randomvibe
 
Posts: 36
Joined: Tue Jan 24, 2012 6:26 am

Re: Adaboard Anyone?

by sellensr on Sat Jan 19, 2013 10:46 am

I actually have a Due that I've been programming. It is exactly as accessible as the extremely approachable UNO. Reading ADCs and DIO is the simple analogRead(pin) format you want, without messing with registers. The board and IDE exist and there's a lot of experience with the Arduino IDE out there already.

I work in engineering development where we often use matlab to prototype applications. Even with GHz PC processors and FPUs we usually wind up with C code for the speed. I expect a matlab like platform would be painfully slow on anything less than a current desktop, because that determines our tolerance for delay.

Matlab's strength is the integrated environment and interpreted code for instant gratification on debugging. You will not get that with a uC that stores it's program in non-volatile memory. An embedded system will probably continue to to have a compile and download step from a programming system running on a computer, so why not stick with proven, efficient C code for the uC specific elements and handle the abstraction in the programming system? Write your matrix algebra in the high level language of your choice and use automatic code generation to translate to C code you can take to any platform.

Integrating that compilation process to be seamless for the user is a software challenge, but it's all on the programming platform (your computer) and not a uC hardware question.

Maybe an Arduino IDE preprocessor directive like this:

#beginYourPreferredLanguage
Your Code goes here
#endYourPreferredLanguage

could send your high level code off to a C code generator. It's an open source world...

The biggest obstacle would be interpretation vs predetermined variable typing. That's what makes matlab and similar systems slow and you would need to resolve that.
sellensr
 
Posts: 13
Joined: Tue Nov 06, 2012 8:41 pm