Model Based Predictive Control over Wireless Sensor

0 downloads 0 Views 2MB Size Report
open loop networked system it is imperative that the MPC scheme should be implemented within an adaptive framework, based on the recursive networked ...
Model Based Predictive Control over Wireless Sensor and Actuator Networks P. Gil1, 2, A. Paulo1, L. Palma1, A. Amâncio2,3 and A. Cardoso2 1

Departamento de Engenharia Electrotécnica, Faculdade de Ciências e Tecnologia Universidade Nova de Lisboa, Campus de Caparica, Lisbon, Portugal, [email protected] 2

Centre for Informatics and Systems of the University of Coimbra Department of Informatics Engineering, University of Coimbra, Coimbra, Portugal 3

Instituto Superior de Engenharia de Coimbra, Coimbra, Portugal

Abstract — Model based predictive control over wireless sensor and actuator networks is considered. To deal with time varying round trip latencies and data dropout it is proposed a formulation where the true open loop networked system dynamics is approximated using recursive identification techniques based on the dual unscented Kalman filter. Experimental results using a testbed show the relevance of the implemented approach. Keywords: Wireless sensor and actuator networks, round trip latencies, packet loss, model based predictive control, distribution approximation Kalman filter.

I.

INTRODUCTION

Over the last decade, wireless sensor networks (WSANs) have emerged as one of the key growth areas for pervasive computing (see e.g. [1]), in part instigated by the recent developments on smart transducers and actuators [2]. They consist of a set of small, low-cost nodes, deployed over the area of interest, along with several sink nodes or gateways. Basically, each node includes a microcontroller, memory, radio transceiver, power supply unit, one or more transducers, such as, temperature, light, humidity or vibration, among others currently available in the market, and, in some cases, an attached actuator. In addition, motes may also come with free A/D converters (ADC) and D/A converters (DAC) ports where external appliances, such as transmitters and actuators can be connected. Given their inherent features, namely, little infrastructure requirements, flexibility, scalability, mobility and lower aggregated costs than their wired counterparts, WSANs exhibit great potential in a myriad of applications and environments, ranging from biosignals monitoring (see e.g. [3]), intrusion detection and surveillance (see e.g. [4]) to supervision of systems (see e.g. [5]), just to name out a few. Likewise multipurpose wired digital networks, the physical integration of WSANs to interconnecting sensors, actuators and controllers raises new challenges, comparing to standard digital control systems, namely,

limited bandwidth of forward and feedback channels, varying end-to-end latencies and data dropout (see [6] for a comprehensive survey on the subject). Depending on the network configuration, available bandwidth and packet loss profile, round trip delays can exhibit stochastic behaviour or stepwise changing mean, and may additionally cause sampling rate variation [8]. Ultimately, both effects give rise to a time-varying open loop system, whose behaviour must be taken into account at the control design stage, for the sake of closed loop performance and stability. The problem of closed loop control over a digital network (NCS) has been widely studied over the last decade. The main approach to the problem has been mostly based on the abstraction of the network and nodes, by considering the digital network as a finite bandwidth communication channel, where round trip latencies are assumed as a stochastic process or presenting arbitrary time-varying behaviour, and packet loss is described in terms of probability distribution (see e.g. [9]). In [10] the authors propose a receding horizon approach to deal with both control and measurement quantization issues, focusing on a trade off between computational complexity and performance. In order to compensate for nondeterministic transmission delays in an Ethernet based NCS, Tang and Silva [11] proposed an extension to the Generalized Predictive Control (GPC) algorithm, relying on a minimum-effort estimator in order to estimate missing or delayed sensor data, and on a varying predictive horizon. Liu et al. [12] combined a networked predictive control with a networked delay compensator in the forward channel to deal with random delays and data dropouts, while in [13] it is suggested a framework for analysing the stability of nonlinear NCSs with disturbances in the setting of Lp stability. In order to deal with time-varying delays in uncertain NCSs, Wang et al. [14] presented an iterative algorithm involving convexoptimization to design controllers with suboptimal

guaranteed cost. Motivated by the need of providing some degree of resilience to NCS over WSN, Ulusoy et al. [15] consider cooperative communications for enhancing the quality of wireless link, which contributes to reducing packet dropouts and latencies. Instead of relying on prior considerations for communication latencies and packet loss models in a finite bandwidth channel environment the present work follows a different direction, assuming the corresponding models are unknown [16]. The instrumental motivation behind the proposed approach is, to some extent, propped up on the notion that the true open loop networked system dynamics, including both forward and feedback communication channels, can be regarded as an unknown time-varying stochastic process. Furthermore, it is explicitly considered a non-synchronized distributed network where every node has its own internal clock with unknown offset, referred to the base station (BS) time, and skew, and all readings are referred to the corresponding sensor nodes’ internal clock (see e.g. [17]). Unlike focusing on to control the plant, regarded as a NCS’s subsystem, the proposed approach aims at maintaining the closed loop networked system stable, and following a predefined trajectory, while implicitly accepting a certain degree of performance degradation, which is inevitable due to model/plant mismatch. The networked system dynamics is approximated using inputoutput data collected on the server side within a recursive nonlinear regression framework. II.

NETWORKED SYSTEM IDENTIFICATION

Since the true nonlinear analytical model for the open loop networked system of Fig. 1 is considered to be unknown the underlying system dynamics is approximated using nonlinear regression techniques. In addition, because the NCS is assumed time varying, the black box model’s parameters have to be recursively updated over time in order to cope with dynamics change. The updating algorithm implemented in this work relies on a dual Kalman filter based on the Unscented Transformation (DUKF) (see e.g. [18]). Consider for online identification purposes the following state-space nonlinear black box structure:

% x k +1 = f ! x k ,u k ,w f k ,k # + ! k " $ ' & ' z k = g ! x k ,u k ,w g k ,k # + ! k " $ (

(

()

)

() ()

() () ()

()

()

()

(1)

where x ! R n denotes the state vector, u ! R m is the input vector, z ! R p is the noisy output vector sampled on the server side, which differs from the plant output at the instant ! due to transmission latencies and sampling artifacts, such as outliers and noise corruption of measurements, f (!) and g(!) are real vector valued nonlinear functions, with parameterisations w f and w g ; ! ! R n and ! ! R p are random variables representing the process and measurement noise, respectively.

WSAN

Plant Actuator node

Sensor node

Fig. 1 – NCS over WSAN schematics.

The DUKF provides estimates for both states and model parameters in two distinctive stages. The first step, concerning the time update, delivers a priori predictions for the parameterization vector and state-space vector. Subsequently, in the measurement-based update, a correction is provided to these estimates taking into account current readings. The dual Kalman filter equations are as follows: Weights estimation Time update:

(

)

(

)

!i k | k "1 = !i k "1| k "1

(2)

Pw k | k !1 = Pw k !1| k !1 + "

(

(3)

Ziw ( k | k !1) = ! #$ xˆ ( k !1| k !1), u ( k !1), "i ( k | k !1), k %&

(4)

)

(

(

)

zˆw k | k !1 = # Pzw k | k !1 = '

(

)

2 Nw i=0

)

2 Nw i=0

" iw Ziw k | k !1

(

)

{" #$Z (k | k !1) ! zˆ (k | k !1)%& w i

w i

w

T) (#$Ziw k | k !1 ! zˆw k | k !1 %& * + , +

(

(

)

Pwz k | k !1 = (

2 Nw i=0

)

(

(6)

)

{" $%# (k | k !1) ! wˆ (k | k !1)&' w i

i

T* )$%Ziw k | k !1 ! zˆw k | k !1 &' + ,

(

(5)

)

(

)

(7)

Correction: !1

K w k = Pwz k | k !1 "# Pzw k | k !1

%$()

(

)

(

)

(8)

wˆ k | k = wˆ k | k !1 + K w k "# z k ! zˆw k | k !1

%$( )

(

)

() ()

(

)

) ( ( ))

Pw k | k = Pw k | k !1 ! K w k P wz k | k !1 K w k

( )

(

)

(9)

() (

T

(10)

States estimation Time update:

X i k | k !1 = f "#X i k !1| k !1 ,u k !1 ,

(

)

(

) (

)

(11)

wˆ k !1| k !1 ,k

%$(

xˆ k | k !1 = #

(

(

)

2 Nx

)

2 Nx

" ix X i k | k !1

(

i=0

)

(12)

{" #$X (k | k !1) ! xˆ (k | k !1)%& (#$X ( k | k !1) ! xˆ ( k | k !1)%&} + )

)

Px k | k !1 = '

x i

i=0

i

(13)

i

Zix k | k !1 = g "#X i k | k !1 ,u k !1 ,

(

)

(

) (

)

(14)

wˆ k !1| k !1 ,k

%$(

(

)

zˆx k | k !1 = # Pzx k | k !1 = '

(

)

2 Nx i=0

)

2 Nx

" ix Zix k | k !1

(

i=0

)

(15)

{" #$Z (k | k !1) ! zˆ (k | k !1)%& x i

x i

x

(16)

T) (#$Zix k | k !1 ! zˆx k | k !1 %& * + , +

(

(

)

Pxz k | k !1 = '

)

2 Nx

(

)

{" #$X (k | k !1) ! xˆ (k | k !1)%& x i

i=0

i

(17)

) (#$Zix k | k !1 ! zˆx k | k !1 %& * +

(

)

(

)

T

Correction: !1

K x k = Pxz k | k !1 "# Pzx k | k !1

%$()

(

) (

)

(18)

xˆ k | k = xˆ k | k !1 + K x k "# z k ! zˆx k | k !1

%$( ) (

)

() ()

(

)

) ( ( ))

Px k | k = Px k | k !1 ! K w k Pzx k | k !1 K x k

( )

(

)

() (

(19)

T

(20)

where Γ is the vector of weights, K the Kalman gain, Υ denotes the measurement noise variance, ! and ! process noise variances, !(!) a real-value nonlinear function, and ! and X are the sigma points matrix of the vectorized parameterization ! and state x, respectively. III.

MODEL BASED PREDICTIVE CONTROL

Model-based predictive control (MPC) is a discretetime technique where an explicit dynamic model of the plant is considered to predict the system’s outputs over a finite prediction horizon !, while control actions are manipulated throughout a finite control horizon ! in order to minimize a given cost function. When the MPC is integrated in a NCS framework the optimizer computes the constrained optimal open-loop sequence of control actions such that the predicted outputs follow a predefined trajectory. In most receding schemes only the current control action u(k | k) is sent to the plant through the wireless network. Next, at discrete time k +1 the prediction and control horizons are shifted ahead by one step and a new optimisation problem is solved, using the most recent measurements collected by sensor nodes attached to transmitters and available on the server. Owing to the unknown time-varying behaviour of the open loop networked system it is imperative that the MPC scheme should be implemented within an adaptive framework, based on the recursive networked system identification. Given the online adjusting of the model parameters it is plausible to approximate the local networked system dynamics by using a linear model structure. Let the local linear discrete-time dynamic system be described in the state-space form as follows:

( ) () y ( k ) = Cx ( k )

()

x k +1 = Ax k + Bu k

(21)

where A ! R n"n , B ! R n"m and C ! R p"n are the state, input and output matrices; x ! R n is the state vector; u ! R m is the control vector; y ! R p the output vector. Considering a 2-norm for the cost function and linear constraints on the system’s inputs and outputs, and bounds on the rate of change of control actions, the openloop optimization problem can be stated as follows [19]:

# P min $" y k + i | k ! r k + i i=1 u %

(

+"

P!1 i=1

) (

(

u k +i |k

)

2

)

+"

Ri

IV.

2 Qi

M !1 i=1

(22)

' &u k + i ( Qi )

(

)

2

subject to the system dynamics (21) and to the following constraints:

( ) ! u (k + i | k ) ! u

ymin ! y k + i | k ! ymax ,i = 1,…, P,k " 0 umin

max

(

)

(

)

,i = 1,…, P #1,k " 0 (23)

$u k + i | k ! $umax ,i = 1,…, M #1,k " 0

EXPERIMENTS ON A TESTBED

This section aims to evaluate experimentally the proposed approach to deal with the problem of communication round trip latencies and unknown open loop dynamics in the context of NCS. A. Testbed Setup The testbed used in the experiments consisted of a Feedback® Process Trainer PCT 37−100 (Fig. 2) interconnected with the control station through a wireless communication network.

$u k + i | k = 0,i = M ,…, P #1,k " 0 with Qi ! R p" p , Ri , Si ! R m"m ; !u " R m is the control vector increment and r ! R p the reference signal. Since the optimization problem is convex then any particular solution is a global minimum. As such, the open-loop optimal control problem can be restated as a quadratic programming problem,

" % 1 min # J !u! = hT !u! + H !u! & !u! 2 $ '

( )

(24)

s.t. G ( d

Fig. 2 – Process Trainer PCT 37−100.

T

with G ! R

(

mM " 4mM +2 pP

)

, d !R(

4mM +2 pP

)

and !u " R mM

is the extended control increments over the control horizon. The gradient h ! " R mM of the cost function

()

and the Hessian H ! R mM "mM are given by [19]:

/1 ) P!1 # T i! j+1 &, h Tj = 2 0 x0T +" % CAi+1 Qi+1 " CAq (. B q=0 '12 * i= j!1$

(

)

i! j+1 P!1 ) P!1 , !+" r T i +1 Qi+1 " CAq . B + u0T " Ri q=0 i=0 * i= j!1 -

( )

}

(25)

( j = 1,…, M ) T 1/ P. j ( i " i %+ H jj = 2 0 B T ! *! $ CAq Qi+1 ! CAq '- B q=0 q=0 q=0 # &, ) 21

( )

+! H

jp

P.1 i= j.1

}

Ri + S j.1 ,

(26)

( j = 1,…, M )

/1 T P! j ) i! j+1# i! p+1 &, = 2 0 B T " +" % CAq Qi+1 " CAq (. B i= j!1 q=0 $ q=0 '12 *

B. Experiments

( )

+"

P!1 i= j!1

}

Ri ,

(i, j = 1,…, M ; j 3 p)

The Process Trainer comprises a variable-speed axial fan, regulated via a potentiometer, that circulates an airstream along a polypropylene tube. The airflow rate is heated by means of a heating element controlled by a thyristor circuit. A thermistor detector is incorporated to sensing the temperature at the insertion point. Concerning the wireless communication network it is implemented by deploying a number of Crossbw® TelosB motes over the area, in a way messages sent from the sensor node could reach the BS and messages stemming from the BS could be delivered to the actuator node. The Telos-B nodes are equipped with the radio controller Chipcon CC2420 operating at 2.4 GHz and using the communication standard IEEE 802.15.4. The implementation was based on the Contiki OS and Rime communication stack, while messages consisted of 38byte payload with 8-byte header, which includes the sender and destination addresses, message sequence number, hops and a control identifier.

(27)

In the experiments carried out and reported in this work it was intended to control the airstream temperature by manipulating the input voltage to the heater grid. The default fan speed was adjusted to 5, the sampling time set

#Q = 20 ! i = 1,…, P % i % $ Ri = 10"5 ! i = 1,…, P "1 % %Qi = 200 ! i = 1,…, M "1 &

(28)

sending just the current control action, sends a sequence of 10 control actions to the wireless actuator obtained from the optimization procedure. Notice that the prediction horizon was chosen as 10 time steps. Temperatura [ºC]

to 0.1 second, the prediction horizon was chosen as ! = 10 and the control horizon ! = 5 time steps. Regarding the performance index weight matrices they were chosen as:

#0 ! y ! +60º C % % $0 ! u ! +10V % % "u ! +0.5V &

(29)

Output Reference

40 35 30 5

10

15

20

25 Time [s]

30

35

40

3 2 1 10

15

20

25 Time [s]

30

35

40

10

15

20

25 30 Time [s]

35

40

45

5

10

15

20

25 30 Time [s]

35

40

45

5 4 3 2 1

45

Output Reference

40 35 30 25 0

5

10

15

20

25 30 Time [s]

35

40

45

5

10

15

20

25 30 Time [s]

35

40

45

5 4 3 2 1 0 0

5

5

The last experiment concerns the implementation of an adaptive MPC scheme based on recursive updating of the networked state-space model parameters, according to the framework presented in section II.

Input [V]

4

Input [V]

25 0

45

5

0 0

30

Fig. 4 – Non-adaptive MPC over WSAN.

Temperature [ºC]

Temperature [ºC]

45

25 0

35

0 0

In order to have a basis of comparison for assessing the proposed approach the MPC scheme was first implemented on the plant considering a peer-to-peer interconnection over a DAQ board. The corresponding system output and control actions, for a user defined reference signal is presented in Fig. 3.

Output Reference

40

Input [V]

Additionally, it was imposed the following hard constraints to the optimization problem:

45

45

Fig. 3 – Adaptive MPC over DAQ.

The next experiment concerns the application of MPC over a WSAN in an environment where adaptation is not considered, and using a fixed-parameters networked state-space model. Fig. 4 presents the NCS time response considering the same reference signal as the one used in the preceding experiment. As can be observed, the system output is far noisier than that obtained by using DAQ interconnection. In addition, it is clear the difference in terms of time constant for the closed loop response. However, this has mainly to do with the way the implementation has been handled. In fact, because the sampling time is rather stringent (0.1s) compared to the transmission period (1s) the base station, instead of

Fig. 5 – Adaptive MPC over WSAN.

The results presented in Fig. 5 suggest that the rationale proposed to deal with uncertainties regarding the plant dynamics and round trip delays contributes to a general improvement from the closed loop performance point of view, not only in terms of static error but also in what its variance is concerned. In order to enable a comparative assessment in terms of performance for both MPC based NCS over WSAN schemes, the root mean square of error (RMSE) given according to equation (30) is considered, along with the control error variance.

N

RMSE =

T

&"# y ( k ) ! r ( k )$% k=1

N

"y k ! r k $ # %

() ()

T

[6]

(30)

&"#r ( k )$% "#r ( k )$% k=1

As can be inferred from Table I the incorporation of adaptiveness into the MPC based NCS contributes to improving the NCS performance by allowing mitigating both the static offset and the control error variance. TABLE I PERFORMANCE METRICS. NCS RMSE Variance Adaptive MPC 3.83% 1.79 Non-Adaptive MPC 5.85% 1.93 V.

CONCLUSION

This paper addressed the problem of remote control over a wireless sensor and actuator network where inherent round trip latencies and packet loss impact the closed loop performance. To accommodate these effects it is proposed an adaptive model based predictive control relying on the recursive approximation of the overall networked system dynamics, including time delays and packets loss effects. Results on a testbed demonstrate the effectiveness of the proposed approach. ACKNOWLEDGMENT This work has been supported by the European Commission under the contract FP7-ICT-224282 (GINSENG).

[7]

[8]

[9]

[10]

[11]

[12]

[13]

[14]

[15]

[16]

[17]

REFERENCES [1]

[2]

[3]

[4]

[5]

Y. Zheng, J. Cao, A. Chan and K. Chan, “Sensors and Wireless Sensor Networks for Pervasive Computing Applications,” Journal of Ubiquitous Computing and Intelligence, vol. 1, pp. 17−34, 2007. J. Yick, B. Mukherjee and D. Ghosal, “Wireless sensor network survey,” Computers Networks, vol. 52, pp. 2292−2330, 2008. S. Junnila, H. Kailanto, J. Merilahti, A-M. Vainio, A. Vehkaoja, M. Zakrzewski and J. Hyttinen, “Wireless, Multipurpose In-Home Health Monitoring Platform: Two Case Trials,” IEEE Trans. Inform. Tech. in Biomedicine, vol. 14, pp. 447−455, 2010. X. Wang, S. Wang and D. Bi, “Distributed Visual-TargetSurveillance System in Wireless Sensor Networks,” IEEE Trans. Syst., Man, Cyber.−Part B: Cybernetics, vol. 39, pp. 1134−1146, 2010. F. Salvadori, M. Campos, P. Sausen, R. Camargo, C. Gehrke, C. Rech, M. Spohn and A. Oliveira, “Monitoring in Industrial Systems Using Wireless Sensor Network with

[18]

[19]

Dynamic Power Management,” IEEE Trans. on Inst. and Measurement, vol. 58, pp. 3104−3111, 2009. J. Hespanha, P. Naghshtabrizi and Y. Xu, “A Survey of Recent Results in Networked Control Systems,” Proceedings of the IEEE, vol. 95, pp. 138−162, 2007. J. Colandairaj, G. Irwin and W. Scanlon, “Analysis of an IEEE 802.11b Wireless Network Control System,” in First Workshop on NCS and Fault Tolerance Control, Ajaccio, France, October, 2005. E. Martins and F. Jota, “Design of Network Control Systems with Explicit Compensation for Time-Delay Variations,” IEEE Trans. Syst, Man, Cybern.- Part C: Appl. Rev., vol. 40, pp. 308−318, 2010. M. Cloosterman, L. Hetel, N. Wouw, W. Heemel, J. Daafouz and H. Nijmeijer, “Controller Synthesis for Networked Control Systems,” Automatica, vol. 46, pp. 1584−1594, 2010. G. Goodwin, H. Haimovich, D. Quevedo and J. Welsh, “A Moving Horizon Approach to Networked Control System Design,” IEEE Trans. Automat. Contr., vol. 49, pp. 1427−1445, 2004. P. Tang and C. Silva, “Compensation for Transmission Delays in an Ethernet-Based Control Neteork Using Variable-Horizon Predictive Control,” IEEE Trans. Contr., Syst. Technol., vol. 14, pp. 707−718, 2006. G.–P. Liu, Y. Xia, J. Chen, D. Rees and W. Hu, “Networked Predictive Control of Systems with Random Delays in both Forward and Feedback Channels,” IEEE Trans. Ind., Electron., vol. 54, pp. 1282−1297, 2007. M. Tabbara, D. Nešcić and A. Teel, “Stability of Wireless and Wireline Networked Control Systems,” IEEE Trans. Automat. Contr., vol. 52, pp. 1615−1630, 2007. R. Wang, G.−P. Liu, W. Wang and Y. Zhao, “Guaranteed Cost Control for Networked Control Systems Based on an Improved Predictive Control Method,” IEEE Trans. Contr., Syst. Technol., vol. 18, pp. 1226−1232, 2010. A. Ulusoy, O. Gurbuz and A. Onat, “Wireless ModelBased Predictive Networked Control System over Cooperative Wireless Network,” IEEE Trans. Ind. Informat., vol. 7, pp. 41−51, 2011. J. Wang, W. Zheng and T. Chen, “Identification of linear dynamic systems operation in a networked environment,” Automatica, vol. 45, pp. 2763−2772, 2009. A. Santos, G. Nunes, P. Gil and A. Cardoso, “Multi-Agent Platform in WSAN Applications: A Time Synchronization Perspective,” in Proc. 5th International Conference on Management and Control of Production and Logistics, 2010. S. julier, J. Uhlmann and F. Durrant-Whyte, “A New Method for Nonlinear Transformation of Means and Covariances in Filter and Estimators,” IEEE Trans. Automat. Contr., vol. 45, pp. 477−482, 2000. P. Gil, J. Henriques, P. Carvalho, H. Duarte-Ramos and A. Dourado, “Adaptive Neural Model-Based Predictive Control with Steady State Compensation for a Distributed Solar Collector Field,” in Proc. IEEE International Conference on Neural Networks & Signal Processing, Nanjing, China, Dec. 14-17, 2002.