Home

Software manual for use with color sensors of the Series

image

Contents

1. 0 80 0x00199999 0 75 0x00180000 gt 4206 0000 CCCC 001C 9999 0019 0000 0018 A6B8 2 2 Command reference The following section describes all available commands Data types other then 16 Bit integer a word and 32 Bit fixed point are described at the command description directly The leading hex number represents the command id the rest of the header for example the length and the checksum have to be set appropriately to build a complete communication frame 2 2 1 System Identification 0x01 ID String Response ASCII String with 16 Bit Character width Note Because the communication is 16 Bit based only the lower 8 Bit of each word contain ASCII code The higher 8 Bit are always zero 0x02 Device Production Date Rey 5 1 2009 01 28 Subject to change 22 3061 01 30 PCS Sensor Software ann Technologies GmbH Response 2 words Word 1 Bit 7 0 Day Word 1 Bit 15 8 Month Word 2 Year Note To make the date readable the value must be interpreted hexadecimal 0x03 Device Feature Index Response 1 word Bit 15 0 Device Feature Index 0x04 Device Hardware Revisions Response 2 words Word 1 Bit 15 8 System Board Revision Word 1 Bit 7 0 Communication Board Revision Word 2 Bit 15 8 Sensor Board Revision Word 2 Bit 7 0 Connector Board Revision 0x05 Device Software Revision Response 1 word Bit 15 8 Major Revision Bit 7 0 Minor Revision 0x06 Device Unique S
2. 5 5 0 1 5 a99 b99 L99 5 2 0 1 2 2 6 Color Table Color Recognition Classification 0x50 Write Color Table Entry Send 9 x Fixed Point Fixed Point 1 Entry number integer as Fixed Point Fixed Point 2 Value 1 Fixed Point 3 Value 2 Fixed Point 4 Value 3 Fixed Point 4 Tolerance 1 Quadratic value of tolerance in spherical amp cylindrical mode Fixed Point 5 Tolerance 2 only cylindrical mode corresp to lightness distance Fixed Point 7 Raw Value 1 X Fixed Point 8 Raw Value 2 Y Fixed Point 9 Raw Value 3 Z Note This command writes a complete entry to the 255 entries long color table The first value is the index of this entry The next three entries are the transformed color values of the color to be recognized The two tolerances depend on the classification mode Please see chapter 1 2 4 for more detailed information The last three values are the corresponding raw values to the transformed values A more practical way to create a new entry is to use command 0x56 0x51 Read Color Table Entry Send Entry Number 1 x Fixed Point Response Fixed Point 1 Value 1 Fixed Point 2 Value 2 Fixed Point 3 Value 3 Fixed Point 4 Tolerance 1 Quadratic value of tolerance in spherical amp cylindrical mode Fixed Point 5 Tolerance 2 only cylindrical mode corresp to lightness distance Fixed Point 6 Raw Value 1 X Rey 5 1 2009 01 28 Subject to change 22 3061 01 36
3. Begin of burst data Format according to requested mode DL Begin of burst data Format according to requested mode N es CH Frame checksum higher 8 bit N soe CL Frame checksum lower 8 bit The burst frame has the same structure like all other frames Directly after the header a timing counter TH TL is inserted This counter indicates the time between two successive burst frames in us After that the requested data follows as if it was the payload of the requested burst mode Other commands received by the system during a burst will be accepted and acknowledged accordingly Burst Mode Sequence example Step 1 Enable Burst Mode 2F Mode 1201 0000 0001 1202 Response F000 0000 F000 Step 2 Receive Burst Frames EO0A 0000 22D2 0112 00F9 0075 OEED 0F06 OF8A OFFF OFFF OFFF 62D6 The system will go on sending frames similar to the above The delay between this and the last frame is 8 914ms 0x22D2 The bold values represent the payload as if requested by a 0x2P command Step 3 Stop Burst Mode 1201 0000 0000 1201 Response after the last burst frame F000 0000 F000 2 1 2 Fixed point notation In many cases it is necessaty to use a more precise numbering system than the 16 bit integer number For this reason the sensor system uses a 32 bit fixed point format number which has the following structure Table 13 Fixed Point Format two s complement Bit 31 21 B
4. 0 com_status PCS_sendCommand pcsdev PCSCC_ReadRawADCChannels devid msg_tx msg_tx_len msg_rx amp amp msg_rx_len amp responsecode if com_status PCSCS_OK responsecode PCSRC_OK printf ReadRawADCChannels communication error x x n com_status responsecode else x msg_rx 0 value x y msg_rx 1 value y z msg_rx 2 value z 4 3 Files File Description libpcs dll library and header file libpcs h Makefile Makefile to generate the example executables in this case gcc with cygwin acquisition c shows the sensor color values in Lab color space acquisition exe benchmark c benchmark the USB and serial communication speed benchmark exe identify c reads the sensor identify string identify exe PCSLib_en_x y pdf this documention 4 4 Requirements e installed FID2XX DLL for USB communication e installed development environment Rey 5 1 2009 01 28 Subject to change 22 3061 01 47 PCS Sensor Software ann Technologies GmbH Revision Remark 1 8 Chap 4 commands 0x44 amp 0x56 added command 0x51 0x60 changed Section 4 1 Description of the fixed point format corrected program screen shots updated table 7 changed 1 81 Table 10 section 3 2 2 corrected 2 0 Chap 3 new screenshots of V2 0 implemented new functions documented 2 01 Section 4 8 Command 0x60 edited Section 3 2 3 Hint 2 and table
5. PCS Sensor Software ann Technologies GmbH Example_LiveValues vi File Edit Operate Tools Browse Window Help KS Figure 38 Front Panel of the example VI for the command 0x2F Read Compensated ADC Channels Rev 5 1 2009 01 28 Subject to change 22 3061 01 43 PCS Sensor Software ann Technologies GmbH 4 DLL Function Library 4 1 Introduction The function library PCSLib contains the functionality to communicate and configure the sensors For the communication two PC devices are supported serial interface COM1 COM2 and the USB interface This document describe the library functions its usage and the delivered files 4 2 Library Functions Three function layer are supported e PCS Library Information name version number about the PCSLib e USB Library Initializing of the USB Library e PCS Devices Opening and closing of the interfaces and the communication 4 2 1 Library PCS_VersionString Delivers the PCSLib version string in the following format PCSLIB 1 3 UCHAR PCS _VersionString void Parameters none Return Value string Pointer to the PCSLib version string 4 2 2 USB Library PCS_initUSBLib This function loads the USB library and initializes its functions It is required to call this function before additional USB functions can be used ULONG PCS_initUSBLib void Parameters none Return Value opening status 0 indicates the succ
6. 12 edited Section 3 2 2 Subsection COLOR SPACE MODE Hint added 2 02 Section 3 2 2 Subsection FREQUENCY screenshot replaced Hint 2 added 2 1 Chap 3 new screenshots of V2 1 implemented Section 3 2 3 new function EXPORT TABLE documented 3 01 Chap 2 edited Tab 3 adapted Sect 2 2 added Chap 3 Sect 3 2 2 Subsect SERVICE Command LOAD FACTORY SETT added COLOR OBJECT TYPE edited LIGHT CONTROL replaced by INTENSITY RUNNING MODE edited HYSTERESIS replaced by AVERAGING FREQUENCY edited Chap 4 Sect 4 1 Command sequence example added Command 0x20 edited commands 0x29 and 0x2A added commands 0x54 and 0x55 corrected Chap 6 completely edited additional specifications added 3 02 Chap 3 Sect 3 2 2 Subsect COLOR SPACE MODE Hint 2 added 3 03 Chap 2 Subsect SERVICE SERVICE edited A Sect 1 1 4 edited Chap 2 Sect 3 2 2 Subsect RESULT FORMAT and Subsect RUNNUNG MODE edited Subsect FREQUENCY Table 12 added Fig 28 added 3 11 Sect 2 1 3 Fig 9 added 3 2 Chap 3 Sect 3 2 2 Subsect SERVICE Commands OFFSET CORRECTION SET HYSTERESIS und SET OUTPUT HOLD TIME added Chap 2 edited A3 Chap 3 new screen shots added new functions SCALING OPTION and SENSOR OUTPUT added 3 31 Corrected response codes in communication protocol F1 F2 3 32 specification in tab 25 changed S
7. 3061 01 e PCS Sensor Software SE 1 2 2 Sensor configuration The parameter window appears Figure 4 after choosing a connection at the start of the program The parameter window can always be found under the tab SENSOR PARAMETERS in the upper area of the program window The sensor parameters are read out and displayed in the program window E Pcs ADJUST Vers 3 8 SELECT CONNECTION SENSOR PARAMETERS TEACHING INCOLORS PROCESS COLORS COLOR OBJECT TYPE AUTO ST GAIN AVERAGING SCAN FREQUENCY Passive ei SET GAIN 10 1 kHz v l SENSOR SIGNAL MONITOR cLIPPING INTENSITY 100 i 200 255 SIGNAL GAIN 5 v COLOR SPACE MODE Ltatb ei REFERENCE WHITE SAMPLE DEFAULT REFX 100 0 z E A E lt Z E A z lt 4 EI Kl SG REFZ 100 0 REFY 100 0 PROCESSING MODE CHECK SPH ei RESULT FORMAT SEQUENCE TIMEOUT ms SEQUENCE INTERVAL ms COLOR GROUPING ONE HOT vi 100 100 OFF e RUNNING MODE SAVE PARAMETERS LOAD PARAMETERS CONTINOUS Ww TO SENSOR TO FILE H FROM FILE E Silicann Technologies Figure 4 Window for sensor parameter configuration COLOR OBJECT TYPE At first the type of object that is going to be measured has to be selected in the field COLOR OBJECT TYPE Figure 5 The adjustment ACQUISITION OFF turns the signal acquisition of the sensor off For self shining objects such as lamps LEDs etc choose the ACTIVE mode for non self
8. 8 70 4 3 6 4 4 3 4 0 9 57 0 90 0 5 4 2 8 4 5 SA 36 5 81 1 4 5 6 0 5 6 2z 4 Sa ena 3 9 4 7 6 F ag A 31 2 63 7 4 8 2 7 Figure 23 recognition with cylindrical tolerances COLOR TABLE a b CC TOL GRP o 0 2 o a 99 9 4 0 o K ii 4 3 22 3 80 6 6 2 l 2 29 0 17 4 79 8 7 9 2 3 27 5 25 8 70 4 3 6 3 4 o 57 0 90 0 5 4 4 D SA zeg 81 1 4 5 5 6 22 4 8 9 60 7 3 9 6 z 35 4 31 2 63 7 4 8 3 Figure 22 recognition with spherical tolerances COLOR TABLE af b L 0 2 0 4 99 9 29 0 17 4 79 8 27 5 25 8 70 4 Da 57 0 90 0 Bei 36 5 _ 81 1 22 4 8 9 60 7 a fon fe joo N e o T 4 3 22 3 80 6 35 4 31 2 63 7 Figure 24 grouping of colors There are no tolerance target values needed in the classification mode The recognition mode needs target values one parameter spherical radius column TOL in Figure 22 is required for spherical tolerances and two parameters color column TO ab in Figure 23 and brightness column TO L in Figure 23 tolerance ate required for cylindrical tolerances The latter is favorable in applications where the color brightness plays a less important role than the actual color If the TO L tolerance is hereby set to a high value the influence of the color brightness is correspo
9. Blue Value Word 4 X Red Value Phase I 12 This function is only available for PCS II sensors Rey 5 1 2009 01 28 Subject to change 22 3061 01 33 PCS Sensor Software ann Technologies GmbH Word 5 Y Green Value Phase I Word 6 Z Blue Value Phase I Word 7 X Red Value Phase II Word 8 Y Green Value Phase IT Word 9 Z Blue Value Phase IT Phase I Light Phase no compensation Phase II Dark Phase Note Ranges are 0x0000 OxOFFF The values are averaged according to 0x29 0x0000 represents the darkest 0xOFFF the brightest value 2 2 4 Sensor Correction 0x30 Set Correction Matrix Mode Send 1 word 0 Disabled 1 Sensor Level Correction 2 Sensor Matrix Correction 0x31 Read Correction Matrix Mode Response 1 word like 0x30 0x32 Set Correction Matrix Send 9 x Fixed Point Matrix formula Xc a00 R a01 G a02 B Yc al0 R a11 G a12 B Zc a20 R a21 G a22 B Send order a00 a01 a02 a10 a11 a12 a20 a21 a22 Note The values of the correction matrix are only limited within the range of the fixed point numbers but to let the system perform reasonable color transformations the result of each channel should be between 0 0 1 0 The settings can be verified by using command 0x3F 0x33 Read Correction Matrix Response 9 x Fixed Point like 0x32 0x3F Read Corrected Channels Response 3 x Fixed Point Fixed Point 1 Corrected X Channel Fixed Po
10. PCS Sensor Software ann Technologies GmbH Fixed Point 7 Raw Value 2 Y Fixed Point 8 Raw Value 3 Z 0x52 Set Classification Mode Send 1 Word Bit 15 8 Table size number of valid entries Bit 7 0 0 no classification 1 spherical check with radius check 2 cylindrical check with radius check 3 spherical classification without radius check 0x53 Read Classification Mode Response 1 Word like 0x52 0x54 Set Hysteresis Send 1 Word Note This command sets a classification hysteresis in percent to filter small disturbances within the color recognition The value enlarges the radius of the actual recognized color and makes it more difficult to leave 0x55 Read Hysteresis Response 1 Word like 0x54 0x56 Set Color Table Entry Response 8 x Fixed Point Fixed Point 1 Value 1 Fixed Point 2 Value 2 Fixed Point 3 Value 3 Fixed Point 4 Tolerance 1 Quadratic value of tolerance in spherical amp cylindrical mode Fixed Point 5 Tolerance 2 only cylindrical mode corresp to lightness distance Fixed Point 6 Raw Value 1 X Fixed Point 7 Raw Value 2 Y Fixed Point 8 Raw Value 3 Z Note This command takes the actual light input as entry and auto increments the table size Tolerances are set default to 4 units 0x57 Set Tolerance Defaults Send 2x Fixed Point Fixed Point 1 Default value for Color Tolerance Value 100 Fixed Point 2 Default value for Lightness Distance Valu
11. are eae ab E E RNG aa 35 2 2 6 Color Table Color Kecognitiond Josetticotion 36 224 EE 38 2 2 8 Flash Operations and Parameter 39 STARVE eg CN 41 3L STRUCTURE OF COMMAND V ISren eraen eee eege ge EE Gegen 41 3 2 OPEN RESOURCE VI AND CLOSE RESOURCE NI 41 33 EXAMPLE ege eet ce Eeer Ee EE En 42 4 DLL FUNCTION LIBRARY esesseeesesosseseseceesosossesesoecososossesesecsososoesesevserosorsesesesossorosoeseseesssosoroesessesssossssee 44 4 1 INTRODUCTION RE 44 4 2 LIBRARY FUNCTIONS EE 44 ADD EE 44 ADD USB LIDIA ET 44 EAAS GER EE 45 4 3 FILES wc sssescsscssvestevessccsacsecesessesscoseosetecsessustunessupschetetessetesevecascdseseesucesecouds es tes uesvecsbesecbaeeddovectecstesdebecovesnekey 47 4 4 RGOUImREMENTg 47 Rev 5 1 2009 01 28 Subject to change 22 3061 01 ioe PCS Sensor Software ann Technologies GmbH 1 Software PCS ADJUST The sensors can be extensively configured by PC software Therefore software tools are shipped with the sensors for individually adjusting the sensors to any operational environment The software functions are as follows e Sensor parameter configuration signal gain scanning frequency processing mode etc e Color sampling Teach In procedure e Color processing Recognition and classification e Displaying of color values The function is described in detail in the following sections 1 1 Software installation The software requires the following minimum system para
12. change 22 3061 01 17 PCS Sensor Software ann Technologies GmbH The button TEACH IN stores the current color space values into the next free row of the color table For overwriting a row of the color table the PC cursor must be set into the corresponding row After that the button TEACH IN has to be pressed The button gt CLEAR ROW clears all color values of one row that has been selected by a mouse click The then remaining data rows move up The button CLEAR TABLE clears all entries in the color table EXPORT TABLE The button EXPORT TABLE stores the current contents of the color table into a comma separated spreadsheet file csv onto the disk of the PC The file can easily be processed with common spreadsheet softwate AXIS SCALING With this selection switch 3 scaling methods can be chosen Figure 19 MANUAL AUTO Figure 19 Scaling options MANUAL allows manually editing of the diagram axes by marking and editing the numbers on the axes DEFAULT resets the axes to default values The setting AUTO activates an auto scaling of the axes PROJECTION PLANE The X and Y axes of the color diagram on the right hand side can be selected in field PROJECTION PLANE in order to display the desired color plane out of all three possible 2 dimensional planes of the 3 dimensional color space All colors and tolerances can be completely viewed by this projection plane To fit
13. to the adjusted RESULT FORMAT mode SAVE PARAMETERS There are two switches in the field SAVE PARAMETERS for saving the current parameter settings The switch TO SENSOR stores all parameters into the built in nonvolatile Flash memory of the sensor The parameters will remain in the Flash memory after power down Rey 5 1 2009 01 28 Subject to change 22 3061 01 15 PCS Sensor Software ann Technologies GmbH The switch TO FILE stores all parameters on a memory drive of a computer that is connected to the sensor system LOAD PARAMETERS The switch FROM FILE in the field LOAD PARAMETERS loads a parameter set into the sensor system Hint After starting the software the parameters are automatically loaded from the built in Flash memory into the sensor system Rey 5 1 2009 01 28 Subject to change 22 3061 01 16 PCS Sensor Software ann Technologies GmbH 1 2 3 Teaching In Colors The so called Teach in procedure for sampling and storing colors into the color table is done in the tab TEACHING IN COLORS of the program window Figure 18 COLOR SPACE MODE The currently selected color mode is shown in the field COLOR SPACE MODE in the left hand upper area of the program window EA Pcs ADJUST Vers 3 8 SELECT CONNECTION SENSOR PARAMETERS TEACHING IN COLORS PROCESS COLORS COLOR TABLE TEACH IN e e L Me 0 4 99 9 4 CLEAR ROW 3 22
14. to the sensor system LOAD PARAMETERS The switch FROM FILE of the field LOAD PARAMETERS loads a parameter set into the sensor system Hint The buttons in the fields SAVE PARAMETERS and LOAD PARAMETERS are located in each program tab and perform all the same functionality An entire parameter set is always stored or loaded After starting the program all parameters are read out from the built in Flash memory and are displayed in the program Rev 5 1 2009 01 28 Subject to change 22 3061 01 20 PCS Sensor Software ann Technologies GmbH 1 2 4 Color processing Figure 27 shows the program window for color recognition and classification which can be found under the tab PROCESS COLORS EJ Pcs ADJUST Vers 3 8 SELECT CONNECTION SENSOR PARAMETERS TEACHING IN COLORS PROCESS COLORS COLOR SPACE MODE COLOR INDEX COLOR TABLE ER a ro ab TOL iL ol 5 0 0 PROCESSING MODE COLOR DIST CHECK CYL 1 4 Ir CURRENT VALUES LIGHTNESS DIST 0 6 at D faa oy jen l feo rv SENSOR OUTPUT eeee e008 L 91 1 DEVIATION cox on INTENSITY cupe ae R G B S 50 pl LEEI AXSIS SCALING i epii OI DEFAULT K oj BEE HEH PROJECTION PLANE ses 100 i i ve ir A eG SAVE PARAMETERS LOAD PARAMETERS TO SENSOR TO FILE FROM FILE du el 2 O E Di E 0 SE T Figure 27 Color recognit
15. 3 80 6 17 4 79 8 CLEAR TABLE at 11 b 55 9 EXPORT TABLE COLOR SPACE MODE L a b PROCESSING MODE CHECK CYL CURRENT YALUES aje join ie o 57 0 90 0 D 36 5 8 9 7 3 4 31 2 63 7 4 8 ha io iro fpe he fo fin Kole fs 9 N fa for fo je o ry e Jo N In jalo Joo je jo jo a s EE lala 25 8 70 4 90 7 INTENSITY BE we cipine AXSIS SCALING DEFAULT ei X t PROJECTION PLANE K i i 1 i 1 i 1 i TEA INY 100 75 50 2 0 25 50 75 100 Pts x ER at SAVE PARAMETERS LOAD PARAMETERS TO SENSOR TO FILE FROM FILE u fm j IO T Figure 18 Acquire color sample program window PROCESSING MODE The currently selected processing mode is shown in the field PROCESSING MODE below the field COLOR SPACE MODE CURRENT VALUES This field shows the current sensor data color coordinates as they are transformed within the current selected color space Beneath these values the current color is shown as a visible color sample a valid reference white is the basic precondition for proper color representation COLOR TABLE The color table is located on the right hand upper area of the program window Its function is to store colors for recognition or classification On the left hand side buttons for sampling and erasing colors are located Rey 5 1 2009 01 28 Subject to
16. ECT CONNECTION SENSOR PARAMETERS TEACHING IN COLORS l PROCESS COLORS z 6 B H PCS ADJUST Version 4 0 SERIAL CONNECTION ADDRESS USB CONNECTION Ri y SELECT COM PORT BAUD RATE SELECT USB DEVICE DEVICES DETECTED AUTO v 28800 e DEVICE W C perceptive color sensor SERVICE SERIAL START SERVICE GET ID VIA SERIAL GET ID j STATUS SERIAL STATUS USB Line not checked Line not checked START SERIAL Ul i gi 7 O E d Cc E 0 T Figure 2 Start window Status and error information are displayed in the text box STATUS SERIAL below the button GET ID Rev 5 1 2009 01 28 Subject to change 22 3061 01 4 PCS Sensor Software ann Technologies GmbH USB CONNECTION The program can be started via USB on the right hand side when a USB interface is available The number of detected devices is shown in the field DEVICES DETECTED The desired USB device can be chosen with the switch in the field SELECT USB DEVICES Figure 3 SELECT USB DEVICE DEVICE 2 DEVICE 3 DEVICE 4 DEVICES DEVICE 6 Figure 3 Selecting the desired USB device SERVICE With this switch within the field SERVICE a service tool is started which allows certain special hardware functions and settings The function are described in Section 1 2 5 P 24 2 Only available for sensors with USB port Rey 5 1 2009 01 28 Subject to change 22
17. PCS Sensor Software ann Technologies GmbH Software manual for use with color sensors of the PCS perceptive color sensor Series Silicann Technologies GmbH oachim Jungius Str 9 D 18059 Rostock 8g www silicann com Rev 5 1 2009 01 28 Subject to change 22 3061 01 vs PCS Sensor Software SES 1 SOFTWARE PCS ADJUST cscsscssssscssessscsssscsssscesessssessssnesscssssesssssnsssssnessssnessessessossssenssssssessesoess 3 1 1 SOFTWARE INSTALLATION scccvssisseescussvctesiunessocuevdeveieeniu seein ESEE EE EENS EEE ro E E EENES 3 L2 OPERATION eege Ee 3 1 2 1 Selecting communication interface cccccccccecccesccesceseceseceecssecsecsceeseeesseceeeeeeeseseeceascnaeenaeseaeeaeens 3 L22 Sensor CORNET ENS EEEE EAN EEEE EEE ENEE EEEE 6 12 3 Teaching In e 17 L2ZA Color processing cisini sai nase eae Ar RE EAEE E EEA E EAEE EEEIEE EEE EEE 21 EDD TE 24 2 COMMUNICATION PROTOCOL AND COMMAND REFERENCE csccssssssssssssssssseneesesserseees 27 ZA lt PROTOCOL STRUCTURE sects 530s 5 eiar na aeea AE EASE EEA e ERRE E ESE ES RAA 27 ss Burst Moder wists toda svintioncts inini a N E E R A enna E R 28 21 2 Fixed POmt novation scccrsssthees sive tags E EET EE epee a Re peat eB a 29 222 COMMAND REFERENCE sce eege eege eene eege 30 KE ET 20 22 2 e 31 22 3 EE 32 2 24 Sensor Correchon sisicseseviacecsees dasa vsuscad aa E E E E testbed aden ARs ts 34 22 3 Color Transformatoren stipes ee
18. Read Transimpedance Amplification Response 1 word like 0x22 0x24 Set Illuminating Intensity 10 Only available for sensors with USB port 11 This function is only available for PCS II sensors Rey 5 1 2009 01 28 Subject to change 22 3061 01 3 PCS Sensor Software ann Technologies GmbH Send 1 word Note Values other than 0 255 are ignored 0x25 Read Illuminating Intensity Response 1 word like 0x24 0x26 Set Light Compensation Frequency Send 1 word Note This value represents the time between bright and dark sample phases The value OxFFFF represents a frequency of 100Hz a value of 0x0270 a frequency of 10kHz Values lower than 0x1D0 gt 15kHz may not give the expected results 0x27 Read Light Compensation Frequency Response 1 word like 0x26 0x28 Auto Gain Setup Response 2 words Word 1 automatically found Gain Word 2 automatically found Intensity 0x29 Set Averaging Cycles Send 1 word 0x2A Read Averaging Cycles Response 1 word like 0x29 0x2D Read Raw ADC Channels Response 7 words Word 1 X Red Value Word 2 Y Green Value Word 3 Z Blue Value Word 4 Temperature Sensor Note Ranges are 0x0000 OxFFFO The values are 12 Bit left justified OxFFFO represents the darkest 0x0000 the brightest intensity inverted 0x2F Read Compensated ADC Channels Response 9 words Word 1 X Comp Red Value Word 2 Y Comp Green Value Word 3 Z Comp
19. S DIST The field gt LIGHTNESS DIST shows the magnitude of the brightness distance in the cylindrical tolerances processing mode equal to an altitude difference in the color space EJ Pcs ADJUST Vers 3 8 SELECT CONNECTION l SENSOR PARAMETERS TEACHING IN COLORS PROCESS COLORS COLOR SPACE MODE COLOR INDEX COLOR TABLE L a b 255 PROCESSING MODE COLOR DIST CHECK CYL 24 3 CURRENT YALUES LIGHTNESS DIST Di at 13 4 faa lo fen l feo n b 32 2 SENSOR OUTPUT seseeee0 Li DEVIATION INTENSITY cupins ae R G B S 50 ne AXSIS SCALING DEFAULT Ww t z 1 1 1 INY R S 5 100 wo olr SAVE PARAMETERS LOAD PARAMETERS TO SENSOR TO FILE FROM FILE PROJECTION PLANE Vi v 2 e aS ka y T m 4 La Figure 28 Program window when tolerance was exceeded and color was not recognized The color distance values can be read out by the RS232 or USB interface Hint If in the processing mode CHECK CYL the tolerance room was exceeded or the color was not recognized respectively the brightness distance to the next closest color is calculated and displayed in the field gt LIGHTNESS DIST SENSOR OUTPUT This display signalizes the switching states of the sensor outputs corresponding to the RESULT FORMAT and COLOR GROUPING settings 6 The number of displayed outputs depen
20. Y xyY L a b uv L L u v Lab99 Hint 1 Due to the limited hardware accuracy of the sensor and the used non standard illumination source white light LED the obtained color values in the corresponding color spaces are not colorimetrical accurate Hint 2 The ranges of the color values in the parameterization software differ from the common ranges for color values Table 2 shows the range of the color values for the several color space modes of the software in comparison to the common ranges The visible range of the color diagrams is pre defined to a suitable value To fit the color diagram scales to the desired range the axes can be adjusted by simply editing the numbers on the corresponding axes Table 2 Axis scaling for the parameterization software Color space common range program range Multiple XYZ X 0 100 X 0 100 1 Y 0 100 Y 0 100 1 Z 0 100 Z 0 100 1 xyY x 0 1 x 0 100 100 ye 0 1 y 0 100 100 Y 0 100 Y 0 100 1 L a b L 0 100 L 0 100 1 a 500 500 a 500 500 1 bt 200 200 bt 200 200 1 L u v L 0 100 L 0 100 1 u 1300 1300 or 1300 1300 1 vir 1300 1300 vi 1300 1300 1 uvL L 0 100 L 0 100 1 u 0 1 u 0 100 100 v 0 1 v 0 100 100 DIN99 L 0 100 L 0 100 1 a 500 500 a 500 500 1 b 200 200 b 200 200 1 Rev 5 1 2009 01 28 22 3061 01 S
21. ach color value in the internal color table please refer to sect 1 2 3 subsect COLOR TABLE is directly assigned to one output signal Thus there are as many colors possible as sensor outputs are available ONE HOT INV Refer to ONE HOT but output signals are inverted BINARY The result is encoded binary and thus 2 n number of sensor outputs states are possible The index 255 is used as Not recognized or Out of tolerance in the CHECK mode BINARY INV Refer to BINARY but output signals are inverted DEVIATION If no matching color can be found this result format indicates the color deviation from the first entry of the color table The meaning of the different output ports is shown in Table 5 This mode is only available with the color space modes L a b or LAB99 and processing mode CHECK CYL Table 5 Deviation mode signal assignment Ausgang Anzeigensegment OUTO 1 color detected 0 No color detected OUT Darker OUT2 Brighter OUT3 Deviation to red OUT4 Deviation to green OUT5 Deviation to yellow OUT6 Deviation to blue OUT7 Not used RUNNING MODE The output ports of the sensor system can be used continuously or triggered EXTERN TRG mode The selection can be made in the field RUNNING MODE Figure 13 When continuously used CONTINOUOS the outputs are always updated as fast as the current adju
22. ann Technologies GmbH Joachim Jungius Strahe 9 18059 Rostock Germany TEL 49 381 4059760 FAX 49 381 4059874 E mail info silicann com URL www silicann com The contents of this document are provided in connection with Silicann Technologies Advanced products Silicann Technologies makes no representations or warranties with respect to the accuracy ot completeness of the contents of this publication Silicann Technologies may make changes to specifications and product descriptions at any time without notice Silicann and Silimann are registered trademarks of Silicann Technologies 2009 Silicann Technologies GmbH All rights reserved Rey 5 1 2009 01 28 Subject to change 22 3061 01 A0
23. coded accordingly The appearance of the sequence state on the output port can be adjusted by setting the proper RESULT FORMAT mode The following modes are detected Table 6 Sequence Encoding State Description OFF Waiting for start 0 Sequence active 1 Sequence finished successfully 2 Wrong color detected 3 Trigger Timeout triggered sequence 4 Trigger too early timed sequence Rev 5 1 2009 01 28 Subject to change 22 3061 01 aias PCS Sensor Software ann Technologies GmbH AVERAGING In the field AVERAGING values in the range of 1 65535 for averaging the sensor signals can be adjusted Large averaging values are recommended for pure signal quality Keep in mind that large averaging values reduce the response time of the sensor Table 7 SCAN FREQUENCY The scanning frequency of the sensor system in kHz can be defined in the field SCAN FREQUENCY Figure 16 Figure 16 Sensor system scanning frequency Please notice the following relationship If the scanning frequency is chosen to be low the power consumption of the sensor is low too Illuminant will get darker But if a high scanning frequency is chosen the power consumption rises due to the increasing light intensity Hint 1 The chosen frequency has also influence on the system s ambient light compensation properties In the case of artificial ambient light modulated mainly at 100 Hz a frequen
24. coding Mode 0 0000 off output pins remain unchanged 1 0001 direct 2 0010 1 hot 3 0011 7 segment 4 0100 Deviation 0x61 Read Output Mode Response 1 Word like 0x60 0x62 Set Encoding Map Entry Rey 5 1 2009 01 28 Subject to change 22 3061 01 38 PCS Sensor Software SE Send 2 Word Word 1 Table Entry range 0 255 Word 2 Table Value range 0 255 0x63 Read Encoding Map Entry Send 1 Word Table Entry 0 255 Response 1 Word Table Value 0 255 0x64 Set Sequence Timeout Send 1 Word Note Sequence Timeout for triggered mode in ms 0x65 Read Sequence Timeout Response 1 Word like 0x64 0x66 Set Sequence Interval Send 1 Word Note Time between two automatic samples for timed mode in ms 0x67 Read Sequence Interval Response 1 Word like 0x66 0x68 Set Output hold time Send 1 Word Note This command sets the time for which the resulting output signal will be hold constant on the output pins no matter how short time the detected color was in front of the sensor The time is given in ms 0x69 Read Output hold time Response 1 Word like 0x68 0x6F Read Encoded Output Response 1 Word like encoded output pins 2 2 8 Flash Operations and Parameters 0xA0 Store Parameter store all parameter from RAM to Flash Note Flash write operations can last up to seconds The device must not be interrupted and power supply has to be stable during this ti
25. cy greater than 1 kHz is recommended in order to achieve good compensation properties Hint 2 Due to hardware limitations higher frequencies for higher signal gain settings SIGNAL GAIN gt 5 are not available Table 7 Examples of dependency of response time on adjusted FREQUENCY and AVERAGING values FREQUENCY AVERAGING Response time 1kHz 1 lms 10kHz 10 1ms 1kHz 100 100ms 10kHz 10000 1000ms SIGNAL MONITOR The current sampled signals from the primary sensor are displayed in the graph SIGNAL MONITOR as raw data Their description is shown in the following Table 8 5 The SIGNAL GAIN option is only available for PCS II sensors Rey 5 1 2009 01 28 22 3061 01 Subject to change 244 PCS Sensor Software ann Technologies GmbH Table 8 Description of the signals in the sensor signal monitor Signal color Description Light red Raw data of the red signal bright phase Light green Raw data of the green signal bright phase Light blue Raw data of the blue signal bright phase Dark red Raw data of the red signal dark phase Dark green Raw data of the green signal dark phase Dark blue Raw data of the blue signal dark phase The three color bars red green and blue displayed underneath the sensor signal monitor show the differential signals of the raw data In the self shining mode the signals are identical to the signals in the bright pha
26. d SERVICE at the startup screen a service tool is started which allows certain special hardware functions and settings Figure 30 shows the program window e SERVICE ER E Silicann PCS L F Of D si Service Get Sensor ID Status S Sensor Address Get Address Ho E Reference Correction Auto Gain Level Value e ei SL Select Baud Rate EE 28 Tolerances T S Brightness Tol ES yy 28800 v Set J Jao Offset Correction Analog Outputs Ons Gf Selec Start v Load Factory Settings Ext Teach Behavior Keep Tolerances Auto Increment Load Set Iv EN Save To Sensor Hysteresis Hysteresis Value Save Set RES y Output Behavior ES Hold Times mS fai op CLK Out Modes EXIT j Set gfo Jo a Color Out v Figure 30 SERVICE program window KEY LOCK By this switch the sensor keys are lock or unlocked respectively GET SENSOR ID With GET ID the device serial number and version of the sensor firmware is read from the device and displayed on the right textbox SENSOR ADDRESS With GET ADDRESS in the area of SENSOR ADDRESS the programmed address of the sensor is read out and displayed on the right textbox Underneath this switch there is a field to set the particular sensor address scope 0 255 With SET ADDRESS the sensor is programmed to listen to the chosen address BAUD RATE With the SELECT BAUD RATE switch the sensor communication is reconfigured to the chose
27. ds on the used sensor type Rey 5 1 2009 01 28 Subject to change 22 3061 01 22 User Manual PCS Sensor Software Technologies GmbH DEVIATION If the result format DEVIATION is selected this display interprets the sensors outputs and displays the color deviation in plain text If one of the other result modes is selected this display just shows whether a color is detected or not EJ Pcs ADJUST Vers 3 8 SELECT CONNECTION l SENSOR PARAMETERS COLOR SPACE MODE L a b PROCESSING MODE CHECK CYL CURRENT VALUES at 26 2 Li Cuppmp R G B ul el 2 O E p ke BS E 0 2 T TEACHING IN COLORS PROCESS COLORS COLOR INDEX COLOR TABLE SS CG roab TOL COLOR DIST D 93 9 4 0 4 0 36 7 LIGHTNESS DIST 36 3 fain jn je jo jy e io SENSOR OUTPUT eee e008 DEVIATION GREEN INTENSITY 100 50 o AXSIS SCALING DEFAULT K PROJECTION PLANE a b mg viir SAVE PARAMETERS TO SENSOR LOAD PARAMETERS FROM FILE TO FILE Figure 29 Result format DEVIATION Display of color deviation AXSIS SCALING With this selection switch 3 scaling methods can be chosen ref to above section 7 Only usable for sensors with 8 outputs Rey 5 1 2009 01 28 22 3061 01 Subject to change 23 PCS Sensor Software SE 1 2 5 Service With the switch within the fiel
28. e 100 0x58 Read Tolerance Defaults Response 2x Fixed Point Fixed Point 1 Default value for Color Tolerance VValue 100 Fixed Point 2 Default value for Lightness Distance Value 100 Rey 5 1 2009 01 28 Subject to change 22 3061 01 Es PCS Sensor Software ann Technologies GmbH 0x5F Read Classified Value Response 3 x Fixed Point Fixed Point 1 Index of recognized classified color closest color Fixed Point 2 Quadratic value of distance 1 spherical amp cylindrical mode Fixed Point 3 Value of Distance 2 only cylindrical mode corresp to lightness distance 2 2 7 Output Encoding 0x60 Set Encoding Style Send 1 Word Bit 15 12 Output Mode 0 0000 continuous 1 0001 external triggered 2 0010 trigger controlled sequence 3 0011 timer controlled sequence 4 0100 external triggered teach in 5 0101 self triggered sequence Bit 11 8 Mapping Mode 0 no mapping direct 1 mapping enabled use 0x62 to set entries Bit 7 External Teach Mode Auto increment enable 0 Auto increment disabled 1 Auto increment enabled Bit 6 External Teach Mode Keep previous tolerance values 0 Set default tolerances 1 Keep previous tolerances only useful in combination with Bit 7 Bit 5 External Trigger Modes Automatic fall off enable 0 Automatic fall off disabled 1 Automatic fall off enabled Bit 4 Encoding Polarity 0 not inverted outputs 1 inverted outputs Bit 3 0 En
29. ect 4 2 7 command 0x63 edited 3 33 Screenshots updated specification adapted 3 4 new screenshots added Sect 3 2 1 SERIAL CONNECTION field ADDRESS added Sect 4 1 9 Command 0x60 self triggered sequence added 4 0 old Chap 1 INTRODUCTION AND COLORIMETRIC BASICS Chap 2 SENSOR HARDWARE and Chap 6 SPECIFICATION removed New Chap 4 DLL Function Library added ew output modes Fall off Deviation Keep Tolerances Auto Increment enable Screenshots updated Function SAMPLE Sec 1 2 3 edited new screenshots inserted ew screenshots inserted Commands 0x57 and 0x58 inserted Section 1 2 5 updated Switch KEY LOCK inserted Chap 2 7 sehm mode removed new screen shots added New screenshots Sec 1 2 1 edited Sect 2 2 6 Hint for command 0x52 added om pep eR aR aR aR A aR A aA Nn ew screenshots in Sec 1 2 1 Select Connection and Sec 1 2 5 Service Sec 1 2 5 Service function Button Tolerances introduced Li Sr New screenshots in Sec 1 2 1 Select Connection and Sec 1 2 5 Service Sec 1 2 5 Service function Button Tolerances and Output Behavior edited Rey 5 1 2009 01 28 Subject to change 22 3061 01 _ 48 PCS Sensor Software SE For further information about Silicann Technologies and products please refer at Headquarters Germany Silic
30. entry of the internal color table If it s disabled the last valid color value will be overwritten The function KEEP PREVIOUS TOLERANCES is only useful with disabled AUTO INCREMENT It overwrites the color values and keeps the old tolerance values of the table entry If this checkbox is disabled default tolerances are used The button SET sends the new properties to the sensor SET HYSTERESIS This function guarantees a stable operation of the sensor system It is recommended to chose a high hysteresis value if the signal quality is poor in order to prevent the signal processing from instability flutter The value for hysteresis can be set by pressing SET HYSTERESIS The value adjusted in the field HYSTERESIS VALUE will be set The value are percentages of the pre defined tolerances in the color table refer to sect 3 2 3 8 Only available for 3 Channel sensors Rey 5 1 2009 01 28 Subject to change 22 3061 01 25 PCS Sensor Software ann Technologies GmbH OUTPUT BEHAVIOR Hold Times ms This function sets a hold time for the sensor outputs Using the running modes CONTINOUS and EXT TEACH this function holds the output values for the selected number of milliseconds The max adjustable time is 65535 ms With the Selector C S the corresponding color channel can be adjusted Fall Off If this function is used with an external triggered mode and the chec
31. erial Number Response 2 words Word 1 Device Unique Serial Number high Word 2 Device Unique Serial Number low 2 2 2 Communication 0x10 Set Baud Rate Send 1 word 0 9 600 ie 14 400 2 28 800 default 3 38 400 4 57 600 5 115 200 Note As for all commands the serial baudrate can be set with an USB command 0x11 Set Sensor Address Send 1 word Note Values other than 0 255 are ignored Rev 5 1 2009 01 28 Subject to change 22 3061 01 31 PCS Sensor Software ann Technologies GmbH 0x12 Set Serial Burst Mode Send 1 word 0 Burst Mode off 1 Burst 2F 2 Burst 3F 3 Burst 4F 4 Burst 5F 5 Burst 6F Response Word 0 difference between two burst packages in us Word 1 and following requested data Note For more information about the burst mode feature please refer to chapter 2 1 1 0x13 Set USB Burst Mode like 0x12 only for USB 2 2 3 Data Acquisition 0x20 Set Acquisition Mode Send 1 word 0 no acquisition 1 active light internal triggered 2 passive light internal triggered 3 active light external triggered 4 passive light external triggered 5 active light external triggered inverted passive light external triggered inverted 0x21 Read Acquisition Mode Response 1 word like 0x20 0x22 Set Transimpedance Amplification Send 1 word Amplification factor 1 Amplification factor 5 Amplification factor 25 Amplification factor 100 Se 0x23
32. essful initialisation 1 if an error occurs Rey 5 1 2009 01 28 Subject to change 22 3061 01 44 PCS Sensor Software ann Technologies GmbH PCS_closeUSBLib This function closes the USB library and frees the allocated memoty void PCS_closeUSBLib void Parameters none Return Value none 4 2 3 Devices PCS_getUSBDeviceNum Detects the number of sensors connected to the USB interface UCHAR PCS_getUSBDeviceNum ULONG num Parameters num Pointer that contains the device number Return Value Communication error PCSCS_OK if command successful otherwise the return value is an error code PCS_openDevice Opens a communication device USB or RS232 interface and initializes the internal device memory structure Depending on the device type different configuration parameters are used UCHAR PCS_openDevice struct PCS_Device_def pcsdev UCHAR devtype UCHAR devnr ULONG baud Parameters pcesdev Pointer to device structure to be initialized devtype Device type PCSDT_USB PCSDT_RS232 devnr Device number depending on device type USB or RS232 device baud RS232 baud rate default value 28800 baud Return Value Communication error PCSCS_OK if command successful otherwise the return value is an error code Rey 5 1 2009 01 28 Subject to change 22 3061 01 45 PCS Sensor Software ann Technologies GmbH PCS_closeDevice Closes a previous opened communication device vo
33. frame is not transmitted completely within one second the sensor responds with a timeout code OxF1 Payload 0x08 Command sequence example 1 Setting the light intensity to a value of 0x20 2401 0000 0020 2421 System Response to that command F000 0000 F000 no error Command sequence example 2 Reading actual value of the light intensity 2500 0000 2500 System Response to that command F001 0000 0020 F021 no error 2 1 1 Burst Mode For getting values from the sensor system as fast as possible without querying them a burst mode has been implemented When a burst mode is set by the burst mode command 0x12 this initial command is acknowledged as usual After that the system will send frames of the following structure continuously until stopped by another burst mode command switching the burst mode off again Burst Frame Structure ID LP JAD RR TH TL DH DL Table 12 Burst Frame Build Up Word Byte Name Description 0 0 ID Burst Mode response Code always OxE0 0 1 LP Payload Length in Words lower 8 bit of word 0 1 2 AD Programmable Sensor Address higher 8 bit of word 1 1 3 RR Reserved always 0 lower 8 bit of word 1 2 4 TH Timing information higher 8 Bit of word 2 Rev 5 1 2009 01 28 Subject to change 22 3061 01 28 PCS Sensor Software ann Technologies GmbH 2 5 TL Timing information lower 8 Bit of word 2 DH
34. hat is within the tolerance C3 and hence was recognized as the color C3 CHECK CYL The mode CHECK CYL cylindrical provides a method for assigning cylindrical tolerance spaces Tolerance parameters can be configured separately for color and brightness The measurement principle is shown in Figure 11 Two tolerance parameters color and brightness tolerance are necessary This mode can not be applied in the XYZ color space because there is no coordinate for brightness p Figure 9 Color classification principle Rev 5 1 2009 01 28 22 3061 01 Subject to change 10 PCS Sensor Software Technologies GmbH Figure 10 Color space with spherical tolerances Figure 11 Color space with cylindrical tolerances RESULT FORMAT The user defines in the field RESULT FORMAT how the results of the color checking or classification are represented at the outputs of the color sensor Figure 12 shows the 6 possible output formats and Table 4 shows their descriptions in detail 1 OFF ONE HOT INY BINARY BINARY INY Figure 12 Color processing result formats at the sensor outputs Rey 5 1 2009 01 28 Subject to change 22 3061 01 11 PCS Sensor Software ann Technologies GmbH Table 4 Output formats for color checking and classification Selection Description OFF The outputs keep their last result and are switched off ONE HOT This is a 1 out of N encoding E
35. id PCS_closeDevice struct PCS_Device_def pcsdev Parameters pcsdev Pointer to the device structure Return Value none PCS_sendCommand This function sends a command via the opened communication interface to the sensor and delivers the response UCHAR PCS_sendCommand struct PCS_Device_def pcsdev UCHAR cmd UCHAR devid USHORT txd USHORT txd_len USHORT rxd USHORT rxd_len UCHAR responsecode Parameters pcsdev Pointer to the device structure cmd Code of the command to be send devid Device ID of the sensor for communication 0x00 default for broadcasting All sensors connected to the opened communication interface are addressed txd Pointer to send message txd_len Length of send message rxd Pointer to receive message txd_len Length of receive message responsecode response code Return Value Communication error PCSCS_OK if command successful otherwise the return value is an error code Rev 5 1 2009 01 28 Subject to change 22 3061 01 46 PCS Sensor Software ann Technologies GmbH Code Example include libpcs h RT X Y Zi R devid 0x00 device id RT msg_tx PCS_MAXMESSAGESIZE transmit command data RT msg_rx PCS_MAXMESSAGESIZE received command data RT msg_tx_len msg_rx_len data length rx tx R com_status communication status R responsecode protocol response code AANNNnNAN I PrPOoOOOPrO msg_tx_len
36. int 2 Corrected Y Channel Fixed Point 3 Corrected Z Channel Rey 5 1 2009 01 28 Subject to change 22 3061 01 34 User Manual PCS Sensor Software Technologies GmbH 2 2 5 Color Transformation 0x40 Set Color Space Mode Send 1 word 0 XYZ raw i xyY 2 Ltu v 3 L a b ER L u v 5 Lab99 0x41 Read Color Space Mode Response 1 word like 0x40 0x42 Write Reference White Send 3 x Fixed Point Fixed Point 1 X reference Fixed Point 2 Y reference Fixed Point 3 Z reference Note The values of the correction matrix are only limited within the range of the fixed point numbers but to let the system perform reasonable color transformations the result of each channel should be between 0 0 1 0 A more practical way is to use command 0x44 to set the reference white 0x43 Read Reference White Response 3 x Fixed Point like 0x42 0x44 Set Reference White Response 3 x Fixed Point like 0x43 Note This command takes the actual input light and sets this values as reference white Rey 5 1 2009 01 28 22 3061 01 Subject to change 35 PCS Sensor Software ann Technologies GmbH 0x4F Read Transformed Channels Response 3 x Fixed Point Tabelle 1 Ranges in different Transformation Modes Mode Read order Range 1 Range 2 Range 3 0 X Z Y 0 1 0 1 0 1 1 x y Y 0 1 0 1 0 1 2 u v L 0 1 0 1 0 1 3 a b L ee 2 0 1 4 uf v L
37. ion and classification program window The window arrangement and operation is similar to the program window TEACHING IN COLORS except for the three buttons on the left hand side of the color table which are substituted by three number boxes COLOR INDEX The color number of the recognized or classified color is shown in the field gt CQOLOR INDEX and represents the result of the entire sensor system s signal processing path This number is the equivalent of the row number in the color table If in the recognition checking processing mode the tolerance boundaries were exceeded the color number becomes 255 In addition the result is also available at the sensor system s communication interface COLOR DIST The Euclidean distance between the actual measured color and the recognized or classified matched color value is displayed in the field gt COLOR DIST If the cylindrical tolerance mode is selected the euclidean distance becomes a 2 dimensional distance vector 2 dimensional color vector All other processing modes show a 3 dimensional euclidean distance vector Hint If in the processing modes CHECK CYL and CHECK SHP the tolerance room was exceeded or the color was not recognized Index 255 the distance to the next closest color is calculated and shown in the field gt COLOR DIST Rey 5 1 2009 01 28 Subject to change 22 3061 01 21 PCS Sensor Software Technologies GmbH LIGHTNES
38. it 20 0 Integer part Fractional part This format has a range 1024 with a resolution of 0 000 000 477 The representation corresponds to the two s complement The conversion is described by the following formula F FE 2 fixed real Conversion Example 1 From Float to Fixed Point a Number 1 123 Because the value is positive the formula can be used directly Rev 5 1 2009 01 28 Subject to change 22 3061 01 29 PCS Sensor Software ann Technologies GmbH 1 123 27 2355101 696 2355102 0x0023EF9E b Number 1 123 Because the value is negative the above result has to be converted to a negative two s complement value by inverting and adding 1 0x0023EF9E OxFFDC1061 0xFFDC1062 Conversion Example 2 From Fixed Point to Float a Number 0x0023EF9E Because the most significant bit is 0 this is a positive value Simple convert by using the above formula 0x0023EF9E 2355102 2 2 1 123000 b Number 0xFFDC1062 Because the most significant bit is 1 this is a negative value Before conversion invert and add Nei OxFFDC1062 0x0023EF9E 2355102 1 123000 Important Please pay attention to the word order of the low and high word of the 32 bit number First the lower part Bit 15 0 is transmitted then the higher part Bit 31 16 Communication Example Setting Reference White to 0 9 0 8 0 75 Command 0x42 0 90 0x001CCCCC
39. kbox Fall off is enabled the results fall back after the expiration of the desired number of milliseconds CLK Out Modes With this switch the output function of the CLK output PIN 5 on SB1 can be determined Mode Function User Can be set with command 0x73 CLK Out Output of Illumination clock Color Out Additional color channel SAVE TO SENSOR With this switch the chosen settings will be stored in flash memory permanently Hint If the program is ended without storing the settings to flash memory permanently all information are lost after a restart Rev 5 1 2009 01 28 Subject to change 22 3061 01 26 PCS Sensor Software ann Technologies GmbH 2 Communication protocol and command reference The sensors can be fully controlled via RS232 or USB All commands ate also available as LabVIEW VIs and DLL function library All software is shipped with the sensor system 2 1 Protocol structure There is a uniform protocol for sending and receiving data respectively The smallest communication unit is a byte 8 bits however two bytes are always combined to one word and transferred together Protocol structure ID LP JAD RR IDH DL The high order byte is followed by a low order byte After sending a command word and receiving by the sensor system a status response including error codes is sent back after executing the command Table 10 Protocol Build U
40. me Otherwise the flash may be corrupted and the device may start with an unknown or even a dangerous configuration 0xA1 Read Parameter read stored parameter from Flash into RAM Rey 5 1 2009 01 28 Subject to change 22 3061 01 39 PCS Sensor Software Technologies GmbH 0xA2 Read Factory Settings read factory defaults into RAM Rey 5 1 2009 01 28 Subject to change 22 3061 01 40 PCS Sensor Software ann Technologies GmbH 3 LabVIEW VIs All commands described in chapter 4 are implemented as LabVIEW VIs and are shipped with this color sensor system The following VIs are saved as LabVIEW Version 6 1 libraries on CD Table 14 LabVIEW libraries Library Description libpcs_cmd llb Main library with all commands libtools Ilb Help library for libpcs_cmd Internal shared VIs libft llb Help library for controlling the USB module libpcs_com general functions for communication 3 1 Structure of command VIs All command VIs have the same standard structure Figure 31 Resource LG ransformed channels Figure 31 VI entity Resource Signal The Resource signal is a so called cluster signal Figure 32 and contains information and configuration about the communication interface IsbHandleOut Figure 32 Resource Cluster Signal The signal UsbHandleIn contains the handle for the USB communication The VISAIn signal stores all information for the serial c
41. meters e PC with 300 MHz CPU 40 MB free hard disc space Mouse RS232 interface USB interface for sensors with USB option CD ROM drive VGA graphic with minimum resolution 800x600 e MS Windows OS WIN98 WIN ME WIN2000 WIN XP For installation insert the CD ROM in the CD ROM drive and follow the installation instruction on the screen Or alternatively start the program SETUP EXE from the folder CD drive PCS ADJUST 1 2 Operation 1 2 1 Selecting communication interface The sensor system can be connected via RS232 or USB to the computer Which interface is going to be used has to be selected right after starting the program Figure 1 SERIAL CONNECTION The configuration of the serial interface is placed on the left hand side The communication port can be chosen in the field SELECT COM PORT Figure 1 With ADDRESS the corresponding sensor address can be chosen if several sensors are connected to the serial port refer to SENSOR ADDRESS below in section SERVICE Hint The software is limited to the COM ports 1 to 9 1 Only available for sensors with USB port Rey 5 1 2009 01 28 Subject to change 22 3061 01 ES PCS Sensor Software Technologies GmbH Figure 1 Selecting the RS232 interface port By default the communication port is configured as follows Baud rate 28800 Data bits 8 Parity no Stop bits 1 Flow control no d e PCS ADJUST Vers SEL
42. n baudrate OFFSET CORRECTION Press this button to start a routine that ascertains and corrects the sensors offsets Offsets are the sensors dark signals that are noticeable in the active mode for self shining objects For correct operation the hole of the sensor light input must be darkened Rev 5 1 2009 01 28 Subject to change 22 3061 01 24 PCS Sensor Software ann Technologies GmbH LOAD FACTORY SETT With the LOAD FACTORY SETT switch the factory settings are loaded into the RAM of the Sensor Auto Gain Level This control is to change the factory preset level of 70 Button Tolerances With this controls the default tolerance values for the 5 possible steps can be changed The assignment to the 5 blinking impulses is as follows Tolerance Step T S Blinking impulses Factory Tolerance Value 0 1 3 1 2 6 2 3 9 3 4 15 4 5 20 The left tolerance values operate in the processing mode CHECK SPH In the operating mode CHECK CYL the right tolerance controls are additionally active The can be used to change the brightness tolerances To adopt the adjusted tolerances the SET button must be pushed HINWEIS In the processing mode CLASSIFY the tolerance controls are inactive EXT TEACH BEHAVIOR There are different ways of using the running mode EXT TEACH If the checkbox AUTO INCREMENT is activated the new color will be added as new
43. n be selected in the field SIGNAL GAIN Figure 6 100 Figure 6 Selecting signal amplification gain AUTO SET GAIN The amplification gain and illumination intensity can be automatically adjusted when the switch in the AUTO SET GAIN field is set on The signal range will be set to approx 90 of the entire range Hint Before successfully applying the function AUTO SET GAIN it has to be verified that the sensor system has been put in its operating point and the distance between sensor and objects has been fixed It is recommended that a white colored object or an object with the highest signal amplitude brightest object to be measured is to be used for adjusting the signal amplification gain and further to prevent from overdrive COLOR SPACE MODE The color space which will be used throughout the color measurement is selected in the field COLOR SPACE MODE Depending on the light control setting one of the following color spaces shown in Table 1 can be selected Figure 7 shows the selection field in the field COLOR SPACE MODE 3 Only available for sensors with USB port Rey 5 1 2009 01 28 Subject to change 22 3061 01 ES User Manual PCS Sensor Software Technologies GmbH XYZ xyY Ltuty Labs9 Figure 7 Color space modes Table 1 Color spaces depending on the two types PASSIVE and ACTIVE PASSIVE Body colors ACTIVE Self shining XYZ XYZ xy
44. ndingly low In the right column GRP a group index 0 255 can be assigned if the grouping function is activated The assigned index is encoded according to the adjusted output format RESULT FORMAT Equal group index numbers activate the same sensor output In this way different colors can be mapped to the same output The color diagram is located in the right lower area of the program window 100 0 80 0 60 0 40 0 20 0 0 0 20 0 40 0 60 0 80 0 100 0 1 1 H 100 0 50 0 0 0 Figure 25 Color diagram with tolerance cylinders in the a b plane L 100 0 30 0 80 0 70 0 30 0 20 0 10 0 0 0 i 100 0 50 0 0 0 b Figure 26 L b plane Figure 25 and Figure 26 show an example color diagram in the L a b color space in the processing mode cylindrical tolerances Rev 5 1 2009 01 28 22 3061 01 Subject to change 19 PCS Sensor Software ann Technologies GmbH The sample colors in the right column of the color table correspond to the colors resulting from the color values coordinates in each row The displayed color complies with the real color only if a valid reference white was successfully sampled before The visible colors in the color table are also used for displaying the tolerance boundaries in the color diagram and hence support the user at defining the tolerance boundaries in the diagram Hint 1 Despite the tolerance rooms boundaries ma
45. olored objects on an assembly line that appear in the same order but undetermined in time The time based sequence mode TIMED SEQU works like the triggered sequence mode in principle but only the beginning of a new sequence has to be indicated by a trigger event on TRG 0 After that the sensor automatically compares the colors after a programmable time interval In case a color does not match its corresponding table entry the sequence will reset to entry 0 The adjustment of the timer interval can be done in the field SEQUENCE INTERVAL Figure 15 SEQUENCE INTERVAL ms 100 Figure 15 Interval configuration for timed color sequence Use this mode to recognize a color series of equidistant spaced and timed objects e g a rotating wire with color stripes A third sequence mode is chosen by activating SELF TRIGG SEQ For this mode no external trigger is required The sequence starts by detecting a first color If every color of the color table is recognized in the right order the sequence is finished successfully If the time adjusted in the field SEQUENCE TIMEOUT to detect the next valid color of the color table is exceeded an error signal occurs The same is for detecting the wrong color sequence order The coding of the states shows Table 6 This mode requires the CHECK SPH or CHECK CYL mode Each state of the sequence detection is treated like an ordinary result of a single color detection and is en
46. ommunication interface The communication channel is selected by the signal SERIAL TRUE RS232 FALSE USB error Signal The error signal is a cluster signal and contains error information Figure 33 KS abet ISBstatus 1321 Figure 33 error Cluster Signal 3 2 Open Resource VI and Close Resource VI There are VIs for opening and closing the communication channel Rey 5 1 2009 01 28 Subject to change 22 3061 01 A1 PCS Sensor Software Technologies GmbH Serial F USB 1 LECT BAUD RATE IF SERIAL i BELECT COM PORT IF SERIAL BELECT USB DEVICE user or Figure 34 Figure 35 Open Resource VI EI Be f The switch T Serial F USB selects between RS232 or USB With the selection switch SELECT COM PORT IF SERIAL the used COM Port for the RS232 can be selected Via the selection switch SELECT BAUD RATE IF SERIAL the used baud rate can be chosen With the control SELECT USB DEVICE the desired USB device can be chosen Resourceln x EH Figure 36 Close Resource VI For closing the used com port the VI close resource is provided 3 3 Example Figure 37 shows a block diagram for combination of LabVIEW VIs with the command 0x2F Read Compensated ADC Channels SELECT USB DEVICE 4 Figure 37 Combination with the command 0x2F Read Compensated ADC Channels Rev 5 1 2009 01 28 Subject to change 22 3061 01 42
47. p Word Byte Name Description 0 0 ID Command ID higher 8 Bit of word 0 0 1 LP Payload Length in Words lower 8 bit of word 0 1 2 AD Programmable Sensor Address higher 8 bit of word 1 1 3 RR Reserved always 0 lower 8 bit of word 1 DH Data higher 8 bit DL Data lower 8 bit N geg CH Frame checksum higher 8 bit N WW CL Frame checksum lower 8 bit The Payload length is limited to 255 words Bigger frames will lead to unpredictable behavior of the device Every sensor can have an 8 bit wide address AD The sensor will only respond to commands with this exact address but always to commands with address 0 This address can be set by command 0x11 The checksum is a simple addition of all transmitted 16 bit words including the header After adding all values only the lower 16 Bit will be taken 7 Only available for sensors with USB port Rey 5 1 2009 01 28 Subject to change 22 3061 01 Ka PCS Sensor Software SE Table 11 Response Codes Response Data Value Description OxFO dep oncom Commando executed correctly OxF1 0x00 0x03 Internal status 0x04 Frame wrong checksum 0x05 Frame wrong length 0x06 Frame receive buffer not ready 0x07 Frame unknown error fatal 0x08 Frame timeout 1s OxF2 0x00 Illegal command OxF3 0x00 Command not enabled OxF4 0x00 Invalid parameter Us PO dep oncom Burst mode If a
48. se On the right hand side a color sample is displayed that is being continuously calculated from the actual three color signals Hint 1 The signal data from the dark phase are zero in the self shining mode and thus not visible If the signal data from the dark phase of body colors passive mode are very small they are also not visible Moreover the signal amplitudes from the bright and dark phase can possibly overlap and hence only one color is able to be seen at the same time Hint 2 The color sample on the right hand side of the three color bars reproduces a sound color which is similar to the measured object after setting a good reference white However the color can be incorrect and not 100 identical and shall merely serve as orientation e g during the color sampling process Teach in or when displaying tolerance boundaries in color diagrams COLOR GROUPING In the right lower window region a switch is located to activate or deactivate the color grouping function Figure 17 COLOR GROUPING v OFF ON raan naAnawrrene Figure 17 Activating and deactivating of color grouping function With this function arbitrary colors of the color table can be pooled to groups In this way complex class or tolerance boundaries can be realized After activating the function in the color table an additional column appears to indicate the group index Colors with the same group index are mapped to the same sensor output correspondingly
49. shining objects also called Body Colors choose the PASSIVE Mode The latter are so called body colors and are illuminated by a light source from the sensor system Otherwise the light source is switched off ACQUISITION OFF ACTIVE ACTIVE EXT PASSIVE EXT 1 ACT EXT INV PASS EXT INY Figure 5 Selecting the object type Rey 5 1 2009 01 28 Subject to change 22 3061 01 6 PCS Sensor Software ann Technologies GmbH There are 4 additional EXT modes that are intended to be used with an external trigger soutce to be provided on the TRG 1 input With this modes the sensor can be synchronized with an external frequency The modes with the INV addition invert the TRG 1 signal For self shining objects an ambient light compensation can be realized For non self shining objects a Master Slave operation can be realized in that way that one sensor is switched to the PASSIVE mode and all other sensors are adjusted to the PASSIVE EXT or PASSIVE EXT INV mode The master slave operation is particularly useful for avoiding light interfering effects if several sensor are used in close proximity Additionally differential a signal processing with to sensors is possible INTENSITY With the intensity regulator the brightness of the built in light source can be adjusted SIGNAL GAIN The amplification gain out of 4 gains of the color signals from the primary color sensor ca
50. sted response time When the EXTERN TRG mode was selected the outputs are updated when a rising edge at the input TRG 0 is detected and remain then in this state until the next rising edge occurs 1 CONTINOUS EXTERN TRG TRG SEQU TIMED SEQU EXT TEACH Figure 13 Output signals running mode Additionally the sensor supports two different sequential modes This makes it possible to detect a color sequence defined by the color table in a trigger based mode or in a time based mode The deviation encoding is only available for sensors with 8 output ports Rev 5 1 2009 01 28 Subject to change 22 3061 01 DER PCS Sensor Software ann Technologies GmbH The triggered sequence mode TRG SEQU compares the actual result with an entry in the color table please refer to sect 1 2 3 subsect COLOR TABLE after each appearing trigger on TRG 0 It starts with entry 0 and goes on after every successful comparison correct color to the next entry If a detected color does not match its table entry or the time between two trigger events is too long timeout the sequence will reset to entry 0 The adjustment of the timeout can be done in the field SEQUENCE TIMEOUT Figure 14 SEQUENCE TIMEOUT ms 100 Figure 14 Timer configuration for triggered color sequence You can use this mode to recognize a color series of objects with undetermined object distance and appearance time e g to trigger on c
51. the color diagram scales to the desired range the axes can be adjusted by editing the numbers on the axes PROJECTION PLANE L a L b Figure 20 Selecting a 2 dimensional plane out of the 3 dimensional color space All values stored in the color table except the row index can be manually modified By clicking on a table row the input mode becomes active and numbers can be simply modified by using the keyboard By entering the RETURN key or clicking on another area within the program window the modified values will be stored into the color table There is a scroll bar on the right hand side at the table for scrolling the table up and down The used table columns depend on the selected processing mode PROCESSING MODE and the activated grouping function Variants are shown in Figure 21 Figure 22 Figure 23 and Figure 24 Rev 5 1 2009 01 28 Subject to change 22 3061 01 18 User Manual PCS Sensor Software Technologies GmbH COLOR TABLE at b L GRP 0 4 99 9 o E 22 3 80 6 17 4 79 8 25 8 70 4 57 0 30 0 8 1 36 5 81 1 22 4 Sa 60 7 35 4 31 2 63 7 H N Ki H w on o o N uja fon le foo a je lo 1 N J J A i Liv e Figure 21 classify mode COLOR TABLE ai b LU TO ab Tot GRP D i o 0 2 0 4 99 9 4 0 5 0 o E E 4 3 22 3 80 6 6 2 3 5 1 2 29 0 17 4 79 8 7 9 4 0 2 3 27 5 25
52. the pre defined reference white In general the sensor works fairly well when using the default SDEFAULT reference white PROCESSING MODE The sensor system provides up to 5 different signal processing modes The desired mode can be selected in the field PROCESSING MODE by the menu shown in Figure 8 CLASSIFY CHECK CYL bce e cnDMAT Figure 8 Processing modes Table 3 shows all processing modes and their description in detail Table 3 Processing modes and description Processing mode Description CLASSIFY The actual measured color value is being classified among pre sampled color values A classification is always done independently if the colors match or not As an example shows if there is only one color RED stored all colors will be later classified as RED Figure 9 shows the classification of the actual color value Cm to the stored color C3 because the distance between Cm and C3 is the smallest one CHECK SPH In the mode CHECK SPH spherical it is to be checked if a measured color is within a spherical tolerance room If the measured color is within such a spherical room the check is successful color recognized otherwise the check was unsuccessful color not recognized Rey 5 1 2009 01 28 Subject to change 22 3061 01 o User Manual PCS Sensor Software Technologies GmbH Processing mode Description Figure 10 shows spherical tolerances and a measured color Cm t
53. ubject to change 8 PCS Sensor Software ann Technologies GmbH REFERENCE WHITE For storing a color value as reference white the actual sensor signals can be sampled in by clicking on the button SAMPLE in the field REFERENCE WHITE The signal settings should have set with the GAIN and INTESITY function before sampling the reference white It is also recommended to use a white colored object for reference The function AUTO SET GAIN can simplify adjusting the signal range The button DEFAULT sets the color values for reference white to 100 The color values for reference white can also be manually manipulated by clicking on the number and than editing Hint 1 The reference white is crucial for color measurements and displaying and therefore has to be re sampled at any time when the signal settings such as gain AUTO SET GAIN or light intensity LIGHT CONTROL INTENSITY have changed Hint 2 The reference white is required for proper displaying the color on the monitor and not needed for further signal processing in the color spaces XYZ and xyY On the other hand the reference white is needed for a correct color transformation into the color spaces L a b L u v and Lab99 Therefore sampling of real sensor values is recommended for the color spaces L a b L u v and Lab99 However the sensor works acceptable even though a reference white has not been sampled as long as the color values do not exceed
54. y overlap the color inspection and classification is done always uniquely The order of colors stored as rows in the color table does not affect in any way the color inspection Hint 2 The tolerance parameters are used as AE like units Table 9 shows how the human color perception commonly recognizes color variations in the L a b color space Due to the dependencies of the obtained color values on the used illumination source and the accuracy of the sensor the table only serves as a clue Practical tolerance values must be find individually for the sensor Table 9 Common values of human perception of color variations color variation AE human perception lt 1 very small color variation that can not be seen by the human eye La small color variation that can be seen by trained human eye RS medium color variation that can be seen by average human eye 3 5 5 considerable color variation gt 5 high color variation Hint 3 If the spherical tolerances processing mode is selected the tolerance circles become ellipses in some projection planes due to different scaling of the diagram axes and is however merely a displaying effect SAVE PARAMETERS The switch TO SENSOR stores all parameters into the built in nonvolatile Flash memory of the sensor The parameters will remain in the Flash memory after power down The switch TO FILE stores all parameters on a memory drive of a computer that is connected

Download Pdf Manuals

image

Related Search

Related Contents

PregnanStick™ - Savyon Diagnostics  S/C-Band J Series Compact Medium Power Amplifier VZS/C  Simpson Strong-Tie ABA66RZ Installation Guide  Philips LCD monitor with LED backlight 226V3LSB5  CA 7028 - Chauvin Arnoux  2 CIII marzo-aprile 2010    Des familles d`indicateurs en ressources humaines  CFD-G500  Poulan P4018 User's Manual  

Copyright © All rights reserved.
Failed to retrieve file