
2004 Microchip Technology Inc. DS00900A-page 11
AN900
PID CONTROL FIRMWARE
PID is a well-known, commonly used method of feed-
back control. As seen in the PID algorithm in
Equation 2, PID generates a control signal by multiply-
ing the error, the integral of the error and the derivative
of the error by individual gains and then summing the
results. The proportional term generates a corrective
signal in proportion to the error. The integral term gen-
erates a corrective signal proportional to summation of
the error over time. The derivative term generates a
corrective signal in proportion to the rate of change of
the error. In velocity control applications, the derivative
gain is often set to zero, as PI control is usually
sufficient for achieving well-tuned speed control.
To implement V/f control with velocity feedback, the tar-
get speed, actual speed and speed error are all calcu-
lated as shown in Equation 2. The speed error is
passed to the PID algorithm. Integral error is calculated
in the PID routine by accumulating the speed error over
time. Derivative error is calculated by subtracting the
last error value from the present error value. Since the
routine is called at fixed time intervals, the difference in
the two error values is proportional to the rate of
change of error. In this application, the PWM period
interrupt rate is used to determine the update rate of
the PID calculation.
The PID functions used in this application note are
described in AN937, “Implementing a PID Controller
Using a PIC18 MCU”.
CLOSED-LOOP SLIP CONTROL
In many applications, it is desirable to control slip in
order to optimize for torque, efficiency or power factor
depending upon changing requirements. Figure 8
shows how torque, power factor and efficiency may
vary with the degree of slip for a typical motor. By vary-
ing the amount of desired slip, the motor performance
can be optimized for any of these three attributes. For
example, torque may be maximized by allowing a
higher degree of slip; efficiency optimized by allowing a
lesser degree.
To control slip, the actual motor speed is compared
against the drive frequency to determine the present
slip frequency. The slip frequency is compared to the
desired slip frequency to produce a slip frequency
error. Drive frequency and amplitude are modified in
order to minimize the slip frequency error.
Figure 9 shows how a slip control could be imple-
mented. Identical hardware is used as in V/f control
with velocity feedback. Only the algorithm is modified.
FIGURE 8: TORQUE, POWER FACTOR AND EFFICIENCY VERSUS SLIP
Torque (T)
Slip
00.2
0.4 0.6
0.8 1
Power Factor (PF)
Efficiency (n)
Rated
Slip
Slip for
max n
Slip for
max PF
Slip for
max T
Torque
Comentarios a estos manuales