Pages

Saturday 24 November 2012

The return of the Geocaching Robot Arm!

I had a five-degrees-of-freedom robotic arm; you could control it over the internet, and see what you were doing via a webcam.

But the tiny PCB that interfaced it to the PC stopped working, and I couldn't find a replacement. So I archived the cache. But now!

I've found a different PCB to control it, the Pololu Micro Maestro, which I got from Hobbytronics for £15.76. It's a tiny little thing, an inch or so, but it's very nice. It will take USB (and is powered from the USB), but I can use a separate power supply for the stepper motors that power the arm.




I connected it to my desktop computer, and then started installing stuff; I think I installed .NET. I'm not sure because modern practice is to hide all the technical stuff behind a barrage of marketing-speak. I connected the Maestro to a stepper motor. I installed a USB library. And then I messed about with it a bit until suddenly, the stepper motor buzzed; it was working!

So, I powered up the computer that used to control the arm. It was a *very* old version of Linux (Red Hat 8); several years old, and it didn't use Yum. Yum is that way you install Fedora Linux software; you type "yum install whatever", and it goes and gets it and installs it for you. Payment? This is open Source; you don't pay for it, it's free.

After a while spent installing software the way we used to way back then (10 years ago), I decided, blow this for a game of soldiers, and brought another computer out, this one running Fedora 6, vintage 2006. This had yum, and was looking OK, but I couldn't make the web cam work, and some of what I wanted to use wasn't yum-installable. Then, in a flash of inspiration, I thought "Raspberry". So I powered up the Raspberry Pi. That uses apt-get to get software (this is Debian Linux) which is really just yum but a bit different. And that turned out to work like a charm. I just apt-getted (apt-got?) a few things, and the webcam worked, the Pololu Maestro worked, and the external relay box worked. And at that point, ladysolly stuck her head in and said "I hope you're not going to be running a load of noisy computers all night?" No, I'm not; the Raspberry has no fan, and it's totally silent.


You can see my thumb; that shows you how tiny the Pi is.

So, here's the way it works. The Raspberry is at the core of it all, and I'm using a USB hub to plug in two webcams and the Maestro. The Raspberry sends commands to the Maestro like "UscCmd --servo 1,6000" which tells the Maestro to move servo 1 to position 6000, and the Maestro controls the six servos that power the arm. The electrical power for the arm comes from an old PC power supply; that gives me a very steady and reliable five volts which is what the servos want.

There's two webcams, because with only one, you only get one point of view, and you're trying to position the arm in three dimensions. The second webcam helps a lot. The webcams are different; one is a very, very old cam I've been using for this sort of thing for maybe 10 years, it's a Creative webcam. The other is a Mustek Wcam 300A, a mere 7 years old, and was part of a project I did back then. You can see that the colour balances are quite different; the smaller cam is closer to reality. The interesting thing about this, though, was that both of them worked straight away, as soon as I connected them to the cam and ran the software (called 'streamer', a very simple program, which seems to work where others make me struggle to get them going).


In this picture, you can see the Maestro. It's the tiny PCB with the green and yellow LEDs.

And there's a relay box, so that the power to the arm, and the lighting, can be switched off when the arm isn't being used. I'd run that off the Raspberry too, but when I try, the power draw is to great that it crashes the Raspberry. So I've got that controlled by a different computer, and the Raspberry sends it a message when it wants to turn off the power. I've ordered a powered hub, though, and I'm hoping that if I use that, I'll be able to run the relay box off the Pi.

Still to do. I have to create a puzzle that needs to be solved in order to get access to the robot arm; that's necessary because if multiple people use it at the same time, they'll trip over each other's feet. So I need a way to thin out the access a bit. And I need to hide a cache that this will give you the coordinates for.

So, until I get the cache in place and the puzzle ready, you can play with the Geocaching Robotic Arm

Let me know if there's any problems.




8 comments:

  1. The link is timing out Doc @ 13:37

    ReplyDelete
  2. Alan its not working for me neither but a great idea back up and running, might have to get you to pass this over to me for another cache idea.

    ReplyDelete
  3. Oops. I messed up the DNS. Try it now.

    ReplyDelete
  4. Hey, man,
    I’m trying to achieve something similar, but can’t find, for the love of God, ANY information on how to hook up a Polulu stepper driver (or 6, in my case) to a Raspberry Pi. Is there I way we can hook up for a chat on that?

    ReplyDelete