13 November 2008

Servos...

How sad (by normal standards, anyway) is it that I am gradually falling in love with my Arduino Diecimila robot controller?

I now have 6 tiny little Ultrafly ST-9 micro-servos, which simply plug into the PMW sockets on the Arduino. The Arduino servo library then allows you to simply send an angle to each and the servo whirs into position. How much simpler could this be?

The more I investigate the online Arduino community and discover the strange and interesting libraries people have written, the more I realise that open source hardware is a viable alternative to closed source, propriatary kit. I've long believed that open source software has the potential to become a major force in computing, and to a very great extent that faith is paying off. How long before somoene decides to create a seriously powerful open source computer, I wonder, or even a cluster of them? I'm not holding my breath, but I don't think we'll have to wait an eternity for the first models to appear either.

Stumble Upon Toolbar

12 November 2008

Taxi Please...

The Daily Mail reports with some glee that BBC radio presenter Sam Mason has been sacked after calling a taxi for her 14-year-old daughter one afternoon and requesting a non-Asian driver. The conversation was recorded and passed to The Sun. Mason apparently says, "A guy with a turban is going to freak her out. She's not used to Asians." When told that it would not be possible to service her request, she the apparently retorted: "You've managed it before."

Why am I commenting on this story? Well, some of the comments left on the Daily Mail's web page covering the story are interesting to say the least. Here's an example:

"Dont blame her,but in PC UK you have no freedoms any more."

...while having the freedom to say so, it seems. This correspondent's idea of freedom is about the race of the driver not the quality of service he offers.

"More selective discrimination PC rubbish. Bet there wouldn't be this fuss if she'd specifically asked for a female driver."

True, requesting a female driver could be about real fear, whereas this is about the race of the driver. So, why didn't Ms Mason simply ask if a female driver was available? Given that it's just a taxi ride and that the driver is immaterial, how can it be that someone in a turban will "freak out" a 14-year-old in this day and age? Clearly Ms Mason has no qualms about letting her daughter ride with an unknown male taxi driver - just not an "Asian" one.

"If it were me I wouldn't care if it had two heads," Mason is alleged to have said, "but it's my little girl we are talking about."

Black American comedian Reginald D Hunter once said that there are two kinds of racism. There's the racism that's just ignorance and doesn't really affect anyone, and there's the racism has consequences. It stops people getting housing, jobs and so on. She may not realise it, but by denying a fare to a perfectly good taxi driver on grounds of his race (or more accurately, religion), Ms Mason falls (perhaps unwittingly, but very definitely) into the second category. I think, however, I'll leave the last word on this to a twistedly self-rigteous comment left on the Daily Mail web site by someone calling himself "Peter". See if you can guess which of Hunter's categories he's in from what he says:

"What the PC brigade have done and are doing to this country is frightening. You'll find Ms.Harman and her troop at the root of much of it. We all have prejudices and that does not make us racist. Simply she didn't want a chap in a turban for her daughter."

Stumble Upon Toolbar

11 November 2008

Sainsbury's again...

My post yesterday about Sainsbury's latest TV ad campaign predicted a Christmas instalment where we'd be treated to an insight into the life of a fictitious family. Sure enough, last night there was the advert, introducing us to (if I remember them correctly) the fictitious shop worker's son Billy. We heard about his best friend, Auntie Jen, and even Billy's teacher. Why go to the trouble of inventing so many unseen characters? It's all in aid of nothing more than getting us to buy our mince pies at Sainsbury's and not Tescos. Price alone, it seems, is not enough. We must be made to feel as if we belong to get us spending. I wonder if it's possible to get too schmaltzy in Christmas adverts? With a recession looming and retailers fighting over dwindling disposible incomes, we may not have long to wait until we find out.

Stumble Upon Toolbar

Definitely coming in on three engines...

Showbiz gossip site Digitalspy.co.uk is reporting that Salisbury Council has banned the phrase "Singing from the same hymn sheet" in case... wait for it... it offends atheists. I'm an atheist, well, not even an atheist really - I don't think about God enough to qualify - and the only offensive thing about the whole story is the assumption that I need protecting from something so pointlessly inconsequential.

When something as powerful as a local authority is so frightened that their employees may inadvertently cause offence with a common phrase whose meaning is innocent and perfectly well-understood, you have to wonder just how much arbitrary personal power that hands you - without you ever having to lift a finger to earn it. What fun could one have, what resources could one waste using this power for evil? With this kind of pointless language micromanagement and fear-based culture lurking in the coridors of minor elected power, the sky's the limit. It may be double plus non-good, to quote Orwell, but what a ridiculous laugh it would be to use political correctness deliberately against itself to make the point. Pick a phrase in common usage, officially demand that you're offended by it, and stand back to watch the fun.

This reminds me of the short time in 1994 when I worked on the IT support desk of a local water company. I was alone on the early shift one morning when a man from the quality assurance department came in with an apparently urgent need to discuss a few of the support records. This puzzled me. Why were QA looking at the support records. They had no hope of ever understanding them. It turned out that the man was indeed puzzled - about the phrase "the machine is down". I explained that it simply means a machine has locked up or has in some way crashed. The man from QA wanted to know if we could use a different phrase in future. I asked why and he said that "down" sounded a bit sexual. Seriously. No one but the other support staff would ever have cause to read these records, and they all knew what the phrase actually meant, but the man from QA wanted us to use the phrase "rendered inoperable" instead. I referred him to the IT manager, who, if my memory serves me correctly, laughed and asked the man from QA if he had anything better to do. That, perhaps, is the problem. The man from QA was employed to take pointless trivialities seriously, to pursue them and to report back. It was a stupid job, but it paid real money, which in turn paid a real mortgage and real taxes.

Stumble Upon Toolbar

10 November 2008

You're an idiot!

There's a Jerry Seinfeld line about magicians that goes something like: "Here's a coin. It's gone! You're an idiot! It's back! You're an idiot!". The idea is to poke fun at magicians who think it's all about showing how much smarter they are than the rest of us while actually being crap. But how about re-applying this line to the current Sainsbury's Adverts.

The current campaign follows a hassled but happy Sainsbury's employee. The only thing is, she's actually actress Tracy Brabin, who's probably most famous in the UK for being Tricia Armstrong in Coronation Street. There's nothing sinister about this; it's just an observation. Maybe Sainsbury's ad agency wanted to create a feeling of familiarity in viewers to keep them spending.

No doubt we'll be treated to the inevitable "preparing for Christmas is such a hassle" instalment of the campaign in the coming weeks. There'll be intimate moments and in-jokes to discover when the family are around the table, just like a real community. All this is completely faked of course, but some viewers will find themselves actually interested in how this mythical family works. Weird, isn't it.

It's just the latest in a long line of "believable" adverts. Remember Linda Bellingham in the Oxo ad campaigns? Talking to friends, however, it's clear that their default attitude to advertisers using famous actors to play "ordinary" people in their campaigns is changing. Maybe I have weird friends, but they seem to believe these types of ad are an insult to their intelligence.

"See this person you remember for that sitcom you liked? Well, this is him enjoying shopping in our store. You're an idiot!"

Stumble Upon Toolbar

Fancy a pint?

Why would any company sell to the public at a loss? The BBC reports that supermarkets are doing just that with alcohol. They must stand to gain more out of it than they're losing or there'd be no point. The Beeb also reports that MPs want a ban on happy hours and a minimum price for booze. There's even an unhappy Superintendent from the Devon and Cornwall police force standing inexplicably in a rain storm, being interviewed by a reporter on BBC News 24 about it. Alcohol, it seems is this week's moral panic, but it's clearly not the common factor here. It's what some people do when drunk that's the problem.

I like a drink, in fact I like a lot of drink, but I've not seen any alcohol-related violence in years. The reason is where I drink. The people beating each other up in town centres at 3am on a Sunday morning didn't come from the backstreet boozers that closed at 11pm but behind whose curtains the landlord is still holding forth about the issues of the day with a few selected friends. The people causing social trouble have been drinking predominantly in one of the massive, impersonal chain pubs that stack the booze high and sell it cheap, need a massive security presence, and in some cases need to insist on a positive ID before allowing entry.

Here's another thing. If you set up a camera in a town centre late on Saturday night and wait, younger drinkers will act the fool in front of it. Maybe the sight of a camera captures the imagination of a generation not used to having their inhibitions lowered, and who have grown up with the idea that it's good to be on TV, regardless of context. If you're ITN and want a sure fire way of making the average Daily Mail reader tut in disgust, you film a report outside a big chain pub at chucking out time. People see the camera and it's as if they're reacting to a posy-hypnotic suggestion in some cases. They must goon about in front of it. Alcohol isn't a new invention. Neither are people. What is new is the context. Society itself has changed.

So, take P as being the population who drink, T as being a subset of P whose members cause trouble when drunk, and E as the establishments where T gets tanked up. Clearly, most of P isn't the problem. It never was. So, why are people saying all of P should have less access to alcohol to prevent T from doing their thing? Surely it's just T who should have less access.

Oh sh*t, I think I've just argued in favour of ID cards.

Stumble Upon Toolbar

8 November 2008

The Arduino Diecimila

Gadgets are guaranteed to give geeks a special tingly feeling, and robot controllers are a very special type of gadget. Was it William Morris who said that nothing useless can ever be truly beautiful? Whoever it was, he was spot on. By that definition, Robot controllers are immensely beautiful. What's more, they're not difficult to get into, and thanks to the open source hardware movement, they're an amazingly cheap method of making intelligent objects. Robot controllers typically contain tiny amounts of RAM, but because you're not fannying about trying to hoist a pointlessly resource hungry translucent user interface onto a graphics card that can outperform an 80's supercomputer, you don't need that much memory to do complex and genuinely cool things. Robot controllers also have plenty of input/output lines built in, waiting for you to poke the wires from sensors, buzzers, motors etc. into them to give your creation (whatever it is - and it doesn't have to be a robot) a sense of where it is, what's going on and how to control itself in the world. The rest is down to your creativity as a programmer.


I've just bought the Arduino Diecimila robot controller for just £17.60 from Cool Components. To the untrained eye, it looks like a very small and boring interface card for a PC. It's not. It's a full computer with some very special qualities. The chip at its heart is an Atmel Mega168, for instance. This is an industry standard microcontroller, which is basically a complete computer on a chip. It runs at 20MHz and, because it has a simple yet very comprehensive instruction set, it delivers a full 20 MIPS. The chip has 16K of non-volatile RAM on board to store its programs, 1K of volatile RAM to store variables while it's running, and 0.5K to store data when it's switched off. So, it can maintain a persistent state between battery changes - ideal for a robotic pet, wouldn't you say? but isn't the lack of RAM a problem?


No. Seriously. By programming like a real programmer, you can fit one hell of a lot of functionality into this beast. Think about it: you need to store a true/false (boolean) value, for example. Why would you need a 4-byte word to do that? Why not designate one byte to store 8 such booleans? See? Real programming; "tapping on tin" as they used to say is how it used to be done, before Windows came along and PCs became bloated playthings. Who actually needs an Intel Quad Core processor to read their email, for crying out loud?


Sorry, I got a bit ranty there. Anyway, by thinking like a proper programmer, the amount of "mind" you can squeeze into a microcontroller is phenomenal and the RAM seems huge. Want proof? Hundreds of millions of microcontrollers are used in car manufacture every year. They control everything from the dashboard to the injector system. They decide whether to deploy the air bags and tell the mechanic whether the wheels need balancing at service time. Your car may contain several dozen of them.


Everything about the Arduino Diecimila is open source, including the hardware. You can, if you wish, download the plans from the Arduino homepage, buy a Mega168 (they're around £3 retail!), a few resistors, capacitors and wires, solder the lot into a bit of veroboard, and hook it up to the serial port on your PC. You can program it directly from there using the free AVR Studio suite, which gives you the industry standard GCC C compiler, and a superb macro assembler if you want to get really code efficient. It also has a full simulator for a range of Atmel chips so you can test your code properly before squirting it onto the chip and watching it control your creation.


The Arduino Diecimila has 20 I/O lines. 6 can take analog inputs and convert them into 10-bit binary. 6 of the ports will do pulse width modulation, making them ideal for directly controlling servos. The others will accept things like infra-red diodes and photo-resistors directly, and have such high impedence, touching the end of a wire connected to them will cause the input to go high (ideal for touch sensors).


What's more, the Arduino Diecimila has a USB interface. This is used to program it, but there's also a library enabling you to write from the unit to a USB pen storage device. Is that enough non-volatile RAM for you?


So, what can you do with a robot controller? Well, the obvious thing is to make a robot, but there are plenty of other possibilities. I'm interested in making what I call an intelligent object; one that reacts intelligently to it's surroundings and to your interaction with it - a digital pet that goes WAY beyond the idea of a Tamagotchi, for want of a better phrase. One that learns from physical interaction. So far, the design can see light and infra red, it has a basic sense of touch, it can sense its orientation (and any movement), and hear basic sounds. It has light, sound and vibration as outputs at the moment and there are plans to give it a small LCD screen. It doesn't even move yet under its own steam, but the plan is to mount the sensors on a kind of "head" that sits atop a servo motor so that it can turn.


I'll be posting the results of my experiments over the coming months, and hopefully I'll have something basic running to show you soon. It's a big project and something I've never contemplated before, but I'm not doing it because it's easy. J.B Priestly once said that the secret to happiness is to be busy with unimportant things. I'm beginning to see what he meant.


P.S: I have no idea why the formatting of this post is different. I've tried everything. Sod it. Life's too short.


Stumble Upon Toolbar