This is an example of modernization for a machine control system. It will go from hardwired relay logic, to PLC programmed logic. With the exception of the ones that the controller can execute (e.g. timers and control relays), the field devices will not change. Modernizing this machine’s control system will bring many benefits:
* A more reliable control system
* Less energy consumption
* Less space is required for the control panel
* A flexible system that can be expanded in the future
Figure 45 shows the relay ladder diagram which controls the logic sequence of this machine. The diagram only shows a portion of the relay ladder logic.
Figure 45: Electromechanical relay diagram.
A quick review of the relay ladder diagram shows that some portions of the logic should remain hardwired. These are lines 1, 2 and 3. This will ensure that all emergency stop conditions are independent of the controller. Hardwiring the hydraulic pump motor (M1) should be done as well. It is only energized when master start push button (PB1) is pushed. These hardwired components are illustrated in Figure 46. The safety relay (SCR), which provides power to the rest, will only work if M1 is functioning properly and the emergency push button is not pressed.
Figure 46. Elements of the modernization example system to be left hardwired.
The PLC fault contact can also be connected to an alarm for a PLC failure. The fault coil will be energized by the PLC during normal operation. This will close PLC Fault Contact 1 (closing) and open PLC Fault Contact 2.
Continuing with the example, let’s now assign the actual inputs and outputs of the I/O assignment file. We will assign all control relays their internal output addresses, along with timers and interlocks. The assignment and description of inputs and outputs as well as internals are shown in Tables 20-21. You will notice that inputs with multiple contacts (e.g. LS4 or SS3) have one connection to the controller.
Table 20: I/O address assignment.
Table 21: Internal address assignment.
Figure 47 illustrates the PLC program code (hardwired relay translator) in this example. The ladder program illustrates the special coding techniques required to implement PLC logic. These techniques include the software MCR function and instantaneous contact from timers.
The program software specifies an MCR’s internal output. This function is similar to a hardwired one. The relay logic diagram shown in Figure 45 shows that if the MCR has been energized, the contacts will close and allow power to flow to other parts of the system. The internal MCR 1700 in the PLC software performs the same function. In this example, MCR1700 represents the first address for MCRs. The PLC cannot execute the ladder logic between the MCR coil instruction and the ENDMCR instruction if the MCR coil has not been energized.
Figure 47: PLC implementation of the circuit in Figure 45.
The control relay CR2 (line 9) cannot be replaced by an internal, as the PL3 contacts can be used in line 10. This can be used when a control relay is connected to a real output device. We don’t need to separate the coils of lines 17 and 18. This is already done because the PLC here doesn’t allow multiple output rungs. It is a good idea to use separate rungs for each output.
As explained in previous sections, the normally closed inputs connected to the input modules can be programmed as normally opened. Two contacts make up the limit switch LS4: a normally open and a normally shut one, respectively. These are shown in Figure 45 lines 17 and 19. Only one set of contacts must be connected to the controller. In this case, the normally closed contact LS4 has been selected. The normally open contact isn’t connected to the controller but its hardwired function may still be achieved by programming LS4 in the form of a normally closed ladder touch.
These applications require timers that have instantaneous contacts. This feature is not available in all PLCs. A timer can be set to enable an instantaneous contact, which means that the contact opens or closes automatically when it is activated. An internal coil can be used to replace an instantaneous contact in most PLCs. Line 15 of the hardwired logic explains that if PB6 and CR4 are pressed, the timer TDR2 will begin timing and contact TDR2-1 seals PB6.
This arrangement requires special PLC implementation. Software timer contacts are required. The timer will not seal until the timer has run out. The timer will reset if PB6 gets released. This is because PB6 has not been sealed. This problem can be solved by using internal coil 1001 for sealing PB6. Then, the TDR2 timing timer will start. This technique is shown on lines 9, 10 and 11 of PLC program coding. ON delays are handled by the time delay contacts (2001).