scieee AI-readable full text Open interactive document viewer

Scan time reduction of PLCs by dedicated parallel-execution multiple PID controllers using an FPGA

Dhanabalan, Gnanasekaran

Abstract

A programmable logic controller (PLC) executes a ladder diagram (LD) using input and output modules. An LD also has PID controller function blocks. It contains as many PID function blocks as the number of process parameters to be controlled. Adding more process parameters slows down PLC scan time. Process parameters are measured as analog signals. The analog input module in the PLC converts these analog signals into digital signals and forwards them to the PID controller as inputs. In this research work, a field-programmable gate array (FPGA)-based multiple PID controller is proposed to retain PLC scan time at a lower value. Concurrent execution of multiple PID controllers was assured by assigning separate FPGA hardware resources for every PID controller. Digital input to the PID controller is routed by the novel idea of analog to digital conversion (ADC), performed using a digital to analog converter (DAC), comparator, and FPGA. ADC combined with dedicated PID controller logic in an FPGA for every closed-loop control system confirms concurrent execution of multiple PID controllers. The time required to execute two closed-loop controls was identified as 18.96000004 ms. This design can be used either with or without a PLC.

Full text

Citation: Dhanabalan, G.; Tamil Selvi, S.; Mahdal, M. Scan Time Reduction of PLCs by Dedicated Parallel-Execution Multiple PID Controllers Using an FPGA. Sensors 2022,22, 4584. https://doi.org/ 10.3390/s22124584 Academic Editor: Mehmet Rasit Yuce Received: 18 May 2022 Accepted: 15 June 2022 Published: 17 June 2022 Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations. Copyright: © 2022 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https:// creativecommons.org/licenses/by/ 4.0/). sensors Article Scan Time Reduction of PLCs by Dedicated Parallel-Execution Multiple PID Controllers Using an FPGA Gnanasekaran Dhanabalan 1, Sankar Tamil Selvi 1and Miroslav Mahdal 2,* 1Department of Electronics and Communication Engineering, AAA College of Engineering and Technology, Sivakasi 626123, India; [email protected] (G.D.); [email protected] (S.T.S.) 2Department of Control Systems and Instrumentation, Faculty of Mechanical Engineering, VSB-Technical University of Ostrava, 17. Listopadu 2172/15, 708 00 Ostrava, Czech Republic *Correspondence: miroslav[email protected] Abstract: A programmable logic controller (PLC) executes a ladder diagram (LD) using input and output modules. An LD also has PID controller function blocks. It contains as many PID function blocks as the number of process parameters to be controlled. Adding more process parameters slows down PLC scan time. Process parameters are measured as analog signals. The analog input module in the PLC converts these analog signals into digital signals and forwards them to the PID controller as inputs. In this research work, a field-programmable gate array (FPGA)-based multiple PID controller is proposed to retain PLC scan time at a lower value. Concurrent execution of multiple PID controllers was assured by assigning separate FPGA hardware resources for every PID controller. Digital input to the PID controller is routed by the novel idea of analog to digital conversion (ADC), performed using a digital to analog converter (DAC), comparator, and FPGA. ADC combined with dedicated PID controller logic in an FPGA for every closed-loop control system confirms concurrent execution of multiple PID controllers. The time required to execute two closed-loop controls was identified as 18.96000004 ms. This design can be used either with or without a PLC. Keywords: analog to digital conversion; data acquisition; field programmable gate arrays; PI control; programmable logic controller; scan time 1. Introduction The contribution of a programmable logic controller (PLC) in an automation system is significant. It acts as a controller for closed-loop system(s) and executes combinational or sequential logic repeatedly through the ladder diagram (LD). It is capable of handling a sufficient number of analog and digital signals. However, adding more and more signals to it is a burden. The PLC needs an analog input module (AIM), an analog output module (AOM), and a proportional, integral, and derivative (PID) function block in the LD to realize a closed-loop control system. This ensures that the output of the closed-loop control system is always at the desired value. Whenever the PLC reads the PID function block in its LD, it refers to the AIM to read the analog value concerned with that function block. It generates a digital output after completing the execution of the PID function block and forwards it to the AOM. A digital to analog converter (DAC) in the AOM converts this digital output into an analog signal and activates the final control element. Adding more PID function blocks delays the execution of the remaining rungs in the LD and increases the scan time of the PLC. The basic reason behind this is that the PLC, AIM, and AOM have processors to perform their functions. An elaborate literature review was carried out to understand how researchers focus on the multiple closed-loop control systems. A model for composition and inventory control for a continuous ethanol–water nonlinear pilot distillation column has been developed in [ 1 ]. A computer acts as a controller, and the control action is established using a neural network combined with the genetic algorithm. A novel technique to monitor the condition Sensors 2022,22, 4584. https://doi.org/10.3390/s22124584 https://www.mdpi.com/journal/sensors Sensors 2022,22, 4584 2 of 17 of a wind turbine gearbox using an NI data acquisition card and LabVIEW is explained in [ 2 ]. The design introduced a new signal processing technique to monitor the condition of the gearbox. A digital signal processor (DSP)-based speed control action for a three-phase induction motor using the vector-controlled method has been implemented in [ 3 ]. The DSP processor modifies the value of the phase current to vary the motor speed. A water pumping system has been developed in [ 4 ]. It used a PLC and an industrial wide area network (WAN) to control the water level in the tank. The digital implementation of a fast, discrete Stockwell transform (FDST) for accurate power quality (PQ) event detection and energy metering is discussed in [ 5 ]. The FDST algorithm was implemented in an FPGA, and the PQ events were analyzed using LabVIEW. The design used a 12-bit analog to digital converter (ADC), available in the FPGA board, to convert the test analog signal into digital. A PLC-SCADA-based control system for a water storage tank is discussed in [ 6 ]. It used an RSLOGIX 5000 PLC in its design. The speed control of a three-phase induction motor using a PLC has been implemented by [ 7 ]. The PLC maintains the speed of the induction motor at the desired value. An idea of detecting induction motor faults using FPGAs is discussed in [ 8 ]. It used a 16-bit serial output ADC to convert the acquired current signal into a digital signal. The design of a parallelized multi-PID controller using a field programmable gate array (FPGA)-based multiprocessor is discussed in [ 9 ]. It used an enhanced PicoBlaze microcontroller (EPM). The design was tested with four PID controllers that ran simultaneously. However, this work did not discuss how this multiple PID controller handles analog signals. An example cited in the work does not require the conversion of analog signals into digital. Therefore, it is not clear whether this design can perform the concurrent execution of multiple PID controllers when an analog signal is to be maintained at the desired set point. Thus, the review indicates that single or multiple closed-loop control systems have been developed using a PLC, computer, DSP, or FPGA, or a combination of these pieces of equipment. The FPGA has being identified as a better alternative that can perform the function of a processor [ 10 ] in an improved way. One such example is the design of the FPGA-based floating-point processor discussed in [ 11 ]. FPGAs can also be used in the implementation of PID controllers [ 12 , 13 ]. The design of an ultrasonic local positioning system using an FPGA for robot applications is discussed in [ 14 ]. It used a PID controller so that the robot could track the line accurately. Researchers are eager to find an optimized solution for PLCs in terms of FPGAs [ 15 ]. Researchers have also started to realize PID controllers using FPGAs, as discussed in [ 16 ]. This work proposed a method in which more than one closed-loop control system will be concurrently processed by the dedicated hardware resources of the FPGA without compromising the scan time of the PLC. 2. Overview of Closed-Loop Control System with PLC In the early 1990s, researchers developed a dedicated hardware controller that did not demand any software. The ASIC design of a PI controller is discussed in [ 17 ]. Realization of a multiple PID controller using a low power single chip has been discussed in [ 18 ]. Conventionally, a closed-loop control system has a controller, final control element, and transmitter. The controller compares the desired value with the transmitter output and actuates the final control element to maintain the process variable at the desired value. The controller employs a microprocessor/microcontroller [ 19 ] to realize controller algorithms such as P/PI/PID. It has an inbuilt ADC to convert the analog output of the transmitter signal into digital. A single closed-loop control system needs an ADC, a microprocessor as a controller, and a DAC. This count increases along with the number of closed-loop control systems. However, a single microprocessor shall be defined as a controller. In a practical scenario, all the ADCs and DACs are developed as AIMs and AOMs, respectively. The processor in the PLC is used to execute the control algorithm, as shown in Figure 1. Sensors 2022,22, 4584 3 of 17 Sensors 2022, 22, x FOR PEER REVIEW 3 of 15 Figure 1. Organization of closed-loop control system using a PLC. Both the AIM and the AOM must have a processor to ensure proper signal conversion. Thus, the AIM, AOM, and PLC have processors in their architecture [20]. Because the processor executes only one instruction at a time, the PLC has to wait for the AIM to complete its operation. The PID function block in the LD is ordered as last in the execution of a ladder diagram. Including PID function blocks in the LD creates an unnecessary delay in the execution of digital signals. If there is a device that takes care of PID function blocks, then the burden of the PLC can be greatly reduced. This work has proposed a solution of multiple PID controllers developed using an FPGA that can be configured as a mixture of AIM, DIM, AOM, and DOM. The present configuration of a PLC-based automation system does not have the configuration of AIM/AOM/DIM/DOM in a single module. 3. Design of Single and Multiple PID Controllers Sections 3.1. and 3.2. elaborate the design of single and multiple PID controllers developed using an FPGA. Section 3.1.1 explains the design of an ADC that ensures concurrent conversion of more than one analog signal into digital. As a whole, this chapter provides a novel solution for the simultaneous processing of all PID controllers. 3.1. FPGA Design of PID Controller A PID controller helps to maintain the value of a process parameter at the desired value. It requires three parameters, proportional gain, integral time, and derivative time, to be adjusted to achieve better performance. In this work, VerilogHDL code has been developed for the PID controller. If required, the PID controller can be easily changed into a PI controller by assigning the derivative time as zero in HDL (Hardware Description Language) code [21]. The standard equation of a PID controller is given as: ()= ()+ () + ()  (1) In Equation (1), () is the error signal, () is the controller output,  is the proportional gain,  is the integral time, and  is the derivative time. Because the equation must be realized by an FPGA, it is converted into the form of a difference equation [22,23], as mentioned in Equation (2). 󰇟󰇠= 󰇟−1 󰇠+ 󰇟󰇠+ 󰇟−1 󰇠+ 󰇟−2 󰇠 (2) where, = + +  Figure 1. Organization of closed-loop control system using a PLC. Both the AIM and the AOM must have a processor to ensure proper signal conversion. Thus, the AIM, AOM, and PLC have processors in their architecture [ 20 ]. Because the processor executes only one instruction at a time, the PLC has to wait for the AIM to complete its operation. The PID function block in the LD is ordered as last in the execution of a ladder diagram. Including PID function blocks in the LD creates an unnecessary delay in the execution of digital signals. If there is a device that takes care of PID function blocks, then the burden of the PLC can be greatly reduced. This work has proposed a solution of multiple PID controllers developed using an FPGA that can be configured as a mixture of AIM, DIM, AOM, and DOM. The present configuration of a PLC-based automation system does not have the configuration of AIM/AOM/DIM/DOM in a single module. 3. Design of Single and Multiple PID Controllers Section 3.1. and Section 3.2. elaborate the design of single and multiple PID controllers developed using an FPGA. Section 3.1.1 explains the design of an ADC that ensures concurrent conversion of more than one analog signal into digital. As a whole, this chapter provides a novel solution for the simultaneous processing of all PID controllers. 3.1. FPGA Design of PID Controller A PID controller helps to maintain the value of a process parameter at the desired value. It requires three parameters, proportional gain, integral time, and derivative time, to be adjusted to achieve better performance. In this work, VerilogHDL code has been developed for the PID controller. If required, the PID controller can be easily changed into a PI controller by assigning the derivative time as zero in HDL (Hardware Description Language) code [21]. The standard equation of a PID controller is given as: u(t) = kP e(t) + 1 TI t Z 0 e(t)dt +TD de(t) dt  (1) In Equation (1), e(t) is the error signal, u(t) is the controller output, kP is the proportional gain, TI is the integral time, and TD is the derivative time. Because the equation must be realized by an FPGA, it is converted into the form of a difference equation [ 22 , 23 ], as mentioned in Equation (2). u[k] = u[k−1]+k1e[k] + k2e[k−1]+k3e[k−2](2) Sensors 2022,22, 4584 4 of 17 where, k1=kp(1+ki+kd) k2=−kp(1+2kd) k3=kpkd Inputs and outputs to and from the multiple closed-loop control system are multiple. The execution becomes concurrent when separate hardware is assigned to execute Equation (2) for every input. Hence, multiple closed-loop control systems designed using FPGAs can be visualized as real multiple input and multiple output systems. 3.1.1. Single Closed-Loop Control System—Proposed In a closed-loop control system, inputs to a PID controller are set to point to the transmitter’s output, wherein the calculation of the control error (difference of these inputs) is realized in-side the controller. The transmitter receives input from a sensor. An industrial standard transmitter generates output in the range of 0–5 V. The output of the transmitter is an analog signal. The interface circuit that comprises a DAC, comparator, and analog to digital conversion logic in the FPGA, as in Figure 2, converts the transmitter’s analog signal into digital. The working principle of successive approximation register (SAR) type ADC is preferred in many applications, as mentioned in [24]. Sensors 2022, 22, x FOR PEER REVIEW 4 of 15 =− −2  =  Inputs and outputs to and from the multiple closed-loop control system are multiple. The execution becomes concurrent when separate hardware is assigned to execute Equation (2) for every input. Hence, multiple closed-loop control systems designed using FPGAs can be visualized as real multiple input and multiple output systems. 3.1.1. Single Closed-Loop Control System—Proposed In a closed-loop control system, inputs to a PID controller are set to point to the transmitter’s output. The transmitter receives input from a sensor. An industrial standard transmitter generates output in the range of 0–5 v. The output of the transmitter is an analog signal. The interface circuit that comprises a DAC, comparator, and analog to digital conversion logic in the FPGA, as in Figure 2, converts the transmitter’s analog signal into digital. The working principle of successive approximation register (SAR) type ADC is preferred in many applications, as mentioned in [24] Figure 2. FPGA design of single closed-loop control system. This work has proposed a novel conversion process of analog signals into digital, which can be seen in Figure 3. It was developed, simulated, and verified using Multisim [25]. Figure 3. FPGA design of analog input module for a single channel. It functions on the working principle of successive approximation register (SAR) type ADC. The most significant bit (MSB) of the SAR register will be set, and the remaining bits will be in reset condition. A register in an FPGA is declared as a SAR register. The Figure 2. FPGA design of single closed-loop control system. This work has proposed a novel conversion process of analog signals into digital, which can be seen in Figure 3. It was developed, simulated, and verified using Multisim [25]. Sensors 2022,22, 4584 5 of 17 Sensors 2022, 22, x FOR PEER REVIEW 4 of 15 =− −2  =  Inputs and outputs to and from the multiple closed-loop control system are multiple. The execution becomes concurrent when separate hardware is assigned to execute Equation (2) for every input. Hence, multiple closed-loop control systems designed using FPGAs can be visualized as real multiple input and multiple output systems. 3.1.1. Single Closed-Loop Control System—Proposed In a closed-loop control system, inputs to a PID controller are set to point to the transmitter’s output. The transmitter receives input from a sensor. An industrial standard transmitter generates output in the range of 0–5 v. The output of the transmitter is an analog signal. The interface circuit that comprises a DAC, comparator, and analog to digital conversion logic in the FPGA, as in Figure 2, converts the transmitter’s analog signal into digital. The working principle of successive approximation register (SAR) type ADC is preferred in many applications, as mentioned in [24] Figure 2. FPGA design of single closed-loop control system. This work has proposed a novel conversion process of analog signals into digital, which can be seen in Figure 3. It was developed, simulated, and verified using Multisim [25]. Figure 3. FPGA design of analog input module for a single channel. It functions on the working principle of successive approximation register (SAR) type ADC. The most significant bit (MSB) of the SAR register will be set, and the remaining bits will be in reset condition. A register in an FPGA is declared as a SAR register. The Figure 3. FPGA design of analog input module for a single channel. It functions on the working principle of successive approximation register (SAR) type ADC. The most significant bit (MSB) of the SAR register will be set, and the remaining bits will be in reset condition. A register in an FPGA is declared as a SAR register. The DAC converts this SAR content into analog, and a comparator compares it with the analog signal that is to be converted into digital. Because the DAC output is connected to the non-inverting input of the comparator, the MSB will be retained as such, provided the DAC output is greater than the analog input signal. Otherwise, it will be reset. Setting or resetting the SAR content will be completed by the FPGA. The FPGA then sets the consecutive MSB bit leading towards the least significant bit (LSB) and repeats the above procedure. Because all the bits have to be verified in this manner, an 8-bit ADC will require eight clock pulses. The equivalent digital output of the analog signal can be identified by reading the content of the SAR register at the eighth clock pulse. It can also be read by a computer through RS232 serial data communication. This helps to establish a data acquisition system (DAS). The conversion time, τ c, of the proposed design is computed based on the settling time of DAC0808 ( τ s), the delay time of the comparator ( τ cd), and the delay time of the FPGA logic ( τ fd). The digital output of the ADC in this work is 8-bit. Hence, τ cis calculated from the following Equation (3): τc=8×(τs+τcd +τfd)(3) In general, for an nbit ADC, Equation (2) is modified to: τc=n×(τs+τcd +τfd)(4) where nindicates the number of clock cycles required to complete the conversion. Thus, the generated digital output is stored in the FPGA register. The PID control logic shown in Figure 2accepts this register content as its process variable. Therefore, e(t) is generated by subtracting the setpoint from the value of the process variable. PID control logic generates u(t) and forwards it to the final control element (FCE). Usually, the FCE accepts analog signals. Hence, the digital output of the PID controller is converted into analog using DAC. Real-time implementation of a closed-loop control system has used DAC0808, IC741, and XC3S200 FPGA chips. The comparator was designed using IC741. The clock signal applied to the Xilinx XC3S200 FPGA chip was 50 MHz. 3.1.2. Multiple Closed-Loop Control System—Proposed Conventionally, the microprocessor processes multiple closed-loop control systems. However, it sequentially executes all the closed-loop systems, as mentioned in Figure 4. Sensors 2022,22, 4584 6 of 17 Sensors 2022, 22, x FOR PEER REVIEW 5 of 15 DAC converts this SAR content into analog, and a comparator compares it with the analog signal that is to be converted into digital. Because the DAC output is connected to the noninverting input of the comparator, the MSB will be retained as such, provided the DAC output is greater than the analog input signal. Otherwise, it will be reset. Setting or resetting the SAR content will be completed by the FPGA. The FPGA then sets the consecutive MSB bit leading towards the least significant bit (LSB) and repeats the above procedure. Because all the bits have to be verified in this manner, an 8-bit ADC will require eight clock pulses. The equivalent digital output of the analog signal can be identified by reading the content of the SAR register at the eighth clock pulse. It can also be read by a computer through RS232 serial data communication. This helps to establish a data acquisition system (DAS). Th econversion time, τc, of the proposed design is computed based on the settling time of DAC0808 (τs), the delay time of the comparator (τcd), and the delay time of the FPGA logic (τfd). The digital output of the ADC in this work is 8-bit. Hence, τc is calculated from the following Equation (3):  = 8 ×  +  + fd (3) In general, for an  bit ADC, Equation (2) is modified to:  =  ×  +  + fd (4) where  indicates the number of clock cycles required to complete the conversion. Thus, the generated digital output is stored in the FPGA register. The PID control logic shown in Figure 2 accepts this register content as its process variable. Therefore, e(t) is generated by subtracting the setpoint from the value of the process variable. PID control logic generates u(t) and forwards it to the final control element (FCE). Usually, the FCE accepts analog signals. Hence, the digital output of the PID controller is converted into analog using DAC. Real-time implementation of a closed-loop control system has used DAC0808, IC741, and XC3S200 FPGA chips. The comparator was designed using IC741. The clock signal applied to the Xilinx XC3S200 FPGA chip was 50MHz. 3.1.2. Multiple Closed-Loop Control System—Proposed Conventionally, the microprocessor processes multiple closed-loop control systems. However, it sequentially executes all the closed-loop systems, as mentioned in Figure 4. Figure 4. Multiple PID controller equation for microprocessor. One of the major drawbacks of this system is that the processor will be able to execute its  PID controller equation at  μs, assuming the time required to execute one PID controller is 1 μ. The proposed system was used to developed a multiple PID controller by which all PID controller equations will be executed simultaneously, as in Figure 5. The Figure 4. Multiple PID controller equation for microprocessor. One of the major drawbacks of this system is that the processor will be able to execute its nth PID controller equation at nth µs , assuming the time required to execute one PID controller is 1 µs . The proposed system was used to developed a multiple PID controller by which all PID controller equations will be executed simultaneously, as in Figure 5. The parallel processing capacity of an FPGA discussed in [ 26 ] indicates the possibility of realizing multiple PID controllers using FPGAs. Sensors 2022, 22, x FOR PEER REVIEW 6 of 15 parallel processing capacity of an FPGA discussed in [26] indicates the possibility of realizing multiple PID controllers using FPGAs. Figure 5. Multiple PID controller equation for FPGA. This is achieved by assigning separate PID controller logic and hence separate FPGA hardware resources for each closed-loop control system. Assigning hardware for each PID controller does not demand any novelty. A perfect multiple closed-loop control system can be established when all the PID controllers can simultaneously access its desired value in the form of a digital signal. This work has resolved the issue by integrating the ADC conversion process with the PID controller, as in Figure 6. By comparing Figure 6 with Figure 2, one can understand that a multiple PID closed-loop control system is established with a comparator, two DACs, and PID controller logic for every closed-loop control system. Figure 6. Closed-loop control system for two analog signals. Figure 6 shows the design that can concurrently maintain two process parameters at their desired values. The concept of AIMs evolved when a set of DAC0808 and a comparator is included for every closed-loop control system. Similarly, the concept of AOMs evolved when a DAC0808 is included in every closed-loop control system. In the same way, individual PID control logic is adopted in FPGAs for every closed-loop control system. Thus, the FPGA plays the role of the PLC. It should be noted that Figure 6 is evolved from Figures 2 and 3. Thus, the novelty of this work is identified in Figure 6. It has an AIM, an AOM, and a PID controller. The maximum number of closed-loop control systems that can be realized in an FPGA is based on its hardware resources. This work has developed VerilogHDL code for eight closed-loop control systems, which have used approximately 55% of the FPGA hardware resources. Figure 5. Multiple PID controller equation for FPGA. This is achieved by assigning separate PID controller logic and hence separate FPGA hardware resources for each closed-loop control system. Assigning hardware for each PID controller does not demand any novelty. A perfect multiple closed-loop control system can be established when all the PID controllers can simultaneously access its desired value in the form of a digital signal. This work has resolved the issue by integrating the ADC conversion process with the PID controller, as in Figure 6. By comparing Figure 6 with Figure 2, one can understand that a multiple PID closed-loop control system is established with a comparator, two DACs, and PID controller logic for every closed-loop control system. Sensors 2022,22, 4584 7 of 17 Sensors 2022, 22, x FOR PEER REVIEW 6 of 15 parallel processing capacity of an FPGA discussed in [26] indicates the possibility of realizing multiple PID controllers using FPGAs. Figure 5. Multiple PID controller equation for FPGA. This is achieved by assigning separate PID controller logic and hence separate FPGA hardware resources for each closed-loop control system. Assigning hardware for each PID controller does not demand any novelty. A perfect multiple closed-loop control system can be established when all the PID controllers can simultaneously access its desired value in the form of a digital signal. This work has resolved the issue by integrating the ADC conversion process with the PID controller, as in Figure 6. By comparing Figure 6 with Figure 2, one can understand that a multiple PID closed-loop control system is established with a comparator, two DACs, and PID controller logic for every closed-loop control system. Figure 6. Closed-loop control system for two analog signals. Figure 6 shows the design that can concurrently maintain two process parameters at their desired values. The concept of AIMs evolved when a set of DAC0808 and a comparator is included for every closed-loop control system. Similarly, the concept of AOMs evolved when a DAC0808 is included in every closed-loop control system. In the same way, individual PID control logic is adopted in FPGAs for every closed-loop control system. Thus, the FPGA plays the role of the PLC. It should be noted that Figure 6 is evolved from Figures 2 and 3. Thus, the novelty of this work is identified in Figure 6. It has an AIM, an AOM, and a PID controller. The maximum number of closed-loop control systems that can be realized in an FPGA is based on its hardware resources. This work has developed VerilogHDL code for eight closed-loop control systems, which have used approximately 55% of the FPGA hardware resources. Figure 6. Closed-loop control system for two analog signals. Figure 6shows the design that can concurrently maintain two process parameters at their desired values. The concept of AIMs evolved when a set of DAC0808 and a comparator is included for every closed-loop control system. Similarly, the concept of AOMs evolved when a DAC0808 is included in every closed-loop control system. In the same way, individual PID control logic is adopted in FPGAs for every closed-loop control system. Thus, the FPGA plays the role of the PLC. It should be noted that Figure 6is evolved from Figures 2and 3. Thus, the novelty of this work is identified in Figure 6. It has an AIM, an AOM, and a PID controller. The maximum number of closed-loop control systems that can be realized in an FPGA is based on its hardware resources. This work has developed VerilogHDL code for eight closed-loop control systems, which have used approximately 55% of the FPGA hardware resources. 3.2. Case Study of Multiple PID Controller—Level and Pressure Process Station The design of multiple closed-loop control systems was tested and verified for two closed-loop control systems. The design depicted in Figure 5was used to maintain the desired value of level and pressure of the level and pressure process stations, respectively. 3.2.1. Level Process Station The Laboratory set-up of the level and pressure process station used to test the closedloop control system is shown in Figure 7. A pump located below the storage tank pumps water from the reservoir tank. It has two outlets. One is connected to a storage tank and the other to the reservoir. Sensors 2022,22, 4584 8 of 17 Sensors 2022, 22, x FOR PEER REVIEW 7 of 15 3.2. Case Study of Multiple PID Controller—Level and Pressure Process Station The design of multiple closed-loop control systems was tested and verified for two closed-loop control systems. The design depicted in Figure 5 was used to maintain the desired value of level and pressure of the level and pressure process stations, respectively. 3.2.1. Level Process Station The Laboratory set-up of the level and pressure process station used to test the closed-loop control system is shown in Figure 7. A pump located below the storage tank pumps water from the reservoir tank. It has two outlets. One is connected to a storage tank and the other to the reservoir. Figure 7. Level process station. The control valve is installed in between the pipeline of the pump and the storage tank. A capacitance probe sensor is used to sense the water level. Its output is converted into 4 to 20 mA current signal by a level transmitter. The connection between the transmitter and the non-inverting terminal of the comparator is shown in Figure 8. An industrial standard transmitter generates an output of 4 to 20 mA current signal (Sunita Sinha [27]). A resistor is connected in series with the 24 V DC power supply to convert the 4 to 20 mA current signal into a 1 V to 5 V voltage signal. An equivalent resistor that adopts the conversion of current signal into voltage was identified as 240 Ω. The output of the FPGA is connected to the I/P converter. Figure 8. Conversion of the output current of the transmitter into voltage. A resistor connected in series with the DAC and I/P converter ensures that the current flowing in the loop is in the range of 4 to 20 mA. DAC output is set as 5 V. The resistor value is adjusted and found to be 130 Ω when the current flow in the circuit is 20 mA [28]. 3.2.2. Pressure Process Station The laboratory setup of the pressure process station in Figure 7 has two storage tanks to store compressed air. It is possible to store compressed air, either in both the tanks or only in one tank, by operating the hand valve interlinked between the two tanks. The maximum pressure that can be stored in the tank is 2 Kg/cm. As discussed in the level Figure 7. Level process station. The control valve is installed in between the pipeline of the pump and the storage tank. A capacitance probe sensor is used to sense the water level. Its output is converted into 4 to 20 mA current signal by a level transmitter. The connection between the transmitter and the non-inverting terminal of the comparator is shown in Figure 8. An industrial standard transmitter generates an output of 4 to 20 mA current signal (Sunita Sinha [ 27 ]). A resistor is connected in series with the 24 V DC power supply to convert the 4 to 20 mA current signal into a 1 V to 5 V voltage signal. An equivalent resistor that adopts the conversion of current signal into voltage was identified as 240 Ω . The output of the FPGA is connected to the I/P converter. Sensors 2022, 22, x FOR PEER REVIEW 7 of 15 3.2. Case Study of Multiple PID Controller—Level and Pressure Process Station The design of multiple closed-loop control systems was tested and verified for two closed-loop control systems. The design depicted in Figure 5 was used to maintain the desired value of level and pressure of the level and pressure process stations, respectively. 3.2.1. Level Process Station The Laboratory set-up of the level and pressure process station used to test the closed-loop control system is shown in Figure 7. A pump located below the storage tank pumps water from the reservoir tank. It has two outlets. One is connected to a storage tank and the other to the reservoir. Figure 7. Level process station. The control valve is installed in between the pipeline of the pump and the storage tank. A capacitance probe sensor is used to sense the water level. Its output is converted into 4 to 20 mA current signal by a level transmitter. The connection between the transmitter and the non-inverting terminal of the comparator is shown in Figure 8. An industrial standard transmitter generates an output of 4 to 20 mA current signal (Sunita Sinha [27]). A resistor is connected in series with the 24 V DC power supply to convert the 4 to 20 mA current signal into a 1 V to 5 V voltage signal. An equivalent resistor that adopts the conversion of current signal into voltage was identified as 240 Ω. The output of the FPGA is connected to the I/P converter. Figure 8. Conversion of the output current of the transmitter into voltage. A resistor connected in series with the DAC and I/P converter ensures that the current flowing in the loop is in the range of 4 to 20 mA. DAC output is set as 5 V. The resistor value is adjusted and found to be 130 Ω when the current flow in the circuit is 20 mA [28]. 3.2.2. Pressure Process Station The laboratory setup of the pressure process station in Figure 7 has two storage tanks to store compressed air. It is possible to store compressed air, either in both the tanks or only in one tank, by operating the hand valve interlinked between the two tanks. The maximum pressure that can be stored in the tank is 2 Kg/cm. As discussed in the level Figure 8. Conversion of the output current of the transmitter into voltage. A resistor connected in series with the DAC and I/P converter ensures that the current flowing in the loop is in the range of 4 to 20 mA. DAC output is set as 5 V. The resistor value is adjusted and found to be 130 Ω when the current flow in the circuit is 20 mA [ 28 ]. 3.2.2. Pressure Process Station The laboratory setup of the pressure process station in Figure 7has two storage tanks to store compressed air. It is possible to store compressed air, either in both the tanks or only in one tank, by operating the hand valve interlinked between the two tanks. The maximum pressure that can be stored in the tank is 2 Kg/cm2 . As discussed in the level process station, resistor values connected to the pressure transmitter and I/P converter were identified as 240 Ωand 130 Ω, respectively. Sensors 2022,22, 4584 9 of 17 3.2.3. FPGA Interfacing Board An FPGA interface board is designed to process two process parameters: level and pressure. Each parameter requires two DACs and one comparator. One DAC and a comparator are used to convert the analog signal of the transmitter output into digital. A second DAC is used to activate the I/P converter for which the output is initiated from the FPGA as a controller output. Hence, the interface board has four DAC0808 chips and two comparators, which were designed using IC741, as shown in Figure 9. Sensors 2022, 22, x FOR PEER REVIEW 8 of 15 process station, resistor values connected to the pressure transmitter and I/P converter were identified as 240 Ω and 130 Ω, respectively. 3.2.3. FPGA Interfacing Board An FPGA interface board is designed to process two process parameters: level and pressure. Each parameter requires two DACs and one comparator. One DAC and a comparator are used to convert the analog signal of the transmitter output into digital. A second DAC is used to activate the I/P converter for which the output is initiated from the FPGA as a controller output. Hence, the interface board has four DAC0808 chips and two comparators, which were designed using IC741, as shown in Figure 9. Figure 9. Interface board for ADC conversion, DAC output to I/P converter. DAC1 and DAC2 are used for the pressure process station, and DAC3 and DAC4 are used for the level process station. The outputs of comparators and inputs to the DACs are integrated into a single 50-pin connector so that the other end of the connector can be connected to the FPGA board (XC3S200). This board has one 40 pin connector, three 25 pin connectors, and one universal asynchronous receiver transmitter (UART) connector. Additionally, it has eight switches and eight light emitting diodes (LEDs). 3.3. VerilogHDL Code—Acquisition, Control, UART The contribution of FPGAs in the design of closed-loop control systems is crucial. They are used to convert an analog signal of transmitter output into digital, initiate control actions based on the transmitter output, and transfer necessary data to the computer for monitoring. 3.3.1. VerilogHDL Code—Single PID Controller, UART FPGA implementation of any design can be carried out by representing a problem in HDL code. This is verified for its proper functionality during simulation. Thus, verified code is converted into a bit file after synthesis for FPGA implementation. This work has used VerilogHDL code to develop the entire logic for the FPGA implementation of multiple closed-loop control systems. The essential elements of VerilogHDL code for a PID controller is listed below. The main module  invokes the modules  and . The  module is responsible for converting the analog signal into a digital signal based on the logic discussed in Section 3.1.1. This digital output is applied as an input to the PID controller. Hence, the logic to generate controller output has also been included in this module. Thus, generated controller output (  ) and digital output (), combined into , are transmitted to the computer by executing the module . This performs the function of UART data transmission. Clock pulse time, Figure 9. Interface board for ADC conversion, DAC output to I/P converter. DAC1 and DAC2 are used for the pressure process station, and DAC3 and DAC4 are used for the level process station. The outputs of comparators and inputs to the DACs are integrated into a single 50-pin connector so that the other end of the connector can be connected to the FPGA board (XC3S200). This board has one 40 pin connector, three 25 pin connectors, and one universal asynchronous receiver transmitter (UART) connector. Additionally, it has eight switches and eight light emitting diodes (LEDs). 3.3. VerilogHDL Code—Acquisition, Control, UART The contribution of FPGAs in the design of closed-loop control systems is crucial. They are used to convert an analog signal of transmitter output into digital, initiate control actions based on the transmitter output, and transfer necessary data to the computer for monitoring. 3.3.1. VerilogHDL Code—Single PID Controller, UART FPGA implementation of any design can be carried out by representing a problem in HDL code. This is verified for its proper functionality during simulation. Thus, verified code is converted into a bit file after synthesis for FPGA implementation. This work has used VerilogHDL code to develop the entire logic for the FPGA implementation of multiple closed-loop control systems. The essential elements of VerilogHDL code for a PID controller is listed below. The main module controller invokes the modules convert and transmit . The convert module is responsible for converting the analog signal into a digital signal based on the logic discussed in Section 3.1.1. This digital output is applied as an input to the PID controller. Hence, the logic to generate controller output has also been included in this module. Thus, generated controller output ( outputtocontroller ) and digital output ( datatodac ), combined into data , are transmitted to the computer by executing the module transmit . This performs the function of UART data transmission. Clock pulse time, clk , of the FPGA is reduced to ‘clkdivided’, which is the required clock pulse for ADC conversion. Similarly, FPGA speed is Sensors 2022,22, 4584 16 of 17 higher execution speed when these components are replaced by high-speed devices. This proposed design can be used independently or in combination with PLCs. The total number of PID controllers required in an application decides the number of FPGAs used in the design of multiple PID controllers. When the design is to be used with a PLC, the concept of networking must be included in the FPGA. This is also applicable when there is a situation in which the content of one FPGA is to be shared with other FPGAs. Hence, the authors have aimed to develop multiple PID controllers that support network communications in the future. Author Contributions: Conceptualization, G.D. and M.M.; data curation, G.D. and S.T.S.; formal analysis, G.D. and S.T.S.; investigation S.T.S.; methodology, M.M.; software, G.D. and M.M.; supervision, M.M.; writing—original draft, G.D. and S.T.S.; writing—review and editing, M.M. All authors have read and agreed to the published version of the manuscript. Funding: This research received no external funding. Institutional Review Board Statement: Not applicable. Informed Consent Statement: Not applicable. Data Availability Statement: Not applicable. Conflicts of Interest: The authors declare no conflict of interest. References 1. De Canete, J.F.; del Saz-Orozco, P.; Gonzalez, S.; Garcia-Moral, I. Dual composition control and soft estimation for a pilot distillation column using a neurogenetic design. Comput. Chem. Eng. 2012,40, 157–170. [CrossRef] 2. Salem, A.; Abu-Siada, A.; Islam, S. Improved condition monitoring technique for wind turbine gearbox and shaft stress detection. IET Sci. Meas. Technol. 2017,11, 431–437. [CrossRef] 3. Carlos, G.G.; Juvenal, R.R.; Georgina, M.V.; Edgar, R.A.; Jorge, M.S.; Ricardo, L.R. A PC-based architecture for parameter analysis of vector-controlled induction motor drive. Comput. Electr. Eng. 2011,37, 858–868. 4. Bayindir, R.; Cetinceviz, Y. A water pumping control system with a programmable logic controller (PLC) and industrial wireless modules for industrial plants—An experimental setup. ISA Trans. 2011,50, 321–328. [CrossRef] [PubMed] 5. Jaiswal, S.; Ballal, M.S. FDST-based PQ event detection and energy metering implementation on FPGA-in-the-loop and NI- LabVIEW. IET Sci. Meas. Technol. 2017,11, 453–463. [CrossRef] 6. Chakraborty, K.; Choudhury, M.; Das, S.; Paul, S. Development of PLC-SCADA based control strategy for water storage in a tank for a semi-automated plant. J. Instrum. 2020,15, T04007. [CrossRef] 7. Ioannides, M. Design and Implementation of PLC-Based Monitoring Control System for Induction Motor. IEEE Trans. Energy Convers. 2004,19, 469–476. [CrossRef] 8. Lizarraga-Morales, R.A.; Rodriguez-Donate, C.; Cabal-Yepez, E.; Lopez-Ramirez, M.; Ledesma-Carrillo, L.M.; Ferrucho-Alvarez, E.R. Novel FPGA-based Methodology for Early Broken Rotor Bar Detection and Classification Through Homogeneity Estimation. IEEE Trans. Instrum. Meas. 2017,66, 1760–1769. [CrossRef] 9. Youness, H.; Moness, M.; Khaled, M. MPSoCs and Multicore Microcontrollers for Embedded PID Control: A Detailed Study. IEEE Trans. Ind. Inform. 2014,10, 2122–2134. [CrossRef] 10. Saponara, S.; Neri, B. Radar Sensor Signal Acquisition and Multidimensional FFT Processing for Surveillance Applications in Transport Systems. IEEE Trans. Instrum. Meas. 2017,66, 604–615. [CrossRef] 11. Dong, J.; Wang, T.; Li, B.; Liu, Z.; Yu, Z. An FPGA-based low-cost VLIW floating-point processor for CNC applications. Microprocess. Microsyst. 2017,50, 14–25. [CrossRef] 12. Senthilnathan, A.; Palanivel, P. A new approach for commutation torque ripple reduction of FPGA based brushless DC motor with outgoing phase current control. Microprocess. Microsyst. 2020,75, 103043. [CrossRef] 13. Roy, A.; Sharma, L.; Chakraborty, I.; Panja, S.; Ojha, V.N.; De, S. An FPGA based all-in-one function generator, lock-in amplifier and auto-relockable PID system. J. Instrum. 2019,14, P05012. [CrossRef] 14. Hernandez, A.; Garcia, E.; Gualda, D.; Villadangos, J.M.; Nombela, F.; Urena, J. FPGA-Based Architecture for Managing Ultrasonic Beacons in a Local Positioning System. IEEE Trans. Instrum. Meas. 2017,66, 1954–1964. [CrossRef] 15. Tasca, L.C.; de Freitas, E.P.; Wagner, F.R. Enhanced architecture for programmable logic controllers targeting performance improvements. Microprocess. Microsyst. 2018,61, 306–315. [CrossRef] 16. Aboelaze, M.; Shehata, M.G. Implementation of multiple PID controllers on FPGA. In Proceedings of the 2015 IEEE International Conference on Electronics, Circuits, and Systems (ICECS), Cairo, Egypt, 6–9 December 2015; pp. 446–449. [CrossRef] 17. Grout, I.A.; Burge, S.E.; Dorey, A.P. Design and testing of a PI controller ASIC. Microprocess. Microsyst. 1995 ,19, 15–22. [CrossRef] Sensors 2022,22, 4584 17 of 17 18. Bhandari, A.S.; Chaudhuri, A.; Roy, S.; Negi, S.; Sharad, M. Single chip self-tunable N-input N-output PID control system with integrated analog front-end for miniature robotics. In Proceedings of the 2017 IEEE 14th International Conference on Networking, Sensing and Control (ICNSC), Calabria, Italy, 16–18 May 2017; pp. 109–114. [CrossRef] 19. Neelamegam, P.; Kumaravel, S.; Raghunathan, R. Microcontroller Based Distributed Monitoring System for Fresh Water Fish Aquaculture. Instrum. Sci. Technol. 2008,36, 515–524. [CrossRef] 20. Dhanabalan, G.; Tamil Selvi, S. Design of parallel conversion multichannel analog to digital converter for scan time reduction of programmable logic controller using FPGA. Comput. Stand. Interfaces 2015,39, 12–21. [CrossRef] 21. Milanovic, M.; Truntic, M.; Slibar, P.; Dolinar, D. Reconfigurable digital controller for a buck converter based on FPGA. Microelectron. Reliab. 2006,47, 150–154. [CrossRef] 22. Chan, Y.F.; Moallem, M.; Wang, W. Design and Implementation of Modular FPGA-Based PID Controllers. IEEE Trans. Ind. Electron. 2007,54, 1898–1906. [CrossRef] 23. Astrom, K.J.; Hagglund, T. The future of PID control. Control. Eng. Pract. 2011,9, 1163–1175. [CrossRef] 24. Chen, D.G.; Tang, F.; Law, M.-K.; Zhong, X.; Bermak, A. A 64 fJ/step 9-bit SAR ADC Array with Forward Error Correction and Mixed-Signal CDS for CMOS Image Sensors. IEEE Trans. Circuits Syst. I Regul. Pap. 2014,61, 3085–3093. [CrossRef] 25. Dhanabalan, G.; Murugan, T. FPGA design of SAR type ADC based analog input module for industrial applications. In Advances in VLSI and Embedded Systems, Lecture Notes in Electrical Engineering; Patel, Z., Gupta, S., Kumar, Y.B.N., Eds.; Springer: Singapore, 2020; Volume 676. 26. Alabdo, A.; Pérez, J.; Garcia, G.J.; Pomares, J.; Torres, F. FPGA-based architecture for direct visual control robotic systems. Mechatronics 2016,39, 204–216. [CrossRef] 27. Sinha, S.; Kachhap, R.V.; Mandal, N. Design and development of a capacitance-based wireless pressure transmitter. IET Sci. Meas. Technol. 2018,12, 858–864. [CrossRef] 28. Datta, J.; Chowdhuri, S.; Bera, J.; Sarkar, G. Remote monitoring of different electrical parameters of multi-machine system using PC. Measurement 2012,45, 118–125. [CrossRef] 29. Ionel, R.; Vasiu, G.; Mischie, S. GPRS based data acquisition and analysis system with mobile phone control. Measurement 2012 , 45, 1462–1470. [CrossRef] 30. Rieger, R.; Huang, Y.-R. A Custom-Design Data Logger Core for Physiological Signal Recording. IEEE Trans. Instrum. Meas. 2010 , 60, 532–538. [CrossRef] 31. ControlLogix I/O Specifications. 2019. Available online: https://literature.rockwellautomation.com/idc/groups/literature/ documents/td/1756-td002_-en-e.pdf (accessed on 1 July 2019). 32. Estimated Execution Time and Memory Use for Logix5000 Controller Instructions. 2019. Available online: https://literature. rockwellautomation.com/idc/groups/literature/documents/rm/logix-rm002_-en-p.pdf (accessed on 1 July 2019). 33. Series 90 TM -30/20/Micro PLC CPU Instruction Set. 2002. Available online: http://www.cimtecautomation.com/documents/ techsupport/Series9030/Manuals/gfk-0467lSeries90-30-20-MicroPLCCPUInstructionSetReferenceManual.pdf (accessed on 1 July 2019).