Difference between revisions of "E-puck Mobile Robot"

From Mech
Jump to navigationJump to search
Line 23: Line 23:
Since sercom.hex uses many of the features of the e-puck, it is a good place to start your in-depth exploration of programming the e-puck. Here's one thing to try: replace the main_com.c file of the sercom project with [[Media:My_main_com.c|my_main_com.c]]. This is a more concise and better documented version of the main_com.c file of the sercom project. You will either have to comment out the '''#define KML_MODIFICATIONS''' line near the beginning of the program, or follow the instructions in the comments at the beginning of the file, which ask you to modify two other files. These modifications allow you to do programmed moves of a specified distance, rather than simply choosing the velocity of the robot.
Since sercom.hex uses many of the features of the e-puck, it is a good place to start your in-depth exploration of programming the e-puck. Here's one thing to try: replace the main_com.c file of the sercom project with [[Media:My_main_com.c|my_main_com.c]]. This is a more concise and better documented version of the main_com.c file of the sercom project. You will either have to comment out the '''#define KML_MODIFICATIONS''' line near the beginning of the program, or follow the instructions in the comments at the beginning of the file, which ask you to modify two other files. These modifications allow you to do programmed moves of a specified distance, rather than simply choosing the velocity of the robot.


Now you are well on your way to good programming of the robot. Here is some other information you might find helpful in your exploration (remember, much more can be found at [http://www.e-puck.org the e-puck website]:
Now you are well on your way to good programming of the robot. Here is some other information you might find helpful in your exploration (remember, much more can be found at [http://www.e-puck.org the e-puck website]):


* A pdf [[Media:Refman.pdf|software reference manual]] created (nearly automatically) by [http://www.stack.nl/~dimitri/doxygen/ Doxygen] from the comments in the code. Warning: it's long, and not necessarily easy to use.
* A pdf [[Media:Refman.pdf|software reference manual]] created (nearly automatically) by [http://www.stack.nl/~dimitri/doxygen/ Doxygen] from the comments in the code. Warning: it's long, and not necessarily easy to use.

Revision as of 14:01, 13 November 2007

E-puck.png

The e-puck is a very capable little differential-drive mobile robot with two stepper-motor-controlled wheels, a VGA camera, a ring of IR proximity sensors, a number of LEDs, a 3-axis accelerometer, microphones, and bluetooth communication, all controlled by a 16-bit Microchip PIC (dsPIC30F6014A). We have a few of them in the mechatronics lab.

The e-puck page is http://www.e-puck.org, and it is the primary source for all updated information on the e-puck. Here we simply keep some local helpful hints on getting started with the e-puck, along with a snapshot of some of the e-puck software from November 2007. See http://www.e-puck.org for the most up-to-date information!

To get started, you need

(After you have success with the tutorial, you will soon want the libraries and more extensive demo programs from http://www.e-puck.org. A snapshot of these as of November 2007 is here, and these will be referred to below.)

Now follow the instructions on the getting started documentation. After you have installed the IDE, C compiler, and bootloader, get the tutorial working. (You may need a USB-to-bluetooth adapter and software if your PC does not have bluetooth.) Note that you may get an error due to an incorrectly named .h file! The included file should be named p30f6014a.h, not p30f6014.h.

Once you have successfully compiled and made small modifications to the tutorial, the next thing you might want to try is the e-puck monitor program, a PC executable file, which can also be found on the e-puck website. To use it, you have to write to the PIC flash the program sercom.hex, which can be found in program/advance_sercom of the demo programs. This is a graphical user interface that allows you to interact with most of the functions of the e-puck.

Once you have this working, try connecting to the e-puck (still running the sercom.hex program) using the PC's HyperTerminal program. Make sure you connect on the proper COM port, using a comm rate of 115,200 bits/sec, 8 data bits, parity none, 1 stop bit. Typing 'H' should show you a menu of options, and you again can interact with the e-puck (minus the graphical interface).

Since sercom.hex uses many of the features of the e-puck, it is a good place to start your in-depth exploration of programming the e-puck. Here's one thing to try: replace the main_com.c file of the sercom project with my_main_com.c. This is a more concise and better documented version of the main_com.c file of the sercom project. You will either have to comment out the #define KML_MODIFICATIONS line near the beginning of the program, or follow the instructions in the comments at the beginning of the file, which ask you to modify two other files. These modifications allow you to do programmed moves of a specified distance, rather than simply choosing the velocity of the robot.

Now you are well on your way to good programming of the robot. Here is some other information you might find helpful in your exploration (remember, much more can be found at the e-puck website):

Below is the dsPIC30F6014A as it is used in the e-puck. For the pins that can be configured in more than way, the configuration used by the e-puck is indicated by yellow highlighting.

PIC_in_e-puck.png