A Simple PID Controller with Adaptive Parameter in a dspic; Case of Study

Similar documents
Multiprocessor Systems-on-Chips

Analogue and Digital Signal Processing. First Term Third Year CS Engineering By Dr Mukhtiar Ali Unar

Chapter 7. Response of First-Order RL and RC Circuits

Task is a schedulable entity, i.e., a thread

Distributing Human Resources among Software Development Projects 1

Module 4. Single-phase AC circuits. Version 2 EE IIT, Kharagpur

OPERATION MANUAL. Indoor unit for air to water heat pump system and options EKHBRD011ABV1 EKHBRD014ABV1 EKHBRD016ABV1

WATER MIST FIRE PROTECTION RELIABILITY ANALYSIS

PROFIT TEST MODELLING IN LIFE ASSURANCE USING SPREADSHEETS PART ONE

The Application of Multi Shifts and Break Windows in Employees Scheduling

TEMPORAL PATTERN IDENTIFICATION OF TIME SERIES DATA USING PATTERN WAVELETS AND GENETIC ALGORITHMS

TOOL OUTSOURCING RISK RESEARCH BASED ON BP NEURAL NETWORK

Market Liquidity and the Impacts of the Computerized Trading System: Evidence from the Stock Exchange of Thailand

INTEREST RATE FUTURES AND THEIR OPTIONS: SOME PRICING APPROACHES

Acceleration Lab Teacher s Guide

Trends in TCP/IP Retransmissions and Resets

Monotonic, Inrush Current Limited Start-Up for Linear Regulators

Journal Of Business & Economics Research September 2005 Volume 3, Number 9

Measuring macroeconomic volatility Applications to export revenue data,

Internet Engineering. Jacek Mazurkiewicz, PhD Softcomputing. Part 1: Introduction, Elementary ANNs

Full-wave rectification, bulk capacitor calculations Chris Basso January 2009

Automatic measurement and detection of GSM interferences

DC-DC Boost Converter with Constant Output Voltage for Grid Connected Photovoltaic Application System

Term Structure of Prices of Asian Options

SELF-EVALUATION FOR VIDEO TRACKING SYSTEMS

Strategic Optimization of a Transportation Distribution Network

Morningstar Investor Return

The naive method discussed in Lecture 1 uses the most recent observations to forecast future values. That is, Y ˆ t + 1

Ecodesign Requirements for Electric Motors Towards a System-Approach. Demonstrating the benefits of motor starters for fixed speed applications

A Novel Approach to Improve Diverter Performance in Liquid Flow Calibration Facilities

Detection of DDoS Attack in SIP Environment with Non-parametric CUSUM Sensor

A Note on Using the Svensson procedure to estimate the risk free rate in corporate valuation

cooking trajectory boiling water B (t) microwave time t (mins)

The Journey. Roadmaps. 2 Architecture. 3 Innovation. Smart City

MTH6121 Introduction to Mathematical Finance Lesson 5

Mortality Variance of the Present Value (PV) of Future Annuity Payments

Cointegration: The Engle and Granger approach

Improvement of a TCP Incast Avoidance Method for Data Center Networks

DYNAMIC MODELS FOR VALUATION OF WRONGFUL DEATH PAYMENTS

Chapter 8: Regression with Lagged Explanatory Variables

Market Analysis and Models of Investment. Product Development and Whole Life Cycle Costing

9. Capacitor and Resistor Circuits

Model-Based Monitoring in Large-Scale Distributed Systems

Mathematics in Pharmacokinetics What and Why (A second attempt to make it clearer)

LIFE INSURANCE WITH STOCHASTIC INTEREST RATE. L. Noviyanti a, M. Syamsuddin b

Feasibility of Quantum Genetic Algorithm in Optimizing Construction Scheduling

11/6/2013. Chapter 14: Dynamic AD-AS. Introduction. Introduction. Keeping track of time. The model s elements

Photovoltaic Power Control Using MPPT and Boost Converter

CHARGE AND DISCHARGE OF A CAPACITOR

Risk Modelling of Collateralised Lending

II.1. Debt reduction and fiscal multipliers. dbt da dpbal da dg. bal

USE OF EDUCATION TECHNOLOGY IN ENGLISH CLASSES

Individual Health Insurance April 30, 2008 Pages

A Probability Density Function for Google s stocks

DYNAMIC ECONOMETRIC MODELS Vol. 7 Nicolaus Copernicus University Toruń Ryszard Doman Adam Mickiewicz University in Poznań

Nikkei Stock Average Volatility Index Real-time Version Index Guidebook

4 Convolution. Recommended Problems. x2[n] 1 2[n]

Stock Price Prediction Using the ARIMA Model

Voltage level shifting

AP Calculus AB 2010 Scoring Guidelines

Diagnostic Examination

ANALYSIS AND COMPARISONS OF SOME SOLUTION CONCEPTS FOR STOCHASTIC PROGRAMMING PROBLEMS

Improvement in Forecasting Accuracy Using the Hybrid Model of ARFIMA and Feed Forward Neural Network

Switching Regulator IC series Capacitor Calculation for Buck converter IC

DDoS Attacks Detection Model and its Application

AP Calculus BC 2010 Scoring Guidelines

Differential Equations and Linear Superposition

Chapter 1.6 Financial Management

SPEC model selection algorithm for ARCH models: an options pricing evaluation framework

Analysis of Pricing and Efficiency Control Strategy between Internet Retailer and Conventional Retailer

How To Write A Demand And Price Model For A Supply Chain

DETERMINISTIC INVENTORY MODEL FOR ITEMS WITH TIME VARYING DEMAND, WEIBULL DISTRIBUTION DETERIORATION AND SHORTAGES KUN-SHAN WU

The Kinetics of the Stock Markets

Return Calculation of U.S. Treasury Constant Maturity Indices

Simulation of the motion of a sphere through a viscous fluid

Signal Rectification

A Re-examination of the Joint Mortality Functions

How To Optimize Time For A Service In 4G Nework

Baumer FWL120 NeuroCheck Edition Art. No: OD106434

Mechanical Fasteners Tensile and Shear Stress Areas

Behavior Analysis of a Biscuit Making Plant using Markov Regenerative Modeling

Single-machine Scheduling with Periodic Maintenance and both Preemptive and. Non-preemptive jobs in Remanufacturing System 1

LLC Resonant Converter Reference Design using the dspic DSC

INTRODUCTION TO FORECASTING

ARCH Proceedings

COMPARISON OF AIR TRAVEL DEMAND FORECASTING METHODS

Stochastic Optimal Control Problem for Life Insurance

Transcription:

A Simple PID Conroller wih Adapive Parameer in a dspic; Case of Sudy João Chaínho, Pedro Pereira, Silviano Rafael 1 and A.J. Pires 1 1 LabSEI - Escola Superior de Tecnologia de Seúbal Insiuo Poliécnico de Seúbal/Campus do IPS, Esefanilha, 2914-508 Seúbal, Porugal Telef:+351 265 790 000, e-mail: srafael@es.ips.p Absrac: The main goal of his work consiss in he developmen and implemenaion of a discree PID conroller wih fas response and parameers adapaion capabiliy, in an auomaic way. This conroller is based on a classic PID where a parameers adapaion algorihm was associaed in order o conrol a process. This PID do no require any kind of adjusmen or calibraion from he operaor. For he parameers adapaion one fuzzy sysem wih a Takagi-Sugeno inference mechanism was chosen and some simplificaion of his sysem algorihm was implemened. These simplificaions had he goal of decreasing he processing ime and he conroller response (250µs), in order o conrol fas processes wihou losing sabiliy. The developed algorihm was implemened in a recen dspic30f. Keywords PID Conroller, Adapive Parameer, Fuzzy logic sysem, conrol sysems. 1. Inroducion The PID conroller is much used in he conrol loops of indusrial processes. Is parameers are need o be adjused in funcion of he conrol process and remain unchanged during is regular aciviy. The sar up of he PID conroller requires a no always simple work in he parameers adjusmen, besides he exisence of some mehodologies, described in [1]. Despie he helpful of hese mehodologies in he approached parameers values calculaion, is however necessary an observaion period o survey wih greaer cerainy he conroller performance, which requires, in some cases, a subsanial amoun of ime. This is inerpreed as a disadvanage or a difficuly in he conroller sar-up service. Oher more complex cases exis due o heir pariculariies, where here are small procedures changes ha compromise he PID conroller performance. These siuaions are observed by he rends maps analyzed by he process operaors, occurring he necessiy of a conroller parameers readjusmen. The reason is difficul o define or explain, being, mos of he ime, from diverse procedures aspecs. This work presens a proposal ha conribues o reduce or even o preven he already referred problems. The imposed requiremens are: fas response, do no need any ype of previous adjusmen and universaliy of communicaion wih he sensors, auomaes (PLC) or scada sysems (DCS). 2. PID Conroller The used discree PID conroller is characerized by he following equaion (1). u ( ) e( ) e( 1) = K p e ( ) + Ki T e k + K d (1) T s k= 0 Where e () is he error of he sysem response in he insan, T s is he signal sampling period and K p, K i and K d are he proporional, inegral and derivaive conroller gains, respecively. This algorihm, associaed wih he error calculaion, is of very fas execuion, however is parameers should be previously and appropriaely adjused. Acually, here are various calculaion and parameers adjusmen mehods for PID conrollers (K p, K i and K d ). From saic parameers adjusmen mehods, like Ziegler Nichols and Kiamori mehods, o mehods where he parameers are dynamic, depending on he sysem response, as, for example, he ones based on Fuzzy Logic sysems [2, 3,4], Neural Nework sysems or Neuro-Fuzzy sysems[5]. The disadvanage of hese las ones is he need of oo many processing resources, being herefore usually slower. 3. Adapive Algorihm The considered adapive algorihm inends o have he advanage of simpliciy and o be implemened wih few hardware resources and simulaneously o obain a reduced implemenaion ime (processing cycle ime). The quesion relaed wih he processing ime is very imporan because i limis he quickness of he conrol signal, he quickness of he conroller parameers s

adapaion and consequenly i limis he se performance and behaviour in he reference signal racking. The adapive algorihm is inspired in a Tagaki- Sugeno fuzzy sysem [6] o which some simplificaions were applied. In his ype of fuzzy sysem, he condiion par uses linguisic variables and he conclusion par is represened by a mahemaical funcion. The proposed sysem has four condiions and wo disinc conclusions and i can be represened as in figure 1. I is characerized by one universe of discourse ha is he error percenage. and he error signal value he parameer value K p (or K i ) is incremened or decremened. The incremen or decremen value will depend on he magniude of he error due he remaining elemens are consan. e = (5) ref ( process) The srengh acivaion, µ n, of he membership funcion assumes he value 0 or 1 due o he used recangular membership funcion, and his implies he acivaion of (3) or (4) in order o mainain or change he parameer value. 4. Simulaion Fig. 1. Disribuion and ype of membership funcions The error percenage, Pe, is defined by (2) and he equaion selecion way and acivaion sysem of he adapaion expressions is made by four recangular membership funcions disribued like is showed in figure 1. ref ( process) Pe = *100 (2) ref The membership funcions n = {1, 4} acivae expression (3) when he error percenage is lower han -4 or greaer han 4, acualizing he K p parameer value. n K = K + ϑ. µ p ( ) p ( 1). e( ) The membership funcions n = {2, 3} acivae expression (4) when he error percenage is in he inerval ]-4, -1 ] or [ 1, 4[, acualizing he K i parameer value. K µ (3) n i = K i + ϑ. e ( ). (4) ( 1) In expressions (3) and (4) ϑ represens he adapaion facor, e() he error value in he insan and µ n he srengh acivaion of he adapaion funcion of he membership funcion n. The adapaion facor is loaded iniially wih a value beween 0 and 1 and will remain consan o he long one of he sysem funcioning. The value of his facor is imporan because i will influence he adapaion speed of he K p and K i parameers. The error value in he insan is defined by (5). Depending on he acivaion of he membership funcion This conroller wih parameer adapaion was firs simulaed in Malab Simulink. The block diagram of he model is shown in figure 2. The named conrol block in figure 2, implemens he Tagaki-Sugeno fuzzy sysem presened in figure 1. The Ki conrol and Kp conrol blocks implemen he parameer adapaion algorihm of K p and K i wih a sampling frequency, Fs. This defines herefore he cycle ime ha will go o exis in he pracical implemenaion of he conrol sysem. The PID block represens he PID algorihm presened in (1). The sauraion block implemens he physical limiaion of he oupu values of he real conrollers. 1 Sine Wave1 Fs sw1 0 Clock Conrol Kp_EN Ki_EN Trigger Kp conrol Trigger Ki conrol Kd conrol Kp Ki Kd In PID Sauraion 100 s 2+5s+100 Process1 Fig. 2. Blocks diagram of he sysem model simulaion 5. Implemenaion The described sysem was implemened in connecion wih a processor logic conroller (PLC) replacing he PID conroller in he PLC due he speed response requiremen of he conrol loop. The block diagram of his sysem is presened in figure 3. Relaed o his sysem inerface wih he PLC and he process, i was inended ha i was simulaneously efficien and universal, in order o allow he linking wih any one PLC. The use of he PLC communicaion por was sudied iniially, wih which i would be possible o implemen advanced monior and parameer operaions. However he communicaion proocols of his kind of

inerface are many imes specific of each manufacurer who represens a drawback regarding he principal objecive. So he conrol sysem conneced o he PLC was made hardwiring by wo analogical signals, he PLC reference signal and he conrol sysem oupu signal, and wo binary signals ha represen he funcioning saus se. S TA RT Iniializaion RU N N RunSaus = ON RunSaus = OFF Daa Aquisiion Conrollerpu = 0 Calc Values SLEEP mode M ode=a uo N Calc Kx values Ge Fixed Kx values Fig. 3. Blocks diagram of he sysem For monioring he sae of he variable value of his conroller sysem, afer developmen, is used a ex display module. C alcp ID S endo upu E N D A. Sofware The principal rouine is showed in figure 4 which schemaizes he main flows of he algorihm codificaion. In a firs place he configuraion and definiion insrucions of he iniial microconroller sae are execued. Nex, if he PLC sends he RUN binary command signal, he circui sar-up mode will acivae he RUN_STATUS binary signal and will execue he nex sub rouine algorihm. In conrary he microconroller places zero in he oupu process conroller and eners in SLEEP mode, of which will only reurn o sar up when he PLC acivaes he RUN command signal. The cycle goes on wih he Daa acquisiion block processing he reference daa (ADC) and he oupu process (ProcADC), proceeding from he ADC's. These daa had previously been processed by he rouine of he inerrupions aendance of he ADC's. The resuls values (changeable and Proc) as well as many ohers are normalized values beween 0 and 1. The sub-rouine Calc Values calculae he variable associaes o he error, for example he proper error, is percenage, is derivaive, inegral and absolue values. An imporan deail is he enrance of he cycle ime, T s (or he sampling frequency, F s ) for he inegral and he derivaive calculaion. Fig. 4. Blocks diagram of he sysem The sub-rouine Calc Kxx values pus in pracice he adapive algorihm previously explained in figure 1. The sub-rouine CalcPID calculaes he oupu signal ha will be applied o he process on he basis of equaion (1). The necessary variable had already been calculaed. The Sendpu rouine ses up he wo oupu DAC and couns he cycle ime. This conroller was developed in inegraed MPLAB R IDE sofware ools allowing he programming and debugging funcions, presened in figure 5. Anoher grea advanage is relaed wih anoher ool, he Visual Device Iniializer, ha is inegraed in he developmen sofware and supplies a visual way for configuraion of he diverse inernal modules of he conroller. This one prevens he hard and difficul ask of manual configuraion of all regisers. B. Hardware The crieria for he choice of he microconroller DSPIC was he possibiliy s of incorporae a lo of peripherals (like ADC's, DAC's), communicaions peripherals (like UART, SPI, I2C, ec) and DSP funcionaliies (like mulipliers and accumulaors blocks) oo. On he oher hand, hey presen high processing speed and superior archiecures han he normal C of 8 bis.

The clock signal applied o he microconroller is supplied by a crysal whose frequency laer is muliplied 16 imes wih an inernal PLL block. To obain he maximum frequency of 120MHz praised by he manufacurer, i is necessary o use a crysal of 7,5MHz. So each machine cycle is execued in four clock cycles obaining a maximum of 30 million cycles per second (30MIPS). Fig. 6. Tracking of a recangular reference signal wih a process of firs order Nex i was esed he behaviour of he conroller wih a second-order process characerized by he ransfer funcion in (7). 2 H 210 = s 2 2 s + 969s + 210 (7) Fig. 5. Environmen of MPLAB R IDE developmen 6. Experimenal Resuls The K p and K i adapaion depends on he evoluion of he error value and he adapaion facor value (in figure 7 he adapaion facor value is always he same and equal o 0.1 and in figure 8 he adapaion facor value is 0.5). Comparing figure 7 wih 8 i is easy o observe ha las one converges more quickly and he process oupu was also enered more quickly in he K i adjusmen zone diminishing he saic error. The necessiy o es he pracical implemenaion of he circui and observe is performance implied he connecion of his one o some well known processes. Firs i was esed he behaviour of he conroller wih a firs-order process characerized by he ransfer funcion in (6). H 200 = s s + 200 (6) In figure 6 i is observed he racking of a recangular reference signal funcion beween 20% and 80% of he maximum process value and he response when he sysem is of firs order. Fig. 7. Tracking of a recangular reference signal wih a process of second order and ϑ = 0.1 The used adapaion facor (ϑ) was 0.1 for he K p and K i parameers calculaion. The figure 6 evidences he conrol sysem adapaion ha sars from zero in racking he recangular signal reference. In he hird sep i is already no observed a saic error. The same behaviour of his sysem was observed in racking he sinusoidal and riangular reference signals wih he same ime period of he recangular reference signal. Fig. 8. Tracking of a recangular reference signal wih a process of second order and ϑ = 0.5 There exiss some relaion beween he adapaion facor value and he frequency of he signal reference. Figure 9

show he sysem conrol wih a second order process wih almos he double frequency of he signal reference ha is in figure 7. The used adapaion facor was 0.1. I show ha he sysem needs more ime o reach accepable values due o he increase of he signal reference frequency. This implies a minor number of adapaion cycles beween consan values of reference signal seps. One soluion could be o increase he adapaion facor value. Alexandre Drive,POBox 12277,Research Triangle Park, Norh Carolina 27709,USA, 1995. [2] J.H. Kim and S.J. Oh, A fuzzy PID conroller for nonlinear and uncerain sysem, in Sof Compuing, 4,Springler Verlag, pp. 123-129, 2000. [3] Pauli Viljama and Heikki Koivo, Fuzzy logic in PID gain scheduling Third European Congress on Fuzzy and Inelligen Technologies EUFIT'95., ELITE-foundaion, vol. 2, pp. 927-931, Aachen, Germany, Augus 28 31. [4] JJ. Buckley, Sugeno ype conrollers are universal conrollers, Fuzzy Ses Sys. 53, 1993), pp 299-303. [5] C.T.Lin, Neural Fuzzy Conrol Sysems wih Srucure and Parameer Learning, Wordl Scienific Publishing Co. Pe. Ld. ISBN 981-02-1613-0, 1994. [6] P.Liu and H.Li, Hierarchical TS fuzzy sysem and is universal approximaion,. Informaion Sciences 169 (3-4): 279-303 Feb 1 2005 Fig. 9. Tracking of a recangular reference signal wih a process of second order and ϑ = 0.1 7. Conclusions This work presens a PID wih a parameer adapive algorihm and is performance wih a firs and second order processes. For he parameers adapaion one fuzzy sysem wih a Takagi-Sugeno inference mechanism was chosen and some simplificaion of his algorihm sysem was implemened. The main advanage of he presened sysem is ha i does no need any kind of adjusmen or PID calibraion. I has he advanage of he adapive sysems, quickly compensaing he disurbances ha can appear in he sysem conrol funcioning. The K p and K i adapive algorihm ha is demonsraed in his work, is quie simple, robus and converge quickly. The limiaion of he membership in +4%,-4% and +1%, -1% had given he bes experimenal response resuls. I is observed ha he PI parameers depend on he evoluion of he error value and he adapaion facor value. One limiaion appears in he hird order process sysems, which is in phase of sudy and implemenaion. The applicaions are he mos diverse in he indusry, due o is simpliciy, use of usual elecrical measures and fas sar up applicaion and use. erences [1] Asröm K.J., Hägglund T., PID Conrollers Theory, Design and Tunning, Insrumen Sociey of América,67