To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.roboticsOpen lugnet.robotics in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / 22706
22705  |  22707
Subject: 
RE: interfacing PCs with LEGO?
Newsgroups: 
lugnet.robotics
Date: 
Mon, 23 Aug 2004 20:29:42 GMT
Original-From: 
PeterBalch <PeterBalch@compuserve.!spamless!com>
Viewed: 
1690 times
  
Joe

Any PIC con only do one time-critcal thing.
A cheap PIC costs around a dollar. So use one PIC per joint or motor to • do
a PID-feedback loop or whatever.
I had no idea PICs could be obtained for so cheap.  Is there a
particular one you would recommend, for programming/control via a
serial port?

My usual architecture is a 16F877 for heavy-duty processing then hang
several 12F629 off it for controlling peripherals. The 12F629 costs £0.76
(in 25off in the UK) which is around US$1. Shop around and you might get
them a few cents cheaper.

The 16F877 has a serial port and so talks to the PC. In your case, that's
probably all it would do - just act as a hub.

The 12F629 has 6 I/O pins but doesn't have a hardware serial port. You
could make one in s/w but that would be your "one time-critcal thing". So I
use two I/O pins to implement a synchronous serial protocol. That way, both
PICs wait until their both ready then exchange a byte of data then go back
to doing their main job. I can send you some documentation and code if you
like. All the 12F629s appear to the 16F877 as a "standard peripheral". I've
used 12F629s that way to control motors, ultrasonic sensor, IR-LED sensor,
keypad, etc.

If you're new to PICs then it might be best to start with the 16F627 which
has a built-in UART and a total of 16 I/O pins. Connect all the 16F627s to
the same RS232 line of the PC. You'd use one transistor (per PIC or one for
all the PICs) to invert the PC's RS232 signal into the PIC. Use another
transistor to invert the PIC's RS232 signal to the PC - use one pnp
transistor per PIC but only use one collector pull-down resistor for all
the PICs. That way, if any PIC sends, the signal gets sent to the PC.

Make the PICs anly send a byte when requested to do so by the PC. That way,
they won't all try to talk at once.

Sorry if I'm telling you stuff you already know - maybe you're an
electronics and serial-comms expert. I can send circiut diags if you want.

It's not LEGO, but it is cool and sounds more like what you describe
above--would probably be a heck of a lot cheaper than attempting to do
the same in LEGO.
I haven't the tools, skills, or desire to work with metal or fabricate
custom parts.  I'm willing to do a bit of adaptation to, say, make an
RC servo interface with my LEGO structural elements, but that's about
the only custom fabrication I think I can handle.

So you're planning to build a Lego buggy, add custom motor-control
electronics controlled over an umbilical from the PC? Then add a cheap
camera with a radio or wire link to a TV-card in the PC. A "security"
camera with a radio link is pretty cheap nowadays. And RS232 radio links
are cheap too so you could run it all off your desktop PC.

If you're going to put a small laptop on the buggy then I suspect you'll
get into metal fabrication whether you want to or not.

All the best,

Peter



1 Message in This Thread:

Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR