User Manual

Table Of Contents
PID Tuning in Speed Position Mode
Advanced Digital Motor Controller User Manual 143
In the case where the load moved by the motor is not fixed, tune the PID with the mini-
mum expected load and tune it again with the maximum expected load. Then try to find
values that will work in both conditions. If the disparity between minimal and maximal
possible loads is large, it may not be possible to find satisfactory tuning values. In this
case, consider changing the PID gains on the fly during motor operation with serial/CAN
commands of with a MicroBasic script
In slow systems, use the integrator limit parameter to prevent the integrator to reach sat-
uration prematurely and create overshoots. Beware to set speeds that can physically be
reached by the motor under load. If the motor is not physically able, there will be a loop
error, which if it becomes too large, will cause a fault to be detected and the motor to be
stopped.
PID Tuning in Speed Position Mode
As discussed, in Closed Loop Speed Position mode, every millisecond, the controller com-
putes a successive desired position. The PID then works to make the motor follow the
computed trajectory. This mode works much better than the regular Closed Loop Speed
mode when the motor must operate at very low speed. When the motor is stopped, it
will maintain its position even if pulled, as for example on a robot stopped downhill.
The PID therefore must be tuned for position mode. In position mode, most of the work
is done by the proportional gain. It acts essentially as an imaginary rubber belt between
the controller’s internal destination counter and the motor: the higher the difference, the
more the belt is stretched, and the stronger the motor will turn. Once the imaginary belt
has stiffened the motor will run at the desired speed.
Try initially with only a small amount of P gain
P = 2
I = 0
D = 0
With the controller configured in Speed Position mode and the motor stopped, do a first
check of the PID’s stiffness by attempting to rotate the motor by hand. It should feel
increasingly hard to rotate away from the rest position. With a higher P gain, it will be-
come harder to move than lower gains. As a rule of thumb, on a mobile robot, use a gain
that makes it very hard to move the wheel more than a quarter turn away from the rest
position. Test then by applying a speed command and verifying the motor runs smoothly
under all load conditions.
The I and D gain can generally be omitted in Speed Position mode.
Beware to set speeds that can physically be reached by the motor under load. The Closed
Loop Speed Position mode relies on the fact that the motor will actually be able to follow
the computed trajectory. If the motor is not able, the controller will pause updating the
destination counter until the motor caught up. This will result in inaccurate speed and can
be a problem in mobile robot applications depending on precise control of their left and
right side motor.