Académique Documents
Professionnel Documents
Culture Documents
KR C...
Function Generator
1 of 28
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
2 of 28
Contents
2 Programming, parameterization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
2.1 Structure variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
2.1.1 $TECH[i], $TECH_C[i], i=1,...,6 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
2.1.2 $TECHIN[i], i = 1,...,6 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
2.1.3 $TECHPAR[i, j], i=1,...,6 , j=1,...,10 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
2.1.4 $TECHPAR_C[i, j], i = 1,...,6 , j=1,...,10 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
2.1.5 $TECHVAL[i], i = 1,...,6 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
2.1.6 $TECHSYS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
2.1.7 $TECHSYS_C . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
2.1.8 $TECHANGLE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
2.1.9 $TECHANGLE_C . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
2.1.10 $TSYS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
2.1.11 $DISTANCE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
2.2 Analog sensors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
2.2.1 Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
2.2.2 Parameterization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
2.2.3 Correction direction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
2.2.4 Changing technology mode, correction variable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
2.3 Conveyor synchronization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
2.4 Complex sensors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
3 Application examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
3.1 Weaving . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
3.2 Analog sensor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
3.3 Conveyor synchronization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
3 of 28
Function Generator
4 of 28
1 Characteristics, functional description
The following diagram illustrates mechanical and thermal weaving using the function
generator.
Max. voltage
Wire feed
Max. feed
Min. feed
Weld direction
5 of 28
Function Generator
Example
The control points
(0,0),
(0.3,0.5),
(0.75,--0.5) and
(1,0)
result in the function illustrated below:
Y
(0,1) (1,1)
(0.3,0.5)
(1,0) X
(0,0)
(0.75,--0.5)
(0,--1) (1,--1)
6 of 28
1 Characteristics, functional description (continued)
Corrections are only possible in Cartesian space and not in axis space. This means
that the function generator is only available for CP motions (LIN, CIRC).
Z axis
TTS
(tool--based technological system) Y axis (middle finger)
X axis (thumb)
XTOOL axis
(index finger)
7 of 28
Function Generator
1.3 Configuration
The maximum number of programmable function generators is selected in the robot--specific
machine data using the datum $TECH_MAX.
$TECH_MAX can be set to values between 3 and 6 with 3 being the default setting.
8 of 28
2 Programming, parameterization
2 Programming, parameterization
The function generator can be programmed using advance run and main run system
variables. Advance run variables are copied into the main run variables internally in the
system at the start of a motion or when changing block to an approximate positioning block.
The function generator, which is only active for CP motions, only evaluates the main run
variables.
For this reason, when controlling the function generator using advance run variables, a CP
motion block must then be executed so that the data are transferred to the main run data.
A so--called zero block is also valid in this case.
$TECH[i]. MODE
The parameter “MODE” defines the type of evaluation of the function in the advance run. The
parameter can be changed in the program and is block--specific.
MODE Effect
#OFF The function is not evaluated.
#SINGLE The definition range of the function is run through just once
when the function is evaluated.
#CYCLE Cyclical evaluation of the function.
$TECH_C[i]. MODE
The parameter “MODE” defines the type of evaluation of the function in the main run. The
parameter can be changed using Trigger, Interrupt or the variable modification function and
the changes take effect immediately.
MODE Effect
#OFF The function is not evaluated.
#SINGLE The definition range of the function is run through just once
when the function is evaluated.
#CYCLE Cyclical evaluation of the function.
9 of 28
Function Generator
$TECH[i].CLASS
The parameter “CLASS” can be used to define the technology class in the advance run. The
parameter can be changed in the program and is block--specific.
CLASS Effect
#PATH The input variable for the function generator is the system
variable $DISTANCE. The unit for the scaling and offset
variables is [mm].
#VEL The input variable for the function generator is the path
velocity ($VEL_ACT).
#SENSOR The input variable for the function generator is the system
variable $TECHIN[i], i=1..6. Depending on the input values, a
corresponding position correction is carried out.
#CONVEYOR The input variable for the function generator is the system
variable $TECHIN[i], i=1..6. Depending on the input values, a
corresponding tracking motion is executed by the robot.
#DATALINK The input variable for the function generator is a correction
frame that is set by the sensor task. Depending on the input
values, a corresponding correction is carried out by the robot.
$TECH_C[i].CLASS
The parameter “CLASS” can be used to define the technology class in the main run. The
parameter cannot be changed.
CLASS Effect
#PATH The input variable for the function generator is the system
variable $DISTANCE. The unit for the scaling and offset
variables is [mm].
#VEL The input variable for the function generator is the path
velocity ($VEL_ACT).
#SENSOR The input variable for the function generator is the system
variable $TECHIN[i], i=1..6. Depending on the input values, a
corresponding position correction is carried out.
#CONVEYOR The input variable for the function generator is the system
variable $TECHIN[i], i=1..6. Depending on the input values, a
corresponding tracking motion is executed by the robot.
#DATALINK The input variable for the function generator is a correction
frame that is set by the sensor task. Depending on the input
values, a corresponding correction is carried out by the robot.
10 of 28
2 Programming, parameterization (continued)
$TECH[i].FCTCTRL
This is a function control structure for setting the scaling and offset parameters in the
advance run. The parameter can be changed in the program and is block--specific.
FCTCTRL Effect
element
OFFSET_IN Real value which, depending on the parameter CLASS, can be used
to offset the zero point of the definition range of the function.
OFFSET_OUT Real value which, depending on the parameter CLASS, can be used
to offset the zero point of the value range of the function.
SCALE_IN Real value which can be used to scale the definition range of the
function with reference to the parameter CLASS.
SCALE_OUT Real value which can be used to scale the value range of the
function with reference to the parameter CLASS.
$TECH_C[i].FCTCTRL
Function control structure for setting the scaling and offset parameters in the main run. The
parameter can be changed using Trigger, Interrupt or the variable modification function and
the changes take effect immediately.
FCTCTRL Effect
element
OFFSET_IN Real value which, depending on the parameter CLASS, can be used
to offset the zero point of the definition range of the function.
OFFSET_OUT Real value which, depending on the parameter CLASS, can be used
to offset the zero point of the value range of the function.
SCALE_IN Real value which can be used to scale the definition range of the
function with reference to the parameter CLASS.
SCALE_OUT Real value which can be used to scale the value range of the
function with reference to the parameter CLASS.
11 of 28
Function Generator
GEOREF
12 of 28
2 Programming, parameterization (continued)
Example
$TECHVAL Y
(output variable)
(0,1) (1,1)
OFFSET_IN SCALE_OUT
(1,0) X
(0,0)
(0,--1) (1,--1)
Technology mode
OFFSET_OUT #CYCLE
SCALE_IN
(input variable)
e.g. length of arc $DISTANCE (CLASS = #PATH)
for #PATH $VEL_ACT (CLASS = #VEL)
$TECHIN (CLASS = #SENSOR,
CLASS = #CONVEYOR)
Correction frame
(CLASS = #DATALINK)
13 of 28
Function Generator
$TECH[i].FCT
Defines the function in the advance run. It can be changed in the program and is
block--specific.
$TECH_C[i].FCT
Defines the function in the main run. It cannot be changed in the program.
14 of 28
2 Programming, parameterization (continued)
2.1.6 $TECHSYS
Used for programming the TTS in the advance run. The coordinate systems #WORLD,
#BASE, #ROBROOT, #TCP and #TTS can be programmed. If GEOREF < > (is not equal
to) #NONE, then the calculated function values refer to the programmed coordinate system.
This variable can be modified in the program and is block--specific.
2.1.7 $TECHSYS_C
This variable is used for programming the TTS in the main run. The coordinate systems
#WORLD, #BASE, #ROBROOT, #TCP and #TTS can be programmed.
If GEOREF < > (is not equal to) #NONE, then the calculated function values refer to the
programmed coordinate system.
This variable can be modified using Trigger, Interrupt or the variable modification function
and the changes take effect immediately.
2.1.8 $TECHANGLE
Used for programming the rotation of the TTS in the advance run.
The rotation is specified in RPY angles.
This variable can be modified in the program and is block--specific.
2.1.9 $TECHANGLE_C
Used for programming the rotation of the TTS in the main run. The rotation is specified in
RPY angles.
The variable can be modified using Trigger, Interrupt or the variable modification function and
the changes take effect immediately.
2.1.10 $TSYS
For each interpolation cycle, this system variable contains the current TTS – insofar as there
is one available – with reference to the base coordinate system.
This variable is of type FRAME and cannot be modified.
2.1.11 $DISTANCE
This variable allows path--related function evaluation. During program execution, it
represents the current arc length of a Cartesian motion in millimeters.
$DISTANCE is set to zero at the start of an individual CP block or at the start of the CP motion
in a PTP/CP approximate positioning motion.
This variable is of type REAL and cannot be modified.
15 of 28
Function Generator
16 of 28
2 Programming, parameterization (continued)
Digital input:
Entry in “$MACHINE.DAT”
SIGNAL $DIGIN1 $IN[20] TO $IN[27]
DECL DIGINCODE $DIGIN1CODE=#UNSIGNED
DIGIN ON $TECHIN[3] = FACTOR * $DIGIN1 + OFFSET
2.2.2 Parameterization
Elements of the array variable $TECHPAR[i,j] are used for parameterization and for
outputting function generator states.
Technology class SENSOR ($TECH[i].CLASS = #SENSOR) causes the function generator
to use the variable $TECHIN[i] and thus the sensor signal as the input variable.
For function generator class #SENSOR, the function definition describes a controller
characteristic as illustrated in the following diagram.
Correction velocity Y
[mm/s] or [degrees/s]
Controller characteristic
(0,1) (1,1)
OFFSET_IN SCALE_OUT
(0,0) (1,0) X
(0,--1) (1,--1)
Technology mode
OFFSET_OUT #CYCLE
SCALE_IN
$TECHIN
17 of 28
Function Generator
For function generator class “#SENSOR”, the function generator calculates a correction
velocity (mm/s or degrees/s) from the input values. This correction velocity is used to
calculate a correction value (mm, degrees) which is added up in every interpolation cycle
(sensor correction, initial value 0.0).
With corresponding parameterization, the correction velocity is 0 (zero) and the sensor
correction value remains constant in the balanced state.
The correction velocity is smoothed before the correction value is calculated in order to avoid
abrupt corrections. This smoothing can be set using $TECHPAR[i,1].
If the filter $TECHPAR[i,1] is set to less than the duration of an interpolation cycle, the
unfiltered velocity value is used for calculating the correction.
Z BASE
Y TSYS
Y BASE
X TSYS
Z TSYS
ds
dz
GEOREF
dx dy
X BASE
ds = correction velocity * t_ipo
18 of 28
2 Programming, parameterization (continued)
The correction increase in the BASE components is added up (dX, dY, dZ or dA, dB, dC),
included in the calculation of the TCP and can be accessed by the user via the TECHPAR
variables.
TECHPAR_C[i, 3] : Correction value in X BASE (dX)
TECHPAR_C[i, 4] : Correction value in Y BASE (dY)
TECHPAR_C[i, 5] : Correction value in Z BASE (dZ)
TECHPAR_C[i, 6] : Correction value in A BASE (dA)
TECHPAR_C[i, 7] : Correction value in B BASE (dB)
TECHPAR_C[i, 8] : Correction value in C BASE (dC)
In the case of a TCP correction (GEOREF = #X, #Y or #Z), the value of the correction vector
in BASE (unit = mm) is written to the output variable of the function generator ($TECHVAL[i])
and can then be used, with the aid of two interrupt declarations, for monitoring the sensor
correction.
INTERRUPT DECL 1 WHEN $TECHVAL[1] > 20.0 DO UPPER_LIMIT()
INTERRUPT DECL 2 WHEN $TECHVAL[1] < --20.0 DO LOWER_LIMIT()
In the case of an orientation correction (GEOREF = #A, #B or #C), the value is calculated
using the correction angle in
BASE (dA, dB, dC)
and transferred to TECHVAL[i].
$TECHVAL[i] = SQRT(dA2 + dB2 + dC2)
All correction values that are made available to the user are interpolator command values
and are not filtered, i.e. there is no reference to actual values.
19 of 28
Function Generator
Function generator 2 should not be used for any other purpose in this case.
The TECH variable “GEOREF” defines the correction direction in this coordinate system.
The parameters
#X, #Y and #Z
define a translational correction in the corresponding direction.
For rotational tracking, the parameters
#A, #B and #C
of the “GEOREF” variable are used:
#A --> about Z, #B --> about Y, #C --> about X.
In the case of translational conveyor mode, it is of vital importance to ensure that the
tracking direction corresponds to the direction of motion of the conveyor belt.
In the case of rotational motions of the part, the correction axis must be located at the center
of rotation, for example:
GEOREF=#A
where the Z axis of the conveyor (Z Conv.) is the rotational axis and the direction of rotation
is mathematically positive.
20 of 28
2 Programming, parameterization (continued)
The parameter $TECHPAR[i,8] defines whether the variable $TECHIN[i] refers to a velocity
value or a distance.
$TECHPAR[i,8]=0 ----> $TECHIN[i] refers to a velocity
$TECHPAR[i,8]=1 ----> $TECHIN[i] refers to a distance
In the case of a conveyor synchronization with an “absolute” position sensing system,
$TECHPAR[i,8] must be set to 1.
Example:
The synchronization switch enables the counting mode.
At the end of the tracking operation, a digital output in the KRC ensures that the counter
is set to 0 and that the enabling of the counting mode is withdrawn.
The 16--bit values are scaled to [mm] using the FACTOR in the
DIGIN statement.
Synchronization switch
X Conv. P2 P3
Conveyor
P4
P1
Z Conv.
Incremental
encoder Direction of motion
Pulse Robot
Direction
of
rotation
Reset counter
(digital output) KR C2
Start counter
Counter Strobe (digital output)
(enable)
21 of 28
Function Generator
If the parameter $TECHPAR[i,8] is set to 0, the tracking distance is calculated on the basis
of the conveyor velocity which is assigned cyclically to $TECHIN[i] by means of an ANIN or
DIGIN statement.
Make sure that $TECHIN[i] contains the conveyor velocity value in mm/s or degrees/s.
This is done by means of the factor in the ANIN/DIGIN statement.
The system variable $TECHVAL[i] contains the absolute tracking distance in mm or degrees.
This variable can be used to monitor the maximum permissible tracking distance, e.g.
INTERRUPT DECL 1 WHEN $TECHVAL[i] > 2000.0 DO STOP_TRACK()
The robot tracking motion is started by means of a synchronization signal which the conveyor
system sends to the robot controller when the part enters the robot’s processing area.
This synchronization input (user input) is transferred to the system via the variable
$TECHPAR[i,7]. The program interpreter is stopped by means of a
“WAIT FOR $TECHVAL[i]>0.05” statement
once the conveyor synchronization has been activated.
The conveyor functionality is activated as soon as the technology mode is switched to
CYCLE and the technology class CONVEYOR is selected.
Once the robot has detected the synchronization signal it leaves its starting position and
starts tracking and processing. For this kind of start from the rest position with the conveyor
already running (so--called “flying start”), special precautions (smoothing) must be taken in
order to ensure a “smooth”, but nonetheless sufficiently rapid, synchronization of the robot
motion with the conveyor motion.
The corresponding parameters are set using elements of $TECHPAR[i,j]:
G “Distance gain” $TECHPAR[i,1] in [1/s],
G “Velocity gain” $TECHPAR[i,2] in [1/s].
The following error between the conveyor and the robot caused by the smoothing and the
system run times can be compensated for by the user by means of
$TECHPAR[i,3] (rate time in s).
As the function generator (interpolator) is not called during pauses between motions, no
exact positioning motion should be programmed at any point in the tracking operation.
A programmed point can be reached exactly by setting the approximation radius to 0 (zero).
If it is necessary for there to be pauses between robot motions, this can be achieved by
setting the override to zero at the corresponding point in the program (TRIGGER in
approximation zero block).
The instruction $TECH[i].MODE=#OFF triggers an advance run stop, deactivates the
conveyor functionality, sets the tracking distance to 0 and continues the motion from the
current point in space.
22 of 28
2 Programming, parameterization (continued)
23 of 28
Function Generator
24 of 28
3 Application examples
3 Application examples
3.1 Weaving
Example
DECL TECH WEAVE1, WEAVE2 ; Declare variables of type TECH
WEAVE1.MODE = #CYCLE ; Cartesian weaving is a cyclical
; function.
WEAVE1.FCTCTRL.SCALE_IN = 2 ; Wavelength of the weave oscillation is
; 2 mm.
WEAVE1.FCTCTRL.OFFSET_IN = 0 ; Start of deflection is start of CP path.
WEAVE1.FCTCTRL.SCALE_OUT = 3 ; Weave amplitude is 3 mm.
WEAVE1.FCTCTRL.OFFSET_OUT = 0 ; Focus of the weave oscillation is
; on the path:
; If amplitude = 0, path is followed without
; weaving.
WEAVE1.CLASS = #PATH ; Argument of the weave pattern is the
; arc length, i.e. SCALE_IN the
; wavelength.
WEAVE1.FCTCTRL.GEOREF = #Y ; Direction of the weave deflection in the Y
; direction in the TTS
WEAVE1.FCT.ORDER = 1 ; Create weave pattern from polygon using
; pairs of values in the function table.
TECHANGLE.C = 10 ; Rotate TTS
; User--defined WEAVE1 is ready for assignment to the technology structure $TECH[1]
; Prepare FCTCTRL section of the structure WEAVE2 for structure
; assignment using TRIGGER command!
25 of 28
Function Generator
26 of 28
3 Application examples (continued)
X Conv. P2
P3
Conveyor
P4
P1
Z Conv.
Velocity measuring system
Direction of motion
KR C1
Robot
Digital
input
Analog input
A workpiece on a conveyor belt is moved past a robot. The velocity measuring system
delivers a voltage of 10.0 V in the case of a maximum conveyor velocity of 0.08 m/s.
The voltage range of the analog input is 0 V to 10.0 V.
FACTOR = 80
OFFSET = 0.0
27 of 28
Function Generator
28 of 28
Index
Symbols C
#CYCLE, 19 Configuration, 8
#SENSOR, 17, 18 Control points, 6
Conveyor synchronization, 20
#SINGLE, 19
Correction coordinate system, 7
$ANIN[1], 17, 20
Correction coordinate system TTS, 7
$DIGIN1, 17 Correction direction, 7
$DISTANCE, 15 Correction value, 18
$MACHINE.DAT, 17, 20 Correction velocity, 18
$TECH[i]. MODE, 9 CYCLE, 21
$TECH[i].CLASS, 17
$TECH[i].CLASS , 10 D
$TECH[i].FCT, 14 DIGIN statement, 21
$TECH[i].FCTCTRL , 11
$TECH[i].MODE, 19, 22 F
$TECH[i], $TECH_C[i], 9 Function definition, 6
$TECH_C[i]. MODE, 9 Functional description, 6
$TECH_C[i].CLASS , 10
$TECH_C[i].FCT, 14 G
$TECH_C[i].FCTCTRL, 11 GEOREF, 7, 18, 20
$TECH_MAX, 8
$TECHANGLE, 7, 15 M
$TECHANGLE_C, 15
Mechanical weaving, 5
$TECHIN[i], 14, 17, 19, 20
$TECHPAR, 17, 20, 22
O
$TECHPAR[i, j], 14
OFFSET_OUT, 15
$TECHPAR[i,1, 18
$TECHPAR[i,1], 18
P
$TECHPAR[i,j], 20
Parameterization, 9
$TECHPAR_C[i, j], 14
Programming, 9
$TECHSYS, 7, 15, 18
$TECHSYS_C, 15
R
$TECHVAL[i], 15, 19, 21
Reaching a programmed point, 22
$TSYS, 15
RESUME, 19
A S
SCALE_OUT, 15
Analog sensors, 17
Sensor correction value, 18
Sensor offset, 19
SIGNAL $DIGIN1, 17
B
SIGNAL CORRECTION, 17
BASE, 19 Structure variables, 9
Index -- i
Index
T
TCP correction, 19
TECHPAR variables, 20
TECHVAL[i], 19
Thermal weaving, 5
Tool--based technological system, 7
Tool--based technological system (TTS), 7, 15
TTS, 7
W
WAIT FOR $TECHVAL[i], 22
Index -- ii