User Manual

Table Of Contents
Closed Loop Relative and Tracking Position Modes
152 Advanced Digital Motor Controller User Manual V2.0 July 8, 2019
The Differential component of the algorithm computes the changes to the error from one
ms time period to the next. This change will be a relatively large number every time an
abrupt change occurs on the desired position value or the measured position value. The
value of that change is then multiplied by a user-selectable Differential Gain and added to
the output. The effect of this part of the algorithm is to give a boost of extra power when
starting the motor due to changes to the desired position value. The differential compo-
nent will also help dampen any overshoot and oscillation.
The Integral component of the algorithm performs a sum of the error over time. In the
position mode, this component helps the controller reach and maintain the exact desired
position when the error would otherwise be too small to energize the motor using the
Proportional component alone. Only a very small amount of Integral Gain is typically re-
quired in this mode.
In systems where the motor may take a long time to physically move to the desired
position, the integrator value may increase significantly causing then difficulties to stop
without overshoot. The Integrator Limit parameter will prevent that value from becoming
unnecessarily large.
PID tuning in Position Mode
As discussed above, three parameters - Proportional Gain, Integral Gain and Differential
Gain - can be adjusted to tune the position control algorithm. The ultimate goal in a well
tuned PID is a motor that reaches the desired position quickly without overshoot or oscil-
lation.
Because many mechanical parameters such as motor power, gear ratio, load and in-
ertia are difficult to model, tuning the PID is essentially a manual process that takes
experimentation.
The Roborun PC utility makes this experimentation easy by providing one screen for
changing the Proportional, Integral and Differential gains and another screen for running
and monitoring the motor.
When tuning the motor, first start with the Integral and Differential Gains at zero, increas-
ing the Proportional Gain until the motor overshoots and oscillates. Then add Differential
gain until there is no more overshoot. If the overshoot persists, reduce the Proportional
Gain. Add a minimal amount of Integral Gain. Further fine tune the PID by varying the
gains from these positions.
To set the Proportional Gain, which is the most important parameter, use the Roborun util-
ity to observe the three following values:
Command Value
Actual Position
Applied Power
With the Integral Gain set to 0, the Applied Power should be:
Applied Power = (Command Value - Actual Position) * Proportional Gain