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
The Engineers' Choice Awards highlight some of the best new control, instrumentation and automation products as chosen by...
The System Integrator Giants program lists the top 100 system integrators among companies listed in CFE Media's Global System Integrator Database.
The Engineering Leaders Under 40 program identifies and gives recognition to young engineers who...
This eGuide illustrates solutions, applications and benefits of machine vision systems.
Learn how to increase device reliability in harsh environments and decrease unplanned system downtime.
This eGuide contains a series of articles and videos that considers theoretical and practical; immediate needs and a look into the future.
Choosing controllers: PLCs, PACs, IPCs, DCS? What's best for your application?; Wireless trends; Design, integration; Manufacturing Day; Product Exclusive
Variable speed drives: Smooth, efficient, electrically quite motion control; Process control upgrades; Mobile intelligence; Product finalists: Vote now; Product Exclusives
Machine design tips: Pneumatic or electric; Software upgrades; Ethernet advantages; Additive manufacturing; Engineering Leaders; Product exclusives: PLC, HMI, IO
This article collection contains the 5 most referenced articles on improving the use of PID.
Learn how Industry 4.0 adds supply chain efficiency, optimizes pricing, improves quality, and more.

Find and connect with the most suitable service provider for your unique application. Start searching the Global System Integrator Database Now!

Cyber security cost-efficient for industrial control systems; Extracting full value from operational data; Managing cyber security risks
Drilling for Big Data: Managing the flow of information; Big data drilldown series: Challenge and opportunity; OT to IT: Creating a circle of improvement; Industry loses best workers, again
Pipeline vulnerabilities? Securing hydrocarbon transit; Predictive analytics hit the mainstream; Dirty pipelines decrease flow, production—pig your line; Ensuring pipeline physical and cyber security