The Complete H3/H3-R Tutorial (BotBoarduino) v2.0

Last modified by Eric Nantel on 2023/01/26 07:43

The Complete H3/H3-R Tutorial v2.0

Updated 06/07/2012

This guide applies to the BotBoarduino.

The purpose of this guide is to use the Hexapod Calibration program to calibrate the servos and to program the Botboarduino for PS2 remote control.

Note, we used the round hexapod for the images in the tutorial, however, everything still applies to the inline hexapod.

Note, the PS2 control programs have been verified to work with our Lynxmotion wireless controllers. We cannot guarantee that non-Lynxmotion controllers will work.

Hardware:
  - SSC-32
  - BotBoarduino
  - PS2 Cable / PS2 Wireless Controller
  - Hexapod 3 / 3-R

Software:
  - Hexapod Calibration (download)
  - Arduino Software (download)


Image of AH3-R.

Image of BH3-R.

Image of BH3.

Image of CH3-R.
 

 
Step 1.
Set the robot up on a stand such as a CD spindle. Connect the USB cable to your PC and to the Botboarduino. Power up the robot. Verify that the green LED on the Botboarduino and SSC-32 light up. Note, the SSC-32's LED is NOT a power indicator. Its purpose is to light up, indicating that the SSC-32 is functioning properly. It will remain lit until it receives serial data. After that, it will blink when receiving data. The servos may jump but will not hold position yet.
 

Figure 1-1.

Figure 1-2.

Step 2.
You will need to modify a 6" servo extender cable. Remove the header pins from the cable so you have two female ends. Then use an exacto knife to gently pry the tab up to pull the red wire free on one end. Cover the exposed female connector with heat shrink to avoid accidental shorts.

Remove the TX and RX jumpers from the lower-right corner of the SSC-32, and plug the unmodified end of the cable in. Yellow on TX, red on RX, and black on ground.

Plug in some extra lengths of 18-24awg wires to VL on the SSC-32, with the 9vdc battery clip. These will be used to run power to the BotBoarduino.


Figure 2.

 
Step 3.
We need to set up the SSC-32 to communicate with the BotBoarduino. Remove the DB9-enable jumpers and install the unmodified end of your 6" servo extender cable on the TTL serial communication posts. The black wire is closest to the edge of the board, and the yellow wire is on RX.

See the schematic below for detailed information.


Figure 3.
 
Step 4.
Remove the 3/8 x 4-40 screws that hold the SSC-32 in place. Install the BotBoarduino as illustrated in Figure 4 using the same screws. Attach the red and black wires from the SSC-32 to the VL input, with black on (-) and red on (+). Plug the red wire of your modified cable into pin 12 and the yellow wire to pin 13.
Install the Playstation 2 cable as illustrated in Figure 4-1.

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


Figure 4.

Schematic.
Double check your connections against the schematic below.

Servo Letter Definitions

 Left
 Right
 Rear
 Middle
 Front
 Knee
 Vertical
 Horizontal


Schematic.

 

Step 5. Download the Program
Download the Arduino software from here. Install and run the program to allow programming the chip. You can download the code for your robot here.

Extract the .zip file to a folder named "BotBoarduino_CH3R_PS2". The folder name IS required. Open BotBoarduino_CH3R_PS2.ino in the arduino software, turn on the robot, and click upload (the small arrow pointing to the right.)

Please note that in some cases you may have to reverse the Attention/Command/Data connector for the PS2 receiver to function with the BotBoarduino

 
Figure 5.
Step 6.
At this point, the robot is able to move around. However, since the legs are not calibrated, it will look very sloppy. Download the Hexapod Calibration program to calibrate the robot's legs here. Just unzip the zip file and run the installer. This will automatically create an icon on your desktop so you can easily run it.

Figure 6.

Step 7.
Hold the "A" button on the BotBoarduino and apply power to the robot. This will force the robot into a calibration mode. Open the Hexapod Calibration program. The program will automatically detect a connected SSC-32 on ports 1-30 and will display the SSC-32's firmware version when connected.

Click "All=1500" to enable the servos. The robot's legs should move quickly into position as in Figures 8-1 or 8-2, and should hold this position. If the legs move into position but suddenly go limp, this is an indication of a low battery. A low battery can't deliver the required current, causing the SSC-32 to reset. Another clue that this is happening is the SSC-32's green LED will be on steady, as it is upon powerup.

If the legs are holding position but look radically different, then a mistake may have been made in the assembly. To correct this, you can remove the center servo horn screw, pull the servo horn off the servo, reposition it, and press it back on the servo. Then replace the servo horn screw. Don't worry if the legs are off a little bit (under 15°) as this will be corrected in the servo offset procedure.

Note, you can click on "inline" if you do not have a circular chassis for a more accurate visual representation.


Figure 7.
 
Step 8.
We will now begin to use the servo offset adjustment to fine-tune the alignment of the leg joints. The goal is to align the leg to be perpendicular to the chassis and for the knee to form a perfect right angle. (See Figures 8-2 and 8-3.)

We are assuming that you have your servos plugged into the appropriate pins, according to the assembly guide. Select a hip servo by clicking on the corresponding radio button. Move the Offset slider around until the joint is aligned. You can move it using the scroll wheel or arrow keys for fine tuning.

After aligning the hip servo, move on to the next closest servo to the body. Finally adjusting the knee servo last. Align the rest of the robot's legs in this manner. When you move to another servo, the previous one is marked as red to show your progress.

 


Figure 8-1.
 

Figure 8-2.

Figure 8-3.

Step 9.
Mount the PS2 cable to the chassis. We used some double-sided foam tape to stick the PS2 cable on the bottom of the robot as shown. This makes it easier to swap controllers if needed.

Figure 9.

Step 10. Controlling the Robot
The default is Walking mode 1. Use the Left joystick to move the robot around without turning (this is called "translation"), and the Right joystick rotates the robot as it moves. Up and Down on the D-Pad increases or decreases the height of the body. The Triangle button puts the body at 35mm from the ground. The Circle button puts the body onto the floor in a 'resting' position. Press Triangle or Up on the D-Pad to raise the body.

There are four special "body moves" functions that are triggered by pressing L1, L2, Circle, or X. While in one of these modes, the hexapod does not walk. The joysticks and some buttons change function depending on which mode is toggled on; see Table 10 for details.


Button

Function

Common Controls

Start Turn robot on/off
R3 Switch between Walk mode 1 (default) and Walk mode 2
L1 Toggle Shift mode
L2 Toggle Rotate mode
X Toggle GP Player mode
O Circle Toggle Single Leg mode
[] Square Toggle Balance mode
(Balance mode: Lifts and lowers body along with moving legs.)
/\ Triangle Switch between body at 35mm from ground (walking default) and body lowered to ground
D-Pad Up Body up 10mm
D-Pad Down Body down 10mm
D-Pad Left Decrease speed by 50mS
D-Pad Right Increase speed by 50mS

Walk Mode Controls
(Default is Walk mode 1)

Select Change gaits
Left Joystick Walk mode 1: Walk/strafe
Walk mode 2: Disabled
Right Joystick Walk mode 1: Rotate
Walk mode 2: Walk/rotate
R1 Toggle double gait travel speed
R2 Toggle double gait travel length
 

Button

Function

Shift Mode Controls
(Special mode)

L1 Turn Shift mode off
Left Joystick Shift body X/Z
Right Joystick Shift and rotate body Y

Rotate Mode Controls
(Special mode)

L2 Turn Rotate mode off
Left Joystick Rotate body X/Z
Right Joystick Rotate body Y

Single Leg Mode Controls
(Special mode)

O Circle Turn Single Leg mode off
Select Switch legs
Left Joystick Move leg X/Z (relative)
Right Joystick Move leg Y (absolute)
R2 Hold/release leg position

GP Player Mode Controls
(Special mode; Requires GP firmware in SSC-32)

X Turn GP Player mode off
Select Switch sequences
R2 Start sequences
PS2 Controls
Table 10.
Tags:
Created by Eric Nantel on 2023/01/25 12:14
Copyright RobotShop 2018