Thanks for the Trombone Tom

I've no idea who Tom is. But he has been reading my blog from 12 years ago. He noticed my lament that I'd failed to find any hits for the search "trombone playing dog" and responded with a link.  Thanks for that. Made my day. 

In fact, things have really moved on. I've just done my own search for "trombone playing dog" and found loads of hits. Such is progress. All we need now is world peace and a cure for cancer.

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....

Hull Looks Great

Every now and then I take a picture that I'm really, really, pleased with. This is one of them. I took it today wandering round the waterfront in Hull. This is fast becoming one of my favourite places. The Fruit Market is coming along a treat and interesting cafes and shops are springing up. It's a pity you have to cross the A63 to get to this part of town, but it's well worth a few seconds waiting at a pedestrian crossing. 

I took a few more pictures that I'm happy with. You can find them here

Star Trek Beyond

Star Trek Beyond is a Star Trek film. It's a good one. I reckon it's the first "proper" one of the new movies, because it has a proper element of "boldly go" about it. They really are meeting strange new worlds etc etc. That said, it does have remarkable similarities to the other two movies, which both had a plot where someone tries to take over/destroy everything. But that's Federation life I guess.

For me, the best thing about it was the way that, now we've had a couple of movies to properly establish the characters, we can sit back and enjoy how they interact. The special effects are good, and there are some suitably silly moments too. Go see. 

Candy Chaser Game

This is a neat little game which gave us a diverting few minutes this lunchtime. Each player is trading in a particular type of sweet and players take it in turns to move the price of any the sweets up or down. Once trading is over you have round where everyone tries to figure out who is selling which kind of sweet. If someone works out which sweet you are trading, you are out. If they get it wrong, they're out. Last player standing with the highest score wins. 

Games last around 20 minutes or so maximum. It's quite fun to play, although in typical Computer Science fashion we all massively overthought the situation and I managed to win one by just doing the simple, stupid thing. 

Quite fun. 

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. 

Bristol Board Game Cafe

I didn't take this picture at the cafe. But I'm still very pleased with it. 

A while back we went to the board game cafe in London.  We had a great time there and so today we went out to the one in Bristol. Just as much fun. In fact it was even better because we had more time to play, with no train to catch this time.

We had a proper go at the Thunderbirds board game. And by proper I mean that we played it long enough to lose. Oh well. As with the one in London, the service and knowledge of games was first rate and the food was excellent.

By the time we left the place was filling up nicely and what sounded like an uproarious session of Cash and Guns was going on in the back. Next stop, the cafe in Hull..... 

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

Get Cura 2.1.2

Una, my four year old, hand built, 3D printer, just got a lot better. I've just downloaded the latest Cura slicing program and used it with the default print settings. And Una has produced some of the best looking prints I've seen for ages. Well up to the standard of the Ultimaker 2;s at work. The new Cura defaults are a lower temperature than I normally use, with a cooler heated bed too. But they work really well. There looks to be quite a few changes in the way that the slicer works and the user interface is now very slick.

The only thing I'm missing is a way to tell Cura that the print head on Una is a rather strange shape, and not the default. If I can't do this it means that its hard to print multiple objects on the platform because the fans will crash into parts already printed if I'm not careful. However, it's a small price to pay for such lovely print quality.

The great thing about Cura is that it is free and it works with a huge range of 3D printers. If you haven't got it, you should get it. If you have got it, you should go for the latest version. 

Visiting the Jim Austin Computer Museum

If you know what this is, you'll want to go and see it. If you don't know what this is, you really should go and find out. Click through the image to more pictures. 

Jim Austin is a Computer Science Professor at the University of York. He has a lot of computers. A lot. I've got one or two. He's got all the other ones. Today he was kind enough to give us a guided tour of the barns where he keeps them all. We were there for several hours, but it felt like several minutes. And I'm sure that all we did was scratch the surface of what is there.

Jim has computers going right back to the start of computing. Persistence and being in the right place at the right time with a lorry has meant that he has mainframes, mini-computers, micro-processors and everything in between spanning the entire computer age. 

He takes the view that this is heritage stuff and I think he is so right. These machines have totally changed the way that we live our lives and the way that they have evolved is quite breathtaking. It is very strange to see so many things that were state of the art in their heyday, and I remember watching them on TV science programs in the past being celebrated as the future.

In a perfect world we'd have all this set out for mass public access. York has a fantastic railway museum that tells the story of how the railways revolutionised the world. We need something similar for computers. Last year I was lucky enough to get to visit the Living Computer Museum in Seattle. The stuff that Jim has deserves to have a setup just the same. Only bigger. 

You can find out more about the museum here. If you live in the Hull, York area you should see if you can get a chance to see what is there. If you live anywhere else in the world you should also try to get to see the stuff. And I don't think you'd regret the trip.

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.

 

RC2014 Homebrew Z80 board

It turns out you can have a lot of fun failing to get something to work. Number one son has bought an RC2014 homebrew Z80 kit. At the moment it is not doing much, so we had a go at finding out what the problem might be. The kit has a backplane board that brings out all the signals from the processor and then you can plug in a processor board, clock, RAM board, ROM board and serial port. It really took me back to the days when you could print out the entire circuit for your computer on a single sheet of paper.

If you really want to discover how a computer works you could do a lot worse than get one of these. Although in our case what we discovered was that it doesn't work just at the moment. 

Fixing problems like these is always a matter of working through each part of the system, checking it and moving on. By the end of our session we'd proved that the serial data was getting from our terminal into the UART, the processor clock was running and the Z80 was trying to load things from the bus. It still wasn't working, but we had a great time anyway.

Tick Tock Unlock Fun and Games

I can't post any pictures of the puzzles or the room, but they did have this rather nice Tesla in one of the arcades in Leeds..

Went to Leeds today for another birthday treat. We had booked a go at Tick Tock Unlock, a locked room escape experience where you have an hour to complete a mission which involves puzzles, cooperation and some really cool padlocks. 

It was great fun. There were five of us and I like to think that we turned into a well-oiled puzzle solving machine. We managed to get out within the the allotted hour and the chap in charge reckoned that we did really well, only needing three clues. (but I bet he says that to all the groups).

The setup is very smooth and well organised and the puzzles themselves are nicely paced so that you get plenty of things to do as you piece together the clues that will get you past the final door.

If you are looking for a novel experience which is great fun then you should have a go. We'll certainly be having a go at another one.