A4WD1 Bot Board II & PS2 Control v1.0

Last modified by Eric Nantel on 2023/01/27 15:17

A4WD1 Tutorial for PS2 Control v1.0

Updated 12/20/2011

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 Sabertooth has already been installed.

Software:
  - Basic Micro Studio


Image of A4WD1.
 
 
Step 1. Mounting the Bot Board II
Add the four standoffs for the Bot Board II to the robot's top panel as shown. Use four .250" hex socket head screws.

 
4 x 4 x

Figure 1.
 
Step 2.
Install the Bot Board as shown, using four of the .250" 4-40 screws. Install the Atom Pro chip as shown.

 
4 x Atom Pro Orientation:

Figure 2.

Step 3. Connecting Sabertooth to Bot Board II
The Sabertooth 2x10 R/C was primarily designed to be connected to a remote control receiver. It has a BEC (battery elimination circuit) that puts 5vdc on the red wires to power the receiver. Because the Bot Board II has its own power supply, it is necessary to bypass the BEC.

Use an exacto knife to carefully pry the black tab up and slip the red wire out of the black housing as shown in Figure 3.

Bend the red wires up and use electrical tape to cover them as shown. This will prevent accidental shorts.


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

Bot Board Jumpers & Connections
Connect 6vdc battery to VS
Enable Speaker
Enable A, B, C Button
Connect VS to VL
Sabertooth Connections
Connect 12vdc battery
Ch1 Bot Board II P0
Ch2 Bot Board II P1

Table 4

 
Step 5.
Set the Sabertooth switches to the settings listed in Table 5 and Figure 5.
 

Sabertooth Settings
1 Enable Mixed Mode
2 Disable Exponential
3 Non-Lithium Mode
4 R/C Flip Mode
5 Disable Autocalibrate
6 Disable Timeout

Table 5


Figure 5.

Schematic - Figure 5.

Schematic - Figure 5.


Step 6. Programming the Atom Pro
Download the BASIC Micro 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. 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 Pro with the BASIC programs listed below.

Now it's time to have some fun!


Figure 6.
 
Step 7. Differential or Tank Mode Test (Optional)
Download this file (a4wd1tst2.zip) and run it. For this program, on the Bot Board II, the "A" button is left channel throttle, "C" button is right channel throttle, and "B" is a speed and direction reset.

This program requires the Sabertooth's Switch 1 to be flipped to the "Off" or "Independent Control" position.

Upon powering up the robot, you should hear four ascending notes. Pressing A once results in a beep and slow forward motion (10%) on the left channel only. Pressing nine more times results in 100% power. Continuing to press A will make the motor act as above, except only for the right channel. The C button will control the left motor in a similar manner. Pressing the B button will reset the speed and direction of both left and right.

Note: The Sabertooth's red Error LED will light to indicate overheating or current limit. The green Status1 LED will glow dimly when power is applied, and brightly when it's receiving pulses from the microcontroller. The green Status2 LED will flash out the detected number of lithium cells when lithium mode is enabled.

 
Step 8. Throttle and Steering Mode Test (Required)
Make sure the Sabertooth's Switch 1 is flipped back into the "On" or "Enable Mixed Mode" position!

Download this file (a4wd1tst1.zip) and run it. For this program, on the Bot Board II, the "B" button is throttle and the "A" and "C" buttons are steering.

Upon powering up the robot, you should hear four ascending notes.  Pressing B once results in a beep and slow forward motion (10%). Pressing nine more times results in 100% power. After the motor is at 100% power, pressing B will reduce the speed in 10% increments until it stops. Continue to press B to make the robot move as above, only in reverse.

Press Reset, then B twice. Now press C a few times to see the robot make a gradual left turn. Pressing A a few times will return to forward motion, and continuing to press A will result in gradual right turn.

Experiment with these buttons to understand how throttle and steering can be used to control the vehicle's motion.

Note: The Sabertooth's red Error LED will light to indicate overheating or current limit. The green Status1 LED will glow dimly when power is applied, and brightly when it's receiving pulses from the microcontroller. The green Status2 LED will flash out the detected number of lithium cells when lithium mode is enabled.
 


Step 9.
Now it's time to set up the A4WD1 for PS2 R/C control. The code supports a pan and tilt and gripper, but they are optional. The Pan and Tilt is installed on the front of the top panel, and the gripper is installed on the front of the base.

If you are adding a pan and tilt and gripper, you will need to change the power bus jumpers according to Table 9 and Schematic 10.

Note: Refer only to Figure 9 for connection information. The cable colors in the picture may be outdated. If your cable's colors do not match the diagram, you can find a complete listing of possible colors here.


Figure 9.

Bot Board Jumpers
Connect I/O 0-3 Power Bus to VS
Connect I/O 4-7 Power Bus to VS
Connect I/O 12-15 Power Bus to 5v

Table 9-1

Connections for Bot Board II
P0 Sabertooth Ch1 P8 N/A
P1 Sabertooth Ch2 P9 Speaker
P2 Pan servo P10 N/A
P3 Tilt servo P11 N/A
P4 Gripper up/down P12 PS2 Data
P5 Gripper rotate servo P13 PS2 Command
P6 Gripper open/close P14 PS2 Select
P7 N/A P15 PS2 Clock

Table 9-2

 
Step 10.
Note, the program allows turning two I/O pins (TTL level peripherals) on or off from the controller. This allows you to add headlights, etc. As a test, you can connect I/O pin 10 or 11 to the "A" and "B" LED / push button enable lines. Connect to the header pins closest to the LED's. You can also use a VOM to measure the voltage on the pins to verify their operation. See the schematic for details.

Bot Board Jumpers
Connect I/O 10 to LED A (see text)
Connect I/O 11 to LED B (see text)

Table 10-1


Schematic - Figure 10.

Schematic - Figure 10.


Step 11.
Download this file (ps2a4wd1.zip) and program the Atom Pro. You will want to set the bot on something so that the wheels aren't touching the ground.

Before running the program turn on the PS2 controller. When the program is run it will turn most PS2 game controllers to analog mode (required) automatically. If your controller does not automatically go into analog mode, you will need to do so manually.


Figure 11.
 
Step 12.
This program lets you control the movement of the bot and several add-on components. Use the left joystick to move the bot forward and backward, and make left and right turns. The turns can be gradual or on-the-spot, depending on how far you push the joystick.

This program also incorporates speed limits. There are four speeds, #1 being slowest and #4 being fastest. #3 is default. The speed limit is increased by pressing L1 and decreased by pressing L2. By reducing the top-end speed, you can use the full range of the joystick at a lower speed, thus increasing the accuracy of the rover's movements. This is helpful when trying to position the gripper over an object to pick up.

When the program is started, the program will read the joystick positions and set those values as the "nulled" position. Pressing the Start button will null the joysticks on command. Robot movements are proportional to the joystick travel from null, and linear in both directions after the deadband. This helps with PS2 controllers that don't reliably return to 127 for joystick center.

See Table 12-1 for a complete list of programmed controls.

PS2 Controls
L Joy U Moves bot forward R Joy U Tilts P&T Up
L Joy D Moves bot backward R Joy D Tilts P&T Down
L Joy L Turns bot Left R Joy L Turns P&T Left
L Joy R Turns bot Right R Joy R Turns P&T Right
L1 Speed Limit Inc. R1 Close Gripper
L2 Speed Limit Dec. R2 Open Gripper
L3 N/A R3 N/A
D-Pad U Lift Gripper Tri Toggle Pin 10
D-Pad D Lower Gripper X Toggle Pin 11
D-Pad L Rotate Gripper L Squ N/A
D-Pad R Rotate Gripper R O N/A
Start Joystick Null (see text) Select N/A

Table 12-1

Tags:
Created by Eric Nantel on 2023/01/27 15:08
Copyright RobotShop 2018