Você está na página 1de 61

DEVELOPMENT OF TUNING ALGORTHM OF PID CONTROLLER USING PLC

INTRODUCTION TO PLC
1. Programmable Logic Controller
A Programmable Logic Controller, or PLC for short, is simply a special computer device used for industrial control systems. They are used in many industries such as oil refineries, manufacturing lines, conveyor systems and so on. Where ever there is a need to control devices the PLC provides a flexible way to "software" the components together. The basic units have a CPU (a computer processor) that is dedicated to run one program that monitors a series of different inputs and logically manipulates the outputs for the desired control. They are meant to be very flexible in how they can be programmed while also providing the advantages of high reliability (no program crashes or mechanical failures), compact and economical over traditional control systems.

1.1 A Simple Example


Consider something as simple as a switch that turns on a light. In this system with a flick of the switch the light would turn on or off. Beyond that though there is no more control. If your boss came along and said I want that light to turn on thirty seconds after the switch has been flipped, then you would need to buy a timer and do some rewiring. So it is time, labor and money for any little change.

DEVELOPMENT OF TUNING ALGORTHM OF PID CONTROLLER USING PLC

1.2 A PLC Saves the Day


Now consider the same device with a PLC in the middle. The switch is fed as an input into the PLC and the light is controlled by a PLC output. Implementing a delay in this system is easy since all that needs to be changed is the program in the PLC to use a delay timer.

This is a rather simple example but in a larger system with many switches and lights (and a host of other devices) all interacting with each other this kind of flexibility is not only nice but imperative. Hopefully a light bulb has now turned on over your head.

1.3 OTHER DEFINATIONS TO PLC


1. A PLC (Programmable Logic Controllers) is an industrial computer used to monitor inputs, and depending upon their state make decisions based on its program or logic, to control (turn on/off) its outputs to automate a machine or a process. 2. A digitally operating electronic apparatus which uses a programmable memory for the internal storage of instructions by implementing specific functions such as logic sequencing, timing, counting, and arithmetic to control, through digital or analog input/output modules, various types of machines or processes.

DEVELOPMENT OF TUNING ALGORTHM OF PID CONTROLLER USING PLC

2. BLOCK DIAGRAM OF PLC

DEVELOPMENT OF TUNING ALGORTHM OF PID CONTROLLER USING PLC

3. WORKING OF PLC
A programmable logic controller is a specialized computer used to control machines and processes. It therefore shares common terms with typical PCs like central processing unit, memory, software and communications. Unlike a personal computer though the PLC is designed to survive in a rugged industrial atmosphere and to be very flexible in how it interfaces with inputs and outputs to the real world. The components that make a PLC work can be divided into three core areas.

The power supply and rack The central processing unit (CPU) The input/output (I/O) section

PLCs come in many shapes and sizes. They can be so small as to fit in your shirt pocket while more involved controls systems require large PLC racks. Smaller PLCs (a.k.a. bricks) are typically designed with fixed I/O points. For our consideration, well look at the more modular rack based systems. Its called modular because the rack can accept many different types of I/O modules that simply slide into the rack and plug in.

PROGRAMMABLE LOGIC CONTROLLER

DEVELOPMENT OF TUNING ALGORTHM OF PID CONTROLLER USING PLC

3.1 The Power Supply and Rack


So lets start off by removing all our modules which leaves us with a naked PLC with only the power supply and the rack.

The rack is the component that holds everything together. Depending on the needs of the control system it can be ordered in different sizes to hold more modules. Like a human spine the rack has a backplane at the rear which allows the cards to communicate with the CPU. The power supply plugs into the rack as well and supplies a regulated DC power to other modules that plug into the rack. The most popular power supplies work with 120 VAC or 24 VDC sources.

DEVELOPMENT OF TUNING ALGORTHM OF PID CONTROLLER USING PLC

3.2 The CPU


The brain of the whole PLC is the CPU module. This module typically lives in the slot beside the power supply. Manufacturers offer different types of CPUs based on the complexity needed for the system. The CPU consists of a microprocessor, memory chip and other integrated circuits to control logic, monitoring and communications. The CPU has different operating modes. In

programming mode it accepts the downloaded logic from a PC. The CPU is then placed in run mode so that it can execute the program and operate the process.

DEVELOPMENT OF TUNING ALGORTHM OF PID CONTROLLER USING PLC

Since a PLC is a dedicated controller it will only process this one program over and over again. One cycle through the program is called a scan time and involves reading the inputs from the other modules, executing the logic based on these inputs and then updated the outputs accordingly. The scan time happens very quickly (in the range of 1/1000th of a second). The memory in the CPU stores the program while also holding the status of the I/O and providing a means to store values.

DEVELOPMENT OF TUNING ALGORTHM OF PID CONTROLLER USING PLC

3.3 I/O System


The I/O system provides the physical connection between the equipment and the PLC. Opening the doors on an I/O card reveals a terminal strip where the devices connect.

There are many different kinds of I/O cards which serve to condition the type of input or output so the CPU can use it for its logic. It's simply a matter of determining what inputs and outputs are needed, filling the rack with the appropriate cards and then addressing them correctly in the CPUs program.

DEVELOPMENT OF TUNING ALGORTHM OF PID CONTROLLER USING PLC

3.3.1 Inputs
Input devices can consist of digital or analog devices. A digital input card handles discrete devices which give a signal that is either on or off such as a pushbutton, limit switch, sensors or selector switches. An analog input card converts a voltage or current (e.g. a signal that can be anywhere from 0 to 20mA) into a digitally equivalent number that can be understood by the CPU. Examples of analog devices are pressure transducers, flow meters and thermocouples for temperature readings

3.3.2 Outputs
Output devices can also consist of digital or analog types. A digital output card either turns a device on or off such as lights, LEDs, small motors, and relays. An analog output card will convert a digital number sent by the CPU to its real world voltage or current. Typical outputs signals can range from 0-10 VDC or 4-20mA and are used to drive mass flow controllers, pressure regulators and position controls.

DEVELOPMENT OF TUNING ALGORTHM OF PID CONTROLLER USING PLC

4. PLC PROGRAMMING
4.1 Introduction to Ladder Logic
Ladder logic uses graphic symbols similar to relay schematic circuit diagrams. Ladder diagram consists of two vertical lines representing the power rails. Circuits are connected as horizontal lines between these two verticals.

4.2 Ladder diagram features


Power flows from left to right. Output on right side cannot be connected directly with left side. Contact cannot be placed on the right of output. Each rung contains one output at least. Each output can be used only once in the program. A particular input a/o output can appear in more than one rung of a ladder. The inputs a/o outputs are all identified by their addresses, the notation used depending on the PLC manufacturer. In these modern times a PC with especially dedicated software from the PLC manufacturer is used to program a PLC. The most widely used form of programming is called ladder logic. Ladder logic uses symbols, instead of words, to emulate the real world relay logic control, which is a relic from the PLC's history. These symbols are interconnected by lines to indicate the flow of current through relay like contacts and coils. Over the years the number of symbols has increased to provide a high level of functionality. The completed program looks like a ladder but in actuality it represents an electrical circuit. The left and right rails indicate the positive and ground of a power supply. The rungs represent the wiring between the different components which in the case of a PLC are all in the virtual world of the CPU. So if you can understand how basic electrical circuits work then you can understand ladder logic. In this simplest of examples a digital input (like a button connected to the first position on the card) when it is pressed turns on an output which energizes an indicator light.

DEVELOPMENT OF TUNING ALGORTHM OF PID CONTROLLER USING PLC

The completed program is downloaded from the PC to the PLC using a special cable thats connected to the front of the CPU. The CPU is then put into run mode so that it can start scanning the logic and controlling the outputs.

4.3 Programming Languages


A program loaded into PLC systems in machine code, a sequence of binary code numbers to represent the program instructions. Assembly language based on the use of mnemonics can be used, and a computer program called an assembler is used to translate the mnemonics into machine code. High level Languages (C, BASIC, etc.) can be used.

DEVELOPMENT OF TUNING ALGORTHM OF PID CONTROLLER USING PLC

5. PLC INSTRUCTIONS
5.1 Internal Relays
Auxiliary relays, markers, flags, coils, bit storage. Used to hold data, and behave like relays, being able to be switched on or off and switch other devices on or off. They do not exist as realworld switching devices but are merely bits in the storage memory.

5.2 Internal Relays Use


In programs with multiple input conditions or arrangements. For latching a circuit and for resetting a latch circuit. Giving special built-in functions with PLCs.

5.3 Retentive relays (battery-backed relays)


Such relays retain their state of activation, even when the power supply is off. They can be used in circuits to ensure a safe shutdown of plant in the event of a power failure and so enable it to restart in an appropriate manner.

5.4 Latch Instructions (Set and Reset)


The set instruction causes the relay to self-hold,, i.e. latch. It then remains in that condition until the reset instruction is received. The latch instruction is often called a SET or OTL (output latch). The unlatch instruction is often called a RES (reset), OTU (output unlatch) or RST (reset).

5.5 Timers
Timer is an instruction that waits a set amount of time before doing something (control time). Timers count fractions of seconds or seconds using the internal CPU clock. The time duration for which a timer has been set is termed the preset and is set in multiples of the time base used. Most manufacturers consider timers to behave like relays with coils which when energized result in the closure or opening of contacts after some preset time. The timer is thus treated as an output for a rung with control being exercised over pairs of contacts elsewhere. Others treat a timer as a delay block which when inserted in a rung delays signals in that rung reaching the output.

DEVELOPMENT OF TUNING ALGORTHM OF PID CONTROLLER USING PLC

5.6 Timers Types


On-Delay timer- simply delays turning on. It is called TON, TIM or TMR. Off-Delay timer- simply delays turning off. It is called TOF and is less common than the ondelay type. The on/off delay timers above would be reset if the input sensor wasnt on/off for the complete timer duration. Retentive or Accumulating timer- holds or retains the current elapsed time when the sensor turns off in mid-stream. It is called RTO or TMRA. This type of timer needs 2 inputs.

5.7 Timer Accuracy


There are software and Hardware Errors when using a timer.

5.8 Software Errors


Input error depending upon when the timer input turns on during the scan cycle. Output error depending upon when in the ladder the timer actually times out and when the PLC. Finishes executing the program to get to the part of the scan when it updates the outputs. Total software error is the sum of both the input and output errors.

5.9 Hardware Error


There is a hardware input error as well as a hardware output error. The hardware input error is caused by the time it takes for the PLC to actually realize that the input is on when it scans its inputs. Typically this duration is about 10ms (to eliminate noise or bouncing inputs). The hardware output error is caused by the time it takes from when the PLC tells its output to physically turn on until the moment it actually does. Typically a transistor takes about 0.5ms whereas a mechanical relay takes about 10ms.

5.10 Counters
A counter is set to some preset value and, when this value of input pulses has been received, it will operate its contacts. The counter accumulated value ONLY changes at the off to on transition of the pulse input. Typically counters can count from 0 to 9999, -32,768 to +32,767 or 0 to 65535.

DEVELOPMENT OF TUNING ALGORTHM OF PID CONTROLLER USING PLC

The normal counters are typically software counters - they dont physically exist in the PLC but rather they are simulated in software. A good rule of thumb is simply to always use the normal (software) counters unless the pulses you are counting will arrive faster than 2X the scan time.

5.11 Counter Types


Up-counters counts from zero up to the preset value. These are called CTU, CNT, C, or CTR. Down-counters count down from the preset value to zero. These are called CTD. Up-down counters count up and/or down. These are called CTUD. For CTU or CTD counter we need 2 inputs, but in CTUD we need 3 (up, down and preset).

5.12 Counter Formats


Some manufacturers consider the counter as a relay and consist of two basic elements: One relay coil to count input pulses and one to reset the counter, and the associated contacts of the counter being used in other rungs. Others (Siemens for example) treat the counter as an intermediate block in a rung from which signals emanate when the count is attained.

5.13 High Speed Counter


Most manufacturers also include a limited number of high-speed counters (HSC). Typically a high-speed counter is a hardware device. Hardware counters are not dependent on scan time.

5.14 Sequencers
The sequencer is a form of counter that is used for sequential control. It replaces the mechanical drum sequencer that was used to control machines that have a stepped sequence of repeatable operations. The PLC sequencer consists of a master counter that has a range of presets counts corresponding to the different steps and so, as it progresses through the count, when each preset count is reached can be used to control outputs.

5.15 Data Handling Instructions


Timers, counters and individual relays are all concerned with the handling of individual bits, i.e. single on-off signal. PLC operations involve blocks of data representing a value, such blocks being termed words.

DEVELOPMENT OF TUNING ALGORTHM OF PID CONTROLLER USING PLC

Data handling consists of operations involving moving or transferring numeric information stored in one memory word location to another word in a different location, comparing data values and carrying out simple arithmetic operations. A register is where data can be stored. Each data register can store a binary word of usually 8 or 16 bits. The number of bits determines the size of the number that can be stored (2n 1). 4-bit register can store a positive number between 0 and +15. 8-bit: 0 and +255. 16-bit: 0 and +65535.

5.16 Data movement instructions


There are typically 2 common instruction sets: The single instruction is commonly called MOV (move) copies a value from one address to another. The MOV instruction needs to know 2 things: Source - where the data we want to move is located. Destination - the location where the data will be moved to. We write an address here. Also, the data can be moved to the physical outputs.

5.17 Data comparison


The data comparison instruction gets the PLC to compare two data values. Thus it might be to compare a digital value read from some input device with a second value contained in a register. PLCs generally can make comparisons for: less than (< or LESS), equal to (= or EQU), less than or equal to (<= or LEQ), greater than (> or GRT), greater than or equal to (>= or GEQ), and not equal to ( NEQ).

DEVELOPMENT OF TUNING ALGORTHM OF PID CONTROLLER USING PLC

5.18 Arithmetic (mathematical) Instructions


PLCs almost always include math functions to carry out some arithmetic operations: Addition (ADD) - The capability to add one piece of data to another. Subtraction (SUB) - The capability to subtract one piece of data from another. Multiplication (MUL) - The capability to multiply one piece of data by another. Division (DIV) - The capability to divide one piece of data from another.

5.19 Overflow
Typically the memory locations are 16-bit locations. If a result is greater than the value that could be stored in a memory location then we get an overflow. The PLC turns on an internal relay that tells us an overflow has happened. We get an overflow if the number is greater than 65535 (2^16=65536). Depending on the PLC, we would have different data in the destination location. Some use 32-bit math which solves the problem. If were doing division, and we divide by zero the overflow bit turns on.

DEVELOPMENT OF TUNING ALGORTHM OF PID CONTROLLER USING PLC

6. PLC COMMUNICATION
6.1 Extension modules
PLC I/O number can be increased through certain additional modules by system extension through extension lines. Each module can contain extension both of input and output lines. Extension modules can have inputs and outputs of a different nature from those on the PLC controller. When there are many I/O located considerable distances away from the PLC an economic solution is to use I/O modules and use cables to connect these, over the long distances, to the PLC.

6.2 Remote I/O connections


When there are many I/O located considerable distances away from the PLC an economic solution is to use I/O modules and use cables to connect these, over the long distances, to the PLC.

6.3 Remote PLCs


In some situations a number of PLCs may be linked together with a master PLC unit sending and receiving I/O data from the other units.

6.4 Cables
Twisted-pair cabling, often routed through steel conduit. Coaxial cable enables higher data rates to be transmitted and does not require the shielding of steel conduit. Fiber-optic cabling has the advantage of resistance to noise, small size and flexibility.

6.5 Parallel communication


Parallel communication is when all the constituent bits of a word are simultaneously transmitted along parallel cables. This allows data to be transmitted over short distances at high speeds. Might be used when connecting laboratory instruments to the system.

DEVELOPMENT OF TUNING ALGORTHM OF PID CONTROLLER USING PLC

Parallel standards :The standard interface most commonly used for parallel communication is IEEE-488, and now termed as General Purpose Instrument Bus (GPIB). Parallel data communications can take place between listeners, talkers, and controllers. There are 24 lines: 8 data (bidirectional), 5 status & control, 3 handshaking, and 8 ground lines.

6.6 Serial communication


Serial communication is when data is transmitted one bit at a time. A data word has to be separated into its constituent bits for transmission and then reassembled into the word when received. Serial communication is used for transmitting data over long distances. Might be used for the connection between a computer and a PLC.

6.7 Serial standards


RS-232 communications is the most popular method of plc to external device communications. RS 232 is a communication interface included under SCADA applications. Other standards such as RS422 and RS423 are similar to RS232 although they permit higher transmission rates and longer cable distances. There are 2 types of RS-232 devices: DTE - Data Terminal Equipment and a common example is a computer. DCE - Data Communications Equipment and a common example is a modem. PLC may be either a DTE or DCE device.

6.8 ASCII
ASCII is a human-readable to computer-readable translation code (each letter/number is translated to 1s and 0s). Its a 7-bit code, so we can translate 128 characters (2^7 is 128).

6.9 Protocols
It is necessary to exercise control of the flow of data between two devices so what constitutes the message, and how the communication is to be initiated and terminated, is defined. This is termed the protocol. One device needs to indicate to the other to start or stop sending data. Interconnecting several devices can present problems because of compatibility problems.

DEVELOPMENT OF TUNING ALGORTHM OF PID CONTROLLER USING PLC

7. PLC NETWORKS
As control systems become more complex, they require more effective communication schemes between the system components. Some machine and process control systems require that programmable controllers be interconnected, so that data can be passed among them easily to accomplish the control task. Other systems require a plant wide communication system that centralizes functions, such as data acquisition, system monitoring, maintenance diagnostics, and management production reporting, thus providing maximum efficiency and productivity.

7.1 Local Area Networks


The term local area network (LAN) is used to describe a communication network designed to link computers and their peripherals within the same building or site. A LAN is a high-speed, medium distance communication system. For most LANs, the maximum distance between two nodes in the network is at least one mile, and the transmission speed ranges from 1 to 20 mega baud. Also, most local networks support at least 100 stations, or nodes.

7.2 Industrial Network


A special type of LAN, the industrial network, is one which meets the following criteria: 1. Capable of supporting real-time control. 2. High data integrity (error detection). 3. High noise immunity. 4. High reliability in harsh environments. 5. And suitable for large installations.

DEVELOPMENT OF TUNING ALGORTHM OF PID CONTROLLER USING PLC

8. PLC VERSUS OTHER TYPES OF CONTROLS


A PLC is not the only choice for controlling a process. Sticking with only basic relays may be of a benefit depending upon your application. Yet, on the other hand, a computer might be the way to go. The PLC vs. PC debate has been going on for a long time. More often though it doesn't come down to an "either or" situation but involves a mix of technologies.

8.1 PLC vs. Relay


When I first started programming PLCs it was still questionable if a PLC was necessary over just relay control. With PLC prices going down, size shrinking, and performance of PLCs improving over the years this has become less of a battle. Yet the designer has to ask themselves if a PLC is really overkill for their application. Some questions should be asked.

8.2 PLC vs. Dedicated Controller


A dedicated controller is a single instrument that is dedicated to controlling one parameter such as a PID controller measuring a temperature for heating control. They have the advantages of an all in one package, typically with display and buttons. This can be a very good thing to use in simple applications. A PLC these days can compete price wise and functionally with these controllers especially if you more then one controller is needed. PLCs offer a greater degree of flexibility too because the can be programmed to handle all sorts of different scenarios.

8.3 PLC vs. PC (Personal Computers)


The PLC vs. PC debate has been going on for years and I'm not going to attempt to give the definitive answer. They both have their pros and cons. What often happens is that the two are used for their strengths in different parts of the factory.

DEVELOPMENT OF TUNING ALGORTHM OF PID CONTROLLER USING PLC

PLC

PC

Environment

The PLC was specifically designed for harsh conditions with electrical noise, magnetic fields, vibration, extreme temperatures or humidity.

Common PCs are not designed for harsh environments. Industrial PCs are available but cost more.

Ease of Use

By design PLCs are friendlier to technicians since they are in ladder logic and have easy connections.

Operating systems like Windows are common. Connecting I/O to the PC is not always as easy. Typical PCs are limited by the number of cards they can accommodate and are not easily expandable. PCs, by design, are meant to handle

Flexibility

PLCs in rack form are easy to exchange and add parts. They are designed for modularity and expansion.

Speed

PLCs execute a single program in

sequential order. The have better ability to simultaneous tasks. They have handle events in real time. Reliability difficulty handling real time events.

A PLC never crashes over long periods of A PC locking up and crashing is time. ("Never" may not be the right word but its close enough to be true.) frequent.

Programming languages Data management

Languages are typically fixed to ladder logic, function block or structured text. Memory is limited in its ability to store a lot of data.

A PC is very flexible and powerful in what to use for programming. This is where the PC excels because of it's hard drive. Any long term data storage, history and trending is best done on a PC.

Cost

Just too hard to compare pricing with so many variables like I/O counts, hardware needed, programming software, etc.

DEVELOPMENT OF TUNING ALGORTHM OF PID CONTROLLER USING PLC

9. FAULT DETECTION TECHNIQUES


For any PLC controlled plant, by far the greater percentage of the faults are likely to be with sensors, actuators, and wiring rather than with PLC itself. The faults within the PLC most are likely to be in the input/output channels or power supply than in the CPU.
Case 1

Consider a single output device failing to turn on though the output LED is on. If testing of the PLC output voltage indicates that it is normal then the fault might be a wiring fault or a device fault. If checking of the voltage at the device indicates the voltage there is normal then the fault is the device.
Case 2

Failure of an input LED to illuminate as required could be because: *Input device is not correctly operating, *Input device is not correctly powered, *Incorrect wiring connections to the input module, or LED or input module is defective. Many PLCs provide built-in fault analysis procedures which carry out self-testing and display fault codes, with possibly a brief message, which can be translated by looking up code in a list to give the source of the fault and possible method of recovery.

10. Traditional PLC Applications


*In automated system, PLC controller is usually the central part of a process control system. *To run more complex processes it is possible to connect more PLC controllers to a central computer.

DEVELOPMENT OF TUNING ALGORTHM OF PID CONTROLLER USING PLC

11. Advantages of PLC control


* Rugged and designed to withstand vibrations, temperature, humidity, and noise. * Have interfacing for inputs and outputs already inside the controller. * Easily programmed and have an easily understood programming language.

12. Disadvantages of PLC control


- Too much work required in connecting wires. - Difficulty with changes or replacements. - Difficulty in finding errors; requiring skillful work force. - When a problem occurs, hold-up time is indefinite, usually long.

DEVELOPMENT OF TUNING ALGORTHM OF PID CONTROLLER USING PLC

INTRODUCTION TO ALL TYPES OF CONTROLLERS


13. PROPORTIONAL CONTROL 13.1 Gain
When we talk about the proportional action of a controller, we generally refer to the proportional gain. The action means that the controller moves in proportion to the error between setpoint (SP) and process output (PV): controller output = K*error = K*(SP - PV) where the gain is denoted by the parameter K. Many terms have been used by different manufacturers to designate this action. It has been called proportional gain, gain, throttling band, sensitivity and proportional band.

13.2 Proportional Band


In practice, the controller output is limited, either by its own limitations or by the limitations of the corresponding actuator. Let umax and umin denote the minimum and maximum output of the controller. The proportional band of the controller is then defined as:

In the ideal case, a controller can have an unlimited output. The proportional band (PB) is then defined as:

This definition of proportional band is often used instead of the controller gain. The value is expressed in percent (%).

DEVELOPMENT OF TUNING ALGORTHM OF PID CONTROLLER USING PLC

13.3 Direct Acting / Reverse Acting


Suppose a process with a controller output CV and a process output PV is in steady state and kept to a certain setpoint SP. For proportional control the following equations can be found: PV = P(CO) CV = K*error = K*(SP - PV) Where P is the process function that yields a measured variable as a result of the controller output. If the controller output decreases as the measured variable increases the controller is said to be direct acting. If the controller output increases as the measured variable increases, then it is called reverse acting. In other words, the controller is direct acting if the gain K is positive and reverse acting if the gain K is negative. This is not only valid for proportional control, but for all PID controllers in the 20-sim library. If you need a reverse acting controller, simply use a negative gain.

13.4 Offset
If you look at the equation for the proportional gain: CV = K*error = K*(SP - PV) you will notice that there has to be an error to produce a controller output. This means that with proportional control only, there will always be a small offset between the setpoint and the measured variable. To remove this offset, integral control has to be used.

DEVELOPMENT OF TUNING ALGORTHM OF PID CONTROLLER USING PLC

14. Integral Control


With integral action, the controller output is proportional to the amount of time the error is present. Integral action eliminates offset that remains when proportional control is used. controller output = (1/Ti)*(error) where the parameter Ti is called the integral time. Integral action is also know as reset and the parameter Ti as reset time.

Integral action gives the controller a large gain at low frequencies that results in eliminating offset. Integrals give information concerning the past. That is why integrals are always late. Integrals provide stability but have a tendency to get stuck in the past. In most controllers the proportional and integral action are combined. The output of the combined proportional and integral action (in s-domain) is then:

with E equal to SP - PV.

15. Derivative Control


With derivative action, the controller output is proportional to the rate of change of the measurement or error. Some manufacturers use the term rate or pre-act instead of derivative. Derivative, rate and pre-act are the same thing. The controller output is calculated by the rate of change of the error with time.

controller output = Td*d(error)/dt = Td*d(SP - PV)/dt

DEVELOPMENT OF TUNING ALGORTHM OF PID CONTROLLER USING PLC

where the parameter Td is called derivative time. Derivative control is mathematically the opposite of integral action, but while we might have an integral-only controller, we would never have a derivative-only controller. The reason for this is that derivative control only knows the error is changing. It does not know what the setpoint actually is.

Derivative action has the potential to improve performance when sudden changes in measured variable occur, but is should be used with care. It is mostly a matter of using enough, not too much.

15.1 Derivative Gain Limitation


In most commercial processes sudden changes in process output may appear. In most cases a sudden change in the slope of such a process output cannot be avoided at all times. Using such a process output in controllers with pure derivative action, would lead to unwanted steps in the controller output. Moreover, high frequency noise in the measured signals may lead to unwanted large outputs of the controller.

To prevent this unwanted effect, the derivative action can be filtered by a first-order system with time constant Td/N.

This approximation acts as a derivative for low-frequency signal components. The gain, however, is limited to K*N. This means that high-frequency measurement noise is amplified at most by a factor KN. This is why the parameter N is called the derivative gain limitation. Typical values of N are 8 to 20.Sometimes the reciprocal value of N is used, mostly with the name beta (beta = 1/N).

DEVELOPMENT OF TUNING ALGORTHM OF PID CONTROLLER USING PLC

16. Proportional - Integral controller (PI) mode


16.1 Proportional Action
Proportional action provides an instantaneous response to the control error. This is useful for improving the response of a stable system but cannot control an unstable system by itself. Additionally, the gain is the same for all frequencies leaving the system with a nonzero steadystate error.

16.2 Integral Action


Integral action gives the controller a large gain at low frequencies that results in eliminating offset. Integrals give information concerning the past. That is why integrals are always late. Integrals provide stability but have a tendency to get stuck in the past. In most controllers the proportional and integral action are combined.

16.3 P-I Mode


The output of the combined proportional and integral action is P=KPE+KPKI E dt+PO . With E equal to SP - PV.

DEVELOPMENT OF TUNING ALGORTHM OF PID CONTROLLER USING PLC

17. Introduction to Proportional-Derivative (PD) Control


Proportional-Derivative control is useful for fast response controllers that do not need a steadystate error of 0. Proportional controllers are fast. Derivative controllers are fast. The two together is very fast. Below is a review.

17.1 Proportional Action


Proportional action provides an instantaneous response to the control error. This is useful for improving the response of a stable system but cannot control an unstable system by itself. Additionally, the gain is the same for all frequencies leaving the system with a nonzero steadystate error.

17.2 Derivative Action


Derivative action acts on the derivative or rate of change of the control error. This provides a fast response, as opposed to the integral action, but cannot accommodate constant errors (i.e. the derivative of a constant, nonzero error is 0). Derivatives have a phase of +90 degrees leading to an anticipatory or predictive response. However, derivative control will produce large control signals in response to high frequency control errors such as set point changes (step command) and measurement noise. In order to use derivative control the transfer functions must be proper. This often requires a pole to be added to the controller (this pole is not present in the equations below).

17.3 Proportional-Derivative (PD) Control


Proportional-Derivative or PD control combines proportional control and derivative control in parallel.

P = KPE+KPKD(dE/dt)+Po.
Where

DEVELOPMENT OF TUNING ALGORTHM OF PID CONTROLLER USING PLC

is the Proportional gain and

KD is the derivative gain.

18. Proportional Integral Derivative (PID) Controller Mode


This mode is formed by the combination of P,I and D control mode. In PI controller, integral part completely removes steady state error and proportional part provides adequately fast response. The process capacity needs some form of additional kick for fast response, which is provided by the derivative action. P=KPE+KPKI E dt +KPKD dE/dt . It produces maximum deviation which is larger than that in PD. No offset. Stabilization time is longer than that of PD but smaller than PI. Best control mode.

DEVELOPMENT OF TUNING ALGORTHM OF PID CONTROLLER USING PLC

19. CONTINUOUS CONTROL WITH PLC


19.1 Introduction
SFB/FB "CONT_C" (continuous controller) is used on SIMATIC S7 programmable logic controllers to control technical processes with continuous input and output variables. During parameter assignment, you can activate or deactivate sub-functions of the PID controller to adapt the controller to the process. You can assign this easily by using the parameter assignment tool (Menu path: Start > Simatic > Step7 > Assign PID Control parameters). The online electronic manual is found under Start > Simatic > Step7 > Assign PID Control English.

19.2 Application
You can use the controller as a PID fixed set point controller or in multi-loop controls as a cascade, blending or ratio controller. The functions of the controller are based on the PID control algorithm of the sampling controller with an analog signal, if necessary extended by including a pulse generator stage to generate pulse duration modulated output signals for two or three step controllers with proportional actuators.

Note
The calculation of the values in the control blocks is only correct if the block is called at regular intervals. For this reason, you should call the control blocks in a cyclic interrupt OB(OB30 to OB38). Enter the sampling time in the CYCLE parameter.

19.3 Description
Apart from the functions in the set point and process value branches, the SFB/FB implements a complete PID controller with continuous manipulated variable output and the option of influencing the manipulated value manually. In the following, you will find a detailed description of the sub-functions:

DEVELOPMENT OF TUNING ALGORTHM OF PID CONTROLLER USING PLC

19.3.1 Set point Branch


The set point is entered in floating-point format at the SP_INT input.

19.3.2 Process Variable Branch


The process variable can be input in the peripheral (I/O) or floating-point format. The CRP_IN function converts the PV_PER peripheral value to a floating-point format of -100 to +100 % according to the following formula: Output of CPR_IN = PV_PER * (100/27648). The PV_NORM function normalizes the output of CRP_IN according to the following formula: Output of PV_NORM = (output of CPR_IN) * PV_FAC + PV_OFF PV_FAC has a default of 1 and PV_OFF a default of 0.

19.3.3 Error Signal


The difference between the set point and process variable is the error signal. To suppress a small constant oscillation due to the manipulated variable quantization (for example, in pulse duration modulation with PULSEGEN), a dead band is applied to the error signal (DEADBAND). If DEADB_W = 0, the dead band is switched off.

19.3.4 PID Algorithm


The PID algorithm operates as a position algorithm. The proportional, integral (INT), and derivative (DIF) actions are connected in parallel and can be activated or deactivated individually. This allows P, PI, PD, and PID controllers to be configured. Pure I and D controllers are also possible.

19.3.5 Manual Value


It is possible to switch over between a manual and an automatic mode. In the manual mode, the manipulated variable is corrected to a manually selected value. The integrator (INT) is set internally to LMN - LMN_P - DISV and the derivative unit (DIF) to 0 and matched internally. This means that a switchover to the automatic mode does not cause any sudden change in the manipulated value.

DEVELOPMENT OF TUNING ALGORTHM OF PID CONTROLLER USING PLC

19.3.6 Manipulated Value


The manipulated value can be limited to a selected value using the LMN limit function. Signaling bits indicate when a limit is exceeded by the input variable. The LMN_NORM function normalizes the output of LMNLIMIT according to the following formula:

LMN = (output of LMNLIMIT) * LMN_FAC + LMN_OFF LMN_FAC has the default 1 and LMN_OFF the default 0. The manipulated value is also available in the peripheral format. The CPR_OUT function converts the floating-point value LMN to a peripheral value according to the following formula: LMN_PER = LMN * (27648/100)

19.3.7 Feed Forward Control


A disturbance variable can be fed forward at the DISV input.

19.3.8 Initialization
SFB 41 "CONT_C" has an initialization routine that is run through when the input parameter COM_RST = TRUE is set. During initialization, the integrator is set internally to the initialization value I_ITVAL. When it is called in a cyclic interrupt priority class, it then continues to work starting at this value.

19.3.9 Error Information


The error output parameter RET_VAL is not used.

DEVELOPMENT OF TUNING ALGORTHM OF PID CONTROLLER USING PLC

20. Pin Description

DEVELOPMENT OF TUNING ALGORTHM OF PID CONTROLLER USING PLC

21. CONT_C Block Diagram Input Parameters

DEVELOPMENT OF TUNING ALGORTHM OF PID CONTROLLER USING PLC

The following table contains the description of the input parameters for SFB 41/FB 41 "CONT_C."

Parameter

Data Type

Range of Values

Default

Description

COM_RST

BOOL

FALSE

COMPLETE RESTART

The block has an initialization routine that is processed when the input COM_RST is set. MAN_ON BOOL TRUE MANUAL VALUE ON

If the input "manual value on" is set, the control loop is interrupted. A manual value is set as the manipulated value. PVPER_ON BOOL FALSE PROCESS VARIABLE PERIPHERAL ON

If the process variable is read from the I/Os, the input PV_PER must be connected to the I/Os and the input "process variable peripheral on" must be set.

DEVELOPMENT OF TUNING ALGORTHM OF PID CONTROLLER USING PLC

P_SEL

BOOL

TRUE

PROPORTIONAL ACTION ON

The PID actions can be activated or deactivated individually in the PID algorithm. The P action is on when the input "proportional action on" is set. I_SEL BOOL TRUE INTEGRAL ACTION ON

The PID actions can be activated or deactivated individually in the PID algorithm. The I action is on when the input "integral action on" is set. INT_HOLD BOOL FALSE INTEGRAL ACTION HOLD The output of the integrator can be "frozen" by setting the input "integral action hold". I_ITL_ON BOOL FALSE INITIALIZATION OF THE INTEGRAL ACTION ON

The output of the integrator can be connected to the input

I_ITL_VAL by setting the input "initialization action on. of the integral

DEVELOPMENT OF TUNING ALGORTHM OF PID CONTROLLER USING PLC

D_SEL

BOOL

FALSE

DERIVATIVE ACTION ON The PID actions can be activated or deactivated individually in the PID algorithm. The D action is on when the input "derivative action on" is set.

CYCLE

TIME

>= 1 ms

T#1s

SAMPLING TIME

The time between the block calls must be constant. The "sampling time" input specifies the time between block calls.

SP_INT

REAL

-100.0 to +100.0 (%) or phys. value 1) 0.0

INTERNAL SETPOINT

The "internal setpoint" input is used to specify a setpoint.

PV_IN

PROCESS VARIABLE IN

-100.0 to +100.0 REAL (%) or phys. 0.0

An initialization value can be set at the "process variable in" input or an external process variable in floating point format can be connected.

Value 1

DEVELOPMENT OF TUNING ALGORTHM OF PID CONTROLLER USING PLC

PROCESS VARIABLE PERIPHERAL PV_PER WORLD W#16#00 00 The process variable in the I/O format is connected to the controller at the "process variable peripheral" input.

MANUAL VALUE

MAN

REAL

-100.0 to +100.0 (%) or phys. Value 2

0.0

The "manual value" input is used to set a manual value using the operator interface functions.

PROPORTIONAL GAIN

GAIN

REAL

functions. The "proportional value" input 2.0 specifies the controller gain.

RESET TIME

TI

TIME

>= CYCLE

T#20s

The "reset time" input determines the time response of the integrator.

DEVELOPMENT OF TUNING ALGORTHM OF PID CONTROLLER USING PLC

DERIVATIVE TIME

TD

TIME

>= CYCLE

T#10s

The "derivative time" input determines the time response of the derivative unit.

TIME LAG OF THE DERIVATIVE ACTION

TM_LAG

TIME >= CYCLE 2 T#2s

The algorithm of the D action includes a time lag that can be assigned at the "time lag of the derivative action" input.

DEAD BAND WIDTH

-100.0 to +100.0 0.0 DEADB_W REAL (%) or phys.

A dead band is applied to the error. The "dead band width" input determines the size of the dead band.

Value 1

DEVELOPMENT OF TUNING ALGORTHM OF PID CONTROLLER USING PLC

MANIPULATED VALUE HIGH LIMIT LMN_LLM LMN_HLM REAL ...100.0 (%) or phys. Value 2) 100.0 The manipulated value is always limited by an upper and lower limit. The "manipulated value high limit" input specifies the upper limit.

MANIPULATED VALUE LOW LIMIT 0.0 The manipulated value is always LMN_LLM REAL -100.0 to +100.0 (%) or phys. limited by an upper and lower limit. The "manipulated value low limit" input specifies the lower limit.

Value 2

PROCESS VARIABLE FACTOR

The "process variable factor" PV_FAC REAL 1.0 input is multiplied by the process variable. The input is used to adapt the process variable range.

DEVELOPMENT OF TUNING ALGORTHM OF PID CONTROLLER USING PLC

PROCESS VARIABLE OFFSET

0.0 PV_OFF REAL

The "process variable offset" input is added to the process variable. The input is used to adapt the process variable range.

INITIALIZATION VALUE OF THE INTEGRAL ACTION

The output of the integrator can I_ITLVAL REAL -100.0 to +100.0 0.0 (%) or phys. be set at input I_ITL_ON. The initialization value is applied to the input "initialization value of the integral action."

Value 2

DISTURBANCE VARIABLE

For feed forward control, the disturbance variable is connected DISV REAL -100.0 to +100.0 0.0 (%) or phys. to input "disturbance variable."

Value 2

1) Parameters in the setpoint and process variable branches with the same unit. 2) Parameters in the manipulated value branch with the same unit.

DEVELOPMENT OF TUNING ALGORTHM OF PID CONTROLLER USING PLC

22. Output Parameters :


The following table contains the description of the output parameters for SFB 41/FB41 "CONT_C".

Parameter

Data Type

Range of Default Values

Description

MANIPULATED VALUE

LMN

REAL

0.0

The effective manipulated value is output in floating point format at the "manipulated value" output. MANIPULATED VALUE PERIPHERAL

LMN_PER

WORD

W#16#0000

The manipulated value in the I/O format is connected to the controller at the "manipulated value peripheral" output. HIGH LIMIT OF MANIPULATED VALUE REACHED

BOOL QLMN_HLM BOOL FALSE The manipulated value is always limited to an upper and lower limit. The output "high limit of manipulated value reached" indicates that the upper limit has been exceeded.

DEVELOPMENT OF TUNING ALGORTHM OF PID CONTROLLER USING PLC

LOW LIMIT OF MANIPULATED VALUE REACHED

BOOL QLMN_LLM FALSE

The manipulated value is always limited to an upper and lower limit. The output "low limit of manipulated value reached" indicates that the lower limit has been exceeded. PROPORTIONAL COMPONENT

LMN_P

REAL

0.0 The "proportional component" output contains the proportional component of the manipulated variable.

INTEGRAL COMPONENT

LMN_I

REAL

0.0

The "integral component" output contains the integral component of the manipulated value.

DEVELOPMENT OF TUNING ALGORTHM OF PID CONTROLLER USING PLC

DERIVATIVE COMPONENT

LMN_D

REAL

0.0

The "derivative component" output contains the derivative component of the manipulated value. PROCESS VARIABLE

PV

REAL

0.0

The effective process variable is output at the "process variable" output. ERROR SIGNAL

ER

REAL

0.0

The effective error is output at the "error signal" output.

DEVELOPMENT OF TUNING ALGORTHM OF PID CONTROLLER USING PLC

23. Development of Tuning Algorithm PID Controller Using PLC


23.1 Introduction:
In spite of developed modern control techniques like fuzzy logic controllers or neural networks controllers, PID controllers constitute an important part at industrial control systems so any improvement in PID design and implementation methodology has a serious potential to be used at industrial engineering applications. At industrial applications the PID controllers are preferred widespread due to its robust characteristics against changes at the system model. From the other side at industry the exact plant models can not be obtained due to too much nonlinear parts and uncertainties so at practice engineers usually find an appropriate model for the dynamic system. For example, when a thermal system is taken into consideration, the systems overall gain changes from season to season. Changes in dynamic system parameters and unknown system variables directly affect the performance of the system. So for obtaining a better performance the controller parameters have to be renewed in some time interval. A lot of methods have been developed over the last forty years for setting the parameters of a PID controller. Some of these methods are based on characterizing the dynamic response of the dynamic system to be controlled with a first-order model or second-order model with a time delay
KC = 1.2 L. N MAX TI = 2.L TD = L 2

. All general methods for control design can be applied to

PID control. A number of special methods that are tailor made for PID control have also been developed, these methods are often called tuning methods. The most well known tuning methods are those that are stated by Ziegler and Nichols. These methods do not need any mathematical calculation to find PID parameters. In this, Ziegler-Nichols process reaction method (PRM) is used to determine PID controller parameters; Kc, Ti and Td. The Ziegler-Nichols process reaction method works well in a large variety of industrial systems. However, this method rarely can find insufficient PID parameters, and system response makes high overshoots or oscillations before entering in steady state. Because of this, an adaptive controller algorithm is also given to work with Ziegler-Nichols methods parameters more effectively.

DEVELOPMENT OF TUNING ALGORTHM OF PID CONTROLLER USING PLC

Industrial systems are controlled by microcontroller based systems in recent years and widely used microcontroller based systems are programmable logic controllers (PLCs). These controllers are more capable than the other micro controller based ones at the design phase of automation systems so the time consumption over the project decreases. Also the elasticity at hardware level and software level let the modifications be done very easily. At the other side nowadays most of PLCs support the popular communication protocols like Profibus, Modbus, Industrial Ethernet, etc. Within this, the integration to SCADA systems gets easy. In this, an adaptive PID controller is given using Ziegler Nicholas based self-tuning methods parameters as initial parameters for programmable logic controllers.

23.2 Adaptive Control:


In everyday language, to adapt means to change a behavior to conform to new circumstances. Intuitively, an adaptive controller is thus a controller that can modify its behavior in response to changes in the dynamics of the process and the character of the disturbances. Adaptive control involves modifying the control law used by a controller to cope with the fact that the parameters of the system being controlled are slowly time-varying or uncertain. For example, as an aircraft flies, its mass will slowly decrease as a result of fuel consumption; we need a control law that adapts itself to such changing conditions. Adaptive control is different from robust control in the sense that it does not need a priori information about the bounds on these uncertain or time-varying parameters; robust control guarantees that if the changes are within given bounds the control law need not be changed, while adaptive control is precisely concerned with control law changes.

DEVELOPMENT OF TUNING ALGORTHM OF PID CONTROLLER USING PLC

Applications:
When designing adaptive control systems, special consideration is necessary of convergence and robustness issues. Typical applications of adaptive control are (in general):

Self-tuning of subsequently fixed linear controllers during the implementation phase for one operating point;

Self-tuning of subsequently fixed robust controllers during the implementation phase for whole range of operating points;

Self-tuning of fixed controllers on request if the process behavior changes due to ageing, drift, wear etc;

Adaptive control of linear controllers for nonlinear or time-varying processes; Adaptive control or self-tuning control of nonlinear controllers for nonlinear processes; Adaptive control or self-tuning control of multivariable controllers for multivariable processes (MIMO systems);

Usually these methods adapt the controllers to both the process statics and dynamics. In special cases the adaptation can be limited to the static behavior alone, leading to adaptive control based on characteristic curves for the steady-states or to extreme value control, optimizing the steady state. Hence, there are several ways to apply adaptive control algorithms. The Ziegler Nichols process reaction method gave three constant parameters of PID controller; Kc, Ti and Td. However, some system responses can be unpredictable, and these PID parameters can not work efficiently. Also, adaptive control can help deliver both stability and good response. The approach changes the control algorithm coefficients in real time to compensate for variations in the system itself. In general, the controller periodically monitors the system transfer function and then modifies the control algorithm. It does so by simultaneously learning about the process while controlling its behavior.

DEVELOPMENT OF TUNING ALGORTHM OF PID CONTROLLER USING PLC

Choosing a Tuning Method:

Method Manual Tuning

Advantages

Disadvantages experienced

No math required. Online Requires method. personnel. Method.

ZieglerNichols

Proven method.

Online Process upset, some trial-anderror, very aggressive tuning. cost and training

Software Tools

Consistent tuning. Online or Some

offline method. May include involved. valve and sensor analysis. Allow simulation before

downloading. Cohen-Coon Good process models. Some math. Offline method. Only good for first-order

processes.

DEVELOPMENT OF TUNING ALGORTHM OF PID CONTROLLER USING PLC

23.3 Tuning methods 23.3.1 Loop tuning


If the PID controller parameters (the gains of the proportional, integral and derivative terms) are chosen incorrectly, the controlled process input can be unstable, i.e. its output diverges, with or without oscillation, and is limited only by saturation or mechanical breakage. Tuning a control loop is the adjustment of its control parameters (gain/proportional band, integral gain/reset, derivative gain/rate) to the optimum values for the desired control response. The optimum behavior on a process change or set point change varies depending on the application. Some processes must not allow an overshoot of the process variable beyond the set point if, for example, this would be unsafe. Other processes must minimize the energy expended in reaching a new set point. Generally, stability of response (the reverse of instability) is required and the process must not oscillate for any combination of process conditions and set points. Some processes have a degree of non-linearity and so parameters that work well at full-load conditions don't work when the process is starting up from no-load. This section describes some traditional manual methods for loop tuning. There are several methods for tuning a PID loop. The most effective methods generally involve the development of some form of process model, then choosing P, I, and D based on the dynamic model parameters. Manual tuning methods can be relatively inefficient. The choice of method will depend largely on whether or not the loop can be taken "offline" for tuning, and the response time of the system. If the system can be taken offline, the best tuning method often involves subjecting the system to a step change in input, measuring the output as a function of time, and using this response to determine the control parameters.

DEVELOPMENT OF TUNING ALGORTHM OF PID CONTROLLER USING PLC

23.4 Manual tuning


If the system must remain online, one tuning method is to first set the I and D values to zero. Increase the P until the output of the loop oscillates, then the P should be left set to be approximately half of that value for a "quarter amplitude decay" type response. Then increase I until any offset is correct in sufficient time for the process. However, too much I will cause instability. Finally, increase D, if required, until the loop is acceptably quick to reach its reference after a load disturbance. However, too much D will cause excessive response and overshoot. A fast PID loop tuning usually overshoots slightly to reach the set point more quickly; however, some systems cannot accept overshoot, in which case an "over-damped" closed-loop system is required, which will require a P setting significantly less than half that of the P setting causing oscillation.

Effects of increasing parameters:


Parameter Kp Ki Kd Rise Time Decrease Decrease Small Decrease Overshoot Increase Increase Decrease Settling Time Small Change Increase Decrease S.S. Error Decrease Eliminate None

DEVELOPMENT OF TUNING ALGORTHM OF PID CONTROLLER USING PLC

23.5 ZieglerNichols method


Another tuning method is formally known as the ZieglerNichols method, introduced by John G. Ziegler and Nathaniel B. Nichols. As in the method above, the I and D gains are first set to zero. The "P" gain is increased until it reaches the "critical gain" Kc at which the output of the loop starts to oscillate. Kc and the oscillation period Pc are used to set the gains as shown: Kp Control type P PI PID 0.5Kc 0.45Kc 0.6Kc 1.2Kp / Pc 2Kp / Pc Ki Kd

23.6 Ziegler-Nichols Process Reaction Method


Process reaction method is an experimental open-loop tuning method and is only applicable to open-loop stable systems. This method presented by Ziegler and Nichols is based on process information in the form of the open loop step response obtained from a bump test. This method can be viewed as a traditional method based on modeling and control. The Ziegler-Nichols tuning rules were developed to give closed loop systems with good attenuation of load disturbances. The design criterion was quarter amplitude decay ratio, which means that the amplitude of an oscillation should be reduced by a factor of four over a whole period. This corresponds to closed loop poles with a relative damping of about = 02, which is too small (1).

Ziegler-Nichols PRM

DEVELOPMENT OF TUNING ALGORTHM OF PID CONTROLLER USING PLC

23.6.1 Calculations of PID Parameters Using Ziegler-Nichols Process .Reaction Method:


This method firstly characterizes the plant by two parameters Nmax and L for first and second order dead time systems and then calculates PID parameters in equation (4). In this report, Nmax and L are calculated by a PLC algorithm as seen in Figure 5. Here N max is the point of maximum slope and L is the dead time (Figure 3).

KC =

1.2 L. N MAX

TI = 2.L

TD =

L 2
------ (4)

First a step signal is applied to the system and program starts to search the dead time. The dead time is the time when system gives no response to reference signal. In program, a tolerance is given for measuring the dead time (Figure 4), because there are always some high frequencies measuring noises at system output. As shown in Figure 4, these signals and distributions change in an interval defined tolerance. After the dynamic system starts to follow reference and reaches outside the tolerance border, dead time is calculated by PLC program.

Tolerance Limit If the dead time is finished or calculated, the program starts to search maximum slope. It collects all slopes and after collecting them, it selects the biggest slope. Every slope is calculated with equation.

N=

Y (k) Y (k 1) Ts

DEVELOPMENT OF TUNING ALGORTHM OF PID CONTROLLER USING PLC

It memorizes the output value of previous period and takes the output value of the recent period and divides their difference by sampling period (3), (5). Then the program constitutes data of all slopes and selects the biggest slope. When the maximum slope is calculated, the program waits steady state because the parameters of system are stable in steady state. Finally, the program calculates PID parameters. To sum up, to calculate PID parameters using Ziegler-Nichols PRM; first gather data from open-loop plant response to unit step input, then examine data set to find the maximum slope (Figure 3), after then determine the parameters needed for Ziegler Nichols PRM, finally, use tuning relations to generate PID constants. The diagram of this process is given in Figure 5.

Calculation of PID Parameters

DEVELOPMENT OF TUNING ALGORTHM OF PID CONTROLLER USING PLC

23.6.2 Self-Tuning using Ziegler Nichols Process Reaction Method:


PID parameters must be determined from dynamic system. As said before, system parameters change because of various reasons. If PID controller parameters remain the same for a long time, the dynamic system could not be controlled by PID efficiently. Root locus method, bode-frequency analysis method and some methods like this can be used for this calculation. But these methods have complex mathematical calculations, and also system feedback and systems distributions can not be measured momentary without any error. In addition, system parameters (like system gain) change due to environmental change. For these reasons, a self-tuning PID controller is a necessity because this type of a controller can be used in different type of systems and environmental situations. Moreover, a self-tuning PID is a robust controller for systems uncertain parts. Also for changing at system dynamics the controller adopts itself. Thus, using a self-tuning PID is reasonable rather than using any other PID controller which has constant parameters (6). Program algorithm for PLCs is given in Figure 8. The algorithm consists of two start options: one is working with recent parameters which are calculated before; other option is working with new parameters. In this option, program finds new PID parameters for system. Because of Ziegler-Nichols method is applicable for open-loop systems, program first cancels system feedback and waits the system response to settle. When the system output is reset, program records systems momentary input and Then program applies a step signal to system input. It should be said that this step signal is at least 10% bigger than the systems current input (reference) value. If the step signal smaller than 10%, system parameters can not be determined reasonable. After applying the step signal, program waits until the system output to settle at the output value. When the system output is stable, program calculates PID parameters using Ziegler-Nichols process reaction method and sends them to PID parameter input. When PID parameters are loaded, program attaches system feedback and PID controller. Thus, system starts to work with PID controller.

DEVELOPMENT OF TUNING ALGORTHM OF PID CONTROLLER USING PLC

To clarify, necessary steps are given in a sequence below: Run the system in open-loop mode Wait until the system output becomes stable Record system input and output Apply a step input to system (larger than %10 of recent input) Wait until the system output becomes stable Calculate PID parameters and work with PID controller.
PROGRAM CONTROL

Work with Recent Parameters

New Parameters

Apply Step Signal

Cancellation of System Feedback

Is System Output Stable ?

NO

YES
Steady State Ok ?

NO
Calculate PID Parameters

YES
Record System Input and Output

Re-Attach System Feedback

Work with PID Controller

Self-Tuning Program

DEVELOPMENT OF TUNING ALGORTHM OF PID CONTROLLER USING PLC

23.7 Adaptive Algorithm for Proportional (Kc) and Integral (Ti) ..parameters of the PID:
The gain (proportional) and integral terms of PID is directly effect system response. In other words, the integral term is closely related with systems error which is the difference between system reference and system output; and the gain term is directly effect systems time constant and overshoot. Of course derivative term is important, but in this paper Ziegler-Nichols derivative term is directly used in PID controller. Because it is adequate for most industrial systems. On the other hand, gain and integral terms used in PID is adaptive. Because of this, the PID controller becomes, PI-Adaptive Self Tune Based and D-Self Tune Based Controller; PI-D. The algorithm for PI terms is given in figure 9, and the equation is given in equation (9).

TiADAPT =

TiS .TUNE (a 1) ( RESPONSE LADAPT ) + TiS .TUNE U ADAPT LADAPT KcS .TUNE (b 1) ( RESPONSE LADAPT ) + KcS .TUNE U ADAPT LADAPT
-----------(9)

a >1 1> b 0

Kc ADAPT =

Figure 9 Adaptive Algorithm

DEVELOPMENT OF TUNING ALGORTHM OF PID CONTROLLER USING PLC

In figure 9, initial Kc (gain) and initial Ti (integral time) is the coefficients which found in Ziegler-Nichols process reaction method. a coefficient is related with integrals upper border and b coefficient is related with gains lower border. It is clear to say that a is bigger than 1 and b is between 1 and 0. System response symbolizes system output (voltage, degrees, speed, moment etc.). For example, when the system response is speed for a motor, lower adaption response is lower adaption speed in rpm and upper adaption response is upper adaption speed in rpm. The algorithm works between upper and lower adaption borders. In the lower adaption border, the algorithm starts to work with increasing integral and decreasing gain. The reason to increase integral is to make error smaller and smaller before reaching the steady state, and the reason to decrease gain is not to make overshoot or not to make higher overshoot in the response of the system.

23.8 Adjusting Adaptive Algorithm to the Self-Tuning Program:

Self Tune parameters, Adaptive algorithm and PID controller are related with each other like in figure 10. As said before, derivative parameter directly goes to PID controller, gain and integral terms firstly go adaptive algorithm and then PID controller.

Figure 10 Complete Controller Algorithm

DEVELOPMENT OF TUNING ALGORTHM OF PID CONTROLLER USING PLC

23.9 Simulation of Adaptive Self-Tuning PI-D Controller in a Programmable Logic Controller:


Siemens S7-400 CPU 412-2 DP PLC is used for testing this algorithm, within the program Semitic Manager Professional a simulation toolbox is given. This simulation toolbox is good for testing algorithm. Also a data collection program is written for S7-400 CPU 412-2 DP which collects datas and transfers them to Microsoft Excel. In addition, the Figures 2, 6 and 7 are obtained from this data collection program. The simulation is realized in to different kinds of second order systems. First system has 0.23 These
4L / T
SET

4L / T

SET

ratio and second system has 1.03

4L / T

SET

ratio.

ratios are not near to

4L / T

SET

0.5 ,

and as said before these type of systems have

problems (section 3).

23.9.1 Simulation 1: Second Order System with 0.4 sec Dead Time, 32% OS, and 8.2 sec Settling Time:
First simulation result is given in figure 11. First response (1) in figure represents the response with only self-tuning PID and second response (2) represents response with adaptive self-tuning PI-D response. Second order systems original settling time is 7.4 second and overshoot is 32%, first curves settling time is 6.2 second and 9.2% overshoot, and second adaptive curves settling time is 6.0 seconds and this controlled system has no overshoot. The best response is the Adaptive PI-D controlled response. As said before, is 0.23 and it is not as robust as other systems which has 0.5
4L / T
SET

4L / T

SET

ratio of this system

ratio. However PI-D controller

increases systems robustness and makes system insensitive to changes.

Figure 11 Simulation Result 1

DEVELOPMENT OF TUNING ALGORTHM OF PID CONTROLLER USING PLC

23.9.2 Simulation 2: Second Order System with 0.7 sec Dead Time, 85% OS, and 2.4 sec Settling Time:

Second simulation is applied to a second order system which has a very high overshoot and approximately fast settling time. But the important point is system has 1.03 system is near the non-robustness border which is 1.07
4L / T
SET

4L / T

SET

ratio. This

. Because of this self-tuning is not

very efficient to this system, and self-tuning methods response is given in figure 12, in curve (1). This response does not have a good response, but the 85% overshoot is decreased to 6.5% overshoot. Settling time for this answer is 7.1 seconds. Second curve in figure 12 represents the response with Adaptive PI-D controller. This response has no overshoot, 2.9 seconds of settling time, and is robust more than curve 1.

Figure 12 Simulation Result 2

The goal using adaptive PID controller to this system is to make the controller robust to a point where the performance of the complete system is as insensitive as possible to modeling errors and changes in the environment. Simulation results shows that adaptive PID controller obtains this specialties.

DEVELOPMENT OF TUNING ALGORTHM OF PID CONTROLLER USING PLC

Conclusion
In this report Adaptive PID controller - using Ziegler Nichols based Self Tuning methods parameters- is presented and its application on a programmable logic controller is given. For this purpose first of all at the implementation part industrial PID algorithm is used where PIDs derivative input is taken from system output and filtered, so high-frequency signals effect is minimized. Then, integral term is confirmed to obtain a more robust PID structure and finally the output of PID is limited due to PLCs maximum and minimum range. Secondly, Ziegler-Nichols method is given and together within robustness definition is defined. It can be seen that most industrial systems are in the group of this robustness limit. Adjusting adaptive algorithm to SelfTuning PID Controller in section 4, the robustness limit is increased. For implementing the developed algorithm a Siemens S7-400 CPU 412-2 DP PLC is selected as a controller due to its good performance and its developed structure. Afterwards the developed PLC algorithm is simulated on two second order systems. The results showed that Adaptive PI-D controller has a good performance on a large scale of L / ratio of industrial systems. As a result in this work, PID application and system simulation blocks are obtained for a general use in other industrial systems.

Você também pode gostar