Subject:
|
Re: rotation sensor mystery solved?
|
Newsgroups:
|
lugnet.robotics.rcx.legos
|
Date:
|
Tue, 25 Jan 2000 08:44:18 GMT
|
Viewed:
|
1419 times
|
| |
| |
In lugnet.robotics.rcx.legos, Ben Jackson writes:
> It turns out that the resistance of the ~100cm
> long wire I was using to connect the sensor was enough to move all of the
> sensor results off from what the `ad2state' array expected
When I wrote my original post I was afraid that major surgery was going to be
required to fix this. The values with an extension wire are actually shifted
into formerly invalid slots which are contiguous with the existing state
groups. So the old state table probably covered directly and indirectly
connected sensors with fresh batteries. With my batteries down to 8.6v and the
rotation sensor connected by an extension the values moved too far for the old
table. This version does very well (in dsensor.c):
static const signed char ad2state[16]={
// 0 1 2 3 4 5 6 7 8 9 a b c d e f // (sensor value>>12)
-1,-1,-1,-1,-1,-1, 2, 2, 2, 3, 3, 3, 1, 1, 1, 0
};
It is possible that even lower battery voltages could cause the states to
overlap, but I haven't tested that.
--Ben
|
|
Message has 1 Reply:
Message is in Reply To:
| | rotation sensor mystery solved?
|
| I was getting very erratic readings from a rotation sensor (if I put a pendulum on it and moved it back and forth the 0 position would wander all over the place). I started looking at the raw values from the sensor and comparing them with what the (...) (25 years ago, 25-Jan-00, to lugnet.robotics.rcx.legos)
|
12 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
|
|
|
|