Once the MkII PhantomX Hexapod is built, it’s time to setup the software and electronics. I’d break it down into the following general steps:
1. Start charging your battery!
Connect the included Imax B6 charger to the wall with the power supply and barrel plug adapter. Connect the lipo battery using both the main deans power connector and the JST balance cable. This plugs into the 3S port on the charger. Scroll through the programs in the charger until you see “LIPO BALANCE CHARGE”. Hit enter, set the current to 1-2A, and the voltage to 11.1V 3S. When the settings look good (I’m not a battery expert, do your own research to get a feel for charge currents) hold the Enter button for a bit until it beeps and does a little test measuring your battery. It then tells you that it finds a 3S, and asks if that sounds correct. Hit Enter again to confirm and off it goes.
2. Arduino Setup for the Arbotix Robocontroller.
An “Arduino” is a family of easy-to-use microcontrollers based on Atmel AVRs. The Arduino IDE includes some handy software libraries for interfacing with a lot of the components in the hardware. The Arbotix Robocontroller uses an Arduino compatible Atmel AVR (ATMEGA644p), but some of its functions are not supported out of the box. So you need to add some libraries. This is outlined pretty well on their support wiki. Just follow the “Arduino Software Setup” section and you’ll be good to go. Don’t worry about any of the PyPose stuff, you don’t need any of that to get the hex up and running.
You should also download the latest MkII PhantomX Hexapod code from Trossen and put it into your Arduino sketchbook folder so its ready to go. If you’re feeling ambitious, give it a compile. If your libraries are setup right it should compile with no errors or warnings.
3. Pairing the Xbee radios.
The kit comes with two Xbee radios that must be paired in order to talk to each other. Basically this means that they need to talk on the same channel (ATID), at the same baud rate (ATBD), and have cooperating receive (ATMY) and send (ATDL) addresses. This forum thread is a great tutorial on how to pair the radios using the MaxStream X-CTU utility. The only variance from the guide is that the PhantomX kit comes with a UARTsBee instead of the Xbee Explorer, but they are functionally the same thing. And don’t worry about the Python Terminal stuff, you only need to use the X-CTU GUI utility. Once that’s all set, plug one of the Xbees into your Commander controller.
4. Programming the hex
The last step is to program the Robocontroller with the Trossen provided code. Break out your UARTsBee and check out how it will all go together here. Make sure that the little switch on the UARtsBee is set to 5V. Note that you don’t want an actual Xbee installed on the UARTsBee. The UARTsBee itself is the FTDI interface which we need for the programming. Its a multipurpose device. Also make sure that the power jumper on the Robocontroller board itself is set to ‘FTDI’ and not ‘VIN’. This means that we’ll be powering the board with the UARTsBee and not your battery supply. Also make sure that you DO NOT have the Xbee plugged into the Robocontroller. The Xbee radio and the UARTsBee serial interface share the same resources and can not be used at the same time.
Connect the UARTsBee to your PC with the USB cable. If all is well it will show up as a virtual COM port in your Windows Device Manager. In the Arduino IDE, select ‘Arbotix’ as your Board in the Tools Menu. Serial Port should be set to the virtual COM port of the UARTsBee.
Next unplug the UARTsBee from the USB Cable. Connect it now to the Robocontroller using the header cable making sure your wire colors are oriented correctly. Now connect the UARTsBee back to your USB cable and the Robocontroller should power up with a green light!
Now for the moment of truth. Click the ‘Upload’ button in the Arduino IDE. It should compile the code with no fuss and begin uploading it to the Robocontroller. You can see the Red LEDs blinking away on the UARTsBee as it transfers. When its all done the lights will go out and the Arduino IDE will report “Upload done.”
Now that your hex has a brain its almost go time. Disconnect the UARTsBee from the PC and from the Robocontroller. Set the Robocontroller power jumper to VIN (battery power). Plug the Xbee radio into the Robocontroller.
Power on the hexapod and power on the Commander controller. If everything went according to plan, the hex should come alive and walk, strafe, rotate, etc. Click the little black buttons above the joysticks to check out the different gaits. Victory!!!
Next: The Game Plan for B.E.T.H.’s Brain