473,327 Members | 1,952 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

Is there a way to program a robot with python (ex, an electric motor, control it's speed, etc)

i hope someone here can help me.

basically, me and my friend have a summer project.

in this project, we need something that would basically function as a
blender. we know we'll need to buy a motor that spins, but what we're
having trouble with is figuring out how to program it. we want to be
able to control the speed of the motor. how would we accomplish this?

i'm new to all of this, so i'm having a hard time wrapping my mind
around how it'd be possible to program one of those things :\

ex: what if i want the motor to turn for 10 seconds. stop for 5. then
turn the other direction.

would you program it the same way you would on a personal computer
(via c, python, etc)?

Jul 9 '07 #1
11 3900
so***********@gmail.com wrote:
i hope someone here can help me.

basically, me and my friend have a summer project.

in this project, we need something that would basically function as a
blender. we know we'll need to buy a motor that spins, but what we're
having trouble with is figuring out how to program it. we want to be
able to control the speed of the motor. how would we accomplish this?

i'm new to all of this, so i'm having a hard time wrapping my mind
around how it'd be possible to program one of those things :\

ex: what if i want the motor to turn for 10 seconds. stop for 5. then
turn the other direction.

would you program it the same way you would on a personal computer
(via c, python, etc)?
Try "comp.robotics.misc" for the basics of robot motor control.

John Nagle
Jul 9 '07 #2
On Jul 8, 5:14 pm, John Nagle <n...@animats.comwrote:
socialanxi...@gmail.com wrote:
i hope someone here can help me.
basically, me and my friend have a summer project.
in this project, we need something that would basically function as a
blender. we know we'll need to buy a motor that spins, but what we're
having trouble with is figuring out how to program it. we want to be
able to control the speed of the motor. how would we accomplish this?
i'm new to all of this, so i'm having a hard time wrapping my mind
around how it'd be possible to program one of those things :\
ex: what if i want the motor to turn for 10 seconds. stop for 5. then
turn the other direction.
would you program it the same way you would on a personal computer
(via c, python, etc)?

Try "comp.robotics.misc" for the basics of robot motor control.

John Nagle
thank you.

Jul 9 '07 #3
On Sun, 2007-07-08 at 17:06 -0700, so***********@gmail.com wrote:
i hope someone here can help me.

basically, me and my friend have a summer project.

in this project, we need something that would basically function as a
blender. we know we'll need to buy a motor that spins, but what we're
having trouble with is figuring out how to program it. we want to be
able to control the speed of the motor. how would we accomplish this?

i'm new to all of this, so i'm having a hard time wrapping my mind
around how it'd be possible to program one of those things :\

ex: what if i want the motor to turn for 10 seconds. stop for 5. then
turn the other direction.

would you program it the same way you would on a personal computer
(via c, python, etc)?
The answers to your questions depend very much on what you're working
with and how the motor is controlled. Is this supposed to be a
self-contained machine, or is it supposed to be connected to a personal
computer as a peripheral device?

The easier way is the peripheral device. In that case, you need some way
of sending signals e.g. from your computer's parallel or serial port to
a relay switch or voltage controller that controls your motor. In that
case, apart from the nitty gritty hardware to make the physical
connections, it's a matter of controlling the parallel or serial port
that the "robot" is attached to, which can definitely be done in Python.

I won't go into details because you're not saying enough about your
project constraints, and as fascinating as your question is, it is
somewhat off-topic on this list (as if that's a deterrent to discussing
something on this list ;-). As John said, you're more likely to receive
useful advice on comp.robotics.misc.

Good luck,

--
Carsten Haese
http://informixdb.sourceforge.net
Jul 9 '07 #4
On Jul 8, 5:06 pm, socialanxi...@gmail.com wrote:
i hope someone here can help me.

basically, me and my friend have a summer project.

in this project, we need something that would basically function as a
blender. we know we'll need to buy a motor that spins, but what we're
having trouble with is figuring out how to program it. we want to be
able to control the speed of the motor. how would we accomplish this?

i'm new to all of this, so i'm having a hard time wrapping my mind
around how it'd be possible to program one of those things :\

ex: what if i want the motor to turn for 10 seconds. stop for 5. then
turn the other direction.

would you program it the same way you would on a personal computer
(via c, python, etc)?
This might be interesting to you.

http://www.makingthings.com/

~Sean

Jul 9 '07 #5
First you'll need a computer interface to your robot. Lego Mindstorm,
for example, comes with ways to program the onboard CPU. Other
standard robotic toolkits will also come with some kind of interface,
which may or may not have Python bindings.

Cheers,
-T

On Jul 9, 10:06 am, socialanxi...@gmail.com wrote:
i hope someone here can help me.

basically, me and my friend have a summer project.

in this project, we need something that would basically function as a
blender. we know we'll need to buy a motor that spins, but what we're
having trouble with is figuring out how to program it. we want to be
able to control the speed of the motor. how would we accomplish this?

i'm new to all of this, so i'm having a hard time wrapping my mind
around how it'd be possible to program one of those things :\

ex: what if i want the motor to turn for 10 seconds. stop for 5. then
turn the other direction.

would you program it the same way you would on a personal computer
(via c, python, etc)?

Jul 9 '07 #6
On Jul 8, 5:37 pm, Carsten Haese <cars...@uniqsys.comwrote:
On Sun, 2007-07-08 at 17:06 -0700, socialanxi...@gmail.com wrote:
i hope someone here can help me.
basically, me and my friend have a summer project.
in this project, we need something that would basically function as a
blender. we know we'll need to buy a motor that spins, but what we're
having trouble with is figuring out how to program it. we want to be
able to control the speed of the motor. how would we accomplish this?
i'm new to all of this, so i'm having a hard time wrapping my mind
around how it'd be possible to program one of those things :\
ex: what if i want the motor to turn for 10 seconds. stop for 5. then
turn the other direction.
would you program it the same way you would on a personal computer
(via c, python, etc)?

The answers to your questions depend very much on what you're working
with and how the motor is controlled. Is this supposed to be a
self-contained machine, or is it supposed to be connected to a personal
computer as a peripheral device?

The easier way is the peripheral device. In that case, you need some way
of sending signals e.g. from your computer's parallel or serial port to
a relay switch or voltage controller that controls your motor. In that
case, apart from the nitty gritty hardware to make the physical
connections, it's a matter of controlling the parallel or serial port
that the "robot" is attached to, which can definitely be done in Python.

I won't go into details because you're not saying enough about your
project constraints, and as fascinating as your question is, it is
somewhat off-topic on this list (as if that's a deterrent to discussing
something on this list ;-). As John said, you're more likely to receive
useful advice on comp.robotics.misc.

Good luck,

--
Carsten Haesehttp://informixdb.sourceforge.net
I would like the robot to be self contained. basically, I'd like to be
able to program functions in python, ex:

while True:
motor.rotate(1)

and have it repeat the same piece of code every time it's turned on.

Jul 9 '07 #7
On Sun, 2007-07-08 at 19:18 -0700, so***********@gmail.com wrote:
On Jul 8, 5:37 pm, Carsten Haese <cars...@uniqsys.comwrote:
On Sun, 2007-07-08 at 17:06 -0700, socialanxi...@gmail.com wrote:
i hope someone here can help me.
basically, me and my friend have a summer project.
in this project, we need something that would basically function as a
blender. we know we'll need to buy a motor that spins, but what we're
having trouble with is figuring out how to program it. we want to be
able to control the speed of the motor. how would we accomplish this?
i'm new to all of this, so i'm having a hard time wrapping my mind
around how it'd be possible to program one of those things :\
ex: what if i want the motor to turn for 10 seconds. stop for 5. then
turn the other direction.
would you program it the same way you would on a personal computer
(via c, python, etc)?
The answers to your questions depend very much on what you're working
with and how the motor is controlled. Is this supposed to be a
self-contained machine, or is it supposed to be connected to a personal
computer as a peripheral device?
[...]
I would like the robot to be self contained. basically, I'd like to be
able to program functions in python, ex:

while True:
motor.rotate(1)
Good luck with that. Your best bet IMHO is to find a single-board
computer (commonly referred to as SBC) that is small enough to fit your
form-factor, capable of running Linux, and equipped with a suitable I/O
interface (e.g. serial or parallel port). In theory, this should allow
you to put Linux and Python on it and control your motor in Python as if
it were a peripheral device connected to a personal computer. In
practice, I've never done anything like this, and the devil is in the
details that you'll need to work out for yourself.

--
Carsten Haese
http://informixdb.sourceforge.net
Jul 9 '07 #8
One "generic" way is using your parallel port for outputting voltages
that would control Relays [2] that would be conected to the motor.

Parapin [1] is the easiest way i know to work with parallel ports but
its for C++, the python binding is still being developed [2].
[1] http://parapin.sourceforge.net/
[2] http://en.wikipedia.org/wiki/Relay
http://es.wikipedia.org/wiki/Rel%C3%A9 <- these graphics are kinda better
[3] http://pyserial.sourceforge.net/pyparallel.html

On 7/9/07, Carsten Haese <ca*****@uniqsys.comwrote:
On Sun, 2007-07-08 at 19:18 -0700, so***********@gmail.com wrote:
On Jul 8, 5:37 pm, Carsten Haese <cars...@uniqsys.comwrote:
On Sun, 2007-07-08 at 17:06 -0700, socialanxi...@gmail.com wrote:
i hope someone here can help me.
>
basically, me and my friend have a summer project.
>
in this project, we need something that would basically function as a
blender. we know we'll need to buy a motor that spins, but what we're
having trouble with is figuring out how to program it. we want to be
able to control the speed of the motor. how would we accomplish this?
>
i'm new to all of this, so i'm having a hard time wrapping my mind
around how it'd be possible to program one of those things :\
>
ex: what if i want the motor to turn for 10 seconds. stop for 5. then
turn the other direction.
>
would you program it the same way you would on a personal computer
(via c, python, etc)?
>
The answers to your questions depend very much on what you're working
with and how the motor is controlled. Is this supposed to be a
self-contained machine, or is it supposed to be connected to a personal
computer as a peripheral device?
[...]
I would like the robot to be self contained. basically, I'd like to be
able to program functions in python, ex:

while True:
motor.rotate(1)

Good luck with that. Your best bet IMHO is to find a single-board
computer (commonly referred to as SBC) that is small enough to fit your
form-factor, capable of running Linux, and equipped with a suitable I/O
interface (e.g. serial or parallel port). In theory, this should allow
you to put Linux and Python on it and control your motor in Python as if
it were a peripheral device connected to a personal computer. In
practice, I've never done anything like this, and the devil is in the
details that you'll need to work out for yourself.

--
Carsten Haese
http://informixdb.sourceforge.net
--
http://mail.python.org/mailman/listinfo/python-list

--
/* Carlos A. Guerrero M. [Alias: Sid] */
/* ------------------------------- */
/* Linux User 390240 */
http://guerrerocarlos.blogspot.com
http://guerrerocarlos.wordpress.com
http://www.tooche.com.ve
Jul 9 '07 #9
<socialanxiety@......comwrote:
i hope someone here can help me.

basically, me and my friend have a summer project.

in this project, we need something that would basically function as a
blender. we know we'll need to buy a motor that spins, but what we're
having trouble with is figuring out how to program it. we want to be
able to control the speed of the motor. how would we accomplish this?

i'm new to all of this, so i'm having a hard time wrapping my mind
around how it'd be possible to program one of those things :\

ex: what if i want the motor to turn for 10 seconds. stop for 5. then
turn the other direction.

would you program it the same way you would on a personal computer
(via c, python, etc)?
It needs a bit more than just the motor - you need to organise some i/o
(lines that the computer can control) and some kind of interface to control
the power, and you have to put it all together - can you solder?

It may be easier to forget about the computer stuff and just use relay logic
for direction control - given that it is a DC motor that would turn the other
way, and not a universal motor (like the one in a drill, that turns the same
way given either AC or DC).

Speed control for a small motor can be accomplished by a heavy rheostat
in series with the motor.

And that should be good enough for a summer project.

On the other hand, if you (or your parents) have pots of money then
you can buy digital to analog hardware that can be used to tell a powerful
DC coupled amplifier what to do, and have a stab at programming the
resultant combination.

But if I were you, I would do the first kind of thing, and use the rest of the
summer to soak up the sun, instead of breathing solder fumes in a basement,
or crouching over a keyboard ruining your eyes watching a screen...
HTH - Hendrik

Jul 9 '07 #10
En Sun, 08 Jul 2007 21:06:48 -0300, <so***********@gmail.comescribió:
in this project, we need something that would basically function as a
blender. we know we'll need to buy a motor that spins, but what we're
having trouble with is figuring out how to program it. we want to be
able to control the speed of the motor. how would we accomplish this?
This is mostly an electronics question. How much power? For small power
and fine control I'd look for "stepwise motor" on any robotics book; for a
high power "blender" I think you don't care so much about fine control. In
any case, it's the available motor which dictates how you can control it.
i'm new to all of this, so i'm having a hard time wrapping my mind
around how it'd be possible to program one of those things :\

ex: what if i want the motor to turn for 10 seconds. stop for 5. then
turn the other direction.
You may write the GUI using python, and the high level controlling API
too. But you may need to use a PIC or some kind of controller, listening
for commands from the PC and acting over the motor accordingly.

Picasso: a Python-controlled robot for doing paintings
http://youtube.com/watch?v=PsbKq5Kysj0

--
Gabriel Genellina

Jul 9 '07 #11
For a robotics project I would highly recommend the use of Phidgets,
they can supply sensors and interface kits with APIs. Not sure if
Python is fully supported yet but there certinally seems to be a
considerable effort ongoing creating an API for python. I've only used
them to date for servo control and accelorometer sencor data
collection through c++ / wxWidgets.

http://www.phidgets.com/

They offer direct motor controllers but I'll be looking to control a
7.2V motor with a 100A draw, so I'll be using the servo controller to
drive a standard Radio Control Car motor controller.

Cheers,

Wes.

On 09/07/07, Gabriel Genellina <ga*******@yahoo.com.arwrote:
En Sun, 08 Jul 2007 21:06:48 -0300, <so***********@gmail.comescribió:
in this project, we need something that would basically function as a
blender. we know we'll need to buy a motor that spins, but what we're
having trouble with is figuring out how to program it. we want to be
able to control the speed of the motor. how would we accomplish this?

This is mostly an electronics question. How much power? For small power
and fine control I'd look for "stepwise motor" on any robotics book; for a
high power "blender" I think you don't care so much about fine control. In
any case, it's the available motor which dictates how you can control it.
i'm new to all of this, so i'm having a hard time wrapping my mind
around how it'd be possible to program one of those things :\

ex: what if i want the motor to turn for 10 seconds. stop for 5. then
turn the other direction.

You may write the GUI using python, and the high level controlling API
too. But you may need to use a PIC or some kind of controller, listening
for commands from the PC and acting over the motor accordingly.

Picasso: a Python-controlled robot for doing paintings
http://youtube.com/watch?v=PsbKq5Kysj0

--
Gabriel Genellina

--
http://mail.python.org/mailman/listinfo/python-list
Jul 9 '07 #12

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: sayoyo | last post by:
Hi Guys, I have to implement a design in Java which is a collection class gathers several units of the same class. I was thinking about two ways to implement it. the first is to create two...
1
by: Will Stuyvesant | last post by:
I never used the popen or popen2 libraries but it is my understanding that they can capture the output of console based programs. Is it also possible to send keystrokes to console base programs? ...
3
by: Ricardo | last post by:
Hi, my name is Ricardo and i'm learning to program in Python with version 2.3.3, i'm also using the latest version of PythonWin(163) but i'm trying to do it with a book (Written in Portuguese) that...
26
by: Wolfgang Keller | last post by:
Hello, is it that my know-how to use Google is insufficient or... ....does really noone use Python for industrial control applications? At least I didn't manage to find any publicly...
13
by: squash | last post by:
I am a little annoyed at why such a simple program in Perl is causing so much difficulty for python, i.e: $a += 200000 * 140000; print $a;
2
by: diffuser78 | last post by:
I want to write a simple clinet/server program that does the following. On Windows, the program listens to the request from linux box On Linux Box, client program send server a shutdown request...
1
by: GnanaKumar | last post by:
hi, Can any one explain me how to execute COBOL program using Python scripts... do i need any third party tool to do this.. can you pls help me out regards, Gnana Kumar
2
by: Sardonic | last post by:
i hope someone here can help me. basically, me and my friend have a summer project. in this project, we need something that would basically function as a blender. we know we'll need to buy a...
0
by: Dr. Colombes | last post by:
I've used a very nice Keystroke Logger Python shareware program (EVDEV.py), written by Micah Dowty. But I couldn't find a dedicated ASCII Character Logger program. Does anyone know of an ASCII...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.