ChipCenter Questlink
SEARCH CHIPCENTER
Search Type:
Search for:




Knowledge Centers
Product Reviews
Data Sheets
Guides & Experts
News
International
Ask Us
Circuit Cellar Online
App Notes
NetSeminars
Careers
Resources
FAQ
EE Times Network
Electronics Group Sites

EE Expert Peter Raeth
Adaptive Automation

Click Here to Go to the Adaptive Automation ArchiveClick Here to Go to Peter Raeth's Main EE Expert PageGuides and Experts

Technology Resources


Feb–Mar 2002 | Jan 2002 | Dec 2001 | Nov 2001 | Oct 2001 | Sep 2001
| Aug 2001 | July 2001 | June 2001 | May 2001 | Apr 2001 | MarApr 2001 | Jan–Feb 2001
| Nov–Dec 2000 | Oct 2000 | Sep 2000 | Aug 2000 | Jun 2000 | May 2000 | Apr 2000 | Mar 2000

Adaptive Proportional, Integral, Derivative (PID) Controllers

A rather significant issue with adaptive control methods is implementing them so that they are fast enough to make a difference. Two fundamental roadblocks exist that can prevent effective implementation: accuracy and speed. Experience has shown that there are cases where the adaptive method exceeds the accuracy of an approach based on a deep knowledge of the application. However, although the adaptive approach is self-adjusting and very general, the specific model is smaller and potentially faster. Sometimes the need for speed will make a less accurate approach more desirable. We have approached this topic earlier:

Field-Programmable Gate Arrays from Conventional Software

Parallel Processing

This time, let's take a look at an approach to adaptive control that can be implemented via a specific device that might normally escape our attention because it is rarely, if ever, mentioned in the adaptive-systems literature. By drawing the two together, we can open the possibilities for speed through yet another device: Proportional, Integral, Derivative Controllers.

According to a tutorial by Richard Wynne, School of Engineering, Sheffield Hallam University:

The PID controller is the most widely used control strategy in industry. It is used for various control problems such as automated systems or plants. A PID controller is a three-term controller that consists of three different elements:

P Proportional control—a pure gain adjustment acting on the error signal to provide the driving input to the process; used to adjust the speed of the system
I Integral control—implemented through the introduction of an integrator; used to provide the required accuracy
D Derivative control—normally introduced to increase the damping in the system; also amplifies the existing noise, which can cause problems, including instability.

Vance VanDoren, Control Engineering OnLine, gives an introductory discussion that contains a succinct definition.

A PID controller performs much the same function as a thermostat, but with a more elaborate algorithm for determining its output. It looks at the current value of the error, the integral of the error over a recent time interval, and the current derivative of the error signal to determine not only how much of a correction to apply, but for how long. Those three quantities are each multiplied by a tuning constant and are added together to produce the current controller output. P is the proportional tuning constant, I is the integral tuning constant, D is the derivative tuning constant, and the error e(t) is the difference between the setpoint P(t) and the process variable PV(t) at time t. If the current error is large, or the error has been sustained for some time, or the error is changing rapidly, the controller will attempt to make a large correction by generating a large output. Conversely, if the process variable has matched the setpoint for some time, the controller will leave well enough alone.

See the other PID tutorial articles posted at the Control Engineering OnLine site.

Understanding PID Control

PID—The Basic Technique for Feedback Control

Fundamentals of PID Control


According to the Advanced Control Technology Club (Industrial Systems and Control Ltd), while the PID controller is by far the widest type of automatic control used in industry, and though it is a relatively simple algorithm, there are many subtle variations in how it is applied. This has resulted in confusion for plant engineers and operators, who are happy to leave control loops in a sub-optimal configuration. See their portal for a number of tutorials and related information.

Process Control Portal

Prashant Mhatre, Tata Consultancy Services, provides a set of organized links into process control, including PID controllers. The topics include Basics of Process Control, Advanced Process Control, Frequency Response Techniques, and Statistical Process Control.

PID Control Technical Notes

In business since 1946, ISE offers a brief practical discussion along with links to other sites.

Interactive Demonstrations

Tomas Co (Chemical Sciences and Engineering, Michigan Technological University) provides two dynamic illustrations of PID controllers: PID Root Locus Generator and PID Controller Tuning. Take a look at these and his other postings in related areas.

Process Control Virtual Lab

This site gives an introductory lesson in process control design and tuning. It guides process control students through control techniques and controller tuning. It provides two examples: control of a toilet tank and temperature control of a distillation column. Additionally, the site provides an interactive forum where students can tune their own controller and create a controller for their own process. Many thanks to the Department of Chemical Engineering, University of Texas at Austin. Certain examples are provided by S. Qin.

Application to Motion Control

Newport Electronics presents us with a multi-part tutorial on applying PID controllers to motion control. The sections include: Introduction, Mechanical Design, Feedback, Electronics Design, Terminology, and Tuning Principles.

Technical Reports on PID and Adaptive Controls

Several people have written papers and reports that are theoretical but very understandable.

Specific PID Controller Devices

Fuzzy Temperature Controllers, Related Manual;

Omron Fuzzy DIN Controller 1, Fuzzy DIN Controller 2;

ISE Process Controller;

Armfield Dual Controller;

Eurotherm (Also go to their search page and enter the keyword pid);

Universal High-Performance Motion Controller/Driver;

Newport Electronics (enter the keyword pid in the search block on their main page).


PID Controllers—Some Further Discussion

Ray Zeune, a Senior Staff Engineer with Delta Design, wrote to say that he wanted to use a microcontroller evaluation board to get a better feel for PID controllers. He asks if there is any software available. After searching for several hours, the pickings were slim in the public-domain arena. There is a ton of expensive commercial software available. Just go to Google. Enter "software" in the all box and "PID control" in the exact phrase box. Then set the domain filter to don't and .edu. That will bring up the commercial software. You can also find a lot of code that is "public domain," but requires the purchase of other software.

Since the question was asked, we should take the opportunity to explore PID controllers a bit further. We can look at the software that is available and bring out some additional information that will extend the discussion we had the last time we got together.

PID Routines for MC68HC11K4 and MC68HC11N4 Microcontrollers

From Motorola Semiconductor, written by James W. Gray, this technical note provides full working code. "While an expensive DSP-class processor is the correct choice for the most demanding applications, several members of the M68HC11 family have the speed and resources to control multiple channels. This note provides two working examples of PID control-loop software. The first example, written primarily in C, shows a PID algorithm in a straightforward way using floating-point math. Key features of the C environment are covered for readers who are more used to assembly language. The second example implements a PID algorithm in assembly language. It uses the MC68HC11N4 on-chip math coprocessor to speed up arithmetic operations. Both examples are complete and ready to run on a Motorola M68HC11EVS evaluation board. External interfacing is identical for both examples—an 8-bit analog to digital converter is used for input, and an 8-bit PWM waveform is output. Because the code in both examples carries more than 16 bits of precision, and because both processors support 16-bit PWM, only minor changes are needed to increase precision." This is the only public-domain software I could find. If others find additional code, we can post links here during a follow-up.

PID Without the Math

According to the posting, "Author David St. Clair retired after 40 years of practice in the field of instrumentation and control in the process industries (8 years with Eastman Kodak and 32 years with DuPont). He took, in 1947, what he understood to be the first college course offered in the theory of feedback control, a chance event at MIT that started his career in the field. He arguably has applied the scientific method to solving control problems in the process industries longer than anyone, or at least that was probably true when he retired in 1987. He had been explaining the concepts to the non-specialist for most of that time. He relishes this opportunity to spread the word to a larger audience. His booklet was originally issued in 1983 as an internal report in the DuPont Company to help engineers and technicians, who have no special training in feedback control, understand the basic considerations and limitations. It handily broke all records at the DuPont Company for number of requested copies (over 1200) when issued. That report was released to the public and published in 1990. It subsequently sold almost 17,000 copies. In 1992 it was expanded for DuPont to about twice the size. This report also broke distribution records in the Company, with over 2500 copies requested when issued. The part unique to DuPont was deleted and more was added to make the current Second Edition." Considering the software (no source) that comes with the book, and the experience of the author, the $US30 price is a pittance.

The PID Control Algorithm—How it Works and How to Tune It

From this booklet's author, John Shaw, of Process Control Solutions, we hear that "Proper understanding of controller tuning requires understanding of the PID algorithm. The PID algorithm comprises three types of responses: Proportional, Integral, and Derivative. The first part of this book will examine the PID control algorithm, as typically implemented in industry. Each of the three elements will be discussed in detail. The book will then discuss common process responses, including dead time, process lags, and their combinations. The amount that each of these elements contribute to the control must be adjusted to correspond to the process being controlled. This adjustment is known as "tuning" the control loop. An incorrectly tuned loop will not function correctly, providing less than the desired performance. We will first look at how to determine if a loop is properly tuned and then cover some of the typical methods of tuning loops." He also makes available an Excel workbook that simulates PID controllers. Together, the booklet and simulator sell for $US55. Quite a reasonable price. He also posts a code fragment that illustrates the basic idea of PID controllers and links to tutorial material.

Comparison of PID Control Algorithms

ExperTune posts considerable information on controllers in general. One article had a rather disturbing introduction: "In practice, manufacturers of controllers don't adhere to any industry-wide standards for PID algorithms. Different manufacturers and vendors use different PID algorithms and sometimes have several algorithms available within their own product lines. Just as there are no industry standards for PID controllers that companies adhere to, nomenclature and action for similar modes varies. Some manufacturers call the Proportional Band the Proportional Gain. Manufacturers interchange names and units for integral or reset action. In this article, integral action is defined in time/repeat and reset in repeat/time. One is the reciprocal of the other. The action of either reset or integral can be reversed depending on the manufacturer's units." Last week we mentioned that there are subtle variations in how PID is implemented. This article will open your eyes further to that reality. Be sure to peruse the other material on this site and sign up for their free training disk. You can spend many good learning hours here.

Hunting for PID Setpoints

Writing for CircuitCellar, George Martin answers the question "If I have a pressure control (PD), and it continuously hunts for the setpoint, would adding some integral (reset) fix this problem? What parameters would work?"

He recommends the PID controller as a potential solution. "The Proportional component of the PID loop gets you to the goal, the integral component takes out any offsets, and the derivative component helps control the overshoot and ringing."

Reading Fuel Levels

Also for CircuitCellar, George Martin responds to a question on getting an accurate reading from a fuel-level sensor in spite of splashing in the tank. He casts this problem for PID controllers. It is a good read.

From Plant Data to Process Control

Here is a commercial book written by Liuping Wang and William Cluett, and published by Taylor & Francis. Of all the large-press offerings, this one appears to be the least theoretical while taking aim at practical applications. "This is a professional-level book aimed at process engineers in industry and researchers into systems and control engineering. It looks at theoretical advances in the area of process engineering and a wide variety of implementations. It also introduces new ideas, techniques, and algorithms to the areas of process identification and process control. Theoretical advances in these areas and a wide variety of applications are examined."

Follow-Up

Max Dirnberger, a design engineer with Einstein Technology, wrote to say that in addition to the links we reviewed in PID Controllers, he found Motorola's app note AN1120/D that describes doing the whole thing in an HC05 micro. While he felt that the code in this app note is flawed in a few areas, he found reading it to be a little more descriptive than the one for the HC11 we mentioned earlier. He actually ported his version of the HC05 code over to a TI MSP430. He found that exercise surprisingly easy. He created one PID channel to control a 40 A DC motor, and a second channel to drive a magnetic clutch in controlled slip mode to achieve a continuously variable transmission. It came to a matter of roughly 1.5 HC05 instructions per one MSP430.

Programmable Logic Controllers (PLCs)

When we talked about adaptive Proportional, Integral, Derivative (PID) Controllers, we emphasized their adaptive nature. PIDs are not the only controller devices available. We should also have a look at Programmable Logic Controllers (PLCs).

According to Hugh Jack, Grand Valley State University, control of electrical machinery was originally accomplished via mechanical relays implementing Boolean logic circuits. Relay logic produces a 1 or a 0 to open or close the line feeding electricity to the machine. In operation, a mechanical-relay logic circuit takes its binary input and exercises its Boolean circuits as appropriate. This is done automatically as electricity flows through the relay coils to open or close the various contacts. Functionally, this is exactly what happens when electronic AND/OR gates are exercised according to a Boolean equation. PLCs are a special-purpose computer whose programmed logic replaces the mechanical relay logic, while the ultimate result may still be the opening or closing of a mechanical relay. The typical means of programming PLCs, ladder logic, is derived from the approach used to design the on/off mechanical-relay logic circuits. The PLC scans its inputs, exercises its program, and delivers its result. This process is repeated continuously with exactly the same functional result as mechanical logic. To read more detail you really do want to download his book. It is a serious contribution to the field.

Basic PLC Tutorial

While it was not possible to determine the source, this is a good tutorial that will help you understand the fundamentals. Something that stands out from this tutorial is that PLCs are capable of much more than could be achieved by mechanical-relay logic circuits. The following topics are covered.

  • History and Description

  • Analog Inputs and Outputs

  • Communications

  • Various Comparators and Their Use

  • Counters and Their Use

  • Storing Data

  • AND/OR Gates

  • Numbering Systems
  • Scanning the Program

  • Generate a Pulse/Edge Trigger

  • Set and Reset of an Output

  • Shift Registers

  • Programming in STATEMENTS instead of LADDER LOGIC

  • Creating and Using Time Delays

  • Programming Examples

Basics of PLCs

This briefing by Siemens starts with the task to be performed on the assembly or inspection line, and continues through the application of PLCs to meet the control goals. You may find yourself reviewing their other briefings for additional background.

PLC Training Simulator

From The Learning Pit, this DOS-based animated training tool comes complete with hands-on student exercises. "PSIM is actually three distinct programs combined into a single package. First, PSIM contains a PLC Ladder-Logic editor that allows users to create and edit PLC programs using Allen Bradley PLC-2 family instructions. Second, PSIM emulates the scanning sequence of a PLC. When placed into the RUN mode, the user's program is scanned and the appropriate I/O are updated just as would occur in an actual PLC. Third, PSIM contains a number of animated simulations that respond accurately to the inputs and outputs of the emulated PLC. A conveyor-based filling line, Traffic intersection, and Batch mixing simulations present life-like challenges for the student programmer."

Open Standards for Industrial Control Programming

"PLCopen is a vendor- and product-independent worldwide association supporting IEC 61131-3. Via this programming standard, we provide greater value to users of industrial controllers. By implementing this standard in many program development environments (known as Program Support Environments in the IEC 61131-3 terminology), users can move between different brands and types of control with very little training, and can exchange applications with a minimum of effort. To reach this goal, the members of PLCopen are committed to supply and/or use IEC 61131-3 compliant products. IEC 61131-3 is a worldwide standard. It harmonizes the way people look to industrial control by standardizing the programming interface. This includes the definition of the language Sequential Function Charts used to structure the internal organization of a program, and four interoperable languages: Instruction List, Ladder Diagram, Function Block Diagram, and Structured Text. Via modularization and declaration of variables, each program is additionally structured, increasing its re-usability, reducing errors, and increasing efficiency. In addition, IEC 61131-3 structures the way a control system is configured." The International Electrotechnical Commission (IEC) is the international standards and conformity assessment body for all fields of electrotechnology.

Fuzzy PLCs

The Industrial Text & Video Company produces training materials in industrial automation. Their site contains several public-access documents on PLCs. One in particular shows how to implement fuzzy logic on PLCs. Thus, using a conventional control device, it is still possible to employ adaptive technology. However, one gets the impression from reading the document that it would not be possible to implement fuzzy logic using ladder logic. However, there is more than one language available for programming PLCs. The other documents available on their site are:

  • PLC Primer
    For those new to PLCs—Grasp the basics of PLCs

  • Introduction to PLC Programming and System Implementation
    Learn the techniques to implement a control program

  • I/O Bus Networks Including DeviceNet
    Slash wiring and installation costs using device networks

  • PLC Start-Up and Maintenance
    Learn six preventive-maintenance procedures to keep your PLC system running fault-free

Light Bulb Graphic Food for Thought

Flying Robotic Insect Slated to Explore Mars

If you want to read about a far-out control problem, read this EE Times article by R. Colin Johnson. "Motivated by the notion that the Mars landscape may prove easier to navigate by air than with ground-based rovers, NASA is backing a research project to build toy-sized flying robots, modeled on the entomology of insects, that can hover like helicopters. Patented as 'entomopters,' the robots are on the drawing board of University of Missouri professor Kakkattukuzhy Isaac."

PLC vs. PC

If the PLC is a special-purpose computer, why not use a PC instead? One of the biggest reasons that comes out is that PLCs are ultra-reliable, and PCs do not have that reputation. Here are links to sites that discuss this issue.

PC Controls: Making Its Mark

Paul Morris, an Instructor/Engineer with Valentine Robotics, writing for Robotics OnLine, offers a balanced view of the issue.

    Pros for PC

  • Start-up costs are typically less.

  • The user interfaces are well known by the general public.

  • Flexibility is increased via open standards.

  • An array of programming languages can be employed.
  • Pros for PLC

  • Well-known interfaces invite unwanted users to "play" with the computer.

  • The crash factor of a complex operating system is not desirable.

  • The variety of available hardware creates many incompatibilities.

  • The time and money to educate labor in the new skills is never invested.

PLC vs. PC Lock Control Systems

The Construction Engineering Research Laboratory, U.S. Army Corps of Engineers, has published a detailed briefing that greatly expands on the pros and cons of PCs and PLCs in critical control applications. As in all choices, you will find that there is not a single best selection for all circumstances. (It is best to download the briefing rather than view it online.)

When Controls Converge

Lawrence Gould, a Contributing Editor writing for Automotive Design and Production, offers that "Many of the features that differentiated programmable logic controllers (PLCs) from computer numerical controllers (CNCs), CNCs from motion controllers, and all of those from industrial controllers based on personal computers (PCs), can now be found in all of these control systems."

Size and Connectivity Drive Hardware Strategies

Gary Mintchell, writing for Control Engineering, says that "New hardware options are appearing with increasing frequency. But even more than PLC vs. PC, it's what kind of PLC or PC to use." He interviews a number of industry experts to give us a large view of the options for implementing automated industrial controls.

Adaptive Automation Archive

Guides and Experts   Analog Avenue   EDA Tools   PLD   DSP   EDA   Embedded Systems   Power   Test

Click here to get your listing up.

Copyright © 2003 ChipCenter-QuestLink
About ChipCenter-Questlink  Contact Us  Privacy Statement   Advertising Information  FAQ