Tanjir's IBlog » Page 'Tutorial: Beginning with 3Pi Robot'

Tutorial: Beginning with 3Pi Robot

3Pi is a mobile robot which is famous for maze solving related problems. In this tutorial, I have assumed, the user is using following hardware:

This article contains presentation, necessary windows softwares, and resources (including Linux installation).

The presentation can be found here: Introduction_to_RoboticsTutorial_3Pi

Necessary softwares for Windows XP can be found here.

Some notes about USBTinyISP Programmer:

To save battery, you can use this programmer to power your robot using USB drive. It can give upto 5V. The power mode is only ON when the jumper is connected on the side which goes to the robot (That is set by default). To program, the 6 pin connector (there are 2 connectors in the programmer) goes to the robot (that is beside the LCD screen). The second connector is not used.

Some resources:

3pi User Manual

Original article which helped me

$70 3Pi from Makershed

Canadian store

Linux installation of 3Pi

Linux installation of Atmel Pololu Guide

Linux installation of USBTinyISP: Driver , Solution of header file problem

You can post questions in the comment section, or you can contact me personally through “Contact” tab.

  • Slashdot
  • Digg
  • Diglog
  • Reddit
  • Delicious
  • Google Bookmarks
  • Facebook
  • Faves
  • Share/Bookmark

11 comments to “Tutorial: Beginning with 3Pi Robot”

  1. Hey this helped out but there are different drivers and sofwares from the link here than the one on your tanjir.net/upload/3pi.sip link.

    Do we need both?

  2. I have mentioned to install Pololu USB Driver, can be found inside “win_cp2102_drivers.zip” and USBTinyISP, which can be found inside usbtinyisp w32 driver “v1.12.zip”. You need to install both.

  3. Hey I tried doing the linefollower under examples in libpololu-avr-091201 and in atmega328p however I ran into a few problems.

    1) there are 2 linefollowers, one is “linefollower” and the other is “linefollower-pid” is there a difference between them?

    2) when I choose one of them, I try to build but it says “Build failed with 6 errors and 19 warnings…”

    3)After I connect the opposite port that I have chosen, I get all OK! but what do you mean
    Select the hex file
    Select the elf file ????
    Program

    Please reply to efares@connect.carleton.ca

    Thank you

  4. Fares,
    1) linefollower-pid is based on pid algorithm, where linefollower is based on a simple algorithm. If you open the .c files, they are mentioned in the first line of the comment. One good way of understanding code is by reading the comments before reading the code. A lot of information on PID based algorithm can be found here: http://www.straightlinecontrol.com/pid_algorithms.html

    2) On my end build does not fail. Could you tell me what are the error messages you are getting? (Before that, did you copy the .a files in the right directory?)

    3) Once you get all OK, in AVR Studio, you need to build the program you want to run (in the given example we already built- for your case probably it failed). If build is successful, it will generate hex and elf files. In order to program the robot, you need to go to Tools menu-> Program AVR -> Connect. Once connects, cancel the upgrade, go to program tab. Then you need to select the .hex file from the “default” directory/folder inside that project. You can find the .elf files in the same folder. (Typically test.hex and test.elf files.)
    More about elf files: http://www.ibm.com/developerworks/power/library/pa-spec12/

  5. GREAT!!!!!

    Thanks it works fine now, I do remember copying the .a files in the right directory but when I went to check, they we’re there.

    So I copied them and it follows the line properly now,

    Thanks a lot for the quick reply.

  6. Just one more thing, what’s the difference between the .hex file and the .elf file? (test.hex and test.elf files.) I can only program one of them onto the robot at a time, do they both essentially do the same thing?

  7. I tryed to program the .hex to the 3pi and then tryed to program the .elf file , after waited until everything is done and after that i got Black squares all over the LCD , I wasn’t even able to test it . is there a way to reset the FLASH or the program on the 3pi ?
    Like any manual reset, because my laptop won’t recognize it anymore :s on any COM port …

    Thanks,
    Antoine Awad

  8. @Fares and @Awad, .elf file is not required. Once you program it with .hex file it should work. They are just different way of programming the robot. As I mentioned in my talk, which language you are using is not important, important is that hex file. Cause everything eventually converts to binary, and hex is the easier way to go.

    @Awad, you should not try any COM port, but only the ones you have used. For example, if you have used port 2 and port 6, then you have to use the alternative ports in two different software. Try restarting the laptop.

  9. I did restart my laptop . I ran the com0com .

    1 – Install PortName=COM1 PortName=COM2
    2 – I ran USBTINYISP -> it’s using COM2 -> and says READY
    3 – AVR Studio is setup on COM1

    Now i try to read the signature it read signature successfully .
    but on the LCD i am always seeing on the TOP LINE : BLACK SQUARES

    no matter what i do . Is it possible to send me a working .hex file so i can load it and try it ?

    because i tryed loading other .hex files , for example the LV_xx8 demo program or the mazesolver or the 3pi_demo_program and the screen stay black.

    any idea why ? i don’t even see the original demo program.

  10. Awad@ When you program, if you see red light is on in the programmer, then it is writing to the robot microcontroller. You have mentioned about the screen. Does it do anything at all? (blinking light or any sound or motor movement?) If not, then probably it is not on or the battery is not connected properly.
    Try this: remove the batteries. Connect the robot to the programmer and program it the way you are currently doing. (try line follower or push button program) And without removing the connection, you should be able to see something on the screen.

  11. The screen doesn’t do anything even when the batteries are not installed, it is always showing me the BLACK SQUARES on the TOP LINE.

    And when I try to write a .hex file to it , the red and green lights are ON .
    Which mean that it is writing properly .

    Is it possible to pass by and show it to you sometime ?

Leave a comment

XHTML - You can use:<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

© 2008 Tanjir's IBlog is powered by WordPress