Embedded Explicit Model Predictive Vibration Control

Embedded Explicit Model Predictive Vibration Control Gergely Takácsa,∗, Gabriel Batistaa , Martin Gulana , Boris Rohaľ-Ilkiva a Institute of Automati...
Author: Elvin Nicholson
1 downloads 0 Views 775KB Size
Embedded Explicit Model Predictive Vibration Control Gergely Takácsa,∗, Gabriel Batistaa , Martin Gulana , Boris Rohaľ-Ilkiva a Institute

of Automation, Measurement and Applied Informatics Faculty of Mechanical Engineering Slovak University of Technology in Bratislava Nám. slobody 17; 812 31 Bratislava; Slovakia

Abstract This article presents an embedded active vibration suppression system featuring real-time explicit model predictive control (EMPC) that is implemented on a microcontroller unit (MCU). The EMPC controller minimizes the tip deflection of an aluminum cantilever beam driven by piezoceramic actuators, gaining its feedback from direct position measurements. The output and input performance of the EMPC method is compared to an analogously tuned positive position feedback (PPF) controller. An extensive analysis is provided on the cycle timing and memory needs of the explicit predictive vibration control scheme. The results demonstrate that the EMPC controller may achieve the same vibration suppression results compared to PPF with less input effort, while inherently respecting process constraints. Furthermore, we show that EMPC task execution timing is comparable in the random access memory (RAM) and read only memory (ROM) alternatives, suggesting that numerous current microcontrollers are suitable for EMPC-based active vibration control, in case the prediction model is kept simple. Keywords: vibration control, model predictive control, explicit solution, parametric programming, embedded systems, microcontroller unit 2010 MSC: 74H45, 70Q05, 49J15, 93C83

∗ Corresponding

author Email address: [email protected] (Gergely Takács)

Preprint submitted to Mechatronics

February 18, 2016

1. Introduction A couple of decades have passed after the first academic studies on active vibration control (AVC) appeared in the literature [17]. By now, the technology has been embraced by a spectrum of real-life applications, ranging from 5

active rotor blades in helicopters [5], through advanced automotive suspensions [18] and even medical devices for those suffering from Parkinson’s disease [35]. This exciting technology transfer can be partly attributed to the ever developing range of actuators available in the market and, more importantly, to the constantly falling price of microcontroller units (MCU) as well [8]. Machines

10

are getting faster to satisfy consumer needs and becoming thinner to maximize profits by cutting back material use. This trend often leads to structures that are vibration prone and may benefit from the use of active vibration control. This time, instead of actuators or mechanisms, our attention will be focused on the algorithms that drive active vibration suppression systems and their imple-

15

mentation on inexpensive embedded computing platforms. There are several well-known control algorithms routinely used in active vibration control. The de-facto standard amongst AVC algorithms is the positive position feedback (PPF) controller that is related to the proportional-integralderivative (PID) controller very closely [10]. Common methods known from

20

control theory are often featured, such as pole-placement (eigenvalue assignment) [27], linear quadratic (LQ) control [18] and others. As for the more exotic approaches, soft computing methods like genetic algorithms or neural networks may hold a great promise for active vibration control in the future, however, their use is at the moment mostly limited to simulation studies or

25

off-line parameter tuning [6]. The technique known as model predictive control (MPC) or receding-horizon control (RHC) has been actively sought out by industry for the past thirty years and its formulation is regarded to be one of the fundamental developments in control engineering [30, 21, 12]. Its advantages compared to traditional control

30

engineering approaches are widely acclaimed and are twofold: it may provide

2

an increased control performance in most applications and it inherently handles process constraints [25]. In fact, MPC is often referred to as the only control approach that may explicitly handle the constraints that are present in every real-life system [23]. These constraints represent the natural limitations of actu35

ators at the input side, but may also express economic, safety or other bounding factors [33]. Thus, the typical contemporary model predictive control algorithm uses a linear quadratic cost function to quantify controller performance over and beyond the horizon using a state-space model, which is then minimized subject to the aforementioned constraints in real time by quadratic program-

40

ming (QP). Consequently, the improvement in performance and the constraint handling feature are not without a price: model predictive control is computationally intensive and its application has been limited to systems with slow dynamics, such as the ones encountered in the petrochemical industry. In light of the computational complexity of MPC, it is no wonder that active

45

vibration control with its typically fast sampling times is not a common field of application. Most academic studies focus on legacy formulations, like generalized matrix control (GMC) or dynamic matrix control (DMC) that do not include or handle constraints explicitly [34], while other studies feature bulky and expensive computing platforms to implement model predictive control for

50

AVC [26]. Thus, in order to use model predictive vibration control in real-life applications, we shall concentrate on up-to-date formulations used in combination with embedded computing solutions that are suitable for mass production, miniaturization and product integration. One of the few examples of using MPC in AVC on a microprocessor is a digital signal processing (DSP) chip implemen-

55

tation that is described by Wills et al. in [39, 40]. The authors achieved high sampling speeds with the original optimal MPC formulation, albeit with a work intensive manual transcription of the algorithm into a customized code-efficient machine code formulation. Besides the question of using the right computing hardware, researchers have

60

recently invested a great deal of effort into modifying the formulation of model predictive control, in order to make it computationally more efficient. There are 3

efficient MPC approaches that sacrifice the controller performance to limit its computational needs, creating so-called sub-optimal predictive controller formulations [19, 38]. The other main class of efficient MPC formulations preserves 65

the optimality of the problem, while still removing some of the burden of solving the task in real time [11]. The best known representative formulation of the latter class rests on the idea of transferring the computational complexity from on-line control into off-line, and is called multi-parametric MPC (MPMPC) or explicit MPC (EMPC) [3, 2].

70

In EMPC, the optimization problem is essentially solved using parametric programming beforehand, formulating the MPC control problem as a set of regions in state space to which linear control laws are assigned. Instead of solving a quadratic programming problem in each sample, the microprocessor needs to find the region to which the currently observed state belongs to, then evaluate

75

a linear control law that is not much more complicated than LQ control. This, of course, means that the computational burden is now transferred from processor speed into memory requirements. Although modern microprocessors—also known as microcontrollers or system on a chip (SoC) systems—have increased their power for a unit price, a traditional quadratic optimization-based MPC

80

(QPMPC) is still thought to be prohibitive for AVC because of direct execution speed requirements, while EMPC because of its memory needs. Niederberger used a clever idea to turn an EMPC controller computed for a vibration suppression problem into a completely electronic system, instead of using the real-time algorithm of the EMPC formulation [28]. Although this is an interesting con-

85

cept, it cannot be considered as a true real-time application of explicit MPC in vibration control, as it only emulates the behavior of the EMPC control law approximating its structure using electronic components. Previously an EMPC active vibration suppression scheme was demonstrated experimentally and in real time, however, only using a personal computer-based prototyping system

90

[36, 37]. Up to now—according to the knowledge of the authors—explicit model predictive control has not been utilized for active vibration suppression using a cost-efficient miniaturized embedded microcontroller that would be suitable for 4

mass production and close system integration. This article presents a real-time application of explicit model predictive con95

trol for active vibration suppression, using a 32-bit embedded microcontroller unit. The purpose of the AVC system is to minimize the tip deflections of an aluminum cantilever beam, by supplying the input decisions of the EMPC algorithm to the piezoceramic actuators in the form of a driving voltage. The EMPC algorithm is running stand-alone and real-time on the microcontroller,

100

gaining its feedback from position measurements and supplying input to the AVC system via an operational amplifier. The proposed control scheme is evaluated by release tests and its performance and timing properties are compared to the open-loop case without control as well as PPF control. An extensive computation speed and memory requirement study is performed on the micro-

105

controller, to evaluate the possibilities of increasing sampling speeds for stiffer structures or to use even lower-priced and smaller microcontrollers for the same class of flexible mechanical systems. It is also important to note what is not in the ambition and scope of this article. In Sect. 2.1 we begin with the assumption that the dynamics of the

110

beam may be represented by a single degree of freedom (SDOF) model. This is an essential premise to this work, as it is unlikely that complex prediction models are feasible to implement on relatively simple embedded hardware, like the one used here [23, 38]. Although by using embedded computing devices with large memory footprints one may be able to utilize EMPC for the vibration

115

control of up to 2–3 resonant modes or multiple-input multiple-output systems, it is unreasonable to expect a complex electro-mechanical model derived from a finite element model (FEM) to be viable on current hardware. Even though we present a performance comparison between EMPC and PPF to provide a baseline for the reader, it is not our aim to prove the superiority

120

of constrained model predictive algorithms against other methods employing saturation only. The performance advantage of constrained MPC compared to saturated control has been extensively studied by others in the past using fundamental mathematical, numerical and experimental comparisons [24, 23, 5

31, 36].

125

2. Controller design 2.1. Modeling Let us assume that the dynamic behavior of the beam is dominated by its first resonant frequency [7]. Moreover, let us represent the beam by a single degree of freedom point mass-spring-damper with an outside driving force. This

130

elementary assumption may under-represent the beam dynamics from a mechanical viewpoint, however, one cannot utilize elaborate mechanical models in on-line optimization procedures such as MPC, since the controller will be infeasible to implement in real time [36, 37]. Keeping this in perspective, the simple SDOF system assumed in this work models the dynamics of thin flexible can-

135

tilevers adequately. The SDOF mass-spring-damper with a linear driving force may be described by m¨ q (t) + bq(t) ˙ + kq(t) = F (t), where m (kg) is the mass, b (Nsm−1 ) the viscous damping and k (Nm−1 ) is the stiffness of the equivalent model. The position output is denoted by q(t) (m), while the force input can be expressed by the force exerted by the piezoceramic actuators F (t) = cm u(t)

140

(N), where u(t) (V) is the driving voltage, and cm (NV−1 ) is the mass-specific force conversion constant. The equation of motion of the SDOF system will yield the following continuous state-space model x(t) ˙ = y(t) =



0



  0  x(t) +   u(t) −2ζω c 1

 −ω 2 h i 0 1 x(t),

(1) (2)

where ω (rads−1 ) is the undamped angular frequency of the beam, ζ (-) is the 145

damping ratio and c (NV−1 m−1 ) is the conversion constant expressing the force generated by the actuators for a unit voltage and mass. The driven beam was identified using a pseudo-random binary signal (PRBS), supplied to the actuating elements for 100 s. The input was changed to kV in 6

order to make the computation of the controller numerically more reliable. Us150

ing a grey-box prediction error method (PEM) system identification procedure [22], the unknown parameters were identified as ω = 50.89 rads−1 (8.10 Hz), ζ = 0.005 (-) and c = 5.91 NkV−1 kg−1 . 2.2. Explicit model predictive control As outlined in the previous section, we consider the control of a linear state-

155

space system (1)–(2) that is discretized with a sample time of Ts = 0.01 s [13] given by x(t + 1) = Ad x(t) + Bd u(t), where t denotes multiplies of the sampling period Ts , pair (Ad , Bd ) is controllable. The SDOF system is required to satisfy the input constraints u(t) ∈ U, ∀t ∈ N, where the set U contains the origin in

its interior.

We may now formulate the following constrained finite-horizon optimal control problem: N −1 X

 T xk Qxk + ru2k + xTN PxN

(3a)

s.t. xk+1 = Ad xk + Bd uk , k = 0, . . . , N − 1,

(3b)

min U

k=0

uk ∈ U, k = 0, . . . , N − 1, 160

(3c)

where xk and uk denote, respectively, the state and input predictions over a finite horizon N ∈ N at time instant t + k, initialized by the current state, i.e.

x0 = x(t). Within the quadratic objective (3a), the stage costs are weighted with Q  0, r > 0, while the terminal penalty uses P  0, usually determined as the

solution of the discrete algebraic Ricatti equation for the unconstrained problem

165

(3a). Solving the optimal control problem (3) for a feasible initial condition  x(t) yields the sequence of optimal control moves U∗ = u∗0 , . . . , u∗N −1 . The

receding horizon MPC feedback hence becomes u∗0 , which is actually supplied

to the controlled system and the procedure is repeated at the next sampling instant for the new measured or estimated state. In view of the problem addressed in this work and the inherent practical aspects discussed in the introduction, we will focus on the explicit representation 7

of the solution of the optimization problem (3), u∗0 , rather than its considerably more expensive computation in an implicit fashion outlined above. As shown e.g. by Bemporad et al. [4], this can be achieved by recasting and solving Eq. (3) as a parametric quadratic program using the technique of parametric programming, which allows us to pre-compute the MPC feedback law u∗0 for all feasible values of x0 = x(t) explicitly, as a continuous and piecewise affine (PWA) function in the form

u∗0 = κ(x0 ) :=

   f1 x0 + g1   

    f x + g R 0 R

if x0 ∈ R1 .. .

(4)

if x0 ∈ RR ,

defined over R polytopic regions Ri in the state space, defined as bounded convex intersections of finitely many affine half-spaces, that is  Ri := x | Rxi x ≤ r0i . 170

(5)

Denoting the set of feasible initial conditions as Ω, the collection of regions R

{Ri }i=1 is referred to as a partition of Ω. It is clear from the nature of the problem that the explicit solution can be computed off-line. The on-line im-

plementation effort hence reduces to a simple function evaluation, as per (4), where the most computation time is typically spent on the so-called point lo175

cation task. This procedure determines the region Ri which the current measured or estimated state resides in, by checking its defining inequalities (5).

A generic way for searching the state-space partition is the sequential region traversal procedure with the runtime complexity proportional to the number of regions, which is also assumed in the implementation proposed in this study. 180

Another crucial practical aspect associated with explicit MPC controllers is the amount of memory required to store the function κ(·), which consists of polytopes Ri and feedback gains fi , gi . Both of the aforementioned indicators of computational requirements are of an immense practical importance, namely

in case of deployment on embedded control hardware. These aspects have re185

cently gained attention, resulting in works proposing the complexity reduction 8

of explicit MPC [1]. Therefore, the memory requirement and on-line computational effort are quantified via a detailed analysis in Section 4, for the proposed real-time embedded EMPC implementation. We remark that persistent feasibility and stability of the receding horizon 190

control law may be guaranteed by utilizing an appropriately designed invariant terminal set within the problem formulation (3). This property is, however, not in the scope of this work since it necessitates longer control horizons in order to keep the region of attraction large enough for a meaningful implementation. This, in turn, markedly increases the complexity of the explicit representation,

195

which makes its deployment intractable in terms of both memory and on-line evaluation requirements, as shown later in the study. 2.3. Positive position feedback The positive position feedback controller may be considered as industry standard in numerous vibration control applications. Here, it serves to evaluate the

200

performance of the EMPC algorithm, providing a comparison baseline in terms of performance and execution efficiency. One must not forget that constraints enforced by simple saturation limits as in PPF are not the same as inherent constraint handling in optimization-based algorithms. The PPF controller can be formulated as [14] q¨(t) + 2ξp ωp q(t) ˙ + ωp2 q(t) = √ g 2 u(t) = ω q(t), c p

205

√ g

(6) (7)

where ωp is the natural frequency, ξp is the damping ratio and g is the controller gain. The rest of the variables are as defined earlier in Sect. 2.1. The parameters of the PPF controller are tuneable and, naturally, the performance of the vibration control system depends on this tuning choice. Comparing the PPF controller to EMPC with arbitrary tuning is pointless, therefore, the

210

procedure laid out by Frisswell and Inman was used to relate the PPF controller tuning to LQ control [14]. Because LQ control can be interpreted as infinite-

9

horizon model predictive control without constraints, a fair comparison between the two diametrically different control algorithms is ensured.

3. Experimental implementation 215

The actively controlled mechanical structure is represented by a fixed-free cantilever beam, measuring 550×40×3 mm and made of commercially pure aluminum. The beam is actuated by a pair of MIDÉ QuickPack 16n piezoceramic transducers connected to a MIDÉ EL-1225 capacitive amplifier in counter-phase mode. This amplifier obtains its input from an Advantech ADAM 3014 signal

220

processor, producing a bipolar voltage between the ±5 V range. The input

chain ends with a Texas Instruments TLC2272CP operational amplifier, which

amplifies the unipolar 0–3 V range to 0–5 V for the signal processor. The deformation of the beam is measured at the free end by a Keyence LG-G 82 laser triangulation head, connected to a Keyence LK-G3001V central processing unit. 225

The simplified schematic diagram of the experimental setup is shown in Fig. 1. One may notice that the active vibration control system involves an actuator and a sensor in the so-called non-collocated configuration [29], meaning they do not relate to the same degree of freedom as we are explicitly interested in the structural response of the beam tip. The associated non-minimum phase

230

dynamic behaviour traditionally presents a difficulty in controller design. This phenomenon is, however, fairly diminished here due to the lightly damped nature of the structure, contributed by the dominant role of piezoelectric loads. From a pure control viewpoint, ability of dealing with non-minimum phase systems is one of numerous features that render MPC interesting. It is known that an

235

appropriate choice of the tuning parameters, in particular the horizon length, helps to avoid instability problems and maintain a robust performance in such cases [9]. The ST Microelectronics STM32F407VGT6 microcontroller is a 32-bit embedded computing device with an ARM Cortex-M architecture. This particular

240

microcontroller comes with 1024 kB flash read only memory (ROM), 192 kB

10

Laser Laser CPU head

Base Piezoceramic actuators

Aluminum beam

Position measurement

Power amplifier

Stinger mechanism

RT control PA3 Advantech ADAM3030

PA4

STM32 F407VGT6 Timing

Signal processor Input

PC with Simulink RT

USB

Programming

PC with Matlab / Simulink

PA7 LAN

PC with Matlab / Simulink

Output

Data logging and experiment control

Figure 1: Schematic representation of the experimental system

random access memory (RAM), is clocked to a maximum of 168 MHz and offers a range of standard peripheral connections. The microcontroller used in the experiment is embedded into a ST Microelectronics Discovery F4-series prototype evaluation board, allowing convenient programming and peripheral access in a 245

laboratory setting (see Fig. 2). Position output, voltage input and execution times were logged independently using the Simulink Real Time control software prototyping suite. In addition to data logging, the prototyping system was also producing the outside disturbance signal for the structure. The experiments introduced in this work

250

use release-tests, which emulate transient vibration behavior often encountered in aerospace structures [32]. In this hardware setup, the beam was deformed using a linear electromagnetic motor—a stinger-mechanism (see Fig. 1). The primary C initialization code for the microcontroller was developed using the ST Microelectronics CubeMX software suite. The controller algorithm was

255

developed in Matlab version 8.3 (R2014a) with Simulink 8.3, using the automatic code generation features of the software suite. The Simulink block scheme used the STM32-MAT/TARGET version 3.0, an STM32 embedded target for Matlab

11

PA7 - Timing t(k)

PA4 - Output u(k) PA3 - Position y(k)

Power, programming

32-bit ARM Cortex-M4F core microcontroller unit

In-circuit debugger and programmer

Figure 2: Prototyping board with the 32-bit microprocessor.

and Simulink to access peripheral configuration files, the analog input port and the analog output port. The unnecessary DC component of the position reading 260

is removed using an 8-th order linear buffer finite impulse response (FIR) filter, then passed into a Kalman Filter algorithm block; where the process noise h i covariance is set to Qf = diag 1 1 , measurement noise to Rf = 1E-4 and the estimation model is identical to the prediction model. These state estimates are used in the EMPC controller algorithmic block,

265

which is a custom S-Function representing the on-line part of the EMPC algorithm. The Multi-Parametric Toolbox for Matlab (version 3.0) [16] was used to automatically generate the controller regions and the associated control laws. The controller was generated with a Ts = 0.01 sampling, a Q = C T C state penalty matrix and a r = 1E-4 input penalty. Constraints were enforced only

270

on the input, constraining the voltage to the polarization limits of ul = −0.1 kV

and uh = 0.1 kV (±100 V). The predictive controller assumed a quadratic cost function and an LQ terminal weight, however, did not implement a terminal set to guarantee stability and constraint feasibility recursively. The piecewise-affine representation of the optimal control input u(k) is shown

275

for the partitions related to the respective position x1 (k) and velocity x2 (k)

12

u (V)

0.1 0 −0.1 1 4

x 10

0 −1 x2 (ms )

−100

−1

0

100 x1 (m)

Figure 3: PWA representation of optimal u(k)

coordinates in Fig. 3. The saturated character of the controller is evident from Fig. 3, where a small and steep transition area is surrounded by the rest of the state space simply switching between the two constraints. In fact, this may suggest an excellent potential to apply complexity reduction techniques e.g. 280

[20, 15]. In order to ensure a fair comparison between the PPF controller and the EMPC algorithm, the procedure outlined in Sect. 2.3 was used to set the tuneable PPF parameters, in a manner such that the two types of controllers have near-identical output performance.

285

4. Experimental results and discussion The release test was performed at 10 s intervals, activating the stinger for 0.5 s at the beginning of each cycle. The experiment lasted 100 s, that is, 10 tests. Sampling time was set to Ts = 0.01 s for each experimental scenario. 4.1. Damping performance

290

A detailed portion of a typical release test is shown in Fig. 4. The stinger pushes the end of the beam to its initial position of y ≈ 8 mm then suddenly

retracts, leaving the beam to vibrate freely with or without control. In closed loop, both the EMPC and PPF controllers increase the damping significantly, governing the tip near its equilibrium position in 1.5 s time (Fig. 4(a)). Com-

295

pared to the full length open loop response, the structure settles about 10 times 13

faster. Thanks to the analogous tuning procedure of Friswell and Inman [14], the response of the EMPC and saturated PPF controllers is almost undistin-

Position (mm)

guishable. Free

10

PPF

5

EMPC

0 −5 0

0.5

1

1.5 Time (s)

2

2.5

3

2.5

3

2.5

3

(a) Position measured at the end

Input (V)

100

0

−100

0

0.5

1

1.5 Time (s)

2

(b) Input to the piezoactuators

TET (s)

x 10

−3

1 0.5 0

0

0.5

1

1.5 Time (s)

2

(c) Task execution timing Figure 4: Detail of a typical release test showing measured position, input to the actuators and task execution timing.

The difference between the behavior of the controllers is more straightfor300

ward in Fig. 4(b), showing the voltage input supplied to the piezoceramic actuators. While both controllers ensure that the inputs remain within the prescribed constraints1 , the difference between simple saturation and implicit 1 Somewhat

smaller than ±100 V only due to the imprecisions of the analog signal process-

14

constraint handling presents itself in the responses. Given the equal output damping response, PPF needs more effort to drive the system to the same po305

sition as EMPC. Despite the relative computational efficiency of EMPC in comparison with traditional MPC formulations, this method is still much more demanding than PPF. The typical task execution time is shown for all scenarios in Fig. 4(c). The algorithm implementation remains the same in case PPF is used, except

310

that the Kalman filter is removed and the controller is substituted for PPF. The average computational time on the given embedded hardware is ≈ 40 µs

for PPF, while an EMPC controller with a N = 10 steps long horizon produces maximal execution times of ≈ 1.1 ms (≈ 1100 µs) and averages near ≈ 0.9 ms.

The fluctuation of the measured execution time in case of the EMPC controller

315

is due to the direct sequential search algorithm used to associate the estimated states with the controller regions. Change in the TET correlates to the saturated regions of the controller, simply showing how many regions the on-line EMPC algorithm must search through in order to find the correct one. Even though PPF computes almost 30 times faster than EMPC, the exe-

320

cution times for the predictive algorithm are still impressive, given its complex nature. The headroom of execution time compared to the sampling time suggests several possibilities for EMPC in vibration control: structures with faster modes may be controlled on the same hardware but with faster sampling, more complex models may be used on the same hardware and sampling or simpler

325

and lower-priced hardware implementation may be chosen for a similar problem. Another possible way to represent the difference between the controllers is to indicate the root of the sum of squares (RSS) for the error in the output

330

and the input. The output error is the difference between the reference and pP (r(k) − y(k))2 , which for zero reference is the measured position RSSy = pP given as RSSy = (y(k))2 . Similarly, the less input is used to achieve the pP (u(k))2 . The desired reference, the better the control is, therefore, RSSu = ing circuit.

15

Output (mm)

Input (V)

Output (%)

Input (%) 100.0*

EMPC:

199.2

3130

100.0*

PPF:

199.4

3269

100.1

104.4

Free:

303.0

N/A

152.1

N/A

Table 1: Controller performance comparison (* — baseline value).

comparison of these indicators is listed in Table 1, where the output and input RSS is taken as the baseline, against which PPF and the open loop system is compared. Due to the analogous tuning, there is no significant difference 335

between the output of the two controllers, while both perform 50% better than the uncontrolled structure. As it was noted earlier, PPC requires more input to achieve a given level of damping performance because of the inherent differences in constraint handling. The remaining root of the sum of squares (RRSS) can be then plotted in

340

time, to illustrate output and input performance [37]. The RRSS criterion may be defined as v v u Tf u k uX uX t 2 y −t y2, RRSS(k) = i

i=0

i

(8)

i=0

where the first part of the equation denotes the total RSS, while the second part denotes the remainder until the end of the experiment. The criterion is similarly formulated for the inputs as well. The performance of the output and input is 345

shown in Fig. 5. The output error in Fig. 5(a) shows practically no difference for EMPC and PPF, but demonstrates the increased damping in contrast to the open loop case. The PPF controller needs a more aggressive course of inputs to achieve the same results, as is demonstrated in Fig. 5(b). 4.2. Memory requirements and timing efficiency

350

The EMPC algorithm was tested in different implementation variants, in order to assess its memory requirements and computational efficiency for a range of prediction horizons. The EMPC algorithm has a considerable advantage in execution speed when we compare it with quadratic programming-based MPC, 16

250

2500 EMPC PPF Free

2000 RRSS (V)

RRSS (mm)

200 150 100 50 0

1500 1000 500

0

50 Time (s)

0

100

(a) RRSS for output

0

50 Time (s)

100

(b) RRSS for input

Figure 5: RRSS performance indicator comparison

however, it requires extensive memory space to store the pre-computed state355

space regions and the corresponding linear control laws. In the default configuration of the Multi-Parametric Toolbox for Matlab, the storage matrices for the regions and control laws are accessed from the random access memory. The advantage is a theoretical speed increase in access times, compared to storing them in read-only memory.

360

First, let us investigate the memory needs of the controller for different horizons, given that the look-up tables are stored in the volatile RAM. Table 2 shows the horizon and the corresponding region count for each case, and the linker estimated memory requirements. The non-volatile ROM essentially denotes the read-only flash memory of the microcontroller, consisting of the sum

365

of the executable code (“CODE”) and read-only variables (“CONST”). The readwrite RAM contains the EMPC look-up tables, and is marked as (“DATA”) in the table. Out of the total 192 kB of RAM in the STM32F407VGT6 microcontroller, the 112 kB + 16 kB SRAM is accessible, the rest is a normally reserved. Naturally, an EMPC controller implemented directly to RAM must fit inside

370

these two regions, that is, must be less than 128 kB. The table clearly shows that, given the second order model on this microcontroller, the largest possible prediction horizon one may use is N = 11 steps with 249 regions, while adding 17

Horizon:

1

2

3

4

5

6

7

Region

5

11

23

37

57

79

105 135 169 207 249 295

CODE (kB)

11

11

11

11

11

11

11

CONST (kB)

1

1

2

4

6

9

13

18

23

30

37

ROM (kB)

12

12

14

15

18

21

24

29

35

41

49

DATA (kB)

11

13

16

20

26

34

39

57

72

91

113 139

tmax (µs)

114 165 256 362 511 669 785 892 986 1100 1237

tavg (µs)

106 136 193 253 336 422 523 644 771 926 1121

tstd (µs)

6

11

19

29

40

52

57

8

11

61

9

11

61

10

11

62

11

12

11

59

Table 2: Controller size and task execution times for direct RAM implementation

one more step will result in RAM requirements exceeding the available space. The table also lists the maximal task execution times along with average val375

ues and the standard deviation from these times. As it is clearly visible, given the processing power of the microcontroller, there is enormous headroom for execution time, resulting in maximal TET under 1.3 ms. The complexity of the controller—either because of a different model or longer horizon—is therefore limited by the available RAM, not the execution

380

speed. In case a nominal controller is assumed, the EMPC look-up tables are permanent. Except for a theoretical decrease in access speeds, there is no good reason to store them in the read-write memory. A slight change in the autogenerated C language code of the MPT Toolbox instructs the linker to place the regions and controllers to the read-only memory, which is larger than RAM in

385

most microcontrollers available on the market. The limiting factor in this case is then the size of the flash memory. Table 3 shows the results of a similar test as before, but now with the EMPC controller stored in the flash memory. This time, the read-only variable memory (“CONST”) includes the look-up tables as well, which together with

390

the executable code (“CODE”) are stored in the ROM. The limit for this case is a horizon of 25 steps with 1257 regions, using up the available 1024 kB flash memory almost entirely. Similarly to the previous case, by increasing the prediction horizon by one step (1359 regions), the memory requirements exceed

18

Horizon:

1

2

3

4

5

6

7

8

Region

5

11

23

37

57

79

105 135 169 207 249 295 345

CODE (kB)

11

12

14

16

14

15

14

CONST (kB)

0

0

1

4

12

18

30

42

56

ROM (kB)

11

12

15

19

26

34

44

56

72

tmax (µs)

115 166 257 365 515 667 771 904 1020 1122 1229 1402 1608

15

9

16

10

17

11

12

13

19

20

22

73

94

118 146

91

113 139 168

tavg (µs)

108 137 194 256 339 425 529 652 788 943 1113 1297 1493

tstd (µs)

6

11

17

30

40

50

57

55

64

62

59

61

72

Horizon: (cont.)

14

15

16

17

18

19

20

21

22

23

24

25

26

Region

399 457 519 585 655 729 807 889 975 1065 1159 1257 1359

CODE (kB)

24

CONST (kB)

178 215 256 302 354 411 473 542 648 733 825 924 1031

26

28

31

33

36

38

41

14

14

14

15

15

ROM (kB)

202 241 284 333 387 446 512 584 662 747 839 939 1046

tmax (µs)

1916 2241 2607 2979 3380 3673 3941 4238 4526 4700 4991 5425

tavg (µs)

1711 1933 2175 2428 2712 2969 3282 3574 3937 4281 4637 5004

tstd (µs)

49

113 135 158 178 193 205 210 215 141 236 250

Table 3: Controller size and task execution times for ROM implementation

the possibilities of the given microcontroller. Execution times at the boundary 395

were less than 5.5 ms, indicating a large reserve for higher sampling speeds or decreasing processor clock speed, either to use a lower-priced variant or to save power. The “DATA” or in other words the read-write row is omitted from the table, as it was precisely the same value of under 9 kB for all cases. Figure 6 illustrates some of the commonly available 32-bit microcontroller

400

types (distinguished by different colors), with the size of the built-in flash memory on the horizontal axis and the size of the built in flash memory on the vertical axis.The detail of this figure is shown in Fig. 6(b). Both of the implementation variants are shown, while the numerical annotation near the data points is referring to the horizon length. A fairly commonly used N = 10 step

405

horizon would require a microcontroller with 96 kB of flash in the case of the direct RAM implementation, with a rapidly growing outlook for more controller regions. This would presumably require a higher-end model with a large builtin RAM and with flash memory under 128 kB. On the other hand, the ROM

19

120

30

in RAM in ROM

11

100

25

RAM size (kB)

10 80

4 20

9

3

60

8

15

40

7 5 10

10

20 0

0

in RAM in ROM

5

15

20

0

1000

(a) ROM/RAM and memory for EMPC

5 6 7

8

9

10

11

5

22 23 24 25

200 400 600 800 Flash / ROM size (kB)

2 1

0

50 100 Flash / ROM size (kB)

(b) Detail (max 128 kB ROM, 32 kB RAM)

Figure 6: Common 32-bit microcontrollers vs. memory requirements of the EMPC algorithm. Data annotations and markers refer to the horizon length.

variant of the EMPC controller with N = 10 step prediction horizon would only 410

need under 12 kB of RAM and 128 kB flash, which is a more typical hardware scenario—giving a range of options among similar mid-category devices. The only important remaining question to answer is the difference in execution times caused by moving the controller regions and laws into the read-only memory. Figure 7 shows the maximal execution times for both variants, along

415

with the average values with the standard deviation marked by the error bars. The number of regions is related to the TET on the vertical axis, while the number annotations at data points denote the horizon length. As it is visible in the figure, there is no significant measurable change between the two variants, therefore the flash memory storage of EMPC regions and laws is recommended

420

in modern embedded microcontroller units.

5. Conclusion A real-time embedded explicit model predictive vibration control scheme was presented here, with the aim of minimizing the tip deflection of a cantilever beam subjected to release tests emulating transient mechanical disturbances.

20

1200

11 10

Execution time (µs)

1000

9 8

800

7 6

600 5 400

RAM (max.) ROM (max.) RAM (avg.) ROM (avg.)

4 3

200 2 0

1 0

50

100 150 Regions (−)

200

250

Figure 7: Comparison of the algorithm task execution timing for RAM and ROM execution. Data annotations refer to the horizon length.

425

According to the experimental results presented in the article, EMPC may provide the same damping performance as a PPF controller, but with less inputs to the actuator. More importantly, the predictive vibration control method respects the process constraints, instead of simply saturating the actuator input. A comprehensive task execution timing and memory requirement summary was

430

given, showing that current microcontroller units are up to the challenge of running EMPC-based vibration control systems, in case the prediction model is simple and the prediction horizons are kept short. Moreover, we could not find a practically significant difference between the algorithm timing of RAM as compared to ROM storage of the EMPC look-up tables, suggesting that similar

435

control schemes should be implemented in the flash memory of the microcontroller, allowing the full economic utilization of the computing hardware. Based on the task execution timing of the EMPC controller, current microcontrollers may also hold significant reserves in computing speed, enabling the use of more complex models or faster sample times. Conversely, similar applications require

440

MCU only with modest clock-speed but relatively large internal or external flash storage capacity.

21

Acknowledgements The authors would like to gratefully acknowledge the financial support granted by the Slovak Research and Development Agency (APVV) under the contracts 445

APVV-14-0399, APVV-0090-10, APVV-14-0244 and APVV-0131-10. The authors would also like to thank the Scientific Grant Agency (VEGA) of the Ministry of Education, Science, Research and Sport of the Slovak Republic for their financial support provided under the contract 1/0144/15. The authors would like to thank for the financial assistance from the STU Grant scheme for the

450

Support of Excellent Teams of Young Researchers.

References [1] Alessandro Alessio and Alberto Bemporad. A survey on explicit model predictive control. In Lalo Magni, DavideMartino Raimondo, and Frank AllgÃűwer, editors, Nonlinear Model Predictive Control, volume 384 of Lec455

ture Notes in Control and Information Sciences, pages 345–369. Springer Berlin Heidelberg, 2009. [2] A. Bemporad, M. Morrari, V. Dua, and E. N. Pistikopoulos. The explicit solution of model predictive control via multiparametric quadratic programming. In Proceedings of the American control conference, pages

460

872–876, Chicago, June 2000. [3] Alberto Bemporad, Nikolaos A. Bozinis, Vivek Dua, Manfred Morari, and Efstratios N. Pistikopoulos. Model predictive control: A multi-parametric programming approach. In Sauro Pierucci, editor, European Symposium on Computer Aided Process Engineering-10, volume 8 of Computer Aided

465

Chemical Engineering, pages 301 – 306. Elsevier, 2000. [4] Alberto Bemporad, Manfred Morari, Vivek Dua, and Efstratios N. Pistikopoulos. The explicit linear quadratic regulator for constrained systems. Automatica, 38(1):3 – 20, 2002.

22

[5] Sergio Bittanti and Francesco A. Cuzzola. Periodic active control of vi470

brations in helicopters: a gain-scheduled multi-objective approach. Control Engineering Practice, 10(10):1043 – 1057, 2002. [6] Zhi cheng Qiu, Ming li Shi, Bin Wang, and Zhuo wei Xie. Genetic algorithm based active vibration control for a moving flexible smart beam driven by a pneumatic rod cylinder. Journal of Sound and Vibration, 331(10):2233 –

475

2256, 2012. [7] R. Y. Chiang and M. G. Safonov. Design of H∞ controller for a lightly damped system using a bilinear pole shifting transform. In American Con-

trol Conference, 1991, pages 1927 –1928, June 1991. [8] C. Edwards. The 8bit strikes back. Electronics Systems and Software, 480

5(2):36–39, April 2007. [9] K. W. Eure. Adaptive Predictive Feedback Techniques for Vibration Control. Doctoral dissertation, Virginia Polytechnic Institute and State University, Blacksburg, Virginia, United States of America, February 1998. [10] Giovanni Ferrari and Marco Amabili. Active vibration control of a sandwich

485

plate by non-collocated positive position feedback. Journal of Sound and Vibration, 342(0):44 – 56, 2015. [11] HansJoachim Ferreau, Christian Kirches, Andreas Potschka, HansGeorg Bock, and Moritz Diehl.

qpoases: a parametric active-set algorithm

forÂăquadratic programming. Mathematical Programming Computation, 490

6(4):327–363, 2014. [12] Michael G. Forbes, Rohit S. Patwardhan, Hamza Hamadah, and R. Bhushan Gopaluni. Model predictive control in industry: Challenges and opportunities.

IFAC-PapersOnLine, 48(8):531 – 538, 2015.

9th

{IFAC} Symposium on Advanced Control of Chemical Processes {AD495

CHEM} 2015Whistler, Canada, 7âĂŞ10 June 7 âĂŞ 10, 2015.

23

[13] G. F. Franklin, J. D. Powell, and M. L. Workman. Digital Control of Dynamic Systems. Addison-Wesley, Boston, MA, 3. edition, 1997. [14] Michael I Friswell and Daniel J Inman. The relationship between positive position feedback and output feedback controllers. Smart Materials and 500

Structures, 8(3):285, 1999. [15] Martin Gulan, Ngoc Anh Nguyen, Sorin Olaru, Pedro Rodriguez-Ayerbe, and Boris Rohal’-Ilkiv. Developments in Model-Based Optimization and Control: Distributed Control and Industrial Applications, chapter Implications of Inverse Parametric Optimization in Model Predictive Control,

505

pages 49–70. Springer International Publishing, Cham, 2015. [16] M. Herceg, M. Kvasnica, C.N. Jones, and M. Morari. Multi-Parametric Toolbox 3.0. In Proc. of the European Control Conference, pages 502–510, Zürich, Switzerland, July 17–19 2013. http://control.ee.ethz.ch/~mpt. [17] Daniel J. Inman. Vibration with control. John Wiley & Sons, Chichester,

510

England, October 2006. [18] A.F. Jahromi and A. Zabihollah. Linear quadratic regulator and fuzzy controller application in full-car model of suspension system with magnetorheological shock absorber. In 2010 IEEE/ASME International Conference on Mechatronics and Embedded Systems and Applications (MESA), pages 522

515

–528, July 2010. [19] B. Kouvaritakis, J.A. Rossiter, and J. Schuurmans. Efficient robust predictive control. IEEE Transactions on Automatic Control, 45(8):1545–1549, August 2000. [20] M. Kvasnica and M. Fikar. Clipping-based complexity reduction in explicit

520

mpc. Automatic Control, IEEE Transactions on, 57(7):1878–1883, July 2012.

24

[21] Jay H. Lee. Model predictive control: Review of the three decades of development. International Journal of Control, Automation and Systems, 9(3):415–424, 2011. 525

[22] L. Ljung. System Identification: Theory for the User. PTR Prentice Hall, Upper Saddle River, NJ., 2. edition, 1999. [23] J. M. Maciejowski. Predictive Control with Constraints. Prentice Hall, Upper Saddle River, NJ, September 2000. [24] D. Q. Mayne, J. B. Rawlings, C. V. Rao, and P. O. M. Scokaert. Con-

530

strained model predictive control: Stability and optimality. Automatica, 36(6):789–814, June 2000. [25] David Q. Mayne. Model predictive control: Recent developments and future promise. Automatica, 50(12):2967 – 2986, 2014. [26] Suk-Min Moon, Daniel G. Cole, and Robert L. Clark. Real-time implemen-

535

tation of adaptive feedback and feedforward generalized predictive control algorithm. Journal of Sound and Vibration, 294(1-2):82 – 96, 2006. [27] John E. Mottershead, Maryam Ghandchi Tehrani, Simon James, and Yitshak M. Ram. Active vibration suppression by pole-zero placement using measured receptances. Journal of Sound and Vibration, 311(3âĂŞ5):1391

540

– 1408, 2008. [28] D. Niederberger. Hybrid Systems: Computation and Control, volume 3414, chapter Design of Optimal Autonomous Switching Circuits to Suppress Mechanical Vibration, pages 511–525. Publisher Springer / Heidelberg, Berlin, 2005.

545

[29] A. Preumont. Vibration Control of Active Structures: An Introduction. Springer Netherlands, Dordrecht, 3. edition edition, 2011. [30] S. Joe Qin and Thomas A. Badgwell. A survey of industrial model predictive control technology. Control Engineering Practice, 11(7):733 – 764, 2003. 25

550

[31] J. B. Rawlings and D. Q. Mayne. Model Predictive Control: Theory and Design. Nob Hill Publishing, Madison, WI, 2009. [32] J. Richelot, J. Bordeneuve-Guibe, and V. Pommier-Budinger. Active control of a clamped beam equipped with piezoelectric actuator and sensor using generalized predictive control. In 2004 IEEE International Sympo-

555

sium on Industrial Electronics, volume 1, pages 583 – 588 vol. 1, May 2004. [33] J. A. Rossiter. Model-Based Predictive Control: A Practical Approach. CRC Press, Boca Raton, FL, 1. edition, June 2003. [34] Yasser Shoukry, M. Watheq El-Kharashi, and Sherif Hammad. An embedded implementation of the generalized predictive control algorithm applied

560

to automotive active suspension systems. Computers & Electrical Engineering, 39(2):512 – 529, 2013. [35] Zarhamdy Zain Suhail Kazi, Musa Mailah. Suppression of hand postural tremor via active force control method. [36] Gergely Takács and Boris Rohaľ-Ilkiv. Model Predictive Vibration Control:

565

Efficient constrained MPC vibration control for lightly damped mechanical systems. Springer, London, United Kingdom, 2012. [37] Gergely Takács and Boris Rohaľ-Ilkiv. Model predictive control algorithms for active vibration control: a study on timing, performance and implementation properties. Journal of Vibration and Control, 20(13):2061–2080,

570

September 2014. DOI: 10.1177/1077546313479993. [38] Yang Wang and S. Boyd. Fast model predictive control using online optimization. Control Systems Technology, IEEE Transactions on, 18(2):267– 278, March 2010. [39] A. Wills, D. Bates, A. Fleming, B. Ninness, and R. Moheimani. Application

575

of MPC to an active structure using sampling rates up to 25 kHz. In 44th IEEE Conference on Decision and Control, 2005 and 2005 European Control Conference. CDC-ECC ’05., pages 3176 – 3181, December 2005. 26

[40] A. G. Wills, D. Bates, A. J. Fleming, B. Ninness, and S. O. R. Moheimani. Model predictive control applied to constraint handling in active noise 580

and vibration control. IEEE Transactions on Control Systems Technology, 16(1):3–12, 2008.

27