[Prev][Next][Index][Thread]

Re: differential optical sensors - some sums




Hi everyone,

    For a 8 bits sensor, a simple 256 bytes/word table pre-computed in 
ram/rom
    will do the tick. And without DSP fix point or floating point 
computation

 Louis Geoffroy  

Bill Marshall wrote:

>Heh Heh! I've been programming real-time systems for years, and IMHO the
>thing that 'separates the men from the boys' is successfully converting
>algorithms written and tested in a high-level language with floating-point
>maths, to fixed-point on a simple DSP chip or microcontroller. Suddenly
>over- and underflow errors cause chaos when working with very limited
>precision maths. Of course floating point routines are available for most
>micros, but the overhead can be huge making real-time operation impossible
>with a high sampling rate. I write control programs in assembler, using a
>library of 16- and 32-bit maths subroutines I put together for the 8051-core
>processors I work with. Sensor resolution is no more than 8-bit. Higher
>resolution should never be necessary in this sort of application.
>
>Bill Marshall
>
>----- Original Message ----- 
>From: "Duncan Louttit" <duncan@swallow.co.uk>
>To: <micromouse@cs.rhul.ac.uk>
>Sent: Wednesday, October 15, 2003 2:01 PM
>Subject: Re: differential optical sensors - some sums
>
>
>  
>
>>Hi Everyone,
>>
>>Concerning Pete's sums, I have not had chance to check over the theory,
>>but one thing does leap out at me. Why do you need floating point? All the
>>numbers that you get from the sensors are fixed-point and the answer needs
>>to be to 8 bit resolution. A bit of analysis should anable you to do the
>>whole thing fixed-point but perhaps you will need to go to something like
>>24 bit precision. That's still a lot quicker than floating point on an
>>    
>>
>AVR!
>  
>
>>Sorry, floating point arithmetic on real-world sensor data is one of my
>>hobby-horses!
>>
>>Regards,
>>
>>Duncan
>>
>>At 21:57 13/10/03 +0100, you wrote:
>>    
>>
>>>Hi
>>>
>>>I have been looking at Duncan's paper on the differential sensors. I
>>>also did some measurements using the sensors on my mouse. Duncan noted
>>>that the response of the sensors was not actually an inverse square. I
>>>guess that, on mature reflection, it wouldn't be. Firstly, you would
>>>expect an inverse square relationship for the level of illumination -
>>>that is, the amount of light per unit area. That is not what the sensors
>>>are measuring. They measure the amount of light they see. As the
>>>distance grows, pretty much the same amount of light is reflected from
>>>the wall. However, there are losses and so you get a non-linear, but not
>>>square law, relationship.
>>>
>>>I took a few observations and fitted a curve to my results and came up
>>>with a relationship that was something like distance raised to the power
>>>-1.4. This is difficult to write in plain ASCII.
>>>
>>>Anyway, I did some sums and drew some graphs. Then I did some cheating
>>>on the sums and started again when it got hard.
>>>
>>>The result is wrapped up in this PDF
>>>
>>>http://micromouse.cannock.ac.uk/sensors/differential_sensors.pdf
>>>
>>>I would be grateful if anyone could look it over and tell me what they
>>>think. It is a bit long-winded but there you go :)
>>>
>>>
>>>
>>>      
>>>
>>    
>>
>
>
>
>  
>