The Robomagellan competition will be held at Robogames on April 17, 2011 in the bay area. The rules are here: http://robogames.net/rules/magellan.php
The Sparkfun competition: http://www.sparkfun.com/products/10435
This project's GIT repository: http://ieee.ucsd.edu/gitorious/robomagellan-2011/robomagellan-2011
Design
The system will use GPS and compass to get within the general vicinity of the waypoints, then use the camera to search for the cone. The camera will be mounted on a gimbal so that it can scan 180 degrees. A sonar sensor will also be mounted on the gimbal so that we can gauge distance to the cone. We will use a fixed array of 3 sonar sensors, plus a sonar sensor mounted on the gimbal to detect and avoid objects. We can use the gimbal-mounted sonar sensor to generate a continuous depth map as a function of angle by scanning it 180 degrees. We will sample the fixed sonar array continuously while driving, which will detect whether an object is present or not. We can then use the gimbal-mounted sonar sensor to get a finer picture of object and determine a way around it.
We will use the LPC2148 for the microcontroller. The LPC2148 is a 32-bit ARM processor running at 60Mhz with 40kB SRAM and 512k flash. We are designing a single PCB for the system which will contain the LPC2148 header board, power supply electronics, level shifting circuitry, and connectors to all the off-board peripherals. The system will use a Zigbee wireless interface for debugging, communication, and kill switch. Voltage level translation between 3.3V and 5V will be performed by a pair of 74LVXC3245MTCX, one configured for transmit and the other configured for receive. This will also serve to buffer the microcontroller pins against large currents.
The electronics will be physically mounted on a sheet of aluminum which will be connected to system ground. The aluminum will serve as a shield against EM noise generated by the motors. The gimbal and sonar array will be mounted in front, the electronics will be mounted in the center, and the GPS and compass will be located at the rear.
We are using the Traxxas E-Maxx monster truck (same chassis as previous two years), which comes with the EVX-2 speed controller. The EVX-2 takes standard RC control signals, that is, 50Hz PWM signals with pulse width between 1us and 2us. The motor and servos are powered by a pair of 8.4V NiMH batteries that connect directly to the speed controller.
The electronics will be powered by a 7.4V Lipo battery. The electronics power and motor power are completely isolated. We are using linear regulators to generate 3.3V and 5V rails for the electronics. The power consumption of our system is so low that we can run the system for several hours without recharging, which is more than sufficient for the competition.
System Block Diagram
Attack Plan
| Name | Role | |
|---|---|---|
| Jordan Rhee | Team Lead | rhee.jordan@gmail.com |
| Jereme Barnett-Woods | PCB | jcbarnet@ucsd.edu |
| Frank Chang | Sonar | fychang@ucsd.edu |
| Nicolas Thien | Camera | nutella50g@gmail.com |
| Arthur Robertson | Compass | ayrobert89@gmail.com |
These are also under source control in doc/Pin Assignments.txt.
LPC2148 Pin Assignments Signal Name Port Pin Function Notes -------------------------------------------------------------- SONAR1_OUT P0.30 CAP0.0 PWM output of sonar device (connected to CAPTURE inputs of lpc2148) SONAR2_OUT P0.29 CAP0.3 SONAR3_OUT P0.28 CAP0.2 SONAR4_OUT P0.4 CAP0.1 SONAR1_EN P1.16 GPIO:output Used to start or stop the sonars from ranging. SONAR2_EN P1.17 GPIO:output High = ranging enabled SONAR3_EN P1.18 GPIO:output Low = ranging disabled SONAR4_EN P1.19 GPIO:output CAR_SERVO P0.21 PWM5 PWM output for car steering servo (50Hz, pulse width = 1us - 2us) - white wire on car connector CAR_MOTOR P0.7 PWM2 PWM output for motors (50Hz, pulse width = 1us - 2us) - red wire on car connector CAM_CS P0.20 SSEL1 SPI bus for camera communication CAM_MOSI P0.19 MOSI1 CAM_MISO P0.18 MISO1 CAM_SCK P0.17 SCK1 CAM_RESET P0.16 GPIO:tristate Connected to reset pin of camera CAM_EN P0.15 GPIO:tristate Connected to power enable pin of camera. Externally pulled up. ZIGBEE_CTS P0.11 CTS1 Zigbee debug interface - UART 115200, 81N, RTS/CTS flow control ZIGBEE_RTS P0.10 RTS1 ZIGBEE_RXD P0.9 RXD1 ZIGBEE_TXD P0.8 TXD1 GIMBAL_SERVO P0.6 GPIO:output Connected to control signal of gimbal servo (50Hz, pulse width = 1us - 2us) COMPASS_SDA P0.3 SDA0 Connected over I2C to ATMEGA168 (for compass) COMPASS_SCL P0.2 SCL0 ATMEGA_RESET P0.12 GPIO:tristate Connected to RESET pin of ATMEGA. Externally pulled high. Should be TRI-STATED when not in use. GPS_RXD P0.1 RXD0 Connected to GPS (UART 8N1 57600) GPS_TXD P0.0 TXD0 BOOTLOADER P1.26 GPIO This pin is used by the bootloader to decide whether to enter bootloader mode or not
1. Install Git and Get Source Code
git config --global user.name "Charlie Root"
git config --global user.email "you@blah.com"
ssh-keygen -t rsa
and hit 'enter' for every question it asks. You should then be able to find the “id_rsa.pub” file in the ”.ssh” folder.
git clone git@ieee.ucsd.edu:robomagellan-2011/robomagellan-2011.git
You now have the source code. Whenever you sit down to work on RM, always get the latest copy of the code by executing
git fetch origin master git merge FETCH_HEAD
As you're working, commit your changes frequently
git commit -a
To push your changes to the server so that everyone can see your changes, execute:
git push origin HEAD:master
2. Read the rules: http://www.robogames.net/rules/magellan.shtml
3. Install ARM compiler
Follow these instructions to install a compiler for the LPC2148: https://sites.google.com/a/eng.ucsd.edu/ece30/lab-1
4. Install Eagle: http://www.cadsoftusa.com/download.htm
The program must compile and run on Ubuntu linux. The code should be contained in 'rmwaypoint.c'. You can compile the code with the following command:
gcc -std=gnu99 rmwaypoint.c tinygpsc.c -o rmwaypoint
and you can run the program with
./rmwaypoint
At the beginning of the competition, we need to detach our GPS module from the robot, and plug it into a 3.3V FTDI cable connected to Alex's netbook. We then need to launch a program with the following usage:
rmwaypoint -b BAUD -t TTY
Where BAUD is a number that corresponds to the baud rate of the GPS device. If not specified on the command line, should default to 57600. TTY should be serial port to connect to, for example ”/dev/ttyUSB0”. If not specified on the command line, should default to ”/dev/ttyUSB0”.
First you should create an output file called “waypoints.txt” in write mode. If waypoints.txt already exists, then open waypoints1.txt. If waypoints1.txt already exists, open waypoints2.txt, and so on, until you find a filename that is not in use. We do not want to overwrite previous outputs from the program. You should then write the following to the file:
const waypoint waypoints[] = {
The program should then connect to the serial port using the provided parameters (or defaults if not specified), and enter a loop where it receives characters from the GPS device and parses them. For this, you can use the same code that's running on the LPC2148. Look at gps.c and tinygpsc.c.
You should then wait for the user to enter a character. If at any time the user enters EOF (by typing ctrl + d), the program should write the following to the output file and exit:
};
If the user types ENTER, your program should print the following to the console:
Is there a cone at this waypoint (Y/N):
at this point, the user will either type in Y or N and hit ENTER
Additional Notes:
at this point, the user can type any string and hit enter. This string is optional and will be included as a comment in the source code file that you generate.
You should then write out the current latitude and longitude to the output file in this format:
{DEG2RAD(latitude), DEG2RAD(longitude), cone}, // Additional Notes
Where cone is either 0 or 1 corresponding to whether the user typed 'Y' or 'N' in response to the cone question. When the program is all done, here's an example of what the output file should look like:
const waypoint waypoints[] = {
{DEG2RAD(32.88125), DEG2RAD(-117.23544), 0}, // start coordinate
{DEG2RAD(32.88428), DEG2RAD(-117.236004), 1}, // first cone coordinate
{DEG2RAD(32.88372), DEG2RAD(-117.23688), 0} // end coordinate
};
Here is the definition of the waypoint structure:
typedef struct {
double lat; // latitude (radians)
double lon; // longitude (radians)
int cone; // 0 = do not expect cone, nonzero = expect cone
} waypoint;
Powering Off