Hardware Realization of Advanced Controller Design Methods using FPGA

Hardware Realization of Advanced Controller Design Methods using FPGA

4th IFAC International Intelligent Control andConference Automationon Sciences 4th Conference on 4th IFAC IFAC International International Conference ...

755KB Sizes 18 Downloads 141 Views

4th IFAC International Intelligent Control andConference Automationon Sciences 4th Conference on 4th IFAC IFAC International International Conference on Intelligent Control and Automation Sciences 4th IFAC on June 1-3,International 2016. Reims, France Available online at www.sciencedirect.com Intelligent Control andConference Automation Sciences Intelligent Control and Automation Sciences June 1-3, 2016. Reims, France Intelligent Control and Automation Sciences June 1-3, 2016. Reims, France June 1-3, 2016. Reims, France June 1-3, 2016. Reims, France

ScienceDirect

49-5 (2016) 163–168 Hardware RealizationIFAC-PapersOnLine of Advanced Controller Design Methods using FPGA Hardware Realization of Advanced Controller Design Methods using FPGA Hardware Realization of Advanced Controller Design Methods using FPGA Hardware Realization of Advanced Controller Design Methods using FPGA Ján Cigánek, Michal Kocúr, Štefan Kozák

Ján Cigánek, Michal  Kocúr, Michal Kocúr, Štefan Štefan Kozák Kozák Ján Cigánek, Cigánek, Michal Štefan Kozák  Kocúr, Faculty ofJán Electrical Engineering and Information Technology,  Faculty Electrical Engineering and Information Information Technology, Slovak University of Technology in Bratislava Faculty of of Electrical Engineering and Technology, Faculty of Electrical Engineering and Information Technology, Slovak University of Technology in Bratislava Bratislava, Slovakia in Bratislava Slovak University of Technology Slovak University of Technology Bratislava, Slovakia in Bratislava e-mail: [email protected], [email protected], [email protected] Bratislava, Slovakia Bratislava, Slovakia e-mail: [email protected], [email protected], [email protected] e-mail: [email protected], [email protected], e-mail: [email protected], [email protected], [email protected] [email protected] Abstract: The presented paper deals with design, experimental verification and comparison of three Abstract: The presented deals with design, experimental verification and comparison of three controller design methodspaper (Internal Model Control, Pole-Placement, PID by Magnitude Optimum) Abstract: The presented paper deals with design, experimental verification and comparison of three Abstract: The presented paper deals with design, experimental verification and comparison of three controller design methods (Internal Model Control, Pole-Placement, PID by Magnitude Optimum) applied in the control for processes with complex dynamics. The presented and tested controlOptimum) methods controller design methods (Internal Model Control, Pole-Placement, PID by Magnitude controller design methods (Internal Model Control, Pole-Placement, PID by Magnitude Optimum) applied in the control for processes complex dynamics. The presented and tested control methods guarantee robust stability and highwith performance of controlled system. Proposed algorithms were applied in control for with complex dynamics. The and tested control methods applied in the the control for processes processes complex dynamics. The presented presented and (FPGA) tested algorithms control methods guarantee robust stability and high performance of controlled system. Proposed were successfully implemented and using the Field Programmable Gate Array technology for guarantee robust stability andtested highwith performance of controlled system. Proposed algorithms were guarantee stability andmotors high using performance controlled system. Proposed algorithms successfully implemented tested the Programmable Gate (FPGA) technology for the velocityrobust control of real and DC system. successfully implemented and tested using the Field Field of Programmable Gate Array Array (FPGA) technologywere for successfully implemented tested using the Field Programmable Gate Array (FPGA) technology for the of DC system. the velocity velocity control control of real real and DC motors motors system. © 2016, IFAC (International Federation of Automatic Control) Hosting by Elsevier Ltd. All rights reserved. the velocity control of real DC motors system. Keywords: Algebraic theory, Control system, Closed-loop, Factorization, Filter, Internal model control, Keywords: Algebraic theory, Control system, system, Closed-loop, Closed-loop, Factorization, Factorization, Filter, Filter, Internal Internal model model control, control, Pole-placement, FPGA, Implementation Algebraic theory, Control Keywords: Keywords: Algebraic theory, Control system, Closed-loop, Factorization, Filter, Internal model control, Pole-placement, FPGA, Implementation Pole-placement, FPGA, Implementation Pole-placement, FPGA, Implementation    

1. INTRODUCTION 1. INTRODUCTION INTRODUCTION A development of1. control methods based on 1.advanced INTRODUCTION A development of advanced control ismethods methods based and on robustness, optimality and prediction an important A development of advanced control based on A development of advanced control methods based on robustness, optimality and prediction is an important and challenging optimality task. In recent a newis control approaches robustness, and years, prediction an important and robustness, optimality and prediction is an important and challenging task. In recent years, a new control approaches have emerged to In replace augment control challenging task. recentoryears, a newconventional control approaches challenging task. recentor a newconventional control approaches have emerged to In replace oryears, augment conventional control engineering methods. have emerged to replace augment control have emerged to replace or augment conventional control engineering methods. engineering methods. The automatic control is crucial for practically all engineering methods. The automatic control The is crucial crucial for practically practically all engineering activities. automation technology all is The automatic control is for The automatic control is crucial for practically engineering activities. The automation technology is understood to be the use of such methods, control strategies, engineering activities. The automation technology all is engineering The automation technology is understood to activities. beinstallations the use use of of such methods, control strategies, processes, and (hardware andcontrol software) which understood to be the such methods, strategies, understood to be the use of such methods, control strategies, processes, and installations (hardware and software) which are capableandofinstallations fulfilling defined objectives without the processes, (hardware and software) which processes, andof (hardware software) which are capable ofinstallations fulfilling defined objectives without the constant interference of a defined man in objectives a and largely independent are capable fulfilling without the are capable of fulfilling defined objectives without the constant interference of a man in a largely independent manner, i.e. automatically. constant interference of a man in a largely independent constant i.e. interference of a man in a largely independent manner, automatically. manner, i.e. automatically. Motivated the practical success of conventional control manner, i.e.by automatically. Motivated the practical success of conventional control engineeringby methods in consumer products and industrial Motivated by the practical success of conventional control Motivated by the practical success of conventional control engineering methods in consumer products and industrial process control, there has an increasing of work engineering methods in been consumer productsamount and industrial engineering methods in consumer products and industrial process control, there there has methods been an an increasing increasing amount on development of new which areamount based of on work new process control, has been of work process control, there has methods been increasing on development of new new methods which are areamount based of on work new optimization techniques, soft ancomputing strategies, and on development of which based on new on development of new methods which based on new optimization techniques, soft of computing strategies, and effective hardware realization controlarealgorithms. The optimization techniques, soft computing strategies, and optimization techniques, soft computing strategies, and effective hardware realization of control algorithms. The automatic hardware control methods withofintegration of information effective realization control algorithms. The effective hardware realization of control algorithms. The automatic control methods with integration of information and communication systems with are today pervasive in all fields automatic control methods integration of information automatic control methods integration of information and communication systems with are today pervasive in all fields of people’s activities. and communication systems are today pervasive and communication systems are today pervasive in in all all fields fields of people’s activities. of activities. Thepeople’s research, development and implementation of new of people’s activities. The research, development and implementation implementation of very new control principles in automation field have been The research, development and of new The research, development and implementation of new control principles in automation field have been very dynamic. Implementation of controllers has gone through control principles in automation field have been very control principles in automation field have been very dynamic. Implementation offrom controllers hasmechanical gone through through several stages of evolution,of the early and dynamic. Implementation controllers has gone dynamic. Implementation controllers hasmechanical gone through several stages of evolution, evolution, from the microprocessor early and pneumatic designs to the of embedded several stages of from the early mechanicalbased and several stages of evolution, from the early mechanical and pneumatic designs to the embedded microprocessor based systems. Moreover, in typical control processes (e.g. thermal pneumatic designs to the embedded microprocessor based pneumatic designs to the embedded microprocessor based systems. Moreover, in typical control processes (e.g. thermal processes,Moreover, power plants, robotic etc.) (e.g. it isthermal often systems. in typical controldrives processes systems. in control processes (e.g. thermal processes, power plants, robotic drives etc.) it is is often necessaryMoreover, topower modifyplants, thetypical mentioned classical control methods processes, robotic drives etc.) it often processes, power plants, robotic drives etc.) it is often necessary to modify the mentioned classical control methods of tuning to taking intotheaccount the classical time delays, unmodeled necessary modify mentioned control methods necessary to modify the mentioned classical control methods of tuning taking into account the time delays, unmodeled dynamics, of working disturbances. of tuning change taking into accountconditions the timeand delays, unmodeled of tuning change taking into accountconditions the timeand delays, unmodeled dynamics, of working working disturbances. dynamics, change of conditions and disturbances. The improvement of classical methods is possible under the dynamics, change of working conditions and disturbances. The improvement oforiginal classicalcontrol methods is possible possible under the the assumption that theof algorithm is extendable The improvement classical methods is under The classical methods is possible under the assumption that theoforiginal original control algorithm is extendable extendable with improvement respect that to changes in process parameters, yields stability assumption the control algorithm is assumption that the original control algorithmyields is extendable with respect to changes in process parameters, stability with respect to changes in process parameters, yields stability with respect to changes in process parameters, yields stability

of the closed loop even in the presence of large time delay of the closed loopineven even in the the control presence(Baotić of large large time delay andthe is closed applicable real-time et time al., 2008), of loop in presence of delay of the closed loopin in the control presence(Baotić of large delay and is and applicable ineven real-time control (Baotić et time al., 2008), 2008), (Cutle Ramaker, 1979). and is applicable real-time et al., and is and applicable in 1979). real-time control (Baotić et al., 2008), (Cutle Ramaker, (Cutle andtheRamaker, 1979).control algorithm used in industry To date, most popular (Cutle and Ramaker, 1979). To date, the most popular control algorithm used in industry industry is the ubiquitous controller which has been implemented To date, the mostPID popular control algorithm used in To date, the most popular control algorithm used in industry is the ubiquitous PID controller which has been implemented successfully in various technicalwhich fields. since the is the ubiquitous PID controller hasHowever, been implemented is the ubiquitous PID controller which has been implemented successfully in various technical fields. However, since the evolution of in embedded microcomputers and mainly during successfully various technical fields. However, since the successfully in various technical fields. However, since the evolution of embedded microcomputers and mainly during the numberofofembedded modern and advanced control have evolution microcomputers andalgorithms mainly during evolution of embedded microcomputers and mainly during the number of modern modern and advanced control algorithms have beennumber also developed and applied in a control wide range of industrial the of and advanced algorithms have the number of modern and advanced algorithms have been also developed developed and applied in aa control wide range range of industrial industrial applications. been also and applied in wide of been also developed and applied in a wide range of industrial applications. applications. The Internal Model Control (IMC) algorithm is based on the applications. The Internal Model Control Control (IMC) algorithm is based based on the fact Internal that an accurate model (IMC) of thealgorithm process can lead on to the The Model is The Internal Model Control (IMC) algorithm is based on the fact that an accurate model of the process can lead to design a robust controller terms can of stability fact thatofan accurate model ofboth the inprocess lead to and the fact that an accurate model of the process can lead to the design of a robust controller both in terms of stability and performance. IMC controller is famous both in both theoretical field and design of a robust in terms of stability design of a robust controller both in terms of stability performance. IMC is famous in both theoretical field and industry for IMC its advantages, be theoretical more exact, performance. is famous intoboth field easy and performance. IMC is famous in into both field and industry forgood its performance advantages, be theoretical more exact, easy framework, follow up control, powerful industry for its advantages, to be more exact, easy industry for its advantages, to be more exact, easy framework, gooddenies performance ininfollow follow up control, control, powerful robustness, high qualityin immeasurable disturbance. framework, good performance up powerful framework, good performance up control, powerful robustness, high denies qualityinin infollow immeasurable disturbance. This paper high proposes enhanced controllers, using Internal robustness, denies quality immeasurable disturbance. robustness, high denies quality in immeasurable disturbance. This paper proposes enhanced controllers, using Internal Modelpaper Control (IMC) and MPC control strategies. This proposes enhanced controllers, using Internal This paper proposes enhanced controllers, using Internal Model Control (IMC) and MPC control strategies. Model Control (IMC) and MPC control strategies. There two approaches for implementing control systems Model are Control (IMC) and MPC control strategies. There are two approaches for implementing control systems using are digital Theimplementing first approach is based on There two technology. approaches for control systems There are two approaches for implementing control systems using digital technology. The first approach is based on software whichtechnology. implies a memory-processor interaction. using digital The first approach is basedThe on using digital technology. The first approach is based on software which implies a memory-processor interaction. The memory holds application program whileinteraction. the processor software which the implies a memory-processor The software which implies a memory-processor interaction. The memory holds the application program while the processor fetches, decodes, executesprogram the program instructions. memory holds the and application while the processor memory holds the application while the processor fetches, decodes, and executesprogram the program instructions. Programmable Logic Controllers (PLCs), microcontrollers, fetches, decodes, and executes the program instructions. fetches, decodes, and executes the program instructions. Programmable Logic Controllers (PLCs), microcontrollers, microprocessors,Logic Digital Signal (PLCs), Processors (DSPs) and Programmable Controllers microcontrollers, Programmable Logic Controllers (PLCs), microprocessors, Digital Signalare Processors (DSPs) and general purpose computers toolsmicrocontrollers, for software microprocessors, Digital Signal Processors (DSPs) and microprocessors, Digital Signal Processors (DSPs) and general purpose computers are tools for software implementation. general purpose computers are tools for software general purpose computers are tools for software implementation. implementation. On the other hand, the second approach is based on hardware. implementation. On the hardware other hand, hand,implementation the second second approach approach is based based by on hardware. hardware. Early is achieved magnetic On the other the is on On the other hand, the second approach is based on hardware. Early hardware implementation is achieved by magnetic relays extensively used in old industry automation systems. Early hardware implementation is achieved by magnetic Early hardware implementation is achieved by magnetic relays extensively used in old industry automation systems. Then, itextensively became achievable byindustry means of digital logic gates relays used in old automation systems. relays extensively used in old industry automation systems. Then, it became achievable by means of digital logic gates and Medium Scale Integration (MSI) components. Then, it became achievable by means of digital logic gates Then, it became means of digital logic gates and Medium Medium Scaleachievable Integrationby(MSI) (MSI) components. and Scale Integration components. If systemScale sizeIntegration and complexity increases, Application andthe Medium (MSI) components. If the system system size Circuits and complexity complexity increases, Application Specific Integrated (ASICs) are utilized.Application The ASIC If the size and increases, If the system size and complexity increases, Application Specific Integrated Circuits (ASICs) are utilized. The ASIC ASIC must be Integrated fabricated Circuits on a manufacturing a process that Specific (ASICs) are line, utilized. The Specific Integrated Circuits (ASICs) are line, utilized. The ASIC must be fabricated on a manufacturing a process that must be fabricated on a manufacturing line, a process that must be fabricated on a manufacturing line, a process that

Copyright © 2016, 2016 IFAC 2405-8963 © IFAC (International Federation of Automatic Control) Hosting by Elsevier Ltd. All rights reserved. Copyright © 2016 IFAC Copyright ©under 2016 responsibility IFAC Peer review© of International Federation of Automatic Control. Copyright 2016 IFAC Copyright © 2016 IFAC 10.1016/j.ifacol.2016.07.107

IFAC ICONS 2016 164 June 1-3, 2016. Reims, France

Ján Cigánek et al. / IFAC-PapersOnLine 49-5 (2016) 163–168

takes several months, before it can be used or even tested. FPGAs are configurable ICs and used to implement logic functions. Today’s high-end FPGAs can hold several millions gates and have some significant advantages over ASICs. They ensure ease of design, lower development costs, more product revenue and the opportunity to speed products to market. At the same time, they are superior to software-based controllers as they are more compact, power-efficient, while adding high speed capabilities.

unstable for processes with non-minimal phase. This problem is solved by the IMC method. 2.1 PID by Magnitude Optimum Magnitude Optimum is a method for the synthesis of PID controllers. This approach is based on the requirement for the control system transfer function (1) to be in a form: 𝐺𝐺𝑟𝑟𝑟𝑟𝑟𝑟 = 𝐺𝐺𝑦𝑦⁄𝑤𝑤 (𝑠𝑠) = 1

2. MODERN CONTROL ENGINEERING APPROACHES

In ideal case, step response of process variable is equal to the set point. In frequency domain it corresponds width:

Advanced Control is the use of new numerical methods, information and communication technology, facilitated by various computer-based techniques, to implement a control strategy that executes, reacts, and/or predicts actions based on process or operating conditions.

𝐺𝐺𝑦𝑦⁄𝑤𝑤 (𝑗𝑗𝑗𝑗) = 1 ⟹ |𝐺𝐺𝑦𝑦⁄𝑤𝑤 (𝑗𝑗𝑗𝑗)| = 1 ⟹ 𝐴𝐴𝑦𝑦⁄𝑤𝑤 (𝜔𝜔) = 1

Condition (2) cannot be satisfied in reality, however it can be proven that control process ends the fastest when amplitude characteristics Ay/w(j ) will be flat at first and then it will monotonically decreasing. Description of this method can be found in (Åström and Hägglund, 1995).

Advanced Control solutions are most often applied in the process industry. Complex systems that must produce precise results (outputs) based upon various requirements and under various disturbances (inputs), exist in all industries (Brosilow and Joseph, 2002), (Seshagiri Rao, Rao and Chidambaram, 2009).

2.2 Internal Model Control IMC methods are applicable for various systems (stable, astatic, unstable, with transport delay ...). In comparison with direct synthesis methods, IMC methods are applicable also for non-minimal phase systems. Unstable parts of model and parts containing transport delay are not inverted in controller proposal. The main principle of IMC method is:

Modern controller design is based on four basic properties: optimality, robustness, adaptability, intelligence. Realization of modern control structures is derived from the basic feedback structure, in Fig.1.

+ w

- e

control output

Controller GC

u

output vlaue

Plant Gp

•factorization of model for invertible and non-invertible parts, •proposal of IMC controller for IMC structures,

y

•transformation of IMC controller to standard form,

feedback

•implementation of PID algorithm to standard PID form. Let separate the model into two factors, one invertible and the second one with all non-invertible terms.

Fig. 1. Control block scheme

During last years, most common and widely used control structures are: a)

𝐺𝐺𝑝𝑝 = 𝐺𝐺𝑝𝑝− 𝐺𝐺𝑝𝑝+

feedback structures with PID controller (transport delay compensation, constrained control action, IMC structures),

(3)

The “invertible” factor 𝐺𝐺𝑝𝑝− has an inverse that is causal and stable, which results in an acceptable controller. The gain of this factor is the same as the model gain K.

b) combination of feedback and feedforward structures, c)

(2)

where Ay/w(ω) is the magnitude of the control system of Ftransfer function Gy/w(jω)and ω is the angular frequency.

This results in providing a more consistent, higher quality product, by increasing throughput, or by utilizing energy and material resources in a more efficient manner.

control deviation

(1)

The “non-invertible” factor 𝐺𝐺𝑝𝑝+ has an inverse that is non causal or unstable. The factor contains models elements with transport delays and positive numerator zeros. The gain is the 1.

cascade structures,

d) combination of feedback, feedforward and cascade structures.

IMC controller could be calculated by (4-5).

In this paper we analysed three methods: Direct synthesis method with two approaches (pole-placement and PID by Magnitude Optimum) and IMC method.

𝐺𝐺𝑐𝑐_𝐼𝐼𝐼𝐼𝐼𝐼 (𝑠𝑠) =

Direct synthesis method is not suitable for the systems with numerator roots (zeros) in the right half-plane, because zeros of the model are poles of controller and therefore controller is

𝐺𝐺𝑓𝑓 (𝑠𝑠) =

164

1

𝐺𝐺𝑝𝑝− (𝑠𝑠)

𝐺𝐺𝑓𝑓 (𝑠𝑠)

1 (𝜏𝜏𝑐𝑐 𝑠𝑠 + 1)𝑁𝑁𝑓𝑓

(4) (5)

IFAC ICONS 2016 June 1-3, 2016. Reims, France

Ján Cigánek et al. / IFAC-PapersOnLine 49-5 (2016) 163–168

165

where Gf is IMC filter, τc is required time constant of closed control loop and Nf is the order of the filter, which should be chosen in order to controller Gc_IMC feasibility. The value of Nf is selected so that the product of the controller and filter has a polynomial in “s” with a denominator order ≥ the numerator order.

We consider the feedback control structure and direct synthesis methods for the rest of this paper. The transfer function of the closed control loop is in form (8).

The filter is designed to prevent pure derivatives and the filter constant is tuned to achieve “robust performance”.

The transfer function of the controller results from (8) and has the form (9).

𝐺𝐺𝑦𝑦⁄𝑤𝑤 (𝑠𝑠) =

The IMC controller eliminates all non-invertible elements in the feedback process model by inverting 𝐺𝐺𝑝𝑝− .

𝐺𝐺𝑐𝑐_𝑃𝑃𝑃𝑃𝑃𝑃 (𝑠𝑠) =

Correlation of IMC control structure and classical control loop with feedback controller is shown in Fig.1 and Fig.3. The control action and controller output variable are the same in both control structures. If the block of controller Gc_IMC and block of the process model GM are merged into one block Gc_PID (Fig.3), we obtain classical control structure with transfer function in form (6). 𝐺𝐺𝑐𝑐_𝑃𝑃𝑃𝑃𝑃𝑃 (𝑠𝑠) =

𝑈𝑈(𝑠𝑠) 𝐺𝐺𝑐𝑐_𝐼𝐼𝐼𝐼𝐼𝐼 (𝑠𝑠) = 𝐸𝐸(𝑠𝑠) 1 − 𝐺𝐺𝑀𝑀 (𝑠𝑠)𝐺𝐺𝑐𝑐_𝐼𝐼𝐼𝐼𝐼𝐼 (𝑠𝑠)

(6)

𝑈𝑈(𝑠𝑠) 𝐺𝐺𝑐𝑐_𝑃𝑃𝑃𝑃𝐷𝐷 (𝑠𝑠) = 𝐸𝐸(𝑠𝑠) 1 + 𝐺𝐺𝑀𝑀 (𝑠𝑠)𝐺𝐺𝑐𝑐_𝑃𝑃𝑃𝑃𝑃𝑃 (𝑠𝑠)

𝐺𝐺𝑦𝑦⁄𝑤𝑤 (𝑠𝑠) 1 𝐺𝐺𝑝𝑝 (𝑠𝑠) 1 − 𝐺𝐺𝑦𝑦⁄𝑤𝑤 (𝑠𝑠)

(7)

𝐺𝐺𝑦𝑦⁄𝑤𝑤 (𝑠𝑠) =

𝑌𝑌(𝑠𝑠) 1 = 𝑊𝑊(𝑠𝑠) 𝜏𝜏𝑐𝑐 𝑠𝑠 + 1

Substituting (10) into (9) we receive controller transfer function (11). 1

1 𝜏𝜏𝑐𝑐 𝑠𝑠+1 𝐺𝐺𝑐𝑐 (𝑠𝑠) = 𝐺𝐺𝑝𝑝 (𝑠𝑠) 1 − 1

𝜏𝜏𝑐𝑐 𝑠𝑠+1

setpoint

+

Controller GCIMC

e

w

-

u

y

Model GM

-

+

Fig. 2. IMC control structure

GCPID setpoint

w

+

-

+

Controller GCIMC

u

1 1 𝐺𝐺𝑝𝑝 (𝑠𝑠) 𝜏𝜏𝑐𝑐 𝑠𝑠

(11)

The controller is represented by general transfer function (12).

control output

+

=

In consideration of integrator in controller transfer function, the transfer function of closed control loop has steady state without permanent output error. Time constant of closed control loop is determined by choice of τc, while in practice it is used τc = 0.5τ as a proposal, where τ is time constant of the process (plant). The next choice of an order of controller transfer function or value of time constant τc has to be done regarding to feasibility of calculated controller Gc.

output vlaue

Plant Gp

(10)

where τc> 0 is required time constant of closed control loop and 𝐺𝐺𝑦𝑦⁄𝑤𝑤 (𝑠𝑠) is stable transfer function of closed control loop.

PID controller set up by IMC methodology by Morari and Zafiriou (Morari and Zafiriou, 1989). control output

(9)

Consider following transfer function (10), which guarantee required dynamics of transfer function of closed control loop, for universal proposal.

where u is the control action (the input variable also for process model and real process), y is the output variable of the real process compared with the output variable of the process model yM. The difference of this two output variables is the input for the controller.

control deviation

(8)

where the required transfer function of closed control loop is substituted for Gy/w(s) using the direct synthesis method. The controller is explicitly depending on process model inversion. The control law U(s) is function of required transfer function of closed control loop. The proposal of the transfer function of closed control loop has to be created. The proposed controller described by this transfer function is simple, feasible and guarantee stability and quality of closed control loop.

It is possible to determine the transfer function of IMC controller from the block scheme in Fig.2 by equation (7). 𝐺𝐺𝑐𝑐_𝐼𝐼𝐼𝐼𝐼𝐼 (𝑠𝑠) =

𝐺𝐺𝑝𝑝 (𝑠𝑠)𝐺𝐺𝑐𝑐_𝑃𝑃𝑃𝑃𝑃𝑃 (𝑠𝑠) 𝑌𝑌(𝑠𝑠) = 𝑊𝑊(𝑠𝑠) 1 + 𝐺𝐺𝑝𝑝 (𝑠𝑠)𝐺𝐺𝑐𝑐_𝑃𝑃𝑃𝑃𝑃𝑃 (𝑠𝑠)

Plant Gp

output vlaue

𝐺𝐺𝐶𝐶 (𝑠𝑠) =

y

Model GM

𝑄𝑄(𝑠𝑠) 𝑞𝑞𝑚𝑚 𝑠𝑠 𝑚𝑚 + 𝑞𝑞𝑚𝑚−1 𝑠𝑠 𝑚𝑚−1 + ⋯ + 𝑞𝑞1 𝑠𝑠 + 𝑞𝑞0 = 𝑃𝑃(𝑠𝑠) 𝑝𝑝𝑛𝑛 𝑠𝑠 𝑛𝑛 + 𝑝𝑝𝑛𝑛−1 𝑠𝑠 𝑛𝑛−1 + ⋯ + 𝑜𝑜1 𝑠𝑠 + 𝑜𝑜0

(12)

In order comparison of numerator m and denominator n:

Fig. 3. Transformation between IMC and PID control structure

It is possible to apply direct synthesis method and IMC control structures for different kinds of PID controller structures (Kocúr, Kozák and Dvorščák, 2014), (Cigánek, Noge and Kozák, 2015).



if n >= m, then controller is causal, therefore without derivative part,



if n = m - 1, then controller is non causal, therefore only derivative part,



if n = m - 2, then controller is non causal and it requires second derivation of measured input (it is unfeasible).

It is recommended to choose n = m - 1 structure. 165

IFAC ICONS 2016 166 June 1-3, 2016. Reims, France

Ján Cigánek et al. / IFAC-PapersOnLine 49-5 (2016) 163–168

2.3 Pole-placement Controller

𝐺𝐺𝑐𝑐_𝑃𝑃𝑃𝑃 (𝑠𝑠) =

The proposed method is suitable for both continuous and discrete forms regulators. Design of controller according to this methodology is based on the idea to prescribe closed loop location poles and thereby to impose a controlled process desired dynamics. Digital pole placement controller with prescribed poles of closed loop requires knowledge of the mathematical model of the controlled process. Correct choice of prescribed poles is guarantying dynamics of closed loop and can ensure the required performance and stability. For the discrete model form of the controlled process we proposed the digital pole placement controller in the form: 𝐺𝐺𝑅𝑅 (𝑧𝑧) =

−1 )

𝑄𝑄(𝑧𝑧 𝑞𝑞0 + 𝑞𝑞1 𝑧𝑧 + ⋯ + 𝑞𝑞𝑛𝑛 𝑧𝑧 = −1 𝑃𝑃(𝑧𝑧 ) 1 + 𝑝𝑝1 𝑧𝑧 −1 + ⋯ + 𝑝𝑝𝑛𝑛 𝑧𝑧 −𝑛𝑛 −1

−𝑛𝑛

𝐺𝐺𝑐𝑐_𝑃𝑃𝑃𝑃 (𝑧𝑧) =

(13)

3.2 Internal Model Control We consider that the continuous transfer function (15) was transformed to discrete region by the sampling period Ts = 0.01s.

(14) 𝐺𝐺𝑃𝑃 (𝑧𝑧) =

𝐵𝐵(𝑧𝑧 −1 ) 19.41𝑧𝑧 −2 = 𝐴𝐴(𝑧𝑧 −1 ) 1 − 0.8735𝑧𝑧 −1

(20)

Let separate the model (20) in two factors as in (3): 𝐺𝐺𝑃𝑃+ = 1;

𝐺𝐺𝑃𝑃− = 𝐺𝐺𝑃𝑃 (𝑧𝑧)

(21,22)

The next step is the choice of filter time constant τc and order of the filter Nf as it was shown in (5). Let choose the IMC filter in form of continuous transfer function (23). 𝐺𝐺𝑓𝑓 (𝑠𝑠) =

(15)

1 (0.01𝑠𝑠 + 1)2

(23)

The continuous transfer function of the filter was transformed to a discrete region by the sampling period Ts=0.01s.

where k is gain, T is time constant and D is time delay of the system. Input of the system u is voltage in range 0-12V, output y is represented with rpm (Revolutions per minute).

Regarding (4), the discrete transfer function of the IMC feedback controller is (24).

The task is to design such controller able to ensure adequate performance and stability of the closed loop.

𝐺𝐺𝑐𝑐_𝐼𝐼𝐼𝐼𝐼𝐼 (𝑧𝑧) =

The first order of the model was selected for two reasons. The first one was to show the controller design methods on simplified model. In case of the higher orders, the model behaviour was very similar. The second reason – the performance was very similar also for closed-loop under the controllers obtained by the same design methods for model with higher orders.

0.3996 − 0.349𝑧𝑧 −1 19.41 − 14.28𝑧𝑧 −1 + 2.627𝑧𝑧 −2

(24)

Using (6) we obtain classical structure of PID controller: 𝐺𝐺𝑐𝑐_𝑃𝑃𝑃𝑃𝑃𝑃 (𝑧𝑧) =

0.0206 − 0.018𝑧𝑧 −1 𝑈𝑈(𝑧𝑧) = −1 −2 1 − 0.7358𝑧𝑧 − 0.2642𝑧𝑧 𝐸𝐸(𝑧𝑧)

(25)

In Fig.8 and Fig.9 the step response of closed loop under IMC controller (25) is shown by blue colour.

3.1 PID by Magnitude Optimum Parameters of Modulus Optimum PI controller we obtained from the SYNREG toolbox in Matlab. Parameters of controller are: 𝐼𝐼 = 0.3273

(19)

In Fig.8 and Fig.9 the step response of closed loop under PI controller (18) is shown by red colour.

Controlled system represents small 12V DC motor. Motor includes encoder for speed and 1:19 gear ratio. Transfer function (15) of motor system in operating point is

𝑃𝑃 = 0.042

(18)

𝐼𝐼 𝑞𝑞1 = −𝑃𝑃 (1 − 𝑇𝑇 ) 𝑃𝑃

𝑞𝑞0 = 𝑃𝑃

3. CASE STUDY

𝑘𝑘 153.4 𝑌𝑌(𝑠𝑠) = 𝑒𝑒 −𝐷𝐷𝐷𝐷 = 𝑒𝑒 0.01𝑠𝑠 0.073292𝑠𝑠 + 1 𝑈𝑈(𝑠𝑠) 𝑇𝑇𝑇𝑇 + 1

𝑈𝑈(𝑧𝑧) 𝑞𝑞0 + 𝑞𝑞1 𝑧𝑧 −1 0.042 − 0.0387 = = 1 − 𝑧𝑧 −1 𝐸𝐸(𝑧𝑧) 1 − 𝑧𝑧 −1

where

where A(z), B(z) are process polynomials and ACH(z) is desired prescribed dynamics polynomial with prescribed poles zi.

𝐺𝐺𝑝𝑝 (𝑠𝑠) =

(17)

The discrete transfer function is in form (18):

Digital controller parameters {𝑝𝑝𝑖𝑖 , 𝑞𝑞𝑖𝑖 } are computed from following Diophantine equation 𝐴𝐴𝐶𝐶𝐶𝐶 (𝑧𝑧) = 𝐴𝐴(𝑧𝑧)𝑃𝑃(𝑧𝑧) + 𝐵𝐵(𝑧𝑧)𝑄𝑄(𝑧𝑧)

𝑈𝑈(𝑠𝑠) 𝐼𝐼 0.3273 = 𝑃𝑃 + = 0.042 + 𝐸𝐸(𝑠𝑠) 𝑠𝑠 𝑠𝑠

3.3 Pole-placement For the discrete model form of the controlled process (20) was proposed the digital pole placement controller (13).

(16)

The digital controller parameters were computed from Diophantine equation (14) by the choice of numerator (rn=1) and denominator (rd=2) orders of the controller (13).

The transfer function of the PI feedback controller is in form

ACH(z) is the desired prescribed dynamics polynomial with 4 chosen stable poles: 0.4, 0.6, 0.9, 1. The last pole was chosen to ensure steady-state. 166

IFAC ICONS 2016 June 1-3, 2016. Reims, France

Ján Cigánek et al. / IFAC-PapersOnLine 49-5 (2016) 163–168

The discrete transfer function of the pole-placement feedback controller is in form (26): 𝐺𝐺𝑐𝑐_𝑃𝑃𝑃𝑃 (𝑧𝑧) =

0.01117 − 0.009936𝑧𝑧 −1 1 − 1.0265𝑧𝑧 −1 + 0.0265𝑧𝑧 −2

the integer part and last seven bits are used for the fractional part. Fixed point arithmetic is applied throughout the control algorithm. In designing, the fixed-point arithmetic range rules must be respected. The data widths in the fixed-point arithmetic were designed that there is no possibility of an overflow. For example, the result of summation or subtraction of two 12-bit vectors has range 13-bit.

(26)

In Fig.8 and Fig.9 the step response of closed loop under Pole-placement controller (26) is shown by green colour. 3.4 Implementation of control algorithms

REG

q1

Recursive form of discrete PI algorithm is expressed from discrete transfer form (18) by the following equation:

e(k-1)

p2

(27)

For implementation of control law (27) for FPGA is necessary to decompose equation into simple arithmetic operations:

REG u(k-1)

Sign bit

REG

q0

(29)

*

add

+

sub s1

-

s2

Bounder 0-12V

REG

sub

+

-

mult

add

*

+

Bounder 0-12V

u(k)

*

00010.1110000(2) = 2.875(10) Fractional part

In the case of parallel design of control algorithms, the control output after last summation (resp. subtraction) has range more than 12-bit. It must be used a bounder block to ensure of range (-12 V to 0V) for 12bit. Bounder is the value limitation logic that keeps the output in the defined range. Bounded signal is latched at register, thus becomes u(k−1) of next cycle. In this way the anti-windup protection is also ensured. Before the hardware implementation the control algorithmsare verified of software Matlab-Simulink. SystemGenerator toolbox ensures that between the blocks gateway in and gateway out algorithm performs as it was implemented on FPGA. We have created the VHDL code for each method separately. This code is used in the resulting hardware solutions to. The VHDL code is developed in Xilinx Vivado. For the implementation of fixed point arithmetic in VHDL code there is used package ieee_proposed.fixed_pkg (Bishop, 2010). Simulation of VHDL code is possible using Xilinx black box block (in System Generator Toolbox). Simulation results are shown in Fig.8. The simulation scheme (Fig.7) is identical for all methods.

u(k)

mult u(k-1)

Fig. 4. Parallel design of digital PI algorithm

Recursive form (30) of IMC and pole-placement controller (Fig.5) is expressed from discrete transfer form (25, 26). Structure of IMC and Pole-placement controller is the same. 𝑢𝑢(𝑘𝑘) = 𝑞𝑞0 𝑒𝑒(𝑘𝑘) + 𝑞𝑞1 𝑒𝑒(𝑘𝑘 − 1) − 𝑝𝑝1 𝑢𝑢(𝑘𝑘 − 1) − 𝑝𝑝2 𝑢𝑢(𝑘𝑘 − 2)

add

*

Fig. 6. Fixed-point control output

* mult

mult

Integer part

mult

e(k)

*

Fig. 5. Parallel design of digital IMC and Pole-Placement algorithm

In this paper, the parallel design of control algorithmsis used, which means that each of the operation has its own arithmetic unit, either accumulator or multiplier (Cigánek, Kocúr and Kozák, 2015). Parallel design of digital PI algorithm is shown in Fig 4. e(k-1)

u(k-2) p1

mult

mult

𝑞𝑞0𝑒𝑒0 = 𝑞𝑞0 ∗ 𝑒𝑒(𝑘𝑘) 𝑞𝑞1𝑒𝑒1 = 𝑞𝑞1 ∗ 𝑒𝑒(𝑘𝑘 − 1) (28) 𝑠𝑠1 = 𝑞𝑞0𝑒𝑒0 + 𝑞𝑞1𝑒𝑒1 𝑠𝑠2 = 𝑠𝑠1 − 𝑢𝑢(𝑘𝑘 − 1) Control output u is bounded in the range from umin to umax. u max  if s 2  u max  u k   s 2  if u min  s 2  u max  u min  if s 2  u min 

q0

e(k)

REG

𝑢𝑢(𝑘𝑘) = 𝑞𝑞0 𝑒𝑒(𝑘𝑘) + 𝑞𝑞1 𝑒𝑒(𝑘𝑘 − 1) − 𝑢𝑢(𝑘𝑘 − 1)

167

(30)

Input range is -2048 to 2047 rpm, because of the 12bit signed data type. Output of the controller is represented withvolts. In signed binary representations the maximum control output is 12(10) V = 01100(2) and the minimum is 0. We can write this range into 5 bits. Real numbers are useful for better quantization of the control output. For implementation of the real numbers it has been used fixed point arithmetic (Bishop, 2010). As we can see in Figure 2 first (MSB) bit of output vectors is reserved for a sign. Next four bits are reserved for

Fig. 7. Schematic of control circuit using Xilinx blocks 167

IFAC ICONS 2016 168 June 1-3, 2016. Reims, France

Ján Cigánek et al. / IFAC-PapersOnLine 49-5 (2016) 163–168

4. RESULTS

types of dynamical system, e.g. strong oscillating systems, unstable systems, systems with transport delay, because its proposal is based on compensation of all unstable parts of the system model.

For verification of the FGPA implementation of the digital controllers we realized a practical experiment. In simulation with Xilinx blocks we made step of reference signal at 0.01s form 300 rpm to 400 rpm for all controllers. Results of simulation are shown in Fig. 8.

The realization and comparison of this methods were applied for several orders of mathematical models. Obtained results confirm for each example good possibilities for realization using FPGA. A control performance of all control approaches was evaluated by overshoot, regulation time and ITSE (integral of the time multiplied square error) criterion. The comparison of results are shown in Tab. 1. New development of FPGA realization control algorithms is oriented to the parallelization of individual PID (Kocúr, Kozák and Dvorščák, 2014), predictive and soft-computing methods. Direct application of this methods to the industry offers the possibilities of performance improvement for the processes with fast dynamics.

Fig. 8. Comparison of the simulated closed-loop time responses

ACKNOWLEDGEMENT

The same VHDL code of controllers was used also for hardware realization to control real DC-motor. The graphical results are shown in Fig. 9.

This work was supported by the Scientific Grants APVV 0772-12 and KEGA 030STU-4/2015. REFERENCES Åström, K. and Hägglund, T. (1995). PID controllers. Research Triangle Park, N.C.: International Society for Measurement and Control. Baotić, M., Borrelli, F., Bemporad, A. and Morari, M. (2008). Efficient On-Line Computation of Constrained Optimal Control. SIAM Journal on Control and Optimization, 47(5), 2470-2489. Bishop, D. (2010). Fixed point package user’s guide. Packages and bodies for the IEEE, 1076-2008. Brosilow, C. and Joseph, B. (2002). Techniques of modelbased control. Upper Saddle River, N.J.: Prentice Hall. Cigánek, J., Kocúr, M. and Kozák, Š. (2015). FPGA as a tool for hardware realization of feedback control. Journal of Electrical Systems and Information Technology, 2(3), 328-337. Cigánek, J., Noge, F. and Kozák, Š. (2015). Advanced Methods of Controller Design for Pneumatic Servodrives. In: 20th International Conference on Methods and Models in Automation and Robotics. IEEE, 87-92. Cutle, C. and Ramaker, B. (1979). Dynamic matrix control – a computer control algorithm. In: AlChE 86th National Meeting. Kocúr, M., Kozák, Š. and Dvorščák, B. (2014). Design and implementation of FPGA - digital based PID controller. In: 15th International Carpathian Control Conference ICCC. IEEE- Czechoslovakia Section of IEEE, 233-236. Morari, M. and Zafiriou, E. (1989). Robust process control. Englewood Cliffs, N.J.: Prentice Hall. Seshagiri Rao, A., Rao, V. and Chidambaram, M. (2009). Direct synthesis-based controller design for integrating processes with time delay. Journal of the Franklin Institute, 346(1), 38-56.

Fig. 9. Comparison of the realized closed-loop time responses

Realization

Simulation

Table 1. Comparison criteria

Type of controller

Overshoot [%]

Control time [s]

Criterion ITSE

PI

23%

0,11

2657

P-P

0%

0,22

3888

IMC

0%

0,06

2432

PI

11%

0,48

4860

P-P

9,10%

0,96

13278

IMC

7,30%

0,64

5748

5. CONCLUSIONS In this paper, three different control techniques are applied, compared and tested for the DC motor. The focus is based on the IMC method which can effectively control many various 168