472,989 Members | 3,028 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,989 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 3886
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: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
3
SueHopson
by: SueHopson | last post by:
Hi All, I'm trying to create a single code (run off a button that calls the Private Sub) for our parts list report that will allow the user to filter by either/both PartVendor and PartType. On...

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.