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.

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.

Long term backups

Filed under: tinkering,trundle — jaydublu @ 3:52 pm

I’ve been digging out all the old boxes figuring out what I’ve got and what I did last time with Trundle. Ah the memories, but faded and incomplete. If only I’d kept better records!

trundle1.jpgI’ve got the original vehicle, but bits of the control system have been removed, and I can’t seem to find all I think I should. Never mind, the bit I really want is the original firmware – but where would that be?

I’m not even sure when I did this thing – it seems to be somewhere in the region 1998 – 2002 – certainly before I got my current desktop computer, and I haven’t still got the machine I was working on in the original state, even if I could remember which of many I’ve had in the past I was working on at the time.

I must have made backups of this stuff I spent so much time on? Apparently not! I’ve got a corrupt CD saying ‘pre Linux big backup 26/7/01‘ which sounds hopeful as one of the contender machines got reformatted with FreeBSD. I also found a ZIP disk with a backup of my htdocs folders from the websites I was running then, including several development projects alas not including trundle.

So it looks like I’ve lost the sourcecode – apart from a dusty manky remins of the vehicle all I have to show for it is a faded Polaroid photo.

The moral of this story – keep backups, and preferably in a format you can get to them again in the future – and your best chance is if you publish stuff to the web.

Trundle II

Filed under: trundle — jaydublu @ 6:07 pm

Ever since I started playing with batteries and wires – and my folks will tell you I was very little when that started – I’ve been tinkering with all sorts of robotic vehicles.

As time, and knowledge, and resources increased they got increasingly complex, but somehow I never got round to building anything really satisfying.

The last machine was quite cool – the original ‘trundle’ – never quit got to be a robot was but was quite good as a remotely operated vehicle. Two geared motors on a disk of MDF, a PIC microcontroller and crude motor controller, mono ccd camera and all power and data coming down a bundle of cables. At the other end another microcontroller and two joysticks, an LCD monitor and crude power supply. It ‘trundled’ quite well within range of the umbilical and fun was had.

That was quite a few years ago now and has been accumulating dust since then – the excuse has always been that I need a more substantial chassis to carry more gear to keep the results coming that I need to keep myself enthused.

wheelchair.jpgWell, now I’ve got no excuse!

Through a happy series of circumstances I’m now the proud owner of an old battery powered wheelchair, in full working order. That’s given me two 24V DC geared motors and wheels, two 12V 33Ah sealed batteries, a battery charger, and a metal tubular chassis to hold it all together. Currently I’ve also got the controller unit but that’s probably got to be the first thing to be replaced with one I can talk to digitally.

Over the intervening years I’ve also accumulated a load of other useful stuff: old laptops, a flux gate compass module, ultrasonic range finders, wifi equipment, other microcontroller gear, and although time might be a bit tight right now I would like to think I’ve got more ‘resource’ available than at any time in the past.

So what is my ultimate goal for Trundle II? I’d like to build a semi-autonomus roving vehicle, like the Mars rover. Being fed the odd instruction from home base,and reporting back where it is and what it’s doing, but on the whole having to fend for itself in the ‘real’ world (e.g. my garden)

First target I think is to get the chassis under computer control, so whereas it’s now moving around via a joystick on the dedicated controller, let’s define success as controlling it via a PC joystick plugged into a laptop? That’ll take me a month or two!