Application Solutions
Precision MicroControl Corp.
160
MCSCALE Scaling;
MCEnableAxis( hCtlr, 3, False);
MCGetScale( hCtlr, 3, &Scaling );
Scaling.Scale = 1000.0;
//
1000
encoder
counts/inch
MCSetScale( hCtlr, 3, &Scaling );
MCEnableAxis( hCtlr, 3, True);
Prior to issuing the
Scale
member, the parameters to all motion commands for a particular axis are
rounded to the nearest integer. After setting a new encoder scale and calling
MCEnableAxis( )
to
initialize the axis, motion targets are multiplied by the ratio prior to rounding to determine the correct
encoder position. Calling the
MCGetPosition( )
will load the scaled encoder position.
i
Note – setting a user scale other than 1:1 will require a change of trajectory
settings (Velocity, Acceleration, Deceleration, and Velocity Gain) but not PID
settings.
Trajectory Time Base
The value of the
Rate
member sets the time unit for velocity, acceleration and deceleration values, to a
time unit selected by the user. If velocities are to be in units of inches per minute, the user time unit is a
minute. The value of the
Rate
member is the number of seconds per 'user time unit'. If the velocity,
acceleration and deceleration are to be specified in units of inches per minute and inches per minute per
minute for axis 1, then the
Rate
value should be set to 60 seconds/1 minute = 60 (1UR60). The function
MCEnableAxis( ) must
be issued before the user rate will take effect.
MCSCALE Scaling;
MCEnableAxis( hCtlr, 3, False);
MCGetScale( hCtlr, 3, &Scaling );
Scaling.Rate = 60.0;
// set rate to inches per minute
MCSetScale( hCtlr, 3, &Scaling );
MCEnableAxis( hCtlr, 3, True);
Time Unit
User Rate Conversion
second 1
(default)
minute 60
hour 3600
Figure 50. Typical Trajectory Rate Values
Defining the Time Base for Wait commands
For the
MCWait( )
,
WaitForStop( )
and
WaitForTarget( )
functions, the default units are seconds. By
setting the member
Time
, these three commands can be issued with parameters in units of the user's
preference. The parameter to member is the number of 1 second periods in the user's unit of time. If the
user prefers time parameters in units of minutes,
Time
= 60 should be issued.
MCSCALE Scaling;
MCEnableAxis( hCtlr, 3, False);
MCGetScale( hCtlr, &Scaling );
Scaling.Time = 60.0;
// set Wait time unit to minutes
Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com