Wiki source code of BRAT Biped Autonomous Water Bottle Attacking Tutorial
Last modified by Eric Nantel on 2026/04/06 13:03
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-figures { display: flex; flex-wrap: wrap; gap: 0.75rem; } |
| 14 | .asm-fullwidth { padding: 1rem; border-top: 1px solid #eee; font-size: 13px; overflow-x: auto; } |
| 15 | .ref-table { border-collapse: collapse; font-size: 12px; } |
| 16 | .ref-table th { background: #ccc; border: 1px solid #aaa; padding: 0.3rem 0.6rem; text-align: center; } |
| 17 | .ref-table td { border: 1px solid #ddd; padding: 0.3rem 0.6rem; text-align: center; } |
| 18 | .ref-table tr:nth-child(odd) td { background: #f9f9f9; } |
| 19 | .ref-table tr:nth-child(even) td { background: #fff; } |
| 20 | .asm-warning { color: #c00; font-weight: bold; } |
| 21 | .asm h1 { font-size: 18px; margin-bottom: 0.25rem; } |
| 22 | </style> |
| 23 | |
| 24 | <div class="asm"> |
| 25 | |
| 26 | <!-- Header --> |
| 27 | <div style="padding: 0.5rem 0 1rem 0; display:flex; flex-wrap:wrap; gap:1.5rem; align-items:flex-start;"> |
| 28 | <div style="flex:1 1 300px;"> |
| 29 | <h1 class="asm">Biped BRAT Autonomous Water Bottle Attacking Tutorial</h1> |
| 30 | <p><b>Updated March 27, 2012</b></p> |
| 31 | <p><span class="asm-warning">Safety first!</span> Wear eye protection and never touch a powered robot!</p> |
| 32 | <p><b>Hardware required:</b> Bot Board II, BASIC Atom Pro 28, Sharp GP2D12 sensor.</p> |
| 33 | <p><b>Software & downloads:</b></p> |
| 34 | <ul style="padding-left:1.2rem; margin-top:0.25rem; line-height:1.8;"> |
| 35 | <li>BASIC Micro Studio</li> |
| 36 | <li><a href="https://wiki.lynxmotion.com/info/wiki/lynxmotion/download/servo-erector-set-robots-kits/ses-v1-robots/ses-v1-bipeds/brat-biped-autonomous-water-bottle/WebHome/mechosf.zip">BRAT Mech Servo Offset Finder Program</a></li> |
| 37 | <li><a href="https://wiki.lynxmotion.com/info/wiki/lynxmotion/download/servo-erector-set-robots-kits/ses-v1-robots/ses-v1-bipeds/brat-biped-autonomous-water-bottle/WebHome/abrat5.zip">Autonomous Water Bottle Attack Code</a></li> |
| 38 | </ul> |
| 39 | </div> |
| 40 | <div style="text-align:center; flex:0 1 280px;"> |
| 41 | <img src="https://wiki.lynxmotion.com/info/wiki/lynxmotion/download/servo-erector-set-robots-kits/ses-v1-robots/ses-v1-bipeds/brat-biped-autonomous-water-bottle/WebHome/bratwb00.jpg" style="max-width:100%; border:1px solid #ccc; border-radius:4px;"> |
| 42 | <p style="font-size:12px; color:#666; margin-top:0.3rem;"><b>Biped BRAT.</b></p> |
| 43 | </div> |
| 44 | </div> |
| 45 | |
| 46 | <!-- Step 1 --> |
| 47 | <div class="asm-step"> |
| 48 | <div class="asm-step-header"> |
| 49 | <div class="asm-step-name">Water Bottle BRAT — Orient U-Channel</div> |
| 50 | <div class="asm-step-num">Step 1 / 12</div> |
| 51 | </div> |
| 52 | <div class="asm-step-body"> |
| 53 | <div class="asm-step-text"> |
| 54 | <p>Depending on how you've built your BRAT, you may need to change the orientation of the U-Channel to match Figure 1.</p> |
| 55 | </div> |
| 56 | <div class="asm-step-figure"> |
| 57 | <img src="https://wiki.lynxmotion.com/info/wiki/lynxmotion/download/servo-erector-set-robots-kits/ses-v1-robots/ses-v1-bipeds/brat-biped-autonomous-water-bottle/WebHome/bratwb01.jpg"> |
| 58 | <span>Figure 1.</span> |
| 59 | </div> |
| 60 | </div> |
| 61 | </div> |
| 62 | |
| 63 | <!-- Step 2 --> |
| 64 | <div class="asm-step"> |
| 65 | <div class="asm-step-header"> |
| 66 | <div class="asm-step-name">Water Bottle BRAT — Attach ASB-18 to Multi-Purpose Bracket</div> |
| 67 | <div class="asm-step-num">Step 2 / 12</div> |
| 68 | </div> |
| 69 | <div class="asm-step-body"> |
| 70 | <div class="asm-step-text"> |
| 71 | <p>Attach an ASB-18 to a multi-purpose bracket as shown using the included hardware.</p> |
| 72 | </div> |
| 73 | <div class="asm-step-figure"> |
| 74 | <img src="https://wiki.lynxmotion.com/info/wiki/lynxmotion/download/servo-erector-set-robots-kits/ses-v1-robots/ses-v1-bipeds/brat-biped-autonomous-water-bottle/WebHome/bratwb02.jpg"> |
| 75 | <span>Figure 2.</span> |
| 76 | </div> |
| 77 | </div> |
| 78 | </div> |
| 79 | |
| 80 | <!-- Step 3 --> |
| 81 | <div class="asm-step"> |
| 82 | <div class="asm-step-header"> |
| 83 | <div class="asm-step-name">Water Bottle BRAT — Attach Long "C" Bracket</div> |
| 84 | <div class="asm-step-num">Step 3 / 12</div> |
| 85 | </div> |
| 86 | <div class="asm-step-body"> |
| 87 | <div class="asm-step-text"> |
| 88 | <p>Attach a long "C" bracket to the multi-purpose bracket as shown. Refer to Figure 3-1 for ball bearing detail.</p> |
| 89 | <div style="margin-top:0.75rem;"> |
| 90 | <img src="https://wiki.lynxmotion.com/info/wiki/lynxmotion/download/servo-erector-set-robots-kits/ses-v1-robots/ses-v1-bipeds/brat-biped-autonomous-water-bottle/WebHome/ballb01.GIF" style="max-width:100%; border:1px solid #ccc; border-radius:4px;"> |
| 91 | <p style="font-size:12px; color:#666; margin-top:0.3rem;">Figure 3-1 — Ball bearing detail.</p> |
| 92 | </div> |
| 93 | </div> |
| 94 | <div class="asm-step-figure"> |
| 95 | <img src="https://wiki.lynxmotion.com/info/wiki/lynxmotion/download/servo-erector-set-robots-kits/ses-v1-robots/ses-v1-bipeds/brat-biped-autonomous-water-bottle/WebHome/bratwb03.jpg"> |
| 96 | <span>Figure 3-2.</span> |
| 97 | </div> |
| 98 | </div> |
| 99 | </div> |
| 100 | |
| 101 | <!-- Step 4 --> |
| 102 | <div class="asm-step"> |
| 103 | <div class="asm-step-header"> |
| 104 | <div class="asm-step-name">Water Bottle BRAT — Attach Pan Assembly & Electronics Carrier</div> |
| 105 | <div class="asm-step-num">Step 4 / 12</div> |
| 106 | </div> |
| 107 | <div class="asm-step-body"> |
| 108 | <div class="asm-step-text"> |
| 109 | <p>Attach the pan assembly and electronics carrier to the U-Channel as shown. Refer to Figure 4-1 for mounting detail.</p> |
| 110 | <div style="margin-top:0.75rem;"> |
| 111 | <img src="https://wiki.lynxmotion.com/info/wiki/lynxmotion/download/servo-erector-set-robots-kits/ses-v1-robots/ses-v1-bipeds/brat-biped-autonomous-water-bottle/WebHome/brat01.gif" style="max-width:100%; border:1px solid #ccc; border-radius:4px;"> |
| 112 | <p style="font-size:12px; color:#666; margin-top:0.3rem;">Figure 4-1 — Mounting diagram.</p> |
| 113 | </div> |
| 114 | </div> |
| 115 | <div class="asm-step-figure"> |
| 116 | <img src="https://wiki.lynxmotion.com/info/wiki/lynxmotion/download/servo-erector-set-robots-kits/ses-v1-robots/ses-v1-bipeds/brat-biped-autonomous-water-bottle/WebHome/bratwb04.jpg"> |
| 117 | <span>Figure 4-2.</span> |
| 118 | </div> |
| 119 | </div> |
| 120 | </div> |
| 121 | |
| 122 | <!-- Step 5 --> |
| 123 | <div class="asm-step"> |
| 124 | <div class="asm-step-header"> |
| 125 | <div class="asm-step-name">Water Bottle BRAT — Install Pan Servo</div> |
| 126 | <div class="asm-step-num">Step 5 / 12</div> |
| 127 | </div> |
| 128 | <div class="asm-step-body"> |
| 129 | <div class="asm-step-text"> |
| 130 | <p>Insert the pan servo into the assembly and secure with servo attachment hardware and two #2 tapping screws.</p> |
| 131 | </div> |
| 132 | <div class="asm-step-figure"> |
| 133 | <img src="https://wiki.lynxmotion.com/info/wiki/lynxmotion/download/servo-erector-set-robots-kits/ses-v1-robots/ses-v1-bipeds/brat-biped-autonomous-water-bottle/WebHome/bratwb05.jpg"> |
| 134 | <span>Figure 5.</span> |
| 135 | </div> |
| 136 | </div> |
| 137 | </div> |
| 138 | |
| 139 | <!-- Step 6 --> |
| 140 | <div class="asm-step"> |
| 141 | <div class="asm-step-header"> |
| 142 | <div class="asm-step-name">Water Bottle BRAT — Mount Bot Board II</div> |
| 143 | <div class="asm-step-num">Step 6 / 12</div> |
| 144 | </div> |
| 145 | <div class="asm-step-body"> |
| 146 | <div class="asm-step-text"> |
| 147 | <p>Attach the Bot Board II to the electronics carrier using four 1/4" hex socket cap screws.</p> |
| 148 | </div> |
| 149 | <div class="asm-step-figure"> |
| 150 | <img src="https://wiki.lynxmotion.com/info/wiki/lynxmotion/download/servo-erector-set-robots-kits/ses-v1-robots/ses-v1-bipeds/brat-biped-autonomous-water-bottle/WebHome/bratwb06.jpg"> |
| 151 | <span>Figure 6.</span> |
| 152 | </div> |
| 153 | </div> |
| 154 | </div> |
| 155 | |
| 156 | <!-- Step 7 --> |
| 157 | <div class="asm-step"> |
| 158 | <div class="asm-step-header"> |
| 159 | <div class="asm-step-name">Water Bottle BRAT — Mount GP2D12 Sensor</div> |
| 160 | <div class="asm-step-num">Step 7 / 12</div> |
| 161 | </div> |
| 162 | <div class="asm-step-body"> |
| 163 | <div class="asm-step-text"> |
| 164 | <p>Using double-sided tape, attach the GP2D12 sensor to the front of the pan long "C" bracket. <span class="asm-warning">Orient the sensor exactly as shown in Figure 7.</span></p> |
| 165 | </div> |
| 166 | <div class="asm-step-figure"> |
| 167 | <img src="https://wiki.lynxmotion.com/info/wiki/lynxmotion/download/servo-erector-set-robots-kits/ses-v1-robots/ses-v1-bipeds/brat-biped-autonomous-water-bottle/WebHome/bratwb07.jpg"> |
| 168 | <span>Figure 7.</span> |
| 169 | </div> |
| 170 | </div> |
| 171 | </div> |
| 172 | |
| 173 | <!-- Step 8 --> |
| 174 | <div class="asm-step"> |
| 175 | <div class="asm-step-header"> |
| 176 | <div class="asm-step-name">Water Bottle BRAT — Connect Servos & Sensor</div> |
| 177 | <div class="asm-step-num">Step 8 / 12</div> |
| 178 | </div> |
| 179 | <div class="asm-step-body"> |
| 180 | <div class="asm-step-text"> |
| 181 | <p>Plug all servos and the sensor into the appropriate channels per Table 8. Note: P9 is used by the speaker and cannot be used for a servo.</p> |
| 182 | </div> |
| 183 | <div class="asm-step-figure" style="flex: 0 1 auto;"> |
| 184 | <table class="ref-table" style="width:auto;"> |
| 185 | <tr><th>Bot Board I/O</th><th>Connection</th></tr> |
| 186 | <tr><td>P4</td><td>Left Ankle</td></tr> |
| 187 | <tr><td>P5</td><td>Left Knee</td></tr> |
| 188 | <tr><td>P6</td><td>Left Hip</td></tr> |
| 189 | <tr><td>P7</td><td>Right Ankle</td></tr> |
| 190 | <tr><td>P8</td><td>Right Knee</td></tr> |
| 191 | <tr><td>P10</td><td>Right Hip</td></tr> |
| 192 | <tr><td>P11</td><td>Sensor Pan Servo</td></tr> |
| 193 | <tr><td>P19 (AX3)</td><td>GP2D12 Sensor</td></tr> |
| 194 | </table> |
| 195 | <span style="margin-top:0.4rem;">Table 8.</span> |
| 196 | </div> |
| 197 | </div> |
| 198 | </div> |
| 199 | |
| 200 | <!-- Step 9 --> |
| 201 | <div class="asm-step"> |
| 202 | <div class="asm-step-header"> |
| 203 | <div class="asm-step-name">Water Bottle BRAT — Configure Bot Board II Jumpers</div> |
| 204 | <div class="asm-step-num">Step 9 / 12</div> |
| 205 | </div> |
| 206 | <div class="asm-step-body"> |
| 207 | <div class="asm-step-text"> |
| 208 | <p>Set the Bot Board II jumpers per Table 9. The VS to AX0 jumper enables battery voltage monitoring — the robot can beep when the battery is low. Refer to Figure 9 for the jumper layout.</p> |
| 209 | </div> |
| 210 | <div class="asm-step-figure" style="flex: 0 1 auto;"> |
| 211 | <table class="ref-table" style="width:auto; margin-bottom:0.5rem;"> |
| 212 | <tr><th colspan="2">Bot Board II Jumper Settings (Table 9)</th></tr> |
| 213 | <tr><td>Enable</td><td>A, B, and C buttons</td></tr> |
| 214 | <tr><td>5V</td><td>I/O Group 0–3</td></tr> |
| 215 | <tr><td>VS</td><td>I/O Groups 4–7 and 8–11</td></tr> |
| 216 | <tr><td>Enable</td><td>SPKEN (Speaker Enable)</td></tr> |
| 217 | <tr><td>Enable</td><td>VS (Servo Voltage) to AX0 (P16)</td></tr> |
| 218 | </table> |
| 219 | <span>Table 9.</span> |
| 220 | </div> |
| 221 | </div> |
| 222 | <div class="asm-fullwidth"> |
| 223 | <p style="font-weight:bold; margin-bottom:0.4rem;">Figure 9 — Jumper diagram</p> |
| 224 | <img src="https://wiki.lynxmotion.com/info/wiki/lynxmotion/download/servo-erector-set-robots-kits/ses-v1-robots/ses-v1-bipeds/brat-biped-autonomous-water-bottle/WebHome/abrat2.gif" style="max-width:100%; border:1px solid #ccc; border-radius:4px;"> |
| 225 | </div> |
| 226 | </div> |
| 227 | |
| 228 | <!-- Step 10 --> |
| 229 | <div class="asm-step"> |
| 230 | <div class="asm-step-header"> |
| 231 | <div class="asm-step-name">Water Bottle BRAT — Find Servo Offsets</div> |
| 232 | <div class="asm-step-num">Step 10 / 12</div> |
| 233 | </div> |
| 234 | <div class="asm-step-body"> |
| 235 | <div class="asm-step-text"> |
| 236 | <p>Download and install BASIC Micro Studio. Download the <a href="https://wiki.lynxmotion.com/info/wiki/lynxmotion/download/servo-erector-set-robots-kits/ses-v1-robots/ses-v1-bipeds/brat-biped-autonomous-water-bottle/WebHome/mechosf.zip">BRAT Mech Servo Offset Finder Program</a>, load it into the IDE, and program the Atom Pro. Use the buttons to adjust offsets:</p> |
| 237 | <ul style="margin-top:0.5rem; padding-left:1.2rem;"> |
| 238 | <li><b>A</b> — decrease servo offset by 5µs</li> |
| 239 | <li><b>C</b> — increase servo offset by 5µs</li> |
| 240 | <li><b>B</b> — change which servo is being adjusted, and save offsets (order shown in Figure 10)</li> |
| 241 | </ul> |
| 242 | <p>If the Speaker is enabled, pressing B plays a tone that rises in pitch as you cycle through servos, and drops to a longer lower tone when returning to Start.</p> |
| 243 | </div> |
| 244 | <div class="asm-step-figure"> |
| 245 | <img src="https://wiki.lynxmotion.com/info/wiki/lynxmotion/download/servo-erector-set-robots-kits/ses-v1-robots/ses-v1-bipeds/brat-biped-autonomous-water-bottle/WebHome/mechosf1.jpg"> |
| 246 | <span>Figure 10 — Offset finder sequence.</span> |
| 247 | </div> |
| 248 | </div> |
| 249 | </div> |
| 250 | |
| 251 | <!-- Step 11 --> |
| 252 | <div class="asm-step"> |
| 253 | <div class="asm-step-header"> |
| 254 | <div class="asm-step-name">Water Bottle BRAT — Calibrate to Neutral Position</div> |
| 255 | <div class="asm-step-num">Step 11 / 12</div> |
| 256 | </div> |
| 257 | <div class="asm-step-body"> |
| 258 | <div class="asm-step-text"> |
| 259 | <p>Place the robot as close to neutral as possible and turn it on. It should hold the neutral position resembling Figures 11-1 through 11-3. If any joint is off by more than 15°, remove the servo horn, rotate to align, and reattach. Use the A, B, and C buttons to fine-tune.</p> |
| 260 | <p>Note: HS-422 hip servos may oscillate when the robot is lifted — this is normal and minimal when walking. Higher voltage worsens oscillations. Higher-power servos (HS-475, HS-485, HS-645) do not exhibit this.</p> |
| 261 | <p><span class="asm-warning">After adjusting all servos to match Figures 11-1 through 11-3, pressing B saves the offset values to the Atom Pro's EEPROM.</span></p> |
| 262 | </div> |
| 263 | <div class="asm-figures"> |
| 264 | <div class="asm-step-figure"> |
| 265 | <img src="https://wiki.lynxmotion.com/info/wiki/lynxmotion/download/servo-erector-set-robots-kits/ses-v1-robots/ses-v1-bipeds/brat-biped-autonomous-water-bottle/WebHome/brat10.jpg"> |
| 266 | <span>Figure 11-1 (front view).</span> |
| 267 | </div> |
| 268 | <div class="asm-step-figure"> |
| 269 | <img src="https://wiki.lynxmotion.com/info/wiki/lynxmotion/download/servo-erector-set-robots-kits/ses-v1-robots/ses-v1-bipeds/brat-biped-autonomous-water-bottle/WebHome/brat07.jpg"> |
| 270 | <span>Figure 11-2 (side view).</span> |
| 271 | </div> |
| 272 | <div class="asm-step-figure"> |
| 273 | <img src="https://wiki.lynxmotion.com/info/wiki/lynxmotion/download/servo-erector-set-robots-kits/ses-v1-robots/ses-v1-bipeds/brat-biped-autonomous-water-bottle/WebHome/brat04.jpg"> |
| 274 | <span>Figure 11-3 (rear view).</span> |
| 275 | </div> |
| 276 | </div> |
| 277 | </div> |
| 278 | </div> |
| 279 | |
| 280 | <!-- Step 12 --> |
| 281 | <div class="asm-step"> |
| 282 | <div class="asm-step-header"> |
| 283 | <div class="asm-step-name">Water Bottle BRAT — Load Attack Code</div> |
| 284 | <div class="asm-step-num">Step 12 / 12</div> |
| 285 | </div> |
| 286 | <div class="asm-step-body"> |
| 287 | <div class="asm-step-text"> |
| 288 | <p>Download the <a href="https://wiki.lynxmotion.com/info/wiki/lynxmotion/download/servo-erector-set-robots-kits/ses-v1-robots/ses-v1-bipeds/brat-biped-autonomous-water-bottle/WebHome/abrat5.zip">BRAT Autonomous Water Bottle Attack Code</a>, load it into the IDE, and program your BRAT.</p> |
| 289 | <p>On startup the robot beeps three times to confirm the download. The BRAT then scans for an object — if nothing is detected it turns in place and scans again, repeating until an object is found.</p> |
| 290 | <p>When an object is detected the BRAT walks toward it, adjusting direction as needed. Once in kicking range it beeps, aligns into kicking position, and kicks. After kicking it scans to confirm the object is down, then resumes scanning for a new target.</p> |
| 291 | </div> |
| 292 | </div> |
| 293 | </div> |
| 294 | |
| 295 | </div> |
| 296 | {{/html}} |

