P
ar
t
2: C
omman
d
s
Moog Animatics SmartMotor™ Developer's Guide, Rev. L
Page 499 of 909
KG=formula
Constant, Gravitational Offset
APPLICATION:
Motion control
DESCRIPTION:
Gravitational offset
EXECUTION:
Buffered until an F command is issued
CONDITIONAL TO:
N/A
LIMITATIONS:
N/A
READ/REPORT:
RKG
WRITE:
Read/write
LANGUAGE ACCESS:
Assignment, formulas and conditional testing
UNITS:
N/A
RANGE OF VALUES:
-16777216 to 16777215
TYPICAL VALUES:
0
DEFAULT VALUE:
0
FIRMWARE VERSION:
5.x and later
COMBITRONIC:
KG:3=1234
where ":3" is the motor address — use the actual address or a
variable
DETAILED DESCRIPTION:
KG sets the gravity compensation term of the PID filter.
NOTE:
The motion or servo modifications from this command must be applied by
the F function. For details, see F on page 446.
Simple PID filters are not equipped for a constant force asserted on the system. An example
of a constant force is that induced by gravity acting on a vertically moving axis. The KG term
exists to offset the PID filter output in a way that removes the effect of these constant forces.
To set KG, set KP and KI to zero and servo in place. The load will want to fall, so you will need
to hold it in place. Increase or decrease KG until the load barely holds. Record that value and
then continue increasing the parameter until the load begins to move upward. Now record that
value. The optimum KG value is the average of the two recorded values.
Valid values for KG are integers from -16777216 to 16777215; the default value is 0. As a
result, you may not see much of an effect until KG has a magnitude greater than one million.
However, extremely high values will cause rapid pulse-width modulation (PWM) saturation,
which results in uncontrollable servo behavior.
EXAMPLE:
KG
=1000000
'Set buffered gravity term
F
'Update PID filter
RELATED COMMANDS:
R
Constant, Acceleration Feed Forward (see page 495)
Part 2: Commands: KG=formula