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