505
CHAPTER
11
System Programming
and Implementation
Industrial Text & Video Company 1-800-752-8398
www.industrialtext.com
SECTION
3
PLC
Programming
In Figure 11-59, scale multiplication allows the virtual position, which has
two decimal points (10
–2
) to be multiplied by the multiplication constant
(4095 × 10
–1
= 409.5); thus, the final scale is 10
–3
. This routine allows the
motor to move the part to the virtual position as specified by the LVDT. Once
the virtual position has been reached, the system is ready to start the machine
cycle (one-shot output 1257). The machine cycle subroutine will return an
end-of-cycle signal (output 1777) when finished, which disables the cycle
subroutine (see Figure 11-57).
When the end of cycle has occurred, the PLC will tell the motor to move either
forward or backward, depending on the moving part position at the end of
cycle. The interlocking performed by output rungs 1354 and 1355 (refer to
Figure 11-60) allow the motor to move in reverse if the part is farther than the
virtual position (current position > V.P.). Rungs 1356 and 1357 perform the
opposite function if the position of the part is closer than the virtual position
(current position < V.P.).
The one-shot circuits used in the LVDT application prevent the system from
moving the motor forward or backward until the part is at exactly the virtual
position in counts. Analog count signals may jump one or two counts in
either direction (up or down). This can result in instability, causing the
forward and reverse signals to clash. The logic that is employed in this
subroutine will detect, once the part crosses the virtual position (one-shot
outputs 1355 and 1357 in Figure 11-60), whether the part is coming from a
reverse motor or forward motor operation. Once the part is detected (i.e.,
when the one-shot is triggered), a minor jump in analog counts will not affect
the operation, since the program has already determined that the part has just
passed the virtual position. After the part stops at the virtual position, both the
forward and reverse motor commands from the subroutine are inhibited.
In some PLC applications, the analog input signal received does not have a
linear relationship with the signal being measured. That is, the ratio of
change in the measurement variable is not the same throughout the measure-
ment range. For example, a pressure transducer measuring hydraulic
pressure (see Figure 11-61) may not provide a signal that is a linear
representation of psi changes versus voltage changes (and therefore input
counts). Sometimes the system that is being controlled creates these
nonlinearities. The use of look-up tables and linear interpolation methods
based on premeasured values can circumvent nonlinearity problems. In
linear interpolation, the PLC stores known measured values in a table and
then refers to this table during the reading of every measurement (analog
counts) to determine the value of the variable (e.g., psi). It calculates this
value by interpolating between the known measured values of the variable
below and above the actual analog count reading. The more known values in
the table, the more accurate the interpolated values will be.
LINEAR INTERPOLATION OF NONLINEAR INPUTS