Subject:
|
#5120 Polarity Switch: cheap shaft encoder/rotation sensor?
|
Newsgroups:
|
lugnet.robotics
|
Date:
|
Sun, 23 Jan 2000 10:21:10 GMT
|
Viewed:
|
825 times
|
| |
| |
If you remove the lever from the polarity switch you can insert an axle through
the switch which will cycle the switch continuously between fwd/off/rev/off.
Since most of the tension in the switch is actually provided by the lever slot,
this axle can turn pretty freely. If you connect both ends of this switch
straight across, it's an open circuit for fwd and off, and it's a short for
rev, so you can than connect this to a passive RCX sensor input just like a
normal button. It will be off 3/4th of the time and on 1/4th of the time, and
you see two 'on' cycles per rotation. A sensor set to SENSOR_EDGE (if you're
using NQC and the standard mindstorms fw) counts up 4 (2 transitions, to on, 2
to off) for every turn of the axle (either way -- no way to tell direction).
This can't keep up with a motor due to the debounce code in the mindstorms fw.
According to the internals page, a transition can only occur every 300ms, so
this works out to about 45rpm max. Even in NQC you may be able to do better by
sampling it manually. legOS could probably do very well.
Since my rotation sensors finally arrived, I doubt I'll ever use this. But
since I noticed it I had to point it out. :-)
--Ben
|
|
Message has 1 Reply:
2 Messages in This Thread:
- Entire Thread on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
|
|
|
Active threads in Robotics
|
|
|
|