User`s manual

4.0 - Programming PMAC
Page - 34
TAN
This is the standard trigonometric tangent function.
ASIN
This is the inverse sine (arc-sine) function with its range reduced to +/-90 degrees.
ACOS
This is the inverse cosine (arc-cosine) function with its range reduced to 0 -- 180 degrees.
ATAN
This is the standard inverse tangent (arc-tangent) function.
ATAN2
This is an expanded arctangent function, which returns the angle whose sine is the expression in parentheses
and whose cosine is the value of Q0 for that coordinate system.
If doing the calculation in a PLC program, make sure that the proper coordinate system has been
ADDRESSed in that PLC program. (Actually, it is only the ratio of the magnitudes of the two values, and
their signs, that matter in this function). It is distinguished from the standard ATAN function by the use of
two arguments. The advantage of this function is that it has a full 360 degree range, rather than the 180
degree range of the single-argument ATAN function.
LN
This is the natural logarithm function (log base e).
EXP
This is the exponentiation function (e
x
).
Note: To implement the y
x
function, use e
x ln(y)
instead. A sample PMAC expression would be
EXP(P2*LN(P1)) to implement the function P1
P2
.
SQRT
This is the square root function.
ABS
This is the absolute value function.
INT
This is a truncation function, which returns the greatest integer less than or equal to the argument
(INT(2.5)=2, INT(-2.5)=-3).
Functions and operators could be used either in Motion Programs, PLCs or as online commands. For example, the
following commands could be typed in a terminal window:
P1=SIN (45) P1 ; Reports the sine value of a 45° angle
I130=I130/2 ; Lower the proportional gain of Motor #1 by half
I125=I125|$20000 ; Disable the end-of-travel limits of Motor #1
4.3.8 - Comparators
A comparator evaluates the relationship between two values (constants or expressions). It is used to determine the truth of a
condition in a motion or PLC program. The valid comparators for PMAC are:
= (equal to)
!= (not equal to)
> (greater than)
!> (not greater than; less than or equal to)
< (less than)
!< (not less than; greater than or equal to)
~ (approximately equal to -- within one)
!~ (not approximately equal to -- at least one apart)
Note that <= and >= are not valid PMAC comparators. The comparators !> and !<, respectively, should be used in their
place.
4.3.9 - User-Written phase and User-Written servo algorithms
For the sophisticated user with unusual and/or difficult commutation needs, PMAC provides the hooks for custom user-
written commutation (phasing) or servo algorithms. These routines are to be written in Motorola 56000 assembly language
code, usually on a PC or compatible, and cross-assembled for the 56000.
4.4 - Memory Map