Page 1
Kilobot User manual Version 1.2 JULY 2012...
Page 2
• All efforts have been made to ensure the accuracy of the content of this manual. However, should any error be detected, please inform K-Team. • The above notwithstanding, K-Team can assume no responsibility for any error in this manual.
VERHEAD ONTROLLER ARDWARE NSTALLATION 4.2.4 ............14 ILOBOT BOOTLOADER PROGRAMMING ........................17 SAGE 4.3.1 ....... 17 ROGRAMMING A KILOBOT GROUP WITH A NEW PROGRAM 4.3.2 OHC U ......................18 4.3.3 ......................21 HARGER 4.3.4 ...................... 22 EBUGGING 4.3.5 API ....................23 ILOBOTS 4.3.6...
How to use this handbook This handbook introduces the Kilobot and its various operating modes. For a quick start, jump to chapter 4 ”USAGE”. If this handbook does not answer one of the problems you wish to solve, please consult the K-Team web site (http://www.k-team.com) and especially the Forum and the FAQs.
1. INTRODUCTION Safety precautions Here are some recommendations on how to correctly use the Kilobot: • Keep the board away from wet area. Contact with water could cause malfunction and/or breakdown. • Store your board in a stable position. This will avoid the risks of falling, which could break it or cause damage to a person.
Package Contents They are 3 different packages sold separately. They are containing the following items: • The robot package: 1 CD-ROM* 10 Kilobot robots • The overhead controller package: 1 overhead controller 1 CD-ROM* 3 cables (1 usb, a 6-wire cable and a 2–wire cable) •...
(opposite of the battery holder +/- marks). For the Overhead controller, check that the LEDS are not bended or broken. The jumper for firmware programming should be present (see figure 3.2). Kilobot User Manual...
3. DESCRIPTION DESCRIPTION Overview 3.1.1 Kilobot robot An overview of the Kilobot hardware is depicted in the Figure 3.1. The locations of various key elements are indicated for later references. ⑧ ⑧ ⑧ ⑧ ⑪ ⑪ ⑪ ⑪ ① ① ① ①...
3. DESCRIPTION 3.1.2 Overhead controller (OHC) An overview of the Kilobot Overhead controller (OHC) is depicted in the Figure 3.1. The locations of various key elements are indicated for later references. ⑧ ⑧ ⑧ ⑧ ⑧ ⑧ ⑧ ⑧ ⑧ ⑧ ⑧ ⑧...
Page 12
The distance depends on the surface used as the light intensity is used to compute the value. ○ The brightness of the ambient light shining on a Kilobot can be detected. ○ A Kilobot can sense its own battery voltage.
Page 13
3. DESCRIPTION • Light Each Kilobot has a red/green/blue (RGB) LED pointed upward, and each color has 3 levels of brightness control. • Software The Kilobot Controller software is available for controlling the controller board, sending program files to the robots and controlling them.
These files are included in the delivered from the CD_ROM: • The compiler WINAVR: software\compiler\WinAVR-20100110-install.exe • The editor AVR Studio 4: software\editor\avrstudio4.19setup.exe • Kilobot controller and programming skeleton project files (VERSION is the version of the files): software\source_code\KilobotController_VERSION.zip This archive contains: • dev/ development directory •...
Page 15
• FTDI64/ directory for 64 bit driver for USB driver • STK500/ directory for Atmel AVR Flash • Controller.hex controller normal firmware • KiloBot Controller.exe Kilobot Controller program • KilobotFirstFirmware.hex robot first firmware • Kilobot_motor_cal.hex robot calibration program • OHC_motor_cal.hex controller "motor calibration"...
3. Decompress KilobotController_VERSION.zip in c:\ 4.2.2 Overhead Controller (OHC) Software Installation 1. Open KilobotController.exe from c:\KilobotController. 2. In the Help menu of KilobotController.exe, select “Installation and programming” and follow the instructions to install the software and drivers (Fig 4.1). Kilobot User Manual...
2. Connect both USB cables to the PC, the power LED of the OHC should be green. 3. Run the KilobotController.exe program, and click the “Toggle LEDs” button to test that a connection is made (Fig 4.2). This should blink the red LEDs on the controller. Figure 4.2: OHC software buttons Kilobot User Manual...
4. USAGE 4.2.4 Kilobot bootloader programming The Kilobot is delivered with a bootloader already installed. Therefore this step can be SKIPPED. But If you would like to reinstall the bootloader or install a newer one, follow the instructions below. 1. In AVR Studio, select Tools->ProgramAVR->Autoconnect .
Page 19
5. Connect the AVRisp programmer to the robot as shown in figure 4.5. Make sure that the programmer pins do not touch the motor on the back side. Gently press the program cable to the side to ensure a good connection. Figure 4.5: communication connector Kilobot User Manual...
Page 20
7. In the Autoconnect pop-up window in AVRstudio, press program. It should take a few seconds to program the robot, and the robot may vibrate. 8. Put the firmware programming jumper of the OHC in the back to the standard position. Figure 4.6: firmware jumper: normal mode Kilobot User Manual...
6. Press the “Program Flash” button to program the OHC (a black window will pop up). 7. Place ALL Kilobot robot in PAUSE mode (LED flashing yellow) underneath the OHC, and press the “Bootload” button in KilobotController.exe. The Kilobot will first quickly flash red->green->blue, to indicate it is now in the PROGRAMMING mode.
The overhead controller should be hung above the Kilobots at a distance of about one meter. The robots beneath the OHC in a about a one meter diameter region will be able to receive communication from the OHC as shown in figure 4.8. Figure 4.8: System setup Kilobot User Manual...
Page 23
Overhead Controller (OHC) Interface Overview Figure 4.9: Programming Panel 1. Program file: browse for the compiled Kilobot user program [.hex] file to be sent to the Kilobots (usually in c:\KilobotController\dev\default). 2. Program Flash: send the program and controller files to the OHC.
Page 24
4. USAGE Figure 4.11: Button Panel 1. Bootload: transmit the kilobot user program from the OHC to the Kilobots, which takes about 30 seconds. Ensure all robots are in pause mode before bootloading. 2. Sleep: put Kilobots in low-power SLEEP mode. They will wake up briefly every 60 seconds to check if a wakeup message is being sent.
5. With the Kilobot Controller, push the Charge button. The robot will stop the current program and enter in charge mode indicated by a blinking red. If the charge is done, the RGB led will turn off.
Figure 4.13 Debug settings 1. Install Realterm, a terminal that can use alternate baud rates. 2. Launch your program with the “Run” button of the Kilobot Controller. 3. Close the Kilobot Controller if it is open. 4. Find the USB serial port number used by the OHC in the Device Manager of your computer.
Set LED color, values can be from 0(off)-3(brightest) Example: set_color(1,1,1); • kprinti(int) Print integer over serial port - be careful can effect timing! Example: kprinti(12); • kprints(string) Print string up to 10 characters - be careful, can effect timing! Kilobot User Manual...
Page 28
Measure if battery is charging, returns 0 if no, 1 if yes Example: if(measure_charge_status()) charging = TRUE; else charging = FALSE; • measure_voltage() Measure battery voltage, returns voltage in .01 volt units for example if 394 is returned, then the voltage is 3.94 volts Example: current_voltage = measure_voltage(); Kilobot User Manual...
Page 29
• get_ambient_light() Returns the value of ambient light note: will return -1 if there is an incoming message (which also uses a/d) note: turns off interrupts for a short while to sample a/d Example: local_brightness = get_ambient_light(); Kilobot User Manual...
3. In the OHC software, select the “Motor calibration” sub-menu of the advanced menu. Figure 4.14: Advanced menu 4. Place the Kilobot under the OHC, and push the button "More cw" or "Less cw" to adjust the calibration of the clock wise rotation for the robot.
Page 31
8. When done, be sure to load Controller.hex back into the OHC with the Advanced menu “Select alternative controller file”. 9. Push wake-up button on the OHC. 10. Program the robot with the KilobotFirstFirmware.hex or your program. 11. You can switch off the robot now or put it in sleep mode. Kilobot User Manual...
"); _delay_ms(10);//wait 10 ms set_color(0,0,0);//turn RGB LED off 5.1.2 Non-blocking timed movement: … static int mode=0;//mode represents state if(clock<40000) //clockwise rotation if(mode!=0) Kilobot User Manual...
Page 33
_delay_ms(30); set_motor(cw_in_straight, ccw_in_straight);//set both motor to calibrated value for good forward movement mode=2; else if(clock<160000) if(mode!=3) set_motor(0x00,0x00);//turn off motors mode=3; else if(clock<200000) mode=5; clock=0;//reset clock to start cycle over agian Kilobot User Manual...
//stop motors //every 2000 counts of clock, check to see if i've seen any neighbors //if i have, there is a 20% chance i will change my movement (such as straight to ccw) if(clock>2000) Kilobot User Manual...
Page 35
//if i have not received a message from a neighbor in the last 2000 counts of clock //stop moving, and turn my RGB led off set_color(0,0,0); start_move=0; clock=0;//reset clock neighbor=0;//reset neighbor count Kilobot User Manual...
6. WARRANTY WARRANTY K-TEAM warrants that the Kilobot is free from defects in materials and workmanship and in conformity with the respective specifications of the product for the minimal legal duration, respectively one year from the date of delivery. Upon discovery of a defect in materials, workmanship or failure to meet the...
Page 37
It is likely that the contents of Customer's flash memory will be lost or reformatted in the course of the service and K-TEAM will not be responsible for any damage to or loss of any programs, data or other information stored on any media or any part of the Product...
Page 38
6. WARRANTY K-TEAM EXPRESSLY DISCLAIMS ALL OTHER WARRANTIES THAN STATED HEREINBEFORE, EXPRESSED OR IMPLIED, INCLUDING WITHOUT LIMITATION IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE TO THE FULLEST EXTENT PERMITTED BY LAW. Limitation of Liability: IN NO EVENT SHALL EITHER PARTY BE LIABLE TO...
Need help?
Do you have a question about the Kilobot and is the answer not in the manual?
Questions and answers