Thursday, June 18, 2015

Paint Flow Control Project, Fuzzy Logic, Chapter 3.12

We don't yet have the go-ahead on the Paint Flow Control Project. Today is June 18 and we may not get funded until some time in July. My co-developer on the project, Thomas Nguyen, is planning on heading down to Ontario, Calif early in July to check out the robot paint gun control system that UEI and VividInc plan to acquire. VividInc would like to set up a control system at the their facility in Santa Clara as a development and demo system, plus to be able to use the system for commercial painting projects. I expect that after Thomas checks out the Ontario robot system, UEI and VividInc will be ready to fund the project.


Meanwhile, I am going ahead with the Fuzzy Logic development. I have made a few posts on my work, trying to improve the Look-Up-Table (LUT) so it will be ready to program into the Digi International BL2600 SBC. If we don't get funding for the project, I can at least consider this Fuzzy Logic work educational :-) and it's fun to do.

In my last post, I mentioned that I am using the Fuzzy-PI configuration where the Fuzzy Logic analysis feeds an Integrator which then outputs a control signal to control the paint pump flow. Also I am using the Mamdani Fuzzy technique and doing my Fuzzy development using Octave and L. Markowsky's Fuzzy Logic Toolkit. I design the Fuzzy Terms and Rules and the Fuzzy Logic Toolkit computes the LUT that I can insert into my LabWindows/CVI simulation code for analyzing and evaluating my Fuzzy design. I wasn't completely satisfied with the results of my design, so decided to work on it a bit more. Hopefully I'm not just thrashing but am making some real improvements. I am just making "baby steps," so the title of this post is just 0.01 higher than my last post at ... 3.12.

So on to my latest design. In order to smooth out the LUT and hopefully improve the simulation response and reduce the overshoot, I increased the number of Terms for the Inputs and Outputs from six to eight and the number of Rules from 19 to 37. I think the simulations show that the Fuzzy design is pretty good. However, I still don't know the trick to completely eliminate the overshoot.

Anyhow, here are some results of my latest analysis. Below are my latest Fuzzy Terms and Rules.

My Latest Fuzzy Terms and Rules.

And here is the LUT and LUT Chart.

My Latest LUT and LUT Chart From Octave and the Fuzzy Logic Toolkit.
Note that the LUT Chart is considerably smoother than the one I showed in my last post. The additional two Rules for each of the Error, Error-Dot and Output variables plus nearly doubling the number of Fuzzy Rules has certainly had a big effect in at least producing a better-looking LUT Chart if nothing else.

I next ran some simulations with my LabWindows/CVI code. I'm adjusting what I call the "Flow Response," which is the low-pass filter response of the paint Pump and Flowmeter. A Response setting of 10% implies that the controller would be sampling and controlling about ten times during the Pump and Flowmeter settling time. I'm guessing that the Pump and Flowmeter low-pass response is about one to two seconds and therefore the controller would be sampling roughly every tenth to two-tenths of a second. Below is the simulation for the Flow Response setting of 10%. In the simulation charts, the red trace is Flow value and the yellow trace is the control output signal.

Control System Simulation, Stepping between 0.2 and 1.4 lbs/min for Flow Response setting of 10%.

Following are charts from other simulations I ran for this Fuzzy configuration.

Control System Simulation, Stepping between 0.2 and 1.4 lbs/min for Flow Response setting of 25%.
Note the slight overshoot in the Paint Flow trace (the red trace) of the chart above and also note that the Flow value settles down to exactly the paint flow setpoint value of 1.4 lbs/min.

Control System Simulation, Stepping between 0.2 and 1.4 lbs/min for Flow Response setting of 33%.
 The chart for the 33% Flow Response setting also shows a slight overshoot and settling down to very close to the Flow Setpoint value.

Control System Simulation, Stepping between 0.2 and 1.4 lbs/min for Flow Response setting of 50%.
The above chart for the Flow Response setting of 50% looks really good to me with no overshoot and settling to very near the Flow Setpoint value. For a Pump and Flowmeter response of 1 to two seconds, the controller would be sampling the flow value and outputting a control signal roughly every second.

Control System Simulation, Stepping between 0.2 and 1.4 lbs/min for Flow Response setting of 60%.
The above chart for the Flow Response setting of 60% also looks really good to me with no overshoot and settling to very near the Flow Setpoint value. 

Control System Simulation, Stepping between 0.2 and 1.4 lbs/min for Flow Response setting of 80%.
Finally, the simulation chart for the Flow Response setting of 80% shows a pretty god response and slightly worse settling to a 2.8% error, certainly adequate for the Paint Flow Control System.

In conclusion, it looks like a controller sampling and controlling rate of once per second would be adequate to provide very good control with this Fuzzy-PI controller configuration and my LUT. I had planned to put the control code in the Digi BL2600 and use the LabWindows/CVI code in a PC to act as a supervisor by communicating over an Ethernet connection with the BL2600. Interestingly, if my guess that the Pump and Flow step response is about one to two seconds, a controller rate of once per second would be adequate and it may be possible to have the controller code in the LW/CVI code and simply send control signals to the BL2600 to control the pump motor. However, it probably would be best for the control code to be in the BL2600 and the PC used as a monitor and supervisor in case there is some hiccup in the PC or Ethernet communication. Anyhow, I believe this latest Fuzzy LUT and the Fuzzy-PI configuration will be perfectly adequately control the paint flow for our PFC project and any additional Fuzzy Logic work would be unnecessary.








No comments:

Post a Comment