Beruflich Dokumente
Kultur Dokumente
a r t i c l e
i n f o
Article history:
Received 3 February 2009
Received in revised form 18 May 2009
Accepted 4 August 2009
Available online 8 August 2009
Keywords:
Optical mouse
Mouse sensor
Rotary encoder
Displacement sensor
a b s t r a c t
In this paper, a new application and capabilities of the sensor of the optical mouse are presented. An
inexpensive incremental rotary encoder is built based on a mechanical assembly where the sensor is at a
xed distance from a rotary white surface onto which a reference black line is drawn. The optical mouse
sensor measures changes in position by optically acquiring sequential surface images and mathematically
determining the direction and magnitude of movement. The optical sensor uses the information of the
images acquired and an attached light source in a closed control loop to keep an average illumination
level in the images. In this paper, the registers involved in this control loop are used to detect high
contrast marks without any dedicated image-processing procedure. The detection of this reference mark
in a rotary white surface allows the correction of long term cumulative errors originated in displacement
measurements performed by the optical sensor and enables the use of the rotary encoder in precision
measurements close to 1900 counts per revolution.
2009 Elsevier B.V. All rights reserved.
1. Introduction
The computer mouse, invented in 1964, has evolved from the
initial mechanical conguration based on wheels and a rotating
ball to the actual design based on optical sensors. The inexpensive
optical mouse sensor can be used specically as a displacement
sensor. In [1] the optical sensor is proposed and tested as a twodimensional displacement sensor over opaque objects when the
height offset does not exceed 1.25 mm. In [2] the optical sensor is
characterized as a motion sensor showing that limitations mainly
arise from the sensitivity of the device to the texture of the reference surface and the upper limit of the working speed. In [3],
the optical mouse sensor shows a very good coefcient of determination in a linear displacement over typical ground surfaces,
R2 = 0.9998, but a high dependence on the relative height of the
sensor with an error of 1% for an offset of 0.1 mm, and very bad
measurements in circular trajectories.
Despite these known problems, the optical mouse sensor has
been used in robotics to measure the displacement and trajectory of
a mobile robot [3,4]. In [59], several redundant optical sensors are
used to reduce the positioning error and eliminate measurement
outliers. In [9] an improvement of 26% in the measurement of the
speed is reported using two complementary sensors.
The optical mouse sensor can be used in other applications
where a kind of linear optical ow [10] is needed. In [11], the sensor is used to measure vibrations. In [12], it is used as a tracking
Corresponding author. Tel.: +34 973 702724; fax: +34 973 702702.
E-mail address: palacin@diei.udl.es (J. Palacn).
0924-4247/$ see front matter 2009 Elsevier B.V. All rights reserved.
doi:10.1016/j.sna.2009.08.003
74
Fig. 1. Example of images obtained with two optical mouse sensors: LED-based
ADNS-3088 LED (left), laser-based ADNS-6010 (right).
The optical sensor generates cumulative error in the measurements [1,4] even in the case of a placement at a xed height
and displacements parallel to its internal axis. This error can be
reduced by averaging a high number of sensors (10 or more) [3]
although this solution is not valid for a small and inexpensive rotary
encoder so, in this paper, we propose the inclusion of reference
marks on the rotary white surface screened by the optical sensor.
The detection of reference marks will enable the correction of the
displacement/rotation measured by the sensor although they will
require an initial calibration to establish the reference value of the
existing counts from mark to mark. In the case of a rotary encoder
the simplest mark is a radial black line (from the center to the outer
radius of the rotary surface). Once detected, the relative cumulated
value of the internal counters can be corrected with the reference
value corresponding to one revolution. The detection of the reference black line can be performed using two alternative methods:
reading the image acquired by the sensor and applying some imageprocessing algorithms or exploiting the information provided by
some additional internal registers involved in the control loop of
the illumination of the optical sensor.
The image acquired by the sensor can be read by repetitive
access to the PIXEL BURST register although this reading stops any
motion measurement and a long time is required to get the complete image using the SPI bus; 900 readings for a 30 30 image
(26 ms in SPI burst mode). The introduction of an internal image
buffer to allow complete image reading without stopping the sensor will enhance the development of unexpected new applications
of the optical mouse sensor [10]. As an alternative, some additional
internal registers as SQUAL, SHUTTER, and PIXELSUM offers average information of the internal status of the illumination control
loop and the image acquired by the sensor. These registers can be
read at any moment without disturbing the sensor and are candidates for indirect black-mark detection without reading the image
acquired by the sensor.
3.1. Detecting marks using SQUAL
The SQUAL register gives information about the changes (also
called features) detected in the image currently being analyzed.
This register is an indication of the roughness of the surface mea-
Table 1
Paper types analyzed.
Type
Size
Color
Manufacturer
Reference
Normal
Recycled
Adhesive
A4
A4
A4
White
White
White
International Paper
Evercopy Plus
Impega
70476
50048
00123
Weight
80 g/m2
80 g/m2
100 g/m2
SQUAL
Displacement
14 5
168 11
64 9
Bad (0)
OK
OK
75
Fig. 3. Image of the experiment performed to evaluate the effect of one transversal
black line in some internal registers of the optical mouse sensor.
Fig. 4. Dynamic evolution of the SQUAL register when moving the optical mouse
sensor over white paper with three transversal black lines of width: 1.2, 3.2 and
5.2 mm, elapsed 25.4 mm.
Fig. 5. Dynamic evolution of the SHUTTER register when moving the optical mouse
sensor over white paper with three transversal black lines of width: 1.2, 3.2 and
5.2 mm, elapsed 25.4 mm.
Fig. 6. Maximum and minimum value of the SHUTTER register for different line
widths.
76
Fig. 7. Dynamic evolution of the PIXELSUM register when moving the optical mouse
sensor over white paper with three transversal black lines of width: 1.2, 3.2 and
5.2 mm, elapsed 25.4 mm.
saturates for widths greater than 7.6 mm. Therefore, an isolated line
wider than 2 mm can be easily detected by reading the SHUTTER
register and applying a threshold detection value of 60.
3.3. Detecting marks using PIXELSUM
The PIXELSUM register is the cumulative value of all the pixels of
the image currently analyzed by the sensor. The register has 8 bits
and its value must be multiplied by 256 to get the real value of the
cumulative addition of the 900 pixels in the image; its maximum
value is 221 (all pixels white). Fig. 7 shows the dynamic evolution
of the PIXELSUM register when repeating the displacement over
the same surface and lines as in the two previous paragraphs. Fig. 7
shows that the PIXELSUM register values range from 130 to 150 for
the white paper but decrease to 60 for a width of 1.2 mm, to 42 for
a width of 3.2 mm and 35 for a width of 5.2 mm (see Fig. 3). After
this initial negative peak, a positive peak up to 220 appears for the
width of 5.2 mm. This positive peak is originated by the internal
control loop of the camera that suddenly increases the intensity
of the LED to force the black line to appear almost white in the
image. Obviously, as the black line disappears from the image, the
PIXELSUM value also increases because the image is then too white.
Fig. 8 shows the maximum, average and minimum value of the
PIXELSUM register for a set of experiments with black lines of different widths. The linear speed of the displacement was xed and
constant (100 mm/s) and lines were isolated with at least 20 mm
Fig. 8. Maximum, average and minimum value of the PIXELSUM register for different line widths.
Fig. 9. Image (right) and drawing (left) of the parameters and parts of the rotary encoder.
Fig. 10. Dynamic evolution of the SHUTTER, PIXELSUM and SQUAL registers when
moving the optical sensor linearly over white paper with three black lines of width:
1.2, 3.2 and 5.2 mm, elapsed 25.4 mm.
77
Fig. 12. Average counts of both measurement axes in the allowed resolutions
depending on the placement radius of the sensor.
Fig. 13. Standard deviation of the counts measured in one complete turn over the
y-axis depending on the placement radius of the sensor.
Fig. 11. Images from the ADNS-3088 used to locate the center of rotation of the wheel of the rotary encoder; the line has a width of 0.2 mm.
78
Fig. 14. Relative error of the counts measured in one complete turn over the y-axis
depending on the placement radius of the sensor.
Fig. 15. Histograms of the absolute error obtained in the counts measured in one
turn at a xed angular speed of 15 rpm and the optical sensor placed at a radius of
10 mm for resolutions of 400 and 800 cpi.
Fig. 16. Maximum, average and minimum counts measured in one complete turn
with the optical sensor placed at a radius of 10 mm.
Fig. 17. Standard deviation of the counts measured in one complete turn with the
optical sensor placed at a radius of 10 mm.
lar speeds from 5 to 100 rpm with the sensor placed at a radius of
10 mm, an angular orientation of 0 , and height of 2.4 mm. Fig. 16
shows that the average value measured decreases linearly with
speed, and the standard deviation of the measurements increases
linearly with speed (Fig. 17), although the average relative error in
the counts measured is always lower than 1.5%, which can be an
acceptable value in the context of inexpensive sensors.
There are no problems detecting the reference line in this speed
range. Fig. 18 shows the maximum, average and minimum values
of the register PIXELSUM, which are almost constant when using
a 0.2 mm wide line in a range of angular speed up to 100 rpm.
The results in Fig. 18 agree with the results also shown in Fig. 8,
therefore the detection of the reference line can be done at very
different angular speeds with a simple threshold in the values of
the PIXELSUM register. In theory, considering only the measurement limitations of the optical sensor, and the time spent reading
the PIXELSUM, DELTA X, and DELTA Y registers sequentially, the
maximum allowable speed when the sensor is placed at a radius
of 10 mm is 490 rpm, although the mechanical design of the rotary
encoder used in this paper did not allow this limit to be veried.
Fig. 19 repeats the previous experiment for line widths of 0.2,
1.2, and 2 mm (see Fig. 20) with the sensor placed at a radius of
Fig. 18. Maximum, average and minimum value of the PIXELSUM register for different angular speeds with the optical sensor placed at a radius of 10 mm.
Fig. 19. Maximum, average and minimum counts measured in one complete turn
for different angular speeds with the optical sensor placed at a radius of 10 mm.
9.8, 10 and 10.2 mm. In all cases, the behavior is very similar; the
counts measured in one revolution slightly decreases as the speed
increases. The sensitivity to speed combined with the deviation of
the measurements precludes direct use of this rotary encoder in
applications where precision measurements are needed. However,
the reference line combined with an initial calibration of the rotary
encoder can be used to improve the precision of the measurements,
as stated in the validation section.
Another important factor in the design of the rotary encoder
is the sensitivity to errors in its angle of orientation, . Fig. 21
shows the average of the relative error in the counts measured in
one revolution depending on the angle of orientation of the sensor (0 corresponds to a perfect tangential orientation) obtained
with a 0.2 mm line, a radius of 10 mm and a xed angular speed
of 15 rpm. In general, the average relative error is below 1% for an
orientation in a range from 2.5 (to the center) to +1 . In his case,
this asymmetry is probably originated by the way that the optical ow algorithm implemented in the optical sensor averages the
displacement detected in the image. Fortunately, this error in the
orientation originates large displacement measurements in the xaxis and so can be automatically detected and corrected in an initial
mechanical calibration operation.
The last experiment of this section is used to conrm the sensitivity of the optical mouse sensor to changes in its relative height.
Starting at the height recommended by the manufacturer (2.4 mm),
Fig. 22 shows the average relative error in the counts measured in
one complete revolution depending on relative changes of height.
The experiment was performed with the optical sensor placed at a
radius of 10 mm and an angular speed of 15 rpm.
Fig. 22 shows that an offset of 0.3 mm in the height originates a
relative error in the measurements of 5.4%. Additionally, Fig. 23
shows the image of the reference line (0.2 mm) viewed by the opti-
79
Fig. 21. Average relative error in the counts measured in one complete turn for
different angles of orientation with the optical sensor placed at a radius of 10 mm.
Fig. 22. Average relative error in the counts measured in one complete turn for
different relative height offsets with the optical sensor placed at a radius of 10 mm.
cal sensor in the case of the recommended height and for an offset
of 1.2 mm where the sensor fails in the measurements.
5. Use and validation of the rotary encoder
The denitive design of the rotary encoder has a 100 mm-radius
wheel and the sensor placed at its recommended height at a radius
of 10 mm from the center of the wheel. The use of the rotary encoder
requires an initial calibration prior to any measurement operation.
As happens in the conventional mouse, it is supposed that the optical sensor will work with a dedicated microprocessor as a bridge to
Fig. 20. Lines of 0.2 (left), 1.2 (center) and 2 mm (right) viewed by the ADNS-3088.
80
Fig. 23. Lines of 0.2 mm viewed by the ADNS-3088 at the nominal height (left) and
with a relative offset of 1.2 mm (right).
Fig. 24. Cumulative relative error in the counts measured by the rotary encoder
when compared with the expected value.
81
[11] T.W. Ng, K.T. Ang, The optical mouse for vibratory motion sensing, Sens. Actuators A SA-116 (2004) 205208.
[12] M.K. Chmarra, N.H. Bakker, C.A. Grimbergen, J. Dankelman, TrEndo, a device
for tracking minimally invasive surgical instruments in training setups, Sens.
Actuators A SA126 (2006) 328334.
[13] G.K. Lott, M.J. Rosen, R.R. Hoy, An inexpensive sub-millisecond system for
walking measurements of small animals based on optical computer mouse
technology, J. Neurosci. Methods JNM-161 (2007) 5561.
[14] S. Matsuda, Measurement of solid circulation rate in a circulating uidized bed,
Powder Technol. PT-187 (2008) 200204.
[15] N.N.A. Charniya, S.V. Dudul, Sensor for classication of material type and its
surface properties using radial basis networks, IEEE Sens. J. SJ-8 (2008) 1981
1991.
[16] N.N.A. Charniya, S.V. Dudul, Investigations into the effects of illumination and
acceleration on optical mouse sensors as contact-free 2D measurement devices,
Sens. Actuators A SA-149 (2009) 8792.
[17] Avago, ADNS-3080 and ADNS-3088 High Performance Optical Mouse Sensor,
http://www.avagotech.com (2008).
Biographies
Marcel Tresanchez received the BSc and MSc degrees in engineering from the University of Lleida (UdL), Spain in 2005 and 2007, respectively. He is currently a Ph.D.
student in the robotics laboratory of the UdL and his research interests include
mobile robots, precision agriculture and the educational application of robotics.
Tomas Palleja received the BSc and MSc degrees in engineering from the University of Lleida (UdL), Spain in 2004 and 2006, respectively. He is currently a Ph.D.
student in the robotics laboratory of the UdL and his research interests include precision agriculture, mobile robots, human system interaction and the educational
application of robotics.
Merce Teixido received the BSc and MSc degrees in engineering from the University
of Lleida (UdL), Spain in 2006 and 2008, respectively. She is currently a Ph.D. student in the robotics laboratory of the UdL and her research interests include human
computer interaction, avatar modeling and the educational application of robotics.
Jordi Palacin received the BSc and MSc degrees in electronics from the Polytechnic
University of Catalonia in 1990 and University of Barcelona (UB), Spain in 1997. He
received the Ph.D. degree in electronics from the UB in 2005. In 1992, he joined the
Department of Computer Science and Industrial Engineering at the University of
Lleida (UdL), Spain leading the robotics group. His research area involves compact
modeling, data fusion and signal processing applications in robotics.