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.

I take it back (sorry!)

Filed under: tinkering,trundle — jaydublu @ 7:58 pm

Further to my rash proclamation that I hate Windows programming! I have to humbly issue a retraction (lest the machines drive me mad)

It turns out that I’m just too lazy and impatient to RTFM.

Having stepped back a bit, dug out some old books and done a bit of Googling, I’m getting it under control and one of the main driving factors of this project is coming into play – i.e. it’s a big learning experience in an arena that I have had not enough exposure to.

My demands on the Windows development aspect of it are not enough to warrant my tirade – since that impetuous posting I’ve actually got on quite well and have serial communication starting to happen. What’s holding me back currently is my inadequacies in C (let alone C++) programming but I will have to sort that out as I currently intend to use C to program the Microchip devices.

So where did I stash my old Uni textbooks? I know I’ve got kernighan and ritchie somehwere!

I hate Windows programming!

Filed under: rants,tinkering,trundle — jaydublu @ 8:39 pm

It’s been a good few years since I tried in earnest to write anything for the Windows environment, but a day wrestling with Visual C++ and it all comes flooding back.

Why is everything so flaming complicated?

It may seem to be easy to do relatively simple things like designing dialogs and laying things out in a window, but when it comes to tying it all together and doing something useful with the app – and bear in mind that I tend to do I/O or other such functionality – it’s a bleeding nightmare.

So I’m sat here frustrated when I start remembering how much more satisfying I found Java when I was developing neural networks and genetic algorithms. ‘Can I talk to serial interfaces and read from joysticks?’ I wonder, and a quick bit of Googling and I’ve found a few references to potentially useful iraries and I have to say it looks hopeful.

So before I fully commit to the hateful slog that will be Visual C++ development, I might spend a few hours seeing if my forehead will have less brick imprints if I build usingJava instead.

It certainly would have a nicer feel to it.