Home

Khepera IV User Manual - K

image

Contents

1. 1 bin sh ifconfig wlan2 up ifconfig wlan2 YOUR_IP_ADDRESS route add default gw YOUR_GATEWAY wlan2 wpa_supplicant c etc wpa_supplicant wpa_supplicant conf i wlan2 Dwext B e reboot the system or restart the network with the following command etc init d networking restart 9 2 5 Transferring files using scp e Establish a network connection between the computer and the robot either with WiFi e Execute the following command scp FILE root KHEPERA4 IP home root where FILE is the file to transfer KHEPERA4 IP isthe robot IP address Press the Return key when a password is asked On Windows you can use WinSCP http www winscp net 9 2 6 Remote access You can have remote access to the robot console while using WiFi e Establish a connection between the robot and the computer with one of the connections WiFi method described in the chapters above e In a console of the computer launch the ssh command where KHEPERA4 IP ADDRESS is the network address of your robot ssh root KHEPERA4 IP ADDRESS e Accept the host authenticity by answering yes in pushing Return key gt root khepera4 appears you are logged in Khepera IV User Manual ver 1 1 70 9 2 7 NFS configuration The first service to set up should be transparent file sharing using NFS Most Linux distributions include NFS support by default and the robot system is ready to be connected The
2. K FIEPEREL LAIN User manual TN O Revision 1 1 Revisions history Rev Date Description EUR 1 0 14 03 2014 Initial creation 1 1 30 01 2015 Minor corrections Documentation Authors Julien Tharin Fr d ric Lambercy and Timoth e Carron K Team S A Z I Les Plans Praz 28 CH 1337 Vallorbe Switzerland E mail info k team com URL www k team com Trademark Acknowledgements IBM PC International Business Machines Corp Macintosh Apple Corp SUN Sparc SUN Microsystems Corp Station LabVIEW National Instruments Corp Matlab MathWorks Corp Khepera K Team and LAMI Legal Notice e The content of this manual is subject to change without notice e 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 e The above notwithstanding K Team can assume no responsibility for any error in this manual TABLE OF CONTENTS 1 INTRODUCTIO N E 1 1 1 How to use this user manual sese eese enne nn nnn nnne 1 1 2 Safety Drecautiolis uiii de e o o E COO o b d cd o d E FEE ERE FEE 2 1 3 Recycling use KEEN KEEN KKK REENEN RE ENRKE RRE ENEE EEN naa neu a uana unu nn una 2 2 UNPACKING AND INSPECTION ne KR REENEN KKK enne 3 2 1 Package Content sek KREE RKK NEE KREE EER KEEN E KREE ER EEN nnn n 3 3 THE ROBOT AND ITS ACCESSORIE
3. C C application enter Debug test e On Connection press New button and choose SSH In the next window in Host name insert the IP address of your robot and press Finish button e On Remote Absolute File Path for C C Application modify to home root test Khepera IV User Manual ver 1 1 43 e In the Debugger tab in Main tab change GDB Debugger to usr local khepera4 oetools tmp sysroots i686 linux usr armv7a bin arm angstrom linux gnueabi gdb On Shared Libraries tab add usr local khepera4 oetools tmp sysroots armv7a angstrom linux gnueabi lib e Then press Debug enter root as User ID and no password e Debug step by step You can go again into the settings and select Release configuration when your program has been fully debugged You can run the program from the robot with a remote terminal or with Eclipse GUI After having set the Debug configuration the parameters are also available for the run Just go to the Run menu and then choose Run In the lower part of the Eclipse window you will see the output of your program in the Console tab Khepera IV User Manual ver 1 1 44 5 3 Full toolchain and sources The full toolchain is for advanced users who would like to modify the kernel rebuild the image system or develop new packages for the robot Remarks 5 3 1 Prior knowledge of Linux its kernel and Open Embedded tools is highly recommended Required software Requi
4. Pin out of the contact pads COIN OY U1 S3 C NJ The internal battery can be used to power external devices Signal is 9V out present on pads number 1 and 8 As this is a power output this signal is controlled by a reed relay to avoid any short circuit In order to be able to draw current from the battery you first need to activate the relay with a magnet Please refer to the drawing for the exact location of the relay Max current is 1 5A but this value depends on operating current of the robot Voltage is accordingly to the battery state minus voltage drop of one Schottky diode and the Rdson of two MOS P transistors The internal battery can be charged from a docking station Signal is 9V in present on pads number 2 and 7 Never apply more than 9 5VDC at these 2 contacts Khepera IV User Manual ver 1 1 19 Communication with the outside is done via IC Clock signal is on pad 3 while data signal is on pad 6 Level is O to 3 3V Use level adapter if needed Ground signal is present on pins 4 and 5 The signals are routed in a symmetrical way so that if the robot is in the wrong direction on the docking no damage occurs 4 4 1 Reed relay location Figure 13 Reed relay location Here above is represented the location of the reed relay Unit is mm The coordinates are about the center of the relay Please note that it is mandatory to add an offset of 5mm left or right on the positi
5. and settings saved 1 Run the following command in the console halt 2 Wait 15s if you are logged through the USB cable you wait until System halted appears Then you can switch off the robot Reboot If you want to reboot you can use reboot Reset The robot reset can be triggered by pressing the reset button see Figure 3 2 You may need to use the reset while the software is blocked and you cannot access anymore by another connection with ssh for killing the annoying process or doing a soft reboot Khepera IV User Manual ver 1 1 3 4 The Khepera IV Robot 3 4 1 Caster wheels There are two caster wheels below the robot These two wheels enable the robot to be very stable even with high payload or with long cantilever extension modules In return the robot is not able to go through door sills 3 4 2 On Off switch This switch will have an action on the internal regulators of the robot and not on the battery meaning that you can charge it even if it is off To turn the robot on put the switch on the inside To turn it off put the switch on the outside 3 4 3 Status LED By default this bicolor indication LED lets you know the state of the robot When you turn it on the green LED will stay on and the red light will blink until the system is ready This LED is user controllable 3 4 4 Mini USB B connector device This connector lets you open a communication link between the robot and a computer It i
6. command F motor left motor right dJ Format of the response f r n Effect Set the position goal in encoder values The controller will use the PID and profile to reach the goal See chapter 4 14 3 Position controlSpeed control for details of the unit G Get US values Format of the command Go Format of the response g 0 25 83 70 1000 r n Effect Get the values of the Ultrasonic values 1000 means nothing detected in range 0 means something under 25cm between 25 and 250 means the distance of an object in cm H Configure PID Format of the command H P I D l Format of the response h r n Effect Set the Proportional Integral and Derivative of the PID controller Example H 10 5 14 Khepera IV User Manual ver 1 1 54 I Reset encoders Format of the command I A Format of the response i r n Effect Reset the values of the motors encoders J Configure the speed profile Format of the command J acc inc acc div min speed acc min speed dec max speed J Format of the response j r n Effect Configure the speed profile See chapter 4 14 2 Speed profile control for details K Set the RGB leds Format of the command K lr lg lb rr rg rb br bg bb 4 Format of the response k r n Effect Set the 3 color leds Values are in range 0 63 First letter is the position I left r right and b back Second letter is the color r red g green b blue Example K 63 0 0 0 63 0 0
7. default parameters Acc Inc 3 Acc Div 0 Min Speed 20 200 150 100 Speed unit 50 4 0 0 0 0 1 0 2 0 3 0 4 0 5 0 6 0 7 0 8 0 9 1 0 1 1 1 2 1 3 1 4 1 5 1 6 1 7 1 8 Time s A speed profile order has been set to 100 After 300ms at constant speed a new speed order of 200 is set The motor keeps this speed during 200ms and finally decreases until reaching O Khepera IV User Manual ver 1 1 29 This curve corresponds to the order sent to the PID speed controller The real speed of the motor will depend on the payload and the PID reactivity A higher Acc Div parameter will increase the time between two steps to allow the PID to reach the speed order A value of O means that the effective motor speed will always be late on the order during the acceleration This type of control must be preferred to the simple speed profile in order to avoid high current peaks and preserve the mechanical parts The user needs to adapt the parameters Acc Inc and Acc Div to match the desired behavior high Acc Inc for a reactive profile high Acc Div for a smooth profile Khepera IV User Manual ver 1 1 30 4 14 3 Position control In this mode the robot will calculate a speed order which will be processed by the PID to move the robot using an acceleration ramp a constant speed and finally a deceleration ramp 350 250 200 4 Speed 150 4 00 05 10 15 20 25 3 0 Time s Speed profile using in posi
8. directory to be shared between the computer and the board must be declared to the NFS service in the etc exports configuration file Please refer to NFS documentation or man exports for a detailed syntax description Basically the following line should be added to the file etc exports on the computer mnt nfsarm KHEPERA4 IP 255 255 255 0 rw no root squash sync And make this folder on the computer mkdir mnt nfsarm The next step is to mount the shared directory to the robot file system Mounting a local hard drive partition or a network directory is exactly the same from the user point of view the mount commands should be on the robot where COMPUTER IP is the IP address of the computer which the robot will be connected mkdir mnt nfs mount t nfs o nolock COMPUTER IP mnt nfsarm mnt nfs If the NFS service is not started on the PC the mount command will issue the following message mount RPC Unable to receive errno Connection refused NFS mount program did not respond mount nfsmount failed Bad file descriptor The NFS service is usually started using a startup script for which location and name depend on you distribution for example etc init d nfs Documentation for the distribution should detail the method to start and stop services Caution For the NFS service to work properly the portmap service should be started as well and if a firewall is active on the host machine it should be config
9. file editor to modify files directly on the robot Launch it with vi FILENAME where FILENAME is the filename with path you would like to edit Here below are some of the basic commands ESC x dd arrow keys ESC set number ESC wq ESC q enters in write mode for adding text You will see the I indicating this mode at the last line of the console I tmp essai 1 1 100 enters in write mode for adding text You will see the I indicating this mode at the last line of the console I tmp essai 1 1 100 to go back in command mode push ESC key delete character on cursor delete current line move around text to display line number to save and quit to quit without saving You will find more commands here http www tutorialspoint com unix unix vi editor htm Khepera IV User Manual ver 1 1 79 10 WARRANTY K TEAM warrants that the Product is free from defects in materials and workmanship and in conformity with the respective specifications of the product for the minimum legal duration respectively two years from the date of delivery Upon discovery of a defect in materials workmanship or failure to meet the specifications in the Product during the aforementioned period Customer must request help on K TEAM Internet forum on www k team com forum by detailing e The type of Product used package version e The expansion modules e The programming environment of the Product standard version OS e T
10. fingers through the pre cut holes in the foam Then remove the foam inserts You should be able to see the CDs with accessories below Figure 2 2 CD Figure 2 3 Accessories Your package should contain the following items Khepera IV robot DVD with Khepera User Manual and software USB to mini USB cable Camera Lens may already be installed in the robot AC DC Power supply 110 220VAC 50 60Hz with plugs Khepera IV User Manual ver 1 1 3 THE ROBOT AND ITS ACCESSORIES 3 1 Global View e 3 Q KHEPERA IV Figure 3 1 Left view Figure 3 3 Right view Khepera IV User Manual ver 1 1 Figure 3 4 Bottom view Figure 3 5 Top view Make an external inspection of the robot Note the location of the following parts VD OO oU P UNE Caster wheels On Off switch Status LED Mini USB B connector device mode no charging USB A connector host mode 500mA Power supply jack 9V 1 5A 0 65mm center positive Charging status LED Reset button Infrared sensors 8x Ultrasonic sensors 5x Camera Bottom IR sensors 4x for fall avoidance and line following Contacts for docking station Wheels Sticker Bottom M3 Nuts 4x KB 250 Extension connectors Top M3 Nuts 4x Magnets 3x RGB LED 3x Khepera IV User Manual ver 1 1 3 2 First start up It is required before to use the robot for the first time to let the ba
11. resolv conf You can also create a file in etc network if pre up d named wireless to have these settings saved Khepera IV User Manual ver 1 1 68 Put the following into it bin sh ifconfig wlan2 up iwconfig wlan2 essid YOUR_SSID_OF_NETWORK iwconfig wlan2 key s YOUR_KEY ifconfig wlan2 YOUR_IP_ADDRESS route add default gw YOUR_GATEWAY_IP wlan2 And the following in a file named etc resolv conf search YOUR_LOCAL_DOMAIN_NAME nameserver YOUR_DNS_SERVER_IP_ADDRESS Restart the network with the following command etc init d networking restart 9 2 4 WEP WPA and other encryptions e Create a file named etc wpa supplicant wpa supplicant conf and insert your selected wireless encryption WEP Shared WEP key connection no WPA network ssid YOUR_SSID key_mgmt NONE wep_keyO YOUR_WEP_KEY auth_alg SHARED wep_tx_keyidx 0 Priority 5 J WPA TKIP etc wpa_supplicant wpa_supplicant conf with WPA PSK TKIT network ssid YOUR_SSID psk YOUR_PASS_KEY key_mgmt WPA PSK group TKIP pairwise TKIP proto WPA priority 5 Khepera IV User Manual ver 1 1 69 You can check the following link for other encryptions http hostap epitest fi wpa supplicant e run the daemon controlling the wireless connection with the following command one line wpa supplicant c etc wpa supplicant wpa supplicant conf i wlan2 Dwext B e In etc network if pre up d named wireless add the following commands
12. s ftp 1 There is already a micro SD card in the robot Carefully open the robot by unscrewing the 4 screws number 16 of figure 3 4 and remove the micro SD card If you want to restore everything start for easy cloning 2 or 3 for each partition Otherwise continue from 4 and transfer only the new files you want 2 Clone use HDDRawCopyi 10Portable exe and the clone on DVD software micro_SD partition_copy to put the clone on the micro SD Then got to 5 3 At first you will need to make 2 partitions on your micro SD card Backup all the data on your microSD card before Follow the chapters Partitioning the Card Formatting the New Partitions and Installing the Boot Files the instructions there http www gumstix org create a bootable microsd card html 4 You will take the uImage and Angstrom khepera4 image glibc ipk 2010 7 test 20130613 overo rootfs tar bz2 where 20130613 is the release version may change without notice from K Team ftp or from your full oetools directory see chapter 5 3 3 2 usr local khepera etools tmp deploy glibc images overo 5 Insert the micro SD and carefully put the cover and screws back Khepera IV User Manual ver 1 1 49 5 4 Microcontroller update You can reflash the micro controller of the Khepera robot with a new firmware Transfer the files kh4 bootloader and the kh4 firmware B 04 hex that are on the DVD in software bootloader to your robot see chapter 5 2 2
13. tools on a virtual machine if you don t have access to a Linux machine You can even find a virtual machine image already configured with the development tools on the DVD or there http ftp k team com KheperaIV software virtual machine forthe light tools 2 8 GB Ubuntu LTS Khepera4 light tools ova e Download and install VirtualBox version 4 3 8 or newer for your computer from https www virtualbox org wiki Downloads If you choose a more recent version you will have to reinstall the Guest Additions after having imported the image see VirtualBox user manual also if you update Ubuntu you will have to reinstall the Guest Additions e Download and install also the VirtualBox 4 3 8 Oracle VM VirtualBox Extension Pack from the webpage above e Import on of the image file above with File menu Import Appliance in the VirtualBox Manager This will take some time and hard disk space 8 GB for the light tools e Create the directory C Virtual machine shared on your computer This will be the shared directory for transferring data between the virtual machine and your host computer It corresponds to the directory media sf virtual machine shared of the virtual machine e Start the virtual machine with your imported image Its login is username user password root2014 e The development tools are already installed The development folder khepera4 development is in home user khepera4 development e Ec
14. ttyS2 11 NC Not Connected 12 I Interrupt 1 13 I Interrupt 2 14 NC Not Connected 15 O I C Serial clock 16 I O I C Serial data 17 NC Not Connected 18 NC Not Connected 19 NC Not Connected 20 O USB Host High cur enable 21 P USH Host VBUS 22 I O USB Host D 23 IO USB Host D 24 NC Not Connected 25 NC Not Connected 26 I O SPI MISO 27 I O SPI MOSI 28 O SPI Clock 29 O SPI Chip Select 30 NC Not Connected 31 NC Not Connected 32 NC Not Connected 33 O PWM 1 34 O PWM 0 35 NC Not Connected 36 NC Not Connected 37 NC Not Connected 38 NC Not Connected 39 NC Not Connected 40 NC Not Connected 41 I dsPIC PGC 42 I dsPIC PGD 43 P Battery out after SW 44 P Battery in before charger 45 NC Not Connected 46 NC Not Connected 47 NC Not Connected 48 NC Not Connected 49 P Ground 50 P Ground Table 3 Khepera IV User Manual ver 1 1 J701 pin out 61 8 MECHANICAL DRAWINGS Unit is mm 100 74 M3 Nut 6 50 95 M3 Nut 105 40 Wheel spacing Figure 8 1 Bottom view Khepera IV User Manual ver 1 1 62 57 70 Figure 8 2 Front view 70 70 M3 Nut 66 Mag Figure 8 3 Top view Khepera IV User Manual ver 1 1 63 9 ANNEXES 9 1 Using Bluetooth The following explanation will be for the Bluetooth on Linux For Windows with Bluetooth you can use Teraterm http ttssh2 sourceforge jp and jump to 3 5 then 8 1 2 3 4 5 6 Install the
15. 0 63 J L Set the speed in openloop mode Format of the command L left motor right motor J Format of the response 1 r n Effect Set the speed of the motor in the open loop control mode Maximum is 2940 which corresponds to 100 of PWM Example L 500 500 J Khepera IV User Manual ver 1 1 55 M Reset the motors controllers Format of the command M Ll Format of the response m r n Effect Reset the motors controllers Example M N Read proximity sensors Format of the command N J Format of the response n Back Left Left Front Left Front Front Right Right Back right Back Ground Left Ground Front Left Ground Front Right Ground Right r n Effect Read the 10 bit 0 to 1024 proximity value of each infra red sensors Note The smaller the value the further the object is from it A value of 900 i e means that an obstacle is very close from the sensor Incandescent IR sources the Sun can perturb the sensors O Read ambient light sensors Format of the command O d Format of the response o Back Left Left Front Left Front Front_Right Right Back right Back Ground Left Ground Front Left Ground Front Right Ground Right r n Effect Read the 10 bit 0 to 1024 brightness value of each infra red sensors Note A value of 0 means that the sensors is saturated with IR light and a big value means that there s no IR light source in front the sensor IR light comes
16. 3 Transferring files And run B 04 hex kh4 bootloader f kh4 firmware Remark B 04 is the version of the firmware It may change without notice 5 5 Packages installations With OpenEmbedded you can easily cross compile existing packages or add your own ones You can list installed packages on the board with the command opkg list installed 5 5 1 Existing packages Many packages are available for Open Embedded Here below are the instructions to add an existing package e Check if there is already a recipe package in usr local khepera etools org openembedded dev recipes khepera oetools directory source extras profile bitbake PACKAGE NAME If it is present you can compile it by running in the usr local e The package will be created in one of the folders into usr local khepera oetools tmp deploy glibc ipk e Transfer the package to the robot with Minicom or SSH see chapters 9 1 and 9 2 5 e Then install it opkg install PACKAGE 5 5 2 Removing packages NAME ipk You can remove a package with the command opkg remove PACKAGE NAME Khepera IV User Manual ver 1 1 50 You may have to add the command parameter force depends if the package depends on others 5 5 3 Creating new package You can create new packages for the robot following the instructions there http docs openembedded org usermanual html recipes examples htm
17. 4 overo defconfig defconfig is the new filename Then you rebuild it and the file system by executing these commands at the root of the Khepera oetools cd usr local khepera oetools source build profile bitbake c clean virtual kernel bitbake virtual kernel may take up to 30 min depending of your computer c The new kernel uImage file will be located at usr local khepera oetools tmp deploy glibc images overo uImage overo bin Also build the filesystem image bitbak C clean khepera4 imag bitbak khepera4 imag c The new filesystem will be located at usr local khepera oetools tmp deploy glibc images overo khepera4 image overo tar bz2 You can now upload the files to the robot with chapter 5 3 3 3 Uploading the kernel and the file system Khepera IV User Manual ver 1 1 48 5 3 3 3 Uploading the kernel and the file system You may need to reinstall the OS file of your robot if you want to upgrade or if something went wrong It is done by modifying the kernel filesystem and other files on the micro SD card inserted in the Gumstix All the data on the robot will be lost after running the following instructions The below procedure should only be done by an advanced user or technician Please notice that opening the robot will void the warranty Material needed e Computer with micro SD reader e flash MLO and u boot img script from DVD software micro SD partition copy FAT32 tar bz2 or K Team
18. Linux package Irzsz containing communications programs If your Linux distribution is Ubuntu sudo apt get install lrzsz On the Linux computer run the emulation terminal Minicom sudo minicom If Minicom is not installed you have to install this package For Linux Distribution Ubuntu the command is sudo apt get install minicom Install blueman a Bluetooth manager for Linux sudo apt get install blueman Switch the robot on Go to the Bluetooth configuration of your computer and search for a new device with blueman The robot will appear as khepera4 ABCD where ABCD is the serial number Pair the robot with the access key 0000 four zeros With blueman right click on the paired khepera4 ABCD choose Connect to Serial Port Run minicom with the command sudo minicom o Set its parameters with the sub menu Serial port setup of the menu configuration keys Ctrl a 0 as described in Figure 9 1 Press RETURN key to validate each time Khepera IV User Manual ver 1 1 64 A Serial Device dev rfcommo B Lockfile Location var lock C Callin Program D Callout Program E Bps Par Bits 115200 8N1 F Hardware Flow Control No G Software Flow Control No Change which setting Figure 9 1 Minicom serial parameters 7 Save the settings with the command Save setup as of the menu configuration cf Figure 9 2 and choose bluetooth You will be able to run again the prog
19. MLO u boot img where X Y is the release version may change without notice 5 3 2 Installation Install the development directory as explained in chapter 5 2 1 1 Installation of the development directory if not already done 1 Extract the cross compiler sources khepera oetools kbX Y tar bz2 in usr local with the command sudo tar xjf khepera oetools kbX Y tar bz2 C usr local Remark you must put the tools there because there are hardcoded links You have to overwrite the light tools if they were already installed 2 You can check if the installation is correct by running the cross compiler Firstly make the environment variables available then check the version of the cross compiler usr local khepera4 oetools tmp sysroots i686 linux usr armv7a bin arm angstrom linux gnueabi gcc version gt The last command should return arm angstrom linux gnueabi gcc GCC 4 3 3 3 Install the board library as explained in chapter 5 2 1 3 Installation of the robot library Khepera IV User Manual ver 1 1 46 5 3 3 Full toolchain usage 5 3 3 1 Rebuilding the whole system To rebuild the toolchain system the image file and the kernel execute the following instructions 1 In a console in the directory usr local khepera oetools source the following file to have access to the environment setup source extras profile With the following commands you can rebuild the whole system o Cleaning bit
20. NEN UU UENEUEENUIS UND SEEENU UU EPOR 64 9 1 Using Bluetooth ueeeesieesseesse nennen annehmen uana ann 64 9 1 1 To send a file to the robot upload ster spent rare rU EFEEEFEFFEEEEE EFE FE FERE 66 9 1 2 To send a file to the computer download 66 9 2 USING WiFi TTT 67 9 2 1 IP without any encryption for security s s s sssssssssssssssrrrrnrnsnnssrns 67 9 2 2 Fixed IP without any encryption for security ssssssssssssssssssssrrsnns 67 9 2 3 WEP encryption support REENEN NEEN EEN dE E EEEE NENNEN NS Ras 68 9 2 4 WEP WPA and other encrvpfione e 69 9 2 5 Transferring files EE 70 9 2 6 En e ee 70 927 MESOGCOBNOUFIDIOR be 71 9 3 Using the camera module necesse esse eene nnne nnne nnns 72 90 3 1 Taking images estu ed VE Rune euer hri n n f e t e 72 9 3 2 Ee Ee e EE 72 9 3 3 Programming Image Drocessing sene 72 9 3 4 Changing colors levels whitebalance cesses 73 9 4 Using microphones and speakers eene 75 9 5 Development with a virtual machine eee 77 9 6 Using vi text file editor E 79 10 WARRANTN ha ERRERRER RER RE ERR ERR ENKER KEE R ENER RER RE KREE RER ER REK KEREN E KEREN EA 80 1 INTRODUCTION Thank you for buying a Khepera IV robot The Khepera IV is a high end table top robot that will initiate your experience to the extraordinary world of mobile robotics Thanks to its wealth of se
21. R PARTY SHALL HAVE ANY LIABILITY TO THE OTHER FOR INDIRECT OR PUNITIVE DAMAGES OR FOR ANY CLAIM BY ANY THIRD PARTY EXCEPT AS EXPRESSLY PROVIDED HEREIN Khepera IV User Manual ver 1 1 81 TEAM V K Team S A Z I Les Plans Praz 28 1337 Vallorbe Switzerland
22. S esee enee enne 4 3 1 Global View A ea nnee nahmen uana uana annua un uua a 4 3 2 First start up e REKR KREE NEE eee enone eee KEN enone eee eee eee eee 6 3 3 Shutdown Reboot Reset e eeeee enean nnnm KK EEN nnn 8 3 4 The Khepera IV Robot seeesseeeeee KEEN KEE RRE KREE anna 9 3 T Caster MEET e 9 3 4 2 OMO SWIECI geed 9 3 4 3 Status VED EE 9 3 4 4 MMini USB B connector device sesssssssssssssssse enhn hn 9 3 4 5 USB A connector Post 9 3 46 POWE SUPPI JACK orrn EEE e EE ERR R ERR ER ER ER ER EE TEE EE EEEREN 9 3 4 7 Charging status LED sssssssssssssisese senes 10 3 4 6 ROSOLDLLCORS 509092999 299 29 9299 29 2922299 292229 9 2929292992 992 99 29 2 9 10 34 9 Ifa ed Ser SES races ua ara RR RR RR RR RE RR RR aa NE 10 3 4 10 Ultrasonic sensors essssssssssssesiseee seen nhe hne nnn 10 3 4 11 CAME EE 10 3 4 12 Bottom infrared sensors used eeu uu UU UU 10 40113 Contacts for docking EE Ee 11 3 4 14 Keele EE 11 EE 11 3 4 l6 Bottom M3 NUTS siio rr RR RREERRRERRRR RE ERR ENTRE RR EE EVREER 11 3 4 17 KB 250 Extension Connectore seen hehehe 11 ET NEE 11 ER ME MEN Ee 11 GU EE 11 3 5 Other Tedtures ioo wen eame c a a a c Ol 12 4 IN DEPTH LOOK oo cnin en e e 13 4 1 Infrared SEMSOMS 9999333113339 08922911333 9 4 4 8 RR RD1 T3 S VR RRRREATOTASRRARE 13 4 1 1 Am
23. SD A AGB MicroSD card is provided inside the Khepera IV The robot will boot on it and use this card It already contains the OS kernel and boot files See chapter 0 Uploading the kernel and the file system to rebuild it if needed 4 13 RGB LED Three RGB LED 19 337 R6GHBHC A01 2T from Everlight are mounted on the TOP of the main board Each of these LED has a light guide on it The LED are driven by a dedicated LED driver LTC3219 from Linear which provides a resolution of 6 Bits 0 63 for each color These LED can be used to locate the Khepera IV with a camera at the ceiling and differentiate each robot in swarm application As the LED are placed on a isosceles triangles the direction of the robot can also be detected The physical positions of these LED are shown in the Mechanicals Drawing chapter Khepera IV User Manual ver 1 1 25 4 14 Motors The Khepera IV has got 2 DC motors in order to drive its two wheels The motors have 1 96W nominal power The integrated gearbox has a reduction ratio of 19 1 and an efficiency of 78 There is another gearbox within the carter of the motor block with a ratio of 2 1 and an efficiency of 85 Total ratio is then 38 1 and efficiency is 66 3 meaning that there is 1 3W of usable mechanical power by wheel Figure 17 Motor block with wheel The encoder has a 128 pulse by turn resolution With the reduction ratio of 38 1 and an internal hardware 4x multiplier we ha
24. WiFi or Bluetooth connection instead e 800MHz ARM Cortex A8 Processor with C64x Fixed Point DSP core e 512 MB RAM 512 MB NAND Flash and additional 4GB for data e Embedded WiFi and Bluetooth with internal antennas e Powerful and long lasting internal Lithium Polymer battery 3400mAh 7 4V 25 16Wh e Two 100 to 10 000 Hz microphones e One 400 to 20 000 Hz 0 7W Loudspeaker e 3 axis accelerometer e 3 axis gyroscope Although the internal battery is not removable it is possible to charge it from 3 places e From the jack e From the contacts situated below the robot e From the KB 250 extensions connectors The max payload of the robot is 2kg Operating temperature range of the robot is O to 55 C Battery charging temperature range is O to 30 C Never attempt to charge it by higher temperature Khepera IV User Manual ver 1 1 12 4 IN DEPTH LOOK 4 1 Infrared Sensors Khepera IV has 8 infrared sensors placed all around the robot and 4 placed on the bottom The latter allow experiments like line following or fall avoidance They are positioned and numbered as shown in figure below Figure 9 Infrared sensors viewed from bottom These sensors embed an infrared light emitter and a receiver For detailed description please refer to the manufacturer s datasheet The twelve sensors are TCRT5000 reflective optical sensors from Vishay Telefunken Measuring range is from 2 to 250mm Each sensor is separated from its neigh
25. a IV User Manual ver 1 1 33 5 2 Software The following sub chapters explain the software installation and the application development with the board Two development packages are available e Light toolchain e Full toolchain and sources for advanced users kernel modifications packages creation addition In the subsequent paragraphs only the light tool chain is explained The full toolchain is described in the following chapter O Khepera IV User Manual ver 1 1 34 Full toolchain usage With a virtual machine you can also use the toolchain from another operating system see chapter 9 5 Development with a virtual machine 5 2 1 Installation of light toolchain The installation of the software required to use the board and the development tool is described in the next sub chapters Below are listed the files needed to install the light toolchain These files are available on the DVD or from the Internet URL http ftp k team com KheperalV software From light_toolchain folder Light toolchain cross compiler only khepera4 oetools light kbX Y tar bz2 From library folder Board library sources libkhepera X Y tar bz2 where X Y is the release version may change without notice 5 2 1 1 Installation of the development directory The development directory wil be the base folder for your development It contains links and scripts to easily use the cross compiler to make your programs Create a ne
26. attery status Format of the command V argument Format of the response u r n Effect Get the battery status where argument is 0 voltage in mV 1 current in mA 2 average current in mA 3 absolute remaining capacity in mAh 4 battery temperature in C 5 relative remaining capacity in 9 6 6 whether the charger is plugged 1 or not 0 7 the status number of the battery controller DS2781 Example v 0 J Khepera IV User Manual ver 1 1 58 W Unused X Binary read Format of the command X dJ Format of the response xBinary data r n Effect Read the sensors data in binary mode in 67 bytes 1 byte x char 24 bytes proximity sensor 24 bytes proximity ambient light sensor 8 bytes motor speed 8 bytes motor position 1 byte line feed n 1 byte carriage return r Y Unused Z Microcontroller Reset Format of the command Z 4 Format of the response z r n Effect This command allows resetting the robot microcontroller as it was cycled On Off Khepera IV User Manual ver 1 1 59 7 EXTENSION CONNECTORS The extension connectors of the Khepera IV are based on KB 250 and are basically connected the same as for the KoreBot 2 board KoreBot extensions are compatible with Khepera IV although the inverse is not necessarily true Figure 19 extension connectors Signals types NC Not connected P Power I Input O Output I O Input Output Please note tha
27. bake c clean khepera image o Rebuild bitbake khepera imag gt The output files will be stored in usr local khepera oetools tmp deploy glibc images overo Three main files will then be built the kernel ulImage 2 6 34 r97 overo bin its modules modules 2 6 34 r97 overo tgz the file system Angstrom khepera4 image glibc ipk 2010 7 test 20130613 overo rootfs tar bz2 where 20130613 is the release version Remarks You may find updated version of these software at http ftp k team com KheperalV software With the chapter 5 3 3 3 Uploading the kernel and the file system you can upload these files to the robot You can find more information about bitbake the tool for executing task and managing metadata here http docs openembedded org bitbake html Information about the OEtools is available here Cross compiler and tools OpenEmbedded http www openembedded org wiki Main Page Linux distribution of the robot http www angstrom distribution org Gumstix documentation http www gumstix org Khepera IV User Manual ver 1 1 47 5 3 3 2 Kernel modification You can modify the kernel here by accessing to its menu with these commands cd usr local khepera oetools tmp work overo angstrom linux gnueabi linux omap3 2 6 34 r97 git and configure the kernel with make ARCH arm menuconfig copy config file to usr local khepera oetools user collection packages linux linux omap3 2 6 3
28. bient light measurement 1ccceece eee eee e enn e ene en hehehe 14 4 1 2 Reflected light measurements proximity eee 15 4 2 Ultrasonic sensors KREE cence eee eee eee eee REENEN EK KEN 16 4 3 Battery ccccccces sees cece eee nee eee ee ee eens eee eee eee eee eee eee eee 17 4 4 Contact pads ENKEN KKK KREE NEEN K KREE NEE EN KKK REENEN annuum KREE RK EN 19 4 4 1 Reed relay Jocation seen hehehe nnn 20 4 5 Camera ees KNK RK NR KEREN KEE ENKE ENEE KEE E uaa uu uae uu aua ua nuu uan 21 4 6 Micropbhones EN REKN KKK KREE EEN E eee eee eee KKK REENEN eee eee eee nnn 21 4 7 Loudepeaker ERKENNEN KREE KENE KREE NEE EN KKK annua ieu ame u unu u n 22 4 8 Gumstix Overo FireSTORM COM esee enne nnns 22 4 9 Accelerometer us REKN KKK KREE KENE KREE NEE EN eee REENEN anna KKK KREE n 23 4 10 Gvroscope ERKENNEN KREE REENEN eee eee eae eee KKK REENEN eee unen 24 4 11 USB Device mini USB B connector eene 25 4 12 Micro dg NKKNNNNNNNNNNNNNNNNNNNNN NNN ENNN NNN NEEN NN NNN NEEN NN NNN deeg 25 4 13 RGB LED iiir 25 4 14 Motors KENE ENK RR KKK ence ERR EE ENKE eee eee 26 4 14 1 Speed Control 28 4 142 Speed profile COMLFOL EE EE EE EE EE EE 29 PLAS a POSION COMOL ee POE ECON POL ee 31 LIAA Open OOP E 32 5 PROGRAMMENG 5 xxix ioo c Gn OG OR CHEC RR ER 33 5 1 Required hardware software RENE eese nnne 33 5 11 Required hard Ware EE 33 51 2 Re
29. bor from an angle of 459 Khepera IV User Manual ver 1 1 13 This kind of sensors allows two measures e The normal ambient light This measure is made using only the receiver part of the device without emitting light with the emitter A new measurement is made every 5ms The value returned at a given time is the result of the last measurement made e The light reflected by obstacles proximity This measure is made by emitting light using the emitter part of the device The returned value is the difference between the measurement made while emitting light and the light measured without light emission ambient light A new measurement is made every 5ms The value returned at a given time is the result of the last measurement made 4 1 1 Ambient light measurement Ambient light measurement is strongly influenced by the robot s environment Depending on the light source type color and distance ambient light measurement profile might vary It is not recommended to use light source with large emission in the infrared range as this could confuse the IR sensors Value range is 0 to 1023 O stands for no light and 1023 for full light Khepera IV User Manual ver 1 1 14 4 1 2 Reflected light measurements proximity Sensors are mainly meant to detect obstacles around the Khepera Measurements for reflected light depend on objects reflectivity and on ambient light conditions Object colors materials and surfaces do have an influe
30. d where it started For Windows on Teraterm go to the menu File Change directory and change the directory to receive the file to Then go to File Transfer Z Modem Receive to receive the file Khepera IV User Manual ver 1 1 66 9 2 Using WiFi There are different ways described below for configuring the WiFi network depending on the given security You can transfer file with the scp command see chapter 9 2 5 You can have remote access to the robot with chapter 9 2 6 9 2 1 IP without any encryption for security e Modify the file etc network interfaces with your wireless network settings YOUR SSID OF NETWORK your wireless network name wlan2 interface number get it with command iwconfig x xxxxxxxk etc network interfaces file auto wlan2 iface wlan2 inet dhcp wireless mode managed wireless essid YOUR SSID OF NETWORK J BRR K K KKK KK KK KK KK K K e K AK KK KK KKK K K KKK AK AK AK KK K K K KK KK e Restart the network with the following command etc init d networking restart e You can get the IP with the command ifconfig 9 2 2 Fixed IP without any encryption for security e Modify the file etc network interfaces with your wireless network settings YOUR_SSID_OF_NETWORK the SSID of your wireless network YOUR_IP_ADDRESS the IP address you would like for the robot YOUR_NETMASK the netmask of your wireless network YOUR_GATEWAY_IP the gateway of your wirele
31. d when it is unused When you have finished working with Khepera turn it off It will save the battery life e Do not manually force any mechanical movement Avoid to force by any mechanical way the movement of the wheels or any other part e Never open the case Only qualified technicians are allowed to do so 1 3 Recycling Think about the end of life of your robot Parts of the robot can be recycled and it is important to do so It is for instance mandatory to keep batteries out of the solid waste stream When you throw away a battery it eventually ends up in a landfill or municipal incinerator This battery which contains Lithium Polymer can contribute to the toxicity levels of landfills or incinerator ash By recycling the batteries through recycling programs you can help to create a cleaner and safer environment for generations to come For those reasons please take care to the recycling of your robot at the end of its life cycle for instance sending back the robot to the manufacturer or to your local dealer Thank you for your contribution to a cleaner environment Made in Switzerl a n d Contains FCC ID U9R W2CBWO003 Khepera IV User Manual ver 1 1 2 UNPACKING AND INSPECTION 2 1 Package Content The Khepera IV package is done in a stack like architecture When you open it you ll first see the robot Figure 2 1 First opening Please remove the robot from the packaging by holding it with your
32. d with the command one line usr local khepera4 oetools tmp sysroots i686 linux usr armv7a bin arm angstrom linux gnueabi gdb version which should return GNU gdb GDB 7 1 5 Run eclipse and at the Workspace launcher window choose where you would like to put your project Go to file menu File gt C Project or C for running a C on the robot For C you must install the standard C library with the command ipkg install libstdct 6 4 3 3 r22 1 6 armv7a ipk on the robot and choose a Project Name ex test 6 In the next window C Project press the Advanced Settings button and on the C C Build gt Settings for c On Cross GCC C Compiler change command gcc to usr local khepera4 oetools tmp sysroots i686 linux usr armv7a bin arm angstrom linux gnueabi gcc or depending if your project is C or C for c On Cross GCC C Compiler change command g to usar local khepera4 oetools tmp sysroots i686 linux usr armv7a bin arm angstrom linux gnueabi g t 7 On Cross GCC Compiler Includes gt Include paths add usr local khepera4 oetools tmp sysroots i686 linux usr include Khepera IV User Manual ver 1 1 39 10 11 12 13 14 15 16 17 On Miscellaneous replace Other flags with c march armv7 a mtune cortex a8 Wa mcpu cortex a8 On the Cross GCC Linker change command gcc to usr local khepera4 oetools tmp sysroots i686 linux usr armv7a bin arm angs
33. e If you modified the library any file in src you will have to transfer the file build khepera 2 6 lib libkhepera so X Y to your robot overwriting usr lib libkhepera so X Y Khepera IV User Manual ver 1 1 36 The board library contains these files and directories build khepera 2 6 doc src src tests template Makefile README kteam compiled library and headers documentation API start in doc html index html source code of the library examples and tests source code template program Makefile for all readme file You can find an updated version of the library from the following FTP site http ftp k team com KheperaIV software library Khepera IV User Manual ver 1 1 37 5 2 2 Programming and light toolchain usage 5 2 2 1 Application development A template program prog template c is available in the robot library in the folder libkhepera X Y template You can start your code into the template program and use the following commands to build it The command runs the Makefile script to compile and build the executable program Type in a console to build the template program cd khepera4 development libkhepera X Y template make gt The template file is the executable output file You can transfer the program to the robot by USB Bluetooth or WiFi see chapters 3 2 9 1 or 9 2 5 Then execute it on the robot by running template The Application Programming Interfac
34. e documentation of the library is available at ev khepera4 development libkhepera X Y doc html index html Remarks If you modify the program name you will have to modify its occurrences in the Makefile file You can find many examples of source code in khepera4_development libkhepera X Y src tests Try kh4_example c or the big khepera4_test c They are compiled with the command below To compile only the examples run make clean tests make tests See next sub chapter for using Eclipse guide for editing source code See chapter 5 2 3 for debugging your program Khepera IV User Manual ver 1 1 38 5 2 2 2 C C Programming using GUI source code editor Eclipse You can use also Eclipse as source code editor See instructions below how to install and use it 1 Install the Java Runtime Environment JRE if not already installed JRE file there http java com en download index js 2 Download the linux version of Eclipse IDE for C C Developers includes Incubating components from for Ubuntu users don t install with apt get because the apt get version is older http www eclipse org cdt 3 Extract the Eclipse program file sudo tar xzf eclipse cpp kepler SR2 linux gtk tar gz C You can also create a link to the start file sudo ln s eclipse eclipse usr bin eclipse 4 You should have installed the latest version of the khepera toolchain light or full You can check by opening a terminal an
35. e run the program with r e execute a step with n e display a variable with p VAR NAME e execute next step with n e continue to the end with c e quit with q 5 2 3 2 Remote debugging If the debugger is not installed you can check with the command gdbserver version you need to upload and install the following package on the robot with the command opkg install gdbserver 7 1 r8 0 6 armv7a ipk e Then run the gdbserver with your cross compiled program and an unused port number as argument here 1234 gdbserver multi 1234 YOUR PROGRAM e Go to the folder where you cross compiled your program e You can use the debugger in command line or with ddd GUI Command line e Execute for running the debugger on the computer one command line only usr local khepera4 oetools tmp sysroots i686 linux usr armv7a bin arm angstrom linux gnueabi gdb YOUR PROGRAM e In this debugger set parameter and connect to the remote gdb with these two commands set sysroot usr local khepera4 oetools tmp sysroots armv7a angstrom linux gnueabi target extended remote YOUR KHEPERA4 IP ADDRESS 1234 With GUI e On your computer install ddd the debugger GUI with sudo apt get install ddd e Launch ddd with one command line only Khepera IV User Manual ver 1 1 42 ddd debugger usr local khepera4 oetools tmp sysroots i686 linux usr armv7a bin arm angstrom linux gnueabi gdb YOUR PROGRAM e In the window at the bo
36. edance 8 Ohm Output SPL 88dBA Distortion max 5 Resonant frequency 850Hz 20 Frequency range 400 20 000Hz See chapter 9 4 Using microphones and speakers for usage 4 8 Gumstix Overo FireSTORM COM The Khepera IV was designed to embed a Gumstix Overo processor board The computer on module mounted by default in the Khepera IV is the Gumstix Overo FireSTORM COM This computer on module has an additional DSP to perform special tasks Bluetooth amp WiFi capabilities SMD antenna mounted on the Khepera Architecture ARM Cortex A8 NAND Flash 512MB Processor Texas Instruments OMAP3730 800MHz DSP C64x Fixed Point DSP 660 800 Mhz Wifi 802 11 b g included Bluetooth included The Gumstix is provided with a Linux system already installed Angstr m distribution More information on the Overo can be found on the Gumstix website www gumstix com Khepera IV User Manual ver 1 1 22 4 9 Accelerometer The accelerometer mounted on the Khepera IV is a LSM330DLC from ST This device includes in one package a 3D accelerometer and a 3D gyroscope The device is exactly at the center of the robot placed on the rotation center The device is located on the TOP of the main PCB The accelerometer is oriented with the pin 1 to the front right this returns a positive value for X axis when going forward The Y axis is positive on the left and finally Z axis is negative with the gravity X Y Z Figure 15 Di
37. en loop This control mode disables the PID controller and sets directly the PWM to the two motors This can be useful if the application wants to calculate its own PID The range of this command is 2 940 where 2 940 correspond to 100 of PWM in forward direction and 2 940 in backward direction If the application wants to disable the motor to decrease current consumption the best way is to use this mode and set the PWM to O The motor will be in free wheel mode Khepera IV User Manual ver 1 1 5 PROGRAMMING 5 1 Required hardware software The required hardware and software to use the board and develop programs are described below 5 1 1 5 1 2 Required hardware Computer with Bluetooth WiFi or USB port with Linux or Linux emulation with a virtual machine you can also use the toolchain See chapter 9 5 Development with a virtual machine Khepera IV robot Required software Required free space 3 GB on usr local for light toolchain 50 MB on user account Required files 1 2 Linux OS kernel 2 6 x on the computer with the following packages installed gcc GNU C compiler minicom terminal emulation Irzsz communication package From the DVD Cross compiler light khepera4 oetools light kb1 0 tar bz2 Robot library sources libkhepera_1 0 tar bz2 Remarks you may find updated versions of this software at http ftp k team com KheperalV software Kheper
38. epera4 oetools tmp work overo angstrom linux gnueabi linux omap3 2 6 34 r97 git arch arm boot you will have the kernel file uImage Use this file for the point 2 of chapter O For future recompilations of the kernel and creations of the filesystem When you have found the right parameters insert them in the existing patch file usr local khepera4 oetools user collection recipes linux linux omap3 2 6 34 overo isppreview patch and rebuild the kernel and filesystem as explained in chapter 5 3 3 1 Khepera IV User Manual ver 1 1 74 9 4 Using microphones and speakers Playing You must switch ON the speakers with the commands echo 64 gt sys class gpio export echo out sys class gpio gpio64 direction echo 1 sys class gpio gpio64 value You can play PCM WAV files with aplay and the syntax aplay FILE wav and MPEG audio files with madplay and the syntax madplay FILENAME o cdda aplay f cdr You can then switch the speakers OFF with echo 0 sys class gpio gpio64 value echo 64 gt sys class gpio unexport Recording You can record PCM WAV with arecord and the syntax arecord f cd FILENAME wav The f cd parameter sets the recording in stereo mode in CD quality See with the command arecord h for all the parameters and help Controlling volume You can modify the playback volume by launching the volume mixer with the command alsamixer You change cha
39. eters User can modify the PID to try to improve the behavior for this kind of very low speed The maximum speed order is approximately 1 200 813mm s It s still possible to move the robot faster if the control mode is set to open loop In this case the maximum speed will vary with the battery voltage and the payload Khepera IV User Manual ver 1 1 28 4 14 2 Speed profile control This type of control uses the same PID as standard speed controller but adds an acceleration ramp to travel from the actual speed to the new speed order The ramp used in this mode can be configured with the speed profile parameters Three parameters define the ramp Acc Inc value of increment to add or subtract every Acc Div 1 control loop value from 1 to 255 Default 3 Acc_Div defines the number of control loops where no increment is added to the speed order For example a value of 0 means that at every control loop the speed will be increased by Acc Inc A value of 4 means that every 5 control loops 50ms the speed will be modified value from 0 to 255 Default 0 Min Speed Acc this parameter defines the minimum speed used by the controller This value avoids setting a speed too low where the controller is not efficient If the order value is smaller than this parameter the controller will automatically limit the speed to Min Speed Acc Do not set values lower than 1 Default 20 Here s an example of speed profile with
40. from an incandescent light like the Sun a fire Khepera IV User Manual ver 1 1 P Configure position margin Format of the command P margin 4 Format of the response p r n Effect the margin parameter defines the threshold when the position controller stops completely the motor set O to the speed controller Example P 10 J Q Unused R Read encoders position Format of the command R Format of the response r left motor right motor r n Effect Read motor encoder position values See chapter Position controlSpeed control for details of the unit S Gyroscope Format of the command S Format of the response s X1 X2 X10 Y1 Y2 Y3 Y10 21 Z22 Z3 Z120NxMn Effect Read gyroscope values new data coming first See chapter 4 10 GyroscopeSpeed control for details of the unit Khepera IV User Manual ver 1 1 57 T Accelerometer Format of the command d VE Format of the response t X1 X2 X10 Y1 Y2 Y3 Y10 21 Z2 Z3 Z120NxMn Effect Read accelerometer values new data coming first See chapter 4 9 AccelerometerSpeed control for details of the unit U Configure the ultrasonic sensors Format of the command U config J Format of the response u r n Effect Configure which US sensor is activated Left 1 front left 2 front 4 front right 8 right 16 all 31 none 0 They can be combined by addition for example left right gt 17 Example U 31 J V Get b
41. g ired Softwa EG 33 5 2 SOWA 5 iiiccca siiis ckavkEvEVERRE VER VREERRERRRERRERRERRRENRERRERREERRRAREKRYRRPRR 34 5 2 1 Installati n of light toolchain r EELE ERENER EEEE EEO OREORE 35 5 2 2 Programming and light toolchain usage 38 SEET 41 5 3 Full toolchain and sources ose eseee esee eese nnne nnn 45 5 3 1 Required software 2 5559 5 2822230222292000099392222020000909200222090504090 022292920029 45 5 3 2 nstallat oN e ui shee cee cee coeds vues uere enu ee n Eenn ko anke enne n EEEE EEEE EE E AES 46 5 3 3 Full toolchain usage ENNEN ENNEN NENNEN NENNEN NENNEN ENEE EN 47 5 4 Microcontroller update e esie esee esee eese enne annnm nnn nnn 50 5 5 Packages installations eeeee eese esee eeee enne nnn nnn enn nnne 50 5 5 1 Existing packages EE 50 5 5 2 REMOVING package sse re EE nave ER ERR ERE poe peed epee ERE ER ITE tiEES 50 5 5 3 Creating new PACKAGe ccccessccscccsccsecntcctecureussessentecteeureetsesnsateens 51 6 COMMUNICATION PROTOCOL WITH SERVER ONLY 52 7 EXTENSION CONNECTORS ixuocksskaASuRRRER DEN RNSSRREREEANRN E MR RR ERE SU 60 7 1 700 PIH OUE iiis rra noua ru arr ni mn n rr n cn n cr n n E RR 61 Ji JZOT JPIBFOUE in EEREREREEERERERERRRER ERR RERRERRERRRERRERRRRR ERR ERR RRRRRRRREREOARUE 61 8 MECHANICAL DRAWINGS eese ese esee nnn nnn nn eene 62 9 WVNNEXES 5 55 02 035020 sath duUisss540 0E dad UN NI NEN
42. he wheels are driven by DC motors with encoder and gearbox 3 4 15 Sticker Here you ll find the serial number of your robot 3 4 16 Bottom M3 Nuts There is the possibility to fix an extension to the robot from below 3 4 17 KB 250 Extension connectors These two connectors are used to connect extension modules to the robot The pin out is accordingly to KB 250 with some minor improvements You can re use the Khepera III or KoreBot extension modules but not the Kh3 Gripper These connectors have their USB host signals shared with the USB Host connectors meaning that you cannot use USB on Extensions at the same time as on the connector USB device is usable on both at the same time as the robot is equipped with a hub 3 4 18 Top M3 Nuts There is the possibility to fix an extension to the robot from above 3 4 19 Magnets There are three magnets used mainly to attach the gripper but they can be used for any other module 3 4 20 RGB LED There are three RGB LED on the top of the robot all are user controllable They are primarily intended for robot pattern recognition with a color camera mounted on the ceiling of your experiment room Khepera IV User Manual ver 1 1 11 3 5 Other features Since the Khepera III we added a lot of functionalities in this new robot e No need for KoreBot a powerful Linux embedded board is included by default Gumstix Overo FireSTORM COM e No need for KoreConnect use the USB device
43. he robot to the host computer it is starting with the same character that was initiating the command but using lower case and followed if necessary with numerical parameters Notation a stands for carriage return Enter or Return key pressed Nr stands for ASCII character OxOA line feed Mn stands for ASCII character OxOD carriage return Khepera IV User Manual ver 1 1 52 A Start Braitenberg mode Format of the command A mode Format of the response a r n Effect Start the Braitenberg mode with the Infrared sensor mode 0 To stop the Baintenberg mode send the A 2 command Example A 0 1 Syntax A 0 B Read firmware version Format of the command B J Format of the response b version Os r n Effect Return the software version stored in the flash memory of the microcontroller C Unused D Set Speed Format of the command D speed motor left speed motor right J Format of the response d r n Effect Set the speed of the both motors with PID without profile O will stop the engine Max forward speed is 1200 and max backward speed 1200 See chapter 4 14 1 Speed control for details Example D 200 200 Khepera IV User Manual ver 1 1 53 E Read Speed Format of the command E J Format of the response e speed motor left speed motor right r n Effect Read the speed of the motors See chapter 4 14 1 Speed control for details of the unit F Set position Format of the
44. he standard use of Product before the appearance of the problem e The description of the problem If no answers have been received within two working days Customer can contact K TEAM support by phone or by electronic mail with the full reference of its order and Product serial number K TEAM shall then at K TEAM s sole discretion either repair such Product or replace it with the equivalent product without charging any technical labour fee and repair parts cost to Customer on the condition that Customer brings such Product to K TEAM within the period mentioned before In case of repair or replacement K TEAM may own all the parts removed from the defective Product K TEAM may use new and or reconditioned parts made by various manufacturers in performing warranty repairs and replacement of the Product Even if K TEAM repairs or replaces the Product its original warranty term is not extended This limited warranty is invalid if the factory applied serial number has been altered or removed from the Product This limited warranty covers only the hardware and software components contained in the Product It does not cover technical assistance for hardware or software usage and it does not cover any software products contained in the Product K TEAM excludes all warranties expressed or implied in respect of any additional software provided with Product and any such software is provided AS IS unless expressly provided for in any enclosed sof
45. ia video isp isppreview c The structure ispprev_rgbtorgb contains the RGB blending especially the parameters RR GG and BB with the matrix equation linking input to output colors static struct ispprev rgbtorgb flr rgb2rgb RGB RGB Matrix gains RR RG RB GR GG GB AN RR RG RB RN Rof BR BG BB Gu GR GG GB J Gp Gof RGB Offset P BR BG BB B Bof Rof Gof Bof C code Equation These parameters are integer values They are coded in fixed point numbers S12Q8 for the 9 gains and S10Q0 for the 3 offsets For converting the gains for the array multiply by 256 and round the value For the offsets just round the value Example RR 0 8 GG 1 0 BB 1 5 Rof 10 5 gt RR 205 GG 256 BB 384 Rof 11 By default all the parameters are zeros except RR 256 GG 314 and BB 498 which is for an incandescent light source Then recompile the kernel Khepera IV User Manual ver 1 1 73 e Install the needed program uboot mkimage with sudo apt get install boot mkimage e go to folder usr local khepera4 oetools tmp work overo angstrom linux gnueabi linux omap3 2 6 34 r97 git e add cross compiler to path set PATH PATH usr local khepera4 oetools tmp sysroots i686 linux usr armv7a bin D compile the kernel with the commands make clean make j8 ARCH arm CROSS COMPILE arm angstrom linux gnueabi ulmage e in usr local kh
46. keys You can configure the web server in the folder usr local mjpg streamer www Some help is available in the file usr local mjpg streamer www README 9 3 3 Programming Image processing In the chapter 5 2 2 1 Application development you will find how to modify and compile the example source code Select the following example for the camera function of camera example v khepera4 development lib khepera 1 0 khepera4 test c Driver source code you can access to the driver if you installed the full toolchain The driver bitbake recipe is located in usr local khepera4 oetools user collection recipes mt9v032 module Khepera IV User Manual ver 1 1 72 It is useful if you would like to change the autoexposure hdr autogain or low light parameters You can test with the right combination of these parameters in unloading the driver and reloading it with these parameters in argument example rmmod mt9v032 modprobe mt9v032 hdr 1 After compiling the module with bitbake copy the file to the robot and install it You need to remove the kernel module before opkg remov force depends kernel module mt9v032 opkg install mt9v032 module 1 0 r97 6 overo ipk 9 3 4 Changing colors levels whitebalance You need the full toolchain chapter 5 3 to change the colors levels For testing modify on your computer in file usr local khepera4 oetools tmp work overo angstrom linux gnueabi linux omap3 2 6 34 r97 git drivers med
47. l And if you installed the full toolchain an example is available into usr local khepera oetools user collection recipes helloworld Khepera IV User Manual ver 1 1 51 6 COMMUNICATION PROTOCOL with server only This communication protocol allows complete control of the Khepera s functions through a Bluetooth serial line This can be useful to remote control the robot easily with an application such Matlab for example The required configuration is presented in section 9 1 Bluetooth By default the login appears on the Bluetooth port To deactivate it comment the line 71 in the file etc init d bluetooth by adding a in the beggining You can use vi as editor see chapter 9 6 RFCOMM EXEC r watch 0 1 sbin getty w L rfcomm0 115200 vt100 amp And add this line below RFCOMM EXEC r listen 0 1 amp Then restart the Bluetooth services with the command etc init d bluetooth restart On the robot launch the server kh4server you must run it after having done the Bluetooth connection Jkh4server Currently there is a bug in the kernel in rfcomm When the BT connection is closed or lost the robot OS crashes The protocol is made of commands and responses all in standard ASCII codes A command is sent from the host computer to the Khepera it is starting with an upper case alpha character and followed if necessary with numerical parameters separated with comma and terminated by a line feed The response is sent by t
48. lipse development program is already installed and configured You can start to use it as described in chapter 5 2 2 2 from point 15 e You may need to update the toolchain Remove the older one and follow instructions in chapter 5 2 1 or 5 3 2 depending if this is the light or full toolchain Khepera IV User Manual ver 1 1 77 Stopping the virtual machine When going to the menu Machine and Close you will have 3 choices e Save the machine state saves the current state which will be reloaded next time you restart it e Send the shutdown signal or press the shutdown button into the machine power off the machine and save only the work done e Power off the machine WARNING it doesn t save anything any work done will be discarded Serial port sharing You may configure your virtual machine to share the serial port to connect to the robot for using Bluetooth e Power off your virtual machine e Select your machine image and press Settings button e Go to Serial Ports settings e On the tab Port 1 enable the checkbox Enable Serial Port and choose Port Number COM1 gt this will be the Linux serial port dev ttySO Port Mode Host Device Port File Path COMI if you have a standard serial port and using COM1 Or adapt to your computer serial port or Bluetooth emulated serial port Khepera IV User Manual ver 1 1 78 9 6 Using vi text file editor You can use the installed vi text
49. nce on the sensor s response Moreover as any sensor IR sensors are subject to environmental noise For all these reasons graphics below are given for information only and should not be considered as references Value range is O to 1023 O stands for no obstacle 1023 for very near obstacle Here s an example of value with a white paper used as an obstacle IR Value 0 1 2 3 4 5 6 Fd 8 9 10 11 12 13 14 15 16 17 18 19 Distance cm Figure 10 IR value vs Distance The IR value never falls to O as even with no obstacle the IR reflects on the floor and adds a static value As all the sensors are not exactly the same the solution is to perform a calibration of the IR with no obstacle in front With this calibration the user will be able to improve detection of obstacle at distance greater than 20cm Khepera IV User Manual ver 1 1 20 15 4 2 Ultrasonic sensors Five sensors are placed around the robot and are positioned and numbered as shown in figure below These sensors are transceivers meaning that they can emit and receive the pulses The ultrasonic sensors are powered by a 85 Vpp source The nominal frequency of these transducers is 40kHz 1kHz The returned value is the distance to the object in centimeters with a tolerance of 2cm Measuring range is from 25 to 200cm Every transducer is separated from its neighbor from an angle of 45 Each sensor can be disabled in order to get higher refresh rate for a par
50. nnel with the keyboard left and right arrows and volume with the up down arrows The channels are for speakers of the robot Dac2 Analog for standard control Dac2 Digital Coarse for rough control Dac2 Fine Coarse for fine control You can change left and right with while a channel above is selected with Q and Z for left W and X for both E and C for right And mute left with key Khepera IV User Manual ver 1 1 75 right with key Pushing A will get you more help For modifying the record volume push the Tab key while in alsamixer You change channel with the keyboard left and right arrows and volume with the up down arrows The channels are for the robot Analog Left Main Mic for mute settings of right micro Analog Right Sub Mic for mute settings of left micro Micros left and right are inverted By default the record channels are muted While a channel is selected pushing spacebar will toggle it You can change left and right while the Analog is selected with Q and Z for left W and X for both E and C for right Programming playback and record In the chapter 5 2 2 1 Application development you will find how to modify and compile the examples source code Select the following example for the sound function of test sound khepera4_development lib_khepera 1 0 khepera4_test c Khepera IV User Manual ver 1 1 76 9 5 Development with a virtual machine You can install the development
51. nsions to shutdown properly before this case happens The battery can be charged from 3 places e From the jack e From the contacts situated below the robot e From the KB 250 extensions connectors The battery is charged through an internal battery charge IC that needs 9V of input voltage During its constant current phase the battery is charged with a 1 1A current To charge from the jack only use the provided AC adapter To charge via the contact pads situated below the robot only use the 9Vin and Ground pads Please refer to the contact pads section for more information To charge via the KB 250 extensions connectors use only pin 44 of J701 and a ground pin Max voltage is 9 5VDC Khepera IV User Manual ver 1 1 17 The charge status is indicated on the charging status LED During the charge the red LED turns on The red LED will turn off when the charge is complete The charge will not be enabled if the external supply is plugged when the battery is above 7 95V In this case the red LED will never turn on neither the green LED If the robot is turned on the dsPIC will check the end of charge status in the Fuel Gauge When this status is set 75 10 second after the red LED turns off the charge status LED will turn green If the battery cuts off after a complete discharge the user needs to make a complete charge with the robot on wait for the charge status LED becoming green to update correctly the remaining ca
52. nsors motors and its software openness you will be able to create complex behavior making you an expert of this promising technology 1 1 How to use this user manual This user manual introduces the Khepera IV robot and its various operating modes If this user manual does not answer one of the problems you are confronted with please consult the K Team web site http www k team com and especially the Forum and the FAQs Three kinds of symbols are used in this document in order to keep you and your robot safe please respect them Ignoring the mentioned warning could lead to malfunction or reduced performance Ignoring the mentioned warning could lead to perpetual damage and would void the warranty Danger risk of electric shock Khepera IV User Manual ver 1 1 1 2 Safety precautions Here are some recommendations on how to correctly use the robot e Keep the robot away from wet area Contact with water could cause malfunction and or breakdown e Store your robot in a stable position This will avoid the risk of falls which could break it or cause damage to a person e Use only the official charger or the cable which is delivered with the robot Do not try to use another charger this can cause irreversible damage to the battery and or the electronics e Do not attach any connector while the robot is powered To avoid any damage make all connections when the robot power is off e Never leave the robot powere
53. oducts which is not contained in the Product cosmetic damages damage or loss to any software programs data or removable storage media or damage due to 1 acts of God accident misuse abuse negligence commercial use or modifications of the Product 2 improper operation or maintenance of the Product 3 connection to improper voltage supply or 4 attempted repair by any party other than a K TEAM authorized robot service facility This limited warranty does not apply when the malfunction results from the use of the Product in conjunction with any accessories products or ancillary or peripheral equipment or where it is determined by K Team that there is no fault with the Product itself 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 THE OTHER FOR ANY INDIRECT SPECIAL INCIDENTAL OR CONSEQUENTIAL DAMAGES RESULTING FROM PERFORMANCE OR FAILURE TO PERFORM UNDER THE CONTRACT OR FROM THE FURNISHING PERFORMANCE OR USE OF ANY GOODS OR SERVICE SOLD OR PROVIDED PURSUANT HERETO WHETHER DUE TO A BREACH OF CONTRACT BREACH OF WARRANTY NEGLIGENCE OR OTHERWISE SAVE THAT NOTHING HEREIN SHALL LIMIT EITHER PARTY S LIABILITY FOR DEATH OR PERSONAL INJURY ARISING FROM ITS NEGLIGENCE NEITHE
54. on of your magnet Some trials may have to be done on customer side Khepera IV User Manual ver 1 1 20 4 5 Camera The Khepera IV is equipped with a front color camera disposed below the front ultrasonic sensor The sensor is a MT9V034C12ST from Aptina It s a 1 3 WVGA CMOS sensor Active imager size 4 51x2 88mm Active pixels 752x480 The default lens has a focal length of 2 1mm with IR cut filter and fixed focus The mounting thread is M12x0 5 Diagonal field of view is 150 horizontal is 131 and vertical is 101 See chapter 9 3 Using the camera module for usage 4 6 Microphones The Khepera IV is equipped with two amplified Microphone PUO414HR5H SB from Knowles They are directly connected to the Overo MIC input The right microphone is connected to the MIC MAIN input and the left on the MIC SUB input See chapter 9 4 Using microphones and speakers for usage Gain 20dB Sensitivity typ 22dbv Pa Directivity Omnidirectional Supply voltage 2 5V Their positions on the Khepera are shown on the pictures below Figure 14 Microphones positions Khepera IV User Manual ver 1 1 21 4 7 Loudspeaker A SMS 1308MS 2 R loudspeaker from PUI Audio is mounted on the Khepera IV This speaker is driven by a 1W low distortion power amplifier The speaker is connected on the HSOLF audio output of the OVERO The OVERO can also mute the amplifier with GPIO64 0 MUTE 1 ampli on Speaker Power 0 7W max 1W Imp
55. otor in speed control and the right motor in another mode To put the motor in idle mode no more current drawn by the motors use the open loop control with parameters set to 0 In speed control even with a parameter of 0 the controller will struggle against any movement Khepera IV User Manual ver 1 1 27 4 14 1 Speed control Both DC motors are controlled by a PID controller executed every 10ms in an interrupt routine of the dsPIC Every term of this controller Proportional Integral Derivative is associated to a constant setting the weight of the corresponding term Kp for the proportional Ki for the integral Kd for the derivative The controller has as input the speed value of the wheels and controls the motor to keep this wheel speed The speed modification is made as quick as possible in an abrupt way No limitation in acceleration is considered in this mode The speed unit corresponds to the difference measured in position between the two controllers routine 10ms Here s the formula to convert the speed unit to metric unit Refresh time 10ms Wheel diameter 42mm Revolution resolution 19 456 pulses V pulses S Pwneel en Y pulses e 4207 0 67818ley Speed mm s Re fresh Nb 0 01 19456 pulses pulses Formula to calculate real speed from the measured value The minimum speed order to ensure a correct control is 5 3mm s Under this value the control is not very stable with default PID param
56. pacity The Fuel Gauge DS2781 returns different information available by the application Battery status register see DS2781 datasheet for details Absolute remaining capacity unit 1 6mAh Relative remaining capacity 0 100906 Battery current updated every 3 5s The resolution is 78 125 uA A positive value means a charging current Average current updated every 28s Temperature with a resolution of 0 125 C Battery voltage with a resolution of 9 76mV The battery current is measured through a 20 mQ resistor The battery temperature is accurate only when the charge is not active During the charge internal component heat will perturb the measure You need to consider that the returned value is approximately 109C higher than the real battery temperature especially when charging current is 1A As the charge is not automatically protected against temperature you have to verify it before starting a charge Battery charging temperature range is O to 309C Never attempt to charge it by higher temperature Do not try to charge if room temperature is higher than 30 C Khepera IV User Manual ver 1 1 4 4 Contact pads Eight contact pads are situated below the robot and can be used to connect either to an extension module or to a docking station Figure 12 Contact pads viewed from bottom Pos Signal 9V out 9V in I C Serial clock Ground Ground I C Serial data 9V in 9V out Table 1
57. ram and load this configuration with sudo minicom o bluetooth configuration Filenames and paths File transfer protocols Serial port setup Modem and dialing Screen and keyboard Save setup as dfl Save setup as Exit Figure 9 2 Minicom configuration menu 8 Push RETURN key and the prompt of the robot will be available Figure 9 3 The Angstrom Distribution khepera4 rfcommo Angstrom 2010 7 test 20130613 khepera4 rfcommo khepera4 login Figure 9 3 Robot prompt Khepera IV User Manual ver 1 1 65 9 Login to the robot with the following parameters Login root Password none press Return key gt You are at the prompt of the robot s Linux console 9 1 1 To send a file to the robot upload In the Minicom console hold the keys Ctrl a and press s and select Z Modem Select the file you would like to upload to the robot navigate with the arrows keys 2x spacebar to change directory and spacebar to select the file Select Okay to send it For Windows on Teraterm go to File Transfer Z Modem Send and choose the file to send 9 1 2 To send a file to the computer download In the Minicom console at the prompt of the robot type the following command where FILENAME is the file you would like to send lsz FILENAME gt The file FILENAME is sent to the last directory Minicom used or if not change
58. rections of detectable accelerations TOP view The accelerometer returns 12 bit data two s complement with a range of 2g This means a value of 1g will return a value of 16 384 The data rate is configured to 100Hz as the dsPIC of the Khepera refreshes 10 values at a time the user needs to read every 100ms 10Hz to obtain fresh data Khepera IV User Manual ver 1 1 23 4 10 Gyroscope The gyroscope of the Khepera IV is included in the same package as the accelerometer The directions of detectable angular rates are defined around the accelerometer axis Figure 16 Directions of detectable angular rates TOP view The data format is on 12 bits too the full range is configured at 2 000dps 360dps 5 898 and the data rate is configured at 95Hz The gyroscope data is read by packets of 10 values at a time which means the user can read new data every 105ms to obtain fresh value The output has to be multiplied by 0 066 to have deg s units Khepera IV User Manual ver 1 1 24 4 11 USB Device mini USB B connector A mini USB B connector provides access to a USB to serial adapter FT234XD from FTDI to access directly to the ttyS2 of the Gumstix Using a terminal provides the access to the boot of the system When connecting a computer to this connector for the first time your local system will ask for driver FT234XD driver can be found at http www ftdichip com Products ICs FT234XD html 4 12 Micro
59. red free space e 31 GB on usr local 45 GB including the packed tools e 50 MB on user account Required files e Full toolchain online at http ftp k team com KheperaIV software e Linux packages g patch help2man diffstat texi2html makeinfo ncurses dev cvs gawk python dev python pysqlite2 subversion git chrpath Khepera IV User Manual ver 1 1 GNU C compiler patch software manual converter reads the output of diff and displays a histogram convert to html produce doc texinfo on Ubuntu library allowing the programmer to write libncurses5 dev on Ubuntu revision control system programming language for processing text based data designed dynamic language object oriented programming Python sql interface version control system fast version control system allows you to change the rpath where the application looks for libraries in an application 45 On Ubuntu Linux distribution you can use the following command to install all the above packages in one time sudo apt get install g patch help2man diffstat texi2html texinfo libncurses5 dev cvs gawk python dev python pysqlite2 subversion git core chrpath Included in the DVD ROM of the package Cross compiler and Open Embedded tools sources khepera oetools kbX Y tar bz2 Board library sources libkhepera_X Y tar bz2 Script and files for uploading kernel and file system flash
60. s not possible to charge the robot by this way 3 4 5 USB A connector host This is a USB host capable connector You can plug on it any USB device you want as long as it doesn t draw more than 500mA of current You can for example connect a GPS module or a memory key This connector has its signals shared with the KB 250 Extension connectors meaning that you cannot use USB on Extensions at the same time as on this connector 3 4 6 Power supply jack This is the 0 65mm center positive jack used to charge the internal battery of the robot Use only the provided adapter Input voltage is 9V Current drawn by the robot is 1A so a 1 5 A adapter is needed Khepera IV User Manual ver 1 1 3 4 7 Charging status LED This is a bicolor indication LED showing you the state of the charge There are two modes depending if the robot is powered or not If the robot is off and the AC adapter is plugged the red LED will be on as long as the battery is charging Once the charge terminated the LED will turn off If the robot is on and the AC adapter is plugged the red LED will be on as long as the battery is charging Once the charge terminated the red LED will turn off and the green LED will turn on 3 4 8 Reset button This button serves to reset the whole robot including the extension modules 3 4 9 Infrared sensors There are 8 infrared sensors all around the robot in order to detect obstacles or measure ambient light With these
61. sensors the robot is able to see obstacles from 2 to approx 250mm depending on the calibration the ambient conditions and the obstacle color Each sensor is separated from its neighbor by an angle of 45 3 4 10 Ultrasonic sensors There are 5 ultrasonic sensors 2 on both sides and 1 in the front of the robot With these sensors the robot is able to see obstacles from approx 250 to approx 2500mm Please notice that it is not possible to see nearer obstacles due to the principle of operation of this kind of sensors There is an angle of 45 between two sensors 3 4 11 Camera In the front of the robot there is a color camera with user changeable lens It can be used to take pictures or movies that can be processed on board 3 4 12 Bottom infrared sensors Four infrared sensors are disposed on the bottom of the robot They are used to avoid the robot from falling down but can also be used to follow a line Khepera IV User Manual ver 1 1 10 3 4 13 Contacts for docking station The Khepera IV has some apparent contacts below its body meaning that you could use a docking station to charge its battery or to communicate with it It S also possible to imagine to develop an extension which would be below the robot for example a mechanical base with tracks The signals that are provided are Battery out controlled by a reed relay 9V in I2C 3 4 14 Wheels The robot is differential driven with 2 wheels equipped with O ring T
62. ss network wlan2 interface number get it with command iwconfig Khepera IV User Manual ver 1 1 67 f coeoexooecc etc network interfaces file xxxxx7 auto wlan2 iface wlan2 inet dhcp iface wlan2 inet static wireless mode managed wireless essid YOUR SSID OF NETWORK address YOUR IP ADDRESS netmask YOUR NETMASK gateway YOUR GATEWAY IP J BRK RR KKK KK KK KK KK K K KKK KK AK AK AK KK K K KKK KKK KKK K K K KKK The 3 last following steps are optional but will get you Internet connection 9 2 3 delete the link etc resolv conf rm etc resolv conf insert the local domain name in etc resolv conf echo search YOUR LOCAL DOMAIN NAME gt gt etc resolv conf and the dns server echo nameserver YOUR DNSSERVER IPADDRESS gt gt etc resolv conf Restart the network with the following command etc init d networking restart WEP encryption support for configuring the WiFi connection type iwconfig wlan2 essid YOUR SSID OF NETWORK if the network is secured enter the key by typing iwconfig wlan2 key YOUR KEY then set an IP address to the robot ifconfig wlan2 YOUR IP ADDRESS configure the gateway by entering the gateway IP route add default gw YOUR GATEWAY IP wlan2 insert the local domain name in etc resolv conf echo search YOUR LOCAL DOMAIN NAME gt gt etc resolv conf and the DNS server echo nameserver YOUR DNSSERVER IPADDRESS etc
63. t the three magnets have a total force of adherence of about 2700g Do not put your watch too close of them Never plug a KoreBot 1 2 LE on these connectors Khepera IV User Manual ver 1 1 60 7 1 J700 Pin out Pos Type Name Pos Type Name 1 P 3V3 2 P 3V3 3 P Ground 4 P Ground 5 NC Not Connected 6 NC Not Connected 7 NC Not Connected 8 NC Not Connected 9 O COM1 TX ttySO 10 I COM1 RX ttySO 11 NC Not Connected 12 NC Not Connected 13 I Reset in active low 14 O Reset out active low 15 I O USB device D 16 I O USB device D 17 P USB device VBUS in 18 I O USB device ID 19 O LCD bit 17 20 O LCD bit 16 21 O LCD bias 22 O LCD PCLK 23 O LCD LCLK 24 O LCD FCLK 25 O LCD bit 15 26 O LCD bit 14 27 O LCD bit 13 28 O LCD bit 12 29 O LCD bit 11 30 O LCD bit 10 31 O LCD bit 9 32 O LCD bit 8 33 O LCD bit 7 34 O LCD bit 6 35 O LCD bit 5 36 O LCD bit 4 37 O LCD bit 3 38 O LCD bit 2 39 O LCD bit 1 40 O LCD bit 0 41 NC Not Connected 42 NC Not Connected 43 P 5V 44 P 5V 45 I dsPIC MCLR active low 46 NC Not Connected 47 P Ground 48 P Ground 49 P Ground 50 P Ground Table 2 J700 pin out 7 2 J701 Pin out Pos Type Name Pos Type Name 1 P 3V3 2 P 3V3 3 P 45V 4 P 45V 5 P Ground 6 P Ground 7 O COM3 TX ttyS2 8 NC Not Connected 9 NC Not Connected 10 I COM3 RX
64. test 5 2 2 3 Transferring files You can transfer files to and from the robot by different means The default one is USB see chapter 3 2 You have also Bluetooth chapter 9 1 But WiFi is the fastest way chapter 9 2 5 5 2 3 Debugging You can debug a program you made directly in the console on the robot or remotely You will find on the DVD or online the needed files http ftp k team com KheperaIV software debug 5 2 3 1 Debugging on the robot If not installed on the robot check with command gdb version you need to upload and install the following packages on the robot Install with the command for each ipk opkg install PACKAGE NAME IPK libthread db1_2 9 r37 4 6_armv7a ipk gdb_7 1 r8 4 6_armv7a ipk Then your program must be cross compiled with the option g Edit your Makefile and replace the flag O2 by g Transfer to the robot the compiled program and its source file And run for debugging it gdb YOUR PROGRAM The basic commands are r run n next one step in the program enter in subroutines s one step in the program b line function break at line function delete break delete breakpoint number until line continue until line c continue I list code q quit gdb h help you can have all the commands here Khepera IV User Manual ver 1 1 41 A common sequence of debugging can be e to list the code with e Set a breakpoint at the beginning of main with b main
65. ticular one or group One sensor measure takes 20ms All 5 sensors need 100ms to be read For more details about the ultrasonic sensor please have a look at the 400PT12B datasheet from Prowave Figure 11 Ultrasonic sensors viewed from top Danger High voltage There is about 85Vpp on the PCB in the area of the ultrasonic sensors never touch it Turn the ultrasonic sensors off while recording sound Khepera IV User Manual ver 1 1 16 4 3 Battery The Khepera IV is equipped with an internal non removeable Lithium Polymer battery It is built in a 2S1P configuration giving 7 4V nominal 8 4V charging voltage and a capacity of 3400mAh Nominal voltage 7 4V Cut off voltage 6 0V Charging voltage 8 4V Nominal capacity 3400mAh Max discharge current 3400mA 1C Charging current 1100mA Time for a complete charge about 4 to 5 hours Using its embedded power the robot is able to run completely autonomously during more than 5 hours with motors at 10096 and 7 hours with motors off running with a basic configuration When additional equipment is used the autonomy is reduced as Khepera s extensions like the gripper rely on Khepera s batteries as a power source There is no specific power management system on the Khepera When the battery voltage falls under 6V the battery opens itself the circuit to avoid a deep discharge of the cells Users can implement their own software power management system to handle exte
66. tion control 70000 4 Position 20000 10000 0 0 05 10 15 20 25 3 0 Time s Position profile Khepera IV User Manual ver 1 1 31 This example shows a travel of 475mm 70 000 pulses using the default parameters The position control mode uses the same parameter as the speed profile control to calculate the acceleration ramp The Min Speed Acc parameter is used only at the start When reaching the target position the speed is limited by Min Speed Dec parameter default 1 In addition to these three parameters the travel speed can be configured through Speed Order parameter default 400 Finally the Pos Margin parameter defines the threshold when the position controller stops completely the motor set 0 to the speed controller A low margin will increase the precision but will add an instability to the control It is not recommended to set this parameter below the default value 10 To calculate the real distance travelled by the motor use the formula below Wheel diameter 42mm Revolution resolution 19 456 pulses 42 P ulses Position mm P re DE P NN OH Conte TTT Nb TT 19456 147 453 pulses The position is stored in a signed 32 bits data which means that the maximum position order is 2 pulses 14 563m When performing straight travel same distance on each wheel the best solution is to reset the position encoder before sending the target position command 4 14 4 Op
67. trom linux gnueabi gcc On Cross GCC Linker gt Libraries at Libraries l add khepera with the button on the upper right At Libraries search path add usr local khepera4 oetools tmp sysroots armv7a angstrom linux gnueabi lib On Cross GCC Assembler in Command field modify to usr local khepera4 oetools tmp sysroots i686 linux usr armv7a bin arm angstrom linux gnueabi as Choose C C Build menu at the left Choose Release under the configuration list on the right Repeat the steps above ffor this configuration from 6 Press Finish button Go to menu File gt New gt Source file choose test c as filename Close the Welcome window with its cross at the upper left Insert in the test c file the following C source code include lt khepera khepera h gt int main int argc char argv int rc Set the libkhepera debug level Highly recommended for development kb set debug level 2 printf LibKhepera Template Program r n Init the khepera library if rc kb init argc argv 0 return 1 ADD YOUR CODE HERE return 0 Khepera IV User Manual ver 1 1 40 18 Then cross compile the project with menu Menu Project gt Build All gt The output file will be in the subdirectory Debug or Release of the project 19 Transfer the file test to your robot see chapter 5 2 2 3 20 And execute the program file with command J
68. ttery charge completely In order to do that once the robot out from its packaging please assure it is off switch on the outside plug the charger into the robot jack and then into mains Please consider a time of 5 hours for the initial charge Carefully screw the camera lens in its place at the front of the robot Please do this operation as soon the robot is removed from its packaging to avoid any dust on the sensor You may have to launch a test application to correctly adjust the focus Be sure to remove the cover of the lens in order to use it If the robot was delivered with the lens already installed please be sure that it s clean If not please use a dry microfiber towel to clean it You can have console access through different ways USB described below Bluetooth on chapter 9 1 Using Bluetooth and WiFi on chapter 9 2 Using WiFi 1 Plug the USB cable to the computer and the mini USB side to the robot connector 4 of figure 3 2 2 Switch on the robot power On Windows you cannot open the serial port before 3 Open the serial port corresponding serial port For Windows you can use Teraterm http ttssh2 sourceforge jp with the parameters 115200 baud no parity and no flow control 4 On Linux the FTDI driver is installed by default use minicom to install it on Ubuntu sudo apt get install minicom Open a terminal console and type example below based on Linux minicom s 5 Go the Serial port se
69. ttom where the gdb prompt is run these two commands set sysroot usr local khepera4 oetools tmp sysroots armv7a angstrom linux gnueabi target extended remote YOUR KHEPERA4 IP ADDRESS 1234 The sequence of debugging and also the commands are the same as described above in chapter 5 2 3 1 You can even send your program to the robot with the gdb commands remote put hostfile targetfile set remot xec fil targetfile where hostfile and targetfile is the same name of your new program to be debugged For quitting the debugger and remote execute commands monitor exit then disconnect and finally quit Tips for using the advantage of the GUI o For setting a breakpoint double click on the line you want to put it just before the line number or right click at the same place or choose Set Breakpoint o With the floating menu you have the different commands for debugging o You can add a watch on a variable by clicking with the right mouse button on the variable and choose Display VARIABLE_NAME 5 2 3 3 Remote debugging with Eclipse You can also remotely debug your program with Eclipse see chapter 5 2 2 2 for a proper installation Follow instructions below e Install gdbserver on your robot as explained in chapter 5 2 3 2 above e On Eclipse menu Run gt Debug Configurations double click on C Remote Application gt test Debug is created e In the Main tab gt
70. tup menu and configure as described in figure 3 4 A Serial Device dev ttyUBSO B Lockfile Location var lock C Callin Program D Callout Program E Bps Par Bits 115200 8N1 F Hardware Flow Control No G Software Flow Control No Change which setting Figure 3 4 Minicom serial parameters 6 Save the settings with the command Save setup as dfl of the menu configuration Khepera IV User Manual ver 1 1 7 Wait for the login Figure 3 9 8 Enter the username root for password push RETURN The Angstrom Distribution khepera4 ttyS2 Angstrom 2010 7 test 20130613 khepera4 ttyS2 khepera4 login Figure 3 9 Robot prompt login 9 You are in the directory home root by default after login You can execute a program by preceding its name with khepera4 test 10 In the beginning of the output there is the version of the microcontroller software then the menu Push q and RETURN key to quit 11 You can add a password to the login of your robot with the command passwd You can upload or download a file with the robot at chapters 9 1 1 and 9 1 2 Continue with chapter 5 PROGRAMMING for starting programming Khepera IV User Manual ver 1 1 3 3 Shutdown Reboot Reset Shutdown While logged into the console of the robot it is better to do a proper shutdown than just switching off the robot This will ensure that the open files are correctly closed
71. tware limited warranty Please refer to the End User License Agreements included with the Product for your rights with regard to the licensor or supplier of the software parts of the Product and the parties respective obligations with respect to the software This limited warranty is non transferable 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 Khepera IV User Manual ver 1 1 80 for any damage to or loss of any programs data or other information stored on any media or any part of the Product serviced hereunder or damage or loss arising from the Product not being available for use before during or after the period of service provided or any indirect or consequential damages resulting therefore IF DURING THE REPAIR OF THE PRODUCT THE CONTENTS OF THE FLASH MEMORY ARE ALTERED DELETED OR IN ANY WAY MODIFIED K TEAM IS NOT RESPONSIBLE WHATEVER CUSTOMER S PRODUCT WILL BE RETURNED TO CUSTOMER CONFIGURED AS ORIGINALLY PURCHASED SUBJECT TO AVAILABILITY OF SOFTWARE Be sure to remove all third parties hardware software features parts options alterations and attachments not warranted by K TEAM prior to Product service K TEAM is not responsible for any loss or damage to these items This warranty is limited as set out herein and does not cover any consumable items such as batteries supplied with the Product any accessory pr
72. ured to allow the NFS port access from the robot Once the directory is successfully mounted it can be accessed from the board exactly as if it was a local directory Files on the PC can be read or written new files can be created and programs can be executed as long as they are ARM executables If required the shared directory can be unmounted using the command umount myMountPoint Khepera IV User Manual ver 1 1 71 9 3 Using the camera module The driver of the camera mt9v032 so is loaded by default on start up 9 3 1 Taking images With the v4 2grab program you can take snapshots pictures with the camera v4l2grab o image jpg W 752 H 480 q 85 where image jpg is the output image file in JPEG format 752 is the width of the image in pixel max 480 is the height of the image in pixel max 85 is the quality jpg compression in 9o 9 3 2 Video streaming There is a mjpeg streamer with web server installed by default on the robot e Firstly set a network connection as explained in chapters 9 2 e Then launch the mjpeg streamer with the following command on the robot in one line command only mjpg streamer i input uvc so yuv f 15 o output http so w usr local mjpg streamer www e On a computer connected to the same network you can have access to the video streaming at http KHEPERA4 IP 8080 action stream where KHEPERA4_IP is the robot network address You can stop with the CTRL c
73. ve 19 456 pulses by wheel turn As the diameter of the wheel is 42mm perimeter is then 131 94mm this gives 147 4 pulses by millimeter Or 1 pulse is 0 006782mm 6 7818um Reminder 1 revolution 131 94mm 19 456 pulses Both motors are controlled via Pulse Width Modulation PWM at 20kHz This technique switches the motor ON and OFF at a given frequency and during a given time By this way the motor reacts to the average of the power supply which can be modified by changing the period the motor is switched ON This means that only the ratio between ON and OFF periods is modified as illustrated in the figure below basic period power ON time power power ON OFF time time Figure 18 Duty cycle with PWM Khepera IV User Manual ver 1 1 26 The dsPIC calculates the PWM to apply to each motor in speed control and position control The user can override the PID and apply directly a desired PWM to the motor using the open loop command Default PID settings applied to the Khepera IV controller are Kp 10 Ki 5 Kp 1 These values will be used by the PID speed controller In position control the PID is the same as the position controller calculates a speed order then calls the speed controller to reach this order User can modify these values to improve behaviour to his particular use When selecting a type of control this mode will be applied to both motors It s not possible to set the left m
74. w development folder khepera4 development in your home directory and enter into it You can use the following commands assuming you are in a console mkdir khepera4 development cd khepera4 development 5 2 1 2 Installation of the cross compiler light toolchain Extract the cross compiler khepera4 oetools light kbX Y tar bz2 in usr local with the command sudo tar xjf khepera4 oetools light kbX Y tar bz2 C usr local Remarks You must be root or use sudo You must put the tools there because there are hardcoded links You can check if the installation is correct by running the cross compiler Firstly make the environment variables available then check the version of the cross compiler cd khepera4 development Khepera IV User Manual ver 1 1 35 usr local khepera4 oetools tmp sysroots i686 linux usr armv7a bin arm angstrom linux gnueabi gcc version gt The last command should return arm angstrom linux gnueabi gcc GCC 4 3 3 5 2 1 3 Installation of the robot library The library is already installed on the robot To install the library on your development system follow the following instructions Extract the library libkhepera_X Y tar bz2 in your development folder tar xjf libkhepera X Y tar bz2 C khepera4 development You can recompile the whole library by running the following commands in the libkhepera X Y folder cd khepera4 development libkhepera X Y make clean mak

Download Pdf Manuals

image

Related Search

Related Contents

ダウンロード  取扱説明書 - シーアンドシー    La ferme des Maquis inaugurée  Husqvarna 335RX-Series Trimmer User Manual  en format PDF - und Sehbehindertenverband, SBV  Arduino-Based Dataloggers: Hardware and Software    

Copyright © All rights reserved.
Failed to retrieve file