Berkeley ELENG C149 - Interfacing Sensors and Actuators with iRobot Create

Unformatted text preview:

Spring 2009 Lab 3 EECS 149 – Embedded Systems Rev. 2.04 UC Berkeley Page 1 of 9 EECS EE 149: Microcontroller Programming in C Interfacing Sensors and Actuators with iRobot Create Jeff C. Jensen & Isaac Liu December 27th, 2008 1. Objective In this lab, you will: • Become familiar with the iRobot Create and Luminary Micro controller. • Program a “bare iron” (no operating system) embedded application in C. • Interface external sensors using either polling or interrupts. • Using an embedded microcontroller, program a robot to navigate and climb a hill, avoiding obstacles along the way. 2. Equipment • Windows computer with Keil μVision 3.24 development environment installed. • iRobot Create, DB-25 connector, USB power breakout board, and charger. • Luminary Micro LM3S8962 controller, Keil ULINK2 JTAG emulator. • ADXL-322 accelerometer. • BlueSMiRF Bluetooth serial modem (optional). 3. Overview The final goal of this lab is to program the iRobot to autonomously climb a hill. Your robot must determine the correct orientation to drive towards the top of the hill, avoid driving off the hill, and navigate around obstacles that may be present along the way. The lab has been divided into three parts, completed over two weeks: 1. Automation of the iRobot; collision and cliff avoidance. 2. Interfacing of an accelerometer and orienting uphill. 3. Combining (i) and (ii), an autonomous robot that climbs a hill and avoids obstacles.Spring 2009 Lab 3 EECS 149 – Embedded Systems Rev. 2.04 UC Berkeley Page 2 of 9 EECS 3. Introduction – iRobot The iRobot Create [1] is a complete robot development kit that can be controlled without consideration of mechanical assembly or machine code. It is important to understand that you are not directly programming the iRobot, but a microcontroller which sends serial instructions to the iRobot according to iRobot’s proprietary Open Interface (OI) standard [2]. Instruction handling and actuation on the iRobot are handled by an internal processor. The iRobot OI defines the electronic and software interface for controlling the iRobot’s behavior and reading of its sensors. The software protocol is briefly explained in section 4 and 5 of [1], and a full reference is available in [2]. Make sure to read the sensor packet section of [2], found on page 17. See Figures 1, 2, and 3 for diagrams of the sensors and actuators available on the iRobot. In this lab, you will use infrared cliff sensors, mechanical bump triggers, and mechanical wheel drop triggers to detect collisions or cliffs. Once you have programmed the iRobot to avoid obstacles, you will attach an accelerometer that will enable the iRobot to orient itself with respect to gravity. The LEDs on the iRobot may be used for debugging. Figure 1. Top view of iRobot Figure 2. Bottom of the iRobot Figure 3. Buttons and lights on the iRobotSpring 2009 Lab 3 EECS 149 – Embedded Systems Rev. 2.04 UC Berkeley Page 3 of 9 EECS 4. Introduction – Luminary Micro The Luminary Micro LM3S8962 (Figure 4) is a microcontroller which can run C/C++ embedded applications; see [3] for overview, see [4] for microcontroller documentation, see [5] for programming API. The Luminary is based on an ARM Cortex-M3 microprocessor [9]. Through a serial interface, this microcontroller will transmit instructions to the iRobot and receive sensor feedback. Figure 4. Luminary Micro LM3S8962 Figure 5. Luminary Micro LM3S8962 diagram 5. Introduction – Lab Configuration The Luminary is powered from a USB interface board, which is connected to pins on the DB-25 connector of the iRobot. UART Rx/Tx lines also come from this connector, terminating at serial port 1 pins on the Luminary. The iRobot, USB interface board, and GPIO pad on the Luminary share a common ground. If you have a Bluetooth device, it should be connected to a 3.3V, 5V, or 10V source, ground, and serial port 0 on the Luminary. The RTS/CTS lines on the Bluetooth chip should be looped together. See Figure 6 for a wiring guide.Spring 2009 Lab 3 EECS 149 – Embedded Systems Rev. 2.04 UC Berkeley Page 4 of 9 EECS Luminary U1Tx / iRobot RxLuminary U1Rx / iRobot Tx+15V+15VGNDGNDGNDiRobot Create / Luminary Micro LM3S8962 / ADXL-322 / BlueSMiRFWiring GuideADC0ADC1+3.3VGNDLuminary U0Rx / BS TxRTS/CTSLuminary U0Tx / BS RxGND+3.3ViRobot Create cargo bay connectorJeff C. JensenDecember 26th, 2008Revision 1.0University of California, BerkeleyDepartment of EECS Figure 6. Lab configuration wiring guideSpring 2009 Lab 3 EECS 149 – Embedded Systems Rev. 2.04 UC Berkeley Page 5 of 9 EECS 6. Development Environment 1. Verify the connections between the iRobot and the Luminary (Figure 6). Connect the ULINK2 JTAG emulator to your computer via USB and to the Luminary with the 20-pin ribbon cable. The JTAG emulator allows you to flash and debug the Luminary. 2. Follow the step-by-step instructions in the μVision quickstart guide [6] to preview the programming environment (begin from step 4). We will be using the μVision suite of development tools to compile and download your C programs to the Luminary. The example programs mentioned in the documentation should be installed in your computer (C:\StellarisWare\boards\ek-lm3s8962); do not open the example projects in the C:\Keil folder as indicated by the quickstart guide. Try building and downloading several programs. A good starting point is the “hello” project. Note: Please do not modify the projects in the examples folder, as they are used by other labs. You may copy an example to your user (U:) drive if you wish to change it. You may need to configure μVision with the correct flashing algorithm for the Luminary. Verify the flash driver settings in the “Configure Flash Tools – Utilities” dialog match those below. Figure 7. Target driver configuration The Luminary can be programmed via USB or JTAG emulator, and μVision projects must be configured according to your configuration. If you experience difficulty programming or debugging the Luminary, follow the online ULINK2 guide [8].Spring 2009 Lab 3 EECS 149 – Embedded Systems Rev. 2.04 UC Berkeley Page 6 of 9 EECS 7. PART 1 – Autonomous iRobot (week 1) 1. Download the template μVision project [0] that has been created for this lab to your user (U:) drive. Open the project and review the code. You are given


View Full Document
Download Interfacing Sensors and Actuators with iRobot Create
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Interfacing Sensors and Actuators with iRobot Create and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Interfacing Sensors and Actuators with iRobot Create 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?