SerSenSchnittstelleKSS51 08.02.00 en
1 of 17
SOFTWARE
KR C...
Serial Sensor Interface
KUKA System Software (KSS) 5.1
2 of 17
SerSenSchnittstelleKSS51 08.02.00 en
e
Copyright
KUKA Roboter GmbH
This documentation or excerpts therefrom may not be reproduced or disclosed to third parties without the express permission of the publishers.
Other functions not described in this documentation may be operable in the controller. The user has no claim to these functions, however, in
the case of a replacement or service work.
We have checked the content of this documentation for conformity with the hardware and software described. Nevertheless, discrepancies
cannot be precluded, for which reason we are not able to guarantee total conformity. The information in this documentation is checked on a
regular basis, however, and necessary corrections will be incorporated in subsequent editions.
Subject to technical alterations without an effect on the function.
PD Interleaf
3 of 17
SerSenSchnittstelleKSS51 08.02.00 en
Contents
1
General
5
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2
Installation / uninstallation / update
6
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3
Configuration
7
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.1
HW_INF.INI
7
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.2
PERCEPT.INI
7
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.3
IOSYS.INI
8
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.4
$CONFIG.DAT
8
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.5
PERCEPT.SRC
9
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4
Functions of the Perceptron
â
â
â
â
laser measurement system
10
. . . . . . . . . .
4.1
Triggering a measuring procedure
10
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4.2
Wait for end of measuring procedure
11
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4.3
Read measurement data
12
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4.4
Calculate measurement result
13
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4.5
Measurement start
13
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4.6
Start individual point measurement
14
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4.7
Measurement end
14
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4.8
Send sensor angle
15
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5
Example programs
16
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Serial Sensor Interface
4 of 17
SerSenSchnittstelleKSS51 08.02.00 en
5 of 17
SerSenSchnittstelleKSS51 08.02.00 en
1
General
In this documentation, the configuration and use of the serial sensor interface add--on
module is described using the example of the Perceptron
â
laser measurement system.
This measurement system is fitted with a standard RS232 or RS422 serial interface. Data
are transferred using the software “communication task 1176” in accordance with protocol
3964R.
It is connected by default to the COM3 serial port on the robot controller (different
configurations can be made in the file percept.ini). The system is controlled by setting outputs
in the KRL program which cause a “message” to be sent via the serial interface.
Serial Sensor Interface
6 of 17
SerSenSchnittstelleKSS51 08.02.00 en
2
Installation / uninstallation / update
From system software version 5.1 onwards, technology packages are offered exclusively as
add--on software modules. These are available on CD--ROM. Should you be interested in
purchasing further modules, please contact KUKA Support.
The installation procedure is the same for all technology packages and is described in a
separate documentation module.
The installation, uninstallation, reinstallation and update of technology
packages are described in detail in the documentation
“Installation/Uninstallation/Update of Tech Packages”.
3
Configuration
7 of 17
SerSenSchnittstelleKSS51 08.02.00 en
3
Configuration
3.1
HW_INF.INI
In the [SERIAL] section of this file, which is located in the directory
c:\KRC\roboter\init, the available serial interfaces are assigned to one of the two
operating systems, Windows95 or VxWorks.
In the following example, management of the third serial interface is assigned to the real--time
operating system VxWorks.
HW_INF.INI
...
;important information to use serial ports (COMx) with V5.1 and higher
;COM1
no longer useable
;COM2
only useable with special ENABLE
;COM3
DISABLE / ENABLE (default) / CONSOLE
[SERIAL]
;ENABLE:
COM is accessible by robot (vxWorks)
;DISABLE: COM is accessible by Win95
;CONSOLE: for developer only
COM3=ENABLE
;[ENABLE, DISABLE, CONSOLE]
3.2
PERCEPT.INI
This file in the directory c:\KRC\roboter\init provides information for initializing the
measurement system protocol driver (protocol 3964R). The parameters “number of data
bits” <8>, “number of stop bits” <1> and “parity declaration” <even> are fixed.
PERCEPT.INI
...
[VERSION]
VERSION=x.x.x
[PERCEPTRON]
;baudrate | valid rates: 9600, 19200
BAUD=9600
;BAUD=19200
;comport | valid ports: 1, 2, 3
COM=3
;timeout (wait seconds for measurement complete)
TIMEOUT=10
;testprint on telnet if value > 0
TESTAUSGABE=0
[END SECTION]
Serial Sensor Interface
8 of 17
SerSenSchnittstelleKSS51 08.02.00 en
3.3
IOSYS.INI
This file is located in the directory c:\KRC\roboter\init. The PERCEPTRON driver
must also be loaded when initializing the system. For this, the file name and associated initial-
ization routine for the CALL--P interface must be named.
The driver is accessed via the controller’s internal I/O map. Output and input data words are
reserved for this purpose.
Make sure that the assignment of inputs and outputs to the measurement system
corresponds to the signal allocation in the PERCEPT.SRC file (see also Section 3.5).
If the driver is deactivated, e.g. the relevant file entries are turned into comments in the
[DRIVERS] section, the application program stops when a “PERCEPTRON” function is
called and waits in vain in the module PERCEPT.SRC for the measurement result.
[DRIVERS]
MFC=0,mfcEntry,mfcdrv.o
PERCEPTRON=4,percInit,percdrv.o
Detailed information on the file IOSYS.INI can be found in the chapter [I/O System].
3.4
$CONFIG.DAT
This file is located in the directory c:\KRC\roboter\KRC\R1\system. It contains, among
other things, the definitions of the globally valid variables which record the results of the
measurements and calculations of the measurement system. In addition to this, data words
are reserved here which are used by the measurement system as status registers.
The ranges of values are limited as follows:
Measurement result:
X, Y, Z
--99.999 mm ... 99.999 mm
A, B, C
--32.769 ° ... 32.767 °
Calculation:
--999.999 ... 999.999
DEFDAT $CONFIG
...
;FOLD PERCEPTRON GLOBALS
;==============================
; External declarations:
;==============================
EXT PERCEPT(INT:IN,INT:IN,INT:IN,INT:IN,INT:IN,INT:OUT)
;==============================
; Variables:
;==============================
INT PERCEPT_32
INT PERCEPT_33
INT PERCEPT_34
REAL PERCEPT_REL
FRAME PERCEPT_KOR
;ENDFOLD (PERCEPTRON GLOBALS)
3
Configuration (continued)
9 of 17
SerSenSchnittstelleKSS51 08.02.00 en
3.5
PERCEPT.SRC
This KRL program file must be stored in the directory C:\KRC\roboter\R1\TP\percep-
tron. Communication between the application program and the measurement system is
carried out via the PERCEPT(...) function.
Make sure that the assignment of inputs and outputs to the measurement system
corresponds to the signal allocation in the $IOSYS.INI file (see also Section 3.3).
Serial Sensor Interface
10 of 17
SerSenSchnittstelleKSS51 08.02.00 en
4
Functions of the Perceptronâ
â
â
â laser measurement system
The format for a measurement system function call reads as follows:
PERCEPT (CMD,PARA1,PARA2,PARA3,PARA4,STATUS)
(All components are integers)
If an unrecognized number is used for a command, the feedback parameter STATUS has
the value 1000.
4.1
Triggering a measuring procedure
This function sends the “start measuring procedure” message to the measurement system;
this is confirmed with the “start measuring procedure confirmation” message if the
connection and the measurement system are in order and ready for operation.
The system then waits for the “measuring procedure complete” message; once this is
received the “measuring procedure complete confirmation” message is sent back.
In the event of problems with the connection, you can increase the variable TIMEOUT
(cf. also Section 3.2).
CMD
1
Command number
PARA1
1...40
Space model number of measured object
PARA2
0...255
Number of sensors
PARA3
0...65535
Color
PARA4
1...9
Phase of the measurement
STATUS
0
=
OK
1
=
Measurement system switched
off
2
=
Measuring procedure in
progress
3
=
An error has occurred
1001 =
A parameter is outside
the permitted range
1002 =
The format of the message
is incorrect
4
Functions of the Perceptron) laser measurement system (continued)
11 of 17
SerSenSchnittstelleKSS51 08.02.00 en
4.2
Wait for end of measuring procedure
This command is used if the measuring procedure is triggered by an external host computer
or PLC controller.
The function waits for the “measuring procedure complete” message and, once this is
received, sends back the “measuring procedure complete confirmation” message.
In the event of problems with the connection, you can increase the variable TIMEOUT
(cf. also Section 3.2).
CMD
2
Command number
PARA1
Not used here
PARA2
Not used here
PARA3
Not used here
PARA4
Not used here
STATUS
0
=
OK
1002 =
The format of the message
is incorrect
Any other value means that
an error has occurred
Serial Sensor Interface
12 of 17
SerSenSchnittstelleKSS51 08.02.00 en
4.3
Read measurement data
This function sends the “communicate workpiece position” message to the measurement
system and then waits for the “communicate workpiece position confirmation” message.
CMD
3
Command number
PARA1
1...40
Space model number of measured object
PARA2
10...98
Visual location number
PARA3
Not used here
PARA4
Not used here
STATUS
0
=
Visual location of the
workpiece completed
1
=
Image information could
not be evaluated
2
=
Deviation of workpiece
position greater than
75% of the defined
tolerance value
3
=
Deviation of workpiece
position outside tolerance
range
4
=
Visual location was not
possible
5
=
Results of visual
location not known
6
=
Visual location sent
manually
7
=
Backup location
sent
9
=
Average location
sent
1001 =
A parameter is outside
the permitted range
1002 =
The format of the message
is incorrect
Once the confirmation message has been received, the global structure PERCEPT_KOR
contains in its components X, Y, Z, A, B and C the result of the measuring procedure.
PERCEPT_KOR.X; offset in x [-99.999...99.999 mm]
PERCEPT_KOR.Y; offset in y [-99.999...99.999 mm]
PERCEPT_KOR.Z; offset in z [-99.999...99.999 mm]
PERCEPT_KOR.A; rotation about z [-32.769...32.767 degrees]
PERCEPT_KOR.B; rotation about y [-32.769...32.767 degrees]
PERCEPT_KOR.C; rotation about x [-32.769...32.767 degrees]
4
Functions of the Perceptron) laser measurement system (continued)
13 of 17
SerSenSchnittstelleKSS51 08.02.00 en
4.4
Calculate measurement result
This function sends the “calculate measurement result” message to the measurement
system and then waits for the “calculate measurement result confirmation” message.
CMD
4
Command number
PARA1
1...40
Space model number of measured object
PARA2
‘A’...‘L’
Zone
PARA3
1...9
Calculation formula
PARA4
Not used here
STATUS
0
=
OK
1
=
An error has occurred,
calculation could
not be carried out
999 =
Calculation formula not
selected or not available
1001 =
A parameter is outside
the permitted range
1002 =
The format of the message
is incorrect
The global variable PERCEPT_REL contains the result of the calculation.
4.5
Measurement start
This function sends the “measurement start” message to the measurement system and then
waits for the “measurement start confirmation” message, but not for the “measurement com-
plete” message. This is used to initialize the measurement system for measuring individual
points.
CMD
5
Command number
PARA1
1...40
Space model number of measured object
PARA2
0...255
Number of sensors
PARA3
0...65535
Color
PARA4
1...9
Phase of the measurement
STATUS
0
=
OK
1
=
Measurement system switched
off
2
=
Measurement system
currently in operation
3
=
An error has occurred
1001 =
A parameter is outside
the permitted range
1002 =
The format of the message
is incorrect
Serial Sensor Interface
14 of 17
SerSenSchnittstelleKSS51 08.02.00 en
4.6
Start individual point measurement
This function sends the “start individual point measurement” message to the measurement
system. This begins with the measuring procedure and sends the “start individual point
measurement confirmation” message which is received by the function.
CMD
6
Command number
PARA1
1...999
Measurement point number
PARA2
Not used here
PARA3
Not used here
PARA4
Not used here
STATUS
0
=
OK
1-255=
An error has occurred
999 =
Sensor not switched
on or not present,
or point no. invalid
4.7
Measurement end
This function sends the “measurement end” message to the measurement system and then
waits for the “measurement complete” message. It then sends the “measurement complete
confirmation” message.
This message is sent when all individual point measurements have been completed.
CMD
7
Command number
PARA1
Not used here
PARA2
Not used here
PARA3
Not used here
PARA4
Not used here
STATUS
0
=
OK
1002 =
The format of the message
is incorrect
Any other value means that
an error has occurred
4
Functions of the Perceptron) laser measurement system (continued)
15 of 17
SerSenSchnittstelleKSS51 08.02.00 en
4.8
Send sensor angle
This function sends a message to the measurement system communicating, by means of
the 3 rotational angles A, B and C, the orientation of a sensor mounted on the robot flange.
The system variable $POS_ACT is evaluated in this way. If $TOOL and $BASE are entered
or determined correctly, by means of tool calibration or manual entry of the values, there is
no need for the time--consuming determination of sensor angles and SWEEP area. The
desired values are determined by the kinematic chain.
CMD
8
Command number
PARA1
Not used here
PARA2
Not used here
PARA3
Not used here
PARA4
Not used here
STATUS
Not used here
Serial Sensor Interface
16 of 17
SerSenSchnittstelleKSS51 08.02.00 en
5
Example programs
DEF
PERCPRO ( )
$BASE=$NULLFRAME
PTP
{A1 0,A2 -90,A3 90,A4 0,A5 0,A6 0}
LOOP
; Perceptron relation number
; model
39
zone ’B’
; relation number
5
PERCEPT(4,39,”B”,5,0,ERGEBNIS)
IF ERGEBNIS <> 0 THEN
HALT
ENDIF
; Perceptron measurement start with:
; model
39
partner 120
; color
41234
PHASE
8
PERCEPT(1,39,120,41234,8,ERGEBNIS)
IF ERGEBNIS <> 0 THEN
HALT
ENDIF
; Perceptron measurement start with:
; model
39
partner 120
; color
41234
PHASE
7
PERCEPT(1,39,120,41234,7,ERGEBNIS)
IF ERGEBNIS <> 0 THEN
HALT
ENDIF
; Perceptron get measurement data with:
; model
39
FIXTURE 87
PERCEPT(3,39,87,0,0,ERGEBNIS)
; only for test
$BASE=$NULLFRAME
; make base correction
$BASE=$BASE:PERCEPT_KOR
; fit in
PTP
{X 1025.0,Y 0.0,Z 1480.0,A 90.0,B 90.0,C 90.0}
; testhalt
HALT
ENDLOOP
END
5
Example programs (continued)
17 of 17
SerSenSchnittstelleKSS51 08.02.00 en
This program demonstrates how a robot fitted with a Perceptron sensor follows a moving
measurement point.
DEF
FOLLOW ( )
INT ERG
POS P=$NULLFRAME
$BASE =$NULLFRAME
$TOOL=NULLFRAME
;move to start point
PTP
{A1 10,A2 -50,A3 120,A4 0,A5 13,A6 0}
;convert start point to Cartesian coordinates
P=$POS_ACT
LOOP
;start measurement cycle with model 3 and a partner
PERCEPT(5,3,1,0,0,ERG)
;start measurement, point 1
PERCEPT(6,1,0,0,0,ERG)
;end measurement cycle
PERCEPT(7,0,0,0,0,ERG)
;fetch measurement data for model 3 and coordinate direc-
tions 10
PERCEPT(3,3,10,0,0,ERG)
;check the vision system data
*)
IF (PERCEPT_KOR.X > 5.0) OR (PERCEPT_KOR.X < -5.0) THEN *)
;error reaction
*)
...
...
ENDIF
;correct start point by possible offset
P.X=P.X+PERCEPT_KOR.X
P.Y=P.Y+PERCEPT_KOR.Y
P.Z=P.Z+PERCEPT_KOR.Z
;follow measurement point
PTP P
ENDLOOP
END
*) The ranges of values for the vision system data (PERCEPT_KOR.X ...)
must undergo a plausibility test in the application program.
The limit values entered in the above program are given as an example.
1
Index
Index -- i
Symbols
$BASE, 15
$CONFIG.DAT, 8
$POS_ACT, 15
$TOOL, 15
Numbers
3964R, 5, 7
H
HW_INF.INI, 7
I
IOSYS.INI, 8
L
Laser measurement system, 10
M
MFC, 8
P
PERCEPT.INI, 7
PERCEPT.SRC, 9
R
Reinstallation, 6
RS232, 5
RS422, 5
T
TIMEOUT, 10, 11
U
Uninstallation, 6
Update, 6
V
VxWorks, 7