A4WD1 Tutorial for Autonomous Behavior

A4WD1 Tutorial for Autonomous Behavior v1.0
Updated 11/29/2010

Safety first! Wear eye protection and never touch a powered robot!

Note: Do not use Loctite or thread locks on the assembly. They are not necessary and may cause damage to the Lexan.

Note: This guide follows the assembly guide. The Roboclaw has already been installed.

Software:

Image of A4WD1.

[hr][/hr]

Step 1. Mounting the Bot Board II
Add the four standoffs for the Bot Board II or ARC-32 to the robot’s top panel as shown. Use four .250" hex socket head screws.

** 4 x**

** 4 x **

Figure 1.

[hr][/hr]

Step 2.
Install the Bot Board or ARC-32 as shown, using four of the .250" 4-40 screws. Install the Atom Pro chip on the Bot Board as shown.

** 4 x**

Atom Pro Orientation

Figure 2.

[hr][/hr]

Step 3.
Refer to the schematic (Figure 4) for wiring connections. Double check your wiring. Make sure the red battery wire goes to the (+) terminal!

Schematic - Figure 3.

Schematic - Figure 3.

[hr][/hr]

Step 4.
Set the Roboclaw switches to the settings shown in Figure 4.

Figure 4.

[hr][/hr]

Step 5. Programming the AtomPro
Download the BasicMicro Studio development software. Install and run the program on your PC. The goal here is to load a program into the editor and program the Atom Pro with the code. For the Bot Board you can use the serial port (D shaped connector with 9 pins sticking out) or a USB-to-serial cable. If you go the USB-to-serial cable route buy a good quality name brand unit. When you have a feel for the program you can load and program your Basic Atom with the BASIC programs listed below.

Figure 5.

[hr][/hr]

Step 6.
Now it’s time to set up the A4WD1 for autonomous behavior.
The code supports three Sharp GP2D12 sensors; two in the front and one in the back.

Note: Connect the appropriate Power Bus jumpers to 5v/Vcc

Table 6
[table=1,320,#000000][tr][td=100,#808080,#C0C0C0,center,2,1]Bot Board/ARC-32 Jumpers & Connections[/td][/tr][tr][td=25,#808080,#FFFFFF,center,1,1]Roboclaw S1[/td][td=75,#808080,#FFFFFF,center,1,1]Bot Board P0/ARC32 0[/td][/tr][tr][td=25,#808080,#FFFFFF,center,1,1]Roboclaw S2(optional)[/td][td=75,#808080,#FFFFFF,center,1,1]Bot Board P1/ARC32 1[/td][/tr][tr][td=25,#808080,#FFFFFF,center,1,1]Left Sensor[/td][td=75,#808080,#FFFFFF,center,1,1]Bot Board AX0/ARC32 8[/td][/tr][tr][td=25,#808080,#FFFFFF,center,1,1]Right Sensor[/td][td=75,#808080,#FFFFFF,center,1,1]Bot Board AX1/ARC32 9[/td][/tr][tr][td=25,#808080,#FFFFFF,center,1,1]Rear Sensor[/td][td=75,#808080,#FFFFFF,center,1,1]Bot Board AX2/ARC32 10[/td][/tr][/table]

[hr][/hr]

Step 7.
Attach two GP2D12 sensors to the chassis as shown, using either double-sided foam tape or optional multi-purpose sensor housing brackets. The exact angle isn’t critical, but will affect the robot’s behavior. Experimentation is encouraged.
Make sure you place the robot’s right sensor on the robot’s right side, facing left! Place the robot’s left sensor on the robot’s left side, facing right! This overlap ensures there isn’t a blind spot in the center. If you switch the positions of the sensors accidentally, the robot will turn into objects, instead of away.

Attach the other GP2D12 sensor at the rear of the robot as shown. Use double-sided foam tape to hold it in place.

Figure 7-1.

Schematic - Figure 7-2.

Schematic - Figure 7-2.

[hr][/hr]

Step 8.
Download this file (4wd1_roboclaw_auto.bas) and program the Atom Pro. You will want to set the bot on something so that the wheels aren’t touching the ground.
This program allows the robot to roam around the room without bumping into things. It uses three Sharp GP2D12 analog distance sensors to “see” things in its environment. Feel free to experiment with the variables and math in the main section of the program. The robot does a very good job navigating without getting stuck. The motor control is based on the GP2D12 sensors with a bias for forward motion. The robot will sometimes back up and turn even though there are no specific instructions to do so. Look for this and other emergent behaviors during your experimentation.

Figure 8.