Re: OT: Programming Robots
On Fri, Nov 30, 2007 at 03:59:47PM +1000, Adrian Levi wrote:
> On 30/11/2007, Thomas H. George <email@example.com> wrote:
> > My college student grandson says he wants to study programming robots.
> > Aside from all the commercial (game?) kits are there serious Linux
> > applications that he should consider? If so, how best to get started?
> For me part of the solution is to learn a programming language that
> can do bitwise operations is a great start, C and pascal can
> communicate directly to hardware fairly easily. Learning to program to
> an old style parallel port can be useful, there are a ton of things
> you can do with a parallel port. Very simply you can have 4 "address"
> lines using LF FF Paper-out and online and 8 bits data. Use the 8 bits
> data to turn things on and off and the address lines as limit switches
> etc. You can interface to the port using common ttl type logic gates.
> One IC he might like to look into is a ULN2003. In 1 IC package there
> are 8 high current sinking transistors with protection (for turning on
> and off relays etc).
> He can also use an old style game port for an analogue input (for
> position sensing).
> All in all the posibilities are endless.
> He is going to have a lot of fun.
Python have serial and parallel debian packages for accessing those
ports. I don't know about game ports. You could probably use a sound
card line-in as a volt meter (standard line is 0-1 Vac) and read it with
python's sound stuff.
As for languages, Ada was created, in part, for programming imbedded
devices like guided missles. It has many compile-time and run-time
sanity checks to help prevent software errors.
Back when I was playing with making robots, I always dreamed of computer
controll. However, the computers of the day couldn't fit in either my
robots (boats, submarines, whatever), nor my wallet.
For motor controll, you may want to look into taking apart an old
dot-matrix printer. If you can get the programming documtation for it
(e.g. my old HP Deskjet [origional] came with all the escape codes in
the manual), you can then controll one motor as line feed and another
motor as the carrage travel (think of printing individual graphics dots
one at a time), and of course the printer's "beep".
You can use a computer speaker to controll a motor's speed. Wire up a
zero-crossing detector that will output a digital signal for each time
an AC input (wire to the computer's speaker) crosses zero, then follow
that with a divide by 1024 (or whatever is suitable), connected to a
drive power transistor. Send appropriate frequency beeps to the speaker
and get appropriatly spaced pulses to to the motor.
There is at least one debian packages for noticing motion in a video
image from a web cam. You can probably do great things with a web cam
on the robot. Python comes with some graphics functions that could be