]> pere.pagekite.me Git - homepage.git/blob - mypapers/drafts/eyebot-compass/eyebot-compass.tex
More links and info.
[homepage.git] / mypapers / drafts / eyebot-compass / eyebot-compass.tex
1 \documentclass[a4paper,10pt, twocolumn]{article}
2 \usepackage{graphicx}
3
4 \title{Connecting an electronic compass to the Eyebot}
5
6 \author{Petter Reinholdtsen $<$pere@td.org.uit.no$>$ \and
7 Mark Gaynor $<$mark@scouts.org.au$>$ \and
8 Klaus Schmitt $<$kschmitt@informatik.uni-kl.de$>$}
9
10 \date{2000-03-22}
11
12 \begin{document}
13 \maketitle
14
15 \section{Introduction}
16
17 During the fall of 1999, the CIIPS Glory robot soccer team started to
18 look into how to connect a compass to the Eyebot controller.
19 Initially, we used dead reckoning to keep track of the heading. This
20 method obviously do not work when the robot is pushed a little of
21 track, and is also accumulating error when the wheels slip. To
22 compensate for these problems and improve our results, we decided to
23 have a look at electronic compasses.
24
25 We first learned about one digital compass, the ``Vector 2X'' from
26 Precision Navigation, Inc. The ``Vector 2x'' is circa $3.8 \times 3.3
27 \times 1$ cm. This document gives a summary on how this driver works,
28 and how to connect and set up such compass with the Eyebot.
29
30 We later learned about the ``Analog sensor no. 1655'' from Dinsmore
31 Instrument Company, a analog compass delivering two output indicating
32 the heading of the compass. The ``Analog sensor no. 1655'' is circa
33 1.3 cm in diameter and circa 1.6 cm tall. This document describe how
34 to connect and read out the heading from this compass.
35
36 \section{Digial compass}
37
38 The digital compass is supposed to have accuracy of $2^\circ$. We
39 have not tested or verified this at the moment. We are running the
40 compass with maximum resolution and in master mode to get the heading
41 of the compass. With maximum resolution it gives an updated heading
42 2.5 times a second.
43
44 \subsection{Wiring and connections}
45
46 This compass could be used with or without an inverter. Without
47 inverters, the compass must be reset in soft software.
48
49 With inverters, DOUT 1 and 2 should be inverted, and RESET should be
50 not connected.
51
52 \begin{figure}
53 \begin{center}
54 \includegraphics[width=3cm]{vector2x}
55 \caption{Vector 2x board layout}
56 \label{fig:vector2x}
57 \end{center}
58 \end{figure}
59
60 The digital compass get power (VCC) and ground (GND) from the Eyebot
61 PSD connector. It needs $5 \pm 0.25$ Volt. The control signals to
62 the compass are connected to the Eyebot digital output connector
63 (DOUT). The control signals from the compass is connected to the servo
64 connector S12 (TPU 13) and the PSD connector. The compass connector
65 names and layout is shown in fig \ref{fig:vector2x}.
66
67 The wires should then connect as given in this table, with the
68 different connectors and connetor pin number given for the Eyebot
69 side.
70
71 To make it possible to mount the compass upside down, the X and Y flip
72 pins should be connected to ground using a strap, to make it
73 configurable which way the compass should work.
74
75
76 \begin{center}
77 \begin{tabular}{|l|l|}
78 \hline
79 {\bf Vector2x} & {\bf Eyebot}\\
80
81 \hline
82
83 P1 (SCLK) & SERVO 1 (TPU) \\
84
85 \hline
86
87 P16 (GND) & PSD 1 (GND) \\
88 P15 (VCC) & PSD 3 (VCC) \\
89 P2 (SDO) & PSD 4 (DIN) \\
90
91 \hline
92
93 P5 (P/C) & DOUT 1 (DO5) \\
94 P6 (CAL) & DOUT 2 (DO6) \\
95 P17 (RESET) & DOUT 3 (DO7) \\
96
97 \hline
98
99 P10 (Y FLIP) & GND or N/C \\
100 P11 (X FLIP) & GND or N/C \\
101
102 \hline
103
104 P3 (SDI) & N/C \\
105 P4 (SS) & N/C \\
106 P7 (RES) & N/C \\
107 P8 (M/S) & (GND) \\
108 P9 (BCD) & N/C \\
109 P12 (CI) & N/C \\
110 P13 (EOC) & N/C \\
111 P14 (RAW) & N/C \\
112
113 \hline
114 \end{tabular}
115 \end{center}
116
117 \subsection{The driver}
118
119 The compass driver is included in a modified version of RoBIOS 3.1.
120 The compass is set up using a hardware description table (HDT) entry
121 like this:
122
123 \begin{verbatim}
124 compass_type compass =
125 {0, /* version */
126 13, /* TPU channel - SCLK */
127 (void*)OutBase, 5, /* P/C */
128 (void*)OutBase, 6, /* CAL */
129 (void*)InBase, 5}; /* SDO */
130
131 HDT_entry_type HDT[] =
132 {
133 ...
134 {COMPASS,COMPASS,"COMPAS",(void *)&compass},
135 ...
136 };
137
138 \end{verbatim}
139
140 The RoBIOS driver uses one Time Processor Unit (TPU) channel to
141 generate an interrupt on the rising edge of the SCLK signal. The
142 interrupt handler then reads out the current value of the SDO signal
143 on the digial input line given in the hardware description table.
144
145 When the compass is connected without an inverter, the RoBIOS kernel
146 must be compiled with {\tt USE\_COMPASS\_NO\_INVERTER} defined to use
147 it properly.
148
149 \section{Analog compass}
150
151 \begin{figure}
152 \begin{center}
153 \includegraphics[width=3cm]{dinsmore-1655}
154 \caption{Analog compass pins looking down through the sensor}
155 \label{fig:dinsmore}
156 \end{center}
157 \end{figure}
158
159 \subsection{Wiring and connections}
160
161 - Temperature control when soldering (documentation warning)
162
163 \begin{center}
164 \begin{tabular}{|l|l|}
165
166 \hline
167
168 VCC & AIN 1 \\
169
170 GND & AIN 9 \\
171
172 Curve 1 & AIN 3 (CH2) \\
173
174 \hline
175
176 VCC & AIN 2 \\
177
178 GND & AIN 10 \\
179
180 Curve 2 & AIN 4 (CH3) \\
181
182 \hline
183 \end{tabular}
184 \end{center}
185
186
187 \section{Using the compass}
188
189 - XXX describe generic API
190
191 int COMPASSInit (DeviceSemantics semantics);
192
193 int COMPASSCalibrate (int mode);
194
195 int COMPASSStart (BOOL cycle);
196
197 int COMPASSCheck (void);
198
199 int COMPASSGet (void);
200
201 int COMPASSStop (void);
202
203 int COMPASSRelease (void);
204
205
206 \section*{References}
207
208 http://dinsmoregroup.com/dico/
209
210 http://www.precisionnav.com/
211
212 \end{document}