Datasheet

LM628, LM629
www.ti.com
SNVS781C JUNE 1999REVISED MARCH 2013
and P = 2000 * desired number of revolutions
P = 2000 * 100 revs = 200,000 counts (value to load)
P (coding) = 00030D40 (hex code written to LM628)
let V = velocity (units = counts/sample)
let T = sample time (seconds) = 341 μs (with 6 MHz clock)
let C = conversion factor = 1 minute/60 seconds
then V = R * T * C * desired rpm
and V = 2000 * 341E6 * 1/60 * 600 rpm
V = 6.82 counts/sample
V (scaled) = 6.82 * 65,536 = 446,955.52
V (rounded) = 446,956 (value to load)
V (coding) = 0006D1EC (hex code written to LM628)
let A = acceleration (units = counts/sample/sample)
A = R * T * T * desired acceleration (rev/sec/sec)
then A = 2000 * 341E6 * 341E-6 * 1 rev/sec/sec
and A = 2.33E4 counts/sample/sample
A (scaled) = 2.33E4 * 65,536 = 15.24
A (rounded) = 15 (value to load)
A (coding) = 0000000F (hex code written to LM628)
The above position, velocity, and acceleration values must be converted to binary codes to be loaded into the
LM628. The values shown for velocity and acceleration must be multiplied by 65,536 (as shown) to adjust for the
required integer/fraction format of the input data. Note that after scaling the velocity and acceleration values,
literal fractional data cannot be loaded; the data must be rounded and converted to binary. The factor of four
increase in system resolution is due to the method used to decode the quadrature encoder signals, see
Figure 10.
PID COMPENSATION FILTER
The LM628 uses a digital Proportional Integral Derivative (PID) filter to compensate the control loop. The motor is
held at the desired position by applying a restoring force to the motor that is proportional to the position error,
plus the integral of the error, plus the derivative of the error. The following discrete-time equation illustrates the
control performed by the LM628:
where
u(n) is the motor control signal output at sample time n, e(n) is the position error at sample time n, n indicates
sampling at the derivative sampling rate, and kp, ki, and kd are the discrete-time filter parameters loaded by
the users. (1)
The first term, the proportional term, provides a restoring force porportional to the position error, just as does a
spring obeying Hooke's law. The second term, the integration term, provides a restoring force that grows with
time, and thus ensures that the static position error is zero. If there is a constant torque loading, the motor will
still be able to achieve zero position error.
The third term, the derivative term, provides a force proportional to the rate of change of position error. It acts
just like viscous damping in a damped spring and mass system (like a shock absorber in an automobile). The
sampling interval associated with the derivative term is user-selectable; this capability enables the LM628 to
control a wider range of inertial loads (system mechanical time constants) by providing a better approximation of
the continuous derivative. In general, longer sampling intervals are useful for low-velocity operations.
Copyright © 1999–2013, Texas Instruments Incorporated Submit Documentation Feedback 11
Product Folder Links: LM628 LM629