Home
User Manual - K
Contents
1. 6 Assembling Instructions 21 7 Serial Communication Protocol 22 8 KNet Communication Protocol 24 K Team S A 3 1 INTRODUCTION 1 1 Safety Precautions Don t plug or unplug any connector or turret when the robot is powered either with batteries or external power supply To prevent damage to the hardware all cables and turrets must be prop erly plugged before switching the robot On or before connecting power supply to the interface Switch Off the robot if not used during a day or longer Please unplug the power supply from the wall socket as well Avoid grabbing or touching the K6300 optical prism Do not try to remove the prism from its socket Try to grab the turret using the eletronic boards only 1 2 Unpacking and inspection Please check your package that should contain a K6300 vision turret and the documenation your are reading currently Check the turret against fig ure 2 1 and especially the optical prism and lens If you notice any damage please contact your K Team products dealer K Team S A 4 2 THE K6300 VISION TURRET 2 1 Overview Figure 2 1 Overview of the K6300 vision turret Figure 2 1 is a general view of the turret when fully assembled the followings details are pointed 1 Optical prism Serial connector Jumper for stand alone mode Lens case K6300 vision board K6300 processor board aD oF W DN The following sections detail the operations required
2. 7 3 Connections 8 4 Serial Communication Mode 10 4 1 Direct Communication 10 4 1 1 Testing the serial link 11 4 2 Communication through a Khepera 12 4 2 1 Detection Test 12 4 2 2 KNet protocol test 12 4 3 Stand Alone Mode 13 5 Programming 14 5 1 Control the Turret from a Khepera Program 14 5 2 Custom User Application and VVL Module System Calls 15 5 2 1 vvlreset bios call 368 4 4 pa musette 15 5 2 2 vvl get line ptr bios call 369 15 5 23 vvl pet mean ptr bios call 375 15 5 2 4 vvl get mean values bios call 376 15 5 2 5 vvl get image _ptr bios call 370 16 5 2 6 vvl get minmax bios call 371 16 5 2 7 vvl get min prof bios call 372 16 5 2 8 vvl get max prof bios call 373 17 5 2 9 vvl aqu image bios call 374 17 5 2 10 vvl get flag ptr bios call 377 17 5 3 Communication with a Khepera Program 17 5 3 1 Using System Flags 18 5 3 2 Custom KNet commands 18 5 4 S Loader Mode 18 5 4 1 Serial link configuration 18 5 4 2 Starting the S loader 19 5 4 3 Loading an application file 19 K Team S A 2
3. 2 Serial communication mode 19200 bps Same as mode 1 3 Serial communication mode 38400 bps Same as mode 1 4 User Application mode 9600 bps Start an appplication stored in the turret s non volatile memory The application should be flashed first using the S loader see section 5 4 for details K Team S A Mode 0 Mode 4 089 Mode 1 Mode 5 Mode 2 Mode 6 Mode 3 Mode 7 Figure 2 3 Jumper positions to select running mode 5 S Loader mode 9600 bps The turret waits for an application to be transfered in RAM and exeucutes it when fully uploaded 6 S Loader mode 38400 bps Same as mode 5 7 Test mode 9600 bps Successive tests are performed and the results are displayed using the serial link Please refer to chapter B for a detailled description of the Serial Com munication mode and methods to use it with a Khepera robot Refer to chapter 5 for instructions concerning turret programs and S Loader mode 2 3 Optical System The K6300 vision turret is based on an optical prism and a pin hole lens to focus the image on the vision sensor The lens is adjusted for a correct image focus with objects placed 10 60cm away from the robot In case of problem concerning the turret optical system please contact your local K Team product dealer K Team S A 7 3 CONNECTIONS 5 The K6300 vision turret is based on a MC68331 processor which is equiped with its own UAR
4. __K63OC user manual version 2 1 april 2003 Documentation Author Pierre Bureau for K Team S A Ch de Vuasset CP 111 1028 Pr verenges Switzerland email info k team com Url www k team com TRADEMARK CKNOWLEDGMENTS IBM PC International Business Machine Corp Macintosh Apple Corp SUN Sparc Station SUN Microsystems Corp LabView National Instruments Corp MatLab MathWorks Corp Webots Cyberbotics Khepera K Team and LAMI LEGAL NOTICE e The content of this manual is subject to change without notice e All effort have been made to ensure the accuracy of the content of this manual However should any error be detected please inform K Team S A e The above notwithstanding K Team can assume no responsibility for any error in this manual K Team S A 1 TABLE OF CONTENTS 1 Introduction 4 1 1 Safety Precautions 4 1 2 Unpacking and inspection 4 2 The K6300 Vision Turret 5 2 1 Ov rview 4 sa da mage Lau da ak sua es Has 5 2 2 Running Modes 5 2 3 Optical System
5. 5 3 Communication with a Khepera Program While an user application is running on the K6300 turret it might need to communicate with the Khepera robot All communication between the robot and the turret are based on the KBus protocol an enhanced SPI bus K Team S A 17 The Khepera robot is always the bus master and any turret is a slave This is why any communication must be initiated from the robot A method to send KNet commands to the turret from a terminal is described in section 4 2 From a Program running on a Khepera a sim ple communication method is to use the system flags If the flags are not enough KNet commands can be customized depending on the application requirements 5 3 1 Using System Flags A set of 64 system flag can be read and changed from both a Khepera program and a turret user application These flag can be used with other standard KNet commands to set up a complex communication between the robot and the turret The robot can read and change the flags using the F command This command is send as any other KNet command The turret application can read and change the flags using the vvl_get_flag_ptr function H 5 3 2 Custom KNet commands Customizing KNet commands is the next available solution to communicate with a Khepera program The low level command table can be redefined so that whenever a KNet command is received an user defined routine will be called instead of the standard system
6. Sloader mode at boot time Second the S loader can be started using the serial communication pro tocol The command run sloader is used to start the loader and the transfer speed will stay the same as the serial communication speed The host terminal terminal display should look as figure 5 2 5 4 3 Loading an application file Once started the S loader simply waits for an executable file to be trans ferred through the serial line Depending on your system and on the terminal emulator you are using several methods are available to send a file The most common is to use a send file command from the terminal emulator As soon as the loading process is initiated one of the turret s led indi cator is switched on The indicator should stay on during the entire loading process and turned off when the download is completed The downloaded application is executed as soon as the transfer is achieved and the following message is displayed S download terminated In case of problem loading an application check all the connections and K Team S A 19 IROM of VY5300 turret C E Franzi P Arnaud K Team SA R2 09 31 May 2000 Serial Communication Protocol jrun sloader Run the selected application JS format Motorola loader mode Figure 5 2 Sloader mode from serial communication configuration and try to use the serial communication protocol using the same baudrate K Team S A 20 SSEMBLING INSTRUCT
7. KBus can be processed as required by the application The following piece of code is one method to send a command to the turret K Bus message syntax bytel turret ID byte2 size of the following in bytes byte3 the command byte4 first command argument OX OX byteN command argument N uint8 message 25 1 Q uint32 size 2 int32 status uint8 ans 1 sc while msg reserve channel 0 tim switch fast Send a Q command status msg send message message size Read the acknowledge status msg receive message ans 1 if status printf Recv c n r ans 0 msg_release_channel 0 K Team S A 14 5 2 Custom User Application and VVL Module System Calls The K6300 turret is able to download and execute custom user application compiled with the appropriate software package Such an application can be written in C or assembly language and it can use the system BIOS library The K6300 BIOS provides the TIM VAR STR SER and COM modules as well as the specific vision VVL module A detailed description of the BIOS APT can be found in the Khepera BIOS Reference Manual and the VVL module is described in the following section turret application structure is the same as a standard Khepera ap plication it should be using tasks and similar BIOS utilities It should be compiled using the appropriate software package either using KT Projec
8. 5 Cream C K Team SA 1028 PreverenGes CH DE VUASSET CP 111 SUWITZerlanD
9. IONS Assembling and disassembling the turret are delicate operations Please operate very carefuly to avoid breaking or bending the connection pins Assembling is the easiest part of the job Simply make sure the pins are correctly aligned with the corresponding socket and press gently the top board Disassembling requires a platic tool to use as a lever It is easy to bend pins by trying to remove the top board too quickly The best method to operate safely is to slightly unplug the board on one side using the lever then slighty unplug the opposite side After a few press on each side the boards should be loose enough for an easy removal nn RE mm Figure 6 1 Assembling and disassembling the turret K Team S A 21 7 SERIAL COMMUNICATION PROTOCOL E eer B Read software version Command B Answer b bios_version protocol_version Effect Read software version stored in the turret s non volatile memory I Read image line Command I line Answer i pixel0 pixell pixel2 pixell58 pixel159 Effect Return the 160 pixels of the given line A decimal value is returned for each pixel of the line separated with commas An image must be acquired first L Set LED state Command L led state Answer l Effect Set the given LED state Each LED can be switched on 1 or switched off 0 M Get min and max pixels Command M Answer m min x min y maxx Max_y Effect Return coordin
10. ROM of minirobot KII Edoardo Franzi September 1 2001 Rev 6 01 beta Serial Communication Protocol Figure 4 4 KNet communication example 4 3 Stand Alone Mode For non Khepera based applications or for debugging purpose the turret can eventually act as a stand alone system In this case direct serial com munication and power supply are provided using a Khepera serial interface The serial communication is exactly the same as described in section 4 1 The turret does not need to be plugged on a robot all the regular turret features can still be used The only difference is a jumper setting required to provide power to the turret regular 2 54mm jumper must be plugged in the correct socket ser item 3 on figure 2 1 K Team S A 13 5 PROGRAMMING z Two main control modes are available to use the K6300 vision turret First it can be controlled as a regular Khepera turret In this case a program running on the robot can interact with the turret using KNet commands Second it can be programmed to match application specific needs and communicate with the robot using a customized protocol 5 1 Control the Turret from a Khepera Program The communication between a Khepera program and the K6300 turret re spect basicaly the rules described in section 4 2 The program can call any supported KNet commands see appendix 8 by sending the correct sequence to the turret The corresponding answers received from the
11. T interface and thus its own serial line The Serial con nector placed on the turret is not an access to the Kkepera serial line as it is usually for other turrets This serial connector is dedicated to serial communication with the turret itself This configuration enables different communication methods with the turret and different connections There is a specific setup to communicate with the Khepera to communicate with the turret and to use the turret as a stand alone system Serial Interface 2 Serial Interface 1 ah Figure 3 1 Serial connections to the turret and or Khepera The power supply jack can be connected to one interface or the other but not to both at the same time If the Khepera is running autonomously embedded batteries will supply the K6300 turret In any case one single power source will supply the entire system The first serial connection is linking the Khepera itself to the host com puter One of the host computer s serial port should be connected to the robot using an interface charger module Do not use the turret serial con nector This connection can be required to send commands to the Khepera and or to debug an user application running on the robot The second serial connection is linking the K6300 turret to the host computer One of the host computer s serial port should be connected to the turret using an interface charger module User applications can be K Team S A 8 dev
12. ates for minimum intensity pixel and maxi mum intensity pixel An image must be acquired first N Read one fourth of image line Command N line Answer n pixel0 pixell pixel2 pixel38 pixel39 Effect Return one pixel out of four for the given line A decimal value is returned for each of the 40 pixels separated with commas An image must be acquired fisrt K Team S A 22 O Get image minimum profile Command O threshold Answer o colunm0 colunm1 colunm2 colunm158 colunm159 Effect Return the computed minimum profile for each column see section 5 2 7 for details An image must be acquired Dart P Get image maximum profile Command P threshold Answer p colunm0 colunm1 colunm2 colunm158 colunm159 Effect Return the computed maximum profile for each column see section 5 2 8 for details An image must be acquired Dart Q Acquire new image Command Q Answer q Effect A new image is acquired S Average value for half a line Command S line Answer s mean first half mean second half Effect Compute the average value for each half of the given line X Transfer image data Command X Answer special Effect Send the complete binary image data to the serial line An image must be acquired first K Team S A 23 8 KNET COMMUNICATION PROTOCOL 3 B Read software version Command B Answer b bios_version protocol_ versio
13. call As some low level definitions are necessary to redefine the command table the K6300 program template should be used as a starting base for any application requiring this feature This template can be downloaded from K Team website and further information is available within the Template itself 5 4 S Loader Mode After being succesfully compiled an user application must be uploaded in the turret memory to be executed Two methods are available to start the Sloader and upload the application 5 4 1 Serial link configuration The serial link has to be properly configured to enable a turret computer communication Please refer to section 3 for a detailed description of nec essary connections and configuration When booting in S loader mode the serial communication speed is set at boot time and the host terminal speed must be set according to the chosen mode Other parameters are set to the usual value K Team S A 18 5 4 2 Starting the S loader Two different methods are available to start the S loader First when boot ing the turret in one of the S loader modes 5 or 6 the loader is auto matically started The communication speed is set according to the chosen mode and the entire loading process will use this baudrate The host ter minal terminal display should look as figure 5 1 OM of VY5300 turret C E Franzi P Arnaud K Team SA R2 09 31 May 2000 format Motorola loader mode Figure 5 1
14. elopped to run on the turret s processor This connection can be used to debug these applications or to send direct commands to the turret for stand alone testing The K6300 vision turret is basicaly designed as an autonomous vision system for the Khepera robot therefore common setup should not require a serial link The turret and the robot can communicate through the KNet bus exchanging informations to build up an effective dual processor system K Team S A 9 4 SERIAL COMMUNICATION MODE Even though the K6300 has been designed to be used as an autonomous embedded vision system serial communication with the turret and or the Khepera can be usefull for development and debbuging purpose The serial line setup and terminal configuration should be the same as the one used for Khepera serial communication please refer to the Khepera User Manual for details Usual commands can be sent to the Khepera robot and completly remote operation is still possible Commands can be sent to the turret using the KNet protocol and the T command as any common turret Moreover some commands can be directly sent to the turret using the turret s serial port 4 1 Direct Communication To enable direct communication between the K6300 vision and the host computer a serial line must be connected from the turret serial connector see section 2 1 to the computer using a k team serial interface This serial interface is provided with a Khepera r
15. ge raw data received from the turret X Ele Seid Er Speed O lt Serial Port Ele Seid Er Speed O lt ___ GrabNewlmage New ___ GrabNewlmage Compute White Balance Press button to grab a new image Figure 4 2 K6300 image grabber The image data need a little bit of processing to be displayed Please refer to the vv6300 CMOS camera datasheet available from www k team com for a detailled description of the image format A test application is also available for download from K Team website to display K6300 images see figure 4 2 K Team S A 11 4 2 Communication through a Khepera Commands can be sent to the turret using the KNet protocol as any usual turret The serial link between the Khepera and the host computer must be set up as usual depending on the robot s running mode see the Khepera User Manual for details The serial cable can be connected to the Khepera itself or to any turret except the K6300 vision turret When switching system power on the Khepera boot message should be displayed on the terminal Normal Khepera commands can be sent and the robot should react as usual 4 2 1 Detection Test Once the serial link between the Khepera and the host computer is valid the net command should be used to detect all turrets plugged on the KNet The K6300 vision turret must be detected as displayed on figure 4 3 c 1992 2001 Edoardo Franzi uKernel Operat
16. iece of code uint16 mean pair vvl get mean values uint8 left mean uint8 mean pair gt gt 8 uint8 right mean uint8 mean pair 5 2 5 vvl get image ptr bios call 370 const uint8 vvl get image ptr void This function returns a pointer to the raw array of 160 x 120 bytes directly encoding the individual pixel values To access the pixel located at the position x y use the following piece of code const uint8 ptr vvl get image ptr uint8 pixel ptr x yx160 5 2 6 vvl get minmax bios call 371 uint32 vvl get minmax void This function returns the co ordinates of the minimum intensity pixel and of the maximum intensity pixel The co ordinates are encoded in the 32 bit result as xmin ymin xmax ymax Use the following piece of code to extract the individual co ordinates uint32 encoded vvl_get_minmax uint8 x_min uint8 encoded gt gt 24 uint8 y_min uint8 encoded gt gt 16 uint8 x_max uint8 encoded gt gt 8 uint8 y_max uint8 encoded 5 2 7 vvl get min prof bios call 372 const uint8 vvl get min prof uint8 max level This function computes the minimum profile of each column there is a total of 160 columns It searches the pixel with the lowest intensity and stores its position in the column in the range 0 119 If the intensity of the given pixel is above the maximum level then its position is discarded and 255 is stored instead If every pixel shou
17. ing System edoardo franziBukos ch implementation for K Team 5 4 CALM 68xxx implementation Design amp Development by Edoardo Franzi All rights reserved OM of minirobot KII Edoardo Franzi September 1 2001 Rev 6 01 beta erial Communication Protocol et 15300 25 160x120 pixel camera EF P 99 Rev 1 02 Figure 4 3 Detection test result 4 2 2 KNet protocol test If the turret is correctly detected serial commands can be tested The usual T syntax must be used to send commands through the Khepera to the turret Anyone of the supported KNet commands can be executed and should return the corresponding answer please refer to appendix 8 for further detail K Team S A 12 The most basic test is to use the B command to get the turret software version Typing T 25 B should launch the command then both version and revision number should be returned More complex interactions require parameters for instance to read line 10 from the acquired image Image acquisition is done after sending a T 25 Q command The required line is returned by typing T 25 1 10 The above commands and command results are displayed on Figure 4 4 as a communication test example c 1992 2001 Edoardo Franzi uKernel Operating System edoardo franzi ukos ch implementation for K Team S A dd CALM 68xxx implementation Design amp Development by Edoardo Franzi All rights reserved
18. ld be considered set max level to 255 The following piece of code prints the y position of each minimum pixel value column by column K Team S A 16 uint32 x const uint8 profile vvl get min prof 255 for x 0 x lt 160 x printf x 3d gt y 3d n x profile x 5 2 8 vvl get max prof bios call 373 const uint8 vvl get max prof uint8 min level This function computes the maximum profile of each column there is a total of 160 columns It searches the pixel with the highest intensity and stores its position in the column in the range 0 119 If the intensity of the given pixel is below the minimum level then its position is discarded and 255 is stored instead If every pixel should be considered set min level to 0 See vvl get max prof for an example 5 2 9 vvl_aqu_image bios call 374 void vvl_aqu_image void This function takes a snapshot with the camera The acquisition of the image takes about xx us You must call this function before you call one of the following functions or their result will be undefined vvl_get_line_ptr vvl_get_mean_ptr vvl_get_mean_values vvl_get_image_ptr vvl get min prof vvl_get_max_prof 5 2 10 vvl_get_flag_ptr bios call 377 uint8 vvl_get_flag_ptr void This function returns a pointer to 64 uint8 flags 8 bit values which can be freely used by the user The host can check or modify these flags through the K bus command F
19. n Effect Read software version stored in the turret s non volatile memory F Read and Change system flags Command F flag operation code Answer f flag_value Effect Read a flag and possibly modify it This command has a single argument consisting of the flag number added with an operation code The flag number is in the range 0 63 and the operation code can be either 0 just read the flag 64 read and set the flag 128 read and clear the flag 192 read and change the flag ie F 72 will read and set flag number 8 I Read image line Command I line Answer i pixel0 pixell pixel2 pixell58 pixel159 Effect Return the 160 pixels of the given line A decimal value is returned for each pixel of the line separated with commas An image must be acquired first O Get image minimum profile Command O threshold Answer o colunm0 colunm1 colunm2 colunm158 colunm159 Effect Return the computed minimum profile for each column see section 5 2 7 for details An image must be acquired Dart K Team S A 24 D Get image maximum profile Command P threshold Answer p colunm0 colunm1 colunm2 Effect colunm158 colunm159 Return the computed maximum profile for each column see section 5 2 8 for details An image must be acquired Dart Q Acquire new image Command Q Answer q Effect A new image is acquired K Team S A 2
20. obot package A terminal emulator should be running on the host computer make sure the cable is connected to the correct serial port Terminal configuration should be set to 8 bit data 1 start bit 2 stop bit and no parity OM of VY5300 turret C E Franzi P Arnaud K Team SA R2 09 31 May 2000 erial Communication Protocol Figure 4 1 K6300 boot message K Team S A 10 The turret s running mode sets communication speed Default mode for a turret is Serial communication 38400 bps Any Serial commu nication mode can be used according to the desired communication speed see section 2 2 for details When switching the system power on the turret boot message should be displayed on the terminal as on figure 4 1 If the message is not displayed check the serial connection and the turret running mode If random char acters are displayed check the serial communication speed according to the turret running mode 4 1 1 Testing the serial link If the boot message is correctly displayed the turret is ready to receive serial commands A complete list of commands is available in appendix 7 The B command can be sent to test the turret connection If the answer is correct an image acquisition test should be performed The Q command should be sent to acquire a new image and the command should start the download A long serie of characters should be displayed on the terminal these are the ima
21. t or a correct Makefile While a program is running on the turret it is still receiving and processing serial commmands from the KNet 5 2 1 vvl reset bios call 368 int32 vvl_reset void Call this function once before using any other vvl_ function This initialises the module and sets up the hardware interface and the camera 5 2 2 vvl_get_line_ptr bios call 369 const uint8 vvl_get_line_ptr int32 line This function returns a pointer to the specified line of 160 pixels The line argument must be in the range 0 119 If outside of this range the function returns a pointer of value OxFFFFFFFF or 1 5 2 3 vvl_get_mean_ptr bios call 375 const uint8 vvl_get_mean_ptr void This function returns a pointer to 120 pairs of mean pixel values The pair consists of the mean value of left half pixels 0 through 79 and the mean value of the right half pixels 80 through 159 of each line To access the left mean value of line number 25 you would access byte number 2 25 0 To access the right mean value of the same line you would access byte number 2 25 1 5 2 4 vvl get mean values bios call 376 uint16 vvl_get_mean_values void K Team S A 15 This function returns the overall mean values of the left half and of the right half of the image Each half is 80 pixels wide and 120 pixels high The left and right values are stored as the high and low byte of the returned value To extract them use the following p
22. to set up and tune the K6300 vision turret Please refer to appendix 6 for instructions on turret assembling and disassembling 2 2 Running Modes The K6300 vision turret is equiped with a Motorola MC68331 processor a RAM memory bank and a Flash memory bank A completely indepen dant Operating System is running on this CPU it provides a complete set K Team S A 5 of functions and a Khepera standard API to use and program the embed ded vision system Depending on the requested operating mode different running modes are available To set up the turret running mode the processor board should be first disassembled from the vision board Refer to appendix 6 for instructions The processor board is such as displayed on figure 2 2 and the following details are pointed 1 Jumper for stand alone mode Serial connector Flash memory MC68331 processor Reset button Running mode jumpers Dork WwW bd Figure 2 2 Overview of the MC68331 processor board The running mode is set by the jumpers position when reseting or switching the turret on This will determine the serial communication speed and the operating mode for the turret Various jumper settings are detailled on figure 2 3 and refer to the fol lowing mode descriptions 0 Unused 1 Serial communication mode 9600 bps Mode to control the turret using the Serial communication protocol
Download Pdf Manuals
Related Search
Related Contents
58000223 Iss 09 - HE6137-39 Claudgen Flow Bedienungsanleitung Mode d`emploi Istruzioni d`uso - Migros ASUS M70AD J8553 User's Manual Philips 46677410483 halogen lamp Programme Jeune public - Festival Cinéma d`Alès ダクト挿入形湿度検出器 - ジョンソンコントロールズ Telit Wireless Solutions GE864 User's Manual König TVS-KN-FSB010B flat panel wall mount 1,9 MB Istruzioni per l`uso e l`installazione Copyright © All rights reserved.
Failed to retrieve file