Robots

I began this project to make my first ever robot because of a general desire to learn something new.  I was, and still am, a newbie.  As in, watching "how to use a soldering iron" videos on youtube newbie.  I recognise a transistor - those are the black bits with 3 metal bits stuck out.  I also recognise black bits with more metal bits stuck out and those are chips.  They do clever stuff.  Now that we've established my credentials . . .

To make an autonomous robot you need a controller, and for that I'm using an Axon2.  Most people reading this will probably be more familiar with the arduino variants - should work fine either way - find your own path.  You also need senors and wires and "bits" which depend on what you want your robot to do - again, find your own path.

Finally, you need a chassis - a base for the robot.  And wheels.  And motors.  And motor drivers.  And mounts to attach them with.  And they all cost money.  I decided to go an alternative route, which was to buy a remote control car and hack it.  RC cars come in two basic flavours - toys, which cost £5 to £20, do 6 kph and can be driven around by small children, and hobby cars, which cost £150 to £2000, do 80 kph and injure small children.  I found a happy medium called the "Carrera RC Shadow Fox".  There is also a "Green Cobra" and "Silver Blade" which I think are the same car with different stickers on.  This costs £40 and does 20 kph.  The box says it contains choking hazards and is not suitable for small children.

It's advantages over a traditional chassis set you can buy online are that it is cheaper, faster and prettier. It comes with a battery pack, power switch and recharger.
It's main disadvantage is that it has rear wheel drive, front wheel steering, which gives it a turning circle that is inconveniently large for indoor use.  (It could probably be improved by going backwards all the time).  The unique problems associated with debugging an autonomous robot that moves faster than you do I will leave to your imagination.

The basic principle for both the motor and the steering is that of an H bridge:
If you close A and D power flows through the motor one way.  If you close C and B power flows the other way.  If you close all 4 it short circuits and melts.  In reality these are usually transistors, or similar, not switches, and they are controlled in pairs by yet more transistors, so that there is one place you can apply current to go forwards, and one place to go backwards (and both places at once to set on fire).  There are also resistors involved.

Opening up the car and lifting the roof off involves just 4 screws, 2 near the battery compartment at the back, and 2 in the battery compartment near the front.  Inside there is a single circuit which can be easily unscrewed and which looks like this:
On it are conveniently marked join points for wires B+, B-, M1+, M1-, M2+, M2-
B- is ground.  B+ is connected to the battery VCC but only if the switch is on.  To those I have attached red and black wires with connectors on the end.
M1+ and M1- are power for the motor, and are controlled by the H bridge I've labelled I,J,K,L on the second image.  That in turn is controlled, ultimately, by applying power at the points G and H.
M2+ and M2- are power for the steering, and are controlled by the H bridge I've labelled A,B,C,D on the first image.  That in turn is controlled by applying power at the points E and F.
I wanted to attach wires to the top of the board at E,F,G & H, to make my life easy, but ultimately decided it was beyond my soldering ability, and attached them underneath intead.  Thus, I have also had to make three holes in the plastic of the car (by boring at it with a knife tip) so that I can feed the wires out.  I colour coded the wires in such a way that the bad mistakes would be obvious (power to both yellows at once is bad, power to both greens at once is bad).  If I swap them round with each other the robot will go the wrong way but atleast it won't die.

Here is a picture of the car attached to my microcontroller in an intermediate stage of development.  This is the stage I think of as the "WTF does this bit go?" stage.
Here is a picture of the car put back together with the cables sticking out.  In this state it still works as a remote control car, and can be easily hijacked by sticking wires into the appropriate connectors.  This is the "gosh, this looks way more professional than I feel" stage.

I shaped a plastic sheet around the wires on the underside (using a plastic shipping carton and a knife) to prevent them bending about too much and touching each other or the board.  I also wrapped them up in tape.  And crossed my fingers.  It's a really fiddly soldering job in there and I didn't do it as tidily as I'd have liked.

Attaching a micro controller board to a piece of flimsy plastic in a non permanent way caused me a little trouble, but I eventually settled on sticking "Epoxy Repair Putty" to the robot, and embedding nuts in the putty, and screwing the controller into the nuts.  This way I can unscrew it and use it elsewhere when ever I like.  Not the most professional job, but the stuff can be filed and painted (and even drilled) once it has set, so I shall tidy it up and make it black eventually.


Still to come - a video of it actually doing something!

Subpages (1): bluetooth