Lab 8: Introduction to the e-puck Robot

Similar documents
1 Lab + Hwk 4: Introduction to the e-puck Robot

Lab 7: Introduction to Webots and Sensor Modeling

EE-110 Introduction to Engineering & Laboratory Experience Saeid Rahimi, Ph.D. Labs Introduction to Arduino

Lab 1: Testing and Measurement on the r-one

Practical Assignment 1: Arduino interface with Simulink

FLIR Tools for PC 7/21/2016

CURIE Academy, Summer 2014 Lab 2: Computer Engineering Software Perspective Sign-Off Sheet

Note: Objective: Prelab: ME 5286 Robotics Labs Lab 1: Hello World Duration: 1 Week

Getting Started with the micro:bit

Mindstorms NXT. mindstorms.lego.com

Note: Objective: Prelab: ME 5286 Robotics Labs Lab 1: Hello Cobot World Duration: 2 Weeks (1/22/2018 2/02/2018)

OzE Field Modules. OzE School. Quick reference pages OzE Main Opening Screen OzE Process Data OzE Order Entry OzE Preview School Promotion Checklist

Signals, Instruments, and Systems W7. Embedded Systems General Concepts and

GE423 Laboratory Assignment 6 Robot Sensors and Wall-Following

Exercise 1. Milling a Part with the Lab-Volt CNC Mill EXERCISE OBJECTIVE

Studuino Icon Programming Environment Guide

Lab 3 Swinging pendulum experiment

EE443L Lab 8: Ball & Beam Control Experiment

On the front of the board there are a number of components that are pretty visible right off the bat!

UCL Micro:bit Robotics Documentation

Instructions for getting connected with Incus and using IHearYou

Sensor Calibration Lab

1. ASSEMBLING THE PCB 2. FLASH THE ZIP LEDs 3. BUILDING THE WHEELS

due Thursday 10/14 at 11pm (Part 1 appears in a separate document. Both parts have the same submission deadline.)

Congratulations on your decision to purchase the Triquetra Auto Zero Touch Plate for All Three Axis.

A Day in the Life CTE Enrichment Grades 3-5 mblock Robotics - Simple Programs

iphoto Getting Started Get to know iphoto and learn how to import and organize your photos, and create a photo slideshow and book.

Boe-Bot robot manual

Experiment 4.B. Position Control. ECEN 2270 Electronics Design Laboratory 1

Exercise 2. Point-to-Point Programs EXERCISE OBJECTIVE

AutoCAD LT 2012 Tutorial. Randy H. Shih Oregon Institute of Technology SDC PUBLICATIONS. Schroff Development Corporation

2809 CAD TRAINING: Part 1 Sketching and Making 3D Parts. Contents

Introduction to: Microsoft Photo Story 3. for Windows. Brevard County, Florida

Conversational CAM Manual

USB Line Camera 8M. Coptonix GmbH

1 Placing particles on the slide

Momo Software Context Aware User Interface Application USER MANUAL. Burak Kerim AKKUŞ Ender BULUT Hüseyin Can DOĞAN

This manual describes the Motion Sensor hardware and the locally written software that interfaces to it.

Quick Start Training Guide

Training Schedule. Robotic System Design using Arduino Platform

Welcome 1. Precaution

MicroLab 500-series Getting Started

QUICK SETUP GUIDE: Firewire/mLAN MACINTOSH OSX Cubase AI4 / Studio Manager / Motif XS Editor / Mac OSX

Lab book. Exploring Robotics (CORC3303)

Mini Turty II Robot Getting Started V1.0

ARDUINO BASED CALIBRATION OF AN INERTIAL SENSOR IN VIEW OF A GNSS/IMU INTEGRATION

Introduction to R Software Prof. Shalabh Department of Mathematics and Statistics Indian Institute of Technology, Kanpur

Some prior experience with building programs in Scratch is assumed. You can find some introductory materials here:

Checking your technology

Developing Applications for the ROBOBO! robot

EE 210 Lab Exercise #3 Introduction to PSPICE

Introduction to NeuroScript MovAlyzeR Handwriting Movement Software (Draft 14 August 2015)

ECE 497 Introduction to Mobile Robotics Spring 09-10

Overview... 3 Starting the Software... 3 Adding Your Profile... 3 Updating your Profile... 4

The ideal K-12 science microscope solution. User Guide. for use with the Nova5000

AN ARDUINO CONTROLLED CHAOTIC PENDULUM FOR A REMOTE PHYSICS LABORATORY

Stratix II Filtering Lab

An Introduction to Programming using the NXT Robot:

Speed Feedback and Current Control in PWM DC Motor Drives

AutoCAD LT 2009 Tutorial

AutoCAD Tutorial First Level. 2D Fundamentals. Randy H. Shih SDC. Better Textbooks. Lower Prices.

SDC. AutoCAD LT 2007 Tutorial. Randy H. Shih. Schroff Development Corporation Oregon Institute of Technology

Chapter 14. using data wires

OTHER RECORDING FUNCTIONS

Blue Bamboo P25 Device Manager Guide

Part 1. Tracing the Dimensions of Some Common Pixel Sizes using a GPS Receiver

Digital Portable Overhead Document Camera LV-1010

Note: Objective: Prelab: ME 5286 Robotics Labs Lab 1: Hello Cobot World Duration: 2 Weeks (1/28/2019 2/08/2019)

Mechatronics Laboratory Assignment 3 Introduction to I/O with the F28335 Motor Control Processor

MASSACHUSETTS INSTITUTE OF TECHNOLOGY /6.071 Introduction to Electronics, Signals and Measurement Spring 2006

Apple Photos Quick Start Guide

The Khepera Robot and the krobot Class: A Platform for Introducing Robotics in the Undergraduate Curriculum i

Nebraska 4-H Robotics and GPS/GIS and SPIRIT Robotics Projects

Meet Cue. USER PROGRAMMABLE LEDS & BUTTONS Customizes your experience.

Where C= circumference, π = 3.14, and D = diameter EV3 Distance. Developed by Joanna M. Skluzacek Wisconsin 4-H 2016 Page 1

EGG 101L INTRODUCTION TO ENGINEERING EXPERIENCE

Autonomous Robot Control Circuit

OZOBOT BASIC TRAINING LESSON 1 WHAT IS OZOBOT?

Photoshop Exercise 2 Developing X

Faculty Lecture Capture Guide

4.5.1 Mirroring Gain/Offset Registers GPIO CMV Snapshot Control... 14

Progeny Imaging. User Guide V x and Higher. Part Number: ECN: P1808 REV. F

with MultiMedia CD Randy H. Shih Jack Zecher SDC PUBLICATIONS Schroff Development Corporation

Internet of Things Student STEM Project Jackson High School. Lesson 2: Arduino and LED

Zybo Z7 Pcam 5C Demo

For customers in USA This device complies with Part 15 of the FCC rules. Operation is subject to the following two conditions:

OTHER RECORDING FUNCTIONS

Agent-based/Robotics Programming Lab II

Instrumentation and Microcontrollers Using Automatic Code Generation

PHYSICS 220 LAB #1: ONE-DIMENSIONAL MOTION

Arduino STEAM Academy Arduino STEM Academy Art without Engineering is dreaming. Engineering without Art is calculating. - Steven K.

ET 304A Laboratory Tutorial-Circuitmaker For Transient and Frequency Analysis

TETRIX PULSE Workshop Guide

OzE Field Modules. OzE Studio Series. OzE Studio OzE Studio Lite. Quick reference pages OzE Studio Data Entry (2pgs) OzE Preview.

UNIT 4 VOCABULARY SKILLS WORK FUNCTIONS QUIZ. A detailed explanation about Arduino. What is Arduino? Listening

Experiment 1 Introduction to Simulink

Preliminary Design Report. Project Title: Search and Destroy

Introduction to Simulink Assignment Companion Document

Horiba LabRAM ARAMIS Raman Spectrometer Revision /28/2016 Page 1 of 11. Horiba Jobin-Yvon LabRAM Aramis - Raman Spectrometer

Application Note. Communication between arduino and IMU Software capturing the data

Transcription:

Lab 8: Introduction to the e-puck Robot This laboratory requires the following equipment: C development tools (gcc, make, etc.) C30 programming tools for the e-puck robot The development tree which is a set of files required by the C30 compiler One e-puck robot, one Bluetooth USB dongle (eventually, a spare battery) The document Introduction to the e-puck robot The laboratory duration is approximately 3 hours. Although this laboratory is not graded, we encourage you to take your own personal notes as the final verification test might leverage results acquired during the laboratory session. For any questions, please contact us at sis-ta@groupes.epfl.ch. 1.1 Information In this assignment, you will find several exercises and questions. The notation S x means that the question can be solved using only additional simulation. The notation Q x means that the question can be answered theoretically, without any simulation. The notation I x means that the problem has to be solved by implementing some code and performing a simulation. The notation B x means that the question is optional and should be answered if you have enough time at your disposal. 1.2 The e-puck The e-puck is a miniature mobile robot developed to perform desktop experiments for educational purposes. Figure 1 shows a close-up of the e-puck robot. More information about the e-puck project is available at http://www.e-puck.org/. Figure 1: Close-up of an e-puck robot. The e-puck's most distinguishing characteristic is its small size (7 cm in diameter). Other basic features are: significant processing power (dspic 30F6014 from Microchip running at 30 MHz), programmable using the standard make compilation tools, energetic autonomy of about 2-3 hours of intensive use (with no additional modules), an extension bus, a belt of eight light and proximity sensors, a 3- JNP, Lab 8: Introduction to the e-puck Robot 1

axis accelerometer, three microphones, a speaker, a color camera with a resolution of 640x480 pixels, 8 red LEDs placed around the robot and a bluetooth interface to communicate with a host computer. The wheels are controlled by two miniature stepper motors, and can rotate in both directions. Figure 2 presents the location of the components, referred above, in the robot itself. Figure 2: Review of the e-puck components. The simple geometrical shape along with the positioning of the motors allows the e-puck to negotiate any kind of obstacle or corner. Modularity is another characteristic of the e-puck robot. Each robot can be extended by adding a variety of modules. In this lab we further explore the capabilities of the e-puck hardware platform. 1.3 Getting Started (Short reminder) To start with this lab, you will need to download the material available on Moodle. Download lab08.tar.gz in your personal directory. Now, extract the lab archive (you can type: tar xvfz lab08.tar.gz.) 1.4 Controlling the e-puck robot In this lab, we will control the e-puck robot by running a program in the robot. This is done by cross-compiling a program for the e-puck on your computer, then creating a connection between your computer and the robot, and finally uploading the program onto the robot s FLASH memory. The executable (a.hex file) runs directly on the e-puck. The procedure to do this will be explained in detail in the following paragraphs. JNP, Lab 8: Introduction to the e-puck Robot 2

2 Getting familiar with the e-puck 2.1 Preparing software and hardware Before starting the lab, we need to set up the experimentation environment. Follow the instructions below to prepare hardware and software. 2.1.1 Preparing the software You will need to download the e-puck development environment onto your computer. Copy these files in your home directory by doing the following: a) First, go to a directory where you will place the e-puck related files. (example: /home/user/myfiles) b) When in this directory, download (checkout) the necessary files from the e- puck git repository by typing the following (on one line): > git clone https://disalgit.epfl.ch/epuck/epuck.git You will be asked to accept the certificate permanently (option p). The download might take a few seconds. c) Inside the EpuckDevelopmentTree/ directory, you will find a library/ and program/ directory. In order to use the e-puck library code you just downloaded, it must be compiled. Do this by going to the library/ directory and executing make: > cd EpuckDevelopmentTree/library > make Your e-puck development environment is now ready. 2.1.2 Preparing the hardware Prepare your hardware setup now: 1. Plug in the Bluetooth USB dongle to your desktop computer. 2. Place the battery in the robot. 3. Switch the robot on. 4. Check your robot number written on a sticker at the front of the robot. My robot number is: In the remainder of this lab, we assume that you robot ID is 999. Make sure to replace 999 with the number of your robot. 2.2 Basic sensor tests We ll start with some questions which should allow you to get a feeling of working with real hardware in general, and the e-puck in particular. To do this, you will upload the sercom program onto the e-puck, and run the minicom program on your computer. Minicom is a small terminal program to communicate with a device over a serial link. Since the e-puck Bluetooth protocol emulates a serial link, we can use this program to chat with the e-puck. JNP, Lab 8: Introduction to the e-puck Robot 3

First, create a connection to your robot: > epuckconnect 999 You might be prompted with a passkey dialog interface at the top of your screen: enter the 4-digit robot ID (ex: 0999). Now navigate the directory lab08/ and upload sercom.hex onto the robot: > epuckupload -f sercom.hex 999 As soon as dots appear on your screen ($...) press the blue reset button on the robot. This will start writing the program to the e-puck memory. Now stars will appear on your screen, indicating that the robot is being programmed (...** **************). When no more stars appear, the robot has finished programming. You will see the following message in your terminal: [/dev/rfcomm999] Transmission of sercom.hex complete! Now establish a communication channel with your e-puck. Launch minicom by entering: > epuckconnect 999 ; minicom Now press the reset button on the robot. Your terminal should display: WELCOME to the SerCom protocol on e-puck the education robot type H for help With Ctrl-A Z (hold the Ctrl key while typing A, then release the Ctrl key and type Z) you get to the main menu of minicom. Configure your terminal to have a local echo (type E). S 0 : Enter H <Enter> in your minicom terminal. Your robot will answer with all the commands it understands through the serial line. Most smartphones can detect their orientation by means of an accelerometer. The e-puck has such an accelerometer as well, allowing to measure acceleration (and therefore forces) in all three dimensions. For each dimension, you get a value between 0 and 4096. If no force is present along an axis, the corresponding value is roughly 2000 2300 (the exact center value depends on the e-puck). Q 1 : Q 2 : Put the e-puck on your desk and press A <Enter>. Then turn your e-puck on one side and measure the acceleration again. Why is one value out of the 2000 2300 range? Explain how the iphone is able to detect its orientation. What would you measure if the e-puck was in free fall (whatever the experiments you do, please DON T drop the e-puck on the table). You can now quit minicom by typing Ctrl-A X. JNP, Lab 8: Introduction to the e-puck Robot 4

2.3 Using the e-puck s IR sensors In the last lab you used the proximity and light sensors of a virtual e-puck to sense the proximity to nearby objects, or as a way to detect light. In this lab we test the same sensing capabilities in the real robot, leveraging its IR sensors. 2.3.1 Proximity sensors In this part we will use the IR sensors as proximity sensors. Recall the sensor disposition in the robot, described in the last lab. I 3 : The code is in e-puck_proximity folder. The program gathers and transmits data from the proximity sensors. To compile the program, go to the directory and change the EPUCKLIBROOT variable in the Makefile to the EpuckDevelopementTree/library directory of your installation: (ex.: EPUCKLIBROOT = /home/user/mydocs/epuck/epuckdevelopmenttree/librar y) Now you can compile your code by typing make. After that you can transfer the generated hex file (e-puck_proximity.hex) to the e-puck as done above. Start a minicom terminal and observe the readings. Why do they change over time? Can you relate to the previous lab? Q 4 : Q 5 : Similarly to the previous lab, move an object around the e-puck (ex: hand), and draw the response of the proximity sensor as a function of the distance to an obstacle. How does it compare with the simulated sensor of the last lab? Now repeat question Q 4 but with different objects (sheet of paper, pencil, hand, etc.) Explain why the values acquired for the same distances differ. Quit minicom by typing Ctrl-A X. 2.3.2 Light sensors In this part we will use the IR sensors as light sensors. In the following exercise, you will use your e-puck to collect light intensity readings in different lighting conditions, and display them in MATLAB. I 6 : The code is in /e-puck_light folder. The program gathers and transmits data from the IR receiver of the front right IR sensor (IR0). Compile and flash the program (e-puck_light.hex) to the e-puck, as explained above. Don t forget to add the path to the EpuckDevelopmentTree/library in the Makefile before compiling. Start collecting data by typing in the terminal: cat /dev/rfcomm999 tee robot_data.txt JNP, Lab 8: Introduction to the e-puck Robot 5

Cover and uncover this sensor with your hand and observe the changes in the value. Then point the sensor to an illuminated place (ex: window) and then to a dark place (ex: under the table). Again observe the changes in the value. Compare the variations happening in both situations and explain what you observe. Stop the data collection by typing into your terminal Ctrl-C. Q 7 : Q 8 : Q 9 : Similar to the previous lab, the light sensor readings are being written to a text file(robot_data.txt). Open Matlab, and plot the recorded values by typing: load robot_data.txt plot(robot_data); Can you explain the graph based on the light sensor readings you saw previously in the robot window? You will now need to use the IR0 sensor to produce a signal to be analyzed. Start recording sensor data as above. Cover and uncover the sensor with your finger during 1 second intervals (cover during 1 second, uncover during 1 second, cover during 1 second,, repeat this procedure some times). Plot the signal in Matlab. What type of signal is this? At which frequencies do you expect to see peaks if you plot this signal in frequency domain? Now open Matlab, set the current directory to lab_08, then run the ReconstructionEPuck.m file. As in the previous lab, this script loads the signal sampled with the e-puck, performs a linear interpolation and computes the FFT of the interpolated signal. Take a look at the FFT. Are the frequency peaks at the values you expected? In this script is the variable sampling_frequency well set? Roughly estimate from your signal its correct value and update it. Run the script again and see if the FFT now corresponds to what you expect. 3 Control a mobile E-puck 3.1 Motor control The e-puck is a so-called differential drive robot which means that just by setting the appropriate speed to the individual motors, the robot can move forward, backward, and even turn on the spot. The commands to set the speed for the motors are: > e_set_speed_left(left_speed) and: > e_set_speed_right(right_speed) The possible values for left_speed and right_speed are between -1000 (full reverse) and 1000 (full forward). Go to the directory /epuck_mobile and open the file epuck_mobile.c in your favorite text editor. Search the lines 62 and 63. I 10 : Modify the values for the wheel speeds to make the robot 1. go forward in a straight line at a medium speed JNP, Lab 8: Introduction to the e-puck Robot 6

2. go backward in a straight line at a medium speed 3. turn on the spot clockwise and counter-clockwise 4. go in a circle For each situation, compile and flash the program to the e-puck, as explained above. Don t forget to add the path to the EpuckDevelopmentTree/library in the Makefile before compiling. Run and test your program. 3.2 Obstacle avoidance In the previous lab, we introduced the Braitenberg robot controller. In this section, you will run the same controller on the e-puck itself. Observe the structure of the controller in epuck_mobile.c, starting in line 65 (you will find almost the same structure of the last lab) I 11 : Change the operation_mode variable, in line 25, to OBSTACLE_AVOIDANCE. Compile and flash the program to the e-puck, as explained above. Run your e-puck. Use some obstacles (ex: you can use your hands) and see if the e-puck can avoid them. I 12 : Now change Braitenberg parameters in order to make the e-puck to be very reactive in one of the sides, but slow in the other. Compile and flash the program to the e-puck, as explained above. There are also other ways of programming an obstacle avoidance controller. Here below we explore a simple rule-based (i.e. if condition_k satisfied, then do action_k ) obstacle avoidance algorithm. I 13 : Change the code, in the indicated place in the c-file, with a simple rule-based obstacle avoidance algorithm based on the values of the proximity sensors. Once you have finished programming, compile and upload and test your program. JNP, Lab 8: Introduction to the e-puck Robot 7