Processes Projects |
Main /
OctoROACHUserManualOctoRoACH User Manual Last updated 2/20/2012 This document provides instructions for setting and operating the OctoRoACH robot. The RobotThe OctoRoACH robot is a centimeter scale multi-legged crawling robot, designed for research in robotics, sensing, locomotion, and related subjects. Theory of OperationThe current software for the OctoRoACH provides a high-level communication interface between the robot and a controlling personal computer. The PC issues commands to the robot, and receives recorded telemetry data. Communication is accomplished via an 802.15.4 standard radio on the robot control board. SoftwareThe software suite associated with the OctoRoACH robot is comprised of the firmware on the microcontroller onboard the robot and the PC-side command and interface utilities. The firmware is implemented in plain C for the Microchip dsPIC33 microcontroller (the C source is not yet available to customers) . Setup & InstallationTo interface with the OctoRoACH robot, you will need an 802.15.4 radio to plug into your computer to communicate with the robot. The robot can be controlled from Windows, OSX, and Linux. HardwareThis section is presented as a pool of links and info about important support hardware for the OctoRoach. XbeeTo communicate with the robot, you will need an XBee module: This module is available from many resellers: You will also a board to interface the module to a USB port on your computer; Sparkfun sells one of these:
http://www.sparkfun.com/products/8687 ChargerThe batteries supplied with the MRI built OctoRoACH robots can be found here: NOTE: Do not use the SparkFun chargers with these batteries. They use an identical connector, but with reversed polarity. E-Flite also makes a charger that can charge multiple batteries at once: Other chargers are available HobbyKing, but these chargers will require some setup to select the right cell type, cell count, etc: PythonRunning the OctoRoACH code will require you to install a python interpreter, as well as several libraries. Python is an open-source programming language, with an open-source interpreter and tools readily available.
Enthough Python is no longer recommended, as they have put several required packages behind a subscription pay-wall.
TODO: Test x64 version of Anaconda on Windows, make sure pyserial works. Windows
If you want to use joystick control, you'll need to install the pygame library. Unfortunately, it seems that none of the various python package managers (easy_install, pip, conda) can install pygame. Get an installer here: If you installed the 64bit version of Anaconda, download and install pygame‑1.9.2a0.win‑amd64‑py2.7.exe OSXThe XBee module can be made to work with OSX, but the X-CTU utility to configure the XBee is not available for OSX. This section will be filled in later. LinuxThe XBee module can be made to work with Linux, but the X-CTU utility to configure the XBee is not available for Linux. This section will be filled in later. Installation of python varies greatly by OS distribution. For Ubuntu systems, all libraries can be installed by running the following command in a terminal: Sudo apt-get install python python-serial python-xbee python-numpy CommunicationsThe use of a computer running Microsoft Windows is required to set up the XBee module to communicate with the robot. After the initial setup, the XBee module can be used with a Windows, OSX, or Linux computer. WindowsWhen the XBee module is plugged into the computer, it will provide a “Virtual COM port”. To find out what COM port was assigned to the Xbee, open the Windows Device Manager (WindowsKey + r, type “devmgmt.msc”, press enter). The device will be listed under the heading “Ports (COM & LPT)”. Note that other devices connect to your computer may be provided COM ports as well. Examine the Device Manager with the XBee unplugged to determine which COM corresponds to your XBee. To configure the Xbee, download the X-CTU program from the Digi website: http://ftp1.digi.com/support/utilities/40003002_B.exe Start X-CTU once it is installed. Refer to figures 1-4 for the following instructions:
Your XBee module should now be configured for use. You will only have to do this once for each Xbee module. Figure 1: Figure 2: Figure 3: Figure 4: To set up the Python software library, edit shared.py, and set the COM port to the correct value. For example, if your XBee is on COM6, then you would edit the line to read: BS_COMPORT = ‘COM6’ The file shared.py is used as a "global" module, to elide the need for long lists of "global" keywords in control scripts. You are ready to control your robot. Exit the X-CTU configuration program before running any of the Python code to connect to the robot. Running the RobotSeveral pre-made Python scripts are provided as example of how to command the robot over the radio link. To run the robot, connect a charged battery to the control board. Verify that the red LED is illuminated; this means that the control board is powered and idling. Figure ##: Connecting the battery Figure ##: Red LED indicates robot ready to go You should now be able to remotely pilot your robot about using the keys described in the on-screen instructions. If this does not work, please see the Troubleshooting section. Accelerometer CalibrationTo get high accuracy results from the accelerometer, a calibration step should be performed; this only needs to be done once per robot. The control board for the OctoRoACH robot has an ADXL345 accelerometer onboard. The chip is configured to sense in the +-8 range. The X,Y,Z acceleration values are saved and downloaded with the telemetry data. Then values are recorded and downloaded in "raw counts" from the ADXL345 chip, and should be converted to G's. Since the datasheet specifies nominal sensitivity of 256 LSB/G, an approximate conversion is: Acceleration [G] = Acceleration [raw counts] / 256 As per the datasheet, each axis of the accelerometer may have it's own scaling and offset, such that the true scaling is: To find the calibration parameters [Cx,Cy,Cz,Dx,Dy,Dz], use experiment.py to take a datalog of the robot over 45-60 seconds, as the user holds the robot in the air and slowly rotates it around all 3 of it's axes smoothly, without shifting the center of robot. Since the acceleromter will track a 1G gravity vector with changing orientation, we can fit this data to a 1G sphere, and determine the conversion parameters which are the best fit, in the least-squares sense. The user should modify the experiment.py such that: Once you have this data log as an "imudata*.txt" file, rename it to "calib_imudata.txt", and use one of the following calibration scripts to calculate the paramters: Mathematica or Matlab. Save a record of the parameters [Cx,Cy,Cz,Dx,Dy,Dz], as they should be uniquely associated with the particular control board on the robot you are calibrating. It is not expected that the calibration parameters will change over time. (TODO: provide pre-made experiment.py for calibration) TroubleshootingIn this section, known issues will be pooled and addressed. If you are experiencing an issue, especially a reproducible one, please email the author so it can be added to the list.
Channel: 0x0E PAN ID: ?? Source Addr: ?? (this is the robot's address, "destination" from the point of the Xbee) Dest Addr: ?? (this is the XBee's address, "source" from the point of the XBee) The python scripts will attempt to set motor control gains as the first step; if the robot cannot be reached, the script will not continue to execute.
Known issues
Notes At the current time, all OctoRoACH robots are shipped with hard-coded network parameters. As such, all robots operate on the same channel (TODO), with the same network PAN ID (TODO), and the same destination address (TODO). This means that two robots cannot be run at the same time in the same location. This section will be expanded to provide details on how to change parameters and use multiple robots together. Future sections: Compiling firmware from source Configuring radio parameters Sensing with the microcontroller’s ADC Using microcontrollers GPIO Authors: Andrew Pullin, UC Berkeley, Graduate Student |