Saturday, 20 January 2007

1st Mockup

I thought I'd try and see if the NSLu2 fits on my chassis.
Looks like it will fit. A couple of concerns at the moment is I need a way of mounting the NSLU2 that will allow me to remove it easily but still keep it in place during use. The USB key hangs over the side of the chassis, it looks a bit vunerable, I guess I could either get a smaller key or move it somewhere else.

The weight needs to be over the ball caster else it tends to tip, I'm sure the positioning of the batteries can be used to balance the robot.

The last photo shows a very rough mock up to try and establish the size of the circuit board. I've temporarily put 32mm spacers on the chassis and cut out some cardboard (courtesy of Mr Kipling, mmmm cake!!!). I've ended up with a 125mm disc with a 98mm x 30mm slot. One interesting thing I've noticed is the power socket on the NSLU2 is very close to the height of the board, I'm sure there's some mileage in mounting a power plug on the board.

Labels: ,


Friday, 19 January 2007

Ruby on Rails on a slug

I was intrigued to read what this guy had managed to do, running Ruby on Rails on the NSLU2.

Here's the link

I believe he's got a ROR\Lighttpd\PostgreSQL\SQUID setup.

A couple of things I noted, he ran up against performance issues, not surprising really with 32Mb memory and 266Mhz ARM processor (The standard NSLU2 is underclocked at 133Mhz, it's a simple mod to make it run at 266mHz involving doing something painful to one of the resistors!) Secondly he had trouble with RubyGems, I've had similar problems and I've yet to get to the bottom of it.

Hopefully my NSLU2 will be able to cope with the tasks I've got in mind for it.

Labels: , ,


Thursday, 18 January 2007

Learning Ruby

Ruby is a brand new language for me, my background is Microsoft's .Net technologies so I need a good tutorial to get me started. The one I'm using is Learning Ruby with Satish Talim, which can be found here. I think it's pretty good, I'm about two thirds through his tutorial and it seems a comprehensive introduction to the language.

I've added this site to my links.

Labels:


The Chassis

I've decided on building a simple chassis based round the Pololu round robot chassis, it looks like an ideal base for low cost robot for development. I ordered the parts from Technobots. The bits you need to get a basic chassis and motor are:-
  • Pololu round robot chassis, there's several colours to choose from
  • Tamiya 70097 Twin-Motor gearbox
  • Tamiya 70144 Ball caster
  • Tamiya 70101 truck tyre set
One thing worth pointing out is the Ball Caster kit contains two casters, you only need one and the tyre set has four tyres, you need two. So if you want to build more than one robot you could save a bit of money.

All the parts come as self assembly kits, not too difficult to build, just take your time and follow the instructions. The gearbox can be assembled with several gear ratios, Pololu recommend you use configuration 'C', this is a low-speed gear ratio.

Once you've assembled everything, you can bolt it together. I think it's going to look pretty neat.





Labels:


K8048 Pre assembled

If you don't fancy building the K8048 yourself and want to get a Pic programmer for a reasonable price Maplin sell a ready built version of the K8048 here

Labels: ,


Wednesday, 17 January 2007

K8048 Pic Programmer



I just built myself a PIC Programmer. It's the K8048 Pic programmer & experimenting board by Velleman, I brought it through Maplin. The K8048 is a programmer with a basic experimentation board built in. There are for keys for inputs and six leds for outputs. One neat feature is an ICSP connector for programming embedded PICs. The kit comes in a plastic case with a high quality PCB, components, software and building instructions. It even comes with a PIC16F627 to get you started


The kit itself took a couple of hours to build and another couple of hours to find out what I did wrong! To assemble you work through a list of components to solder onto the board, it even warns you when your working with a component that has a polarity such as electrolytics, diodes etc. All the resistors and diodes are on a tape and the theory goes in the right order for assembly. This didn't quite work out in practice, a couple or resistors were in the wrong order and one was missing. It was no big deal really it just meant you had to double check the value in your hand was what you thought it was.


Once I'd finished building it I was eager to try it out. You need to supply your own PSU and serial cable, so I routed round my box of bits and found what I needed. Connected it all up, installed the software and went to program my Pic with one of the demo programs. It failed, every time I tried to flash my Pic I kept getting the message No Device ID Detected.
After a couple of fruitless hours Googling I did what I should of done in the first place, checked the schematic. It turns out one of the transistors was a PNP, I thought they all were NPN and didn't bother to check the model numbers. Because of this I'd swapped a PNP for a NPN, duhhh! Once this was sorted all worked well and my K8048 LEDs are flashing in a purposeful manner .

Labels: ,


Friday, 12 January 2007

Topics of interest to this blog

I don't want this blog to be too general, so here's my list of things I'm going to write about.

  • Ruby
  • Pic microcontrollers
  • Electronics (If its related to embedded control)
  • AI
  • Robotics
  • NSLU2 (aka The Slug)
  • Linux (If its related to the NSLU2)

I think that's about it, perhaps they need to be my keywords.

Labels: , , , , , ,


What's going on here then?

A couple of years ago I brought a NSLU2 (Aka The Slug), a small network attatched storage device that runs on Linux. This group http://www.nslu2-linux.org/ have done a lot of work hacking the system so you can use it for pretty much what you want. My original device is used as a music server, running TwonkyVision.

Recently I brought another one and instead of running off a USB hard drive it runs off a 1GB usb key, really cool. I now have a little linux box that fits in the palm of my hand and could potentially be truly portable, just add a battery. It gets better, Ruby runs on it, in fact people have installed RoR on it, but that really did slow it down. Ruby however runs fine, I've installed it, written a few programs and it all seems to work just fine.

What am I going to do with my RubySlug (See what I did there?)? Well I'd like to turn it into Ruby the RoboSlug!!! The kid in me thinks that Robots are really cool, and my past academic experience thinks that AI is pretty neat so I have a plan.

Make a robot, with motors, sensors etc, use a PIC microcontroller to capture the information from the sensors and to drive the outputs (motors etc). I'm not going to let the PIC do any of the decision making, i'm going to do that with the Slug. The Slug will be fitted with a USB to Serial adapter which will be linked to my PIC board. Ruby will receive information on the state of the inputs via the serial port and send commands back to the PIC board to control the outputs. Initialy I'll use very traditionaly fixed rules for controlling the robot, but I'd like to eventually get the robot to adapt to its environment and make up it's own rules.


I'm not sure the project has any use other than personal interest. Although it will be interesting to see what actually happens to the code. It will be interesting to see if the computer generated code is very different from what I'd come up with if I was designing the code in a traditional manner.

Well there's a lot of things to get together before I get to this point.

  • Learn Ruby
  • Learn how to program PICs, (It's a long time since I've programmed any microcontroller)
  • Design and build the hardware, (My electronics is equally rusty)
  • Get the Robot talking with the Slug
  • Get the Slug controlling the Robot
  • Investigate the current research on AI
  • Design and code a self modifying system
  • See what happens.

Labels: , , , , , ,