© 2007 Science Publications Custom Design of an Analogue Input Digital Output Interface Card for Small Size PLCs

This paper describes the design and implementation of an interface card (IC) with analogue input and digital output, designed for use with small size PLCs, which do not support interface features. The absence of generic I/O interface modules due to the differences in PLCs design and software, validates the importance of such work. The IC costs about one third of an analogue I/O dedicated proprietary module. The IC was utilized in a closed loop temperature control system. The results of the work are satisfactory.


INTRODUCTION
The subject of this paper is a custom design of an analogue input digital output PLC interface card. Nowadays many PLC manufacturers offer for extra cost analogue I/O interface modules dedicated for their PLCs. The design of generic interface modules is still not common. This is due to the differences in PLC's structures and software. This work is an attempt in the said direction. This, also, helps in solving the problem of controlling a heater temperature by using custom designed PID/PWM program [1]. The card input is not programmable and the card does not include a coprocessor. All logic, math, data move and other operations are carried out by the PLC control processing unit (CPU). This interface card is intended to be used with small PLCs, which do not support analogue input interface (AII). The interface card (IC) is designed for one analogue input, but it could be expanded to accommodate multi analogue inputs by utilizing an 8-channel multiplexer existing in the (ADC) chip.
Very often, when it is required to control final power elements, switch-mode amplifiers [2] or (D) type amplifiers [3] are utilized. This is due to their high efficiency when compared with linear power amplifiers [4]. In order to function, power switches of switchmode amplifiers are controlled by using PWM signals. The generation of PWM signal is supposed to be done by a PLC subroutine which is driven by the output of a PID/PLC program [1]. This decreases the total cost of the control system, since there is no special hardware for the generation of the PWM signal, also it gives flexibility for modifying the control strategy from another point of view, as such there is no need for a (DAC) and power amplifier in order to control the final power element.

PRACTICAL DESIGN CONSIDERATIONS
The simplest things are the most powerful. Realizing this fact, an effort has been made to select standard common components with minimal complexity and lowest cost. In order to achieve the target the following requirements have to be met.
Taking into account that the voltage signal range at the transducer output is different from the required voltage range at the ADC input, zero and span circuits [5] are used for signal level matching between the transducer and (ADC). This same approach was applied in order to match signals levels between the PLC output and the power switch trigger unit. In order to input process variable signal to the PLC, an (ADC) with adequate resolution is utilized to convert the analogue signal to a digital one. The heater and the PLC are located beside each other. So there is no need for serial signal transmission between the (ADC) and the PLC. Thus through isolating optocouplers, an eight bit word is transmitted from the (ADC) to the PLC inputs. Some kind of timing is needed to drive the ADC, so, the 555 IC timer was utilized. In addition to that, power supply and voltage regulation are required to supply the components of the (IC). To meet this demand the voltage regulator 7805 IC was used.
Building on the above the I/O terminals of the interface card shall be as shown in figure No (1).
The detailed schematic diagram is illustrated in figure No (2). Hereunder is a detailed technical discussion about the interface card components and the selection of their parameters.    Figure 3 shows PLC I/O connections. The PLC type is Siemens Simatic S7-200 with a 214 CPU. The version of the PLC is DC/DC/DC, and this means that it has a DC power supply, and also DC inputs and outputs.
The CPU 214 DC/DC/DC accepts 20.4 to 28.8 as a power supply voltage range, consuming 85 mA typically for the CPU, and 900 mA on maximum load. It is fused with a 1 A, 125 V, slow-blow fuse.

Technical Specifications Of Interface Card Components
Zero and Span Circuit: The output of a transducer rarely matches the levels needed to be provided to the controller. Although it is possible to get high-level signal using different conditioning techniques [6], we still have inconvenient voltage range to deliver to the (ADC). In the used experimental temperature control board [7] the transducer gives 100 mV/ºC. This means that 2 to 8 volts result from applying 20 ºC to 80ºC to the transducer. Unfortunately the ADC accepts 0 to 5 volts as the analogue input. This issue is frequently encountered and therefore must have a standard solution. The solution is to implement zero and span circuit which is shown in figure No (4).
Two inverting amplifiers (LM741CN) are used in this circuit. The voltage at the circuit output e u2 is equal to: To meet the need negative offset, we selected V = -12 as the negative power supply voltage.
Therefore, R os was selected as a 220 kΩ fixed resistor with a series 500 kΩ potentiometer. This permits to vary (b) within the range (-1.375 to -4.5) V.
The above implies that    This IC is fully isolated from the PLC by using optocouplers as shown in figure No (5). ADC resolution is 0.01961 V.
Experimentally, the ADC was mounted on the test board, also different analogue voltages were applied to the (INO) pin, and the digital outputs were observed. Table No (2) shows some of the conversion results.

TIMER 555 IC:
The timer 555 IC is used to generate a 640 KHz, 50% duty cycle, 5 volts pulse train to drive the ADC0809. To achieve this timer, IC was connected to operate in the astable mode as astable vibrator as shown in figure No (6). The frequency of oscillation is calculated by using equation: And the duty cycle is equal to: For f r = 640 KHz, duty cycle = 50%, C ext = 1nF, solving the last two equations simultaneously gives: R 1 = R 2 = 750Ω. The timer circuit in figure No (6) was simulated using the EWB software and the circuit output was scoped as shows in figure No (7).

Optocoupler:
The duel and quad optocoupler ICs 74-4 / 74-2 use single transistor output stages in which the base terminal is not externally available. The CNY 74-4 / CNY 74-2 implemented digital interfacing between the CMOS IC (with TTL level output), and also the PLC 24 volts input circuit. Applying a 5 volt pulse signal to the led terminals causes the phototransistor to conduct 24 volts to the high voltage circuit (PLC input circuit). Temic Semiconductors shows detailed description, ratings and switching characteristics.
Power Supply: Referring to the ADC0809 datasheets we notice that the V cc may take values from 4.5 VDC to 6 VDC, while the reference voltage must be stabilized at 5 volts in order to obtain optimum functionality and accuracy. Luckily, the 555 IC can be fed with a wide range of V cc DC voltages including 5V (giving a 5V amplitude clock acceptable by ADC0809). This leads to underline the need of a 5V voltage regulator. The 7805 IC implements this function accompanied by adequate heat sink. It can provide 1A with fixed 5 volts between V out and GND.
Output Power Circuit: After adequate conditioning, the 0/24 VDC output of the PLC is used to trigger the triac as shown in figure No (8).
Average power delivered to the load depends on pulse width. Figure No (9) illustrates this.

CONCLUSIONS
For using PLC program as a controller in a closed loop system, a custom design analogue input digital output interface card was designed, assembled and tested.
As an interface card is three times cheaper than standard propriety analogue I/O model, the designed interface card could be utilized with PLCs which do not support analogue input interface.