Last modified by Eric Nantel on 2026/04/02 16:09

Show last authors
1 {{html wiki="false" clean="false"}}
2 <style>
3 .asm { font-family: Verdana, Helvetica, sans-serif; font-size: 14px; max-width: 960px; }
4 .asm-step { background: #fff; border: 1px solid #ddd; border-radius: 8px; margin-bottom: 1.5rem; overflow: hidden; }
5 .asm-step-header { background: #F5A800; display: flex; align-items: stretch; justify-content: space-between; }
6 .asm-step-name { padding: 0.6rem 1rem; font-weight: bold; font-size: 15px; color: #2C1A00; }
7 .asm-step-num { background: #1a1a1a; color: white; padding: 0.6rem 1.1rem; font-weight: bold; font-size: 15px; display: flex; align-items: center; white-space: nowrap; }
8 .asm-step-body { display: flex; flex-wrap: wrap; gap: 1.25rem; padding: 1rem; align-items: flex-start; }
9 .asm-step-text { flex: 1 1 250px; font-size: 13px; line-height: 1.6; }
10 .asm-step-figure { flex: 0 1 280px; text-align: center; }
11 .asm-step-figure img { max-width: 100%; height: auto; border: 1px solid #ccc; border-radius: 4px; }
12 .asm-step-figure span { display: block; font-size: 12px; color: #666; margin-top: 0.3rem; }
13 .asm-fullwidth { padding: 1rem; border-top: 1px solid #eee; font-size: 13px; }
14 .asm-fullwidth img { max-width: 100%; height: auto; border: 1px solid #ccc; border-radius: 4px; display: block; margin: 0.5rem auto; }
15 .asm-info { background: #f9f9f9; border: 1px solid #ddd; border-radius: 8px; padding: 1rem; margin-bottom: 1.5rem; font-size: 13px; line-height: 1.8; }
16 .asm-info h2 { font-size: 15px; margin: 0 0 0.5rem 0; color: #2C1A00; }
17 .ref-table { border-collapse: collapse; width: 100%; font-size: 12px; margin-top: 0.5rem; }
18 .ref-table th { background: #ccc; border: 1px solid #aaa; padding: 0.3rem 0.6rem; text-align: center; }
19 .ref-table td { border: 1px solid #ddd; padding: 0.3rem 0.6rem; }
20 .ref-table td:nth-child(odd) { background: #e8e8e8; text-align: center; font-weight: bold; }
21 .ref-table td:nth-child(even) { background: #fff; }
22 .ref-table tr:first-child td { background: #ccc; font-weight: bold; text-align: center; }
23 .code-block { background: #1a1a1a; color: #f0f0f0; font-family: 'Courier New', monospace; font-size: 12px; padding: 1rem; border-radius: 6px; white-space: pre; overflow-x: auto; margin-top: 0.75rem; line-height: 1.6; }
24 .safety { color: #c00; font-weight: bold; }
25 .warning { color: #c00; font-weight: bold; }
26 h1 { font-size: 18px; margin-bottom: 0.25rem; }
27 </style>
28
29 <div class="asm">
30
31 <!-- Header -->
32 <div style="padding: 0.5rem 0 1rem 0;">
33 <h1>The Complete 2DOF Hexapod Tutorial</h1>
34 <p><b>Updated September 30, 2010</b></p>
35 <p>This tutorial follows the <a href="https://wiki.lynxmotion.com/info/wiki/lynxmotion/view/servo-erector-set-robots-kits/ses-v1-robots/ses-v1-2dof-hexapods/inline-hexapod-body/" target="_blank">2DOF Hexapod assembly guide</a>. Make sure all servos and other connections are set up as detailed there.</p>
36 </div>
37
38 <!-- Requirements -->
39 <div class="asm-info">
40 <h2>Required Hardware</h2>
41 <p>Any Lynxmotion 2 DOF Hexapod, SSC-32, Bot Board / BASIC Atom Pro 28, PS2 Cable, PS2 Wireless Controller (not included in combo kit), Sharp GP2D12 Sensor (optional)</p>
42 <h2>Required Software</h2>
43 <p>
44 <a href="https://wiki.lynxmotion.com/info/wiki/lynxmotion/view/ses-software/lynxterm/" target="_blank">LynxTerm</a> (free download) | Basic Micro Studio ver 2.0.0.0<br>
45 Basic Atom Pro Hexapod Programs:
46 <a href="https://wiki.lynxmotion.com/info/wiki/lynxmotion/download/servo-erector-set-robots-kits/ses-v1-robots/ses-v1-2dof-hexapods/the-complete-2-dof-hexapod-tutorial/WebHome/h2prog01.zip" target="_blank">h2prog01.zip</a> PS2 |
47 <a href="https://wiki.lynxmotion.com/info/wiki/lynxmotion/download/servo-erector-set-robots-kits/ses-v1-robots/ses-v1-2dof-hexapods/the-complete-2-dof-hexapod-tutorial/WebHome/h2prog02.zip" target="_blank">h2prog02.zip</a> PS2 |
48 <a href="https://wiki.lynxmotion.com/info/wiki/lynxmotion/download/servo-erector-set-robots-kits/ses-v1-robots/ses-v1-2dof-hexapods/the-complete-2-dof-hexapod-tutorial/WebHome/h2prog03.zip" target="_blank">h2prog03.zip</a> PS2 |
49 <a href="https://wiki.lynxmotion.com/info/wiki/lynxmotion/download/servo-erector-set-robots-kits/ses-v1-robots/ses-v1-2dof-hexapods/the-complete-2-dof-hexapod-tutorial/WebHome/h2prog04.zip" target="_blank">h2prog04.zip</a> Autonomous
50 </p>
51 <h2>Resources</h2>
52 <p><a href="https://wiki.lynxmotion.com/info/wiki/lynxmotion/download/servo-erector-set-robots-kits/ses-v1-robots/ses-v1-2dof-hexapods/the-complete-2-dof-hexapod-tutorial/WebHome/2dofsch2.gif" target="_blank">Wiring Schematic (2dofsch2.gif)</a></p>
53 <h2>Goal</h2>
54 <p>Install, program, and test the electronics to operate a Hexapod 2 remotely from a Lynxmotion wireless controller or autonomously using sensors.</p>
55 </div>
56
57 <!-- Step 1 -->
58 <div class="asm-step">
59 <div class="asm-step-header">
60 <div class="asm-step-name">2DOF Hexapod Tutorial — Establishing Communication</div>
61 <div class="asm-step-num">Step 1 / 10</div>
62 </div>
63 <div class="asm-step-body">
64 <div class="asm-step-text">
65 <p>Connect the serial data cable to the PC's serial port (recognized by 9 pins that stick out). Connect the other end to the SSC-32's DB9 port.</p>
66 <p>Note: if your computer does not have a native serial port, you can use a high quality USB to Serial adapter such as one made by FTDI. If using an FTDI adapter, install the VCP (Virtual Com Port) driver and change the "latency" property to its minimum.</p>
67 </div>
68 <div class="asm-step-figure">
69 <img src="https://wiki.lynxmotion.com/info/wiki/lynxmotion/download/servo-erector-set-robots-kits/ses-v1-robots/ses-v1-2dof-hexapods/the-complete-2-dof-hexapod-tutorial/WebHome/comp.jpg">
70 <span>Figure 1.</span>
71 </div>
72 </div>
73 </div>
74
75 <!-- Step 2 -->
76 <div class="asm-step">
77 <div class="asm-step-header">
78 <div class="asm-step-name">2DOF Hexapod Tutorial — Install &amp; Test LynxTerm</div>
79 <div class="asm-step-num">Step 2 / 10</div>
80 </div>
81 <div class="asm-step-body">
82 <div class="asm-step-text">
83 <p>Install and run <a href="https://wiki.lynxmotion.com/info/wiki/lynxmotion/view/ses-software/lynxterm/" target="_blank">LynxTerm</a> on your PC. Plug in the 9VDC battery and notice the green LED light up on the SSC-32. Choose the COM port from the drop down menu in the upper left corner.</p>
84 <p>Click in the black box, type "ver" and press Enter. If everything is working correctly, you should receive a response such as "SSC32-2.03XE".</p>
85 <p>Note: the LED on the SSC-32 is a status indicator, not a power indicator. It lights up on power up, turns off after receiving a serial command, then blinks when it receives data. The LED on the Bot Board II is a simple power indicator.</p>
86 </div>
87 <div class="asm-step-figure">
88 <a href="https://wiki.lynxmotion.com/info/wiki/lynxmotion/download/servo-erector-set-robots-kits/ses-v1-robots/ses-v1-2dof-hexapods/the-complete-2-dof-hexapod-tutorial/WebHome/lterm01.jpg" target="_blank">
89 <img src="https://wiki.lynxmotion.com/info/wiki/lynxmotion/download/servo-erector-set-robots-kits/ses-v1-robots/ses-v1-2dof-hexapods/the-complete-2-dof-hexapod-tutorial/WebHome/lterm01s.jpg">
90 </a>
91 <span>Figure 2. (click to enlarge)</span>
92 </div>
93 </div>
94 </div>
95
96 <!-- Step 3 -->
97 <div class="asm-step">
98 <div class="asm-step-header">
99 <div class="asm-step-name">2DOF Hexapod Tutorial — Aligning the Servos</div>
100 <div class="asm-step-num">Step 3 / 10</div>
101 </div>
102 <div class="asm-step-body">
103 <div class="asm-step-text">
104 <p>Place the robot on top of a CD spindle or similar object to support the body and lift the legs off the ground. Make sure the 6V battery is connected to the wiring harness and flip the power switch to ON.</p>
105 <p>Click the "All=1500" button at the bottom of the program and the legs should move to a centered position. If the robot was constructed properly, the legs will be horizontal and perpendicular to the body. If the legs are more than 15° off, remove the output horn, rotate it, and reinstall it. The next step is to align the servos in software.</p>
106 </div>
107 <div class="asm-step-figure">
108 <img src="https://wiki.lynxmotion.com/info/wiki/lynxmotion/download/servo-erector-set-robots-kits/ses-v1-robots/ses-v1-2dof-hexapods/the-complete-2-dof-hexapod-tutorial/WebHome/2dofh11.jpg">
109 <span>Figure 3.</span>
110 </div>
111 </div>
112 </div>
113
114 <!-- Step 4 -->
115 <div class="asm-step">
116 <div class="asm-step-header">
117 <div class="asm-step-name">2DOF Hexapod Tutorial — Fine-Tuning Servo Alignment</div>
118 <div class="asm-step-num">Step 4 / 10</div>
119 </div>
120 <div class="asm-step-body">
121 <div class="asm-step-text">
122 <p>Click on the H2 Sequencer button in the lower left corner. Use the Offset tool under Servo Quick Test. Click "Read" to load any previous offset settings. Select each servo on the Hexapod diagram and adjust the offset slider to fine-tune the leg alignment. Do this for all twelve servos. When completed, click "Write" to save your offsets to the SSC-32 EEPROM.</p>
123 <p>Refer to Figures 4-2 and 4-3 for how each servo should be aligned.</p>
124 </div>
125 <div class="asm-step-figure">
126 <a href="https://wiki.lynxmotion.com/info/wiki/lynxmotion/download/servo-erector-set-robots-kits/ses-v1-robots/ses-v1-2dof-hexapods/the-complete-2-dof-hexapod-tutorial/WebHome/lterm02.jpg" target="_blank">
127 <img src="https://wiki.lynxmotion.com/info/wiki/lynxmotion/download/servo-erector-set-robots-kits/ses-v1-robots/ses-v1-2dof-hexapods/the-complete-2-dof-hexapod-tutorial/WebHome/lterm02s.jpg">
128 </a>
129 <span>Figure 4-1. (click to enlarge)</span>
130 </div>
131 </div>
132 <div style="display: flex; flex-wrap: wrap; gap: 0.75rem; padding: 0 1rem 1rem 1rem;">
133 <div class="asm-step-figure" style="flex: 1 1 200px;">
134 <img src="https://wiki.lynxmotion.com/info/wiki/lynxmotion/download/servo-erector-set-robots-kits/ses-v1-robots/ses-v1-2dof-hexapods/the-complete-2-dof-hexapod-tutorial/WebHome/align01.jpg">
135 <span>Figure 4-2.</span>
136 </div>
137 <div class="asm-step-figure" style="flex: 1 1 200px;">
138 <img src="https://wiki.lynxmotion.com/info/wiki/lynxmotion/download/servo-erector-set-robots-kits/ses-v1-robots/ses-v1-2dof-hexapods/the-complete-2-dof-hexapod-tutorial/WebHome/align02.jpg">
139 <span>Figure 4-3.</span>
140 </div>
141 </div>
142 <!-- Schematics -->
143 <div class="asm-fullwidth">
144 <p><b>Schematic.</b> Double check your connections. Red wires to positive (+), black wires to negative (−). Note: your PS2 cable may not match Schematic 1 — refer to Schematic 2 for accurate connection information.</p>
145 <img src="https://wiki.lynxmotion.com/info/wiki/lynxmotion/download/servo-erector-set-robots-kits/ses-v1-robots/ses-v1-2dof-hexapods/the-complete-2-dof-hexapod-tutorial/WebHome/2dofsch2.gif">
146 <p style="text-align:center; font-size:12px; color:#666;">Schematic 1.</p>
147 <img src="https://wiki.lynxmotion.com/info/wiki/lynxmotion/download/servo-erector-set-robots-kits/ses-v1-robots/ses-v1-2dof-hexapods/the-complete-2-dof-hexapod-tutorial/WebHome/wire08s.gif">
148 <p style="text-align:center; font-size:12px; color:#666;">Schematic 2.</p>
149 </div>
150 </div>
151
152 <!-- Step 5 -->
153 <div class="asm-step">
154 <div class="asm-step-header">
155 <div class="asm-step-name">2DOF Hexapod Tutorial — Programming the Microcontroller</div>
156 <div class="asm-step-num">Step 5 / 10</div>
157 </div>
158 <div class="asm-step-body">
159 <div class="asm-step-text">
160 <p>Install and run the BASIC Micro Studio to allow programming the chip. Refer to <a href="https://wiki.lynxmotion.com/info/wiki/lynxmotion/view/support/basic-atom-pro-programming/" target="_blank">this tutorial</a> for assistance using the BASIC Micro Studio program.</p>
161 <table class="ref-table" style="margin-top: 0.75rem;">
162 <tr><td colspan="2">Available Programs</td></tr>
163 <tr><td><a href="https://wiki.lynxmotion.com/info/wiki/lynxmotion/download/servo-erector-set-robots-kits/ses-v1-robots/ses-v1-2dof-hexapods/the-complete-2-dof-hexapod-tutorial/WebHome/h2prog01.zip" target="_blank">h2prog01.zip</a></td><td>Default program</td></tr>
164 <tr><td><a href="https://wiki.lynxmotion.com/info/wiki/lynxmotion/download/servo-erector-set-robots-kits/ses-v1-robots/ses-v1-2dof-hexapods/the-complete-2-dof-hexapod-tutorial/WebHome/h2prog02.zip" target="_blank">h2prog02.zip</a></td><td>Tank mode and single joystick mode</td></tr>
165 <tr><td><a href="https://wiki.lynxmotion.com/info/wiki/lynxmotion/download/servo-erector-set-robots-kits/ses-v1-robots/ses-v1-2dof-hexapods/the-complete-2-dof-hexapod-tutorial/WebHome/h2prog03.zip" target="_blank">h2prog03.zip</a></td><td>Single joystick mode and pan-and-tilt on left joystick</td></tr>
166 </table>
167 </div>
168 <div class="asm-step-figure">
169 <img src="https://wiki.lynxmotion.com/info/wiki/lynxmotion/download/servo-erector-set-robots-kits/ses-v1-robots/ses-v1-2dof-hexapods/the-complete-2-dof-hexapod-tutorial/WebHome/2dofprod.jpg">
170 <span>Figure 5.</span>
171 </div>
172 </div>
173 </div>
174
175 <!-- Step 6 -->
176 <div class="asm-step">
177 <div class="asm-step-header">
178 <div class="asm-step-name">2DOF Hexapod Tutorial — PS2 Control</div>
179 <div class="asm-step-num">Step 6 / 10</div>
180 </div>
181 <div class="asm-step-body">
182 <div class="asm-step-text">
183 <p>Control the direction of walking with the right joystick. Left and Right on the D-Pad adjusts speed in 5% increments (up to 200%). The joystick positions will allow a max of 100% XS speed initially.</p>
184 <p>Both modes offer additional control of leg trajectory. Pressing △, O (default), X, or □ changes how the foot is lifted during the walking gait.</p>
185 <p>If the robot is driven toward an obstacle, the forward joystick position is ignored after a threshold is reached, but you can still reverse direction. The controller will also vibrate proportionally to obstacle distance. The Sharp sensor can be enabled/disabled with the Start button.</p>
186 </div>
187 <div class="asm-step-figure">
188 <img src="https://wiki.lynxmotion.com/info/wiki/lynxmotion/download/servo-erector-set-robots-kits/ses-v1-robots/ses-v1-2dof-hexapods/the-complete-2-dof-hexapod-tutorial/WebHome/legtraj.jpg">
189 <span>Figure 6.</span>
190 </div>
191 </div>
192 <div class="asm-fullwidth">
193 <p><b>PS2 Controls — Right-Joystick Mode (h2prog01.zip)</b></p>
194 <table class="ref-table">
195 <tr><td>L Joy U</td><td>Tilt Servo up</td><td>R Joy U</td><td>Forward</td></tr>
196 <tr><td>L Joy D</td><td>Tilt Servo down</td><td>R Joy D</td><td>Backward</td></tr>
197 <tr><td>L Joy L</td><td>Pan Servo left</td><td>R Joy L</td><td>Left</td></tr>
198 <tr><td>L Joy R</td><td>Pan Servo right</td><td>R Joy R</td><td>Right</td></tr>
199 <tr><td>△</td><td>See Figure 8</td><td>□</td><td>See Figure 8</td></tr>
200 <tr><td>X</td><td>See Figure 8</td><td>O</td><td>See Figure 8</td></tr>
201 <tr><td>D-Pad L</td><td>Speed Limit Down</td><td>D-Pad R</td><td>Speed Limit Up</td></tr>
202 <tr><td>Start</td><td>Disable/Enable Crash Monitor</td><td></td><td></td></tr>
203 </table>
204 <p style="margin-top: 1rem;"><b>PS2 Controls — Right Joystick Mode (h2prog03.zip)</b></p>
205 <table class="ref-table">
206 <tr><td>L Joy U</td><td>Tilt Servo up</td><td>R Joy U</td><td>Forward</td></tr>
207 <tr><td>L Joy D</td><td>Tilt Servo down</td><td>R Joy D</td><td>Backward</td></tr>
208 <tr><td>L Joy L</td><td>Pan Servo left</td><td>R Joy L</td><td>Left</td></tr>
209 <tr><td>L Joy R</td><td>Pan Servo right</td><td>R Joy R</td><td>Right</td></tr>
210 <tr><td>All other commands</td><td colspan="3">See Tank Mode table below</td></tr>
211 </table>
212 <p style="margin-top: 1rem;"><b>PS2 Controls — Tank Mode or Right Joystick Mode (h2prog02.zip)</b></p>
213 <table class="ref-table">
214 <tr><td>L Joy U</td><td>Left Side Forward (N/A)</td><td>R Joy U</td><td>Right Side Forward (Forward)</td></tr>
215 <tr><td>L Joy D</td><td>Left Side Backward (N/A)</td><td>R Joy D</td><td>Right Side Backward (Backward)</td></tr>
216 <tr><td>L Joy L/R</td><td>N/A</td><td>R Joy L/R</td><td>N/A (Left/Right)</td></tr>
217 <tr><td>L1</td><td>Raise body height</td><td>R1</td><td>Increase leg lift</td></tr>
218 <tr><td>L2</td><td>Lower body height</td><td>R2</td><td>Decrease leg lift</td></tr>
219 <tr><td>L3</td><td>N/A</td><td>R3</td><td>Switch control mode</td></tr>
220 <tr><td>D-Pad U</td><td>Raise body height</td><td>△</td><td>See Figure 8</td></tr>
221 <tr><td>D-Pad D</td><td>Lower body height</td><td>X</td><td>See Figure 8</td></tr>
222 <tr><td>D-Pad L</td><td>Speed Limit Down</td><td>□</td><td>See Figure 8</td></tr>
223 <tr><td>D-Pad R</td><td>Speed Limit Up</td><td>O</td><td>See Figure 8</td></tr>
224 <tr><td>Start</td><td>Disable/Enable Crash Monitor</td><td>Select</td><td>N/A</td></tr>
225 </table>
226 </div>
227 </div>
228
229 <!-- Step 7 -->
230 <div class="asm-step">
231 <div class="asm-step-header">
232 <div class="asm-step-name">2DOF Hexapod Tutorial — Autonomous Control</div>
233 <div class="asm-step-num">Step 7 / 10</div>
234 </div>
235 <div class="asm-step-body">
236 <div class="asm-step-text">
237 <p>The autonomous program requires three Sharp GP2D12 sensors connected as follows:</p>
238 <ul>
239 <li>A to D channel 0: front left side, facing right</li>
240 <li>A to D channel 1: front right side, facing left</li>
241 <li>A to D channel 2: rear, facing behind the robot</li>
242 </ul>
243 <p>The exact angle of the sensors isn't critical, but will affect the robot's behavior. Experimentation is encouraged.</p>
244 <table class="ref-table" style="margin-top: 0.75rem;">
245 <tr><td colspan="2">Autonomous Program</td></tr>
246 <tr><td><a href="https://wiki.lynxmotion.com/info/wiki/lynxmotion/download/servo-erector-set-robots-kits/ses-v1-robots/ses-v1-2dof-hexapods/the-complete-2-dof-hexapod-tutorial/WebHome/h2prog04.zip" target="_blank">h2prog04.zip</a></td><td>Autonomous using two Sharp GP2D12 sensors and one on the rear</td></tr>
247 </table>
248 </div>
249 <div class="asm-step-figure">
250 <img src="https://wiki.lynxmotion.com/info/wiki/lynxmotion/download/servo-erector-set-robots-kits/ses-v1-robots/ses-v1-2dof-hexapods/the-complete-2-dof-hexapod-tutorial/WebHome/sensors.jpg">
251 <span>Figure 7.</span>
252 </div>
253 </div>
254 </div>
255
256 <!-- Step 8 -->
257 <div class="asm-step">
258 <div class="asm-step-header">
259 <div class="asm-step-name">2DOF Hexapod Tutorial — Hexapod Sequencer</div>
260 <div class="asm-step-num">Step 8 / 10</div>
261 </div>
262 <div class="asm-step-body">
263 <div class="asm-step-text">
264 <p>The Hexapod Sequencer can be used to test the hexapod without a microcontroller. Connect the SSC-32 to the serial port as if aligning the servos, then follow along.</p>
265 <p>The L* and R* textboxes control the positions the legs move to in the sequence. Fine-tune these values using the Servo Quick Test position slider.</p>
266 <table class="ref-table" style="margin-top: 0.75rem;">
267 <tr><td colspan="4">Tripod Leg Movement Sequence</td></tr>
268 <tr><td>LF</td><td>Left Front Horiz</td><td>RF</td><td>Right Front Horiz</td></tr>
269 <tr><td>LH</td><td>Left High Vertical</td><td>RH</td><td>Right High Vertical</td></tr>
270 <tr><td>LM</td><td>Left Middle Vertical</td><td>RM</td><td>Right Mid Vertical</td></tr>
271 <tr><td>LL</td><td>Left Low Vertical</td><td>RL</td><td>Right Low Vertical</td></tr>
272 <tr><td>LR</td><td>Left Rear Horiz</td><td>RR</td><td>Right Rear Horiz</td></tr>
273 </table>
274 </div>
275 <div class="asm-step-figure">
276 <a href="https://wiki.lynxmotion.com/info/wiki/lynxmotion/download/servo-erector-set-robots-kits/ses-v1-robots/ses-v1-2dof-hexapods/the-complete-2-dof-hexapod-tutorial/WebHome/lterm03.jpg" target="_blank">
277 <img src="https://wiki.lynxmotion.com/info/wiki/lynxmotion/download/servo-erector-set-robots-kits/ses-v1-robots/ses-v1-2dof-hexapods/the-complete-2-dof-hexapod-tutorial/WebHome/lterm03s.jpg">
278 </a>
279 <span>Figure 8. (click to enlarge)</span>
280 </div>
281 </div>
282 </div>
283
284 <!-- Step 9 -->
285 <div class="asm-step">
286 <div class="asm-step-header">
287 <div class="asm-step-name">2DOF Hexapod Tutorial — Walking the Robot</div>
288 <div class="asm-step-num">Step 9 / 10</div>
289 </div>
290 <div class="asm-step-body">
291 <div class="asm-step-text">
292 <p>Adjust the XL and XR sliders to 100%. Note that HT=1500uS (1.5 seconds). Set the XS slider to ~50% and notice the stride takes 3 seconds. Adjust HT to 1000 and the stride now takes 2 seconds.</p>
293 <p>You have complete control over all aspects of the tripod gait. Adjust either XL or XR lower to do gradual turns. Setting XL and XR to opposite directions causes the robot to turn in place. Reverse values cause the robot to walk backwards.</p>
294 <p>Moving a slider is the same as sending the command from a microcontroller — for example, moving XS to 50% is the same as sending "XS50". The robot will continue to walk until it receives XS = 0.</p>
295 </div>
296 <div class="asm-step-figure">
297 <a href="https://wiki.lynxmotion.com/info/wiki/lynxmotion/download/servo-erector-set-robots-kits/ses-v1-robots/ses-v1-2dof-hexapods/the-complete-2-dof-hexapod-tutorial/WebHome/lterm04.jpg" target="_blank">
298 <img src="https://wiki.lynxmotion.com/info/wiki/lynxmotion/download/servo-erector-set-robots-kits/ses-v1-robots/ses-v1-2dof-hexapods/the-complete-2-dof-hexapod-tutorial/WebHome/lterm04s.jpg">
299 </a>
300 <span>Figure 9. (click to enlarge)</span>
301 </div>
302 </div>
303 </div>
304
305 <!-- Step 10 -->
306 <div class="asm-step">
307 <div class="asm-step-header">
308 <div class="asm-step-name">2DOF Hexapod Tutorial — Sample Walking Code</div>
309 <div class="asm-step-num">Step 10 / 10</div>
310 </div>
311 <div class="asm-step-body">
312 <div class="asm-step-text">
313 <p>The following program will set up and initiate walking on the robot. To change speed and direction, just alter the XL, XR, XS values. The robot will immediately begin walking in the speed and direction commanded.</p>
314 <div class="code-block">XL var sbyte
315 XR var sbyte
316 XS var byte
317
318 XL = 100
319 XR = 100
320 XS = 100
321
322 start:
323 serout p15,i38400,["LF1700 RF1300 LR1300",13]
324 serout p15,i38400,["RR1700 LH1000 LM1700",13]
325 serout p15,i38400,["LL1800 RH2000 RM1300",13]
326 serout p15,i38400,["RL1200 VS3000 HT1500",13]
327 serout p15,i38400,["XL",SDEC XL,"XR",SDEC XR,13]
328 serout p15,i38400,["XS",DEC XS,13]
329 loop:
330 goto loop</div>
331 </div>
332 </div>
333 </div>
334
335 </div>
336 {{/html}}
Copyright RobotShop 2018