Is the barrel plug connected correctly?
If you have not already done so, make sure your batteries are freshly charged. Follow the instructions provided on the charger case.
If the BOE’s power light did not come on:
Are the P13 and P12 correctly connected to Ch1 and Ch2?
Let’s make sure to clear the program in the BASIC Stamp 2 before turning motor power on. That way, some Boe-Bot program that used to be in there won’t send your Arlo into unexpected maneuvers.
' Arlo - No Surprise Maneuvers.bs2 ' Run this before ever turning on power to the Arlo's motors to prevent any ' unexpected motions. ' {$STAMP BS2} ' {$PBASIC 2.5} FREQOUT 4, 2000, 3000 ' Beep -> program starting DEBUG "Your Arlo will stay still." ' Success message END ' End program
This next program asks the DHB-10 for its hardware and firmware versions, and displays the results in your Debug Terminal. Here is what you’ll see if your BS2 communicates successfully with the DHB-10 (left) alongside one of the messages you might see if communication fails (right).
' Arlo - Test BOE and DHB-10 Communication.bs2 ' Run this program to verify that your BOE and DHB-10 are communicating. ' Should display: ' Hardware ' HWVER = 1 ' Firmware ' VER = 10 ' If it instead displays: ' "ERROR, no reply from DHB..." ' It means there is a wiring problem. ' {$STAMP BS2} ' {$PBASIC 2.5} val VAR Word n VAR Byte ' Stores index of serial exchange FREQOUT 4, 2000, 3000 ' Beep -> program starting DEBUG "Program running...", CR, CR ' Display program running n = 1 ' First exchange DEBUG "PACE 1", CR ' Set serial pace for BS2 SEROUT 13, 32800, ["PACE 1", CR] ' Set serial pace for BS2 SERIN 13, 32800, 50, ERR, [WAIT(CR)] ' Get DHB-10's confirmation n = 2 ' Second exchange DEBUG "STORE PACE", CR, CR ' Display storing serial pace SEROUT 13, 32800, ["STORE PACE", CR] ' Remember serial pace settings SERIN 13, 32800, 50, ERR, [WAIT(CR)] ' Get DHB-10's confirmation n = 3 ' Third exchange DEBUG "Hardware", CR ' Display hardware heading SEROUT 13, 32800, ["HWVER", CR] ' Request hardware version SERIN 13, 32800, 50, ERR, [DEC val] ' Get DHB-10's reply DEBUG "HWVER = ", DEC val, CR, CR ' Display version n = 4 ' Fourth exchange DEBUG "Firmware", CR ' Display firmware heading SEROUT 13, 32800, ["VER", CR] ' Request firmware version SERIN 13, 32800, 50, ERR, [DEC val] ' Get DHB-10's reply DEBUG "VER = ", DEC val, CR ' Display version END ' End program ERR: ' Error routine DEBUG "ERROR, no reply from DHB-10.", CR ' Error message DEBUG "n = ", DEC n ' Index of exchange that failed END ' End program
This next program sets the Arlo’s motors to 20/127 of full power in the forward direction. If your Arlo goes forward while running this program, it indicates that your motors are connected correctly and the battery is charged.
IMPORTANT: Your Arlo will not be ready for the next step until it goes forward for this test.
' Arlo - Test Motor Connections.bs2 ' Run this program to verify that your Arlo goes forward. ' {$STAMP BS2} ' {$PBASIC 2.5} s VAR Byte(19) ' Stores DHB-10 replies n VAR Byte ' Stores index of serial exchange FREQOUT 4, 2000, 3000 ' Beep -> program starting DEBUG "Program running...", CR, CR ' Display program running n = 1 ' First exchange DEBUG "GO 20 20", CR ' Display message to DHB-10 SEROUT 13, 32800, ["GO 20 20", CR] ' Motors forward 20/127 of full power SERIN 13, 32800, 50, ERR, [WAIT(CR)] ' Wait for DHB-10 confirmation PAUSE 3000 ' Let motors run 3 seconds n = 2 ' Second exchange DEBUG "GO 0 0", CR ' Display message to DHB-10 SEROUT 13, 32800, ["GO 0 0", CR] ' Set both motors to 0 power SERIN 13, 32800, 50, ERR, [WAIT(CR)] ' Wait for DHB-10 confirmation END ' End program ERR: ' Error routine DEBUG "ERROR, no reply from DHB-10.", CR ' Error message DEBUG "n = ", DEC n ' Index of exchange that failed STOP ' End program
The Arlo has built-in encoders that can count how far the Arlo travels in terms of 144ths of a wheel revolution. Although it’s not needed to run Boe-Bot code, it’s best to make sure they are functioning correctly in case you want to improve the accuracy of the Arlo’s maneuvers later. The next program will display the status of your encoder connections in the Debug Terminal. If there is a problem, it may indicate that the encoder cables have been swapped or that there is some other wiring problem. Here are examples of what you might see:
' Arlo - Test Encoder Connections.bs2 ' Run this program to verify that the Arlo's encoders have been connected. ' to the DHB-10 board correctly. ' {$STAMP BS2} ' {$PBASIC 2.5} left VAR Word right VAR Word n VAR Byte ' Stores index of serial exchange FREQOUT 4, 2000, 3000 ' Beep -> program starting DEBUG "Program running...", CR, CR ' Display program running ' Pace setting not required if Test BOE and DHB-10 Communication.bs2 has ' already been run (successfully). n = 1 ' First exchange DEBUG "PACE 1", CR ' Set serial pace for BS2 SEROUT 13, 32800, ["PACE 1", CR] ' Set serial pace for BS2 SERIN 13, 32800, 50, ERR, [WAIT(CR)] ' Get DHB-10's confirmation n = 2 ' Second exchange DEBUG "RST", CR SEROUT 13, 32800, ["RST", CR] ' Send reset encoders message SERIN 13, 32800, 50, ERR, [WAIT(CR)] ' Wait for DHB-10's confirmation n = 3 ' Third exchange DEBUG "GO 32 32", CR SEROUT 13, 32800, ["GO 32 32", CR] ' Send reset encoders message SERIN 13, 32800, 50, ERR, [WAIT(CR)] ' Wait for DHB-10's confirmation DEBUG "...for 4 s", CR PAUSE 4000 ' ...for 4 seconds n = 4 ' Fourth exchange DEBUG "GO 0 0", CR SEROUT 13, 32800, ["GO 0 0", CR] ' Send reset encoders message SERIN 13, 32800, 50, ERR, [WAIT(CR)] ' Wait for DHB-10's confirmation n = 5 ' Fifth exchange DEBUG "DIST", CR SEROUT 13, 32800, ["DIST", CR] ' Request distance SERIN 13, 32800, 50, ERR, ' Get left & right distances [SDEC left, SDEC right] DEBUG "left = ", SDEC left, ' Display left & right distances ", right = ", SDEC right, CR n = 6 ' Sixth exchange DEBUG "PULSE", CR SEROUT 13, 32800, ["PULSE", CR] ' Change modes, serial to pulse SERIN 13, 32800, 50, ERR, [WAIT(CR)] ' Wait for confirmation DEBUG CR ' Add a carriage return ' If all distances in range, then display success. IF left > 175 AND left < 325 AND right > 175 AND right < 325 THEN DEBUG "Encoder connections are ", CR DEBUG "correct! Your Arlo is ready ", CR DEBUG "for the next step.", CR, CR ELSE ' If not, find errors IF left > 175 AND left < 325 THEN ' If left good, say so DEBUG "Motor 1 encoder cables ", CR DEBUG "are connected correctly.", CR, CR ELSEIF left > -325 AND left < -125 THEN ' Negative? Cables reversed DEBUG "ERROR: Motor 1 encoder ", CR DEBUG "connections are reversed!", CR, CR ELSE ' Else, unknown error DEBUG "ERROR: Motor 1 encoder ", CR DEBUG "values out of range. Recheck ", CR DEBUG "encoder connections and ", CR DEBUG "assemblies.", CR ENDIF IF right > 175 AND right < 325 THEN ' Repeat for right encoders DEBUG "Motor 2 encoder cables ", CR DEBUG "are connected correctly.", CR, CR ELSEIF right > -325 AND right < -125 THEN DEBUG "ERROR: Motor 2 encoder ", CR DEBUG "connections are reversed!", CR, CR ELSE DEBUG "ERROR: Motor 2 encoder.", CR DEBUG "values out of range. Recheck ", CR DEBUG "encoder connections and ", CR DEBUG "assemblies", CR ENDIF ENDIF END ERR: ' Error routine DEBUG "ERROR, no reply from DHB-10.", CR ' Error message DEBUG "n = ", DEC n ' Index of exchange that failed STOP ' End program
Links
[1] http://learn.parallax.com/tutorials/robot/arlo/arlo-basic-stamp-boe-bot-brain/troubleshooting-your-arlo-boe