It Trundles!

Filed under: tinkering, trundle — jaydublu @ 4:16 pm

Success came about 4pm last night, when I finally managed to get my stripped down electric wheelchair not only moving forwards, but also backwards under control of the PIC microcontroller.

Today I took it for a walk around the garden on a log serial lead. Perhaps I should call it Fido?

You need to a flashplayer enabled browser to view this YouTube video

So what do we have? We start off with a small Visual C++ app which reads a standard PC joystick, and sends the values read as a string down COM1 serial port. A PIC24F 16 bit microcontroller mounted on an Explorer 16 demo board receives that data, does a quick calculation to turn speed and steering information into differential speed and direction data, and uses this to control the duty cycle of two PWM outputs and matching digital outputs for direction.

The PWM output for each wheel is fed into a 4QD VTX-40 motor controller - the direction signal is amplified by a transistor and fed in place of the reverse switch.

The rest is the original wheelchair - two 12V batteries feeding 24V to the controllers, and two geared 24V DC motors.

Next step - replace RS232 wired communications with ethernet, and get this going over wifi so the vehicle is literally wireless.

Trundle firmware almost ready

Filed under: tinkering, trundle — jaydublu @ 6:54 pm

A few weeks back I craked getting Visual C++ to read joystick data and send it down a serial stream. Today I’ve run first tests with the Explorer 16 board using the PIC24 device to receive and parse that data from one of the UARTs, apply a differential steering equation, then use the calculated value as the duty cycle of tow channels of PWM ready to be connected to the motor controllers.

So far, I’m on course to achieve my first goal of having a joystick connected to a PC controlling the wheelchair rather than the dedicated controller, hopefully in the first couple of weeks in January. All that’s stopping me now is wiring, mechanics, and whatever gremlins I’ve not anticipated.

Does ‘one web’ mean ‘one website’?

Filed under: mobile, opinion, web development — jaydublu @ 5:05 pm

Ongoing discussions with a colleague about the most appropriate way to deliver websites that are mobile friendly, led him to send me a link to a blog posting in the Opera Community: ‘Open Standards, One Web, and Opera‘. He reckons this demonstrates his view that you should build a standards compliant site, and leave it to standards compliant browsers to adapt. For the record my view is that whilst this approach may work most of the time, better experience can be given to the visitor if you tailor the code being delivered by the server to suit device capabilities.

Summarising the main argument of the piece:

We believe very strongly in 2 main principles:

  1. One Web — first coined by the W3C, the one Web principle is what it implies — there should be one single Web that can be accessed by any Web—enabled device, not different content for different devices — this is unsustainable, and a maintenance nightmare — having to maintain several versions of the same content can be really frustrating. The “one Web” is made possible by…
  2. Open standards. Technologies such as CSS and HTML are open — they are free for anyone to use and get involved in the evolution of, and because they are also standards, pages created using them should be viewable on any device by anybody, as long as user agent vendors follow the standards. Most vendors, including ourselves, are making a pretty good job of this these days, mostly (hint — there is still a bloated giant out there that has trouble with standards, despite controlling over 70% of the browser market. We won’t name any names…) Proprietary standards, that is, standards that are not free for anyone to use and lock you in to having to use a single/few company’s products, are bad for the one Web, and are often inaccessible (that is, not usable by users with disabilities) and expensive to develop with.

I can’t and won’t argue against either point - I believe in them too, but that doesn’t mean I necessarily agree with the implication that ‘one web’ implies ‘one website’ - i.e. one set of code that gets delivered to all devices.

That’s getting a bit close to ‘lowest common denominator’ where you don’t use particular techniques or features if not supported by all devices you’re building for, or another risk is that you’re abandoning a chunk of your audience for the sin of not using a standards compliant browser (that could be 90%+ of your potential audience!)

Where in those two principles does it say you can’t adapt code a bit to suit device capabilities - and before I get screamed at for suggesting multiple sites / thousands of separate templates / layouts etc. note the phrase ‘a bit’ - and use some of the power going spare in our modern day servers? A pragmatic approach rather than dogmatic.

‘One Web’ is about content - reading what the W3C say about One Web in their Mobile Web Best Practices:

“One Web means making, as far as is reasonable, the same information and services available to users irrespective of the device they are using. However, it does not mean that exactly the same information is available in exactly the same representation across all devices. The context of mobile use, device capability variations, bandwidth issues and mobile network capabilities all affect the representation.”

i.e. The content should be the same, but the way it’s being presented could be adapted to suit the device.

Not all devices / browsers are equal - some have very special needs, particularly mobile ones. Even if they can render full standards compliant web pages, there are problems of bandwidth and memory. Mobile devices will perform better with nice light pages, whereas Desktop users are perfectly happy with big bloated ones.

Screen size and navigation - yes I love the iPhone’s zooming, but at the end of the day when you start to read a site or try and use the navigation, the screen is only 320×480 pixels, and a fat finger is less precise that a mouse. So the likelihood is that a navigation system that works well at 1024×768 with a mouse, might be a bit fiddly on an iPhone, let alone a mobile using a simulated mouse or keys, on the other hand something simple enough for a mobile might be really tame on a Desktop.

But which standard? xhtml is getting wider support within higher spec phones now, but it’s still widely regarded that XHTML-MP is supported by the overwhelming majority of mobile browsers. And what about old phones that prefer WML? Just because you’re sending different markup to different devices doesn’t mean that the markup used won’t be standards compliant.

In summary - ‘one web‘ - yes. ‘Use standards‘ - yes. But adapt the output a bit to better match device capabilities. If my understanding is right that’s also what the W3C is saying.

WURFL DB

Filed under: mobile — jaydublu @ 3:21 pm

In Luca Passani’s post on wmlporgramming he announces the launch of WURFL DB:

“People of WURFL, it’s with great pleasure that I announce the WURFL public interface (AKA WURFLDB) … The basic idea is that everyone will be able to look at the latest WURFLdata about specific devices, while some will also be able to contribute and download a newer WURFL right away.”

As well as being a browsable interface to the latest WURFL data, and the new home of the latest xml file, there’s also the ability to become a contributor to the database.

Luca has done a grand job bringing it this far, but a job of this scope is more than one man can do alone, and releasing this tool to allow the chore to be spread about the community has to be a good thing.

If I feel I can do anything useful, I’m in!

Nimmo Twins - Normal for Norfolk

Filed under: life — jaydublu @ 1:23 pm

nimmo_twins.jpgBest wishes to Karl Minns, and all those caught up in the aftermath of his recent clash with Norfolk lowlife - I’m a regular at the Nimmo Twins Playhouse shows and was due to go twice this week - once as part of our works festive jollities, and later on our regular pilgrimage with friends and family.

I’m trying to think of something humorous to say about it, but it’s not remotely funny. I can only hope that no permanent damage is done and he soon returns to normal (for Norfolk!) - and I eagerly anticipate the show if it goes ahead.

How exciting can 8 LEDs be?

Filed under: life — jaydublu @ 8:12 pm

Hello World!It’s the Microcontroller equivalent of ‘Hello World!’ - getting 8 LEDs to light signifying that you’ve put a data port into ouput and changed the bits from 0 to 1.

It might not seem like much progress towards an autonomous (or semi- autonomous) vehicle, but in reality it’s a big step, because it means I have all I need to program 16 bit controllers.

I had a bit of a dud start yesterday - impatiently I dove straight into instant gratification and tried to get one of the higher value examples going, but nothing seemed to play ball.

So, calmly, one step at a time, RTFM and surprise, surprise, it does what it says on the can.

As long as progress is being made, no matter how small the steps, then all is good. After all if it all happened too quickly and easily, it would be no fun would it?

OpenSocial

Filed under: opinion, rants — jaydublu @ 6:18 pm

opensocial.jpgI finally found an hour or two to read a bit more into OpenSocial - the innovation (?) promoted by Google to ‘make the web more social’.

On the homepage is a nice link to a 57 minute YouTube video - that I couldn’t get enough bandwidth to stream acceptably, so I watched the chunks - all six of them - and I’m feeling not very well.

How corny could they make this presentation? Initially I was put off by the symbolism of the fires, and the play on ‘open’:

“We believe this format of bringing developers together in an intimate setting to work collaboratively in the open, is the best way to engage with the developer community”

In other words, they approach a select few ‘partners’ and say ‘we’re going to make this big announcement - jump on board or miss the wagon!’ They make it look cosy by doing the presentation outside, but I doubt there was anyone in the ‘audience’ not part of the launch, and I’m surprosed they didn’t sing any songs - there was enough of a dance.

Google are starting to get on my nerves a bit - you can’t help but see them everywhere, and I’m getting a bit suspicious of motives.

I like the idea of OpenSocial - if I get it right - it’s like the Facebook developers platform, but open so anyone can use it. Great. But they seem to have gone a bit further by putting JavaScript gizmos and methods on top. Not so sure. I’m not a fan of all this Ajax - it too often is bling for bling’s sake and gets in the way of sensible functionality.

I’m not totally anti the rich user experience - times I’ve seen it done well it is neat, but it can be overdone, or inappropriately applied. Much like technology as a whole. I’m a KISS person myself.

So perhaps I should just concentrate on the Data APIs and concepts, and not get put off by the ’shiny’ distractions.

Anyway, back to OpenSocial - it seems to have a good amount of adoption by the PR - if there’s a critical mass it might take off. But I remember a similar hubub around OpenID and that one has gone quiet.

This open stuff is great for developers perhaps, but isn’t everything ending up looking the same? Yes MySpace jumped in because they’ve been hurt my the Facebook API no doubt. And all these business networks are all like LinkedIn - where’s the USP? They’ll all end up like Ning where it’s who’s using an application makes it stand out rather than the application itself.

Bye-bye handheld stylesheets?

Filed under: mobile, opinion, web development — jaydublu @ 5:55 pm

opera.jpgFirst Safari mobile on the iPhone, now Opera Mini 4, it would seem that the trend for mobile browsers is to pretend they’re a Desktop, and to persuade sites not to dumb down the presentation enabling the browser to wow us with zooming etc. they’re ignoring handheld stylesheets. However, new CSS3 features like media queries which allow different stylesheets to be included based on for example screen size.

As discussed on Unintentionally Blank a few weeks back, the reasoning seems to be to save the users from the developers who apparently all want to dish up ‘dumbed down’ sites for mobile devices.

But surely we all agree that mobile devices are not desktop devices - you use them in different contexts and have different requirements. Whilst I appreciate that not all mobile users want a dumbed down site, let’s have choice rather than imposition. And taking away tools that can have a positive benefit if used properly is removing choice.

Learning to fly the PIC24

Filed under: review, trundle — jaydublu @ 9:06 pm

Programming 16-bit Microcontrollers in CUpdate on Trundle - I’ve been buying everyone else’s Christmas presents for me - a couple of VTX-40 motor controllers, a joystick, a Microchip Explorer 16 evaluation kits and a couple of books on Microcontroller development.

In another life I did a fair bit of PIC programming - on 8 bit devices - but I have to admit I’ve probably forgotten most of it, I worked in assembler, and I know little about the 16 bit RISC architecture let alone programming it in C.

So I do what I normally do when I’m breaking new territory - buy a good book or two.

I’ll own up now that I’ve only read the back cover, the introduction and the first chapter (the obligatory hello world!) but I can already tell I’m going to like it - it’s speaking my language.

Lucio is a private pilot, and the book’s subtitle relates to the way he describes the process of developing in aviation terms; and I think it works well - flight plan, preflight checklist, the flight, post flight briefing and references.

The topics cover are mostly directly relevant to me too - from initial familiarisation with the various environments, references and techniques, through key topics such as I/O, interrupts, A/D, Async comms and for good measure using the onboard LCD display.

Yes it’s going to be a real drag stopping myself from jumping into the fun of later topics, but I know from previous experience that time spent in fundamentals pay dividends down the line.

How to liven up a dull blog

Filed under: opinion — jaydublu @ 2:00 pm

WinCacheGrindPerformance problems again, but this time at an application level. So I finally get around to trying out PHP profiling tools in earnest. XDebug and WinCacheGrind give very useful information where a script is spending its time, without having to go dropping bits of benchmarking code around.

I know this is old news - I’ve just not had a real need before now. So I go hunting for good info on how to get the most from WinCacheGrind, and the project’s SourceForge homepage has a really interesting approach to livening up what could otherwise be a slightly dry geeky subject.

Not an approach I would feel adopting long term, but I thought I might try it out just once…

Next Page »