A4WD1 & AL5 Arm Tutorial for PS2 Control (Bot Board II)

Last modified by Eric Nantel on 2023/01/30 10:12

A4WD1 & AL5 Arm Tutorial for PS2 Control v2.0

Updated 12/20/2011

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

Note: This guide follows the A4WD1 and AL5 arm assembly guides. The Sabertooth has already been installed.

Software:
  - Basic Micro Studio
  -- Differential / Tank Mode test program (download)
  -- Throttle / Steering Mode test program (download)
  -- Arm offset finder program (download)
  -- PS2 A4WD1 & AL5 arm program v1.2 (download)


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 P10
Ch2 Bot Board II P11

Table 4

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

Sabertooth Settings
1 Enable Independent Control
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.

Connect the serial data cable to the PC's serial port. This can be recognized by having 9 pins that stick out. Connect the other end of the serial data cable to the Bot Board's DB9 port. You can use a USB-to-Serial adaptor if your PC doesn't have a physical serial port; see the troubleshooting guide for a list of tested USB-to-serial adaptors.

Please consult the Atom Pro programming tutorial and the serial troubleshooting guide if you have difficulties with this.


Figure 6.
 
Step 7. Differential or Tank Mode Test (Required)
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 (Optional)
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 that the chassis is fully tested, it's time to add the arm. Attach the arm to the A4WD1 as shown.

Any AL5 arm will work (AL5A, B, C, or D), with or without wrist rotate. You will edit the code later on to match your arm.


Figure 9.
 
Step 10.
Now it's time to set up the A4WD1 for PS2 R/C control. Y
ou will need to change the Bot Board's power bus jumpers according to Table 10 and Schematic 10 for the AL5 arm.

Note: Refer only to Figure 10 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 10.

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 10-1

Connections for Bot Board II
P0 Arm: Base P8 N/A
P1 Arm: Shoulder P9 Speaker
P2 Arm: Elbow P10 Sabertooth Ch1
P3 Arm: Wrist P11 Sabertooth Ch2
P4 Arm: Gripper open/close P12 PS2 Data
P5 Arm: Wrist rotate P13 PS2 Command
P6 N/A P14 PS2 Select
P7 N/A P15 PS2 Clock

Table 10-2


Schematic - Figure 10.

Schematic - Figure 10.


Step 11. Servo and Motor Controller Calibration
Put the rover up on a CD spindle or similar, to keep the wheels elevated.

Download the A4WD AL5 Arm Servo Offset Finder program, and load it into the BASIC Micro Studio.

In the IDE, at the bottom of the screen, click on the "Terminal1" tab. Change the Baud Rate to 9600, COM port to the port you're using, Echo to NoEcho, then click Connect (it will change to say Disconnect).


Figure 11.

 
Step 12.
Program the Atom Pro, and follow these instructions to find your robot's offsets.
  • Press A to decrease the servo offset.
  • Press C to increase the servo offset.
  • Press B to change which servo is being manipulated, and to send data back to the terminal. The order of the program is shown in Figure 12.
  • Note: If your arm does not have wrist rotate, just press B when wrist rotate is being configured to skip it.
  • Note: Motor offsets are only needed if the motors creep along slowly when the offset finder program is running. Adjust the offsets until they stop moving.

Note, if you have the Speaker enabled, when you press the B button you will hear a short tone. The tone will raise in pitch when you change from servo to servo, and will lower in pitch and be longer when you get back to Start.


Figure 12.


Step 13.
Place the robot in a position as close to neutral as possible, and turn it on. Your robot should go to and hold the neutral position, and should resemble figure 13. If the joints are off by more than 15° you may have made an error in assembly. To correct this, remove the center screw from the round servo horn, pull the servo horn off the servo, rotate until it's aligned, then reattach the servo horn.

Use the A, B, and C buttons to straighten the arm as shown in Figure 13.


Figure 13.

 
Step 14.
After you've cycled through the servos and adjusted them to match Figure 13, pressing the B button again will send your servo offset values to the Terminal window. See Figure 14 for an example. Your offset values will be different from those shown in the image.

Write your offset values down. You'll need them for the next step.


Figure 14.

 
Step 15.
Open this file (rover_v1.2.zip) with the BASIC Micro Studio editor. Find the section referencing offsets (starts at program line 84). Fill in the offset values you wrote down.

Servo Offsets in Program
(starts at Line 84)

;[SERVO OFFSETS]    deg * 166.6
Base_Offset         con 0
Shoulder_Offset     con 0
Elbow_Offset        con 0
Wrist_Offset        con 0
Gripper_Offset      con 0
WristRotate_Offset  con 0
;[MOTOR NEUTRAL OFFSET]
RightChNeutral      con 1500
LeftChNeutral       con 1500

Table 15-1


Step 16.
Select the proper arm type
(starts at program line 73). If you're using FSR sensor on the gripper, change the 0 to a 1 on that line.

(The FSR assembly and set up guide can be found here.)

Arm Setup in Program
(starts at Line 73)

;[SETUP]
;disable(0)/enable(1) the FSR Gripper

EnableFSR con 0

;Select Arm type
;NOTE: Enable only one arm!
;AL5A con 1
AL5B con 1
;AL5C con 1
;AL5D con 1

Table 16-1

 
Step 17.
You will want to set the bot on something so that the wheels aren't touching the ground. When the program is run, there will be a series of beeps telling you that the Atom is trying to communicate with the PS2 game controller. When communication is established, the beeps will stop, but you may need to put the controller in Analog mode.

This program lets you control the movement of the bot in two modes. On powerup, the vehicle is controlled with a tank mode, meaning left and right joysticks control the left and right motors independently. Pressing the right joystick in (R3) switches the control mode from tank mode to a single joystick control mode. Up and Down on the D-pad control the robot's max speed. This is useful when precise positioning of the robot base is required.

Consult Tables 17-1, 17-2, and 17-3 for more information on controlling the 4WD.

PS2 Controls
Start Turn Rover/Arm on/off Select Switch between Rover and Arm control

Table 17-1

Rover Control
Tank Mode:
L Joy U/D Left wheels forward/reverse R Joy U/D Right wheels forward/reverse
One-Stick Mode:
R Joy U/D Forward/reverse R Joy L/R Steering
Speed Control (Both Modes):
D-Pad U Shift gear up (1-4)
(Default gear 3)
D-Pad D Shift Gear down (1-4)
(Default gear 3)
R3 Switch steering mode (Tank/One-Stick)

Table 17-2

Arm Control
L Joy U/D Gripper Up/Down R Joy U/D Gripper Angle Up/Down
L Joy L/R Gripper Away/Back R Joy L/R Base Left/Right
/\ Tri Reset Wrist Rotate to middle position X Fully open gripper
L1 Gripper Close R1 Wrist Rotate CW
L2 Gripper Open R2 Wrist Rotate CCW

Table 17-3

Tags:
Created by Eric Nantel on 2023/01/19 12:55
Copyright RobotShop 2018