Application Solutions
MultiFlex PCI 1000 Series User's Manual
159
Defining User Units
When power is applied or the controller is reset, it defaults to encoder counts or stepper pulses as its
units for motion command parameters. If the user issues a move command to a servo with a target of
1000, the controller will move the servo 1000 encoder counts. If the user issues the same command to a
stepper motor, it will issue 1000 step pulses.
In many applications there is a more convenient unit of measure than the encoder counts of the servo or
steps of the stepper motor. If there is a fixed ratio between the encoder counts or steps and the desired
'user units', the controller can be programmed with this ratio and it will perform conversions implicitly
during command execution.
Defining user units is accomplished with the function
MCSetScale( )
, which uses the
MCSCALE
data
structure. This function provides a way of setting all scaling parameters with a single function call using
an initialized
MCSCALE
structure. To change scaling, call
MCGetScale( )
, update the
MCSCALE
structure, and write the changes back using
MCSetScale( )
.
i
Before changing any/all of the axis related scaling values (Scale, Rate, Offset,
or Zero)
the axis must first be disabled (turned off)
. To complete a scaling
change enable (turn on) the axis.
MCScale Data Structure
typedef struct {
double
Constant;
// Define output constant
double
Offset; //
Define
the
work
area
zero
double
Rate;
//
Define
move
(vel.,
accel,
decel)
time units
double
Scale;
//
Define
encoder
scaling
double
Zero;
//
Define
part
zero
double
Time;
//
Define
time
scale
} MCMOTION;
Setting Move (Encoder/Step) Units
The value of the
Scale
member is the number of encoder counts or steps per user unit. For
example, if the servo encoder on axis 1 has 1000 quadrature counts per rotation, and the
mechanics move 1 inch per rotation of the servo, then to setup the controller for user units of
inches:
Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com