User's Manual

Turbo PMAC User Manual
244 Turbo PMAC Computational Features
If a command consisting simply of a constant value is sent to Turbo PMAC, Turbo PMAC assigns that
value to variable P0 (unless a special table buffer such as a compensation table or stimulus table has been
defined but not yet filled – in that case the constant value will be entered into the table. For example, if
the command 342<CR> is sent to Turbo PMAC, it will interpret it as P0=342<CR>.)
This capability is intended to facilitate simple operator terminal interfaces. It does mean, however, that it
is not a good idea to use P0 for other purposes, because it is easy to change this variable’s value
accidentally.
If your application uses kinematic subroutines to convert between tool-tip (axis) positions and joint
(motor) positions, variables P1 – P32 and P101 – P132 are used for the motor positions in these
subroutines (Pn is Motor n position; if PVT moves are converted, P10n is Motor n velocity). If you are
using the kinematic subroutines, make sure not to use the P-variables employed in the subroutines for any
other purpose.
Q-Variables
Q-variables, like P-variables, are general-purpose user variables – 48-bit floating-point variables at fixed
locations in memory, with no pre-defined use. However, the register using a given Q-variable (and hence
the value contained in it) is dependent on which coordinate system is utilizing it. This allows several
coordinate systems to use the same program (for instance, containing the line X(Q1+25) Y(Q2), but to
have different values in their own Q variables (which in this case, means different destination points).
Allotting Q-Variables
There is a total of 8192 Q-variables. If using only a single coordinate system (Coord.Sys. 1 – specified as
&1), use all of these: Q0 to Q8191. The Q-variables of Coordinate System 2 (&2) overlap these: Q0 of
&2 is the same thing as Q4096 of &1, and Q4095 of &2 is the same thing as Q8191 of &1. (The Q buffer
is actually rotary, so Q4096 of &2 is the same thing as Q0 of &1, and Q8191 of &2 is Q4095 of &1.)
Thus, both coordinate systems have 4096 unique Q-variables: Q0 to Q4095.
Note:
There is no protection against overwriting another coordinate system’s Q-
variables. It is your responsibility to keep Q-numbers within the proper range.
If using 3 or 4 coordinate systems, there are 2048 unique Q-variables for each coordinate system (Q0 –
Q2047). If using 5 to 8 coordinate systems, there are 1024 unique Q-variables for each coordinate system
(Q0 – Q1023). If using 9 to 16 coordinate systems, there are 512 unique Q-variables for each coordinate
system (Q0 – Q511).
The following table shows the addresses used to store Q0 for each coordinate system when the Q-
variables are stored in main memory. It shows how they potentially overlap.
CS # Q0
Address
CS # Q0
Address
CS # Q0
Address
CS # Q0
Address
1 $8000 5 $8400 9 $8200 13 $9200
2 $9000 6 $8C00 10 $8600 14 $9600
3 $8800 7 $9400 11 $8A00 15 $9A00
4 $9800 8 $9C00 12 $8E00 16 $9E00
Addressing a Q-Variable Set
The type of command determines which set of Q-variables being used. When accessing a Q-variable
from an on-line (immediate) command from the host, the Q-variable for the currently host-addressed
coordinate system (with the &n command) is being used.