User Manual

Table Of Contents
PID Description
Advanced Digital Motor Controller User Manual 141
sired actual max RPM, an additional parameter must be entered in the encoder or brush-
less configuration. The Max RPM parameter is the speed that will be reported as 1000
when reading the speed in relative mode. Max RPM is also the speed the controller will
attempt to reach when a max command of 1000 is applied.
When sending a speed command via serial, CANbus, scripting or USB, the command may
be sent as a relative speed (0 to +/-1000) or actual RPM value.
PID Description
The controller performs both Closed Loop Speed modes using a full featured Proportional,
Integral and Differential (PID) algorithm. This technique has a long history of usage in con-
trol systems and works on performing adjustments to the Power Output based on the dif-
ference measured between the desired speed or position (set by the user) and the actual
speed or position (captured by the sensor on the motor).
Figure 9-3 shows a representation of the PID algorithm. Every 1 millisecond, the controller
measures the actual motor speed or position and subtracts it from the desired speed or
position to compute the error.
The resulting error value is then multiplied by a user selectable Proportional Gain. The
resulting value becomes one of the components used to command the motor. The effect
of this part of the algorithm is to apply power to the motor that is proportional with the dif-
ference between the current and desired speed or position: when far apart, high power is
applied, with the power being gradually reduced as the motor moves to the desired speed
or destination.
A higher Proportional Gain will cause the algorithm to apply a higher level of power for a
given measured error thus making the motor react more quickly to changes in commands
and/or motor load.
The Differential component of the algorithm computes the changes to the error from one
1 ms time period to the next. This change will be a relatively large number every time
an abrupt change occurs on the desired speed value or the measured speed 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 speed or position value. The differential
component will also help dampen any overshoot and oscillation.
The Integral component of the algorithm performs a sum of the error over time. In Speed
mode, this component helps the controller reach and maintain the exact desired speed
when the error is reaching zero (i.e. measured speed is near to, or at the desired value). In
Speed Position mode, the Integral parameter can help maintain a slightly tighter difference
between the desired and actual position, but makes no significant difference and can be
omitted altogether.