| | 
      |   |   
            | Subject: 
 | Re: more on the rotation sensor 
 |  
            | Newsgroups: 
 | lugnet.robotics.rcx.legos 
 |  
            | Date: 
 | Sat, 29 Jan 2000 17:32:18 GMT 
 |  
            | Viewed: 
 | 3214 times 
 |  |  |  
 | 
 |  | Ben (ben@ben.com) wrote: 
 > I did some more experiments last night.  My conclusion is that the majority  of
 > apparent 2-state transitions never actually occur (that is: the sensor does  not
 > actually travel through 2 states between two consecutive sensor readings).
 >
 > The order of the states (as defined by legOS, in order of increasing raw  value)
 > is:  2, 1, 3, 0.  0 is unambiguous:  the sensor always returns 1023 under  all
 > conditions.  The other three are large ranges of values from the sensor.  These
 > ranges (with my patch) are contiguous, because the battery level and length  of
 > connecting wire skew the return values up and down.
 >
 > In order to move 2 states you either have to have a jump from 0->2 or 2->0,  or
 > a 1->3 or 3->1.  The 2/0 transitions never happen accidentally because they  are
 > so far apart.  What I think is happening is that in some cases the observed
 > sensor value for a 1-state or a 3-state is landing right in the middle and
 > being misinterpreted.  When I captured the raw sensor values at the instant  the
 > glitch occurred, they were almost always right on the upper edge of the 1  range
 > or the lower edge of the 3 range.  These readings don't show up if you move  the
 > rotation sensor slowly through all of the values (at the same battery  strength
 > and with the same connecting wires).
 >
 > So the question is what to do about these transient readings.  I still need  to
 > gather more data to understand what's going on...
 >
 > --Ben
 
 I think I have an idea what is going on.
 Consider the sensor rotating forwards. If typical readings for states 0 to 3
 are
 3,  1, 0, and 2 (ordered as in your message) the input goes through the
 series:
 
 state : 0 -> 1 -> 2 ->  3 -> 0 ->...
 input : 3 -> 1 -> 0 ->* 2 -> 3 ->...
 
 As the input is an analog signal, if you read it while it is changing from
 state
 2 to 3 and the input is changing from 0 to 2 (marked with a * above) you may
 get a reading corresponding to a 1. This will be interpreted as a move
 backwards to state 1. The next reading will correspond to state 3 (which is
 where the sensor really is) giving an apparent 2-state transition.
 
 The thing to do about transient readings is to debounce them, that is to
 take
 successive readings until for example you get two the same. You can only do
 this if you can read faster than the hardware changes state. I'm afraid I
 don't
 know enough about legos or RCX timings to suggest a scheme, but you should
 be able to find one that works with a bit of experimentation.
 
 Hope this helps
 Philip Brown
 
 |  |  |  
 
 Message has 1 Reply:
 
  |  |  | Re: more on the rotation sensor 
 | 
 |  | (...) value) (...) The order is numerical, either 0->1->2->3->0... or 0->3->2->1->0... That's why legOS has them enumerated that way. The Mindstorms fw numbers them differently, which is why I mentioned it. (...) I don't think your specific example (...)   (26 years ago, 29-Jan-00, to lugnet.robotics.rcx.legos) 
 |  3 Messages in This Thread:
 
      
 
      Entire Thread on One Page:
      
        Nested: 
        All | Brief | Compact | Dots
        Linear: 
        All | Brief | Compact
 | 
 | 
 | 
 |