At the time in the late 70's and for some years after I didn't have any other application for FL and forgot about it for several years until Gary Johnson (http://wb9jps.com/Gary_Johnson/Home.html) contacted me at LLNL in 1991 about a possible consulting project with a painting (and other) company, K&H Finishing, now defunct, on Trade Zone Blvd in San Jose. Gary is a good friend and we were coworkers at LLNL, initially working on the Liquefied Gaseous Fuels Project that I had previously blogged about. Anyhow, Gary told me about K&H needing a controller for paint flow at their facility. They were in the business of painting conductive paint for RF shielding and also decorative paint on Apple computer boxes and other electronic housings. A control system for the paint flow was particularly important for controlling the quantity of conductive paint for the RF shielding since the conductive paint was (and is) very expensive. So they wanted to use just enough paint to provide a good RF shield for the Apple computers. Gary had been contacted by George Halldin who worked for Apple and was responsible for RF shielding and other painting for Apple. George had known that Gary was a LabView expert and so had contacted him for help on the K&H project but Gary was more into LabView applications (http://www.ni.com/labview/) and this control project would require a microprocessor or microcontroller. Gary knew that it would be "my line" of work, so he contacted me. Gary and I would work together: I would develop the controller and Gary would develop any LabView code required to communicate with the controller. I had a little free time and so enthusiastically agreed, happy to be working again with Gary.
So Gary and I met at K&H one night to learn about the project where I met Halldin and Thomas (Ming) Nguyen. Thomas was K&H paint control systems manager and had assembled a system with an air operated paint pump, a Coriolis-type mass flow sensor for the paint flow and other components. We had initially been thinking of using a PID (Proportional, Integral and Derivative) control method but I was concerned about the PID parameters that would be required to adequately control the paint flow. I had developed flow control systems at LLNL and recognized from my previous work that it would be necessary to perform extensive system tests to determine the PID parameters. See the Wikipedia article for more information about PID controllers: http://en.wikipedia.org/wiki/PID_controller. Then I remembered about Fuzzy Logic and my meeting with Zadeh many years before, and figured that FL could probably be used to control the paint flow instead of a PID controller. But I would need a microcontroller board with analog and digital circuitry, along with the FL software in order to develop a FL software system to make a control system for K&H. Rather than spending the time to design my own microcontroller board, we wanted to get something operating quickly for K&H and selected a module from Z-World, a module that I was familiar with from my work at LLNL. Z-World is now Digi International (http://www.digi.com/products/wireless-wired-embedded-solutions/), having taken over Z-World and adding to the product line. I had previously used Z-World's Dynamic C compiler at LLNL and found it to be very powerful and easy to use. Consequently I went ahead and ordered a Z-World "Little Giant" module and the Dynamic C compiler for developing my FL control system. The Little Giant board utilized a Z-180 microcontroller chip and the board included an Analog-To-Digital-Converter (ADC) for measuring the signals from the flow sensor and a Digital-To-Analog-Converter (DAC) for the output control but the output of the Little Giant's DAC was a voltage whereas we needed a 4-20 mA current to control a current-to-air pressure transducer for driving the paint pump. So Gary designed a circuit board for converting the DAC output voltage to the required 4-20 mA to drive the current-to-air transducer. And Gary assembled the Little Giant board, his voltage-to-current converters and a power supply in an aluminum enclosure.
As I say, I was concerned about the control parameters for a PID controller and decided I wanted to develop a FL controller. I suspect that Gary was skeptical about the FL approach, but he didn't argue with me, allowing me to go ahead with the software development, maybe to see if I would "hang myself!" I roughed out some simple rules (Fuzzy Logic is rule-based) and wrote a compiler to take my rules and produce an output signal for controlling the paint flow. I was quite a novice with FL and am still learning, coming up with eight rules. Rule #1 was simply (and cryptically):
"ZE","SN","ZE",
"ZE","ZE","ZE",
"ZE","SP","ZE",
which would be read as:
a) If the flow error was zero and the error change was small negative, the output would be zero, and
b) if the flow error is zero and the error change was zero, the output would be zero, and
c) if the flow error is zero and the error change was small positive, the output would be zero.
The rules are compiled and produce a 3-D control surface such as the following one that I made for a different project several years later using the Octave program:
I computed the above Flow Control Surface using my FL compiler in an Octave program (https://www.gnu.org/software/octave/). Octave is similar to MatLab but Open-Source software with a "Command-line" interface at this time.
Another aspect of the painting system was that it utilized a robot that moved the paint gun around to cover the computer enclosure with paint. Thomas had programmed the operation of the robot. An additional requirement was for the controller code to detect when the paint gun was turned on and off and to control the paint flow to an idle mode when the gun was turned off, allowing the paint to be recirculated, thus keeping the paint flowing at a lower rate. Then when the robot turned the gun on, the paint flow would increase to the previous value, the "gun-on" paint flow value.
The rules are compiled and produce a 3-D control surface such as the following one that I made for a different project several years later using the Octave program:
Flow Control Surface for the Silk Screen Project in 2013. |
Another aspect of the painting system was that it utilized a robot that moved the paint gun around to cover the computer enclosure with paint. Thomas had programmed the operation of the robot. An additional requirement was for the controller code to detect when the paint gun was turned on and off and to control the paint flow to an idle mode when the gun was turned off, allowing the paint to be recirculated, thus keeping the paint flowing at a lower rate. Then when the robot turned the gun on, the paint flow would increase to the previous value, the "gun-on" paint flow value.
I defined ZE, SN, SP, etc as triangular shapes as shown in a University of Texas at Arlington webpage, http://www.uta.edu/utari/acs/ee5322/lectures/Ballal%20fuzzy%20logic%20notes.pdf. There is more information and many more examples available from uta.edu at: http://www.uta.edu/search/?q=fuzzy+logic. An excellent paper is that by Y.F. Li and C.C. Lau titled "Development of Fuzzy Algorithms for Servo Systems" (http://fivedots.coe.psu.ac.th/Software.coe/240-371/fuzzy/00024814.pdf) and of course there is much more information available on the WWW in addition to many books and some software available for FL.
After developing my FL rule compiler and the remaining code and debugging the code, Gary and I tried out our Z-World controller system on the K&H painting system, finding that it worked well with a slight problem. It appeared that my code caused the paint flow to oscillate a small amount. Fearing that my FL code was the problem, we decided to re-code the control software as a PID controller. Now having some experience with the paint flow system, I had a feel for the control parameters that would work for a PID controller and was able to re-code the software. In a few days, I had the revised code ready to try and this time it worked just fine, no oscillations and satisfactory control of the paint flow. So at first, we were convinced that my FL code was to blame for the oscillations but on further examination we discovered that the problem really was that we had been using a lower resolution DAC signal, a 10-bit signal, for the control output. For the PID control, we had switched to a 12-bit DAC output and the result was elimination of the slight oscillation. However, we decided to leave the system as a PID controller rather than switch back to the FL control. Actually the PID control algorithm was only a PI (Proportional-Integral) control, since Derivative control wasn't needed.
So this was my first experience at making a FL control system, and it mostly worked just great, although we left the paint flow controller in a PI control mode. I was able to code a FL rule compiler and produce a working FL control system. That encouraged me to use Fuzzy Logic in future work.
After developing my FL rule compiler and the remaining code and debugging the code, Gary and I tried out our Z-World controller system on the K&H painting system, finding that it worked well with a slight problem. It appeared that my code caused the paint flow to oscillate a small amount. Fearing that my FL code was the problem, we decided to re-code the control software as a PID controller. Now having some experience with the paint flow system, I had a feel for the control parameters that would work for a PID controller and was able to re-code the software. In a few days, I had the revised code ready to try and this time it worked just fine, no oscillations and satisfactory control of the paint flow. So at first, we were convinced that my FL code was to blame for the oscillations but on further examination we discovered that the problem really was that we had been using a lower resolution DAC signal, a 10-bit signal, for the control output. For the PID control, we had switched to a 12-bit DAC output and the result was elimination of the slight oscillation. However, we decided to leave the system as a PID controller rather than switch back to the FL control. Actually the PID control algorithm was only a PI (Proportional-Integral) control, since Derivative control wasn't needed.
So this was my first experience at making a FL control system, and it mostly worked just great, although we left the paint flow controller in a PI control mode. I was able to code a FL rule compiler and produce a working FL control system. That encouraged me to use Fuzzy Logic in future work.
No comments:
Post a Comment