Hull Pixelbot Version 2.0

I've just released a new set of design files for the HullPixelBot. I've made some improvements and also added holders for the pixel lights (always useful in a pixelbot) and the distance sensor. I was quite proud of the design for the distance sensor holder, until I tried to use it. 

I thought I'd been clever by providing mounting slots for the distance sensors so that the wires could come through the slots for the connections on the back. Turns out this was actually stupid. It turned out to be really hard to make the connections with the hole. 

The new design (which you can see above) has separate holes for the two sensor wires, and they are arranged vertically so you can just connect all the bottom wires together to a common ground (or reference voltage) and then take each of the top wires and connect them to their potential divider resistor and reference voltage (or ground). I'll be doing a detailed post about wiring things up a little later. 

Interrupts Interrupted

I've spent some time writing smooth movement routines for the motors for the HullPixelBot. I want the motor movement to run in the background, so that the program can do other things as the robot moves. This will make the drive very like the behaviour that you get from a traditional "servo" motor that starts turning when the program switches it on.

Thing is, the stepper motors only turn if the program sends the appropriate set of signals to the coils in them. The solution to this problem is to use the timer on the Arduino processor. This can repeatedly trigger a bit of program code at regular intervals using a hardware technique called an interrupt.

Interrupts are used by a computer to respond to real world events. Tapping a touch sensitive screen, moving the mouse or pressing a key are all things that interrupt a running program and cause the computer to run a special piece of code called an interrupt handler which deals with the event. In the case of a key press, for example, the operating system (perhaps Windows 10) responds to the interrupt by sending a keyboard message to the currently active program.

In the case of the HullPixelBot I'm using a timer to produce a sequence of interrupts at regular events which are then used to trigger code which moves the stepper motors to their next position. The code required to do this is quite tiny, and so once the move has been completed the "normal" program can be resumed.

I don't reckon you can call yourself a programmer unless you've written an interrupt handler or two. I've done quite a few and they are rather fraught bits of code. You're not allowed to touch any of the things used by the "normal" program (in case you confuse it), and you must complete your action in the shortest possible time, otherwise you'll bring the computer to a halt. Programming ninjas can write code that uses multiple interrupts from different sources at the same time. 

Which is what I want to do. 

I want programs to be able to use the distance sensor and the motors, and for both of these devices to work using interrupts. Now, I think of myself as a bit of a programming ninja, so I knock out the code and fire it up. And it doesn't work. 

I can have motors, or distance sensor, but not both. 

I'm not surprised by this because it can be tricksy if interrupts occur during interrupt handlers. So I check the hardware manual for the processor and get myself into a state where I'm convinced it should work, but it doesn't. Hmm. Perhaps I'm not a ninja after all. 

So it was back to the start, and a careful re-write of the code to make it as smooth as possible, and remove any ways in which the two handlers (one for the timer, one for the distance sensor) could interact. And it still didn't work. No fair. 

Of course, I eventually figured it out (otherwise you would not be reading this blog post). It turns out that it had nothing to do with the interrupts. It was just that when the program turned the motors on it dropped the voltage level in the robot power supply to such a low level that the distance sensors stopped working. I was testing the code on a machine on my desktop and I'd left the motor power supply turned off so that the robot wouldn't try to run away. That lack of power was my undoing. 

The good news is that I'm now pretty confident that the code I've written is solid, and the HullPixelBot can move in a very nice, precise way, measuring distance values as it goes. And I've learnt something about motor power and distance sensors, which is useful. 

I'll be showing the code off at the hardware meetup on Thursday this week. 

HullPixelBot is going places

I spent a happy chunk of today designing and printing a front sensor assembly for the Hull PixelBot. The new part provides an ultrasonic distance measure and three light sensors. 

This will mean that the robot will be able to find and move towards light sources and also detect obstacles in its path. 

You can find out more about HullPixelBot at the next C4DI hardware meetup on Thursday 18th August. Sign up here (it's free). Anyone can come along and get into building tiny cheap robots. I'll have some more chassis kits to give away. All you need to do is add around 10 pounds worth of parts and you have a wandering pixel bot. 

And if you want to see a bunch of HullPixelBots in action I'm taking a mini-swarm to the Amy Johnson Festival Makerfest in Hull on 27th of August. 

Who knows what they'll be doing by then....

HullPixelBot can now turn corners

Spent a bit of time today fiddling with timer interrupts so that I can get fine control of the speed of the motors on the HullPixelBot. Because they are steppers they are quite precise, which means I can get the bot to trace accurate curves. 

The next thing I have to do is put the light and distance sensor on the front (along with a bumper) and then we'll have a proper robot. 

Putting the Pixel into HullPixelBot

I've reached the point in 3D design where the hard part is not expressing the design. It's deciding what the design should be. I regard this as progress. Above you can see the new pixel mounts for the HullPixelBot that we've been playing with at C4DI.

Each bot will have two pixels. One at the top between the wheels to make it easy to do persistence of vision photography. And one at the back for other HullPixelBots to find and follow. 

I unveiled the new design to an awestruck audience at the hardware meetup tonight. Unfortunately I also unveiled a rather nasty power issue where the robot motors cut out when the lights were turned on. Oh well. It might be that we need extra volts for the pixels...

Anyhoo, I'll be posting the new designs in a little while, once I'm sure that it all fits together properly.  

I gave away a couple of 3D printed kits to new folks who had come along. If you want to come, get some parts and have a go at building your own robot (it won't cost you more than a tenner to build) then sign up for our next meetup on 18th August. All are welcome, young or old, experienced or not. Sign up here

Putting the Pixel into HullPixelBot

The idea behind HullPixelBot is that it is a roving pixel robot. From Hull. We've got the robot part working quite nicely now, with motors and wheels and everything. But we've been missing the pixel bit. So today I spent some time crafting the holders for the pixels mounts.

The plan is to have two pixels on a robot.. One on the top, directly between the two wheels. We can use this to "draw with light" and whatnot. The other pixel is mounted on the back of the robot. On the front of the robot we are going to put a light sensor so that a robot can find and follow another robot with a particular coloured pixel on the back.

I'm going to spend the next day or so fiddling with the design and printing test versions to make sure it all fits together. Exciting stuff.

 

HullPixelBot on WiFi

We had a pretty good turnout tonight at the C4DI hardware group. The focus was on building and powering up HullPixelBots. I'd printed a few sets of parts and some folks had even turned up with all the other bits, so we made some robots from scratch. Important lesson learned, make sure that you link the two pins on the motor driver board If you want the motors to work. 

I even managed to get the WiFi working on the "bot with two brains". The code made the motor move when I browsed a website on the phone. From an access point hosted on the robot. My dream of a networked army of robots doing my bidding is coming closer.

Dual Processor Hull Pixel Bot

I think you should know I'm rather proud of this...

I've just finished building the prototype for the dual processor version of the HullPIxelBot. A single Arduino is a nice enough way to do simple robot control. But I want WiFi. And access points. And web servers. So I've coupled an ESP8266 device (in this case the Node MCU) up to an Arduino Pro-Mini. The Pro-Mini takes care of the low level motor control, producing the signals that will drive the steppers. The ESP8266 device doesn't really have enough pins for the motors, and it has better things to do than drive steppers, so I've linked the two with a serial connection.

Since the Pro-Mini costs around a pound and has a negligible effect on power consumption I reckon it is worth doing. At the moment we have a really simple one byte command protocol, but I can build that up a bit if I need to use the Pro-Mini to do some sensor integration. 

Next step is to work up the web side so that I can make a wireless, web controlled robot. Then we add the coloured pixels to the bot and we are really in business. 

I'll be releasing all the code and the circuit diagrams later. If you want to see the real thing, come along to C4DI tomorrow evening at 6:00 pm. 

Robot Building at C4DI this Thursday

We will be holding a special Robt Building meetup this Thursday (16th of June) at C4DI. I'll be bringing along a bunch of printed components (see above) for people to use to build their own robots. If you've been collecting the hardware to build your own robot, come along and we'll help you put it together and get it moving. 

I'll also be showing off the latest "two brained" version of the PixelBot and we'll be discussing the way forward. Everything will start around 6:00 at C4DI in Hull on Thursday. 

HullPixelBot planning at C4DI

We had another of our hardware hacking group meetings last night. Plenty of great discussion, a lot of it focused on the HullPixelBot. Robin had assembled one and added some sensors that allowed it to chase light. Which mostly worked. We're planning a "bot assembly" evening on the 16th of June. I'm going to print out a bunch of chassis and anyone who fancies a bot of their own can come along and build it with us. Then we'll try to get them all going. You can find the build instructions on the Hull PixelBot microsite here. They include how to get all the part's you'll need. It shouldn't cost you more than ten pounds or so. 

We also have a Google group about matters Hull PixelBot. If you want the details ping me a message (or add a comment) and I'll get you registered. 

Say Hello to Hull Pixel Bot

I've been spending the odd five minutes here and there designing and printing parts for a little robot that I want everybody to build. I've called it the HullPixelBot, because I want to turn it into a mobile pixel. I had lots of fun making my wedding lights a couple of years ago and so I thought I'd have a go at making a mobile version. The idea is that if I can get enough of them together and network them we could have a whole bunch of mobile coloured dots which we can display patterns on. 

It's kind of artistic. But in a technical way. 

Sooooo,  I want to get everybody making little Arduino powered robots. The target price for parts for the robot is less than ten pounds. I'm using very cheap stepper motors which work fine. They are a bit slow, but they provide a precision of movement which you just can't get with standard DC motors. I'm also using catapult ammunition (really) for the caster and four AA batteries provide the power. There are holes you can use to attach sensors and we will develop the design as we go along. 

I'm taking a bunch of parts to the C4DI Hardware Meetup on Thursday this week. If you fancy having a go at building a pixel bot, come along to find out more. 

I made a tiny video. More hardware details to follow.

Update: The STL files are now on Thingiverse here.  There's also a HullPixelBot mini-site here