MSR-H01 Hexapod + HexEngine Integration Guide
Updated: 12-Feb-2010

Read first: Safety First!

If you plan on using an p.Brain-HexEngine with your MSR-H01 hexapod, this guide will help you get up and running as quickly as possible, without having to fully understand all of the configuration settings of the HexEngine.

Print this 6 page document with the following settings: Paper A4 or Letter, Margins 0.5", Scale 55%. tested in IE7 & Firefox 3.0.1

Index
Number02 p.Brian-SMB & Battery Switch Harness
Number02 Servo Leads & Battery
Number02 HexEngine & Terminal Communications
Number02 HexEngine Configuration
Number02 Hexapod Calibration
Number02 Waking The Hexapod!
Number02 Hexapod First Steps!
clr mms_logo

MSR-H01 Hexapod
Diagram (1) - MSR-H01 Hexapod with servos plugged into p.Brain-SMB mounted in body.

 

Servo Leads & Switch Harness

Number02 p.Brain-SMB & Battery Switch Harness

Take a look at diagram (2) opposite and familiarize yourself with the layout of the p.Brain-SMB. We will use the following connectors in this quick start guide.

  • CN1 to CN8 The servo plugs
  • CN20 The servo and logic power (green terminal block).
  • CN21 The RS232 terminal port
  • CN18 The baud configuration jumpers
  • JP2 The power configuration jumpers
  • LED2 Servo power led

Your p.Brain-SMB should be installed in your hexapod, with CN20 towards the posterior. JP2 should have a jumper in place as shown by the dark block in the diagram. There should be no jumpers on CN18. If you have not already installed the p.Brain-HexEngine module, you should do this now (See diagram (3) for correct insertion orientation).

If you have a switch harness, install this now in the either the left or right switch hole just in front of the middle legs in the top body plate. Route the switch leads back to the posterior of the body. Strip the the ends without a connector on them and insert into the SMB CN20 power terminal, pin 1 for the red (positive) and pin 2 for the black (negative) as sown in diagram (2).

 

 
 

p.Brain-SMB
Diagram (2) - p.Brain-SMB layout, with servo power leads.

 

p.Brain-SMB + HexEngine
Diagram (3) - p.Brain-SMB with HexEngine module.



Number02 Servo Leads & Battery

Next we need to route the servos to the correct servo plug on the p.Brain-SMB and plug them in. Take time to work out the best way to route the servo leads, and make sure each lead has enough length so as not to impede leg movement or become pinched by moving parts.

Plug your servos into the p.Brain-SMB (CN1 to CN8) using diagram (4) opposite to map to the servo numbering on the p.Brain-SMB PCB (See the numbers on the p.Brain-SMB PCB on the outside edge of CN1 to CN8 in diagram (2)). When plugging the servo into the PCB, make sure the black lead is towards the outside edge of the PCB. Note: servo connectors 1,2,3,22,23,24 are not used for the legs.

Now plug your power source into your switch harness, the battery does not have to be in the body cavity at this point, but you may wish to insert the battery through the back legs, under the p.Brain-SMB. If LED2 illuminates when you plug your power source in, this means your switch on your switch harness is in the ON position, for now, turn it OFF.

Note: your power source should be 4.8 or 6.0 Volts, such as a 4 or 5 cell NiMh battery pack or suitable power supply. If you are using a battery pack, make sure the pack is charged.

clr

MSR-H01 Servo Layout
Diagram (4) - MSR-H01 hexapod servo number map.

HexEngine Terminal


Number02 HexEngine Terminal Communications

Before continuing with the hexapod configuration, you will need to prop your hexapod up so that the legs can't reach the floor. To do this I suggest using one or two CD stack towers or similar as in diagram (7). What ever you use, make sure the hexapod is stable, and that the feet can't touch the ground when the femur is parallel to the ground and the tibia perpendicular to the ground (the calibration position diagram (8) )

Plug the p.Brain-RJ232 lead diagram (5) into CN21 and to an available COM port on your computer. Now you will need to launch your choice of terminal software, such as hyperterm, or the recommended terraterm for windows which can be downloaded free here.

Once you have your terminal software running, select the COM port you have plugged the p.Brain-RJ232 lead into and set the baud rate to: 115200, No Parity, 8 Data bits, 1 Stop Bit, do not worry about flow control. Switch on power to your hexapod. You should see that LED2 illuminates on the p.Brain-SMB, and a green LED on the p.Brain-HexEngine should be slowly flashing. At the same time a screen similar to that shown in diagram (6) should appear in the terminal screen. If you do not see the HexEngine terminal screen, check the following:

  1. If LED2 on the p.Brain-SMB is illuminated, but the green LED on the HexEngine is not slowly blinking: switch power off, and check you have the HexEngine module correctly inserted into the p.Brain-SMB. Once you are happy that the HexEngine is inserted correctly, switch the power back on, if the green LED on the HexEngine does not start to blink, go to step 4.
  2. If LED2 on the p.Brain-SMB is illuminated and the green LED on the HexEngine module is slowly flashing: check that your p.Brian-RJ232 lead is plugged in correctly at both ends. Make sure you are selecting the correct COM port within your terminal software and the port is OPEN. Double check the port speed and configuration within the terminal software. power cycle the hexapod once you have made these checks.
  3. If LED2 does not illuminate, go to step 4.
  4. Switch off the power to the hexapod and check your power source is correctly connected. If you are using a battery, check it is fully charged.

Once you have established communications with the HexEngine and have a screen similar to the one in diagram (6) please move to the next step, HexEngine Configuration.

clr

p.Brain-RJ232
Diagram (5) - p.Brain-RJ232 DB9 to RJ11 serial lead.

 

HexEngine - Terminal
Diagram (6) - HexEngine Terminal Screen.

 

Tip:

TerraTerm will support upto 16 serial ports, COM1 to COM16, however, only COM1 to COM4 are listed by default, to change this you will need to edit the "TERATERM.INI" file located in the TeraTerm install directory. First make a backup copy of the file, then open the file in a text editor and make the following changes: Find "MaxComPort=4", Change to: "MaxComPort=16". To set the default port number find: "ComPort=1", change to: "ComPort=n" Where n is the port number you require. You can also set the default baud rate, find "BaudRate=9600" and change to "BaudRate=115200". And finally to tell TeraTerm to always open a serial port, find "Port=" and change to "Port=serial".

 

 


Number02 HexEngine Configuration

Now we are going to set up the basic geometry and configuration settings for the MSR-H01 hexapod within the HexEngine. Fortunately there is a built in configuration file for the MSR-H01 which greatly simplifies the procedure. From within your terminal window, type the following list of commands: Note: each command is shown in blue upper case for clarity and followed by the ENTER key, comments are in brackets and should not be typed:

  • CONFIG (Enters configuration menu)
  • MSRH01 (Recalls MSR-H01 hexapod configuration)
  • Y (Selects YES to load MSR-H01 configuration)
  • EXIT (Exit configuration menu)
  • Y (Selects YES to save new configuration changes)

You have now configured your MSR-H01 hexapod geometry and should be back in the main terminal menu, if your configuration was successfully you should see the name "MSRH01" will be displayed under "micromagic systems ltd" at the top of the main menu. If this is not the case, repeat the configuration steps above.

Now configuration is complete, move to Hexapod Calibration.

 
 

MSR-H01 Calibration
Diagram (7) - MSR-H01 placed on CD tower in calibration position


Number02 Hexapod Calibration

Leg calibration is a very important step in the set up process, the more time spent during calibration the better your hexapod will move!

Enter the calibration menu by typing "CALIBRATE" and hitting the ENTER key. A new menu should appear and look something like diagram (7). Within this menu each joint on each leg is calibrated at a set position shown in diagram (9) and diagram (10).

All Coxa joints are calibrated at 90° to the Y axis of the body (See diagram (10)) The femur joints are calibrated parallel to the floor and the tibia joints are calibrated perpendicular to the floor (See diagram (9)).

You will see towards the top right hand side of the screen there is a leg organization table showing the anterior (front) and posterior (rear) of the hexapod, with the six legs numbered around the body. This is a top view of the hexapod, therefore leg 1 corresponds to the front right leg. You can use the number keys 1 to 6 to select the desired leg to calibrate.

Lets start by calibrating leg 1. Note: At this point your hexapod should be suspended off of the ground so that none of the legs can come in contact with the floor.

  1. Select desired leg by tapping the appropriate number key. I suggest starting with leg 1: tap '1'.
  2. Press the '+' key to globally enable servos. Note if at any point things are going wrong! press the '-' key to disable all servos, or switch the hexapod off, you can always come back to the calibration screen and start again. Remember, the '+' key is also the '=' key on a standard keyboard, so you need hold down SHIFT and tap the '+' key, or press the dedicated '+' key on the numerical keypad.
  3. Now you have six keys in three pairs to trim the leg position, Coxa trim = 'A' & 'Z', Femur trim = 'S' & 'X', Tibia trim = 'D' & 'C'. As soon as you press one of the three pairs of keys, the corresponding joint will spring into action! for this reason its a good idea to have the leg in an approximate calibration position. press these keys in this order: 'D', 'S', 'A'. You should have seen the leg fire up, Tibia, Femur and Coxa.
  4. Coxa trim: look down on the top of your hexapod, and check to see if the coxa is at 90° to the Y axis as in diagram (9). If this is not the case, use the 'A' key to drive the coxa forward and the 'Z' key to drive the coxa back until it is at right angles with the Y axis.
  5. Femur trim: take a look at the front of the hexapod and check that the femur is parallel to the ground, if it is not, use the 'S' key to move the femur up, and the 'X' key to move the femur down until parallel
  6. Tibia trim: the tibia should be at right angles with the femur, or perpendicular to the ground, if it is not use the 'D' key to move it out, and the 'C' key to move it in.
  7. Once you are happy with the leg calibration, hold down 'SHIFT' and press the 'F' key. Press 'Y' when prompted to save the calibration file.
  8. Now repeat steps 1 to 7 for each leg on the hexapod. each time you move to the next leg, the previous leg is powered off, so you can gently manipulate it out of the way if necessary.

Once calibration of all legs are complete, exit the calibration menu by holding down 'SHIFT' and pressing 'Q'. When prompted if you wish to save the calibration file, press 'Y'.

 

HexEngine Calibrate
Diagram (8) - HexEngine Calibration Menu.

 

Calibration 01

Diagram (9) - Hexapod Femur and Tibia calibration position.
Calibration 02

Diagram (10) - Hexapod Coxa Calibration Position.



Number02

Waking the Hexapod!

Your hexapod is just about ready to take its first steps! but we need to check that the calibration is correct. place your hexapod on a flat level surface with the legs roughly as positioned in diagram (11).

Now within the main terminal window type "WAKE" and press ENTER. All going well, your hexapod should stand up, and flex each leg into the position similar to diagram (1) at the top of this document. If your calibration was carried out successfully, each foot should be in contact with the ground, and taking approximately the same weight. This can be checked by gently grasping one foot at a time and gently moving the foot back and forth a few millimeters to see how much friction there is with the surface of the ground. If there is alot of difference between the ground contact and each foot, type "SLEEP" followed by the ENTER key, wait for your hexapod to power down and go back to the calibration process Number02.

If you are happy with the standing position and leg calibration, type "SLEEP" followed by the ENTER key and go to stage 7.

Note: the hexapod will automatically sleep after a given time interval of about 30 seconds. you can wake the hexapod up by typing "WAKE" and pressing the ENTER key.

clr

MSR-H01 Sleep
Diagram (11) - MSR-H01 Hexapod in sleep position.

 
 

Number02 Hexapod First Steps!

Now we are happy with the calibration and standing position will get the hexapod to walk using the built in simple control interface.

from the main terminal menu type "SIM CONTROL" followed by the ENTER key. You should now be in the Simple Control menu which should look like diagram (11). from within this screen you can control your hexapod much like a first person perspective game, using the keyboard keys: W,S,A,D,Q,E. Try the out! You can also change the hexapods gait using the number keys '1' to '4'.

This control method is a great way to get started and see what the HexEngine can do, but as the name suggests, this is the Simple Control technique, there is a more advanced control interface called the PIP protocol which gives control of body rotation, translation, proportional direction control and much more!

Further information on the HexEngine configuration, PIP guide and control tutorials, see table (1):

This concludes the quick start guide

 
Configuration Guide (PDF) A guide to configuring the HexEngine
PIP protocol Guide (PDF) A guide to the PIP protocol used to send locomotion commands to the HexEngine.
PodControl Application (Zip File) Simple WIN32 application to test the various features of the HexEngine.
PodControl BB5 Project (Zip File) PodControl application project written in Borland Builder 5. Full source.
PodJoy Application (Zip File) HexEngine control application using joysticks
HexEngine Control VB.NET Project (Link) HexEngine Control application project & executable written in VB.NET by Paul Pemble
HexEngine + BS2p Tutorial 1(Link) Tutorial to demonstrate connecting a BS2p to a PS2 game pad and controlling the HexEngine via PIP commands.
HexEngine + BS2p Tutorial 2(Link) In this tutorial 2 way communications are established between the BS2p and the HexEngine, to demonstrate reading the I2C, ADC & DIO ports.
HexEngine + BS2p Tutorial 3(Link) In this tutorial, the BS2p uses two way comms to the HexEngine which is attached to an SRF08 range finder via I2C. The BS2p & SRF08 are used to add basic obstacle avoidance to the Hexapod.
HexEngine + BS2p Tutorial 4(Link) Basic obstacle avoidance using the setup from tutorial 3
HexEngine Control VB.NET Project (Link) HexEngine Control application project & executable written in VB.NET by Paul Pemble
HexEngine Java App. for PS3 controller (Link) untested The purpose of this program is to enable control of a MSR-H01 Hexapod through a Sony PS3 Six axis (or compatible) handheld controller.
By Peder Madsen

Table (1)