The Programmable Computer Controlled Remote Control Car project (PCCRCC)

Introduction from 2001:

Computer controlled RC car, CPU interfaces with controller with a bunch of switching transistors. Can preprogram course of action just like a NASA interplanetary probe. May add feedback circuit later on if I have the necessary radio channels.

animation of car moving forward and backward, presumably being controlled by an apple ii

An RC car on an apple ii It matters not our current state of machine intelligence is no more advanced than the ability of nature's five year old kid, or that beyond expert systems there is little application for a machine that thinks on its own, the fact of the matter is, aside from MIT's COG, most of our machine's available thinking power is locked in a box, with no other channel of influence than to draw pretty pictures on a screen. Without a form, it is extremely difficult for an intelligence to develop, for it is the need of the body that demands the resourcefulness of the mind.

Hence this project. It is an exercise in allowing a machine to act in/on the physical world. To give limbs, in a sense, to whatever intelligence that is possible within a typical personal computer.

2019 edit: this was written in 2000.
The Apple IIe, the computer that started it all Some might question my choice of the computer used in this project, after all, compared with today's machines, this thing is like an amoeba. But, and this is important, because to people who have actually used the thing sometime in their lives, such as myself, we know this is a true hacker's machine. You don't even need a screw driver to open the case! To young people who always wondered what is making the sound inside a radio and longed to pry open the case to have a look-see, this is a dream machine - it not only inspires ones curiosity, it invites you to an exciting journey of self guided exploration called learning. Thanks to Woz and the hacker ethic. 
The Game I/O port built into the back of the machine Anywho, this is a good place to start because it has a very simple and very hackable I/O in the form of the game port. The code is easy, the language is designed for curious non-programmers, i.e. kids, to play with, and best of all, it is cheap. Purchased for the price of about two lunches. While it would still be a tragic loss should it get destroyed in the experiment, the world will not come to an end and I could easily replace what could have been the single most expensive component in the setup.
A controller Since the software will be controlling a R/C car, the first step would of course involve interfacing the controller with the computer's I/O. This is not that difficult, as long as we are not afraid of a little soldering. (If we are, it's still okay, not only does a little solder burn in the finger non-fatal, it will actually make you stronger with a new knowledge.)
Controller circuit The circuit board of the controller, note the switches right beneath the buttons. Those are simple normally open switches. In the computer interface, we'll activate them with NPN transistor. Right now all we do is turn the board around. . . 
A bunch of solder points And pick out the normally open switch solder points, and solder wires to them. This will allow us to activate the switches without pressing the buttons.
Five wires connected to circuit There should be five wires, Forward, Reverse, Right, Left, and ground. 
Connector The other end is soldered to a sub miniature 9 pin female connector, since the factory gameport inputs on the Apple II is female, when we wire up the homebrewed output port in, we choose to put a male connector, so it will be impossible to connect them wrongly by mistake. (Male output on the Apple II, meaning Female on controller.)
 
Apple II Adapter
Output Male 9 Pin SubMin
To be hooked up
Female 9 Pin SubMin, dremeled and then bolted to controller
Input Female 9 Pin SubMin
Standard Paddle input
Male 9 Pin SubMin Homebrewed to hook up with photo resistor
Controller With a little work, the controller can still be used normally in monkey-flipping- switch mode when not connected to the Apple. The only difference from the outside is now it has a serial port looking thing in the back. (By the way, I have not tried to use it as a PC serial mouse, and I won't advise it.) The port sends out a little power and is designed to accept input.
Apple II Now the Apple II came with a gameport connector on the back, but it also has a socket on the motherboard for soft switching other potential game related accessories. In a nutshell, the original Apple II quite capable of supporting force feedback gaming. . . It is this ability we will take advantage of.
By the way, removing the cover of the apple requires no tool, it does not even use thumb screws, you just lift it up like the hood of a car. Mind boggling easy access to the innards, the way a hacker friendly machine should be. 
Apple II The part we are interested in is to the top right as we are facing the keyboard. (How else would one face a computer?)
AppleII Right at the corner of the case. . .
AppleII There we see a 16 pin DIP connector.
AppleII Since one Apple II damaged is one less Apple II in the world, we think it a good idea to transistor protect the soft switches. See the male 9 pin we'll connect to the back of the case later on.
AppleII With the newly hooked up port at the back of the apple mated with the port we hacked up in the controller, the controller is riding piggy back on the apple.
AppleII Looks okay. Works fine.

Update (051601) on the computer controlled RC car, it is done, the documentation is also done, just needs a little organizing and uploading before you can see how it was put together. It has worked for a couple of months now, but due to lack of input, all the CPU can do is either control the little RC car wirelessly in a preprogrammed course or generate random movements. As you might have guess, this gets old quick. Unfortunately, due to the size of the slave vehicle, it is difficult to provide real time telemetry. So I cheated on the implementation in feedback. I put a light source on the vehicle and added a light sensor to the base station. In a dark testing environment, when the CPU sees light, it knows the vehicle is close by, and can then control the vehicle accordingly. As of last night it controls the car only on one axis: come closer if you are too far, and back off if you are too close. Experimentation yielded an acceptable equilibrium where the vehicle will hunt around, moving closer and then further until it reaches the acceptable position.

Update update (052101) The light hunting algorithm has been improved with a little fuzzy logic, instead of moving a fixed amount until the optimal distance is reached, it now knows how far off it is and adjusts its movement accordingly. i.e. instead of going back and forth with the intelligence of a thermostat, it now applies just the right amount of movement until it get there and stays there. Less fun to watch it run but it is easier on the batteries. One problem with fuzzy logic though, instead of stopping at precisely the exact place, it seems sometimes decide 'arhh, that's close enough, never mind the details' and stop very close to the mark but not quite there. I'll upload some graphs later to explain better. At this stage, I have to decide whether to let the program know it can also do turns and implement that or stay with one dimension and make the thing learn about fuzzy logic by itself, and see if it will evolve it. And as my buddy has suggested, it's probably time to migrate the whole thing to a laptop PC rather than sticking with the APPLE IIe.

More elaborate algorithm to come, as the goal is to have the car wander around a two dimensional plane and be able to figure out by itself where it needs to go, how to get there, and if the AI is there, learn from its own experience. All with just the feedback of one single photoresistor. The Holy Grail would be to have the machine learn a la WOPR/Joshua in 'War Games,' i.e. being able to learn from experience and spontaneously attempt to apply learned knowledge to other topics. (Maybe even teach its creator a thing or two.) One thing is certain, I don't want a HAL9000, let it learn, let it make philosophical decisions, but three basic laws or not, thou shalt not kill thy creator.

red purple orange blue yellow red orange green

Views: 85

Replies coming soon