Subject:
|
Re: Weird RCX electrical ideas
|
Newsgroups:
|
lugnet.robotics
|
Date:
|
Mon, 1 Sep 2003 16:06:33 GMT
|
Viewed:
|
986 times
|
| |
| |
In lugnet.robotics, Orion Pobursky wrote:
|
Well Jordan I know a little about DC motor theory. In essence a DC Motor and
a DC Generator are the same thing. The amount of ripple (i.e. the frequency
of the pulses although frequency is a bad term to use) is dependent on 2
things: the speed of the input shaft and the number of commutation points the
machine has. The commutation points are fixed by machine construction. As
far as controlling motor speed, I dont know if you could get speed low enough
for the RCX to pick up the pulse (if indeed the RCX can detect the pulses).
-Orion
|
I got a private email that said this:
Jordan,
this idea is a good one. and has proved to work in the past. if you
have 2 rcx's, then try it. heck you can even experiment with just one
RCX for proof of concept.
run a wire from the motor out to a sensor in.
if memory serves, set the sensor as a light.
and if you don't want to risk damage to your RCX
ONLY EVER PULSE THE MOTOR BETWEEN OFF and FLOAT!
I used this for my Project X robot to communicate between my 3 rcx.
it works very well, I used a very primitive communications method.... I
simply had the receiving RCX count the pulses and then use that number
to "do something"
if you fear the direct connection route, you can build an opto isolator,
and power a lego light, with the motor port, and use a light sensor to
detect that flashes.
both work very well.
|
|
I dont have two RCXs, but I did test it with one, like he suggested. Hes
right. Heres the NQC code I wrote:
#define INPUT SENSOR_1
#define BUTTON SENSOR_3
#define OUTPUT OUT_A
task main()
{
#ifdef __RCX
SetSensor(INPUT, SENSOR_LIGHT);
SetSensor(BUTTON, SENSOR_TOUCH);
#endif
Float(OUTPUT);
while(true)
{
until(BUTTON == 1);
PlaySound(SOUND_CLICK);
Off(OUTPUT);
Wait(100);
until(BUTTON == 1);
Float(OUTPUT);
PlaySound(SOUND_LOW_BEEP);
Wait(100);
}//while
}//main
|
|
If you want to test it yourself, take a short wire and connect output A to input
1. Then take a longer wire and attach a touch sensor to input 3. Use the View
button on the RCX to look at input 1, and then run the program.
First it tells the output to float, so you should see 0 in the display. Then
the code enters the infinite loop. As soon as you press the touch sensor, it
will tell the motor output to go off. This makes the input see 100. The code
also plays a different sound for each button press so you know where you are in
the code. So if you press it again, the motor output is told to float, so the
input will see 0 again. Press it again, and it will be told to turn off, so
youll see 100 again. Rinse. Repeat.
So I could theoretically pulse messages of Off Float Off Float Off Float and
have the receiving RCX count them, and then perform an action based on the
message. Thats exactly what I wanted.
I also just now realized why its seeing 100 for off. The RCX is sending power
to the motor to counterract whatever direction it was previously going, which is
like an electrical brake. Floating the motor, though, shuts off the current
completely, so the motor spins down nicely. Well, it would spin down nicely,
but theres no motor in this situation.
|
|
Message has 1 Reply:
Message is in Reply To:
| | Re: Weird RCX electrical ideas
|
| <snip> (...) Well Jordan I know a little about DC motor theory. In essence a DC Motor and a DC Generator are the same thing. The amount of ripple (i.e. the frequency of the pulses although frequency is a bad term to use) is dependent on 2 things: (...) (21 years ago, 1-Sep-03, to lugnet.robotics)
|
9 Messages in This Thread:
- Entire Thread on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
This Message and its Replies on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
|
|
|
Active threads in Robotics
|
|
|
|