You are on page 1of 2

Functions

Kinematics
general
HEADER of commands which enable defining a joint as a function joint. These commands define functions
which receive the values of the independent joint or joints, and which return the value of the function (dependent)
joint.
definition
A function joint is a joint the movement of which is totally dependent on the motion of one or more other joints
and which therefore does not constitute an independent, accessible degree of freedom. It is not listed in the data
window together with the data for the active mechanism, and cannot be actuated by the drive command nor from
the Workcell Motion/joint jog panel. If a motion command moves an independent joint, any function joints
dependent thereon also move according to their functional dependence.
current joint
For these commands, the function joint for which the function is written is either the current joint as specified for
the current command under the Edit Joint header, or is another, specified joint. The name of the current joint is
displayed in the data window.
functions
A function-joint function consists of an expression expr surrounded by double quotation marks "", i.e., "expr".
When expr includes a reference to an independent joint, that reference can assume any of four different forms:
t# d#
Designate a rotational or prismatic joint, respectively, numbered # in the order of the joints as determined when
the mechanism is defined by the mechanism define command. This order is determined by the system and is
subject to change if the mechanism is subsequently redefined. The maximum allowable number of joints is 64.
T(name) D(name)
Designate a rotational or prismatic joint, respectively, specified by its name determined when the joint was
defined or as subsequently renamed by the user.
The format of expr itself has one or more of the forms listed below. In all of the forms, the spaces as shown are
optional; thus (mnp) and ( mnp ) are equally valid.
( string )
One of seven forms enclosed in parentheses ( ):
Denavit-Hartenberg parameters: one of a i o c s d t f followed by one or more digits from 1 to 9. Examples:
(a1), (s5), (t32). The digit 0 cannot be the first digit: (d08) is not allowed.
TCP matrix: one of n o a p followed by one of x y z. Examples: (nx), (ay).
Inverse TCP matrix: m followed by one of n o a followed by p. Examples: (mnp), (map).
Tool matrix: h followed by two digits each in the range 0 to 3. Examples: (h10), (h33).
Base matrix: b followed by two digits each in the range 0 to 3. Examples: (b03), (b32).
0 or ±1: 0 or 1 or –1. Examples: (0), (−1).
Sine or cosine abbreviation: Uppercase S or C for rotational joints, or lowercase s or c for prismatic joints,
followed by one or more digits from 0 to 9, to express the sine or cosine of the specified joint in radians. This
expression abbreviates references to joints in the format d# or t#; it does not abbreviate expressions using
D(name) or T(name). Examples: (S9) means (sin(t9)) for rotational joint 9; (s9) means (sin(d9)) for prismatic joint
9. (C1) similarly means (cos(t1)) and (c1) means (cos(d1)). An expression like (sin(T(j2))) cannot be abbreviated.
( number ) int ( expr )
A real number. A minus sign – is prefixed if the The integer portion of expr; the fractional portion is
value is negative. If the value is a decimal fraction a truncated.
decimal point . is appended and followed by one or Example: (int(27.9)) returns 27.
more digits; if the fraction is less than 1 the leading
sgn ( expr )
zero may be omitted. If the value is a whole number
The sign of expr, returning 1 if expr is positive, –1 if
the .0 portion may be omitted.
Examples: (–0.21), (–.21), (200.03), (762). expr is negative, and 0 if expr is zero.
Example: (sgn(−3)) returns –1.
sin | cos | tan ( expr )
The respective trigonometric value of expr in ! ( expr )
radians. Not expr, where expr is Boolean.
Examples: (sin(t3)), (cos(T(j3))), (tan(D(j1)/a3)). rad ( expr )
asin ( expr ) The conversion of expr to radians.
The arc sine of expr, returning values in the range deg ( expr )
−π/2 to π/2. The conversion of expr to degrees.
Example: (asin(nx)).
( expr1 expr2 )
acos ( expr ) ( expr * expr2 )
The arc cosine of expr, returning values in the The product of expr1 and expr2; the sign * is
range 0 to π. optional.
Example: (acos(nx0y–ny0x)).
( expr1 + expr2 )
atan ( expr ) The sum of expr1 and expr2; expr2 may itself be a
The arc tangent of expr, returning values in the sum of two or more expressions.
range −π/2 to π/2. Example: (2+(3+(−3))) returns 2. The parentheses
Example: (atan(31.7)). are required.
atan2 ( expr1 , expr2 ) ( expr1 / expr2 )
The arc tangent of expr1/expr2, returning values in The quotient of expr1 divided by expr2; expr2 may be
the range −π to π. a sum of two or more expressions.
Example: (atan2(31.7,1.7)). Example: (6/(1+2)) returns 2. The parentheses are
sqrt ( expr ) required.
The square root of expr ≥ 0. ( expr1 % expr2 )
Example: (sqrt(4)). The remainder of expr1 divided by expr2; expr2
ln ( expr ) may be a sum of two or more expressions.
The natural logarithm of expr ≥ 0. Example: (9%7) returns 2.
Example: (ln(4)). ( expr1 == expr2 )
exp ( expr ) ( expr1 != expr2 )
Expr constituted as an exponent. ( expr1 >= expr2 )
Example: (exp(2)). ( expr1 <= expr2 )
( expr1 > expr2 )
pow ( expr1 , expr2 ) ( expr1 < expr2 )
Expr1 raised to the power expressed by the Return 1 if the indicated comparisons are true, 0 if
exponent consisting of expr2. the comparisons are false.
Example: (pow(10, 2)) returns 100.
(bexpr1 && bexpr2 )
abs ( expr ) Boolean and: evaluates Boolean expressions
The absolute value of expr. bexpr1 and bexpr2 in the order given and returns 1
Example: (abs(–3)) returns 3. if they are both true, 0 otherwise. If bexpr1 is false,
this function returns 0 and exits without evaluating
floor ( expr )
bexpr2.
The largest integer not greater than expr.
Example: (floor(27.9)) returns 27. ( bexpr1 || bexpr2 )
Boolean or: evaluates Boolean expressions bexpr1
ceil ( expr )
and bexpr2 in the order given and returns 0 if they
The smallest integer not less than expr.
are both false, 1 otherwise. If bexpr1 is true, this
Example: (ceil(27.9)) returns 28.
function returns 1 and exits without evaluating
bexpr2.

implementation notes
The Robcad function-joint implementation is heavily dependent on nested parentheses. When formulating a
formula, ensure that the parentheses are properly placed and balanced.

You might also like