Moog Animatics SmartMotor™ Developer's Guide,Rev. L
Page 571 of 909
To use MFR, you will need to define the desired relationship (ratio) of the external encoder
input to shaft position, which is represented by the primary internal encoder count. The MFR
command must be issued after both MFMUL and MFDIV have been specified. Both MFMUL and
MFDIV may be positive or negative — this controls the resulting direction of shaft rotation.
The MFR command followed by a G command will immediately turn on the servo. The
servo-off flag (Bo) is set to 0; the trajectory flag (Bt) is set to 1. The motion is restricted by
the current value of EL. The motion is also subject to the currently defined activity of the limit
switches.
The fractional ratio of input encoder to motor motion is maintained with a continuing
remainder. This means that the ratio can run continuously without concern about loss of
accuracy. Any ratio that can be expressed with the integers MFMUL and MFDIV, and within
their range limits, can be maintained accurately. For example, the ratio 1:10 or 2:3 can be
maintained accurately. Keep in mind that the values of MFMUL and MFDIV can be creatively
selected to give the desired ratio. For instance, MFMUL=10 and MFDIV=395 gives a reduction
ratio of 39.5.
NOTE: The only method of inputting a ratio to the SmartMotor is with the MFMUL
and MFDIV commands, which require integers within a certain range.
Ratios that are irrational — a mathematical definition that means it cannot be represented by
a ratio of integers — cannot be tracked continuously. This is a fundamental mathematical
principal and not a limitation of the SmartMotor. For example, converting degrees to radians,
or diameter to circumference, is considered irrational because an integer ratio cannot express
the precision required to operate continuously. Such a ratio would only be accurate in a
limited range of motion. Depending on the application, this could be a problem. Therefore, it
is the responsibility of the system designer to be aware of this.
EXAMPLE: (phase offset adjustment)
In some applications, it may be necessary to introduce a phase shift to achieve proper
alignment during MFR following. To perform this shift, configure trajectory 1 to execute a
position move.
EIGN(W,0) 'Make all onboard I/O inputs
ZS 'Clear errors
MF0 'Reset CTR(1)
MFDIV=-10 'Divisor = -10
MFMUL=21 'Multiplier = 21
MFR 'Calculate Ratio, input -10 external counts
'Resulting motion 21 counts
MP(1) 'Position mode in trajectory 1
'Also, keep MFR active
PRT=0 'No phase shift
G(2) 'Start following
'Implementing phase adjust:
PRT=500 ' Set relative distance
VT=5000 ' Set velocity target
ADT=100 ' Set accel/decel
G(1) ' Start phase adjust
END
RELATED COMMANDS:
R
CTR(enc) Counter, Encoder, Step and Direction (see page 374)
G Start Motion (GO) (see page 456)
Part 2: Commands: MFR