PID math demystified, part 1

You’ve seen the equations, but have you thought about how those elements work together? Part 1: The basic concepts and proportional control.

05/06/2013


Most process control engineers have been exposed to the basic equation in a form that looks something like this:

Most process control engineers have been exposed to the basic equation in a form that looks something like this

More than you want to swallow in one bite? Let’s break this down into the major components:

 

More than you want to swallow in one bite? Let’s break this down into the major components

Output: u(t)  is the output of the controller at the end of the scan. If the output of the controller is a valve, then the output is the valve position that the controller is requesting after it has seen the inputs. In most controllers, this is actually the change in output from 50%. So if u(t) = 0 then the valve output is 50%; if u(t) = 1 then the valve output is 51%; and if u(t) = -2 then the valve output is 48%. You get the idea. But what’s important is that it’s not a change in output from the previous scan, but a new output.

Proportional

Kpe(t) is the proportional component, the P in PID. If you have a controller configured as proportional only, this is it. So let’s look at how this works.

Let’s start with my own misconception of how I thought it worked. When I imagine a controller, I picture myself turning a valve while watching a gage. I look at the gage, decide if I need more or less, turn that valve a little more or a little less, and then repeat the process until the gage shows the value I want. That sounds fundamentally logical, but it is not how a proportional only controller works. It’s more like if I were to look at the gage, subtract what it reads from what I want it to read, and then take that error over to a chart to look up a new value for the valve.

e(t) usually called error, is simply the difference between the setpoint and the process variable. It is the difference between where you are and where you want to be, right now, at this instant.

Kp gain, is a factor that is multiplied by the error to give you the new output, the new valve position. It’s that simple. The error at that instant of the scan is calculated and the new output is calculated.

Let’s look at an example of pseudo code to explore how this works:

Error = Setpoint - ProcessValue;

Output = K * Error;

This control algorithm is deceptively simple, yet it gives an immediate response to a setpoint change or a disturbance in the process. And if K is set correctly, will quickly move the process toward the setpoint. But, it won’t get the process to the setpoint because there has to be some error if the output is anything other than 50%.

Note: On some systems (though not often in modern systems), gain is expressed as proportional band. Proportional band is defined as the amount of change in the controlled variable required to drive the loop output from 0 to 100%. To convert between the two, gain = 100/PB.

Next week: Understanding I and D.

PID art, Real World Engineering blog, Control Engineering

This post was written by Scott Hayes. Scott is a senior engineer 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.



Anonymous , 05/13/13 07:16 PM:

Please post simple analog (op amp) circuits for each of the PID sections. or A full opamp analog PID controller. Your description along with the circuit diagram of an old school analog (variable pot) design would greatly help the newbies with real world understanding. AS it did for me in the 70's. Thank you.
Anonymous , 05/14/13 07:59 AM:

This is a nice start on the series, but there is a trap. You have chosen one particular form of PID equation. There are, unfortunately, many forms, and they go by many different names. Once you get beyond proportional mode, you have to acknowledge those differences. Even in proportional mode, remember that some systems use proportional band instead of gain.
Anonymous , 05/14/13 11:29 AM:

P conttoller does no action until there is an error. This base need is satisfied by using manual reset
Dr. Zahid , AL, Pakistan, 05/17/13 10:19 PM:

These articles of PID are a quick source of information and good to read them
The Top Plant program honors outstanding manufacturing facilities in North America. View the 2013 Top Plant.
The Product of the Year program recognizes products newly released in the manufacturing industries.
The Leaders Under 40 program features outstanding young people who are making a difference in manufacturing. View the 2013 Leaders here.
The new control room: It's got all the bells and whistles - and alarms, too; Remote maintenance; Specifying VFDs
2014 forecast issue: To serve and to manufacture - Veterans will bring skill and discipline to the plant floor if we can find a way to get them there.
2013 Top Plant: Lincoln Electric Company, Cleveland, Ohio
Case Study Database

Case Study Database

Get more exposure for your case study by uploading it to the Plant Engineering case study database, where end-users can identify relevant solutions and explore what the experts are doing to effectively implement a variety of technology and productivity related projects.

These case studies provide examples of how knowledgeable solution providers have used technology, processes and people to create effective and successful implementations in real-world situations. Case studies can be completed by filling out a simple online form where you can outline the project title, abstract, and full story in 1500 words or less; upload photos, videos and a logo.

Click here to visit the Case Study Database and upload your case study.

Why manufacturers need to see energy in a different light: Current approaches to energy management yield quick savings, but leave plant managers searching for ways of improving on those early gains.
Electric motor power measurement and analysis: Understand the basics to drive greater efficiency; Selecting the right control chart; Linear position sensors gain acceptance
Protecting standby generators for mission critical facilities; Selecting energy-efficient transformers; Integrating power monitoring systems; Mitigating harmonics in electrical systems

Annual Salary Survey

Participate in the 2013 Salary Survey

In a year when manufacturing continued to lead the economic rebound, it makes sense that plant manager bonuses rebounded. Plant Engineering’s annual Salary Survey shows both wages and bonuses rose in 2012 after a retreat the year before.

Average salary across all job titles for plant floor management rose 3.5% to $95,446, and bonus compensation jumped to $15,162, a 4.2% increase from the 2010 level and double the 2011 total, which showed a sharp drop in bonus.

2012 Salary Survey Analysis

2012 Salary Survey Results

Maintenance and reliability tips and best practices from the maintenance and reliability coaches at Allied Reliability Group.
The One Voice for Manufacturing blog reports on federal public policy issues impacting the manufacturing sector. One Voice is a joint effort by the National Tooling and Machining...
The Society for Maintenance and Reliability Professionals an organization devoted...
Join this ongoing discussion of machine guarding topics, including solutions assessments, regulatory compliance, gap analysis...
IMS Research, recently acquired by IHS Inc., is a leading independent supplier of market research and consultancy to the global electronics industry.
Maintenance is not optional in manufacturing. It’s a profit center, driving productivity and uptime while reducing overall repair costs.
The Lachance on CMMS blog is about current maintenance topics. Blogger Paul Lachance is president and chief technology officer for Smartware Group.