10
Advanced Control in SIMATIC PCS7 with online interface to MATLAB/Simulink 1 Bernd-Markus Pfeiffer Siemens AG, Automation & Drives Advanced Group Technologies A&D GT5 D-76181 Karlsruhe, Germany Fax +49(721)595-6728, e-mail: [email protected] KEYWORDS Advanced Control, Digital Control Systems (DCS), Online Interface ABSTRACT The complexity and diversity of „advanced control“ algorithms call for powerful numerical program libraries like e.g. Matlab for efficient implementation of application specific solutions. Matlab is worldwide recognized as a powerful numeric computation, visualization and solution development package. New control strategies can be developed and optimized in offline simulations within a comfortable Matlab/Simulink environment. Afterwards they have to be tested online, at the real, full scale plant. However, drastic changes to the DCS runtime software are not yet desired, before the feasibility and performance of the new control strategies is verified. In this context, the paper describes the benefits of a real-time online interface from Matlab/Simulink on WinNT-PC’s to digital process control systems, e.g. SIMATIC PCS7 and TELEPERM M. This way, the industrial control engineer gets access to virtually unlimited control and optimization capabilities, easily integrated into the DCS. As an application example, design and implementation of a multivariable decoupling controller for a distillation column will be presented. The whole design cycle is supported by a Matlab-based tool with graphical user interface: data acquisition, modeling of process transfer functions, computation of ideal decoupling, approximation by low order functions, design of classical PI-controllers for main loops, offline simulation and online-test of closed loop system. 1 INTRODUCTION: TRADITIONAL APPROACH Any “advanced control” approach that goes beyond conventional PID control involves at least the following steps: data acquisition and preprocessing, process identification, controller design and optimization, simulation, application. Each of these steps requires high mathematical effort and is only feasible using sophisticated engineering tools (“CAE-tools”). But advanced control is not a simple, well defined method, it is a big “bunch”, offering a lot of different algorithms for different purposes. Users want to combine their individual solution to their special problem from pre-programmed modules, taken from huge 1 Interkama ISA-Tech Conference, Düsseldorf, 10/1999.

Doc Adv Control PCS7 With Matlab-Simulink-En (1)

Embed Size (px)

Citation preview

Page 1: Doc Adv Control PCS7 With Matlab-Simulink-En (1)

Advanced Control in SIMATIC PCS7 with online interface to MATLAB/Simulink1

Bernd-Markus Pfeiffer

Siemens AG, Automation & Drives Advanced Group Technologies A&D GT5

D-76181 Karlsruhe, Germany Fax +49(721)595-6728, e-mail: [email protected]

KEYWORDS

Advanced Control, Digital Control Systems (DCS), Online Interface

ABSTRACT The complexity and diversity of „advanced control“ algorithms call for powerful numerical program libraries like e.g. Matlab for efficient implementation of application specific solutions. Matlab is worldwide recognized as a powerful numeric computation, visualization and solution development package. New control strategies can be developed and optimized in offline simulations within a comfortable Matlab/Simulink environment. Afterwards they have to be tested online, at the real, full scale plant. However, drastic changes to the DCS runtime software are not yet desired, before the feasibility and performance of the new control strategies is verified. In this context, the paper describes the benefits of a real-time online interface from Matlab/Simulink on WinNT-PC’s to digital process control systems, e.g. SIMATIC PCS7 and TELEPERM M. This way, the industrial control engineer gets access to virtually unlimited control and optimization capabilities, easily integrated into the DCS. As an application example, design and implementation of a multivariable decoupling controller for a distillation column will be presented. The whole design cycle is supported by a Matlab-based tool with graphical user interface: data acquisition, modeling of process transfer functions, computation of ideal decoupling, approximation by low order functions, design of classical PI-controllers for main loops, offline simulation and online-test of closed loop system.

1 INTRODUCTION: TRADITIONAL APPROACH Any “advanced control” approach that goes beyond conventional PID control involves at least the following steps: • data acquisition and preprocessing, • process identification, • controller design and optimization, • simulation, • application. Each of these steps requires high mathematical effort and is only feasible using sophisticated engineering tools (“CAE-tools”). But advanced control is not a simple, well defined method, it is a big “bunch”, offering a lot of different algorithms for different purposes. Users want to combine their individual solution to their special problem from pre-programmed modules, taken from huge 1 Interkama ISA-Tech Conference, Düsseldorf, 10/1999.

Page 2: Doc Adv Control PCS7 With Matlab-Simulink-En (1)

libraries of well tested, state-of-the-art numerical routines. Worlds leading supplier of such a technical computing environment is MATLAB, delivering a mathematical kernel and more than 40 “toolboxes”, i.e. libraries for different application areas. Matlab together with its continuous function chart simulator “Simulink” is well established as a comfortable CAE-environment for control systems. All kind of Matlab functions can be included in Simulink blocks, allowing to test newly developed control concepts with simulated process models. But the final verification and proof of economic benefit always requires a test of the new concept at the real world plant, with all its non-ideal, non-linear and un-modelled effects. At this point the traditional approach is facing a big gap, because Matlab/Simulink is by definition an offline-tool. Therefore the whole control concept had to be re-implemented on the DCS until now. This used to be an extremely high obstacle, involving months of programming effort, if memory requirements, computing time limitations and human resources allowed it at all. Although high-level programming languages like Structured Text (IEC 1131) are in the meanwhile available for DCS, all matrix operations still have to be coded manually in form of loops, whereas in Matlab, matrix formulas can be typed just like they are written in a textbook. Many advanced control concepts are still “sleeping” in laboratory desktops, because they never got a chance to get practically tested.

2 ONLINE CO-OPERATION OF DCS AND CAE-TOOL The new approach is closing this gap between offline CAE and online test to a matter of a few hours. The whole control concept implemented in Simulink on a PC running WinNT is connected online to the DCS (Figure 1), and the test can begin immediately. This requires a data exchange protocol and a synchronization mechanism forcing Simulink to real-time execution of simulation steps. Simulink itself remains ready for operator inputs and observation of data scopes, providing a “transparent” interface mode for easy testing and debugging.

real worldprocess

Trigger

WinCC

edde.m

adde.m

Advancedcontrol structure

Control structurein DCS

-1

DDEMATLAB/SimulinkPC – Windows NT SIMATIC PCS7

Profibus

Figure 1: Online connection of CAE tool to DCS, using Matlab DDE client

Page 3: Doc Adv Control PCS7 With Matlab-Simulink-En (1)

An online interface to a CAE tool adds a lot of computing power to a DCS. Advanced control is only one area of application, besides e.g. online-optimization, statistical process control, quality supervision, 3D-graphics and many more. SIMATIC PCS7, the new generation DCS by Siemens follows the concept of “Totally Integrated Automation”: it is based on standard Simatic S7-400 PLC hardware. Typical operator stations (OS) are PC’s running Windows NT. Matlab/Simulink can be run on the same PC, either an existing operator station in a OS network, or an additional PC with OS software linked to this network. For communication between different programs on the same PC, Microsoft Windows offers a standard protocol called DDE (Dynamic Data Exchange). The client-server architecture is based on three basic services: • open/close channel to DDE server • request data from DDE server • send data to DDE server The architecture requires a DDE server in the DCS and a DDE client to be implemented in Matlab/Simulink.

2.1 DDE-SERVER FOR DCS Simatic PCS7 operator station software is based on WinCC, a general engineering tool to develop human machine interfaces for all Simatic systems. WinCC comes along with an integrated DDE server, making all variables that are addressed for operating and observation on the OS available on a DDE channel. On the other hand, in the DCS’s of the family TELEPERM M, operator stations are based on dedicated hard- and software, that is mostly not Windows-compatible. But there is an interface program called WinTM, that allows to connect a PC with a special plug-in connector card to the CS275 system bus of the DCS. WinTM also offers a DDE server. Names and addresses of the interface variables are specified manually in popup-windows.

2.2 MATLAB DDE-CLIENT The whole communication is initialized and directed by the DDE client. The Matlab DDE client as described in this paper consists of three generic Simulink blocks that can be included in a Simulink model (continuous function chart) and afterwards be connected like any other function blocks. Trigger-Block: allows the user to specify the DDE communication partners, the data format and the trigger cycle: Figure 2. A periodical trigger signal is produced on the DCS and used by this block as a timer for the whole Simulink model. In normal offline mode, the Simulink simulator runs as

Page 4: Doc Adv Control PCS7 With Matlab-Simulink-En (1)

Figure 2: Matlab DDE client - masks of generic interface blocks fast as possible, whereas this single trigger block transforms the Simulink model to a real time simulator, allowing online connection to real time DCS applications. The opening and closing of the communication channel is performed by simple mouse clicks. The trigger block is also working as a supervisor for the communication: warnings are issued, if the DDE channel is disturbed or delayed. Input and Output blocks “Adde” and “Edde”: The block “Adde” writes data from the simulator to the DDE server. Up to four variables are managed by one block, and any number of interface blocks can be included in a Simulink model. The block “Edde” reads data from the DDE server and converts them to Matlab format.

Page 5: Doc Adv Control PCS7 With Matlab-Simulink-En (1)

3 AN APPROACH TO COMPUTER-AIDED DESIGN OF LOW DIMENSIONAL MULTIVARIABLE CONTROL SYSTEMS

There is a number of specialized software packages for multivariable predictive control [1.] , like e.g. DMC+ by Aspen Tech, Cambridge, Massachusetts, RMPCT by Honeywell. The predictive control approach is suitable for large scale problems with high dimensional input and output spaces. It is able to explicitly consider limitations of manipulated/controlled variables and setpoint ranges in an online optimization. But the complexity of this algorithms requires: • additional heavy computing power, e.g. separate Unix workstations, and control specialists from the software provider to • check feasibility and benefits for a given plant, • support data acquisition, modeling, design and commissioning, • train the process operators not familiar with this approach, • maintain the software running in a changing environment. Because of these enormous costs, application of these predictive control packages is still restricted to single, big projects, most of them in the petrochemicals industry. On the other hand, most of the smaller multivariable problems are still treated, more or less successful, by conventional, decentralized PID control. Tuning of PID controllers in coupled multivariable systems is a difficult iterative procedure, because the parameters of each controller have an influence on the „process“ dynamics the other controllers have to cope with. Mathematical methods to design simple decoupling controllers for low-dimensional multivariable systems like e.g. the „Direct Nycquist Arrays“ (DNA, [2.] ) are well known in literature for many years: Figure 3.

Figure 3: Multivariable control with p-canonical decoupling network according to „Direct Nycquist Arrays“

Precompensated plant

PlantDecoupling network PI-con.

Multivariable controller

Page 6: Doc Adv Control PCS7 With Matlab-Simulink-En (1)

The basic principle is to compensate the interacting physical effects in such a way, that the compensated process is split in several more or less independent part systems, that can be controlled by simple single input single output controllers. Ideal decoupling is mostly not feasible, but in many applications even a considerable reduction of coupling problems is worth the effort. Widespread practical application of these methods just now becomes interesting for non-specialist users, due to a new, menu driven engineering tool [3.] presented here. The tool supports “low-cost” multivariable control: compared to the “high-end” tools for predictive control, there are much less resources required for tuning and commissioning, but the dimensionality of the control problem is restricted to quadratic systems with 2, 3 or 4 coupled input and output variables. The implementation of the tool is based on Matlab, that supports not only the complex numerical calculations, but also delivers easy access to realization of graphical user interfaces.

Figure 4: Multivariable controller design tool based on Matlab, main menu showing process step responses Users are guided by the graphical user interface shown in Figure 4 through a systematic design sequence of 5 steps:

Page 7: Doc Adv Control PCS7 With Matlab-Simulink-En (1)

1. Data acquisition, preprocessing and process identification. PTn-models of the form

nij tsksG

)1()(

+= are fitted to measured step responses with a method well known from [4.] .

2. Computation of ideal decoupling DNA compensator [2.] , and approximation [5.] by a network

of feasible, low-order transfer functions jistst

ststksK ddkij ≠

++++

= ,)1)(1(

)1)(1()(21

21 .

3. Design of main-loop PI controllers )11()(st

ksRi

pii += according to [6.].

4. Offline simulation and optimization. 5. Online verification and test at the real world plant.

Mux

wxu2

Mux

wxu1

Mux

Mux

Mux

wxd2

Mux

wxd1

Demux

uq2

Demux

uq1

tyx

ty1

39.6

soll2

65.3

soll1

disv21

disv12

1

1

Ty2Kp= 0.264Ti= 32.4

Standard PID_C_22

Kp= 0.395Ti= 32.4

Standard PID_C_11

Memory

Gp(2,1)

Kopplung21

Gp(1,2)

Kopplung12

Kp= -0.366Td= -61.6

KomPD_21

Kp= -0.749Td= -79.7

KomPD_12

Gp(2,2)

Haupt-Prozeß 2

Gp(1,1)

Haupt-Prozeß 1

Mux

">>mdataus"

Figure 5: Simulation model of multivariable controller with mathematical process description As already mentioned, the big gap used to be between step 4 and 5. Now you can see, how easy this gap can be bridged with the new Matlab DDE client. Figure 5 shows a simulation model for offline optimization using a mathematical process description with continuous transfer functions Gp(1,1)...Gp(2,2) obtained from process identification. Controller and compensator are already implemented as sampled data systems with limited manipulated variables. Simulink supports a mixed-mode simulation with continuous and discrete part systems.

Page 8: Doc Adv Control PCS7 With Matlab-Simulink-En (1)

Mux

y1y2

emu

x1x2 Mux

Mux

Mux

Mux

Mux

wxd2

Mux

wxd1

Demux

Demux

70

setpoint2

60

setpoint1

s7p_CFC_x1.Us7p_CFC_x2.U

e_DDE

0

cycle_eff

1

1 y1_LINK_Uy2_LINK_U

a_DDE

Twxy2

Twxy1

cycle= 4 sec

Trigger

Memory

Kp= -0.37Td= -61.6

KomPD_21

Kp= -0.75Td= -79.7

KomPD_12Kp= 0.208Ti= 32.4

PID_22

Kp= 0.32Ti= 32.4

PID_11

Figure 6: Verification model of multivariable controller with online connection to DCS, using interface blocks of the Matlab DDE client. After you are satisfied with the simulation results, you just replace the mathematical process model by the interface blocks of the DDE client, giving you access to the DCS as shown in Figure 6. The whole control system stays as it is, but can now operate the real world plant. The realization of a p-canonical decoupling network (c.f. Figure 3) with anti-reset-windup and bumpless transfer between manual and automatic mode using the disturbance value inputs of the main PI controllers as shown in Figure 5 is a modification of the classical DNA method. Patents are pending under No. 19846447.9 . If low order transfer functions with three arbitrary parameters each are used as compensator blocks,

the decoupling network can be constructed with additional PDT1 controllers )1

1()(1 +

+=st

stksK dpkij

as shown in the example. This makes a final implementation in the DCS after successful test with the Matlab version much more easy. In this case, the CAE tool with online interface was used as a rapid prototyping environment for advanced control.

4 APPLICATION EXAMPLE RECTIFICATION COLUMN A pilot application of the Matlab DDE client and the multivariable control design tool based on it was installed for quality control of a rectification column at BASF, Ludwigshafen. It is documented in [7.] and only summarized here. The column with 10 trays separates a mixture of Ethanol and 1-Propanol and is used for the training of operators. It is equipped with a number of basic control loops for pressure, feed-temperature and holdups to maintain stable operation. But the “production quality”, i.e. the concentration of the two fluids to be separated in head and bottom of the column, depends on the thermodynamic balance inside the column. The purpose of an additional supervisory quality control is to keep these concentrations explicitly at given setpoints. A measure for the fluid compositions are the temperatures in the 2nd and 9th tray of the column, they are declared as controlled variables (CV’s). The two manipulated variables (MV’s) are boilup (bottom hot steam flow) and reflux ratio. The coupling problem is obvious: changing the boilup has an influence not only on the temperature of the 2nd, but also of the 9th tray. Changing the reflux ratio

Page 9: Doc Adv Control PCS7 With Matlab-Simulink-En (1)

has an influence on the thermodynamic balance and on the temperature not only on the 9th, but also on the 2nd floor. The online-connection from Matlab to the DCS was established in half a day. Three days were needed to obtain suitable step responses from the plant. Process identification, design of decoupling network and main loop PI-control are all performed on site with a notebook PC using the Matlab based tool as described in the previous chapter. The control system was implemented as resulting from the offline design and simulation without trial and error tuning at the real plant, i.e. the whole commissioning did not take longer than a week. From the measurement data in Figure 7 it can be seen that the controller is in principle doing its job to follow setpoint changes, but the decoupling is not ideal: there is still an influence of setpoint steps of the temperature on the 2nd to the 9th floor. Moreover the test shows, that in this application the performance of the multivariable controller is not much better than conventional decentralized control; at least the multivariable controller delivers smoother MV signals. Anyway, the main goal of the test was to show that low-cost multivariable control with a Matlab-based CAE tool is feasible at all.

0 1000 2000 3000 4000 5000 6000 7000

86

88

90

92

94

96Temperatur Boden 2

Temperatur Boden 9

Zeit [s]

Temperatur [°C]

Figure 7: Multivariable decoupling control of a rectification column, upper diagramm: bottom temperature and its setpoint, lower diagramm: top temperature and its setpoint

5 CONCLUSIONS The Matlab DDE client as described here provides an online connection between Siemens DCS and Matlab/Simulink, transforming offline simulation models to real time control software. It will be delivered by Siemens starting from 6/99. The multivariable controller design tool is presently a laboratory prototype that can be used for pilot applications.

Page 10: Doc Adv Control PCS7 With Matlab-Simulink-En (1)

LITERATURE [1.] Camacho, C.F., Bordons, C.: Model predictive control in the process industry. Springer, Berlin, 1995. [2.] Rosenbrock, H.H.: Computer-aided control system design, Academic Press, 1974 [3.] Bergold, S.: Verfahren zur Mehrgrößenregelung in der Prozeßindustrie. Dissertation Universität Kaiserslautern, Prof. Pandit. VDI-Verlag, Düsseldorf, to appear in 1999. [4.] Preuß, H.-P., Linzenkirchner, E., Kirchberg, K.-H.: SIEPID - ein Inbetriebsetzungsgerät zur automatischen Regleroptimierung. atp 29, 9/1987. [5.] Kiendl, H.: Das Konzept der invarianten Ordnungsreduktion. at 34, 12/1986, pp. 465-473. [6.] Latzel, W.; Einstellregeln für kontinuierliche und Abtast-Regler nach der Methode der Betragsanpassung; at 5/88, S.170-178 und at 6/88, S. 222-227. [7.] Bergold, S., Pfeiffer, B-M., Pandit, M.: Entwurf und Erprobung eines Entkopplungsreglers am Beispiel einer Rektifikationskolonne. atp 41, 3/1999, pp. 25-34