Linux bot - hardware configuration options

Hello,

I’m going to be working on two bots - one will be a ‘simple’ AtomBotBoard-based rover, and the other will be a longer term project based on mini-itx and linux.

I want to start collecting the hardware for the linux project, but I’m not really sure what the best options are. I think a lot of other people have this same problem, so maybe this thread can be useful for coming up with workable configurations.

Here are some requirements:

  • mini-itx motherboard
  • minimal linux kernel, no GUI needed
  • flash-based disk with plenty of space for the OS, java runtime, programs and potentially lots of data
  • respectable CPU and memory spec
  • wifi
  • minimal power consumption
  • standard lipo/nimh battery pack powered
  • noiseless - no fans
  • minimal size
  • easy integration with SSC-32
  • easy integration with Sabertooth dual motor controller
  • easy integration with popular IR/sonar sensors

Cost isn’t a big issue, but I’d like to keep it reasonable - let’s say $300-$400 not counting things like the SSC, Sabertooth and sensors (all of which will come from lynxmotion.com :wink:).

I’d also like recommendations on the best linux kernel given the above requirements. Ease of installation/configuration is important; I don’t want to spend all my limited time trying to get to first base.

The goal of this project will be to create an “intelligent” autonomous bot with Java code running natively in the linux kernel.

I want it to be on my wireless home network, and I expect to be able to use putty to connect and push out code, debug or control it.

Thanks for any help you all can give, and I hope that others may benefit from this discussion as well.
-Adam

I’ve been looking at Linux based robotics options for awhile now. :smiley: I am planning to use a Linux based controller for a robot at some point in the future. Are you absolutely tied to using a mini-itx motherboard?

I ask because there are a couple of reasonably priced Linux based controllers you should look at too. One is the TS-7260 and another is this one sold by Sparkfun. Now, I have not actually used either of these, but they are two choices I am looking seriously at for the future.

The 2.6.x kernel will be your best choice, since it has features that have been tuned for smaller and more limited platforms. It also has specific features designed to make it better for embedded applications, like robotics.

This will be very cool! I haven’t tried to do anything with Java under Linux yet, but I have controlled an SSC-32 using Python under Linux, FreeBSD, and Windows XP. :slight_smile:

This should not be a problem. As long as you have the capability of building software for whatever Linux controller you end up using, you can put whatever software on it you want.

8-Dale

No, as long as it works with “standard” flash disks and other peripherals. Also, the mini-itx stuff seems more powerful, but I could be wrong about that. I’ll look into those other options you mentioned.

Thanks, I hope it works out. To do it right will take a lot of CPU, memory and storage - way more than something like the ABB can provide. I’m looking forward to the prgramming challenge; I just need to get this hardware stuff out of the way.

Nearly any x86 mini-itx board is going to meet your basic requirements. Linux support for the VIA chipsets is good, and Linux support for the Intel chipsets is superb. The things that don’t work on itx boards in Linux are generally stuff like hardware acceleration for video (MPEG2/MPEG4) or cryptography (RSA/AES), but if you’re using this as a minimal terminal none of that matters.

As far as a flash drive goes, space is the issue. Linux runs fine with a very small amount of storage (especially in a no GUI configuration) so you don’t need that much. If you’re going under 4GB you can use USB sticks, CF with an adapter, etc. If you want bigger, I’d suggest using a 2.5" laptop drive since the cost of getting bigger flash drives is prohibative.

Wifi is painful if you buy the wrong hardware. I’d skip any attempt to buy an integrated system (i.e. wifi on the motherboard) and just pick up a USB adapter known to work well with Linux for $50.

As far as integration, nearly all boards come with serial ports and USB. If push comes to shove you may need a USB to serial adapters, but integration is not an issue.

As far as being fanless, all these chips can be made fanless by sticking a bigger sink on them. I have some Pentium III 800 Mhz chips I run fanless with sinks taken from older Athlons that died. The sinks are about three-four times the size of the original PIII sinks, and the chips run a few degrees hotter than before, but I’ve been running multiple machines like this for years and they’re fine. All the VIAs and most of the Intels come with small active sinks for use in a tightly confined case. If your bot isn’t going into harsh conditions (read water), just slap a bigger sink, design in an airflow path and go. All these processors are under 30 watt, which makes this okay.

The biggest issue is power consumption, which is directly related to processing power and price. In the $300-$400 range, Core Duo is ruled out due to cost, Pentium 4/D ruled out due to massive power consumption, leaving you with a handful of options:

  1. VIA integrated boards (C3) - Low power consumption, very low processing power, fairly cheap.
  2. VIA C7s - Low power, low processing, very expensive.
  3. Pentium III boards - Moderate power comsumption, mild processing, very cheap.
  4. Pentium M boards - High power comsumption, moderate processing, most expensive option.

If you don’t really need say anything faster than a Pentium III 500, go with a VIA C3. The 500-800 Mhz ones go for < $100 on eBay and take PC133 RAM.

Personally I’d avoid the C7s since they’re too expensive for what you get, and there is the largest chance (albeit still rather small) you’ll run into a support issue. A 1.0 Ghz C3 could be beat by a 500 Mhz PIII. The C7 is slightly better, but unless you get the high end 2.0 Ghz models (which cost as much as PIIIs and Pentium Ms anyway), they’re still not going to give you the best processing power/ price ratio.

That leaves PIII and Pentium M boards. I have nothing but good things to say about my PIIIs. I have some I’ve been running for nearly 8 years. The only thing that prevented me from getting some Socket 370 boards was that PIIIs are older technology and the processing/ power ratio of newer Core processors (especially when not in use) is signficantly better. However if you’re on a budget or have older PIIIs handing around I’d highly suggest a Cromwell LV-603 board or similar. For $150 you can get a board that takes PC133 and a desktop Socket 370 PIII.

I haven’t looked too much at the Pentium M boards since they’re much more expesnive. Cromwell and other good manufacturers have Pentium M itx boards, but unless you need the extra processing power, I won’t really recommend these. The boards can go as high as $300 without processors, which is getting into the Core Duo range. If you’re luckly you can get a combo for under $400.

Sorry I went off on a bit of a rant, but I’ve been looking closely at itx hardware recently. I’ve more or less decided on this Core Duo 2 board:

http://www.epiacenter.com/pictures/news/2007/peb-7602vg2a.jpg

Essentially it’s a Core Duo 2 itx board which supports DDR2 800, 2 Gigabit ethernet ports, 4 serial ports, 8 USB, PCIe x16 and has 6 SATA ports. It currently goes for $400 from the manufacturer. I’m going to put in a $315 Core Duo 2 775 2.4 Ghz, and use this as my basis to upgrade all my PIII machines.

As far as Linux goes, I’d either stick to a distro you know. Or if you know it won’t work easily with your choice of hardware, try Debian. Debian has a lot of dedicated devs. working on the project and has made configuring and maintaining my machines much easier.

EDIT: Typos galore…

Tillin9, that was an awesome post. :smiley: I need to let these ideas marinate, but I just wanted to say thanks. I am going to have several follow-up questions…

I have to agree with you here. I’ve had a 733 Mhz Pentium III with 192 Meg of SDRAM running rock solid for years. It has happily taken all the Linux and FreeBSD stuff I have thrown at it and just keeps on going. Right now, it is running DNS, web, ftp, and database (MySQL) services for four of my domains, and is directly on the internet. This is the only PC I have never had any hardware problems with, so that should say something.

On any type of PC compatible board, I’d say Debian would be a great choice if he doesn’t have any serious experience building Linux from sources. Otherwise I would suggest going with Gentoo. So for, to get a Linux box up and running fast, Debian is my new favorite there. :smiley: When I want to control everything that is on my Linux box, I go with Gentoo or scratch build a Linux system.

That reminds me, I need to get back to my ARM toolchain project too. I already have the tools for AVR development under Linux.

8-Dale

Hey guys,

I’ve read and re-read what you wrote and done some more research, and now I have a few follow-up questions:

  1. With regards to the motherboard, I’m mostly concerned about power consumption and processing power. I’d like to get something at least 1 GHz with a FSB of at least 533Mhz, but I don’t want it to consume a lot of power or get hot with passive cooling. Cost is less of a concern. A P3 isn’t really an option since they are so old at this point. A 65nm Intel Socket M would be sweet. Via would be ok if it works. Oh, and it has to have a few serial COM ports. What would you recommend given these more refined requirements? I’ve been looking at stuff from mini-box, Kontron and BCM, but nothing is jumping out at me.

What do you think of these?
emea.kontron.com/index.php?id=22 … uctid=1759
mini-box.com/3368G-Pentium-M-Celeron-M-MBD

  1. I’m going to use a 4GB IDE embedded flash drive. What is the best way to get a bootable linux image on there? Should I mount it in my PC and perform the installation there, then move it into the mini-itx?

  2. I’m not sure what wattage I need for the power supply. Do you think 60W is enough? I’m looking at the mini-box picos… should I just go for the 80W or 120W?

  3. Linux distro… Red Hat is the only distro I’ve ever used, but I don’t have a preference. I want the best distro for the application (minimal kernel, no GUI), and I’d prefer the convenience of an installer vs compiling a source code distribution (but that prospect doesn’t frighten me). What distro would YOU use given my system requirements? This is the hardest question for me. Also I don’t mind paying for a quality distro.

I’ve been looking at this minimal Debian distro:
debian.org/CD/netinst/

Is that a reasonable choice, or will I have issues getting it to recognize all the mini-itx hardware features?

Thanks!

There should not be any problem interfacing any small Linux based controller to these devices. Yes, the mini-itx boards will be more powerful, but you have to decide how much power is required by your robot, which will be decided by how much processing you expect to do right on the robot itself.

Remember that the small Linux based controllers are running at least 200 Mhz for the ones you would want to use for this robot. That is considerable processing power right there. There are the small and powerful microcontrollers made and sold by New Micros - the Pluga and Tini series are both ones I am seriously considering, but these are ARM7 based and do not run Linux. Right now, for ARM based controllers, I am favoring the Pluga series, and the development kits for both Pluga and Tini are very reasonably priced, using Open Source tools such as GCC…

8-Dale

A P3 is not slouch. I have always been amazed at how much I can do on the 733 Mhz P3 with 192 Meg of RAM I have running Linux (currently, Debian Etch). Don’t count the P3 out as a possibility as there are many small form factor boards still available and being used for embedded applications. You can still get a 1 GHz P3 board in PC/104 and other form factors from companies such as Ampro and others. If money isn’t a problem, take a look at Intrinsyc (Cerfboards) and Applied Data (Bitsy, BitsyX).

Treat these just like a solid state hard drive. How you get Linux onto it depends on which motherboard/controller you get. For mini-itx and similar boards, attach a CD-ROM drive and install the base system from there. For Debian, you can install the rest from the internet after the base system is working. You can install the entire Linux system from CDs or DVDs in the case of Debian and others.

I would have to go with Debian if at all possible. I have two systems here dual booting with Debian Etch, and haven’t had so much as a single glitch. Debian is 100% FREE and top quality all the way. Hmmm, I’m starting to sound just like Tillin now… :slight_smile:

It’s the kernel that is going to determine what hardware features are recognnized and usable. Go with the most recent 2.6.x kernel, since it will provide the support for the most hardware. As long as the board you choose doesn’t have any really exotic hardware, there should not be any problems. I would advise you to install Debian on a PC and take it for a test ride before you select a board to use for your robot. You will need to learn how to configure and compile a kernel to support just the specific hardware your board has, so as to be as small as possible. Everything that can be should be modules, except the filesystem and driver(s) for your root (boot) disk device and possibly network interface(s).

8-Dale

Hi,

I have been working on a mini-itx/linux robot project. So I got a VIA ML6000 board (fanless, 600Mhz) with 128Mb RAM and a flash card reader. I also use an 80W picoPSU DC/C converter.

I chose the mini-itx because it is very flexible and can be used for a lot of other things than robotics. And also because I need CPU power for image processing.

However there ARE other alternatives to consider. For example, ARM based boards such as the ones here:
embeddedarm.com

Currently, I just want to control an arm (the Lynx 6 from www.lynxmotion.com ) :smiley: and have it move chess pieces on board.

I am using Damn Small Linux from a compact flash card. It was a real pain to create a bootable card with Linux on it (I had to use some dos tools to format the card and do a raw copy of the linux image), but eventually got it working. I used a 256Mb compact flash card.

One important thing about flash cards is that they have limited write cycles. So you want to be careful about writing data to them (especially log files). The flash card is mounted as a read only filesystem, but at boot-up a RAM file system is created and Linux will run from there. When the system shuts down you lose all your data.

Now there are a few things you need to be aware of as far as performance goes.

Linux is not a real time or a reactive OS, which means that the process controlling the robot (for example to send PWMs to control the servos) could get interrupted by other processes, based on the priority it is given. Also that process could get pre-empted if executed at the user level.
The context switching between tasks may take time and you may not be able to satisfy the timing requirements for generating PWMs.

One solution is to use a dedicated board such as SCC-32 or AtomBot Board connected to the ITX serial port. But you would have to write a system level Serial driver.

So, you may need to consider a Real Time Linux (see RTAI : rtai.org)

The other thing is power consumption.

The following link provides a rough estimate of how much power you need, depending on your configuration: resources.mini-box.com/online/po … lator.html

Thanks for the information… I’ll go ahead and hook up a CD-ROM drive for the install, and I’ll roll with Debian and see how that goes.

I understand, but that’s just because you already own the P3s. The 1.5Ghz 65nm M processors can be had new for about $80, which is roughly equivalent to “free” from my perspective… I can’t think of a reason to go back to 1999 technology for a new purchase when there are affordable modern low-power alternatives that slay a P3.

Check out this processor… 65nm 1.46Ghz with 533Mhz FSB for only $82:
newegg.com/Product/Product.a … 6819111258

I’m not decided on the CPU/board though… I need to spend more time looking at the options and also educate myself more on CPU power consumption between the various choices. Any further insight is more than welcome…

I’m going to stick with the mini-itx form factor for similar reasons. If I get bored with the bot, I’ll put it in a little box and still have a nice linux server. I just need to decide on which board and which CPU.

I’m trying to avoid these pitfalls by spending the extra cash on a IDE flash solid state disk. The flash cards are cheap though.

That is precisely what I plan to do.

Cool, thanks for the info. Edit: I checked out that link… holy crap, that’s exactly what I needed! Great stuff, thanks so much.

Excellent! Do let us know how things progress. :slight_smile:

I agree. However, for times when keeping cost down and capabilities as high as possible, I still think a 1 GHz P3 would work very well. Using newer technology is generally better when one can do it.

I can almost always come up with more options. :smiley::smiley:

8-Dale

I bet we’d all like to hear more about this Damn Small Linux. Is there a website for it? I’ll google for it and see what I can find.

You can prevent data loss by using a solid state disk. I can’t remember the website and company, but I’ll dig it up and post it later.

This should be qualified - Standard Linux is setup for real time processing. There are Linux distributions specifically tuned for real time operation though, and these have kernels tuned for rapid response. When using an SSC-32 to control servos, you do not have to worry about PWM timings at all, since it handles all of this automatically. That makes PWM timing a non-issue. :slight_smile: PWM timing is only an issue of your controller is controlling the servos directly and not using a servo controller like the SSC-32.

Why would one have to write a system level serial driver? Linux already supports standard USB and old style serial ports natively. All you have to do is write the code to send the commands to the SSC-32, which does not require a special driver. You just send ASCII command strings to the SSC-32. To use a Basic Atom or Atom PRO as a controller, you would have to write software for it to accept commands over a serial port or via other means. process them, and then act in whatever means your robot requires, such as sending commands to an SSC-32. It would be much simpler to just let Linux send the SSC-32 commands direct, which would not require any special timing.

8-Dale

Here is the DSL website :
damnsmalllinux.org/

It may be easier to create the bootable flash or USB pen disk from a Linux host.

I was considering the solid state disk but they are very expensive.
For my project, I could just use a 2.5" hard-drive (either internal or external) since it won’t be a mobile robot.

For communicating with the controller it’s true that all I should need is to send these ASCII strings and get feedback via the serial driver.

But I am wondering if that code should be handled by a real-time scheduler compared to behavior and image processing tasks.

I have been looking at RTAI which is an add-on to the standard linux (you need to apply a patch to the kernel). It basically replaces the linux scheduler with a real-time scheduler.

Couple of things…

asv, knowing your budget a bit better, I’d advise you to check out Core Duo instead of Pentium M. Or if power is really a concern, try the low voltage or ultra low voltage CD/PM (ULV Core Duos can get expensive fast, the Pentium Ms might be better in that regard) variants. Note: Core Duo 2s come in Socket 479 and LGA 775 options. The Socket 479 boards do Pentium M, Core Duo 1, and low voltage as well. The LGA 775s don’t.

That Kontron board was what I wanted to use in my Core Duo 2 setup for months so I could use a low voltage Core Duo 2. It probably would retail for around $300, since most of my boards won’t need the 6 SATA ports, at 4 boards with one SATA RAID card (I recommend HighPoint 2220s at $250) using the Kontron board would be slightly cheaper than the one I eventually picked and Kontron is a good company. Did they finally release the thing? For awhile I checked religously to see if I could buy it anywhere, but with no luck.

The Pentium M board you linked to is okay overall, good for the price. The lack of SATA, only DDR-333, and those odd white connectors (might need a special cable for USB or serial, though they seem to have most on the hood) are my only reservations.

As far as a 4Gb drive. If you are using a Compact Flash card with an IDE adaptor, or some kind of IDE plugin module, you can install Linux directly onto the module. If you’re using a USB thumbdrive or MMC via USB (I won’t do this), you might have to do something more complicated.

I don’t know how much space is needed for a default DSL install, but a minimal Debian install (off the stock netiso) only takes up only 160MB (Not sure if it needs more for the actually installation, I’ve never tried to go as low a 256Mb, worked fine on 1Gb). Once nice thing about Debian is that in the vast majority of cases you can just rsync -auxv / /(where the other drive is mounted), then boot up grub to configure the MBR and you’ve effectively duplicated your boot image. When I upgraded the terminal machines in my lab (they had be designed diskless) to disked 80GB SATA drives, I got one working, then just imaged all the other drives.

As far as power, 60W will be enough for a Pentium M or Core Duo (under 30W) since you’re running from flash and not adding a powerful video card, and PicoPSU is pretty good railwise. If you might use this as a desktop (add a red or green video card) or a server (add a bunch of hard drives), you might want to get the 80W since the price isn’t that different.

Note I’ve used the power simulator before. It’s nice as a rough guide, but things like a 5 1/4 CD-ROM taking 25W are plain wrong, I have DVD burners that don’t pull that much when burning. If power is a real concern and you want a CD drive on the bot, obviously use a slim CD (I think space might be a better reason). Similarly 15W for 3.5" hard drive is also not really accurate, while a correct average. Different drives and different sized drives have different pulls during use/idle and startup (biggest concern). Any new SATA drives has about 6W pull (80Gb Seagates/ WDs/ Hitachis) to 12W pull (200Gb WDs, 250Gb Maxtors, 500Gb or 750Gb Seagates). What kills you is startup. These drives can pull 25W on spinup, so if you’re making a RAID array a controller with staggered spinup is a must. However, since the processor isn’t at full load, you can sneak past boot if you only have one or two drives.

As far as distro, Debian is a good choice since you’re coming from another package distro. If you plan on having tons of programs or data you might want to check out Gentoo just because installing much beyond the base system (mainly anything with X dependencies) on Debian is watseful since they don’t really minimize package dependencies. I.e. to install something like OpenCV (vision recognition) and development libraries on your bot, you’re going to end up using the same space as a minimal KDE configuration (around 3Gb).

I do fully agree with linuxguy that you should install Debian on an extra PC (if you have one) or just do a test install on the bot not worrying about space, as it will help you learn all the administrational stuff first. Granted having used REL breifly, I think you’ll find it much easier.

As far as hardware goes, Debian Etch (testing) uses a 2.6.18 kernel and Debian has really good tools for compiling custom kernels (I know way too much about this, so feel free to ask) so if your hardware is supported at all, it will work. I’m sure you already know the things that don’t work well under Linux, but unless you chose a VIA board with its bizzare chipset hardware accelerator (again for MPEG, AES, and GUI stuff, all CLI stuff should work fine) the biggest issue you’ll encounter is picking the right WiFi card. All but the newest red and green video cards work (though performance might not be as good as it can be), and I doubt you’re using one, a printer/ scanner, or odd RAID card or bluetooth dongle (the other areas where Linux is weak with hardware support) on this project. Red Hat ships a highly patched (and thefore now requiring much more testing) kernels and lag behind. Debian’s kernel is more or less a vanilla one with a few Debian patches and some standard distro defaults applied. The real reason for the Debian patches is more to make sure the kernel works with the package management system, things go in the right place, and if you compile things oddly Debians default tools can handle it. They are not the driver extensions and experimental tools (a la GFS) that exist in the Red Hat world.

As far as your flash drive becoming unusable because of Read/ Writes. This is a very real possibility. The first step is to not use a swap partion/ page file. Make sure your bot has enough RAM. Another reason for Core Duo 2 is you can have up to 48Gb. Unless you really do something to exacerbate the flash wear the vast majority of consumer grade flash should last just fine with this setup it has about (500,000 writes per bit). I’d give a ballpark estimate of 5 years of heavy use. If you’re going to write a lot to the drive, you might want to pay up for industrial grade flash (5,000,000 writes per bit, much better wear-level handling, and more spare bits). dvnation.com/nand-flash-ssd.html At $300 the PQI 4Gb IDE DOM isn’t as cheap as a consumer grade Compact Flash, but it will give you at least 10 years unless you really trash it on purpose. An alternative is to use a filesystem designed for flash. This is what OpenWRT and many other embedded Linux distros do to help minimize flash wear. This makes your root partition JFFS2 or SquashFS (two filesystems designed to operate on mainly in RAM and to rarely write to the filesystem), though you now need even more RAM. I don’t think stock Debian supports this (the installer’s mkfs probably can’t do those), and I’ve never personally tried this, but I’m sure its easy to do as OpenWRT is Debian based.

Finally, I would never rely on Linux being able to do realtime stuff on a PC bot. Using a Pentium M GPIO to do PWM is highly wasteful if not bad for a whole lot of other reasons. If you were running Linux on an embedded ARM where it was the only prcessor in the bot, things would be different. However, using the SCC-32 or other servo and motor controllers which are realtime embedded will be fine, I’m assuming this bot isn’t for use in ultra critical application. Judging by how many serial ports you wanted, I’m guessing you already planned to do this.

Hope this helps…

Just a quick question - with all this talk of using a flash with the already stated limitations on write cycles - how do you plan on handling your swap partition under Debian? Isn’t this area one of ultra high write activity?

Just a thought

Chris

I know others are using Flash cards and USB sticks because they are cheap, but just to make sure we are all on the same page, this is the disk I am currently planning to use:

mini-box.com/4GB-DOM

I thought these solid state IDE DOM Flash drives did not suffer from the limitations of the cards and sticks. Please correct me if I’m wrong about this.

Simply put, you don’t use a swap file when running from flash. If you’re able to afford flash, you should be able to afford more RAM.

asv, those ADM DOMs look pretty good. I’ve never heard of them, so you might want to check around to see if they’re really quality. Considering I can get 4GB CF and MMC flashes for closer to $50, I’m willing to believe they’re really using the more expensive stuff.

Not from what I can tell. They appear to be well packaged nand-flash based disk modules with wear leveling software built in. they are convenient in that they just plug onto an IDE header.
I am going with a CF200 compact flash adapter, replacing the header on it with a socket strip (like Samtec SSW series) and using a 4GB CF card. My XP install has no swap disk allocated, and all logging and perfomance monitoring stuff turned off. I still see a periodic twitch happening from something called lsass.exe which I am trying to figure out how to stop.