The benefits of reusing control logic

Don’t think it’s lazy—reusing effective control system strategy and programming can help you identify problems.


The first large project I worked on in my career taught me that reusing code isn’t just a way to get more done with less effort; it is also makes problems that have nothing to do with the code very obvious. Let me explain:

The project was a new 40 million gallon-per-day wastewater treatment facility in South Carolina. The commissioning of the plant went very well, and all systems checked out. A few weeks after commissioning, I was sent back to the plant because they were having a problem with their effluent pumps.

Three effluent pumps were set up in a lead-lag configuration that followed the level of the effluent wet well. When the level got high, the pumps would turn on and pump down to the low level. If one pump couldn’t keep up, a second pump started. The logic seemed to be working correctly, except the pump didn’t always stop when the level got low. The customer was very concerned that the pumps could have already been damaged by running dry.

I studied the data on the historical trends, and it appeared the problem only happened on the second pump, which the operators confirmed. The customer concluded that it must be a PLC issue and insisted we look for the solution there. My conclusion was different: I was certain that this was not a PLC issue. I was certain because I used the same logic for turning every pump on and off based on the level. If the other pumps always worked correctly, I knew there had to be something wrong outside of the PLC.

The customer was skeptical, so I started looking for a way to examine the problem and prove that the code was solid. This was a very important customer, so I had to take care of the problem quickly.

Luckily, the interposing relay used in the control cabinet had a spare set of contacts. This was a good point of demarcation for proving the PLC programming. I tied the spare set of contacts back to a spare digital input on the PLC and added that point to the history collection system. I then let the system run all day and all night.

The next day, the historical trend showed the PLC output turned off an hour before the pump finally stopped. The PLC did indeed do the right thing. The customer called in the motor controller supplier and had the contactor replaced. They never had a problem with the pump again.

I learned a valuable lesson: reusing effective code properly is not being lazy, it is good design.

This post was written by Matt Dougherty, Engineer II at MAVERICK Technologies, a leading system integrator providing industrial automation, operational support, and control systems engineering services in the manufacturing and process industries. MAVERICK delivers expertise and consulting in a wide variety of areas including industrial automation controls, distributed control systems, manufacturing execution systems, operational strategy, and business process optimization. The company provides a full range of automation and controls services – ranging from PID controller tuning and HMI programming to serving as a main automation contractor. Additionally MAVERICK offers industrial and technical staffing services, placing on-site automation, instrumentation and controls engineers.

No comments
Consulting-Specifying Engineer's Product of the Year (POY) contest is the premier award for new products in the HVAC, fire, electrical, and...
Consulting-Specifying Engineer magazine is dedicated to encouraging and recognizing the most talented young individuals...
The MEP Giants program lists the top mechanical, electrical, plumbing, and fire protection engineering firms in the United States.
Economics of HVAC systems; NFPA 110-2016; Designing and choosing modular data centers
Combined heat and power; Assessing replacement of electrical systems; Energy codes and lighting; Salary Survey; Fan efficiency
Commissioning lighting control systems; 2016 Commissioning Giants; Design high-efficiency hot water systems for hospitals; Evaluating condensation and condensate
Tying a microgrid to the smart grid; Paralleling generator systems; Previewing NEC 2017 changes
Driving motor efficiency; Preventing Arc Flash in mission critical facilities; Integrating alternative power and existing electrical systems
Putting COPS into context; Designing medium-voltage electrical systems; Planning and designing resilient, efficient data centers; The nine steps of designing generator fuel systems
As brand protection manager for Eaton’s Electrical Sector, Tom Grace oversees counterfeit awareness...
Amara Rozgus is chief editor and content manager of Consulting-Specifier Engineer magazine.
IEEE power industry experts bring their combined experience in the electrical power industry...
Michael Heinsdorf, P.E., LEED AP, CDT is an Engineering Specification Writer at ARCOM MasterSpec.
click me