Datasheet

LM628, LM629
SNVS781C JUNE 1999REVISED MARCH 2013
www.ti.com
RDDV COMMAND: READ DESIRED VELOCITY
Command Code:07 Hex
Bytes Read:Four
Data Range:C0000001 to 3FFFFFFF
Executable During Motion:Yes
This command reads the integer and fractional portions of the instantaneous desired (current temporal ) velocity,
as used to generate the desired position profile. The bytes are read in most-to-least significant order. The value
read is properly scaled for numerical comparison with the user-supplied (commanded) velocity; however,
because the two least-significant bytes represent fractional velocity, only the two most-significant bytes are
appropriate for comparison with the data obtained via command RDRV (see below). Also note that, although the
velocity input data is constrained to positive numbers (see command LTRJ), the data returned by command
RDDV represents a signed quantity where negative numbers represent operation in the reverse direction.
RDRV COMMAND: READ REAL VELOCITY
Command Code:0B Hex
Bytes Read:Two
Data Range:C000 to 3FFF Hex, See Text
Executable During Motion:Yes
This command reads the integer portion of the instantaneous actual velocity of the motor. The internally
maintained fractional portion of velocity is not reported because the reported data is derived by reading the
incremental encoder, which produces only integer data. For comparison with the result obtained by executing
command RDDV (or the user-supplied input value), the value returned by command RDRV must be multiplied by
2
16
(shifted left 16 bit positions). Also, as with command RDDV above, data returned by command RDRV is a
signed quantity, with negative values representing reverse-direction motion.
RDSUM COMMAND: READ INTEGRATION-TERM SUMMATION VALUE
Command Code:0D Hex
Bytes Read:Two
Data Range:00000 Hex to ± the Current Value of the Integration Limit
Executable During Motion:Yes
This command reads the value to which the integration term has accumulated. The ability to read this value may
be helpful in initially or adaptively tuning the system.
Typical Applications
PROGRAMMING LM628 HOST HANDSHAKING (INTERRUPTS)
A few words regarding the LM628 host handshaking will be helpful to the system programmer. As indicated in
various portions of the above text, the LM628 handshakes with the host computer in two ways: via the host
interrupt output (Pin 17), or via polling the status byte for “interrupt” conditions. When the hardwired interrupt is
used, the status byte is also read and parsed to determine which of six possible conditions caused the interrupt.
When using the hardwired interrupt it is very important that the host interrupt service routine does not interfere
with a command sequence which might have been in progress when the interrupt occurred. If the host interrupt
service routine were to issue a command to the LM628 while it is in the middle of an ongoing command
sequence, the ongoing command will be aborted (which could be detrimental to the application).
Two approaches exist for avoiding this problem. If one is using hardwired interrupts, they should be disabled at
the host prior to issuing any LM628 command sequence, and re-enabled after each command sequence. The
second approach is to avoid hardwired interrupts and poll the LM628 status byte for “interrupt” status. The status
byte always reflects the interrupt-condition status, independent of whether or not the interrupts have been
masked.
24 Submit Documentation Feedback Copyright © 1999–2013, Texas Instruments Incorporated
Product Folder Links: LM628 LM629