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

S

socialanxiety

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)?
 
J

John Nagle

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
 
C

Carsten Haese

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,
 
H

half.italian

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
 
T

tleeuwenburg

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
 
S

socialanxiety

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,

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.
 
C

Carsten Haese

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.
 
C

Carlos Guerrero

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é <- these graphics are kinda better
[3] http://pyserial.sourceforge.net/pyparallel.html

On Sun, 2007-07-08 at 17:06 -0700, (e-mail address removed) 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.


--
/* Carlos A. Guerrero M. [Alias: Sid] */
/* ------------------------------- */
/* Linux User 390240 */
http://guerrerocarlos.blogspot.com
http://guerrerocarlos.wordpress.com
http://www.tooche.com.ve
 
H

Hendrik van Rooyen

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
 
G

Gabriel Genellina

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
 
W

Wesley Brooks

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.
 

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

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top