1 Introduction
In the design of a PLC control system, although wiring accounts for a relatively small proportion, the majority of the work is still PLC programming. However, wiring is the foundation of programming; only with correct wiring can programming proceed smoothly. Ensuring correct wiring requires a clear understanding of the PLC's internal input/output circuits.
We know that to prevent interference from external circuits (such as voltage spikes, noise, etc.) from causing abnormal operation or even damage to components, PLC digital input modules generally use optocouplers on the input side to disconnect the electrical connection between the internal and external circuits, ensuring normal operation of the PLC. Furthermore, RC filter circuits are installed in the input circuits to prevent erroneous signals caused by input point jitter or external interference pulses.
2. Input circuit configuration
2.1 Classification
PLC input circuits can be categorized by external power supply type into DC input circuits and AC input circuits; by the direction of current flow at the PLC input module's common terminal (COM terminal) into source input circuits and drain input circuits; and by the connection method of the optocoupler's LED common terminal into common anode and common cathode input circuits. See Figure 1 below:
Figure 1 Classification of PLC input circuits
2.2 Classification by type of external power supply
2.2.1 DC Input Circuit
Figure 2 shows one form of DC input circuit (only one input circuit is shown). When the switch of the external circuit in Figure 1 is closed, the LED of the optocoupler inside the PLC lights up, and the phototransistor is saturated and conducting. This conduction signal is then transmitted to the processor, so the CPU thinks that there is a signal input on this circuit; when the external switch is opened, the LED in the optocoupler is turned off, the phototransistor is cut off, and the CPU thinks that there is no signal on this circuit.
Figure 2 DC input circuit
2.2.2 AC Input Circuit
The AC input circuit is shown in Figure 3. It can be seen that the main difference from the DC input circuit is...
It simply adds a rectification stage.
The input voltage for AC input is typically AC120V or 230V. The AC power is limited by resistor R and isolated by capacitor C (removing the DC component from the power supply), and then rectified into DC power by a bridge rectifier. The subsequent working principle is the same as that of the DC input circuit, and will not be described in detail again.
Figure 3 AC input circuit
As can be seen from the above, due to the addition of current limiting, isolation, and rectification stages in the AC input circuit, the input signal delay time is longer than that of the DC input circuit, which is its disadvantage. However, because its input terminal is at a high voltage, the reliability of the input signal is higher than that of the DC input circuit. Generally, AC input is used in harsh environments such as those with oil mist or dust, where responsiveness requirements are not high, while DC input is used in environments with better conditions, less severe electromagnetic interference, and where responsiveness requirements are high.
2.3 Classification by the direction of current flowing into the common terminal
2.3.1 Sinking Input Circuit
The sinking input circuit is shown in Figure 4. At this time, the current flows in from the PLC common terminal (COM terminal or M terminal) and flows out from the input terminal, that is, the PLC common terminal is connected to the positive terminal of the external DC power supply.
Figure 4 Sinking Input Circuit
This diagram only shows the case of one input. If there are multiple inputs, the anodes of all the diodes at the inputs are connected together, forming a common anode circuit, as shown in Figure 5.
Figure 5 Common anode circuit
The input modules of Mitsubishi A-series PLCs, such as AX40/41/42/50/60 and Q-series QX40/41/42, are all sinking input modules.
2.3.2 Source Input Circuit
The circuit shown in Figure 3 is also a source-type input circuit. In this case, the current flow direction is exactly the opposite of that in the sink-type circuit. The current in the source-type input circuit flows into the PLC's input terminal and out through the common terminal, which is connected to the negative terminal of the external power supply.
If the cathodes of the diodes in all input circuits are connected together, a common cathode circuit is formed, as shown in Figure 6:
Figure 6 Common cathode circuit
The input modules of Mitsubishi's A-series PLCs AX80/81/82 and Q-series PLCs QX80/81 belong to this type of input circuit.
2.3.2 Hybrid Input Circuit
Because this type of PLC's common terminal can both output current and drain current (meaning it can be connected to either the positive or negative terminal of an external power supply), and it possesses the characteristics of both a source input circuit and a drain input circuit, we can tentatively call this type of input circuit a hybrid input circuit. Its circuit configuration is shown in Figure 7.
Figure 7 Hybrid Circuit
When used as a source input, the common terminal is connected to the negative terminal of the power supply; when used as a drain input, the common terminal is connected to...
The positive terminal of the power supply. This allows for wiring according to site requirements, providing great flexibility in wiring work.
Mitsubishi A-series PLCs AX50-S1/60-S1/70/71/81-S1 and Q-series PLCs QX70/71/72.
It should be noted that Mitsubishi and Siemens have opposite classifications for "source input" and "drain input" circuits. The above explanation follows Mitsubishi's classification method, and this should be taken into account during use.
Most DC input modules in the SIEMENS S7-300/400 series PLCs are sinking inputs (the common terminal is connected to the negative terminal of the external power supply. Note: according to SIEMENS classification). In the S7-300 series PLCs, only the SM321 (-IBH50-) input module is a source input (the common terminal is connected to the positive terminal. Note: according to SIEMENS classification). The S7-400 series PLCs do not have source input modules. The input modules in the smaller S7-200 series are all of mixed type. This type of input is not recommended for large projects because, although wiring is convenient, it can easily lead to power supply confusion.
3. Connection of external switch signals and PLC input circuit
In addition to dry contact signals like those from buttons, some sensors now also provide NPN and PNP open-collector output signals for PLC external input signals. The connection between dry contact signals and PLC input modules is relatively simple and will not be elaborated upon here. However, the choice between NPN and PNP inputs for different PLC input circuits can sometimes be confusing. The following section mainly introduces the connection between these two types of inputs and PLC input circuits.
3. Forms of NPN and PNP output circuits
Figures 8 and 9 show one form of NPN and PNP output circuits, respectively.
Figure 8 NPN open-collector output; Figure 9 PNP open-collector output.
As can be seen from Figures 8 and 9, the output OUT terminal of the NPN open-collector output circuit is connected to 0V through a switching transistor. When the sensor is activated, the switching transistor is saturated and turned on, and the OUT terminal is connected to 0V, outputting a 0V low-level signal. The output OUT terminal of the PNP open-collector output circuit is connected to +V through a switching transistor. When the sensor is activated, the switching transistor is saturated and turned on, and the OUT terminal is connected to +V, outputting a +V high-level signal.
3. Connection of 2NPN and PNP output circuits to PLC input module
3.2.1 NPN Open Collector Output
From the above analysis, we can see that the NPN open-collector output is 0V. When the output OUT terminal is connected to the PLC input, the current flows out from the PLC input terminal and into the PLC common terminal. This is the form of a sinking circuit for the PLC. That is, the NPN open-collector output can only be connected to a PLC with a sinking or mixed-type input circuit. The connection diagram is shown in Figure 10.
Figure 10 shows the connection between NPN open collector output and PLC.
3.2.2 PNP Open Collector Output
The PNP open-collector output is +V high level. When the output OUT terminal is connected to the PLC input, current flows in from the PLC input terminal and out from the PLC common terminal. This is the source-type circuit configuration of the PLC. That is, the PNP open-collector output can only be connected to a PLC with source-type or mixed-type input circuit configuration. The connection diagram is shown in Figure 11.
Figure 11 Connection between PNP open collector output and PLC
4. Conclusion
Due to the diversity of PLC input module circuit configurations and external sensor output signals, we must fully understand the type of PLC input circuit and the form of sensor output signals before wiring the PLC input module. Only in this way can we ensure that the PLC input module wiring is correct and lay a good foundation for subsequent PLC programming and debugging.