44
MPC-385 SERIES OPERATION MANUAL – REV. 3.21K (20201120)
6. Absolute Positioning System Origin: The Origin is set to a physical position of travel to
define absolute position 0. The physical Origin position is fixed at beginning of travel
(BOT). This means that all higher positions (towards end of travel (EOT)) are positive
values; there are no lower positions and therefore no negative values are allowed.
7. Absolute vs. Relative Positioning: Current position (‘c’) and move commands always use
absolute positions. All positions can be considered “relative” to the Origin (Position 0), but
all are in fact absolute positions. Any position that is considered to be “relative” to the
current position, whatever that might be, can be handled synthetically by external
programming. However, care should be taken to ensure that all relative position
calculations always result in correct positive absolute positions before initiating a move
command.
Declaring relative position variables in C/C++:
/* relative positions for X, Y, & Z */
double rp_x_um, rp_y_um, rp_z_um; /* microns */
/* initialize all relative positions to 0 after declaring them */
rp_x_um = rp_y_um = rp_z_um = 0;
Enter any positive or negative value for each relative position (e.g., rp_x_um = 1000; rp_y_um
= 500; rp_z_um = -200 … etc.
For each axis, check to make sure that the new resultant absolute position (to which to move)
is within bounds. Reset the relative position to 0 if not. If relative value is negative, its
positivized value must not be greater than the current position. Otherwise, if positive, adding
current position with relative position must not exceed the maximum position allowed. If out
of bounds, resetting relative position to 0 allow the remaining conversions and movement to
resolve without error.
/* check to make sure that relative X is within bounds */
if ( ( rp_x_um < 0 && abs(rp_x_um) > cp_x_um ) ||
(cp_x_um + rp_x_um > max_x_um) ) /* out of bounds? */
rp_x_um = 0; /* yes, so reset relative pos. to 0 */
Repeat the above bounds check for each of the remaining axes.
For each axis, calculate new absolute position in microns and then convert to microsteps before
issuing a move command.
/* convert X relative position to absolute position */
sp_x_um = cp_x_um + rp_x_um; /* add relative pos. to current pos. */
/* convert new absolute X position in microns to microsteps */
sp_x_us = sp_x_um * um2usCF;
Repeat for each of the remaining axes as required before issuing a move command.
8. Position Value Typing: All positions sent and received to and from the controller are in
microsteps and consist of 32-bit integer values (four contiguous bytes). Position values in
microsteps are always positive, so data type must be an “unsigned” integer that can hold
32 bits of data. Although each positional value is transmitted to, or received from, the
controller as a sequence of four (4) contiguous bytes, for computer application
computational and storage purposes each should be typed as an unsigned 32-bit integer
(“unsigned long” in C/C++, “uint32” in MATLAB, “U32” in LabVIEW, etc.).