Robotics and parallel ports

I

Isaac T Alston

Basically, I'm thinking about building a robot which can be controlled by
programs which I write, I'm going to interface to the robot through the
parallel port (like in this tutorial here:
linuxfocus.org/English/May2001/article205.shtml). However, I know that this
will probably need to be done in low level C. Now, although I can code in
C, I don't particularly want to :) , instead I'd like to use Python. I'm
wondering, is there any way I can access the parallel port and the kernel
module parport using Python?

Many thanks.

Regards,
 
I

Isaac T Alston

Heiko said:
Maybe it's what you're looking for.

Thanks for that. I've never actually built a robot or anything like that
before, so I'm welcome to any advice I can get! I've heard programming via
USB is hard, so that's why I'm using the parallel port (serial ports are
said to be slow when sending a lot of data (I think)). I think I'll start
off with something very simple, for example controlling a motor and then
move up to more advance models.

Thanks again.

Regards,
 
?

=?ISO-8859-1?Q?Gregory_Pi=F1ero?=

Hi Isaac,

I've been meaning to get into robot building too. After much
consideration I decided to go the Lego Mindstorms route. I actually
figured it was a Pythonic way to go. "Pythonic" meaning finding
something that lets me do I want easily with minimal knowledge of the
system required. (I'm pretty sure it won't actually run Python)

I figure eventually I'll graduate to working on raw electronics like
you, but working with Mindstorms will let me figure out what I'm
interested in and determine what limitations it has.

I'll let you know how my approach goes. I'm figuring I'll get the
Mindstorms for Christmas .. otherwise I'll buy one soon after.

Do drop me an email sometime. I'm very interested to see how you
progress in your approach.

-Greg
 
M

mensanator

Isaac said:
Thanks for that. I've never actually built a robot or anything like that
before, so I'm welcome to any advice I can get! I've heard programming via
USB is hard, so that's why I'm using the parallel port (serial ports are
said to be slow when sending a lot of data (I think)). I think I'll start
off with something very simple, for example controlling a motor

I did that using the Lego Mindstorm Robotics Kit:

and then move up to more advance models.

I never got past the

Turn the motor on
Halt

design.
 
C

c d saunter

Isaac T Alston ([email protected]) wrote:
: Heiko Wundram wrote:
: > Maybe it's what you're looking for.

: Thanks for that. I've never actually built a robot or anything like that
: before, so I'm welcome to any advice I can get! I've heard programming via
: USB is hard, so that's why I'm using the parallel port (serial ports are
: said to be slow when sending a lot of data (I think)). I think I'll start
: off with something very simple, for example controlling a motor and then
: move up to more advance models.

Greetings Isaac,

Go for it! Words of advice on using the parallel port:

1 - there are different modes (SPP, EPP etc.) availible - 'Parallel Port
Interfacing' on www.beyondlogic.org is an excellent starting point. The
mode is set in the PC BIOS, and if it's not set to the mode you're coding
for then you may spend hours being perplexed...

2 - If you're new to robotics etc. make sure you think carefully about
how you connect your motors to the parallel port to prevent hardware
getting blown... An old but good book that covers electronic (and
computer) control of motors is "The Robot Builder's Bonanza"

Seperatly: USB needn't be so hard... This little board of tricks
http://www.dlpdesign.com/usb/usb245.shtml gives you a parallel interface
from USB 1.1, and a C library on the PC (which can be accessed from
Python with ctypes) - data rate is similar to the parallel port, although
latency is much higher, which can kill performance of some applications.

Enjoy!
 
P

Peter Hansen

Isaac said:
I've never actually built a robot or anything like that
before, so I'm welcome to any advice I can get! I've heard programming via
USB is hard, so that's why I'm using the parallel port (serial ports are
said to be slow when sending a lot of data (I think)).

How much data do you plan to send? We build industrial control systems
and robotics for laboratories and use serial ports most of the time
without much concern for performance. Generally speaking you shouldn't
have to send lots of data, and only rare have to receive lots (e.g. if
you have a camera on-board).

The only time I'd consider a parallel port is in the very early stages
if I had no intelligence in the robot, and simply needed a few discrete
output signals to turn motors on and off. In a prototype, for example.
For anything real I would likely have on-board intelligence (embedded
Linux system maybe, or a microcontroller board) and in that case a
serial port is going to be much easier to work with than a parallel port.

-Peter
 
I

Isaac T Alston

Thanks for everyone's tips and hints. I WILL MAKE THIS WORK! I think I'll
take your advice and use the serial port instead of the parallel port - I
won't have that much data to send (in comparison with, for example,
industrial level applications). As for on-board chips though, does this
require low level programming!? Or can I have an embedded python
interpreter for the chip?

Many thanks.

Regards,
 
M

malv

Hi,
Thank you for the info.
The dlp usb solution looks like a terrific gadget, especially since
parallel ports have almost disppeared, at least on portables.
In fact, would in linux not any py software capable of dealing with a
usb connection (almost) suffice? Any further comments would be much
appreciated.
malv
 
C

c d saunter

Isaac T Alston ([email protected]) wrote:
: Thanks for everyone's tips and hints. I WILL MAKE THIS WORK! I think I'll
: take your advice and use the serial port instead of the parallel port - I
: won't have that much data to send (in comparison with, for example,
: industrial level applications). As for on-board chips though, does this
: require low level programming!? Or can I have an embedded python
: interpreter for the chip?

Hi Isaac,
You might be interested in PyMite - http://python.fyxm.net/pycon/papers/pymite/
although I don't know much (anythin? :) about it.

For on board control there are some tiny embedded computers out there that can run
Linux etc. (and hence Python) these days - e.g. see
http://www.linuxdevices.com/articles/AT8498487406.html or you could use a much simpler
processor such as a PIC to implement a simple serial port to dgital and analogue IO
module.

Either way, plent to do :)

Cheers,
cds
 
I

Isaac T Alston

Thanks - now I just have to convince my parents that I should be allowed to
etch circuit boards in my room :) .

Thanks again.

Regards,

Isaac
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,053
Latest member
BrodieSola

Latest Threads

Top