By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
449,314 Members | 1,772 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 449,314 IT Pros & Developers. It's quick & easy.

Robotics and parallel ports

P: n/a
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,

--
sleepingeliminator
Dec 15 '05 #1
Share this Question
Share on Google+
11 Replies


P: n/a
Isaac T Alston wrote:
I'm wondering, is there any way I can access the parallel port and
the kernel module parport using Python?


A quick Google search for "parport python" turned up this:

http://bigasterisk.com/parallel

Maybe it's what you're looking for.

--- Heiko.
Dec 15 '05 #2

P: n/a
Isaac T Alston wrote:
I'm wondering, is there any way I can access the parallel port and
the kernel module parport using Python?


Or you might even give pyparallel a try:

http://pyserial.sourceforge.net/pyparallel.html

I've used that before to control a psychology experiment setup, and it works
just fine, under Linux and under Windows.

--- Heiko.
Dec 15 '05 #3

P: n/a
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.

Thanks again.

Regards,

--
Isaac
Dec 15 '05 #4

P: n/a
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
On 12/15/05, Isaac T Alston <sl****************@gmail.com> 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.

Thanks again.

Regards,

--
Isaac
--
http://mail.python.org/mailman/listinfo/python-list

--
Gregory Piñero
Chief Innovation Officer
Blended Technologies
(www.blendedtechnologies.com)
Dec 15 '05 #5

P: n/a

Isaac T Alston 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


I did that using the Lego Mindstorm Robotics Kit:

<http://members.aol.com/rotanasnem/lego.htm>
and then move up to more advance models.
I never got past the

Turn the motor on
Halt

design.

Thanks again.

Regards,

--
Isaac


Dec 15 '05 #6

P: n/a
Isaac T Alston (sl****************@gmail.com) 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!
Dec 15 '05 #7

P: n/a
Isaac T Alston wrote:
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

Dec 16 '05 #8

P: n/a
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,

--
Isaac
Dec 16 '05 #9

P: n/a
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

Dec 16 '05 #10

P: n/a
Isaac T Alston (sl****************@gmail.com) 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
Dec 17 '05 #11

P: n/a
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
Dec 19 '05 #12

This discussion thread is closed

Replies have been disabled for this discussion.