Fuzzy Logic Control of a Chemical Bath Edgar Dohmann Ortech Engineering Inc. 17000 El Camino Real #208 Houston, Texas 77058 Abstract - This paper describes how a conventional chemical bath control system was replaced with a fuzzy logic controller to improve quality and reduce operating and maintenance costs. The system described in this paper was implemented with TRIACS system modules from Ortech Engineering and with TILShell and µFPL products from Togai InfraLogic (TIL). I. INTRODUCTION Chemical baths are used in many industrial manufacturing processes for cleaning, etching, and plating metal surfaces. Maintaining a proper balance of chemical components in the bath requires periodic analysis of the present composition and the addition of replenisher products which will compensate for chemical depletion during the manufacturing process. Figure 1 shows a typical conventional approach to controlling such a chemical bath system. Figure 1 Conventional Chemical Control System In this system, a chemical bath consisting of 3 primary chemical components is used to treat the metal surfaces of products which pass through the bath via a conveyor system. An accelerator chemical is added to the bath to enhance the reaction of the three primary chemicals with the metal of the product being treated. Total acid and free acid characteristics of the bath are of interest since they also affect the quality and speed of the reaction. Chemical concentrations are affected primarily by drag-in, normal reaction depletion, decomposition, and drag-out. Drag-in is the addition of impurities which adhere to the products from previous baths or processes. Normal chemical reactions cause a depletion in chemical components. Chemical decomposition over some time period also causes changes in chemical components. Drag-out is the loss of bath liquid which adheres to the product as it moves out of the current bath. The conventional control system for this process uses a programmable controller (PLC) to monitor a conductivity probe which senses the pH of the chemical bath. The PLC then cycles the replenisher and accelerator pumps on and off at preset intervals to maintain the pH within an acceptable range. The replenisher is a mixture of the three primary chemical components in ratios that match the anticipated depletion rates. Periodic manual titrations are used to verify the viability of the replenisher and accelerator addition rates and any required adjustments are made manually. While this system is very simple and straightforward, there are a number of shortcomings inherent in this system: 1) The replenisher is composed of a nominal chemical mix that is matched to the specific requirements of the product being processed through the bath. The chemical mix of the replenisher is mixed in a fixed ratio that matches the anticipated depletion rates of the individual components. Such a custom mix also places severe limits on the flexibility of the chemical bath to handle a variety of products. 2) Utilization of a custom replenisher mix is more costly than individual replenisher components. If the control system can be enhanced to easily handle individual components rather than a custom mix, operating costs could be reduced. 3) Since replenisher and accelerator additions are controlled by simple timer circuits in the PLC, there can be significant overshoot and undershoot of desired pH levels. This can affect the quality of the process, quality of the product, and the cost of the process. 4) The pump timing factors for the PLC are based upon nominal depletion and usage rates for the chemical bath. These rates are affected by drag-in, chemical reactions, chemical decomposition, and drag-out. The PLC cannot easily adapt to dynamic changes in these rates. 5) The conductivity probes are subject to sludge build-up and corrosion which changes their sensing characteristics. This change can affect the quality of the process and increases maintenance costs. 6) Periodic manual titrations of the chemical bath are required to verify that chemical compositions are within desired limits. Manual injection of additional replenisher or accelerator solutions may be required if the total compositions are too low. These manual tests add cost to the manufacturing process and introduce delays in the ability to compensate for dynamic changes. These factors make a conventional control system costly to operate and requires significant manual intervention to ensure that a high degree of quality is maintained. The objective of a fuzzy logic control system is to reduce operating and maintenance costs, increased quality and reliability, and reduce manual intervention. It is also desired to make the process capable of handling a wider variety of products by making the bath less dependent on a particular product's metallic composition [5]-[7]. II FUZZY LOGIC CONTROL SYSTEM The general fuzzy logic control system which was implemented for this application is shown in Figure 2. Figure 2 Fuzzy Logic Chemical Control System A significant difference in this control system vs the conventional system shown in Figure 1 is the use of an on-line chemical analyzer. Replacing a simple conductivity probe with an on-line analyzer provides significantly more data to the control logic. The on-line analyzer measures the levels of accelerator, free acid, total acid, and individual chemical components. This provides 6 data values as inputs to the control logic for this application, however, more data values could be provided if a larger number of chemical components are involved. Outputs of the control logic are pump control signals to individual chemical tanks rather than to a nominal replenisher mixture. The system shown in Figure 2 has 6 such pumps but more could be used depending on the number of chemical components required by the process. While the conductivity probe could be replaced with an on-line analyzer in the conventional system, doing so would not significantly improve the system due to the difficulty in utilizing the additional data. Since the PLC in use could only be programmed with conventional ladder logic, there was no easy way to implement the required control algorithms. Fuzzy logic is an ideal approach to such a system due to the large number of input and output variables involved. Figure 3 shows a schematic diagram of the fuzzy logic control system for this application [4]. Figure 3 Rule Based Fuzzy Control System While this example shows one output for each chemical component, in some cases there might actually be two outputs for each component. For example, a chemical might be available in either a phosphate or a nitrite solution and the appropriate selection might be determined by the levels of free acid, total acid, and other component values. III FUZZY LOGIC IMPLEMENTATION The specific rule base used to implement this control system is proprietary and cannot be included in this paper; however, the overall implementation process can be described. A block diagram of the TRIACS control system used to implement the fuzzy control strategy is shown in Figure 4. Figure 4 TRIACS System Diagram TRIACS is a family of microcontroller based products which communicate over an RS485 Data Bus to provide distributed monitoring and control of industrial processes. Several standard TRIACS modules were used in this application. TILShell was used to develop the membership functions and rule base for the chemical control system. After testing the system with simulation features of TILShell, the control algorithm was compiled with µFPL8051 and downloaded into a TRIACS control system [1]-[3]. The TRIACS modules in use are implemented with 8-bit microcontrollers from the MCS-51 family [8]- [10]. The PC-126 CCM (Communications and Control Module) is the heart of the TRIACS control system. It receives the chemical composition inputs from the on-line analyzer, executes the fuzzy control algorithm developed with TILShell, and issues pump timing control signals to the PC-120 SCM modules via the TRIACS data bus. The PC-120 SCM (Serial Control Modules) monitor and control up to 3 pumps per module. They accept control signals from the CCM and turn pumps on or off as required. They also monitor and report pump status information back to the CCM and CVT modules. Up to 30 SCM modules can be installed in a single control system. The PC-125 CVT (Converter Module) translates the TRIACS data bus (RS485 protocol) to a standard RS232 format for direct connection to the serial I/O port of a PC. The PC can then display such operating data as chemical compositions, pump control timing, and current pump status. It can also record chemical composition trend data. IV RESULTS AND CONCLUSIONS With a conventional system, manual titrations were made at 2-hour intervals to check on system operation and performance. If adjustments were necessary, manual overrides allowed additional replenisher or accelerator to be added. The fuzzy control system eliminated the need for this manual titration because the on-line analyzer continuously measures the chemical composition of the bath. A 15 minute analysis and reporting interval was chosen to allow reasonable time for mixing and stabilization of new chemical additions. Besides reducing manual labor, the on-line analysis approach also provides improved measurement precision due to the nature of the instrumentation involved. The system in use had 6 critical parameters: accelerator, free acid, total acid, and three chemical components. In the conventional system, only the first three were measured at 2-hour intervals. There was no benefit to measuring individual components since the replenisher provided a nominal mix of all three components. Fuzzy logic makes the on-line measurement of all components practical because individual chemical replenishment can be controlled by the fuzzy logic control system. The fuzzy logic control system can also make on-line, real-time adjustments to the replenishment rate. The rate of this automatic adjustment is the same as the sample update rate of the on-line analyzer which in this case is every 15 minutes. This is a significant improvement over the conventional system which only provided manual replenishment rate adjustments at 2-hour intervals. A further advantage of the fuzzy logic system is that the replenishment rates can be adjusted for each component individually rather than a nominal mix. The table below shows a performance comparison between the original conventional system and the new fuzzy logic control system: Table 1 Conventional vs Fuzzy Logic Control System In conclusion, it was determined that the fuzzy logic control system is far superior and preferred over the conventional control system for this application. All anticipated benefits were realized or exceeded. Maintenance costs and manual operating costs were significantly reduced. Replenisher chemical costs were reduced because lower cost individual component chemicals could be used rather than a custom-mixed replenisher. Operating costs were further reduced by minimizing chemical waste since individual chemicals are only added on an as-needed basis. The higher precision of measurement, more specific component control, and increased measurement rate also produced improved quality control. Test data and operating results have demonstrated that the system can be easily adapted to accommodate different products with minimal adjustments. The initial system only used the PC connected to the CVT module as a monitor device, however, it could also be used to download new setpoints for chemical components based on a change in product manufacturing. This capability may be added to the system in the future. REFERENCES [1] Espy, T., Hill, G., Horstkotte, E., and Teichrow, J: "TILShell+ User's Manual", Version 2.0.0, Togai InfraLogic, Inc., September 1992. [2] Hill, G., Horstkotte, E., and Teichrow, J.: "8051 µFPL Development System User's Manual", Version 1.0, Togai InfraLogic, Inc., September 1992. [3] Dohmann, E.: "TRIACS User's Manual", Release 1.0.0, Togai InfraLogic, Inc., February 1993. [4] Dohmann, E.: "TRIACS Chemical Control System Instruction Manual", Version 1.0, Togai InfraLogic, Inc., August 1993. [5] Bochsler, D.: "A Project Management Approach to Expert System Application", Proc. ISA/88 International Conference and Exhibit, pp 1459-1466, 1988. [6] Cordes, G., Smartt, H., Johnson, J., Clark, D., and Wickham, K.: "Design and Testing of a Fuzzy Logic/Neural Network Hybrid Controller for Three-Pump Liquid Level/Temperature Control", Proc. Second IEEE International Conference on Fuzzy Systems (FuzzIEEE '93), Volume 1, pp 167-171, 1993. [7] Pereira, G., Prabhulla, C., and Krishnan, U.: "Precision Control of Refinery Feed-Heater Temperature Using Fuzzy Algorithm", Proc. IEEE International Conference on Fuzzy Systems 1992 (FuzzIEEE '92), pp 859-866, 1992. [8] Sibigtroth, J. and Mazuelos, D.: "Basic Training: Fuzzy Logic for 8-Bit MCUs", Proc. Computer Design Fuzzy Logic '93 Technical Conference, pp T11-1 - T11-27, 1993. [9] Altnether, J.:"Comparison of Intel Microcontrollers for Fuzzy Applications", Proc. Computer Design Fuzzy Logic '93 Technical Conference, pp M213-1 - M213-7, 1993. [10] Banks, W.:"Fuzzy Logic on Embedded Microcomputers", Proc. Computer Design Fuzzy Logic '93 Technical Conference, pp M324-1 - M324-10, 1993.